
/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */

int __regparm3
shaxxx_stream(FILE *stream,char *alg,void *resblock,ssize_t hashlen,
             _func_void_sha256_ctx_ptr *init_ctx,_func_void_ptr_sha256_ctx_ptr_void_ptr *finish_ctx)

{
  int iVar1;
  void *buffer;
  size_t sVar2;
  int iVar3;
  size_t len;
  int in_GS_OFFSET;
  sha256_ctx ctx;
  
  iVar1 = *(int *)(in_GS_OFFSET + 0x14);
  buffer = malloc(0x8048);
  if (buffer == (void *)0x0) {
    iVar3 = 1;
LAB_00015e44:
    if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {
      return iVar3;
    }
                    /* WARNING: Subroutine does not return */
    __stack_chk_fail_local();
  }
  (*(code *)resblock)(&ctx);
  do {
    len = 0;
LAB_00015e1d:
    if ((stream->_flags & 0x10) != 0) goto LAB_00015e22;
    sVar2 = fread_unlocked((void *)((int)buffer + len),1,0x8000 - len,(FILE *)stream);
    len = len + sVar2;
    if (len != 0x8000) break;
    sha256_process_block(buffer,0x8000,&ctx);
  } while( true );
  if (sVar2 == 0) {
    if ((stream->_flags & 0x20) == 0) {
LAB_00015e22:
      if (len != 0) {
        sha256_process_bytes(buffer,len,&ctx);
      }
      (*(code *)hashlen)(&ctx,alg);
      free(buffer);
      iVar3 = 0;
    }
    else {
      free(buffer);
      iVar3 = 1;
    }
    goto LAB_00015e44;
  }
  goto LAB_00015e1d;
}



/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */

undefined4 __regparm3 FUN_00015d90(FILE *param_1,undefined4 param_2,code *param_3,code *param_4)

{
  void *__ptr;
  size_t sVar1;
  undefined4 uVar2;
  int iVar3;
  int in_GS_OFFSET;
  undefined1 local_cc [172];
  int local_20;
  undefined4 uStack_14;
  
  uStack_14 = 0x15d9d;
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  __ptr = malloc(0x8048);
  if (__ptr == (void *)0x0) {
    uVar2 = 1;
LAB_00015e44:
    if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
      return uVar2;
    }
                    /* WARNING: Subroutine does not return */
    FUN_00019e70();
  }
  (*param_3)(local_cc);
  do {
    iVar3 = 0;
LAB_00015e1d:
    if ((param_1->_flags & 0x10) != 0) goto LAB_00015e22;
    sVar1 = fread_unlocked((void *)((int)__ptr + iVar3),1,0x8000 - iVar3,param_1);
    iVar3 = iVar3 + sVar1;
    if (iVar3 != 0x8000) break;
    FUN_000130c0(__ptr,0x8000,local_cc);
  } while( true );
  if (sVar1 == 0) {
    if ((param_1->_flags & 0x20) == 0) {
LAB_00015e22:
      if (iVar3 != 0) {
        FUN_00015950(__ptr,iVar3,local_cc);
      }
      (*param_4)(local_cc,param_2);
      free(__ptr);
      uVar2 = 0;
    }
    else {
      free(__ptr);
      uVar2 = 1;
    }
    goto LAB_00015e44;
  }
  goto LAB_00015e1d;
}


PUSH EBP
MOV EBP,ECX
PUSH EDI
PUSH ESI
MOV ESI,EAX
PUSH EBX
CALL 0x00012620
ADD EBX,0x9263
SUB ESP,0xd8
MOV EAX,dword ptr [ESP + 0xec]
MOV dword ptr [ESP + 0x14],EDX
MOV dword ptr [ESP + 0x18],EAX
MOV EAX,GS:[0x14]
MOV dword ptr [ESP + 0xc8],EAX
XOR EAX,EAX
PUSH 0x8048
CALL 0x000111c0
ADD ESP,0x10
TEST EAX,EAX
JZ 0x00015eb0
SUB ESP,0xc
MOV EDI,EAX
LEA EAX,[ESP + 0x1c]
MOV dword ptr [ESP + 0x10],EAX
PUSH EAX
CALL EBP
ADD ESP,0x10
XOR EBP,EBP
JMP 0x00015e1d
MOV EAX,0x8000
PUSH ESI
SUB EAX,EBP
PUSH EAX
LEA EAX,[EDI + EBP*0x1]
PUSH 0x1
PUSH EAX
CALL 0x00011190
ADD ESP,0x10
ADD EBP,EAX
CMP EBP,0x8000
JZ 0x00015e78
TEST EAX,EAX
JZ 0x00015e92
TEST byte ptr [ESI],0x10
JZ 0x00015df8
TEST EBP,EBP
JNZ 0x00015e60
SUB ESP,0x8
PUSH dword ptr [ESP + 0x10]
PUSH dword ptr [ESP + 0x10]
MOV EAX,dword ptr [ESP + 0x1c]
CALL EAX
MOV dword ptr [ESP],EDI
CALL 0x00011070
ADD ESP,0x10
XOR EAX,EAX
MOV EDX,dword ptr [ESP + 0xbc]
XOR EDX,dword ptr GS:[0x14]
JNZ 0x00015eb7
ADD ESP,0xcc
POP EBX
POP ESI
POP EDI
POP EBP
RET
SUB ESP,0x4
PUSH dword ptr [ESP + 0x8]
PUSH EBP
PUSH EDI
CALL 0x00015950
ADD ESP,0x10
JMP 0x00015e26
SUB ESP,0x4
PUSH dword ptr [ESP + 0x8]
PUSH 0x8000
PUSH EDI
CALL 0x000130c0
ADD ESP,0x10
JMP 0x00015def
TEST byte ptr [ESI],0x20
JZ 0x00015e22
SUB ESP,0xc
PUSH EDI
CALL 0x00011070
ADD ESP,0x10
MOV EAX,0x1
JMP 0x00015e44
MOV EAX,0x1
JMP 0x00015e44
CALL 0x00019e70
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nundefined4 __regparm3 FUN_00015d90(FILE *param_1,undefined4 param_2,code *param_3,code *param_4)\n\n{\n  void *__ptr;\n  size_t sVar1;\n  undefined4 uVar2;\n  int iVar3;\n  int in_GS_OFFSET;\n  undefined1 local_cc [172];\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x15d9d;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  __ptr = malloc(0x8048);\n  if (__ptr == (void *)0x0) {\n    uVar2 = 1;\nLAB_00015e44:\n    if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n      return uVar2;\n    }\n                    /* WARNING: Subroutine does not return */\n    FUN_00019e70();\n  }\n  (*param_3)(local_cc);\n  do {\n    iVar3 = 0;\nLAB_00015e1d:\n    if ((param_1->_flags & 0x10) != 0) goto LAB_00015e22;\n    sVar1 = fread_unlocked((void *)((int)__ptr + iVar3),1,0x8000 - iVar3,param_1);\n    iVar3 = iVar3 + sVar1;\n    if (iVar3 != 0x8000) break;\n    FUN_000130c0(__ptr,0x8000,local_cc);\n  } while( true );\n  if (sVar1 == 0) {\n    if ((param_1->_flags & 0x20) == 0) {\nLAB_00015e22:\n      if (iVar3 != 0) {\n        FUN_00015950(__ptr,iVar3,local_cc);\n      }\n      (*param_4)(local_cc,param_2);\n      free(__ptr);\n      uVar2 = 0;\n    }\n    else {\n      free(__ptr);\n      uVar2 = 1;\n    }\n    goto LAB_00015e44;\n  }\n  goto LAB_00015e1d;\n}\n\n" comment (function_definition "undefined4 __regparm3 FUN_00015d90(FILE *param_1,undefined4 param_2,code *param_3,code *param_4)\n\n{\n  void *__ptr;\n  size_t sVar1;\n  undefined4 uVar2;\n  int iVar3;\n  int in_GS_OFFSET;\n  undefined1 local_cc [172];\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x15d9d;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  __ptr = malloc(0x8048);\n  if (__ptr == (void *)0x0) {\n    uVar2 = 1;\nLAB_00015e44:\n    if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n      return uVar2;\n    }\n                    /* WARNING: Subroutine does not return */\n    FUN_00019e70();\n  }\n  (*param_3)(local_cc);\n  do {\n    iVar3 = 0;\nLAB_00015e1d:\n    if ((param_1->_flags & 0x10) != 0) goto LAB_00015e22;\n    sVar1 = fread_unlocked((void *)((int)__ptr + iVar3),1,0x8000 - iVar3,param_1);\n    iVar3 = iVar3 + sVar1;\n    if (iVar3 != 0x8000) break;\n    FUN_000130c0(__ptr,0x8000,local_cc);\n  } while( true );\n  if (sVar1 == 0) {\n    if ((param_1->_flags & 0x20) == 0) {\nLAB_00015e22:\n      if (iVar3 != 0) {\n        FUN_00015950(__ptr,iVar3,local_cc);\n      }\n      (*param_4)(local_cc,param_2);\n      free(__ptr);\n      uVar2 = 0;\n    }\n    else {\n      free(__ptr);\n      uVar2 = 1;\n    }\n    goto LAB_00015e44;\n  }\n  goto LAB_00015e1d;\n}" type_identifier (ERROR "__regparm3" identifier) (function_declarator "FUN_00015d90(FILE *param_1,undefined4 param_2,code *param_3,code *param_4)" identifier (parameter_list "(FILE *param_1,undefined4 param_2,code *param_3,code *param_4)" ( (parameter_declaration "FILE *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "undefined4 param_2" type_identifier identifier) , (parameter_declaration "code *param_3" type_identifier (pointer_declarator "*param_3" * identifier)) , (parameter_declaration "code *param_4" type_identifier (pointer_declarator "*param_4" * identifier)) ))) (compound_statement "{\n  void *__ptr;\n  size_t sVar1;\n  undefined4 uVar2;\n  int iVar3;\n  int in_GS_OFFSET;\n  undefined1 local_cc [172];\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x15d9d;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  __ptr = malloc(0x8048);\n  if (__ptr == (void *)0x0) {\n    uVar2 = 1;\nLAB_00015e44:\n    if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n      return uVar2;\n    }\n                    /* WARNING: Subroutine does not return */\n    FUN_00019e70();\n  }\n  (*param_3)(local_cc);\n  do {\n    iVar3 = 0;\nLAB_00015e1d:\n    if ((param_1->_flags & 0x10) != 0) goto LAB_00015e22;\n    sVar1 = fread_unlocked((void *)((int)__ptr + iVar3),1,0x8000 - iVar3,param_1);\n    iVar3 = iVar3 + sVar1;\n    if (iVar3 != 0x8000) break;\n    FUN_000130c0(__ptr,0x8000,local_cc);\n  } while( true );\n  if (sVar1 == 0) {\n    if ((param_1->_flags & 0x20) == 0) {\nLAB_00015e22:\n      if (iVar3 != 0) {\n        FUN_00015950(__ptr,iVar3,local_cc);\n      }\n      (*param_4)(local_cc,param_2);\n      free(__ptr);\n      uVar2 = 0;\n    }\n    else {\n      free(__ptr);\n      uVar2 = 1;\n    }\n    goto LAB_00015e44;\n  }\n  goto LAB_00015e1d;\n}" { (declaration "void *__ptr;" primitive_type (pointer_declarator "*__ptr" * identifier) ;) (declaration "size_t sVar1;" primitive_type identifier ;) (declaration "undefined4 uVar2;" type_identifier identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "undefined1 local_cc [172];" type_identifier (array_declarator "local_cc [172]" identifier [ number_literal ]) ;) (declaration "int local_20;" primitive_type identifier ;) (declaration "undefined4 uStack_14;" type_identifier identifier ;) (expression_statement "uStack_14 = 0x15d9d;" (assignment_expression "uStack_14 = 0x15d9d" identifier = number_literal) ;) (expression_statement "local_20 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "local_20 = *(int *)(in_GS_OFFSET + 0x14)" identifier = (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) ;) (expression_statement "__ptr = malloc(0x8048);" (assignment_expression "__ptr = malloc(0x8048)" identifier = (call_expression "malloc(0x8048)" identifier (argument_list "(0x8048)" ( number_literal )))) ;) (if_statement "if (__ptr == (void *)0x0) {\n    uVar2 = 1;\nLAB_00015e44:\n    if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n      return uVar2;\n    }\n                    /* WARNING: Subroutine does not return */\n    FUN_00019e70();\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    uVar2 = 1;\nLAB_00015e44:\n    if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n      return uVar2;\n    }\n                    /* WARNING: Subroutine does not return */\n    FUN_00019e70();\n  }" { (expression_statement "uVar2 = 1;" (assignment_expression "uVar2 = 1" identifier = number_literal) ;) (labeled_statement "LAB_00015e44:\n    if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n      return uVar2;\n    }" statement_identifier : (if_statement "if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n      return uVar2;\n    }" if (parenthesized_expression "(local_20 == *(int *)(in_GS_OFFSET + 0x14))" ( (binary_expression "local_20 == *(int *)(in_GS_OFFSET + 0x14)" identifier == (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) )) (compound_statement "{\n      return uVar2;\n    }" { (return_statement "return uVar2;" return identifier ;) }))) comment (expression_statement "FUN_00019e70();" (call_expression "FUN_00019e70()" identifier (argument_list "()" ( ))) ;) })) (expression_statement "(*param_3)(local_cc);" (call_expression "(*param_3)(local_cc)" (parenthesized_expression "(*param_3)" ( (pointer_expression "*param_3" * identifier) )) (argument_list "(local_cc)" ( identifier ))) ;) (do_statement "do {\n    iVar3 = 0;\nLAB_00015e1d:\n    if ((param_1->_flags & 0x10) != 0) goto LAB_00015e22;\n    sVar1 = fread_unlocked((void *)((int)__ptr + iVar3),1,0x8000 - iVar3,param_1);\n    iVar3 = iVar3 + sVar1;\n    if (iVar3 != 0x8000) break;\n    FUN_000130c0(__ptr,0x8000,local_cc);\n  } while( true );" do (compound_statement "{\n    iVar3 = 0;\nLAB_00015e1d:\n    if ((param_1->_flags & 0x10) != 0) goto LAB_00015e22;\n    sVar1 = fread_unlocked((void *)((int)__ptr + iVar3),1,0x8000 - iVar3,param_1);\n    iVar3 = iVar3 + sVar1;\n    if (iVar3 != 0x8000) break;\n    FUN_000130c0(__ptr,0x8000,local_cc);\n  }" { (expression_statement "iVar3 = 0;" (assignment_expression "iVar3 = 0" identifier = number_literal) ;) (labeled_statement "LAB_00015e1d:\n    if ((param_1->_flags & 0x10) != 0) goto LAB_00015e22;" statement_identifier : (if_statement "if ((param_1->_flags & 0x10) != 0) goto LAB_00015e22;" if (parenthesized_expression "((param_1->_flags & 0x10) != 0)" ( (binary_expression "(param_1->_flags & 0x10) != 0" (parenthesized_expression "(param_1->_flags & 0x10)" ( (binary_expression "param_1->_flags & 0x10" (field_expression "param_1->_flags" identifier -> field_identifier) & number_literal) )) != number_literal) )) (goto_statement "goto LAB_00015e22;" goto statement_identifier ;))) (expression_statement "sVar1 = fread_unlocked((void *)((int)__ptr + iVar3),1,0x8000 - iVar3,param_1);" (assignment_expression "sVar1 = fread_unlocked((void *)((int)__ptr + iVar3),1,0x8000 - iVar3,param_1)" identifier = (call_expression "fread_unlocked((void *)((int)__ptr + iVar3),1,0x8000 - iVar3,param_1)" identifier (argument_list "((void *)((int)__ptr + iVar3),1,0x8000 - iVar3,param_1)" ( (cast_expression "(void *)((int)__ptr + iVar3)" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)__ptr + iVar3)" ( (binary_expression "(int)__ptr + iVar3" (cast_expression "(int)__ptr" ( (type_descriptor "int" primitive_type) ) identifier) + identifier) ))) , number_literal , (binary_expression "0x8000 - iVar3" number_literal - identifier) , identifier )))) ;) (expression_statement "iVar3 = iVar3 + sVar1;" (assignment_expression "iVar3 = iVar3 + sVar1" identifier = (binary_expression "iVar3 + sVar1" identifier + identifier)) ;) (if_statement "if (iVar3 != 0x8000) break;" if (parenthesized_expression "(iVar3 != 0x8000)" ( (binary_expression "iVar3 != 0x8000" identifier != number_literal) )) (break_statement "break;" break ;)) (expression_statement "FUN_000130c0(__ptr,0x8000,local_cc);" (call_expression "FUN_000130c0(__ptr,0x8000,local_cc)" identifier (argument_list "(__ptr,0x8000,local_cc)" ( identifier , number_literal , identifier ))) ;) }) while (parenthesized_expression "( true )" ( true )) ;) (if_statement "if (sVar1 == 0) {\n    if ((param_1->_flags & 0x20) == 0) {\nLAB_00015e22:\n      if (iVar3 != 0) {\n        FUN_00015950(__ptr,iVar3,local_cc);\n      }\n      (*param_4)(local_cc,param_2);\n      free(__ptr);\n      uVar2 = 0;\n    }\n    else {\n      free(__ptr);\n      uVar2 = 1;\n    }\n    goto LAB_00015e44;\n  }" if (parenthesized_expression "(sVar1 == 0)" ( (binary_expression "sVar1 == 0" identifier == number_literal) )) (compound_statement "{\n    if ((param_1->_flags & 0x20) == 0) {\nLAB_00015e22:\n      if (iVar3 != 0) {\n        FUN_00015950(__ptr,iVar3,local_cc);\n      }\n      (*param_4)(local_cc,param_2);\n      free(__ptr);\n      uVar2 = 0;\n    }\n    else {\n      free(__ptr);\n      uVar2 = 1;\n    }\n    goto LAB_00015e44;\n  }" { (if_statement "if ((param_1->_flags & 0x20) == 0) {\nLAB_00015e22:\n      if (iVar3 != 0) {\n        FUN_00015950(__ptr,iVar3,local_cc);\n      }\n      (*param_4)(local_cc,param_2);\n      free(__ptr);\n      uVar2 = 0;\n    }\n    else {\n      free(__ptr);\n      uVar2 = 1;\n    }" if (parenthesized_expression "((param_1->_flags & 0x20) == 0)" ( (binary_expression "(param_1->_flags & 0x20) == 0" (parenthesized_expression "(param_1->_flags & 0x20)" ( (binary_expression "param_1->_flags & 0x20" (field_expression "param_1->_flags" identifier -> field_identifier) & number_literal) )) == number_literal) )) (compound_statement "{\nLAB_00015e22:\n      if (iVar3 != 0) {\n        FUN_00015950(__ptr,iVar3,local_cc);\n      }\n      (*param_4)(local_cc,param_2);\n      free(__ptr);\n      uVar2 = 0;\n    }" { (labeled_statement "LAB_00015e22:\n      if (iVar3 != 0) {\n        FUN_00015950(__ptr,iVar3,local_cc);\n      }" statement_identifier : (if_statement "if (iVar3 != 0) {\n        FUN_00015950(__ptr,iVar3,local_cc);\n      }" if (parenthesized_expression "(iVar3 != 0)" ( (binary_expression "iVar3 != 0" identifier != number_literal) )) (compound_statement "{\n        FUN_00015950(__ptr,iVar3,local_cc);\n      }" { (expression_statement "FUN_00015950(__ptr,iVar3,local_cc);" (call_expression "FUN_00015950(__ptr,iVar3,local_cc)" identifier (argument_list "(__ptr,iVar3,local_cc)" ( identifier , identifier , identifier ))) ;) }))) (expression_statement "(*param_4)(local_cc,param_2);" (call_expression "(*param_4)(local_cc,param_2)" (parenthesized_expression "(*param_4)" ( (pointer_expression "*param_4" * identifier) )) (argument_list "(local_cc,param_2)" ( identifier , identifier ))) ;) (expression_statement "free(__ptr);" (call_expression "free(__ptr)" identifier (argument_list "(__ptr)" ( identifier ))) ;) (expression_statement "uVar2 = 0;" (assignment_expression "uVar2 = 0" identifier = number_literal) ;) }) (else_clause "else {\n      free(__ptr);\n      uVar2 = 1;\n    }" else (compound_statement "{\n      free(__ptr);\n      uVar2 = 1;\n    }" { (expression_statement "free(__ptr);" (call_expression "free(__ptr)" identifier (argument_list "(__ptr)" ( identifier ))) ;) (expression_statement "uVar2 = 1;" (assignment_expression "uVar2 = 1" identifier = number_literal) ;) }))) (goto_statement "goto LAB_00015e44;" goto statement_identifier ;) })) (goto_statement "goto LAB_00015e1d;" goto statement_identifier ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nint __regparm3\nshaxxx_stream(FILE *stream,char *alg,void *resblock,ssize_t hashlen,\n             _func_void_sha256_ctx_ptr *init_ctx,_func_void_ptr_sha256_ctx_ptr_void_ptr *finish_ctx)\n\n{\n  int iVar1;\n  void *buffer;\n  size_t sVar2;\n  int iVar3;\n  size_t len;\n  int in_GS_OFFSET;\n  sha256_ctx ctx;\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  buffer = malloc(0x8048);\n  if (buffer == (void *)0x0) {\n    iVar3 = 1;\nLAB_00015e44:\n    if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n      return iVar3;\n    }\n                    /* WARNING: Subroutine does not return */\n    __stack_chk_fail_local();\n  }\n  (*(code *)resblock)(&ctx);\n  do {\n    len = 0;\nLAB_00015e1d:\n    if ((stream->_flags & 0x10) != 0) goto LAB_00015e22;\n    sVar2 = fread_unlocked((void *)((int)buffer + len),1,0x8000 - len,(FILE *)stream);\n    len = len + sVar2;\n    if (len != 0x8000) break;\n    sha256_process_block(buffer,0x8000,&ctx);\n  } while( true );\n  if (sVar2 == 0) {\n    if ((stream->_flags & 0x20) == 0) {\nLAB_00015e22:\n      if (len != 0) {\n        sha256_process_bytes(buffer,len,&ctx);\n      }\n      (*(code *)hashlen)(&ctx,alg);\n      free(buffer);\n      iVar3 = 0;\n    }\n    else {\n      free(buffer);\n      iVar3 = 1;\n    }\n    goto LAB_00015e44;\n  }\n  goto LAB_00015e1d;\n}\n\n" comment (function_definition "int __regparm3\nshaxxx_stream(FILE *stream,char *alg,void *resblock,ssize_t hashlen,\n             _func_void_sha256_ctx_ptr *init_ctx,_func_void_ptr_sha256_ctx_ptr_void_ptr *finish_ctx)\n\n{\n  int iVar1;\n  void *buffer;\n  size_t sVar2;\n  int iVar3;\n  size_t len;\n  int in_GS_OFFSET;\n  sha256_ctx ctx;\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  buffer = malloc(0x8048);\n  if (buffer == (void *)0x0) {\n    iVar3 = 1;\nLAB_00015e44:\n    if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n      return iVar3;\n    }\n                    /* WARNING: Subroutine does not return */\n    __stack_chk_fail_local();\n  }\n  (*(code *)resblock)(&ctx);\n  do {\n    len = 0;\nLAB_00015e1d:\n    if ((stream->_flags & 0x10) != 0) goto LAB_00015e22;\n    sVar2 = fread_unlocked((void *)((int)buffer + len),1,0x8000 - len,(FILE *)stream);\n    len = len + sVar2;\n    if (len != 0x8000) break;\n    sha256_process_block(buffer,0x8000,&ctx);\n  } while( true );\n  if (sVar2 == 0) {\n    if ((stream->_flags & 0x20) == 0) {\nLAB_00015e22:\n      if (len != 0) {\n        sha256_process_bytes(buffer,len,&ctx);\n      }\n      (*(code *)hashlen)(&ctx,alg);\n      free(buffer);\n      iVar3 = 0;\n    }\n    else {\n      free(buffer);\n      iVar3 = 1;\n    }\n    goto LAB_00015e44;\n  }\n  goto LAB_00015e1d;\n}" primitive_type (ERROR "__regparm3" identifier) (function_declarator "shaxxx_stream(FILE *stream,char *alg,void *resblock,ssize_t hashlen,\n             _func_void_sha256_ctx_ptr *init_ctx,_func_void_ptr_sha256_ctx_ptr_void_ptr *finish_ctx)" identifier (parameter_list "(FILE *stream,char *alg,void *resblock,ssize_t hashlen,\n             _func_void_sha256_ctx_ptr *init_ctx,_func_void_ptr_sha256_ctx_ptr_void_ptr *finish_ctx)" ( (parameter_declaration "FILE *stream" type_identifier (pointer_declarator "*stream" * identifier)) , (parameter_declaration "char *alg" primitive_type (pointer_declarator "*alg" * identifier)) , (parameter_declaration "void *resblock" primitive_type (pointer_declarator "*resblock" * identifier)) , (parameter_declaration "ssize_t hashlen" primitive_type identifier) , (parameter_declaration "_func_void_sha256_ctx_ptr *init_ctx" type_identifier (pointer_declarator "*init_ctx" * identifier)) , (parameter_declaration "_func_void_ptr_sha256_ctx_ptr_void_ptr *finish_ctx" type_identifier (pointer_declarator "*finish_ctx" * identifier)) ))) (compound_statement "{\n  int iVar1;\n  void *buffer;\n  size_t sVar2;\n  int iVar3;\n  size_t len;\n  int in_GS_OFFSET;\n  sha256_ctx ctx;\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  buffer = malloc(0x8048);\n  if (buffer == (void *)0x0) {\n    iVar3 = 1;\nLAB_00015e44:\n    if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n      return iVar3;\n    }\n                    /* WARNING: Subroutine does not return */\n    __stack_chk_fail_local();\n  }\n  (*(code *)resblock)(&ctx);\n  do {\n    len = 0;\nLAB_00015e1d:\n    if ((stream->_flags & 0x10) != 0) goto LAB_00015e22;\n    sVar2 = fread_unlocked((void *)((int)buffer + len),1,0x8000 - len,(FILE *)stream);\n    len = len + sVar2;\n    if (len != 0x8000) break;\n    sha256_process_block(buffer,0x8000,&ctx);\n  } while( true );\n  if (sVar2 == 0) {\n    if ((stream->_flags & 0x20) == 0) {\nLAB_00015e22:\n      if (len != 0) {\n        sha256_process_bytes(buffer,len,&ctx);\n      }\n      (*(code *)hashlen)(&ctx,alg);\n      free(buffer);\n      iVar3 = 0;\n    }\n    else {\n      free(buffer);\n      iVar3 = 1;\n    }\n    goto LAB_00015e44;\n  }\n  goto LAB_00015e1d;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "void *buffer;" primitive_type (pointer_declarator "*buffer" * identifier) ;) (declaration "size_t sVar2;" primitive_type identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "size_t len;" primitive_type identifier ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "sha256_ctx ctx;" type_identifier identifier ;) (expression_statement "iVar1 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "iVar1 = *(int *)(in_GS_OFFSET + 0x14)" identifier = (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) ;) (expression_statement "buffer = malloc(0x8048);" (assignment_expression "buffer = malloc(0x8048)" identifier = (call_expression "malloc(0x8048)" identifier (argument_list "(0x8048)" ( number_literal )))) ;) (if_statement "if (buffer == (void *)0x0) {\n    iVar3 = 1;\nLAB_00015e44:\n    if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n      return iVar3;\n    }\n                    /* WARNING: Subroutine does not return */\n    __stack_chk_fail_local();\n  }" if (parenthesized_expression "(buffer == (void *)0x0)" ( (binary_expression "buffer == (void *)0x0" identifier == (cast_expression "(void *)0x0" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    iVar3 = 1;\nLAB_00015e44:\n    if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n      return iVar3;\n    }\n                    /* WARNING: Subroutine does not return */\n    __stack_chk_fail_local();\n  }" { (expression_statement "iVar3 = 1;" (assignment_expression "iVar3 = 1" identifier = number_literal) ;) (labeled_statement "LAB_00015e44:\n    if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n      return iVar3;\n    }" statement_identifier : (if_statement "if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n      return iVar3;\n    }" if (parenthesized_expression "(iVar1 == *(int *)(in_GS_OFFSET + 0x14))" ( (binary_expression "iVar1 == *(int *)(in_GS_OFFSET + 0x14)" identifier == (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) )) (compound_statement "{\n      return iVar3;\n    }" { (return_statement "return iVar3;" return identifier ;) }))) comment (expression_statement "__stack_chk_fail_local();" (call_expression "__stack_chk_fail_local()" identifier (argument_list "()" ( ))) ;) })) (expression_statement "(*(code *)resblock)(&ctx);" (call_expression "(*(code *)resblock)(&ctx)" (parenthesized_expression "(*(code *)resblock)" ( (pointer_expression "*(code *)resblock" * (cast_expression "(code *)resblock" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(&ctx)" ( (pointer_expression "&ctx" & identifier) ))) ;) (do_statement "do {\n    len = 0;\nLAB_00015e1d:\n    if ((stream->_flags & 0x10) != 0) goto LAB_00015e22;\n    sVar2 = fread_unlocked((void *)((int)buffer + len),1,0x8000 - len,(FILE *)stream);\n    len = len + sVar2;\n    if (len != 0x8000) break;\n    sha256_process_block(buffer,0x8000,&ctx);\n  } while( true );" do (compound_statement "{\n    len = 0;\nLAB_00015e1d:\n    if ((stream->_flags & 0x10) != 0) goto LAB_00015e22;\n    sVar2 = fread_unlocked((void *)((int)buffer + len),1,0x8000 - len,(FILE *)stream);\n    len = len + sVar2;\n    if (len != 0x8000) break;\n    sha256_process_block(buffer,0x8000,&ctx);\n  }" { (expression_statement "len = 0;" (assignment_expression "len = 0" identifier = number_literal) ;) (labeled_statement "LAB_00015e1d:\n    if ((stream->_flags & 0x10) != 0) goto LAB_00015e22;" statement_identifier : (if_statement "if ((stream->_flags & 0x10) != 0) goto LAB_00015e22;" if (parenthesized_expression "((stream->_flags & 0x10) != 0)" ( (binary_expression "(stream->_flags & 0x10) != 0" (parenthesized_expression "(stream->_flags & 0x10)" ( (binary_expression "stream->_flags & 0x10" (field_expression "stream->_flags" identifier -> field_identifier) & number_literal) )) != number_literal) )) (goto_statement "goto LAB_00015e22;" goto statement_identifier ;))) (expression_statement "sVar2 = fread_unlocked((void *)((int)buffer + len),1,0x8000 - len,(FILE *)stream);" (assignment_expression "sVar2 = fread_unlocked((void *)((int)buffer + len),1,0x8000 - len,(FILE *)stream)" identifier = (call_expression "fread_unlocked((void *)((int)buffer + len),1,0x8000 - len,(FILE *)stream)" identifier (argument_list "((void *)((int)buffer + len),1,0x8000 - len,(FILE *)stream)" ( (cast_expression "(void *)((int)buffer + len)" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)buffer + len)" ( (binary_expression "(int)buffer + len" (cast_expression "(int)buffer" ( (type_descriptor "int" primitive_type) ) identifier) + identifier) ))) , number_literal , (binary_expression "0x8000 - len" number_literal - identifier) , (cast_expression "(FILE *)stream" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier) )))) ;) (expression_statement "len = len + sVar2;" (assignment_expression "len = len + sVar2" identifier = (binary_expression "len + sVar2" identifier + identifier)) ;) (if_statement "if (len != 0x8000) break;" if (parenthesized_expression "(len != 0x8000)" ( (binary_expression "len != 0x8000" identifier != number_literal) )) (break_statement "break;" break ;)) (expression_statement "sha256_process_block(buffer,0x8000,&ctx);" (call_expression "sha256_process_block(buffer,0x8000,&ctx)" identifier (argument_list "(buffer,0x8000,&ctx)" ( identifier , number_literal , (pointer_expression "&ctx" & identifier) ))) ;) }) while (parenthesized_expression "( true )" ( true )) ;) (if_statement "if (sVar2 == 0) {\n    if ((stream->_flags & 0x20) == 0) {\nLAB_00015e22:\n      if (len != 0) {\n        sha256_process_bytes(buffer,len,&ctx);\n      }\n      (*(code *)hashlen)(&ctx,alg);\n      free(buffer);\n      iVar3 = 0;\n    }\n    else {\n      free(buffer);\n      iVar3 = 1;\n    }\n    goto LAB_00015e44;\n  }" if (parenthesized_expression "(sVar2 == 0)" ( (binary_expression "sVar2 == 0" identifier == number_literal) )) (compound_statement "{\n    if ((stream->_flags & 0x20) == 0) {\nLAB_00015e22:\n      if (len != 0) {\n        sha256_process_bytes(buffer,len,&ctx);\n      }\n      (*(code *)hashlen)(&ctx,alg);\n      free(buffer);\n      iVar3 = 0;\n    }\n    else {\n      free(buffer);\n      iVar3 = 1;\n    }\n    goto LAB_00015e44;\n  }" { (if_statement "if ((stream->_flags & 0x20) == 0) {\nLAB_00015e22:\n      if (len != 0) {\n        sha256_process_bytes(buffer,len,&ctx);\n      }\n      (*(code *)hashlen)(&ctx,alg);\n      free(buffer);\n      iVar3 = 0;\n    }\n    else {\n      free(buffer);\n      iVar3 = 1;\n    }" if (parenthesized_expression "((stream->_flags & 0x20) == 0)" ( (binary_expression "(stream->_flags & 0x20) == 0" (parenthesized_expression "(stream->_flags & 0x20)" ( (binary_expression "stream->_flags & 0x20" (field_expression "stream->_flags" identifier -> field_identifier) & number_literal) )) == number_literal) )) (compound_statement "{\nLAB_00015e22:\n      if (len != 0) {\n        sha256_process_bytes(buffer,len,&ctx);\n      }\n      (*(code *)hashlen)(&ctx,alg);\n      free(buffer);\n      iVar3 = 0;\n    }" { (labeled_statement "LAB_00015e22:\n      if (len != 0) {\n        sha256_process_bytes(buffer,len,&ctx);\n      }" statement_identifier : (if_statement "if (len != 0) {\n        sha256_process_bytes(buffer,len,&ctx);\n      }" if (parenthesized_expression "(len != 0)" ( (binary_expression "len != 0" identifier != number_literal) )) (compound_statement "{\n        sha256_process_bytes(buffer,len,&ctx);\n      }" { (expression_statement "sha256_process_bytes(buffer,len,&ctx);" (call_expression "sha256_process_bytes(buffer,len,&ctx)" identifier (argument_list "(buffer,len,&ctx)" ( identifier , identifier , (pointer_expression "&ctx" & identifier) ))) ;) }))) (expression_statement "(*(code *)hashlen)(&ctx,alg);" (call_expression "(*(code *)hashlen)(&ctx,alg)" (parenthesized_expression "(*(code *)hashlen)" ( (pointer_expression "*(code *)hashlen" * (cast_expression "(code *)hashlen" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(&ctx,alg)" ( (pointer_expression "&ctx" & identifier) , identifier ))) ;) (expression_statement "free(buffer);" (call_expression "free(buffer)" identifier (argument_list "(buffer)" ( identifier ))) ;) (expression_statement "iVar3 = 0;" (assignment_expression "iVar3 = 0" identifier = number_literal) ;) }) (else_clause "else {\n      free(buffer);\n      iVar3 = 1;\n    }" else (compound_statement "{\n      free(buffer);\n      iVar3 = 1;\n    }" { (expression_statement "free(buffer);" (call_expression "free(buffer)" identifier (argument_list "(buffer)" ( identifier ))) ;) (expression_statement "iVar3 = 1;" (assignment_expression "iVar3 = 1" identifier = number_literal) ;) }))) (goto_statement "goto LAB_00015e44;" goto statement_identifier ;) })) (goto_statement "goto LAB_00015e1d;" goto statement_identifier ;) })))
(translation_unit "undefined4 __regparm3 FUN_00015d90(FILE *param_1,undefined4 param_2,code *param_3,code *param_4)\n\n{\n  void *__ptr;\n  size_t sVar1;\n  undefined4 uVar2;\n  int iVar3;\n  int in_GS_OFFSET;\n  undefined1 local_cc [172];\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x15d9d;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  __ptr = malloc(0x8048);\n  if (__ptr == (void *)0x0) {\n    uVar2 = 1;\nLAB_00015e44:\n    if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n      return uVar2;\n    }\n                    \n    FUN_00019e70();\n  }\n  (*param_3)(local_cc);\n  do {\n    iVar3 = 0;\nLAB_00015e1d:\n    if ((param_1->_flags & 0x10) != 0) goto LAB_00015e22;\n    sVar1 = fread_unlocked((void *)((int)__ptr + iVar3),1,0x8000 - iVar3,param_1);\n    iVar3 = iVar3 + sVar1;\n    if (iVar3 != 0x8000) break;\n    FUN_000130c0(__ptr,0x8000,local_cc);\n  } while( true );\n  if (sVar1 == 0) {\n    if ((param_1->_flags & 0x20) == 0) {\nLAB_00015e22:\n      if (iVar3 != 0) {\n        FUN_00015950(__ptr,iVar3,local_cc);\n      }\n      (*param_4)(local_cc,param_2);\n      free(__ptr);\n      uVar2 = 0;\n    }\n    else {\n      free(__ptr);\n      uVar2 = 1;\n    }\n    goto LAB_00015e44;\n  }\n  goto LAB_00015e1d;\n}\n\n" (function_definition "undefined4 __regparm3 FUN_00015d90(FILE *param_1,undefined4 param_2,code *param_3,code *param_4)\n\n{\n  void *__ptr;\n  size_t sVar1;\n  undefined4 uVar2;\n  int iVar3;\n  int in_GS_OFFSET;\n  undefined1 local_cc [172];\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x15d9d;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  __ptr = malloc(0x8048);\n  if (__ptr == (void *)0x0) {\n    uVar2 = 1;\nLAB_00015e44:\n    if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n      return uVar2;\n    }\n                    \n    FUN_00019e70();\n  }\n  (*param_3)(local_cc);\n  do {\n    iVar3 = 0;\nLAB_00015e1d:\n    if ((param_1->_flags & 0x10) != 0) goto LAB_00015e22;\n    sVar1 = fread_unlocked((void *)((int)__ptr + iVar3),1,0x8000 - iVar3,param_1);\n    iVar3 = iVar3 + sVar1;\n    if (iVar3 != 0x8000) break;\n    FUN_000130c0(__ptr,0x8000,local_cc);\n  } while( true );\n  if (sVar1 == 0) {\n    if ((param_1->_flags & 0x20) == 0) {\nLAB_00015e22:\n      if (iVar3 != 0) {\n        FUN_00015950(__ptr,iVar3,local_cc);\n      }\n      (*param_4)(local_cc,param_2);\n      free(__ptr);\n      uVar2 = 0;\n    }\n    else {\n      free(__ptr);\n      uVar2 = 1;\n    }\n    goto LAB_00015e44;\n  }\n  goto LAB_00015e1d;\n}" type_identifier (ERROR "__regparm3" identifier) (function_declarator "FUN_00015d90(FILE *param_1,undefined4 param_2,code *param_3,code *param_4)" identifier (parameter_list "(FILE *param_1,undefined4 param_2,code *param_3,code *param_4)" ( (parameter_declaration "FILE *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "undefined4 param_2" type_identifier identifier) , (parameter_declaration "code *param_3" type_identifier (pointer_declarator "*param_3" * identifier)) , (parameter_declaration "code *param_4" type_identifier (pointer_declarator "*param_4" * identifier)) ))) (compound_statement "{\n  void *__ptr;\n  size_t sVar1;\n  undefined4 uVar2;\n  int iVar3;\n  int in_GS_OFFSET;\n  undefined1 local_cc [172];\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x15d9d;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  __ptr = malloc(0x8048);\n  if (__ptr == (void *)0x0) {\n    uVar2 = 1;\nLAB_00015e44:\n    if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n      return uVar2;\n    }\n                    \n    FUN_00019e70();\n  }\n  (*param_3)(local_cc);\n  do {\n    iVar3 = 0;\nLAB_00015e1d:\n    if ((param_1->_flags & 0x10) != 0) goto LAB_00015e22;\n    sVar1 = fread_unlocked((void *)((int)__ptr + iVar3),1,0x8000 - iVar3,param_1);\n    iVar3 = iVar3 + sVar1;\n    if (iVar3 != 0x8000) break;\n    FUN_000130c0(__ptr,0x8000,local_cc);\n  } while( true );\n  if (sVar1 == 0) {\n    if ((param_1->_flags & 0x20) == 0) {\nLAB_00015e22:\n      if (iVar3 != 0) {\n        FUN_00015950(__ptr,iVar3,local_cc);\n      }\n      (*param_4)(local_cc,param_2);\n      free(__ptr);\n      uVar2 = 0;\n    }\n    else {\n      free(__ptr);\n      uVar2 = 1;\n    }\n    goto LAB_00015e44;\n  }\n  goto LAB_00015e1d;\n}" { (declaration "void *__ptr;" primitive_type (pointer_declarator "*__ptr" * identifier) ;) (declaration "size_t sVar1;" primitive_type identifier ;) (declaration "undefined4 uVar2;" type_identifier identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "undefined1 local_cc [172];" type_identifier (array_declarator "local_cc [172]" identifier [ number_literal ]) ;) (declaration "int local_20;" primitive_type identifier ;) (declaration "undefined4 uStack_14;" type_identifier identifier ;) (expression_statement "uStack_14 = 0x15d9d;" (assignment_expression "uStack_14 = 0x15d9d" identifier = number_literal) ;) (expression_statement "local_20 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "local_20 = *(int *)(in_GS_OFFSET + 0x14)" identifier = (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) ;) (expression_statement "__ptr = malloc(0x8048);" (assignment_expression "__ptr = malloc(0x8048)" identifier = (call_expression "malloc(0x8048)" identifier (argument_list "(0x8048)" ( number_literal )))) ;) (if_statement "if (__ptr == (void *)0x0) {\n    uVar2 = 1;\nLAB_00015e44:\n    if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n      return uVar2;\n    }\n                    \n    FUN_00019e70();\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    uVar2 = 1;\nLAB_00015e44:\n    if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n      return uVar2;\n    }\n                    \n    FUN_00019e70();\n  }" { (expression_statement "uVar2 = 1;" (assignment_expression "uVar2 = 1" identifier = number_literal) ;) (labeled_statement "LAB_00015e44:\n    if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n      return uVar2;\n    }" statement_identifier : (if_statement "if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n      return uVar2;\n    }" if (parenthesized_expression "(local_20 == *(int *)(in_GS_OFFSET + 0x14))" ( (binary_expression "local_20 == *(int *)(in_GS_OFFSET + 0x14)" identifier == (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) )) (compound_statement "{\n      return uVar2;\n    }" { (return_statement "return uVar2;" return identifier ;) }))) (expression_statement "FUN_00019e70();" (call_expression "FUN_00019e70()" identifier (argument_list "()" ( ))) ;) })) (expression_statement "(*param_3)(local_cc);" (call_expression "(*param_3)(local_cc)" (parenthesized_expression "(*param_3)" ( (pointer_expression "*param_3" * identifier) )) (argument_list "(local_cc)" ( identifier ))) ;) (do_statement "do {\n    iVar3 = 0;\nLAB_00015e1d:\n    if ((param_1->_flags & 0x10) != 0) goto LAB_00015e22;\n    sVar1 = fread_unlocked((void *)((int)__ptr + iVar3),1,0x8000 - iVar3,param_1);\n    iVar3 = iVar3 + sVar1;\n    if (iVar3 != 0x8000) break;\n    FUN_000130c0(__ptr,0x8000,local_cc);\n  } while( true );" do (compound_statement "{\n    iVar3 = 0;\nLAB_00015e1d:\n    if ((param_1->_flags & 0x10) != 0) goto LAB_00015e22;\n    sVar1 = fread_unlocked((void *)((int)__ptr + iVar3),1,0x8000 - iVar3,param_1);\n    iVar3 = iVar3 + sVar1;\n    if (iVar3 != 0x8000) break;\n    FUN_000130c0(__ptr,0x8000,local_cc);\n  }" { (expression_statement "iVar3 = 0;" (assignment_expression "iVar3 = 0" identifier = number_literal) ;) (labeled_statement "LAB_00015e1d:\n    if ((param_1->_flags & 0x10) != 0) goto LAB_00015e22;" statement_identifier : (if_statement "if ((param_1->_flags & 0x10) != 0) goto LAB_00015e22;" if (parenthesized_expression "((param_1->_flags & 0x10) != 0)" ( (binary_expression "(param_1->_flags & 0x10) != 0" (parenthesized_expression "(param_1->_flags & 0x10)" ( (binary_expression "param_1->_flags & 0x10" (field_expression "param_1->_flags" identifier -> field_identifier) & number_literal) )) != number_literal) )) (goto_statement "goto LAB_00015e22;" goto statement_identifier ;))) (expression_statement "sVar1 = fread_unlocked((void *)((int)__ptr + iVar3),1,0x8000 - iVar3,param_1);" (assignment_expression "sVar1 = fread_unlocked((void *)((int)__ptr + iVar3),1,0x8000 - iVar3,param_1)" identifier = (call_expression "fread_unlocked((void *)((int)__ptr + iVar3),1,0x8000 - iVar3,param_1)" identifier (argument_list "((void *)((int)__ptr + iVar3),1,0x8000 - iVar3,param_1)" ( (cast_expression "(void *)((int)__ptr + iVar3)" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)__ptr + iVar3)" ( (binary_expression "(int)__ptr + iVar3" (cast_expression "(int)__ptr" ( (type_descriptor "int" primitive_type) ) identifier) + identifier) ))) , number_literal , (binary_expression "0x8000 - iVar3" number_literal - identifier) , identifier )))) ;) (expression_statement "iVar3 = iVar3 + sVar1;" (assignment_expression "iVar3 = iVar3 + sVar1" identifier = (binary_expression "iVar3 + sVar1" identifier + identifier)) ;) (if_statement "if (iVar3 != 0x8000) break;" if (parenthesized_expression "(iVar3 != 0x8000)" ( (binary_expression "iVar3 != 0x8000" identifier != number_literal) )) (break_statement "break;" break ;)) (expression_statement "FUN_000130c0(__ptr,0x8000,local_cc);" (call_expression "FUN_000130c0(__ptr,0x8000,local_cc)" identifier (argument_list "(__ptr,0x8000,local_cc)" ( identifier , number_literal , identifier ))) ;) }) while (parenthesized_expression "( true )" ( true )) ;) (if_statement "if (sVar1 == 0) {\n    if ((param_1->_flags & 0x20) == 0) {\nLAB_00015e22:\n      if (iVar3 != 0) {\n        FUN_00015950(__ptr,iVar3,local_cc);\n      }\n      (*param_4)(local_cc,param_2);\n      free(__ptr);\n      uVar2 = 0;\n    }\n    else {\n      free(__ptr);\n      uVar2 = 1;\n    }\n    goto LAB_00015e44;\n  }" if (parenthesized_expression "(sVar1 == 0)" ( (binary_expression "sVar1 == 0" identifier == number_literal) )) (compound_statement "{\n    if ((param_1->_flags & 0x20) == 0) {\nLAB_00015e22:\n      if (iVar3 != 0) {\n        FUN_00015950(__ptr,iVar3,local_cc);\n      }\n      (*param_4)(local_cc,param_2);\n      free(__ptr);\n      uVar2 = 0;\n    }\n    else {\n      free(__ptr);\n      uVar2 = 1;\n    }\n    goto LAB_00015e44;\n  }" { (if_statement "if ((param_1->_flags & 0x20) == 0) {\nLAB_00015e22:\n      if (iVar3 != 0) {\n        FUN_00015950(__ptr,iVar3,local_cc);\n      }\n      (*param_4)(local_cc,param_2);\n      free(__ptr);\n      uVar2 = 0;\n    }\n    else {\n      free(__ptr);\n      uVar2 = 1;\n    }" if (parenthesized_expression "((param_1->_flags & 0x20) == 0)" ( (binary_expression "(param_1->_flags & 0x20) == 0" (parenthesized_expression "(param_1->_flags & 0x20)" ( (binary_expression "param_1->_flags & 0x20" (field_expression "param_1->_flags" identifier -> field_identifier) & number_literal) )) == number_literal) )) (compound_statement "{\nLAB_00015e22:\n      if (iVar3 != 0) {\n        FUN_00015950(__ptr,iVar3,local_cc);\n      }\n      (*param_4)(local_cc,param_2);\n      free(__ptr);\n      uVar2 = 0;\n    }" { (labeled_statement "LAB_00015e22:\n      if (iVar3 != 0) {\n        FUN_00015950(__ptr,iVar3,local_cc);\n      }" statement_identifier : (if_statement "if (iVar3 != 0) {\n        FUN_00015950(__ptr,iVar3,local_cc);\n      }" if (parenthesized_expression "(iVar3 != 0)" ( (binary_expression "iVar3 != 0" identifier != number_literal) )) (compound_statement "{\n        FUN_00015950(__ptr,iVar3,local_cc);\n      }" { (expression_statement "FUN_00015950(__ptr,iVar3,local_cc);" (call_expression "FUN_00015950(__ptr,iVar3,local_cc)" identifier (argument_list "(__ptr,iVar3,local_cc)" ( identifier , identifier , identifier ))) ;) }))) (expression_statement "(*param_4)(local_cc,param_2);" (call_expression "(*param_4)(local_cc,param_2)" (parenthesized_expression "(*param_4)" ( (pointer_expression "*param_4" * identifier) )) (argument_list "(local_cc,param_2)" ( identifier , identifier ))) ;) (expression_statement "free(__ptr);" (call_expression "free(__ptr)" identifier (argument_list "(__ptr)" ( identifier ))) ;) (expression_statement "uVar2 = 0;" (assignment_expression "uVar2 = 0" identifier = number_literal) ;) }) (else_clause "else {\n      free(__ptr);\n      uVar2 = 1;\n    }" else (compound_statement "{\n      free(__ptr);\n      uVar2 = 1;\n    }" { (expression_statement "free(__ptr);" (call_expression "free(__ptr)" identifier (argument_list "(__ptr)" ( identifier ))) ;) (expression_statement "uVar2 = 1;" (assignment_expression "uVar2 = 1" identifier = number_literal) ;) }))) (goto_statement "goto LAB_00015e44;" goto statement_identifier ;) })) (goto_statement "goto LAB_00015e1d;" goto statement_identifier ;) })))
(translation_unit (function_definition TYPE (ERROR IDENT) (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE (pointer_declarator * IDENT)) ))) (compound_statement { (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (array_declarator IDENT [ LIT ]) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + 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) ;) (labeled_statement statement_identifier : (if_statement if (parenthesized_expression ( (binary_expression IDENT == (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) )) (compound_statement { (return_statement return IDENT ;) }))) (expression_statement (call_expression IDENT (argument_list ( ))) ;) })) (expression_statement (call_expression (parenthesized_expression ( (pointer_expression * IDENT) )) (argument_list ( IDENT ))) ;) (do_statement do (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) (labeled_statement statement_identifier : (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (field_expression IDENT -> field_identifier) & LIT) )) != LIT) )) (goto_statement goto statement_identifier ;))) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) + IDENT) ))) , LIT , (binary_expression LIT - IDENT) , IDENT )))) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + IDENT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (break_statement break ;)) (expression_statement (call_expression IDENT (argument_list ( IDENT , LIT , IDENT ))) ;) }) while (parenthesized_expression ( BOOL )) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (field_expression IDENT -> field_identifier) & LIT) )) == LIT) )) (compound_statement { (labeled_statement statement_identifier : (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT , IDENT ))) ;) }))) (expression_statement (call_expression (parenthesized_expression ( (pointer_expression * IDENT) )) (argument_list ( IDENT , IDENT ))) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (expression_statement (assignment_expression IDENT = LIT) ;) }) (else_clause else (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (expression_statement (assignment_expression IDENT = LIT) ;) }))) (goto_statement goto statement_identifier ;) })) (goto_statement goto statement_identifier ;) })))
(function_definition "undefined4 __regparm3 FUN_00015d90(FILE *param_1,undefined4 param_2,code *param_3,code *param_4)\n\n{\n  void *__ptr;\n  size_t sVar1;\n  undefined4 uVar2;\n  int iVar3;\n  int in_GS_OFFSET;\n  undefined1 local_cc [172];\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x15d9d;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  __ptr = malloc(0x8048);\n  if (__ptr == (void *)0x0) {\n    uVar2 = 1;\nLAB_00015e44:\n    if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n      return uVar2;\n    }\n                    \n    FUN_00019e70();\n  }\n  (*param_3)(local_cc);\n  do {\n    iVar3 = 0;\nLAB_00015e1d:\n    if ((param_1->_flags & 0x10) != 0) goto LAB_00015e22;\n    sVar1 = fread_unlocked((void *)((int)__ptr + iVar3),1,0x8000 - iVar3,param_1);\n    iVar3 = iVar3 + sVar1;\n    if (iVar3 != 0x8000) break;\n    FUN_000130c0(__ptr,0x8000,local_cc);\n  } while( true );\n  if (sVar1 == 0) {\n    if ((param_1->_flags & 0x20) == 0) {\nLAB_00015e22:\n      if (iVar3 != 0) {\n        FUN_00015950(__ptr,iVar3,local_cc);\n      }\n      (*param_4)(local_cc,param_2);\n      free(__ptr);\n      uVar2 = 0;\n    }\n    else {\n      free(__ptr);\n      uVar2 = 1;\n    }\n    goto LAB_00015e44;\n  }\n  goto LAB_00015e1d;\n}" (type_identifier "undefined4") (ERROR "__regparm3" (identifier "__regparm3")) (function_declarator "FUN_00015d90(FILE *param_1,undefined4 param_2,code *param_3,code *param_4)" (identifier "FUN_00015d90") (parameter_list "(FILE *param_1,undefined4 param_2,code *param_3,code *param_4)" (( "(") (parameter_declaration "FILE *param_1" (type_identifier "FILE") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "undefined4 param_2" (type_identifier "undefined4") (identifier "param_2")) (, ",") (parameter_declaration "code *param_3" (type_identifier "code") (pointer_declarator "*param_3" (* "*") (identifier "param_3"))) (, ",") (parameter_declaration "code *param_4" (type_identifier "code") (pointer_declarator "*param_4" (* "*") (identifier "param_4"))) () ")"))) (compound_statement "{\n  void *__ptr;\n  size_t sVar1;\n  undefined4 uVar2;\n  int iVar3;\n  int in_GS_OFFSET;\n  undefined1 local_cc [172];\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x15d9d;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  __ptr = malloc(0x8048);\n  if (__ptr == (void *)0x0) {\n    uVar2 = 1;\nLAB_00015e44:\n    if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n      return uVar2;\n    }\n                    \n    FUN_00019e70();\n  }\n  (*param_3)(local_cc);\n  do {\n    iVar3 = 0;\nLAB_00015e1d:\n    if ((param_1->_flags & 0x10) != 0) goto LAB_00015e22;\n    sVar1 = fread_unlocked((void *)((int)__ptr + iVar3),1,0x8000 - iVar3,param_1);\n    iVar3 = iVar3 + sVar1;\n    if (iVar3 != 0x8000) break;\n    FUN_000130c0(__ptr,0x8000,local_cc);\n  } while( true );\n  if (sVar1 == 0) {\n    if ((param_1->_flags & 0x20) == 0) {\nLAB_00015e22:\n      if (iVar3 != 0) {\n        FUN_00015950(__ptr,iVar3,local_cc);\n      }\n      (*param_4)(local_cc,param_2);\n      free(__ptr);\n      uVar2 = 0;\n    }\n    else {\n      free(__ptr);\n      uVar2 = 1;\n    }\n    goto LAB_00015e44;\n  }\n  goto LAB_00015e1d;\n}" ({ "{") (declaration "void *__ptr;" (primitive_type "void") (pointer_declarator "*__ptr" (* "*") (identifier "__ptr")) (; ";")) (declaration "size_t sVar1;" (primitive_type "size_t") (identifier "sVar1") (; ";")) (declaration "undefined4 uVar2;" (type_identifier "undefined4") (identifier "uVar2") (; ";")) (declaration "int iVar3;" (primitive_type "int") (identifier "iVar3") (; ";")) (declaration "int in_GS_OFFSET;" (primitive_type "int") (identifier "in_GS_OFFSET") (; ";")) (declaration "undefined1 local_cc [172];" (type_identifier "undefined1") (array_declarator "local_cc [172]" (identifier "local_cc") ([ "[") (number_literal "172") (] "]")) (; ";")) (declaration "int local_20;" (primitive_type "int") (identifier "local_20") (; ";")) (declaration "undefined4 uStack_14;" (type_identifier "undefined4") (identifier "uStack_14") (; ";")) (expression_statement "uStack_14 = 0x15d9d;" (assignment_expression "uStack_14 = 0x15d9d" (identifier "uStack_14") (= "=") (number_literal "0x15d9d")) (; ";")) (expression_statement "local_20 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "local_20 = *(int *)(in_GS_OFFSET + 0x14)" (identifier "local_20") (= "=") (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" (* "*") (cast_expression "(int *)(in_GS_OFFSET + 0x14)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(in_GS_OFFSET + 0x14)" (( "(") (binary_expression "in_GS_OFFSET + 0x14" (identifier "in_GS_OFFSET") (+ "+") (number_literal "0x14")) () ")"))))) (; ";")) (expression_statement "__ptr = malloc(0x8048);" (assignment_expression "__ptr = malloc(0x8048)" (identifier "__ptr") (= "=") (call_expression "malloc(0x8048)" (identifier "malloc") (argument_list "(0x8048)" (( "(") (number_literal "0x8048") () ")")))) (; ";")) (if_statement "if (__ptr == (void *)0x0) {\n    uVar2 = 1;\nLAB_00015e44:\n    if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n      return uVar2;\n    }\n                    \n    FUN_00019e70();\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    uVar2 = 1;\nLAB_00015e44:\n    if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n      return uVar2;\n    }\n                    \n    FUN_00019e70();\n  }" ({ "{") (expression_statement "uVar2 = 1;" (assignment_expression "uVar2 = 1" (identifier "uVar2") (= "=") (number_literal "1")) (; ";")) (labeled_statement "LAB_00015e44:\n    if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n      return uVar2;\n    }" (statement_identifier "LAB_00015e44") (: ":") (if_statement "if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n      return uVar2;\n    }" (if "if") (parenthesized_expression "(local_20 == *(int *)(in_GS_OFFSET + 0x14))" (( "(") (binary_expression "local_20 == *(int *)(in_GS_OFFSET + 0x14)" (identifier "local_20") (== "==") (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" (* "*") (cast_expression "(int *)(in_GS_OFFSET + 0x14)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(in_GS_OFFSET + 0x14)" (( "(") (binary_expression "in_GS_OFFSET + 0x14" (identifier "in_GS_OFFSET") (+ "+") (number_literal "0x14")) () ")"))))) () ")")) (compound_statement "{\n      return uVar2;\n    }" ({ "{") (return_statement "return uVar2;" (return "return") (identifier "uVar2") (; ";")) (} "}")))) (expression_statement "FUN_00019e70();" (call_expression "FUN_00019e70()" (identifier "FUN_00019e70") (argument_list "()" (( "(") () ")"))) (; ";")) (} "}"))) (expression_statement "(*param_3)(local_cc);" (call_expression "(*param_3)(local_cc)" (parenthesized_expression "(*param_3)" (( "(") (pointer_expression "*param_3" (* "*") (identifier "param_3")) () ")")) (argument_list "(local_cc)" (( "(") (identifier "local_cc") () ")"))) (; ";")) (do_statement "do {\n    iVar3 = 0;\nLAB_00015e1d:\n    if ((param_1->_flags & 0x10) != 0) goto LAB_00015e22;\n    sVar1 = fread_unlocked((void *)((int)__ptr + iVar3),1,0x8000 - iVar3,param_1);\n    iVar3 = iVar3 + sVar1;\n    if (iVar3 != 0x8000) break;\n    FUN_000130c0(__ptr,0x8000,local_cc);\n  } while( true );" (do "do") (compound_statement "{\n    iVar3 = 0;\nLAB_00015e1d:\n    if ((param_1->_flags & 0x10) != 0) goto LAB_00015e22;\n    sVar1 = fread_unlocked((void *)((int)__ptr + iVar3),1,0x8000 - iVar3,param_1);\n    iVar3 = iVar3 + sVar1;\n    if (iVar3 != 0x8000) break;\n    FUN_000130c0(__ptr,0x8000,local_cc);\n  }" ({ "{") (expression_statement "iVar3 = 0;" (assignment_expression "iVar3 = 0" (identifier "iVar3") (= "=") (number_literal "0")) (; ";")) (labeled_statement "LAB_00015e1d:\n    if ((param_1->_flags & 0x10) != 0) goto LAB_00015e22;" (statement_identifier "LAB_00015e1d") (: ":") (if_statement "if ((param_1->_flags & 0x10) != 0) goto LAB_00015e22;" (if "if") (parenthesized_expression "((param_1->_flags & 0x10) != 0)" (( "(") (binary_expression "(param_1->_flags & 0x10) != 0" (parenthesized_expression "(param_1->_flags & 0x10)" (( "(") (binary_expression "param_1->_flags & 0x10" (field_expression "param_1->_flags" (identifier "param_1") (-> "->") (field_identifier "_flags")) (& "&") (number_literal "0x10")) () ")")) (!= "!=") (number_literal "0")) () ")")) (goto_statement "goto LAB_00015e22;" (goto "goto") (statement_identifier "LAB_00015e22") (; ";")))) (expression_statement "sVar1 = fread_unlocked((void *)((int)__ptr + iVar3),1,0x8000 - iVar3,param_1);" (assignment_expression "sVar1 = fread_unlocked((void *)((int)__ptr + iVar3),1,0x8000 - iVar3,param_1)" (identifier "sVar1") (= "=") (call_expression "fread_unlocked((void *)((int)__ptr + iVar3),1,0x8000 - iVar3,param_1)" (identifier "fread_unlocked") (argument_list "((void *)((int)__ptr + iVar3),1,0x8000 - iVar3,param_1)" (( "(") (cast_expression "(void *)((int)__ptr + iVar3)" (( "(") (type_descriptor "void *" (primitive_type "void") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "((int)__ptr + iVar3)" (( "(") (binary_expression "(int)__ptr + iVar3" (cast_expression "(int)__ptr" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "__ptr")) (+ "+") (identifier "iVar3")) () ")"))) (, ",") (number_literal "1") (, ",") (binary_expression "0x8000 - iVar3" (number_literal "0x8000") (- "-") (identifier "iVar3")) (, ",") (identifier "param_1") () ")")))) (; ";")) (expression_statement "iVar3 = iVar3 + sVar1;" (assignment_expression "iVar3 = iVar3 + sVar1" (identifier "iVar3") (= "=") (binary_expression "iVar3 + sVar1" (identifier "iVar3") (+ "+") (identifier "sVar1"))) (; ";")) (if_statement "if (iVar3 != 0x8000) break;" (if "if") (parenthesized_expression "(iVar3 != 0x8000)" (( "(") (binary_expression "iVar3 != 0x8000" (identifier "iVar3") (!= "!=") (number_literal "0x8000")) () ")")) (break_statement "break;" (break "break") (; ";"))) (expression_statement "FUN_000130c0(__ptr,0x8000,local_cc);" (call_expression "FUN_000130c0(__ptr,0x8000,local_cc)" (identifier "FUN_000130c0") (argument_list "(__ptr,0x8000,local_cc)" (( "(") (identifier "__ptr") (, ",") (number_literal "0x8000") (, ",") (identifier "local_cc") () ")"))) (; ";")) (} "}")) (while "while") (parenthesized_expression "( true )" (( "(") (true "true") () ")")) (; ";")) (if_statement "if (sVar1 == 0) {\n    if ((param_1->_flags & 0x20) == 0) {\nLAB_00015e22:\n      if (iVar3 != 0) {\n        FUN_00015950(__ptr,iVar3,local_cc);\n      }\n      (*param_4)(local_cc,param_2);\n      free(__ptr);\n      uVar2 = 0;\n    }\n    else {\n      free(__ptr);\n      uVar2 = 1;\n    }\n    goto LAB_00015e44;\n  }" (if "if") (parenthesized_expression "(sVar1 == 0)" (( "(") (binary_expression "sVar1 == 0" (identifier "sVar1") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n    if ((param_1->_flags & 0x20) == 0) {\nLAB_00015e22:\n      if (iVar3 != 0) {\n        FUN_00015950(__ptr,iVar3,local_cc);\n      }\n      (*param_4)(local_cc,param_2);\n      free(__ptr);\n      uVar2 = 0;\n    }\n    else {\n      free(__ptr);\n      uVar2 = 1;\n    }\n    goto LAB_00015e44;\n  }" ({ "{") (if_statement "if ((param_1->_flags & 0x20) == 0) {\nLAB_00015e22:\n      if (iVar3 != 0) {\n        FUN_00015950(__ptr,iVar3,local_cc);\n      }\n      (*param_4)(local_cc,param_2);\n      free(__ptr);\n      uVar2 = 0;\n    }\n    else {\n      free(__ptr);\n      uVar2 = 1;\n    }" (if "if") (parenthesized_expression "((param_1->_flags & 0x20) == 0)" (( "(") (binary_expression "(param_1->_flags & 0x20) == 0" (parenthesized_expression "(param_1->_flags & 0x20)" (( "(") (binary_expression "param_1->_flags & 0x20" (field_expression "param_1->_flags" (identifier "param_1") (-> "->") (field_identifier "_flags")) (& "&") (number_literal "0x20")) () ")")) (== "==") (number_literal "0")) () ")")) (compound_statement "{\nLAB_00015e22:\n      if (iVar3 != 0) {\n        FUN_00015950(__ptr,iVar3,local_cc);\n      }\n      (*param_4)(local_cc,param_2);\n      free(__ptr);\n      uVar2 = 0;\n    }" ({ "{") (labeled_statement "LAB_00015e22:\n      if (iVar3 != 0) {\n        FUN_00015950(__ptr,iVar3,local_cc);\n      }" (statement_identifier "LAB_00015e22") (: ":") (if_statement "if (iVar3 != 0) {\n        FUN_00015950(__ptr,iVar3,local_cc);\n      }" (if "if") (parenthesized_expression "(iVar3 != 0)" (( "(") (binary_expression "iVar3 != 0" (identifier "iVar3") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n        FUN_00015950(__ptr,iVar3,local_cc);\n      }" ({ "{") (expression_statement "FUN_00015950(__ptr,iVar3,local_cc);" (call_expression "FUN_00015950(__ptr,iVar3,local_cc)" (identifier "FUN_00015950") (argument_list "(__ptr,iVar3,local_cc)" (( "(") (identifier "__ptr") (, ",") (identifier "iVar3") (, ",") (identifier "local_cc") () ")"))) (; ";")) (} "}")))) (expression_statement "(*param_4)(local_cc,param_2);" (call_expression "(*param_4)(local_cc,param_2)" (parenthesized_expression "(*param_4)" (( "(") (pointer_expression "*param_4" (* "*") (identifier "param_4")) () ")")) (argument_list "(local_cc,param_2)" (( "(") (identifier "local_cc") (, ",") (identifier "param_2") () ")"))) (; ";")) (expression_statement "free(__ptr);" (call_expression "free(__ptr)" (identifier "free") (argument_list "(__ptr)" (( "(") (identifier "__ptr") () ")"))) (; ";")) (expression_statement "uVar2 = 0;" (assignment_expression "uVar2 = 0" (identifier "uVar2") (= "=") (number_literal "0")) (; ";")) (} "}")) (else_clause "else {\n      free(__ptr);\n      uVar2 = 1;\n    }" (else "else") (compound_statement "{\n      free(__ptr);\n      uVar2 = 1;\n    }" ({ "{") (expression_statement "free(__ptr);" (call_expression "free(__ptr)" (identifier "free") (argument_list "(__ptr)" (( "(") (identifier "__ptr") () ")"))) (; ";")) (expression_statement "uVar2 = 1;" (assignment_expression "uVar2 = 1" (identifier "uVar2") (= "=") (number_literal "1")) (; ";")) (} "}")))) (goto_statement "goto LAB_00015e44;" (goto "goto") (statement_identifier "LAB_00015e44") (; ";")) (} "}"))) (goto_statement "goto LAB_00015e1d;" (goto "goto") (statement_identifier "LAB_00015e1d") (; ";")) (} "}")))

/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */

int __regparm3
function_1(type_1 *stream,char *alg,void *resblock,ssize_t hashlen,
             type_2 *init_ctx,type_3 *finish_ctx)

{
  int var_4;
  void *var_3;
  size_t var_8;
  int iVar3;
  size_t var_7;
  int var_1;
  type_4 ctx;
  
  var_4 = *(int *)(var_1 + 0x14);
  var_3 = var_2(0x8048);
  if (var_3 == (void *)0x0) {
    iVar3 = 1;
LAB_00015e44:
    if (var_4 == *(int *)(var_1 + 0x14)) {
      return iVar3;
    }
                    /* WARNING: Subroutine does not return */
    var_5();
  }
  (*(type_5 *)resblock)(&ctx);
  do {
    var_7 = 0;
LAB_00015e1d:
    if ((stream->_flags & 0x10) != 0) goto LAB_00015e22;
    var_8 = var_6((void *)((int)var_3 + var_7),1,0x8000 - var_7,(type_1 *)stream);
    var_7 = var_7 + var_8;
    if (var_7 != 0x8000) break;
    var_9(var_3,0x8000,&ctx);
  } while( true );
  if (var_8 == 0) {
    if ((stream->_flags & 0x20) == 0) {
LAB_00015e22:
      if (var_7 != 0) {
        var_10(var_3,var_7,&ctx);
      }
      (*(type_5 *)hashlen)(&ctx,alg);
      var_11(var_3);
      iVar3 = 0;
    }
    else {
      var_11(var_3);
      iVar3 = 1;
    }
    goto LAB_00015e44;
  }
  goto LAB_00015e1d;
}


(translation_unit (function_definition type: (type_identifier) (ERROR (identifier)) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (parameter_declaration type: (type_identifier) declarator: (identifier)) (parameter_declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (parameter_declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))))) body: (compound_statement (declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (type_identifier) declarator: (array_declarator declarator: (identifier) size: (number_literal))) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (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))) (labeled_statement label: (statement_identifier) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) 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))))) (expression_statement (call_expression function: (parenthesized_expression (pointer_expression argument: (identifier))) arguments: (argument_list (identifier)))) (do_statement body: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (labeled_statement label: (statement_identifier) (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (field_expression argument: (identifier) field: (field_identifier)) right: (number_literal))) right: (number_literal))) consequence: (goto_statement label: (statement_identifier)))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (cast_expression type: (type_descriptor type: (primitive_type)) value: (identifier)) right: (identifier)))) (number_literal) (binary_expression left: (number_literal) right: (identifier)) (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (break_statement)) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier) (number_literal) (identifier))))) condition: (parenthesized_expression (true))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (field_expression argument: (identifier) field: (field_identifier)) right: (number_literal))) right: (number_literal))) consequence: (compound_statement (labeled_statement label: (statement_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) (identifier) (identifier))))))) (expression_statement (call_expression function: (parenthesized_expression (pointer_expression argument: (identifier))) arguments: (argument_list (identifier) (identifier)))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (number_literal)))) alternative: (else_clause (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (number_literal)))))) (goto_statement label: (statement_identifier)))) (goto_statement label: (statement_identifier)))))

/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */

undefined4 __regparm3 MASKED(FILE *param_1,undefined4 param_2,code *param_3,code *param_4)

{
  void *__ptr;
  size_t sVar1;
  undefined4 uVar2;
  int iVar3;
  int in_GS_OFFSET;
  undefined1 local_cc [172];
  int local_20;
  undefined4 uStack_14;
  
  uStack_14 = 0x15d9d;
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  __ptr = malloc(0x8048);
  if (__ptr == (void *)0x0) {
    uVar2 = 1;
LAB_00015e44:
    if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
      return uVar2;
    }
                    /* WARNING: Subroutine does not return */
    FUN_00019e70();
  }
  (*param_3)(local_cc);
  do {
    iVar3 = 0;
LAB_00015e1d:
    if ((param_1->_flags & 0x10) != 0) goto LAB_00015e22;
    sVar1 = fread_unlocked((void *)((int)__ptr + iVar3),1,0x8000 - iVar3,param_1);
    iVar3 = iVar3 + sVar1;
    if (iVar3 != 0x8000) break;
    FUN_000130c0(__ptr,0x8000,local_cc);
  } while( true );
  if (sVar1 == 0) {
    if ((param_1->_flags & 0x20) == 0) {
LAB_00015e22:
      if (iVar3 != 0) {
        FUN_00015950(__ptr,iVar3,local_cc);
      }
      (*param_4)(local_cc,param_2);
      free(__ptr);
      uVar2 = 0;
    }
    else {
      free(__ptr);
      uVar2 = 1;
    }
    goto LAB_00015e44;
  }
  goto LAB_00015e1d;
}

