
int hmac_file(int hash,char *fname,uchar *key,ulong keylen,uchar *out,ulong *outlen)

{
  long lVar1;
  int iVar2;
  int iVar3;
  uchar *in;
  FILE *__stream;
  size_t inlen;
  long in_FS_OFFSET;
  hmac_state hmac;
  
  lVar1 = *(long *)(in_FS_OFFSET + 0x28);
  if (fname == (char *)0x0) {
                    /* WARNING: Subroutine does not return */
    crypt_argchk("fname != NULL","src/mac/hmac/hmac_file.c",0x2f);
  }
  if (key == (uchar *)0x0) {
                    /* WARNING: Subroutine does not return */
    crypt_argchk("key != NULL","src/mac/hmac/hmac_file.c",0x30);
  }
  if (out == (uchar *)0x0) {
                    /* WARNING: Subroutine does not return */
    crypt_argchk("out != NULL","src/mac/hmac/hmac_file.c",0x31);
  }
  if (outlen == (ulong *)0x0) {
                    /* WARNING: Subroutine does not return */
    crypt_argchk("outlen != NULL","src/mac/hmac/hmac_file.c",0x32);
  }
  in = (uchar *)malloc(0x2000);
  if (in == (uchar *)0x0) {
    iVar2 = 0xd;
  }
  else {
    iVar2 = hash_is_valid(hash);
    if (iVar2 == 0) {
      iVar2 = hmac_init(&hmac,hash,key,keylen);
      if (iVar2 == 0) {
        __stream = fopen(fname,"rb");
        if (__stream == (FILE *)0x0) {
          iVar2 = 0x11;
        }
        else {
          do {
            inlen = fread(in,1,0x2000,__stream);
            iVar2 = hmac_process(&hmac,in,inlen);
            if (iVar2 != 0) {
              fclose(__stream);
              goto LAB_001614b0;
            }
          } while (inlen == 0x2000);
          iVar2 = 1;
          iVar3 = fclose(__stream);
          if (iVar3 == 0) {
            iVar2 = hmac_done(&hmac,out,outlen);
          }
LAB_001614b0:
          zeromem(in,0x2000);
        }
      }
    }
    free(in);
  }
  if (lVar1 == *(long *)(in_FS_OFFSET + 0x28)) {
    return iVar2;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail();
}



int hmac_file(undefined4 param_1,char *param_2,long param_3,undefined8 param_4,long param_5,
             long param_6)

{
  int iVar1;
  int iVar2;
  void *__ptr;
  FILE *__stream;
  size_t sVar3;
  long in_FS_OFFSET;
  undefined1 local_398 [856];
  long local_40;
  
  local_40 = *(long *)(in_FS_OFFSET + 0x28);
  if (param_2 == (char *)0x0) {
                    /* WARNING: Subroutine does not return */
    crypt_argchk("fname != NULL","src/mac/hmac/hmac_file.c",0x2f);
  }
  if (param_3 == 0) {
                    /* WARNING: Subroutine does not return */
    crypt_argchk("key != NULL","src/mac/hmac/hmac_file.c",0x30);
  }
  if (param_5 == 0) {
                    /* WARNING: Subroutine does not return */
    crypt_argchk("out != NULL","src/mac/hmac/hmac_file.c",0x31);
  }
  if (param_6 == 0) {
                    /* WARNING: Subroutine does not return */
    crypt_argchk("outlen != NULL","src/mac/hmac/hmac_file.c",0x32);
  }
  __ptr = malloc(0x2000);
  if (__ptr == (void *)0x0) {
    iVar1 = 0xd;
  }
  else {
    iVar1 = hash_is_valid(param_1);
    if (iVar1 == 0) {
      iVar1 = hmac_init(local_398,param_1,param_3,param_4);
      if (iVar1 == 0) {
        __stream = fopen(param_2,"rb");
        if (__stream == (FILE *)0x0) {
          iVar1 = 0x11;
        }
        else {
          do {
            sVar3 = fread(__ptr,1,0x2000,__stream);
            iVar1 = hmac_process(local_398,__ptr,sVar3);
            if (iVar1 != 0) {
              fclose(__stream);
              goto LAB_001614b0;
            }
          } while (sVar3 == 0x2000);
          iVar1 = 1;
          iVar2 = fclose(__stream);
          if (iVar2 == 0) {
            iVar1 = hmac_done(local_398,param_5,param_6);
          }
LAB_001614b0:
          zeromem(__ptr,0x2000);
        }
      }
    }
    free(__ptr);
  }
  if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {
    return iVar1;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail();
}


PUSH R15
PUSH R14
PUSH R13
PUSH R12
PUSH RBP
PUSH RBX
SUB RSP,0x388
MOV qword ptr [RSP + 0x18],RCX
MOV qword ptr [RSP + 0x8],R9
MOV RAX,qword ptr FS:[0x28]
MOV qword ptr [RSP + 0x378],RAX
XOR EAX,EAX
TEST RSI,RSI
JZ 0x00161543
MOV RBP,RDX
TEST RDX,RDX
JZ 0x0016152b
MOV R14,R8
TEST R8,R8
JZ 0x00161513
CMP qword ptr [RSP + 0x8],0x0
JZ 0x00161560
MOV R12D,EDI
MOV EDI,0x2000
MOV R13,RSI
CALL 0x001141b0
MOV RBX,RAX
TEST RAX,RAX
JZ 0x001614c8
MOV EDI,R12D
CALL 0x00113bd0
MOV R15D,EAX
TEST EAX,EAX
JZ 0x00161430
MOV RDI,RBX
CALL 0x00113130
MOV RCX,qword ptr [RSP + 0x378]
XOR RCX,qword ptr FS:[0x28]
MOV EAX,R15D
JNZ 0x0016155b
ADD RSP,0x388
POP RBX
POP RBP
POP R12
POP R13
POP R14
POP R15
RET
MOV RCX,qword ptr [RSP + 0x18]
LEA RDI,[RSP + 0x20]
MOV RDX,RBP
MOV ESI,R12D
MOV qword ptr [RSP + 0x10],RDI
CALL 0x00114c70
MOV R15D,EAX
TEST EAX,EAX
JNZ 0x001613f6
LEA RSI,[0x1bd949]
MOV RDI,R13
CALL 0x001148b0
MOV RBP,RAX
TEST RAX,RAX
JNZ 0x00161479
JMP 0x00161508
CMP R12,0x2000
JNZ 0x001614d8
MOV RCX,RBP
MOV EDX,0x2000
MOV ESI,0x1
MOV RDI,RBX
CALL 0x00113480
MOV RDI,qword ptr [RSP + 0x10]
MOV RSI,RBX
MOV RDX,RAX
MOV R12,RAX
CALL 0x00113560
MOV R15D,EAX
TEST EAX,EAX
JZ 0x00161470
MOV RDI,RBP
CALL 0x00113700
MOV ESI,0x2000
MOV RDI,RBX
CALL 0x00114e10
JMP 0x001613f6
MOV R15D,0xd
JMP 0x001613fe
MOV RDI,RBP
MOV R15D,0x1
CALL 0x00113700
TEST EAX,EAX
JNZ 0x001614b0
MOV RDX,qword ptr [RSP + 0x8]
MOV RDI,qword ptr [RSP + 0x10]
MOV RSI,R14
CALL 0x001145b0
MOV R15D,EAX
JMP 0x001614b0
MOV R15D,0x11
JMP 0x001613f6
MOV EDX,0x31
LEA RSI,[0x1cb210]
LEA RDI,[0x1b77e1]
CALL 0x00114270
MOV EDX,0x30
LEA RSI,[0x1cb210]
LEA RDI,[0x1d547d]
CALL 0x00114270
MOV EDX,0x2f
LEA RSI,[0x1cb210]
LEA RDI,[0x1bd92c]
CALL 0x00114270
CALL 0x00113880
MOV EDX,0x32
LEA RSI,[0x1cb210]
LEA RDI,[0x1bd93a]
CALL 0x00114270
(translation_unit "int hmac_file(undefined4 param_1,char *param_2,long param_3,undefined8 param_4,long param_5,\n             long param_6)\n\n{\n  int iVar1;\n  int iVar2;\n  void *__ptr;\n  FILE *__stream;\n  size_t sVar3;\n  long in_FS_OFFSET;\n  undefined1 local_398 [856];\n  long local_40;\n  \n  local_40 = *(long *)(in_FS_OFFSET + 0x28);\n  if (param_2 == (char *)0x0) {\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("fname != NULL","src/mac/hmac/hmac_file.c",0x2f);\n  }\n  if (param_3 == 0) {\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("key != NULL","src/mac/hmac/hmac_file.c",0x30);\n  }\n  if (param_5 == 0) {\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("out != NULL","src/mac/hmac/hmac_file.c",0x31);\n  }\n  if (param_6 == 0) {\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("outlen != NULL","src/mac/hmac/hmac_file.c",0x32);\n  }\n  __ptr = malloc(0x2000);\n  if (__ptr == (void *)0x0) {\n    iVar1 = 0xd;\n  }\n  else {\n    iVar1 = hash_is_valid(param_1);\n    if (iVar1 == 0) {\n      iVar1 = hmac_init(local_398,param_1,param_3,param_4);\n      if (iVar1 == 0) {\n        __stream = fopen(param_2,"rb");\n        if (__stream == (FILE *)0x0) {\n          iVar1 = 0x11;\n        }\n        else {\n          do {\n            sVar3 = fread(__ptr,1,0x2000,__stream);\n            iVar1 = hmac_process(local_398,__ptr,sVar3);\n            if (iVar1 != 0) {\n              fclose(__stream);\n              goto LAB_001614b0;\n            }\n          } while (sVar3 == 0x2000);\n          iVar1 = 1;\n          iVar2 = fclose(__stream);\n          if (iVar2 == 0) {\n            iVar1 = hmac_done(local_398,param_5,param_6);\n          }\nLAB_001614b0:\n          zeromem(__ptr,0x2000);\n        }\n      }\n    }\n    free(__ptr);\n  }\n  if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return iVar1;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail();\n}\n\n" (function_definition "int hmac_file(undefined4 param_1,char *param_2,long param_3,undefined8 param_4,long param_5,\n             long param_6)\n\n{\n  int iVar1;\n  int iVar2;\n  void *__ptr;\n  FILE *__stream;\n  size_t sVar3;\n  long in_FS_OFFSET;\n  undefined1 local_398 [856];\n  long local_40;\n  \n  local_40 = *(long *)(in_FS_OFFSET + 0x28);\n  if (param_2 == (char *)0x0) {\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("fname != NULL","src/mac/hmac/hmac_file.c",0x2f);\n  }\n  if (param_3 == 0) {\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("key != NULL","src/mac/hmac/hmac_file.c",0x30);\n  }\n  if (param_5 == 0) {\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("out != NULL","src/mac/hmac/hmac_file.c",0x31);\n  }\n  if (param_6 == 0) {\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("outlen != NULL","src/mac/hmac/hmac_file.c",0x32);\n  }\n  __ptr = malloc(0x2000);\n  if (__ptr == (void *)0x0) {\n    iVar1 = 0xd;\n  }\n  else {\n    iVar1 = hash_is_valid(param_1);\n    if (iVar1 == 0) {\n      iVar1 = hmac_init(local_398,param_1,param_3,param_4);\n      if (iVar1 == 0) {\n        __stream = fopen(param_2,"rb");\n        if (__stream == (FILE *)0x0) {\n          iVar1 = 0x11;\n        }\n        else {\n          do {\n            sVar3 = fread(__ptr,1,0x2000,__stream);\n            iVar1 = hmac_process(local_398,__ptr,sVar3);\n            if (iVar1 != 0) {\n              fclose(__stream);\n              goto LAB_001614b0;\n            }\n          } while (sVar3 == 0x2000);\n          iVar1 = 1;\n          iVar2 = fclose(__stream);\n          if (iVar2 == 0) {\n            iVar1 = hmac_done(local_398,param_5,param_6);\n          }\nLAB_001614b0:\n          zeromem(__ptr,0x2000);\n        }\n      }\n    }\n    free(__ptr);\n  }\n  if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return iVar1;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail();\n}" primitive_type (function_declarator "hmac_file(undefined4 param_1,char *param_2,long param_3,undefined8 param_4,long param_5,\n             long param_6)" identifier (parameter_list "(undefined4 param_1,char *param_2,long param_3,undefined8 param_4,long param_5,\n             long param_6)" ( (parameter_declaration "undefined4 param_1" type_identifier identifier) , (parameter_declaration "char *param_2" primitive_type (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "long param_3" (sized_type_specifier "long" long) identifier) , (parameter_declaration "undefined8 param_4" type_identifier identifier) , (parameter_declaration "long param_5" (sized_type_specifier "long" long) identifier) , (parameter_declaration "long param_6" (sized_type_specifier "long" long) identifier) ))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  void *__ptr;\n  FILE *__stream;\n  size_t sVar3;\n  long in_FS_OFFSET;\n  undefined1 local_398 [856];\n  long local_40;\n  \n  local_40 = *(long *)(in_FS_OFFSET + 0x28);\n  if (param_2 == (char *)0x0) {\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("fname != NULL","src/mac/hmac/hmac_file.c",0x2f);\n  }\n  if (param_3 == 0) {\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("key != NULL","src/mac/hmac/hmac_file.c",0x30);\n  }\n  if (param_5 == 0) {\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("out != NULL","src/mac/hmac/hmac_file.c",0x31);\n  }\n  if (param_6 == 0) {\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("outlen != NULL","src/mac/hmac/hmac_file.c",0x32);\n  }\n  __ptr = malloc(0x2000);\n  if (__ptr == (void *)0x0) {\n    iVar1 = 0xd;\n  }\n  else {\n    iVar1 = hash_is_valid(param_1);\n    if (iVar1 == 0) {\n      iVar1 = hmac_init(local_398,param_1,param_3,param_4);\n      if (iVar1 == 0) {\n        __stream = fopen(param_2,"rb");\n        if (__stream == (FILE *)0x0) {\n          iVar1 = 0x11;\n        }\n        else {\n          do {\n            sVar3 = fread(__ptr,1,0x2000,__stream);\n            iVar1 = hmac_process(local_398,__ptr,sVar3);\n            if (iVar1 != 0) {\n              fclose(__stream);\n              goto LAB_001614b0;\n            }\n          } while (sVar3 == 0x2000);\n          iVar1 = 1;\n          iVar2 = fclose(__stream);\n          if (iVar2 == 0) {\n            iVar1 = hmac_done(local_398,param_5,param_6);\n          }\nLAB_001614b0:\n          zeromem(__ptr,0x2000);\n        }\n      }\n    }\n    free(__ptr);\n  }\n  if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return iVar1;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail();\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "void *__ptr;" primitive_type (pointer_declarator "*__ptr" * identifier) ;) (declaration "FILE *__stream;" type_identifier (pointer_declarator "*__stream" * identifier) ;) (declaration "size_t sVar3;" primitive_type identifier ;) (declaration "long in_FS_OFFSET;" (sized_type_specifier "long" long) identifier ;) (declaration "undefined1 local_398 [856];" type_identifier (array_declarator "local_398 [856]" identifier [ number_literal ]) ;) (declaration "long local_40;" (sized_type_specifier "long" long) identifier ;) (expression_statement "local_40 = *(long *)(in_FS_OFFSET + 0x28);" (assignment_expression "local_40 = *(long *)(in_FS_OFFSET + 0x28)" identifier = (pointer_expression "*(long *)(in_FS_OFFSET + 0x28)" * (cast_expression "(long *)(in_FS_OFFSET + 0x28)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_FS_OFFSET + 0x28)" ( (binary_expression "in_FS_OFFSET + 0x28" identifier + number_literal) ))))) ;) (if_statement "if (param_2 == (char *)0x0) {\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("fname != NULL","src/mac/hmac/hmac_file.c",0x2f);\n  }" if (parenthesized_expression "(param_2 == (char *)0x0)" ( (binary_expression "param_2 == (char *)0x0" identifier == (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("fname != NULL","src/mac/hmac/hmac_file.c",0x2f);\n  }" { comment (expression_statement "crypt_argchk("fname != NULL","src/mac/hmac/hmac_file.c",0x2f);" (call_expression "crypt_argchk("fname != NULL","src/mac/hmac/hmac_file.c",0x2f)" identifier (argument_list "("fname != NULL","src/mac/hmac/hmac_file.c",0x2f)" ( (string_literal ""fname != NULL"" " string_content ") , (string_literal ""src/mac/hmac/hmac_file.c"" " string_content ") , number_literal ))) ;) })) (if_statement "if (param_3 == 0) {\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("key != NULL","src/mac/hmac/hmac_file.c",0x30);\n  }" if (parenthesized_expression "(param_3 == 0)" ( (binary_expression "param_3 == 0" identifier == number_literal) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("key != NULL","src/mac/hmac/hmac_file.c",0x30);\n  }" { comment (expression_statement "crypt_argchk("key != NULL","src/mac/hmac/hmac_file.c",0x30);" (call_expression "crypt_argchk("key != NULL","src/mac/hmac/hmac_file.c",0x30)" identifier (argument_list "("key != NULL","src/mac/hmac/hmac_file.c",0x30)" ( (string_literal ""key != NULL"" " string_content ") , (string_literal ""src/mac/hmac/hmac_file.c"" " string_content ") , number_literal ))) ;) })) (if_statement "if (param_5 == 0) {\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("out != NULL","src/mac/hmac/hmac_file.c",0x31);\n  }" if (parenthesized_expression "(param_5 == 0)" ( (binary_expression "param_5 == 0" identifier == number_literal) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("out != NULL","src/mac/hmac/hmac_file.c",0x31);\n  }" { comment (expression_statement "crypt_argchk("out != NULL","src/mac/hmac/hmac_file.c",0x31);" (call_expression "crypt_argchk("out != NULL","src/mac/hmac/hmac_file.c",0x31)" identifier (argument_list "("out != NULL","src/mac/hmac/hmac_file.c",0x31)" ( (string_literal ""out != NULL"" " string_content ") , (string_literal ""src/mac/hmac/hmac_file.c"" " string_content ") , number_literal ))) ;) })) (if_statement "if (param_6 == 0) {\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("outlen != NULL","src/mac/hmac/hmac_file.c",0x32);\n  }" if (parenthesized_expression "(param_6 == 0)" ( (binary_expression "param_6 == 0" identifier == number_literal) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("outlen != NULL","src/mac/hmac/hmac_file.c",0x32);\n  }" { comment (expression_statement "crypt_argchk("outlen != NULL","src/mac/hmac/hmac_file.c",0x32);" (call_expression "crypt_argchk("outlen != NULL","src/mac/hmac/hmac_file.c",0x32)" identifier (argument_list "("outlen != NULL","src/mac/hmac/hmac_file.c",0x32)" ( (string_literal ""outlen != NULL"" " string_content ") , (string_literal ""src/mac/hmac/hmac_file.c"" " string_content ") , number_literal ))) ;) })) (expression_statement "__ptr = malloc(0x2000);" (assignment_expression "__ptr = malloc(0x2000)" identifier = (call_expression "malloc(0x2000)" identifier (argument_list "(0x2000)" ( number_literal )))) ;) (if_statement "if (__ptr == (void *)0x0) {\n    iVar1 = 0xd;\n  }\n  else {\n    iVar1 = hash_is_valid(param_1);\n    if (iVar1 == 0) {\n      iVar1 = hmac_init(local_398,param_1,param_3,param_4);\n      if (iVar1 == 0) {\n        __stream = fopen(param_2,"rb");\n        if (__stream == (FILE *)0x0) {\n          iVar1 = 0x11;\n        }\n        else {\n          do {\n            sVar3 = fread(__ptr,1,0x2000,__stream);\n            iVar1 = hmac_process(local_398,__ptr,sVar3);\n            if (iVar1 != 0) {\n              fclose(__stream);\n              goto LAB_001614b0;\n            }\n          } while (sVar3 == 0x2000);\n          iVar1 = 1;\n          iVar2 = fclose(__stream);\n          if (iVar2 == 0) {\n            iVar1 = hmac_done(local_398,param_5,param_6);\n          }\nLAB_001614b0:\n          zeromem(__ptr,0x2000);\n        }\n      }\n    }\n    free(__ptr);\n  }" if (parenthesized_expression "(__ptr == (void *)0x0)" ( (binary_expression "__ptr == (void *)0x0" identifier == (cast_expression "(void *)0x0" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    iVar1 = 0xd;\n  }" { (expression_statement "iVar1 = 0xd;" (assignment_expression "iVar1 = 0xd" identifier = number_literal) ;) }) (else_clause "else {\n    iVar1 = hash_is_valid(param_1);\n    if (iVar1 == 0) {\n      iVar1 = hmac_init(local_398,param_1,param_3,param_4);\n      if (iVar1 == 0) {\n        __stream = fopen(param_2,"rb");\n        if (__stream == (FILE *)0x0) {\n          iVar1 = 0x11;\n        }\n        else {\n          do {\n            sVar3 = fread(__ptr,1,0x2000,__stream);\n            iVar1 = hmac_process(local_398,__ptr,sVar3);\n            if (iVar1 != 0) {\n              fclose(__stream);\n              goto LAB_001614b0;\n            }\n          } while (sVar3 == 0x2000);\n          iVar1 = 1;\n          iVar2 = fclose(__stream);\n          if (iVar2 == 0) {\n            iVar1 = hmac_done(local_398,param_5,param_6);\n          }\nLAB_001614b0:\n          zeromem(__ptr,0x2000);\n        }\n      }\n    }\n    free(__ptr);\n  }" else (compound_statement "{\n    iVar1 = hash_is_valid(param_1);\n    if (iVar1 == 0) {\n      iVar1 = hmac_init(local_398,param_1,param_3,param_4);\n      if (iVar1 == 0) {\n        __stream = fopen(param_2,"rb");\n        if (__stream == (FILE *)0x0) {\n          iVar1 = 0x11;\n        }\n        else {\n          do {\n            sVar3 = fread(__ptr,1,0x2000,__stream);\n            iVar1 = hmac_process(local_398,__ptr,sVar3);\n            if (iVar1 != 0) {\n              fclose(__stream);\n              goto LAB_001614b0;\n            }\n          } while (sVar3 == 0x2000);\n          iVar1 = 1;\n          iVar2 = fclose(__stream);\n          if (iVar2 == 0) {\n            iVar1 = hmac_done(local_398,param_5,param_6);\n          }\nLAB_001614b0:\n          zeromem(__ptr,0x2000);\n        }\n      }\n    }\n    free(__ptr);\n  }" { (expression_statement "iVar1 = hash_is_valid(param_1);" (assignment_expression "iVar1 = hash_is_valid(param_1)" identifier = (call_expression "hash_is_valid(param_1)" identifier (argument_list "(param_1)" ( identifier )))) ;) (if_statement "if (iVar1 == 0) {\n      iVar1 = hmac_init(local_398,param_1,param_3,param_4);\n      if (iVar1 == 0) {\n        __stream = fopen(param_2,"rb");\n        if (__stream == (FILE *)0x0) {\n          iVar1 = 0x11;\n        }\n        else {\n          do {\n            sVar3 = fread(__ptr,1,0x2000,__stream);\n            iVar1 = hmac_process(local_398,__ptr,sVar3);\n            if (iVar1 != 0) {\n              fclose(__stream);\n              goto LAB_001614b0;\n            }\n          } while (sVar3 == 0x2000);\n          iVar1 = 1;\n          iVar2 = fclose(__stream);\n          if (iVar2 == 0) {\n            iVar1 = hmac_done(local_398,param_5,param_6);\n          }\nLAB_001614b0:\n          zeromem(__ptr,0x2000);\n        }\n      }\n    }" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (compound_statement "{\n      iVar1 = hmac_init(local_398,param_1,param_3,param_4);\n      if (iVar1 == 0) {\n        __stream = fopen(param_2,"rb");\n        if (__stream == (FILE *)0x0) {\n          iVar1 = 0x11;\n        }\n        else {\n          do {\n            sVar3 = fread(__ptr,1,0x2000,__stream);\n            iVar1 = hmac_process(local_398,__ptr,sVar3);\n            if (iVar1 != 0) {\n              fclose(__stream);\n              goto LAB_001614b0;\n            }\n          } while (sVar3 == 0x2000);\n          iVar1 = 1;\n          iVar2 = fclose(__stream);\n          if (iVar2 == 0) {\n            iVar1 = hmac_done(local_398,param_5,param_6);\n          }\nLAB_001614b0:\n          zeromem(__ptr,0x2000);\n        }\n      }\n    }" { (expression_statement "iVar1 = hmac_init(local_398,param_1,param_3,param_4);" (assignment_expression "iVar1 = hmac_init(local_398,param_1,param_3,param_4)" identifier = (call_expression "hmac_init(local_398,param_1,param_3,param_4)" identifier (argument_list "(local_398,param_1,param_3,param_4)" ( identifier , identifier , identifier , identifier )))) ;) (if_statement "if (iVar1 == 0) {\n        __stream = fopen(param_2,"rb");\n        if (__stream == (FILE *)0x0) {\n          iVar1 = 0x11;\n        }\n        else {\n          do {\n            sVar3 = fread(__ptr,1,0x2000,__stream);\n            iVar1 = hmac_process(local_398,__ptr,sVar3);\n            if (iVar1 != 0) {\n              fclose(__stream);\n              goto LAB_001614b0;\n            }\n          } while (sVar3 == 0x2000);\n          iVar1 = 1;\n          iVar2 = fclose(__stream);\n          if (iVar2 == 0) {\n            iVar1 = hmac_done(local_398,param_5,param_6);\n          }\nLAB_001614b0:\n          zeromem(__ptr,0x2000);\n        }\n      }" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (compound_statement "{\n        __stream = fopen(param_2,"rb");\n        if (__stream == (FILE *)0x0) {\n          iVar1 = 0x11;\n        }\n        else {\n          do {\n            sVar3 = fread(__ptr,1,0x2000,__stream);\n            iVar1 = hmac_process(local_398,__ptr,sVar3);\n            if (iVar1 != 0) {\n              fclose(__stream);\n              goto LAB_001614b0;\n            }\n          } while (sVar3 == 0x2000);\n          iVar1 = 1;\n          iVar2 = fclose(__stream);\n          if (iVar2 == 0) {\n            iVar1 = hmac_done(local_398,param_5,param_6);\n          }\nLAB_001614b0:\n          zeromem(__ptr,0x2000);\n        }\n      }" { (expression_statement "__stream = fopen(param_2,"rb");" (assignment_expression "__stream = fopen(param_2,"rb")" identifier = (call_expression "fopen(param_2,"rb")" identifier (argument_list "(param_2,"rb")" ( identifier , (string_literal ""rb"" " string_content ") )))) ;) (if_statement "if (__stream == (FILE *)0x0) {\n          iVar1 = 0x11;\n        }\n        else {\n          do {\n            sVar3 = fread(__ptr,1,0x2000,__stream);\n            iVar1 = hmac_process(local_398,__ptr,sVar3);\n            if (iVar1 != 0) {\n              fclose(__stream);\n              goto LAB_001614b0;\n            }\n          } while (sVar3 == 0x2000);\n          iVar1 = 1;\n          iVar2 = fclose(__stream);\n          if (iVar2 == 0) {\n            iVar1 = hmac_done(local_398,param_5,param_6);\n          }\nLAB_001614b0:\n          zeromem(__ptr,0x2000);\n        }" if (parenthesized_expression "(__stream == (FILE *)0x0)" ( (binary_expression "__stream == (FILE *)0x0" identifier == (cast_expression "(FILE *)0x0" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n          iVar1 = 0x11;\n        }" { (expression_statement "iVar1 = 0x11;" (assignment_expression "iVar1 = 0x11" identifier = number_literal) ;) }) (else_clause "else {\n          do {\n            sVar3 = fread(__ptr,1,0x2000,__stream);\n            iVar1 = hmac_process(local_398,__ptr,sVar3);\n            if (iVar1 != 0) {\n              fclose(__stream);\n              goto LAB_001614b0;\n            }\n          } while (sVar3 == 0x2000);\n          iVar1 = 1;\n          iVar2 = fclose(__stream);\n          if (iVar2 == 0) {\n            iVar1 = hmac_done(local_398,param_5,param_6);\n          }\nLAB_001614b0:\n          zeromem(__ptr,0x2000);\n        }" else (compound_statement "{\n          do {\n            sVar3 = fread(__ptr,1,0x2000,__stream);\n            iVar1 = hmac_process(local_398,__ptr,sVar3);\n            if (iVar1 != 0) {\n              fclose(__stream);\n              goto LAB_001614b0;\n            }\n          } while (sVar3 == 0x2000);\n          iVar1 = 1;\n          iVar2 = fclose(__stream);\n          if (iVar2 == 0) {\n            iVar1 = hmac_done(local_398,param_5,param_6);\n          }\nLAB_001614b0:\n          zeromem(__ptr,0x2000);\n        }" { (do_statement "do {\n            sVar3 = fread(__ptr,1,0x2000,__stream);\n            iVar1 = hmac_process(local_398,__ptr,sVar3);\n            if (iVar1 != 0) {\n              fclose(__stream);\n              goto LAB_001614b0;\n            }\n          } while (sVar3 == 0x2000);" do (compound_statement "{\n            sVar3 = fread(__ptr,1,0x2000,__stream);\n            iVar1 = hmac_process(local_398,__ptr,sVar3);\n            if (iVar1 != 0) {\n              fclose(__stream);\n              goto LAB_001614b0;\n            }\n          }" { (expression_statement "sVar3 = fread(__ptr,1,0x2000,__stream);" (assignment_expression "sVar3 = fread(__ptr,1,0x2000,__stream)" identifier = (call_expression "fread(__ptr,1,0x2000,__stream)" identifier (argument_list "(__ptr,1,0x2000,__stream)" ( identifier , number_literal , number_literal , identifier )))) ;) (expression_statement "iVar1 = hmac_process(local_398,__ptr,sVar3);" (assignment_expression "iVar1 = hmac_process(local_398,__ptr,sVar3)" identifier = (call_expression "hmac_process(local_398,__ptr,sVar3)" identifier (argument_list "(local_398,__ptr,sVar3)" ( identifier , identifier , identifier )))) ;) (if_statement "if (iVar1 != 0) {\n              fclose(__stream);\n              goto LAB_001614b0;\n            }" if (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) (compound_statement "{\n              fclose(__stream);\n              goto LAB_001614b0;\n            }" { (expression_statement "fclose(__stream);" (call_expression "fclose(__stream)" identifier (argument_list "(__stream)" ( identifier ))) ;) (goto_statement "goto LAB_001614b0;" goto statement_identifier ;) })) }) while (parenthesized_expression "(sVar3 == 0x2000)" ( (binary_expression "sVar3 == 0x2000" identifier == number_literal) )) ;) (expression_statement "iVar1 = 1;" (assignment_expression "iVar1 = 1" identifier = number_literal) ;) (expression_statement "iVar2 = fclose(__stream);" (assignment_expression "iVar2 = fclose(__stream)" identifier = (call_expression "fclose(__stream)" identifier (argument_list "(__stream)" ( identifier )))) ;) (if_statement "if (iVar2 == 0) {\n            iVar1 = hmac_done(local_398,param_5,param_6);\n          }" if (parenthesized_expression "(iVar2 == 0)" ( (binary_expression "iVar2 == 0" identifier == number_literal) )) (compound_statement "{\n            iVar1 = hmac_done(local_398,param_5,param_6);\n          }" { (expression_statement "iVar1 = hmac_done(local_398,param_5,param_6);" (assignment_expression "iVar1 = hmac_done(local_398,param_5,param_6)" identifier = (call_expression "hmac_done(local_398,param_5,param_6)" identifier (argument_list "(local_398,param_5,param_6)" ( identifier , identifier , identifier )))) ;) })) (labeled_statement "LAB_001614b0:\n          zeromem(__ptr,0x2000);" statement_identifier : (expression_statement "zeromem(__ptr,0x2000);" (call_expression "zeromem(__ptr,0x2000)" identifier (argument_list "(__ptr,0x2000)" ( identifier , number_literal ))) ;)) }))) })) })) (expression_statement "free(__ptr);" (call_expression "free(__ptr)" identifier (argument_list "(__ptr)" ( identifier ))) ;) }))) (if_statement "if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return iVar1;\n  }" if (parenthesized_expression "(local_40 == *(long *)(in_FS_OFFSET + 0x28))" ( (binary_expression "local_40 == *(long *)(in_FS_OFFSET + 0x28)" identifier == (pointer_expression "*(long *)(in_FS_OFFSET + 0x28)" * (cast_expression "(long *)(in_FS_OFFSET + 0x28)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_FS_OFFSET + 0x28)" ( (binary_expression "in_FS_OFFSET + 0x28" identifier + number_literal) ))))) )) (compound_statement "{\n    return iVar1;\n  }" { (return_statement "return iVar1;" return identifier ;) })) comment (expression_statement "__stack_chk_fail();" (call_expression "__stack_chk_fail()" identifier (argument_list "()" ( ))) ;) })))
(translation_unit "int hmac_file(int hash,char *fname,uchar *key,ulong keylen,uchar *out,ulong *outlen)\n\n{\n  long lVar1;\n  int iVar2;\n  int iVar3;\n  uchar *in;\n  FILE *__stream;\n  size_t inlen;\n  long in_FS_OFFSET;\n  hmac_state hmac;\n  \n  lVar1 = *(long *)(in_FS_OFFSET + 0x28);\n  if (fname == (char *)0x0) {\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("fname != NULL","src/mac/hmac/hmac_file.c",0x2f);\n  }\n  if (key == (uchar *)0x0) {\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("key != NULL","src/mac/hmac/hmac_file.c",0x30);\n  }\n  if (out == (uchar *)0x0) {\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("out != NULL","src/mac/hmac/hmac_file.c",0x31);\n  }\n  if (outlen == (ulong *)0x0) {\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("outlen != NULL","src/mac/hmac/hmac_file.c",0x32);\n  }\n  in = (uchar *)malloc(0x2000);\n  if (in == (uchar *)0x0) {\n    iVar2 = 0xd;\n  }\n  else {\n    iVar2 = hash_is_valid(hash);\n    if (iVar2 == 0) {\n      iVar2 = hmac_init(&hmac,hash,key,keylen);\n      if (iVar2 == 0) {\n        __stream = fopen(fname,"rb");\n        if (__stream == (FILE *)0x0) {\n          iVar2 = 0x11;\n        }\n        else {\n          do {\n            inlen = fread(in,1,0x2000,__stream);\n            iVar2 = hmac_process(&hmac,in,inlen);\n            if (iVar2 != 0) {\n              fclose(__stream);\n              goto LAB_001614b0;\n            }\n          } while (inlen == 0x2000);\n          iVar2 = 1;\n          iVar3 = fclose(__stream);\n          if (iVar3 == 0) {\n            iVar2 = hmac_done(&hmac,out,outlen);\n          }\nLAB_001614b0:\n          zeromem(in,0x2000);\n        }\n      }\n    }\n    free(in);\n  }\n  if (lVar1 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return iVar2;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail();\n}\n\n" (function_definition "int hmac_file(int hash,char *fname,uchar *key,ulong keylen,uchar *out,ulong *outlen)\n\n{\n  long lVar1;\n  int iVar2;\n  int iVar3;\n  uchar *in;\n  FILE *__stream;\n  size_t inlen;\n  long in_FS_OFFSET;\n  hmac_state hmac;\n  \n  lVar1 = *(long *)(in_FS_OFFSET + 0x28);\n  if (fname == (char *)0x0) {\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("fname != NULL","src/mac/hmac/hmac_file.c",0x2f);\n  }\n  if (key == (uchar *)0x0) {\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("key != NULL","src/mac/hmac/hmac_file.c",0x30);\n  }\n  if (out == (uchar *)0x0) {\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("out != NULL","src/mac/hmac/hmac_file.c",0x31);\n  }\n  if (outlen == (ulong *)0x0) {\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("outlen != NULL","src/mac/hmac/hmac_file.c",0x32);\n  }\n  in = (uchar *)malloc(0x2000);\n  if (in == (uchar *)0x0) {\n    iVar2 = 0xd;\n  }\n  else {\n    iVar2 = hash_is_valid(hash);\n    if (iVar2 == 0) {\n      iVar2 = hmac_init(&hmac,hash,key,keylen);\n      if (iVar2 == 0) {\n        __stream = fopen(fname,"rb");\n        if (__stream == (FILE *)0x0) {\n          iVar2 = 0x11;\n        }\n        else {\n          do {\n            inlen = fread(in,1,0x2000,__stream);\n            iVar2 = hmac_process(&hmac,in,inlen);\n            if (iVar2 != 0) {\n              fclose(__stream);\n              goto LAB_001614b0;\n            }\n          } while (inlen == 0x2000);\n          iVar2 = 1;\n          iVar3 = fclose(__stream);\n          if (iVar3 == 0) {\n            iVar2 = hmac_done(&hmac,out,outlen);\n          }\nLAB_001614b0:\n          zeromem(in,0x2000);\n        }\n      }\n    }\n    free(in);\n  }\n  if (lVar1 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return iVar2;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail();\n}" primitive_type (function_declarator "hmac_file(int hash,char *fname,uchar *key,ulong keylen,uchar *out,ulong *outlen)" identifier (parameter_list "(int hash,char *fname,uchar *key,ulong keylen,uchar *out,ulong *outlen)" ( (parameter_declaration "int hash" primitive_type identifier) , (parameter_declaration "char *fname" primitive_type (pointer_declarator "*fname" * identifier)) , (parameter_declaration "uchar *key" type_identifier (pointer_declarator "*key" * identifier)) , (parameter_declaration "ulong keylen" type_identifier identifier) , (parameter_declaration "uchar *out" type_identifier (pointer_declarator "*out" * identifier)) , (parameter_declaration "ulong *outlen" type_identifier (pointer_declarator "*outlen" * identifier)) ))) (compound_statement "{\n  long lVar1;\n  int iVar2;\n  int iVar3;\n  uchar *in;\n  FILE *__stream;\n  size_t inlen;\n  long in_FS_OFFSET;\n  hmac_state hmac;\n  \n  lVar1 = *(long *)(in_FS_OFFSET + 0x28);\n  if (fname == (char *)0x0) {\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("fname != NULL","src/mac/hmac/hmac_file.c",0x2f);\n  }\n  if (key == (uchar *)0x0) {\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("key != NULL","src/mac/hmac/hmac_file.c",0x30);\n  }\n  if (out == (uchar *)0x0) {\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("out != NULL","src/mac/hmac/hmac_file.c",0x31);\n  }\n  if (outlen == (ulong *)0x0) {\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("outlen != NULL","src/mac/hmac/hmac_file.c",0x32);\n  }\n  in = (uchar *)malloc(0x2000);\n  if (in == (uchar *)0x0) {\n    iVar2 = 0xd;\n  }\n  else {\n    iVar2 = hash_is_valid(hash);\n    if (iVar2 == 0) {\n      iVar2 = hmac_init(&hmac,hash,key,keylen);\n      if (iVar2 == 0) {\n        __stream = fopen(fname,"rb");\n        if (__stream == (FILE *)0x0) {\n          iVar2 = 0x11;\n        }\n        else {\n          do {\n            inlen = fread(in,1,0x2000,__stream);\n            iVar2 = hmac_process(&hmac,in,inlen);\n            if (iVar2 != 0) {\n              fclose(__stream);\n              goto LAB_001614b0;\n            }\n          } while (inlen == 0x2000);\n          iVar2 = 1;\n          iVar3 = fclose(__stream);\n          if (iVar3 == 0) {\n            iVar2 = hmac_done(&hmac,out,outlen);\n          }\nLAB_001614b0:\n          zeromem(in,0x2000);\n        }\n      }\n    }\n    free(in);\n  }\n  if (lVar1 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return iVar2;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail();\n}" { (declaration "long lVar1;" (sized_type_specifier "long" long) identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "uchar *in;" type_identifier (pointer_declarator "*in" * identifier) ;) (declaration "FILE *__stream;" type_identifier (pointer_declarator "*__stream" * identifier) ;) (declaration "size_t inlen;" primitive_type identifier ;) (declaration "long in_FS_OFFSET;" (sized_type_specifier "long" long) identifier ;) (declaration "hmac_state hmac;" type_identifier identifier ;) (expression_statement "lVar1 = *(long *)(in_FS_OFFSET + 0x28);" (assignment_expression "lVar1 = *(long *)(in_FS_OFFSET + 0x28)" identifier = (pointer_expression "*(long *)(in_FS_OFFSET + 0x28)" * (cast_expression "(long *)(in_FS_OFFSET + 0x28)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_FS_OFFSET + 0x28)" ( (binary_expression "in_FS_OFFSET + 0x28" identifier + number_literal) ))))) ;) (if_statement "if (fname == (char *)0x0) {\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("fname != NULL","src/mac/hmac/hmac_file.c",0x2f);\n  }" if (parenthesized_expression "(fname == (char *)0x0)" ( (binary_expression "fname == (char *)0x0" identifier == (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("fname != NULL","src/mac/hmac/hmac_file.c",0x2f);\n  }" { comment (expression_statement "crypt_argchk("fname != NULL","src/mac/hmac/hmac_file.c",0x2f);" (call_expression "crypt_argchk("fname != NULL","src/mac/hmac/hmac_file.c",0x2f)" identifier (argument_list "("fname != NULL","src/mac/hmac/hmac_file.c",0x2f)" ( (string_literal ""fname != NULL"" " string_content ") , (string_literal ""src/mac/hmac/hmac_file.c"" " string_content ") , number_literal ))) ;) })) (if_statement "if (key == (uchar *)0x0) {\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("key != NULL","src/mac/hmac/hmac_file.c",0x30);\n  }" if (parenthesized_expression "(key == (uchar *)0x0)" ( (binary_expression "key == (uchar *)0x0" identifier == (cast_expression "(uchar *)0x0" ( (type_descriptor "uchar *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("key != NULL","src/mac/hmac/hmac_file.c",0x30);\n  }" { comment (expression_statement "crypt_argchk("key != NULL","src/mac/hmac/hmac_file.c",0x30);" (call_expression "crypt_argchk("key != NULL","src/mac/hmac/hmac_file.c",0x30)" identifier (argument_list "("key != NULL","src/mac/hmac/hmac_file.c",0x30)" ( (string_literal ""key != NULL"" " string_content ") , (string_literal ""src/mac/hmac/hmac_file.c"" " string_content ") , number_literal ))) ;) })) (if_statement "if (out == (uchar *)0x0) {\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("out != NULL","src/mac/hmac/hmac_file.c",0x31);\n  }" if (parenthesized_expression "(out == (uchar *)0x0)" ( (binary_expression "out == (uchar *)0x0" identifier == (cast_expression "(uchar *)0x0" ( (type_descriptor "uchar *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("out != NULL","src/mac/hmac/hmac_file.c",0x31);\n  }" { comment (expression_statement "crypt_argchk("out != NULL","src/mac/hmac/hmac_file.c",0x31);" (call_expression "crypt_argchk("out != NULL","src/mac/hmac/hmac_file.c",0x31)" identifier (argument_list "("out != NULL","src/mac/hmac/hmac_file.c",0x31)" ( (string_literal ""out != NULL"" " string_content ") , (string_literal ""src/mac/hmac/hmac_file.c"" " string_content ") , number_literal ))) ;) })) (if_statement "if (outlen == (ulong *)0x0) {\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("outlen != NULL","src/mac/hmac/hmac_file.c",0x32);\n  }" if (parenthesized_expression "(outlen == (ulong *)0x0)" ( (binary_expression "outlen == (ulong *)0x0" identifier == (cast_expression "(ulong *)0x0" ( (type_descriptor "ulong *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("outlen != NULL","src/mac/hmac/hmac_file.c",0x32);\n  }" { comment (expression_statement "crypt_argchk("outlen != NULL","src/mac/hmac/hmac_file.c",0x32);" (call_expression "crypt_argchk("outlen != NULL","src/mac/hmac/hmac_file.c",0x32)" identifier (argument_list "("outlen != NULL","src/mac/hmac/hmac_file.c",0x32)" ( (string_literal ""outlen != NULL"" " string_content ") , (string_literal ""src/mac/hmac/hmac_file.c"" " string_content ") , number_literal ))) ;) })) (expression_statement "in = (uchar *)malloc(0x2000);" (assignment_expression "in = (uchar *)malloc(0x2000)" identifier = (cast_expression "(uchar *)malloc(0x2000)" ( (type_descriptor "uchar *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "malloc(0x2000)" identifier (argument_list "(0x2000)" ( number_literal ))))) ;) (if_statement "if (in == (uchar *)0x0) {\n    iVar2 = 0xd;\n  }\n  else {\n    iVar2 = hash_is_valid(hash);\n    if (iVar2 == 0) {\n      iVar2 = hmac_init(&hmac,hash,key,keylen);\n      if (iVar2 == 0) {\n        __stream = fopen(fname,"rb");\n        if (__stream == (FILE *)0x0) {\n          iVar2 = 0x11;\n        }\n        else {\n          do {\n            inlen = fread(in,1,0x2000,__stream);\n            iVar2 = hmac_process(&hmac,in,inlen);\n            if (iVar2 != 0) {\n              fclose(__stream);\n              goto LAB_001614b0;\n            }\n          } while (inlen == 0x2000);\n          iVar2 = 1;\n          iVar3 = fclose(__stream);\n          if (iVar3 == 0) {\n            iVar2 = hmac_done(&hmac,out,outlen);\n          }\nLAB_001614b0:\n          zeromem(in,0x2000);\n        }\n      }\n    }\n    free(in);\n  }" if (parenthesized_expression "(in == (uchar *)0x0)" ( (binary_expression "in == (uchar *)0x0" identifier == (cast_expression "(uchar *)0x0" ( (type_descriptor "uchar *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    iVar2 = 0xd;\n  }" { (expression_statement "iVar2 = 0xd;" (assignment_expression "iVar2 = 0xd" identifier = number_literal) ;) }) (else_clause "else {\n    iVar2 = hash_is_valid(hash);\n    if (iVar2 == 0) {\n      iVar2 = hmac_init(&hmac,hash,key,keylen);\n      if (iVar2 == 0) {\n        __stream = fopen(fname,"rb");\n        if (__stream == (FILE *)0x0) {\n          iVar2 = 0x11;\n        }\n        else {\n          do {\n            inlen = fread(in,1,0x2000,__stream);\n            iVar2 = hmac_process(&hmac,in,inlen);\n            if (iVar2 != 0) {\n              fclose(__stream);\n              goto LAB_001614b0;\n            }\n          } while (inlen == 0x2000);\n          iVar2 = 1;\n          iVar3 = fclose(__stream);\n          if (iVar3 == 0) {\n            iVar2 = hmac_done(&hmac,out,outlen);\n          }\nLAB_001614b0:\n          zeromem(in,0x2000);\n        }\n      }\n    }\n    free(in);\n  }" else (compound_statement "{\n    iVar2 = hash_is_valid(hash);\n    if (iVar2 == 0) {\n      iVar2 = hmac_init(&hmac,hash,key,keylen);\n      if (iVar2 == 0) {\n        __stream = fopen(fname,"rb");\n        if (__stream == (FILE *)0x0) {\n          iVar2 = 0x11;\n        }\n        else {\n          do {\n            inlen = fread(in,1,0x2000,__stream);\n            iVar2 = hmac_process(&hmac,in,inlen);\n            if (iVar2 != 0) {\n              fclose(__stream);\n              goto LAB_001614b0;\n            }\n          } while (inlen == 0x2000);\n          iVar2 = 1;\n          iVar3 = fclose(__stream);\n          if (iVar3 == 0) {\n            iVar2 = hmac_done(&hmac,out,outlen);\n          }\nLAB_001614b0:\n          zeromem(in,0x2000);\n        }\n      }\n    }\n    free(in);\n  }" { (expression_statement "iVar2 = hash_is_valid(hash);" (assignment_expression "iVar2 = hash_is_valid(hash)" identifier = (call_expression "hash_is_valid(hash)" identifier (argument_list "(hash)" ( identifier )))) ;) (if_statement "if (iVar2 == 0) {\n      iVar2 = hmac_init(&hmac,hash,key,keylen);\n      if (iVar2 == 0) {\n        __stream = fopen(fname,"rb");\n        if (__stream == (FILE *)0x0) {\n          iVar2 = 0x11;\n        }\n        else {\n          do {\n            inlen = fread(in,1,0x2000,__stream);\n            iVar2 = hmac_process(&hmac,in,inlen);\n            if (iVar2 != 0) {\n              fclose(__stream);\n              goto LAB_001614b0;\n            }\n          } while (inlen == 0x2000);\n          iVar2 = 1;\n          iVar3 = fclose(__stream);\n          if (iVar3 == 0) {\n            iVar2 = hmac_done(&hmac,out,outlen);\n          }\nLAB_001614b0:\n          zeromem(in,0x2000);\n        }\n      }\n    }" if (parenthesized_expression "(iVar2 == 0)" ( (binary_expression "iVar2 == 0" identifier == number_literal) )) (compound_statement "{\n      iVar2 = hmac_init(&hmac,hash,key,keylen);\n      if (iVar2 == 0) {\n        __stream = fopen(fname,"rb");\n        if (__stream == (FILE *)0x0) {\n          iVar2 = 0x11;\n        }\n        else {\n          do {\n            inlen = fread(in,1,0x2000,__stream);\n            iVar2 = hmac_process(&hmac,in,inlen);\n            if (iVar2 != 0) {\n              fclose(__stream);\n              goto LAB_001614b0;\n            }\n          } while (inlen == 0x2000);\n          iVar2 = 1;\n          iVar3 = fclose(__stream);\n          if (iVar3 == 0) {\n            iVar2 = hmac_done(&hmac,out,outlen);\n          }\nLAB_001614b0:\n          zeromem(in,0x2000);\n        }\n      }\n    }" { (expression_statement "iVar2 = hmac_init(&hmac,hash,key,keylen);" (assignment_expression "iVar2 = hmac_init(&hmac,hash,key,keylen)" identifier = (call_expression "hmac_init(&hmac,hash,key,keylen)" identifier (argument_list "(&hmac,hash,key,keylen)" ( (pointer_expression "&hmac" & identifier) , identifier , identifier , identifier )))) ;) (if_statement "if (iVar2 == 0) {\n        __stream = fopen(fname,"rb");\n        if (__stream == (FILE *)0x0) {\n          iVar2 = 0x11;\n        }\n        else {\n          do {\n            inlen = fread(in,1,0x2000,__stream);\n            iVar2 = hmac_process(&hmac,in,inlen);\n            if (iVar2 != 0) {\n              fclose(__stream);\n              goto LAB_001614b0;\n            }\n          } while (inlen == 0x2000);\n          iVar2 = 1;\n          iVar3 = fclose(__stream);\n          if (iVar3 == 0) {\n            iVar2 = hmac_done(&hmac,out,outlen);\n          }\nLAB_001614b0:\n          zeromem(in,0x2000);\n        }\n      }" if (parenthesized_expression "(iVar2 == 0)" ( (binary_expression "iVar2 == 0" identifier == number_literal) )) (compound_statement "{\n        __stream = fopen(fname,"rb");\n        if (__stream == (FILE *)0x0) {\n          iVar2 = 0x11;\n        }\n        else {\n          do {\n            inlen = fread(in,1,0x2000,__stream);\n            iVar2 = hmac_process(&hmac,in,inlen);\n            if (iVar2 != 0) {\n              fclose(__stream);\n              goto LAB_001614b0;\n            }\n          } while (inlen == 0x2000);\n          iVar2 = 1;\n          iVar3 = fclose(__stream);\n          if (iVar3 == 0) {\n            iVar2 = hmac_done(&hmac,out,outlen);\n          }\nLAB_001614b0:\n          zeromem(in,0x2000);\n        }\n      }" { (expression_statement "__stream = fopen(fname,"rb");" (assignment_expression "__stream = fopen(fname,"rb")" identifier = (call_expression "fopen(fname,"rb")" identifier (argument_list "(fname,"rb")" ( identifier , (string_literal ""rb"" " string_content ") )))) ;) (if_statement "if (__stream == (FILE *)0x0) {\n          iVar2 = 0x11;\n        }\n        else {\n          do {\n            inlen = fread(in,1,0x2000,__stream);\n            iVar2 = hmac_process(&hmac,in,inlen);\n            if (iVar2 != 0) {\n              fclose(__stream);\n              goto LAB_001614b0;\n            }\n          } while (inlen == 0x2000);\n          iVar2 = 1;\n          iVar3 = fclose(__stream);\n          if (iVar3 == 0) {\n            iVar2 = hmac_done(&hmac,out,outlen);\n          }\nLAB_001614b0:\n          zeromem(in,0x2000);\n        }" if (parenthesized_expression "(__stream == (FILE *)0x0)" ( (binary_expression "__stream == (FILE *)0x0" identifier == (cast_expression "(FILE *)0x0" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n          iVar2 = 0x11;\n        }" { (expression_statement "iVar2 = 0x11;" (assignment_expression "iVar2 = 0x11" identifier = number_literal) ;) }) (else_clause "else {\n          do {\n            inlen = fread(in,1,0x2000,__stream);\n            iVar2 = hmac_process(&hmac,in,inlen);\n            if (iVar2 != 0) {\n              fclose(__stream);\n              goto LAB_001614b0;\n            }\n          } while (inlen == 0x2000);\n          iVar2 = 1;\n          iVar3 = fclose(__stream);\n          if (iVar3 == 0) {\n            iVar2 = hmac_done(&hmac,out,outlen);\n          }\nLAB_001614b0:\n          zeromem(in,0x2000);\n        }" else (compound_statement "{\n          do {\n            inlen = fread(in,1,0x2000,__stream);\n            iVar2 = hmac_process(&hmac,in,inlen);\n            if (iVar2 != 0) {\n              fclose(__stream);\n              goto LAB_001614b0;\n            }\n          } while (inlen == 0x2000);\n          iVar2 = 1;\n          iVar3 = fclose(__stream);\n          if (iVar3 == 0) {\n            iVar2 = hmac_done(&hmac,out,outlen);\n          }\nLAB_001614b0:\n          zeromem(in,0x2000);\n        }" { (do_statement "do {\n            inlen = fread(in,1,0x2000,__stream);\n            iVar2 = hmac_process(&hmac,in,inlen);\n            if (iVar2 != 0) {\n              fclose(__stream);\n              goto LAB_001614b0;\n            }\n          } while (inlen == 0x2000);" do (compound_statement "{\n            inlen = fread(in,1,0x2000,__stream);\n            iVar2 = hmac_process(&hmac,in,inlen);\n            if (iVar2 != 0) {\n              fclose(__stream);\n              goto LAB_001614b0;\n            }\n          }" { (expression_statement "inlen = fread(in,1,0x2000,__stream);" (assignment_expression "inlen = fread(in,1,0x2000,__stream)" identifier = (call_expression "fread(in,1,0x2000,__stream)" identifier (argument_list "(in,1,0x2000,__stream)" ( identifier , number_literal , number_literal , identifier )))) ;) (expression_statement "iVar2 = hmac_process(&hmac,in,inlen);" (assignment_expression "iVar2 = hmac_process(&hmac,in,inlen)" identifier = (call_expression "hmac_process(&hmac,in,inlen)" identifier (argument_list "(&hmac,in,inlen)" ( (pointer_expression "&hmac" & identifier) , identifier , identifier )))) ;) (if_statement "if (iVar2 != 0) {\n              fclose(__stream);\n              goto LAB_001614b0;\n            }" if (parenthesized_expression "(iVar2 != 0)" ( (binary_expression "iVar2 != 0" identifier != number_literal) )) (compound_statement "{\n              fclose(__stream);\n              goto LAB_001614b0;\n            }" { (expression_statement "fclose(__stream);" (call_expression "fclose(__stream)" identifier (argument_list "(__stream)" ( identifier ))) ;) (goto_statement "goto LAB_001614b0;" goto statement_identifier ;) })) }) while (parenthesized_expression "(inlen == 0x2000)" ( (binary_expression "inlen == 0x2000" identifier == number_literal) )) ;) (expression_statement "iVar2 = 1;" (assignment_expression "iVar2 = 1" identifier = number_literal) ;) (expression_statement "iVar3 = fclose(__stream);" (assignment_expression "iVar3 = fclose(__stream)" identifier = (call_expression "fclose(__stream)" identifier (argument_list "(__stream)" ( identifier )))) ;) (if_statement "if (iVar3 == 0) {\n            iVar2 = hmac_done(&hmac,out,outlen);\n          }" if (parenthesized_expression "(iVar3 == 0)" ( (binary_expression "iVar3 == 0" identifier == number_literal) )) (compound_statement "{\n            iVar2 = hmac_done(&hmac,out,outlen);\n          }" { (expression_statement "iVar2 = hmac_done(&hmac,out,outlen);" (assignment_expression "iVar2 = hmac_done(&hmac,out,outlen)" identifier = (call_expression "hmac_done(&hmac,out,outlen)" identifier (argument_list "(&hmac,out,outlen)" ( (pointer_expression "&hmac" & identifier) , identifier , identifier )))) ;) })) (labeled_statement "LAB_001614b0:\n          zeromem(in,0x2000);" statement_identifier : (expression_statement "zeromem(in,0x2000);" (call_expression "zeromem(in,0x2000)" identifier (argument_list "(in,0x2000)" ( identifier , number_literal ))) ;)) }))) })) })) (expression_statement "free(in);" (call_expression "free(in)" identifier (argument_list "(in)" ( identifier ))) ;) }))) (if_statement "if (lVar1 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return iVar2;\n  }" if (parenthesized_expression "(lVar1 == *(long *)(in_FS_OFFSET + 0x28))" ( (binary_expression "lVar1 == *(long *)(in_FS_OFFSET + 0x28)" identifier == (pointer_expression "*(long *)(in_FS_OFFSET + 0x28)" * (cast_expression "(long *)(in_FS_OFFSET + 0x28)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_FS_OFFSET + 0x28)" ( (binary_expression "in_FS_OFFSET + 0x28" identifier + number_literal) ))))) )) (compound_statement "{\n    return iVar2;\n  }" { (return_statement "return iVar2;" return identifier ;) })) comment (expression_statement "__stack_chk_fail();" (call_expression "__stack_chk_fail()" identifier (argument_list "()" ( ))) ;) })))
(translation_unit "int hmac_file(undefined4 param_1,char *param_2,long param_3,undefined8 param_4,long param_5,\n             long param_6)\n\n{\n  int iVar1;\n  int iVar2;\n  void *__ptr;\n  FILE *__stream;\n  size_t sVar3;\n  long in_FS_OFFSET;\n  undefined1 local_398 [856];\n  long local_40;\n  \n  local_40 = *(long *)(in_FS_OFFSET + 0x28);\n  if (param_2 == (char *)0x0) {\n                    \n    crypt_argchk("fname != NULL","src/mac/hmac/hmac_file.c",0x2f);\n  }\n  if (param_3 == 0) {\n                    \n    crypt_argchk("key != NULL","src/mac/hmac/hmac_file.c",0x30);\n  }\n  if (param_5 == 0) {\n                    \n    crypt_argchk("out != NULL","src/mac/hmac/hmac_file.c",0x31);\n  }\n  if (param_6 == 0) {\n                    \n    crypt_argchk("outlen != NULL","src/mac/hmac/hmac_file.c",0x32);\n  }\n  __ptr = malloc(0x2000);\n  if (__ptr == (void *)0x0) {\n    iVar1 = 0xd;\n  }\n  else {\n    iVar1 = hash_is_valid(param_1);\n    if (iVar1 == 0) {\n      iVar1 = hmac_init(local_398,param_1,param_3,param_4);\n      if (iVar1 == 0) {\n        __stream = fopen(param_2,"rb");\n        if (__stream == (FILE *)0x0) {\n          iVar1 = 0x11;\n        }\n        else {\n          do {\n            sVar3 = fread(__ptr,1,0x2000,__stream);\n            iVar1 = hmac_process(local_398,__ptr,sVar3);\n            if (iVar1 != 0) {\n              fclose(__stream);\n              goto LAB_001614b0;\n            }\n          } while (sVar3 == 0x2000);\n          iVar1 = 1;\n          iVar2 = fclose(__stream);\n          if (iVar2 == 0) {\n            iVar1 = hmac_done(local_398,param_5,param_6);\n          }\nLAB_001614b0:\n          zeromem(__ptr,0x2000);\n        }\n      }\n    }\n    free(__ptr);\n  }\n  if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return iVar1;\n  }\n                    \n  __stack_chk_fail();\n}\n\n" (function_definition "int hmac_file(undefined4 param_1,char *param_2,long param_3,undefined8 param_4,long param_5,\n             long param_6)\n\n{\n  int iVar1;\n  int iVar2;\n  void *__ptr;\n  FILE *__stream;\n  size_t sVar3;\n  long in_FS_OFFSET;\n  undefined1 local_398 [856];\n  long local_40;\n  \n  local_40 = *(long *)(in_FS_OFFSET + 0x28);\n  if (param_2 == (char *)0x0) {\n                    \n    crypt_argchk("fname != NULL","src/mac/hmac/hmac_file.c",0x2f);\n  }\n  if (param_3 == 0) {\n                    \n    crypt_argchk("key != NULL","src/mac/hmac/hmac_file.c",0x30);\n  }\n  if (param_5 == 0) {\n                    \n    crypt_argchk("out != NULL","src/mac/hmac/hmac_file.c",0x31);\n  }\n  if (param_6 == 0) {\n                    \n    crypt_argchk("outlen != NULL","src/mac/hmac/hmac_file.c",0x32);\n  }\n  __ptr = malloc(0x2000);\n  if (__ptr == (void *)0x0) {\n    iVar1 = 0xd;\n  }\n  else {\n    iVar1 = hash_is_valid(param_1);\n    if (iVar1 == 0) {\n      iVar1 = hmac_init(local_398,param_1,param_3,param_4);\n      if (iVar1 == 0) {\n        __stream = fopen(param_2,"rb");\n        if (__stream == (FILE *)0x0) {\n          iVar1 = 0x11;\n        }\n        else {\n          do {\n            sVar3 = fread(__ptr,1,0x2000,__stream);\n            iVar1 = hmac_process(local_398,__ptr,sVar3);\n            if (iVar1 != 0) {\n              fclose(__stream);\n              goto LAB_001614b0;\n            }\n          } while (sVar3 == 0x2000);\n          iVar1 = 1;\n          iVar2 = fclose(__stream);\n          if (iVar2 == 0) {\n            iVar1 = hmac_done(local_398,param_5,param_6);\n          }\nLAB_001614b0:\n          zeromem(__ptr,0x2000);\n        }\n      }\n    }\n    free(__ptr);\n  }\n  if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return iVar1;\n  }\n                    \n  __stack_chk_fail();\n}" primitive_type (function_declarator "hmac_file(undefined4 param_1,char *param_2,long param_3,undefined8 param_4,long param_5,\n             long param_6)" identifier (parameter_list "(undefined4 param_1,char *param_2,long param_3,undefined8 param_4,long param_5,\n             long param_6)" ( (parameter_declaration "undefined4 param_1" type_identifier identifier) , (parameter_declaration "char *param_2" primitive_type (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "long param_3" (sized_type_specifier "long" long) identifier) , (parameter_declaration "undefined8 param_4" type_identifier identifier) , (parameter_declaration "long param_5" (sized_type_specifier "long" long) identifier) , (parameter_declaration "long param_6" (sized_type_specifier "long" long) identifier) ))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  void *__ptr;\n  FILE *__stream;\n  size_t sVar3;\n  long in_FS_OFFSET;\n  undefined1 local_398 [856];\n  long local_40;\n  \n  local_40 = *(long *)(in_FS_OFFSET + 0x28);\n  if (param_2 == (char *)0x0) {\n                    \n    crypt_argchk("fname != NULL","src/mac/hmac/hmac_file.c",0x2f);\n  }\n  if (param_3 == 0) {\n                    \n    crypt_argchk("key != NULL","src/mac/hmac/hmac_file.c",0x30);\n  }\n  if (param_5 == 0) {\n                    \n    crypt_argchk("out != NULL","src/mac/hmac/hmac_file.c",0x31);\n  }\n  if (param_6 == 0) {\n                    \n    crypt_argchk("outlen != NULL","src/mac/hmac/hmac_file.c",0x32);\n  }\n  __ptr = malloc(0x2000);\n  if (__ptr == (void *)0x0) {\n    iVar1 = 0xd;\n  }\n  else {\n    iVar1 = hash_is_valid(param_1);\n    if (iVar1 == 0) {\n      iVar1 = hmac_init(local_398,param_1,param_3,param_4);\n      if (iVar1 == 0) {\n        __stream = fopen(param_2,"rb");\n        if (__stream == (FILE *)0x0) {\n          iVar1 = 0x11;\n        }\n        else {\n          do {\n            sVar3 = fread(__ptr,1,0x2000,__stream);\n            iVar1 = hmac_process(local_398,__ptr,sVar3);\n            if (iVar1 != 0) {\n              fclose(__stream);\n              goto LAB_001614b0;\n            }\n          } while (sVar3 == 0x2000);\n          iVar1 = 1;\n          iVar2 = fclose(__stream);\n          if (iVar2 == 0) {\n            iVar1 = hmac_done(local_398,param_5,param_6);\n          }\nLAB_001614b0:\n          zeromem(__ptr,0x2000);\n        }\n      }\n    }\n    free(__ptr);\n  }\n  if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return iVar1;\n  }\n                    \n  __stack_chk_fail();\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "void *__ptr;" primitive_type (pointer_declarator "*__ptr" * identifier) ;) (declaration "FILE *__stream;" type_identifier (pointer_declarator "*__stream" * identifier) ;) (declaration "size_t sVar3;" primitive_type identifier ;) (declaration "long in_FS_OFFSET;" (sized_type_specifier "long" long) identifier ;) (declaration "undefined1 local_398 [856];" type_identifier (array_declarator "local_398 [856]" identifier [ number_literal ]) ;) (declaration "long local_40;" (sized_type_specifier "long" long) identifier ;) (expression_statement "local_40 = *(long *)(in_FS_OFFSET + 0x28);" (assignment_expression "local_40 = *(long *)(in_FS_OFFSET + 0x28)" identifier = (pointer_expression "*(long *)(in_FS_OFFSET + 0x28)" * (cast_expression "(long *)(in_FS_OFFSET + 0x28)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_FS_OFFSET + 0x28)" ( (binary_expression "in_FS_OFFSET + 0x28" identifier + number_literal) ))))) ;) (if_statement "if (param_2 == (char *)0x0) {\n                    \n    crypt_argchk("fname != NULL","src/mac/hmac/hmac_file.c",0x2f);\n  }" if (parenthesized_expression "(param_2 == (char *)0x0)" ( (binary_expression "param_2 == (char *)0x0" identifier == (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n                    \n    crypt_argchk("fname != NULL","src/mac/hmac/hmac_file.c",0x2f);\n  }" { (expression_statement "crypt_argchk("fname != NULL","src/mac/hmac/hmac_file.c",0x2f);" (call_expression "crypt_argchk("fname != NULL","src/mac/hmac/hmac_file.c",0x2f)" identifier (argument_list "("fname != NULL","src/mac/hmac/hmac_file.c",0x2f)" ( (string_literal ""fname != NULL"" " string_content ") , (string_literal ""src/mac/hmac/hmac_file.c"" " string_content ") , number_literal ))) ;) })) (if_statement "if (param_3 == 0) {\n                    \n    crypt_argchk("key != NULL","src/mac/hmac/hmac_file.c",0x30);\n  }" if (parenthesized_expression "(param_3 == 0)" ( (binary_expression "param_3 == 0" identifier == number_literal) )) (compound_statement "{\n                    \n    crypt_argchk("key != NULL","src/mac/hmac/hmac_file.c",0x30);\n  }" { (expression_statement "crypt_argchk("key != NULL","src/mac/hmac/hmac_file.c",0x30);" (call_expression "crypt_argchk("key != NULL","src/mac/hmac/hmac_file.c",0x30)" identifier (argument_list "("key != NULL","src/mac/hmac/hmac_file.c",0x30)" ( (string_literal ""key != NULL"" " string_content ") , (string_literal ""src/mac/hmac/hmac_file.c"" " string_content ") , number_literal ))) ;) })) (if_statement "if (param_5 == 0) {\n                    \n    crypt_argchk("out != NULL","src/mac/hmac/hmac_file.c",0x31);\n  }" if (parenthesized_expression "(param_5 == 0)" ( (binary_expression "param_5 == 0" identifier == number_literal) )) (compound_statement "{\n                    \n    crypt_argchk("out != NULL","src/mac/hmac/hmac_file.c",0x31);\n  }" { (expression_statement "crypt_argchk("out != NULL","src/mac/hmac/hmac_file.c",0x31);" (call_expression "crypt_argchk("out != NULL","src/mac/hmac/hmac_file.c",0x31)" identifier (argument_list "("out != NULL","src/mac/hmac/hmac_file.c",0x31)" ( (string_literal ""out != NULL"" " string_content ") , (string_literal ""src/mac/hmac/hmac_file.c"" " string_content ") , number_literal ))) ;) })) (if_statement "if (param_6 == 0) {\n                    \n    crypt_argchk("outlen != NULL","src/mac/hmac/hmac_file.c",0x32);\n  }" if (parenthesized_expression "(param_6 == 0)" ( (binary_expression "param_6 == 0" identifier == number_literal) )) (compound_statement "{\n                    \n    crypt_argchk("outlen != NULL","src/mac/hmac/hmac_file.c",0x32);\n  }" { (expression_statement "crypt_argchk("outlen != NULL","src/mac/hmac/hmac_file.c",0x32);" (call_expression "crypt_argchk("outlen != NULL","src/mac/hmac/hmac_file.c",0x32)" identifier (argument_list "("outlen != NULL","src/mac/hmac/hmac_file.c",0x32)" ( (string_literal ""outlen != NULL"" " string_content ") , (string_literal ""src/mac/hmac/hmac_file.c"" " string_content ") , number_literal ))) ;) })) (expression_statement "__ptr = malloc(0x2000);" (assignment_expression "__ptr = malloc(0x2000)" identifier = (call_expression "malloc(0x2000)" identifier (argument_list "(0x2000)" ( number_literal )))) ;) (if_statement "if (__ptr == (void *)0x0) {\n    iVar1 = 0xd;\n  }\n  else {\n    iVar1 = hash_is_valid(param_1);\n    if (iVar1 == 0) {\n      iVar1 = hmac_init(local_398,param_1,param_3,param_4);\n      if (iVar1 == 0) {\n        __stream = fopen(param_2,"rb");\n        if (__stream == (FILE *)0x0) {\n          iVar1 = 0x11;\n        }\n        else {\n          do {\n            sVar3 = fread(__ptr,1,0x2000,__stream);\n            iVar1 = hmac_process(local_398,__ptr,sVar3);\n            if (iVar1 != 0) {\n              fclose(__stream);\n              goto LAB_001614b0;\n            }\n          } while (sVar3 == 0x2000);\n          iVar1 = 1;\n          iVar2 = fclose(__stream);\n          if (iVar2 == 0) {\n            iVar1 = hmac_done(local_398,param_5,param_6);\n          }\nLAB_001614b0:\n          zeromem(__ptr,0x2000);\n        }\n      }\n    }\n    free(__ptr);\n  }" if (parenthesized_expression "(__ptr == (void *)0x0)" ( (binary_expression "__ptr == (void *)0x0" identifier == (cast_expression "(void *)0x0" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    iVar1 = 0xd;\n  }" { (expression_statement "iVar1 = 0xd;" (assignment_expression "iVar1 = 0xd" identifier = number_literal) ;) }) (else_clause "else {\n    iVar1 = hash_is_valid(param_1);\n    if (iVar1 == 0) {\n      iVar1 = hmac_init(local_398,param_1,param_3,param_4);\n      if (iVar1 == 0) {\n        __stream = fopen(param_2,"rb");\n        if (__stream == (FILE *)0x0) {\n          iVar1 = 0x11;\n        }\n        else {\n          do {\n            sVar3 = fread(__ptr,1,0x2000,__stream);\n            iVar1 = hmac_process(local_398,__ptr,sVar3);\n            if (iVar1 != 0) {\n              fclose(__stream);\n              goto LAB_001614b0;\n            }\n          } while (sVar3 == 0x2000);\n          iVar1 = 1;\n          iVar2 = fclose(__stream);\n          if (iVar2 == 0) {\n            iVar1 = hmac_done(local_398,param_5,param_6);\n          }\nLAB_001614b0:\n          zeromem(__ptr,0x2000);\n        }\n      }\n    }\n    free(__ptr);\n  }" else (compound_statement "{\n    iVar1 = hash_is_valid(param_1);\n    if (iVar1 == 0) {\n      iVar1 = hmac_init(local_398,param_1,param_3,param_4);\n      if (iVar1 == 0) {\n        __stream = fopen(param_2,"rb");\n        if (__stream == (FILE *)0x0) {\n          iVar1 = 0x11;\n        }\n        else {\n          do {\n            sVar3 = fread(__ptr,1,0x2000,__stream);\n            iVar1 = hmac_process(local_398,__ptr,sVar3);\n            if (iVar1 != 0) {\n              fclose(__stream);\n              goto LAB_001614b0;\n            }\n          } while (sVar3 == 0x2000);\n          iVar1 = 1;\n          iVar2 = fclose(__stream);\n          if (iVar2 == 0) {\n            iVar1 = hmac_done(local_398,param_5,param_6);\n          }\nLAB_001614b0:\n          zeromem(__ptr,0x2000);\n        }\n      }\n    }\n    free(__ptr);\n  }" { (expression_statement "iVar1 = hash_is_valid(param_1);" (assignment_expression "iVar1 = hash_is_valid(param_1)" identifier = (call_expression "hash_is_valid(param_1)" identifier (argument_list "(param_1)" ( identifier )))) ;) (if_statement "if (iVar1 == 0) {\n      iVar1 = hmac_init(local_398,param_1,param_3,param_4);\n      if (iVar1 == 0) {\n        __stream = fopen(param_2,"rb");\n        if (__stream == (FILE *)0x0) {\n          iVar1 = 0x11;\n        }\n        else {\n          do {\n            sVar3 = fread(__ptr,1,0x2000,__stream);\n            iVar1 = hmac_process(local_398,__ptr,sVar3);\n            if (iVar1 != 0) {\n              fclose(__stream);\n              goto LAB_001614b0;\n            }\n          } while (sVar3 == 0x2000);\n          iVar1 = 1;\n          iVar2 = fclose(__stream);\n          if (iVar2 == 0) {\n            iVar1 = hmac_done(local_398,param_5,param_6);\n          }\nLAB_001614b0:\n          zeromem(__ptr,0x2000);\n        }\n      }\n    }" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (compound_statement "{\n      iVar1 = hmac_init(local_398,param_1,param_3,param_4);\n      if (iVar1 == 0) {\n        __stream = fopen(param_2,"rb");\n        if (__stream == (FILE *)0x0) {\n          iVar1 = 0x11;\n        }\n        else {\n          do {\n            sVar3 = fread(__ptr,1,0x2000,__stream);\n            iVar1 = hmac_process(local_398,__ptr,sVar3);\n            if (iVar1 != 0) {\n              fclose(__stream);\n              goto LAB_001614b0;\n            }\n          } while (sVar3 == 0x2000);\n          iVar1 = 1;\n          iVar2 = fclose(__stream);\n          if (iVar2 == 0) {\n            iVar1 = hmac_done(local_398,param_5,param_6);\n          }\nLAB_001614b0:\n          zeromem(__ptr,0x2000);\n        }\n      }\n    }" { (expression_statement "iVar1 = hmac_init(local_398,param_1,param_3,param_4);" (assignment_expression "iVar1 = hmac_init(local_398,param_1,param_3,param_4)" identifier = (call_expression "hmac_init(local_398,param_1,param_3,param_4)" identifier (argument_list "(local_398,param_1,param_3,param_4)" ( identifier , identifier , identifier , identifier )))) ;) (if_statement "if (iVar1 == 0) {\n        __stream = fopen(param_2,"rb");\n        if (__stream == (FILE *)0x0) {\n          iVar1 = 0x11;\n        }\n        else {\n          do {\n            sVar3 = fread(__ptr,1,0x2000,__stream);\n            iVar1 = hmac_process(local_398,__ptr,sVar3);\n            if (iVar1 != 0) {\n              fclose(__stream);\n              goto LAB_001614b0;\n            }\n          } while (sVar3 == 0x2000);\n          iVar1 = 1;\n          iVar2 = fclose(__stream);\n          if (iVar2 == 0) {\n            iVar1 = hmac_done(local_398,param_5,param_6);\n          }\nLAB_001614b0:\n          zeromem(__ptr,0x2000);\n        }\n      }" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (compound_statement "{\n        __stream = fopen(param_2,"rb");\n        if (__stream == (FILE *)0x0) {\n          iVar1 = 0x11;\n        }\n        else {\n          do {\n            sVar3 = fread(__ptr,1,0x2000,__stream);\n            iVar1 = hmac_process(local_398,__ptr,sVar3);\n            if (iVar1 != 0) {\n              fclose(__stream);\n              goto LAB_001614b0;\n            }\n          } while (sVar3 == 0x2000);\n          iVar1 = 1;\n          iVar2 = fclose(__stream);\n          if (iVar2 == 0) {\n            iVar1 = hmac_done(local_398,param_5,param_6);\n          }\nLAB_001614b0:\n          zeromem(__ptr,0x2000);\n        }\n      }" { (expression_statement "__stream = fopen(param_2,"rb");" (assignment_expression "__stream = fopen(param_2,"rb")" identifier = (call_expression "fopen(param_2,"rb")" identifier (argument_list "(param_2,"rb")" ( identifier , (string_literal ""rb"" " string_content ") )))) ;) (if_statement "if (__stream == (FILE *)0x0) {\n          iVar1 = 0x11;\n        }\n        else {\n          do {\n            sVar3 = fread(__ptr,1,0x2000,__stream);\n            iVar1 = hmac_process(local_398,__ptr,sVar3);\n            if (iVar1 != 0) {\n              fclose(__stream);\n              goto LAB_001614b0;\n            }\n          } while (sVar3 == 0x2000);\n          iVar1 = 1;\n          iVar2 = fclose(__stream);\n          if (iVar2 == 0) {\n            iVar1 = hmac_done(local_398,param_5,param_6);\n          }\nLAB_001614b0:\n          zeromem(__ptr,0x2000);\n        }" if (parenthesized_expression "(__stream == (FILE *)0x0)" ( (binary_expression "__stream == (FILE *)0x0" identifier == (cast_expression "(FILE *)0x0" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n          iVar1 = 0x11;\n        }" { (expression_statement "iVar1 = 0x11;" (assignment_expression "iVar1 = 0x11" identifier = number_literal) ;) }) (else_clause "else {\n          do {\n            sVar3 = fread(__ptr,1,0x2000,__stream);\n            iVar1 = hmac_process(local_398,__ptr,sVar3);\n            if (iVar1 != 0) {\n              fclose(__stream);\n              goto LAB_001614b0;\n            }\n          } while (sVar3 == 0x2000);\n          iVar1 = 1;\n          iVar2 = fclose(__stream);\n          if (iVar2 == 0) {\n            iVar1 = hmac_done(local_398,param_5,param_6);\n          }\nLAB_001614b0:\n          zeromem(__ptr,0x2000);\n        }" else (compound_statement "{\n          do {\n            sVar3 = fread(__ptr,1,0x2000,__stream);\n            iVar1 = hmac_process(local_398,__ptr,sVar3);\n            if (iVar1 != 0) {\n              fclose(__stream);\n              goto LAB_001614b0;\n            }\n          } while (sVar3 == 0x2000);\n          iVar1 = 1;\n          iVar2 = fclose(__stream);\n          if (iVar2 == 0) {\n            iVar1 = hmac_done(local_398,param_5,param_6);\n          }\nLAB_001614b0:\n          zeromem(__ptr,0x2000);\n        }" { (do_statement "do {\n            sVar3 = fread(__ptr,1,0x2000,__stream);\n            iVar1 = hmac_process(local_398,__ptr,sVar3);\n            if (iVar1 != 0) {\n              fclose(__stream);\n              goto LAB_001614b0;\n            }\n          } while (sVar3 == 0x2000);" do (compound_statement "{\n            sVar3 = fread(__ptr,1,0x2000,__stream);\n            iVar1 = hmac_process(local_398,__ptr,sVar3);\n            if (iVar1 != 0) {\n              fclose(__stream);\n              goto LAB_001614b0;\n            }\n          }" { (expression_statement "sVar3 = fread(__ptr,1,0x2000,__stream);" (assignment_expression "sVar3 = fread(__ptr,1,0x2000,__stream)" identifier = (call_expression "fread(__ptr,1,0x2000,__stream)" identifier (argument_list "(__ptr,1,0x2000,__stream)" ( identifier , number_literal , number_literal , identifier )))) ;) (expression_statement "iVar1 = hmac_process(local_398,__ptr,sVar3);" (assignment_expression "iVar1 = hmac_process(local_398,__ptr,sVar3)" identifier = (call_expression "hmac_process(local_398,__ptr,sVar3)" identifier (argument_list "(local_398,__ptr,sVar3)" ( identifier , identifier , identifier )))) ;) (if_statement "if (iVar1 != 0) {\n              fclose(__stream);\n              goto LAB_001614b0;\n            }" if (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) (compound_statement "{\n              fclose(__stream);\n              goto LAB_001614b0;\n            }" { (expression_statement "fclose(__stream);" (call_expression "fclose(__stream)" identifier (argument_list "(__stream)" ( identifier ))) ;) (goto_statement "goto LAB_001614b0;" goto statement_identifier ;) })) }) while (parenthesized_expression "(sVar3 == 0x2000)" ( (binary_expression "sVar3 == 0x2000" identifier == number_literal) )) ;) (expression_statement "iVar1 = 1;" (assignment_expression "iVar1 = 1" identifier = number_literal) ;) (expression_statement "iVar2 = fclose(__stream);" (assignment_expression "iVar2 = fclose(__stream)" identifier = (call_expression "fclose(__stream)" identifier (argument_list "(__stream)" ( identifier )))) ;) (if_statement "if (iVar2 == 0) {\n            iVar1 = hmac_done(local_398,param_5,param_6);\n          }" if (parenthesized_expression "(iVar2 == 0)" ( (binary_expression "iVar2 == 0" identifier == number_literal) )) (compound_statement "{\n            iVar1 = hmac_done(local_398,param_5,param_6);\n          }" { (expression_statement "iVar1 = hmac_done(local_398,param_5,param_6);" (assignment_expression "iVar1 = hmac_done(local_398,param_5,param_6)" identifier = (call_expression "hmac_done(local_398,param_5,param_6)" identifier (argument_list "(local_398,param_5,param_6)" ( identifier , identifier , identifier )))) ;) })) (labeled_statement "LAB_001614b0:\n          zeromem(__ptr,0x2000);" statement_identifier : (expression_statement "zeromem(__ptr,0x2000);" (call_expression "zeromem(__ptr,0x2000)" identifier (argument_list "(__ptr,0x2000)" ( identifier , number_literal ))) ;)) }))) })) })) (expression_statement "free(__ptr);" (call_expression "free(__ptr)" identifier (argument_list "(__ptr)" ( identifier ))) ;) }))) (if_statement "if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return iVar1;\n  }" if (parenthesized_expression "(local_40 == *(long *)(in_FS_OFFSET + 0x28))" ( (binary_expression "local_40 == *(long *)(in_FS_OFFSET + 0x28)" identifier == (pointer_expression "*(long *)(in_FS_OFFSET + 0x28)" * (cast_expression "(long *)(in_FS_OFFSET + 0x28)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_FS_OFFSET + 0x28)" ( (binary_expression "in_FS_OFFSET + 0x28" identifier + number_literal) ))))) )) (compound_statement "{\n    return iVar1;\n  }" { (return_statement "return iVar1;" return identifier ;) })) (expression_statement "__stack_chk_fail();" (call_expression "__stack_chk_fail()" identifier (argument_list "()" ( ))) ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration (sized_type_specifier long) IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration (sized_type_specifier long) IDENT) , (parameter_declaration (sized_type_specifier long) IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration (sized_type_specifier long) IDENT ;) (declaration TYPE (array_declarator IDENT [ LIT ]) ;) (declaration (sized_type_specifier long) IDENT ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor (sized_type_specifier long) (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( (string_literal " string_content ") , (string_literal " string_content ") , LIT ))) ;) })) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( (string_literal " string_content ") , (string_literal " string_content ") , LIT ))) ;) })) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( (string_literal " string_content ") , (string_literal " string_content ") , LIT ))) ;) })) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( (string_literal " string_content ") , (string_literal " string_content ") , LIT ))) ;) })) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( LIT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT , IDENT , IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , (string_literal " string_content ") )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) }) (else_clause else (compound_statement { (do_statement do (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , LIT , LIT , IDENT )))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT , IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (goto_statement goto statement_identifier ;) })) }) while (parenthesized_expression ( (binary_expression IDENT == LIT) )) ;) (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT , IDENT )))) ;) })) (labeled_statement statement_identifier : (expression_statement (call_expression IDENT (argument_list ( IDENT , LIT ))) ;)) }))) })) })) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) }))) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (pointer_expression * (cast_expression ( (type_descriptor (sized_type_specifier long) (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) )) (compound_statement { (return_statement return IDENT ;) })) (expression_statement (call_expression IDENT (argument_list ( ))) ;) })))
(function_definition "int hmac_file(undefined4 param_1,char *param_2,long param_3,undefined8 param_4,long param_5,\n             long param_6)\n\n{\n  int iVar1;\n  int iVar2;\n  void *__ptr;\n  FILE *__stream;\n  size_t sVar3;\n  long in_FS_OFFSET;\n  undefined1 local_398 [856];\n  long local_40;\n  \n  local_40 = *(long *)(in_FS_OFFSET + 0x28);\n  if (param_2 == (char *)0x0) {\n                    \n    crypt_argchk("fname != NULL","src/mac/hmac/hmac_file.c",0x2f);\n  }\n  if (param_3 == 0) {\n                    \n    crypt_argchk("key != NULL","src/mac/hmac/hmac_file.c",0x30);\n  }\n  if (param_5 == 0) {\n                    \n    crypt_argchk("out != NULL","src/mac/hmac/hmac_file.c",0x31);\n  }\n  if (param_6 == 0) {\n                    \n    crypt_argchk("outlen != NULL","src/mac/hmac/hmac_file.c",0x32);\n  }\n  __ptr = malloc(0x2000);\n  if (__ptr == (void *)0x0) {\n    iVar1 = 0xd;\n  }\n  else {\n    iVar1 = hash_is_valid(param_1);\n    if (iVar1 == 0) {\n      iVar1 = hmac_init(local_398,param_1,param_3,param_4);\n      if (iVar1 == 0) {\n        __stream = fopen(param_2,"rb");\n        if (__stream == (FILE *)0x0) {\n          iVar1 = 0x11;\n        }\n        else {\n          do {\n            sVar3 = fread(__ptr,1,0x2000,__stream);\n            iVar1 = hmac_process(local_398,__ptr,sVar3);\n            if (iVar1 != 0) {\n              fclose(__stream);\n              goto LAB_001614b0;\n            }\n          } while (sVar3 == 0x2000);\n          iVar1 = 1;\n          iVar2 = fclose(__stream);\n          if (iVar2 == 0) {\n            iVar1 = hmac_done(local_398,param_5,param_6);\n          }\nLAB_001614b0:\n          zeromem(__ptr,0x2000);\n        }\n      }\n    }\n    free(__ptr);\n  }\n  if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return iVar1;\n  }\n                    \n  __stack_chk_fail();\n}" (primitive_type "int") (function_declarator "hmac_file(undefined4 param_1,char *param_2,long param_3,undefined8 param_4,long param_5,\n             long param_6)" (identifier "hmac_file") (parameter_list "(undefined4 param_1,char *param_2,long param_3,undefined8 param_4,long param_5,\n             long param_6)" (( "(") (parameter_declaration "undefined4 param_1" (type_identifier "undefined4") (identifier "param_1")) (, ",") (parameter_declaration "char *param_2" (primitive_type "char") (pointer_declarator "*param_2" (* "*") (identifier "param_2"))) (, ",") (parameter_declaration "long param_3" (sized_type_specifier "long" (long "long")) (identifier "param_3")) (, ",") (parameter_declaration "undefined8 param_4" (type_identifier "undefined8") (identifier "param_4")) (, ",") (parameter_declaration "long param_5" (sized_type_specifier "long" (long "long")) (identifier "param_5")) (, ",") (parameter_declaration "long param_6" (sized_type_specifier "long" (long "long")) (identifier "param_6")) () ")"))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  void *__ptr;\n  FILE *__stream;\n  size_t sVar3;\n  long in_FS_OFFSET;\n  undefined1 local_398 [856];\n  long local_40;\n  \n  local_40 = *(long *)(in_FS_OFFSET + 0x28);\n  if (param_2 == (char *)0x0) {\n                    \n    crypt_argchk("fname != NULL","src/mac/hmac/hmac_file.c",0x2f);\n  }\n  if (param_3 == 0) {\n                    \n    crypt_argchk("key != NULL","src/mac/hmac/hmac_file.c",0x30);\n  }\n  if (param_5 == 0) {\n                    \n    crypt_argchk("out != NULL","src/mac/hmac/hmac_file.c",0x31);\n  }\n  if (param_6 == 0) {\n                    \n    crypt_argchk("outlen != NULL","src/mac/hmac/hmac_file.c",0x32);\n  }\n  __ptr = malloc(0x2000);\n  if (__ptr == (void *)0x0) {\n    iVar1 = 0xd;\n  }\n  else {\n    iVar1 = hash_is_valid(param_1);\n    if (iVar1 == 0) {\n      iVar1 = hmac_init(local_398,param_1,param_3,param_4);\n      if (iVar1 == 0) {\n        __stream = fopen(param_2,"rb");\n        if (__stream == (FILE *)0x0) {\n          iVar1 = 0x11;\n        }\n        else {\n          do {\n            sVar3 = fread(__ptr,1,0x2000,__stream);\n            iVar1 = hmac_process(local_398,__ptr,sVar3);\n            if (iVar1 != 0) {\n              fclose(__stream);\n              goto LAB_001614b0;\n            }\n          } while (sVar3 == 0x2000);\n          iVar1 = 1;\n          iVar2 = fclose(__stream);\n          if (iVar2 == 0) {\n            iVar1 = hmac_done(local_398,param_5,param_6);\n          }\nLAB_001614b0:\n          zeromem(__ptr,0x2000);\n        }\n      }\n    }\n    free(__ptr);\n  }\n  if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return iVar1;\n  }\n                    \n  __stack_chk_fail();\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (declaration "void *__ptr;" (primitive_type "void") (pointer_declarator "*__ptr" (* "*") (identifier "__ptr")) (; ";")) (declaration "FILE *__stream;" (type_identifier "FILE") (pointer_declarator "*__stream" (* "*") (identifier "__stream")) (; ";")) (declaration "size_t sVar3;" (primitive_type "size_t") (identifier "sVar3") (; ";")) (declaration "long in_FS_OFFSET;" (sized_type_specifier "long" (long "long")) (identifier "in_FS_OFFSET") (; ";")) (declaration "undefined1 local_398 [856];" (type_identifier "undefined1") (array_declarator "local_398 [856]" (identifier "local_398") ([ "[") (number_literal "856") (] "]")) (; ";")) (declaration "long local_40;" (sized_type_specifier "long" (long "long")) (identifier "local_40") (; ";")) (expression_statement "local_40 = *(long *)(in_FS_OFFSET + 0x28);" (assignment_expression "local_40 = *(long *)(in_FS_OFFSET + 0x28)" (identifier "local_40") (= "=") (pointer_expression "*(long *)(in_FS_OFFSET + 0x28)" (* "*") (cast_expression "(long *)(in_FS_OFFSET + 0x28)" (( "(") (type_descriptor "long *" (sized_type_specifier "long" (long "long")) (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(in_FS_OFFSET + 0x28)" (( "(") (binary_expression "in_FS_OFFSET + 0x28" (identifier "in_FS_OFFSET") (+ "+") (number_literal "0x28")) () ")"))))) (; ";")) (if_statement "if (param_2 == (char *)0x0) {\n                    \n    crypt_argchk("fname != NULL","src/mac/hmac/hmac_file.c",0x2f);\n  }" (if "if") (parenthesized_expression "(param_2 == (char *)0x0)" (( "(") (binary_expression "param_2 == (char *)0x0" (identifier "param_2") (== "==") (cast_expression "(char *)0x0" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n                    \n    crypt_argchk("fname != NULL","src/mac/hmac/hmac_file.c",0x2f);\n  }" ({ "{") (expression_statement "crypt_argchk("fname != NULL","src/mac/hmac/hmac_file.c",0x2f);" (call_expression "crypt_argchk("fname != NULL","src/mac/hmac/hmac_file.c",0x2f)" (identifier "crypt_argchk") (argument_list "("fname != NULL","src/mac/hmac/hmac_file.c",0x2f)" (( "(") (string_literal ""fname != NULL"" (" """) (string_content "fname != NULL") (" """)) (, ",") (string_literal ""src/mac/hmac/hmac_file.c"" (" """) (string_content "src/mac/hmac/hmac_file.c") (" """)) (, ",") (number_literal "0x2f") () ")"))) (; ";")) (} "}"))) (if_statement "if (param_3 == 0) {\n                    \n    crypt_argchk("key != NULL","src/mac/hmac/hmac_file.c",0x30);\n  }" (if "if") (parenthesized_expression "(param_3 == 0)" (( "(") (binary_expression "param_3 == 0" (identifier "param_3") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n                    \n    crypt_argchk("key != NULL","src/mac/hmac/hmac_file.c",0x30);\n  }" ({ "{") (expression_statement "crypt_argchk("key != NULL","src/mac/hmac/hmac_file.c",0x30);" (call_expression "crypt_argchk("key != NULL","src/mac/hmac/hmac_file.c",0x30)" (identifier "crypt_argchk") (argument_list "("key != NULL","src/mac/hmac/hmac_file.c",0x30)" (( "(") (string_literal ""key != NULL"" (" """) (string_content "key != NULL") (" """)) (, ",") (string_literal ""src/mac/hmac/hmac_file.c"" (" """) (string_content "src/mac/hmac/hmac_file.c") (" """)) (, ",") (number_literal "0x30") () ")"))) (; ";")) (} "}"))) (if_statement "if (param_5 == 0) {\n                    \n    crypt_argchk("out != NULL","src/mac/hmac/hmac_file.c",0x31);\n  }" (if "if") (parenthesized_expression "(param_5 == 0)" (( "(") (binary_expression "param_5 == 0" (identifier "param_5") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n                    \n    crypt_argchk("out != NULL","src/mac/hmac/hmac_file.c",0x31);\n  }" ({ "{") (expression_statement "crypt_argchk("out != NULL","src/mac/hmac/hmac_file.c",0x31);" (call_expression "crypt_argchk("out != NULL","src/mac/hmac/hmac_file.c",0x31)" (identifier "crypt_argchk") (argument_list "("out != NULL","src/mac/hmac/hmac_file.c",0x31)" (( "(") (string_literal ""out != NULL"" (" """) (string_content "out != NULL") (" """)) (, ",") (string_literal ""src/mac/hmac/hmac_file.c"" (" """) (string_content "src/mac/hmac/hmac_file.c") (" """)) (, ",") (number_literal "0x31") () ")"))) (; ";")) (} "}"))) (if_statement "if (param_6 == 0) {\n                    \n    crypt_argchk("outlen != NULL","src/mac/hmac/hmac_file.c",0x32);\n  }" (if "if") (parenthesized_expression "(param_6 == 0)" (( "(") (binary_expression "param_6 == 0" (identifier "param_6") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n                    \n    crypt_argchk("outlen != NULL","src/mac/hmac/hmac_file.c",0x32);\n  }" ({ "{") (expression_statement "crypt_argchk("outlen != NULL","src/mac/hmac/hmac_file.c",0x32);" (call_expression "crypt_argchk("outlen != NULL","src/mac/hmac/hmac_file.c",0x32)" (identifier "crypt_argchk") (argument_list "("outlen != NULL","src/mac/hmac/hmac_file.c",0x32)" (( "(") (string_literal ""outlen != NULL"" (" """) (string_content "outlen != NULL") (" """)) (, ",") (string_literal ""src/mac/hmac/hmac_file.c"" (" """) (string_content "src/mac/hmac/hmac_file.c") (" """)) (, ",") (number_literal "0x32") () ")"))) (; ";")) (} "}"))) (expression_statement "__ptr = malloc(0x2000);" (assignment_expression "__ptr = malloc(0x2000)" (identifier "__ptr") (= "=") (call_expression "malloc(0x2000)" (identifier "malloc") (argument_list "(0x2000)" (( "(") (number_literal "0x2000") () ")")))) (; ";")) (if_statement "if (__ptr == (void *)0x0) {\n    iVar1 = 0xd;\n  }\n  else {\n    iVar1 = hash_is_valid(param_1);\n    if (iVar1 == 0) {\n      iVar1 = hmac_init(local_398,param_1,param_3,param_4);\n      if (iVar1 == 0) {\n        __stream = fopen(param_2,"rb");\n        if (__stream == (FILE *)0x0) {\n          iVar1 = 0x11;\n        }\n        else {\n          do {\n            sVar3 = fread(__ptr,1,0x2000,__stream);\n            iVar1 = hmac_process(local_398,__ptr,sVar3);\n            if (iVar1 != 0) {\n              fclose(__stream);\n              goto LAB_001614b0;\n            }\n          } while (sVar3 == 0x2000);\n          iVar1 = 1;\n          iVar2 = fclose(__stream);\n          if (iVar2 == 0) {\n            iVar1 = hmac_done(local_398,param_5,param_6);\n          }\nLAB_001614b0:\n          zeromem(__ptr,0x2000);\n        }\n      }\n    }\n    free(__ptr);\n  }" (if "if") (parenthesized_expression "(__ptr == (void *)0x0)" (( "(") (binary_expression "__ptr == (void *)0x0" (identifier "__ptr") (== "==") (cast_expression "(void *)0x0" (( "(") (type_descriptor "void *" (primitive_type "void") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n    iVar1 = 0xd;\n  }" ({ "{") (expression_statement "iVar1 = 0xd;" (assignment_expression "iVar1 = 0xd" (identifier "iVar1") (= "=") (number_literal "0xd")) (; ";")) (} "}")) (else_clause "else {\n    iVar1 = hash_is_valid(param_1);\n    if (iVar1 == 0) {\n      iVar1 = hmac_init(local_398,param_1,param_3,param_4);\n      if (iVar1 == 0) {\n        __stream = fopen(param_2,"rb");\n        if (__stream == (FILE *)0x0) {\n          iVar1 = 0x11;\n        }\n        else {\n          do {\n            sVar3 = fread(__ptr,1,0x2000,__stream);\n            iVar1 = hmac_process(local_398,__ptr,sVar3);\n            if (iVar1 != 0) {\n              fclose(__stream);\n              goto LAB_001614b0;\n            }\n          } while (sVar3 == 0x2000);\n          iVar1 = 1;\n          iVar2 = fclose(__stream);\n          if (iVar2 == 0) {\n            iVar1 = hmac_done(local_398,param_5,param_6);\n          }\nLAB_001614b0:\n          zeromem(__ptr,0x2000);\n        }\n      }\n    }\n    free(__ptr);\n  }" (else "else") (compound_statement "{\n    iVar1 = hash_is_valid(param_1);\n    if (iVar1 == 0) {\n      iVar1 = hmac_init(local_398,param_1,param_3,param_4);\n      if (iVar1 == 0) {\n        __stream = fopen(param_2,"rb");\n        if (__stream == (FILE *)0x0) {\n          iVar1 = 0x11;\n        }\n        else {\n          do {\n            sVar3 = fread(__ptr,1,0x2000,__stream);\n            iVar1 = hmac_process(local_398,__ptr,sVar3);\n            if (iVar1 != 0) {\n              fclose(__stream);\n              goto LAB_001614b0;\n            }\n          } while (sVar3 == 0x2000);\n          iVar1 = 1;\n          iVar2 = fclose(__stream);\n          if (iVar2 == 0) {\n            iVar1 = hmac_done(local_398,param_5,param_6);\n          }\nLAB_001614b0:\n          zeromem(__ptr,0x2000);\n        }\n      }\n    }\n    free(__ptr);\n  }" ({ "{") (expression_statement "iVar1 = hash_is_valid(param_1);" (assignment_expression "iVar1 = hash_is_valid(param_1)" (identifier "iVar1") (= "=") (call_expression "hash_is_valid(param_1)" (identifier "hash_is_valid") (argument_list "(param_1)" (( "(") (identifier "param_1") () ")")))) (; ";")) (if_statement "if (iVar1 == 0) {\n      iVar1 = hmac_init(local_398,param_1,param_3,param_4);\n      if (iVar1 == 0) {\n        __stream = fopen(param_2,"rb");\n        if (__stream == (FILE *)0x0) {\n          iVar1 = 0x11;\n        }\n        else {\n          do {\n            sVar3 = fread(__ptr,1,0x2000,__stream);\n            iVar1 = hmac_process(local_398,__ptr,sVar3);\n            if (iVar1 != 0) {\n              fclose(__stream);\n              goto LAB_001614b0;\n            }\n          } while (sVar3 == 0x2000);\n          iVar1 = 1;\n          iVar2 = fclose(__stream);\n          if (iVar2 == 0) {\n            iVar1 = hmac_done(local_398,param_5,param_6);\n          }\nLAB_001614b0:\n          zeromem(__ptr,0x2000);\n        }\n      }\n    }" (if "if") (parenthesized_expression "(iVar1 == 0)" (( "(") (binary_expression "iVar1 == 0" (identifier "iVar1") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n      iVar1 = hmac_init(local_398,param_1,param_3,param_4);\n      if (iVar1 == 0) {\n        __stream = fopen(param_2,"rb");\n        if (__stream == (FILE *)0x0) {\n          iVar1 = 0x11;\n        }\n        else {\n          do {\n            sVar3 = fread(__ptr,1,0x2000,__stream);\n            iVar1 = hmac_process(local_398,__ptr,sVar3);\n            if (iVar1 != 0) {\n              fclose(__stream);\n              goto LAB_001614b0;\n            }\n          } while (sVar3 == 0x2000);\n          iVar1 = 1;\n          iVar2 = fclose(__stream);\n          if (iVar2 == 0) {\n            iVar1 = hmac_done(local_398,param_5,param_6);\n          }\nLAB_001614b0:\n          zeromem(__ptr,0x2000);\n        }\n      }\n    }" ({ "{") (expression_statement "iVar1 = hmac_init(local_398,param_1,param_3,param_4);" (assignment_expression "iVar1 = hmac_init(local_398,param_1,param_3,param_4)" (identifier "iVar1") (= "=") (call_expression "hmac_init(local_398,param_1,param_3,param_4)" (identifier "hmac_init") (argument_list "(local_398,param_1,param_3,param_4)" (( "(") (identifier "local_398") (, ",") (identifier "param_1") (, ",") (identifier "param_3") (, ",") (identifier "param_4") () ")")))) (; ";")) (if_statement "if (iVar1 == 0) {\n        __stream = fopen(param_2,"rb");\n        if (__stream == (FILE *)0x0) {\n          iVar1 = 0x11;\n        }\n        else {\n          do {\n            sVar3 = fread(__ptr,1,0x2000,__stream);\n            iVar1 = hmac_process(local_398,__ptr,sVar3);\n            if (iVar1 != 0) {\n              fclose(__stream);\n              goto LAB_001614b0;\n            }\n          } while (sVar3 == 0x2000);\n          iVar1 = 1;\n          iVar2 = fclose(__stream);\n          if (iVar2 == 0) {\n            iVar1 = hmac_done(local_398,param_5,param_6);\n          }\nLAB_001614b0:\n          zeromem(__ptr,0x2000);\n        }\n      }" (if "if") (parenthesized_expression "(iVar1 == 0)" (( "(") (binary_expression "iVar1 == 0" (identifier "iVar1") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n        __stream = fopen(param_2,"rb");\n        if (__stream == (FILE *)0x0) {\n          iVar1 = 0x11;\n        }\n        else {\n          do {\n            sVar3 = fread(__ptr,1,0x2000,__stream);\n            iVar1 = hmac_process(local_398,__ptr,sVar3);\n            if (iVar1 != 0) {\n              fclose(__stream);\n              goto LAB_001614b0;\n            }\n          } while (sVar3 == 0x2000);\n          iVar1 = 1;\n          iVar2 = fclose(__stream);\n          if (iVar2 == 0) {\n            iVar1 = hmac_done(local_398,param_5,param_6);\n          }\nLAB_001614b0:\n          zeromem(__ptr,0x2000);\n        }\n      }" ({ "{") (expression_statement "__stream = fopen(param_2,"rb");" (assignment_expression "__stream = fopen(param_2,"rb")" (identifier "__stream") (= "=") (call_expression "fopen(param_2,"rb")" (identifier "fopen") (argument_list "(param_2,"rb")" (( "(") (identifier "param_2") (, ",") (string_literal ""rb"" (" """) (string_content "rb") (" """)) () ")")))) (; ";")) (if_statement "if (__stream == (FILE *)0x0) {\n          iVar1 = 0x11;\n        }\n        else {\n          do {\n            sVar3 = fread(__ptr,1,0x2000,__stream);\n            iVar1 = hmac_process(local_398,__ptr,sVar3);\n            if (iVar1 != 0) {\n              fclose(__stream);\n              goto LAB_001614b0;\n            }\n          } while (sVar3 == 0x2000);\n          iVar1 = 1;\n          iVar2 = fclose(__stream);\n          if (iVar2 == 0) {\n            iVar1 = hmac_done(local_398,param_5,param_6);\n          }\nLAB_001614b0:\n          zeromem(__ptr,0x2000);\n        }" (if "if") (parenthesized_expression "(__stream == (FILE *)0x0)" (( "(") (binary_expression "__stream == (FILE *)0x0" (identifier "__stream") (== "==") (cast_expression "(FILE *)0x0" (( "(") (type_descriptor "FILE *" (type_identifier "FILE") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n          iVar1 = 0x11;\n        }" ({ "{") (expression_statement "iVar1 = 0x11;" (assignment_expression "iVar1 = 0x11" (identifier "iVar1") (= "=") (number_literal "0x11")) (; ";")) (} "}")) (else_clause "else {\n          do {\n            sVar3 = fread(__ptr,1,0x2000,__stream);\n            iVar1 = hmac_process(local_398,__ptr,sVar3);\n            if (iVar1 != 0) {\n              fclose(__stream);\n              goto LAB_001614b0;\n            }\n          } while (sVar3 == 0x2000);\n          iVar1 = 1;\n          iVar2 = fclose(__stream);\n          if (iVar2 == 0) {\n            iVar1 = hmac_done(local_398,param_5,param_6);\n          }\nLAB_001614b0:\n          zeromem(__ptr,0x2000);\n        }" (else "else") (compound_statement "{\n          do {\n            sVar3 = fread(__ptr,1,0x2000,__stream);\n            iVar1 = hmac_process(local_398,__ptr,sVar3);\n            if (iVar1 != 0) {\n              fclose(__stream);\n              goto LAB_001614b0;\n            }\n          } while (sVar3 == 0x2000);\n          iVar1 = 1;\n          iVar2 = fclose(__stream);\n          if (iVar2 == 0) {\n            iVar1 = hmac_done(local_398,param_5,param_6);\n          }\nLAB_001614b0:\n          zeromem(__ptr,0x2000);\n        }" ({ "{") (do_statement "do {\n            sVar3 = fread(__ptr,1,0x2000,__stream);\n            iVar1 = hmac_process(local_398,__ptr,sVar3);\n            if (iVar1 != 0) {\n              fclose(__stream);\n              goto LAB_001614b0;\n            }\n          } while (sVar3 == 0x2000);" (do "do") (compound_statement "{\n            sVar3 = fread(__ptr,1,0x2000,__stream);\n            iVar1 = hmac_process(local_398,__ptr,sVar3);\n            if (iVar1 != 0) {\n              fclose(__stream);\n              goto LAB_001614b0;\n            }\n          }" ({ "{") (expression_statement "sVar3 = fread(__ptr,1,0x2000,__stream);" (assignment_expression "sVar3 = fread(__ptr,1,0x2000,__stream)" (identifier "sVar3") (= "=") (call_expression "fread(__ptr,1,0x2000,__stream)" (identifier "fread") (argument_list "(__ptr,1,0x2000,__stream)" (( "(") (identifier "__ptr") (, ",") (number_literal "1") (, ",") (number_literal "0x2000") (, ",") (identifier "__stream") () ")")))) (; ";")) (expression_statement "iVar1 = hmac_process(local_398,__ptr,sVar3);" (assignment_expression "iVar1 = hmac_process(local_398,__ptr,sVar3)" (identifier "iVar1") (= "=") (call_expression "hmac_process(local_398,__ptr,sVar3)" (identifier "hmac_process") (argument_list "(local_398,__ptr,sVar3)" (( "(") (identifier "local_398") (, ",") (identifier "__ptr") (, ",") (identifier "sVar3") () ")")))) (; ";")) (if_statement "if (iVar1 != 0) {\n              fclose(__stream);\n              goto LAB_001614b0;\n            }" (if "if") (parenthesized_expression "(iVar1 != 0)" (( "(") (binary_expression "iVar1 != 0" (identifier "iVar1") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n              fclose(__stream);\n              goto LAB_001614b0;\n            }" ({ "{") (expression_statement "fclose(__stream);" (call_expression "fclose(__stream)" (identifier "fclose") (argument_list "(__stream)" (( "(") (identifier "__stream") () ")"))) (; ";")) (goto_statement "goto LAB_001614b0;" (goto "goto") (statement_identifier "LAB_001614b0") (; ";")) (} "}"))) (} "}")) (while "while") (parenthesized_expression "(sVar3 == 0x2000)" (( "(") (binary_expression "sVar3 == 0x2000" (identifier "sVar3") (== "==") (number_literal "0x2000")) () ")")) (; ";")) (expression_statement "iVar1 = 1;" (assignment_expression "iVar1 = 1" (identifier "iVar1") (= "=") (number_literal "1")) (; ";")) (expression_statement "iVar2 = fclose(__stream);" (assignment_expression "iVar2 = fclose(__stream)" (identifier "iVar2") (= "=") (call_expression "fclose(__stream)" (identifier "fclose") (argument_list "(__stream)" (( "(") (identifier "__stream") () ")")))) (; ";")) (if_statement "if (iVar2 == 0) {\n            iVar1 = hmac_done(local_398,param_5,param_6);\n          }" (if "if") (parenthesized_expression "(iVar2 == 0)" (( "(") (binary_expression "iVar2 == 0" (identifier "iVar2") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n            iVar1 = hmac_done(local_398,param_5,param_6);\n          }" ({ "{") (expression_statement "iVar1 = hmac_done(local_398,param_5,param_6);" (assignment_expression "iVar1 = hmac_done(local_398,param_5,param_6)" (identifier "iVar1") (= "=") (call_expression "hmac_done(local_398,param_5,param_6)" (identifier "hmac_done") (argument_list "(local_398,param_5,param_6)" (( "(") (identifier "local_398") (, ",") (identifier "param_5") (, ",") (identifier "param_6") () ")")))) (; ";")) (} "}"))) (labeled_statement "LAB_001614b0:\n          zeromem(__ptr,0x2000);" (statement_identifier "LAB_001614b0") (: ":") (expression_statement "zeromem(__ptr,0x2000);" (call_expression "zeromem(__ptr,0x2000)" (identifier "zeromem") (argument_list "(__ptr,0x2000)" (( "(") (identifier "__ptr") (, ",") (number_literal "0x2000") () ")"))) (; ";"))) (} "}")))) (} "}"))) (} "}"))) (expression_statement "free(__ptr);" (call_expression "free(__ptr)" (identifier "free") (argument_list "(__ptr)" (( "(") (identifier "__ptr") () ")"))) (; ";")) (} "}")))) (if_statement "if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return iVar1;\n  }" (if "if") (parenthesized_expression "(local_40 == *(long *)(in_FS_OFFSET + 0x28))" (( "(") (binary_expression "local_40 == *(long *)(in_FS_OFFSET + 0x28)" (identifier "local_40") (== "==") (pointer_expression "*(long *)(in_FS_OFFSET + 0x28)" (* "*") (cast_expression "(long *)(in_FS_OFFSET + 0x28)" (( "(") (type_descriptor "long *" (sized_type_specifier "long" (long "long")) (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(in_FS_OFFSET + 0x28)" (( "(") (binary_expression "in_FS_OFFSET + 0x28" (identifier "in_FS_OFFSET") (+ "+") (number_literal "0x28")) () ")"))))) () ")")) (compound_statement "{\n    return iVar1;\n  }" ({ "{") (return_statement "return iVar1;" (return "return") (identifier "iVar1") (; ";")) (} "}"))) (expression_statement "__stack_chk_fail();" (call_expression "__stack_chk_fail()" (identifier "__stack_chk_fail") (argument_list "()" (( "(") () ")"))) (; ";")) (} "}")))

int function_1(int hash,char *var_2,type_1 *var_4,type_2 keylen,type_1 *var_5,type_2 *var_6)

{
  long var_22;
  int var_10;
  int var_18;
  type_1 *var_8;
  type_3 *var_13;
  size_t var_17;
  long var_1;
  type_4 hmac;
  
  var_22 = *(long *)(var_1 + 0x28);
  if (var_2 == (char *)0x0) {
                    /* WARNING: Subroutine does not return */
    var_3("fname != NULL","src/mac/hmac/hmac_file.c",0x2f);
  }
  if (var_4 == (type_1 *)0x0) {
                    /* WARNING: Subroutine does not return */
    var_3("key != NULL","src/mac/hmac/hmac_file.c",0x30);
  }
  if (var_5 == (type_1 *)0x0) {
                    /* WARNING: Subroutine does not return */
    var_3("out != NULL","src/mac/hmac/hmac_file.c",0x31);
  }
  if (var_6 == (type_2 *)0x0) {
                    /* WARNING: Subroutine does not return */
    var_3("outlen != NULL","src/mac/hmac/hmac_file.c",0x32);
  }
  var_8 = (type_1 *)var_7(0x2000);
  if (var_8 == (type_1 *)0x0) {
    var_10 = 0xd;
  }
  else {
    var_10 = var_9(hash);
    if (var_10 == 0) {
      var_10 = var_11(&hmac,hash,var_4,keylen);
      if (var_10 == 0) {
        var_13 = var_12(var_2,"rb");
        if (var_13 == (type_3 *)0x0) {
          var_10 = 0x11;
        }
        else {
          do {
            var_17 = var_14(var_8,1,0x2000,var_13);
            var_10 = var_15(&hmac,var_8,var_17);
            if (var_10 != 0) {
              var_16(var_13);
              goto LAB_001614b0;
            }
          } while (var_17 == 0x2000);
          var_10 = 1;
          var_18 = var_16(var_13);
          if (var_18 == 0) {
            var_10 = var_19(&hmac,var_5,var_6);
          }
LAB_001614b0:
          var_20(var_8,0x2000);
        }
      }
    }
    var_21(var_8);
  }
  if (var_22 == *(long *)(var_1 + 0x28)) {
    return var_10;
  }
                    /* WARNING: Subroutine does not return */
  var_23();
}


(translation_unit (function_definition type: (primitive_type) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (type_identifier) declarator: (identifier)) (parameter_declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (parameter_declaration type: (sized_type_specifier) declarator: (identifier)) (parameter_declaration type: (type_identifier) declarator: (identifier)) (parameter_declaration type: (sized_type_specifier) declarator: (identifier)) (parameter_declaration type: (sized_type_specifier) declarator: (identifier)))) body: (compound_statement (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (sized_type_specifier) declarator: (identifier)) (declaration type: (type_identifier) declarator: (array_declarator declarator: (identifier) size: (number_literal))) (declaration type: (sized_type_specifier) declarator: (identifier)) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (sized_type_specifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (number_literal)))) consequence: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (string_literal (string_content)) (string_literal (string_content)) (number_literal)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (string_literal (string_content)) (string_literal (string_content)) (number_literal)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (string_literal (string_content)) (string_literal (string_content)) (number_literal)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (string_literal (string_content)) (string_literal (string_content)) (number_literal)))))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (number_literal))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (number_literal)))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (number_literal)))) alternative: (else_clause (compound_statement (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier) (identifier) (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (string_literal (string_content)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (number_literal)))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (number_literal)))) alternative: (else_clause (compound_statement (do_statement body: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (number_literal) (number_literal) (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier) (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier)))) (goto_statement label: (statement_identifier))))) condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal)))) (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier) (identifier))))))) (labeled_statement label: (statement_identifier) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier) (number_literal)))))))))))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (sized_type_specifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))))) consequence: (compound_statement (return_statement (identifier)))) (expression_statement (call_expression function: (identifier) arguments: (argument_list))))))

int MASKED(undefined4 param_1,char *param_2,long param_3,undefined8 param_4,long param_5,
             long param_6)

{
  int iVar1;
  int iVar2;
  void *__ptr;
  FILE *__stream;
  size_t sVar3;
  long in_FS_OFFSET;
  undefined1 local_398 [856];
  long local_40;
  
  local_40 = *(long *)(in_FS_OFFSET + 0x28);
  if (param_2 == (char *)0x0) {
                    /* WARNING: Subroutine does not return */
    crypt_argchk("fname != NULL","src/mac/hmac/MASKED.c",0x2f);
  }
  if (param_3 == 0) {
                    /* WARNING: Subroutine does not return */
    crypt_argchk("key != NULL","src/mac/hmac/MASKED.c",0x30);
  }
  if (param_5 == 0) {
                    /* WARNING: Subroutine does not return */
    crypt_argchk("out != NULL","src/mac/hmac/MASKED.c",0x31);
  }
  if (param_6 == 0) {
                    /* WARNING: Subroutine does not return */
    crypt_argchk("outlen != NULL","src/mac/hmac/MASKED.c",0x32);
  }
  __ptr = malloc(0x2000);
  if (__ptr == (void *)0x0) {
    iVar1 = 0xd;
  }
  else {
    iVar1 = hash_is_valid(param_1);
    if (iVar1 == 0) {
      iVar1 = hmac_init(local_398,param_1,param_3,param_4);
      if (iVar1 == 0) {
        __stream = fopen(param_2,"rb");
        if (__stream == (FILE *)0x0) {
          iVar1 = 0x11;
        }
        else {
          do {
            sVar3 = fread(__ptr,1,0x2000,__stream);
            iVar1 = hmac_process(local_398,__ptr,sVar3);
            if (iVar1 != 0) {
              fclose(__stream);
              goto LAB_001614b0;
            }
          } while (sVar3 == 0x2000);
          iVar1 = 1;
          iVar2 = fclose(__stream);
          if (iVar2 == 0) {
            iVar1 = hmac_done(local_398,param_5,param_6);
          }
LAB_001614b0:
          zeromem(__ptr,0x2000);
        }
      }
    }
    free(__ptr);
  }
  if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {
    return iVar1;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail();
}

