
int sha1_stream(FILE *stream,void *resblock)

{
  int iVar1;
  size_t sVar2;
  size_t len;
  sha1_ctx ctx;
  char buffer [4168];
  
  ctx.A = 0x67452301;
  ctx.B = 0xefcdab89;
  ctx.C = 0x98badcfe;
  ctx.D = 0x10325476;
  ctx.E = 0xc3d2e1f0;
  ctx.total[0] = 0;
  ctx.total[1] = 0;
  ctx.buflen = 0;
  do {
    len = 0;
    while( true ) {
      sVar2 = fread(buffer + len,1,0x1000 - len,(FILE *)stream);
      len = len + sVar2;
      if (len == 0x1000) break;
      if (sVar2 == 0) {
        iVar1 = ferror((FILE *)stream);
        if (iVar1 != 0) {
          return 1;
        }
        goto LAB_002d5340;
      }
      iVar1 = feof((FILE *)stream);
      if (iVar1 != 0) {
LAB_002d5340:
        if (len != 0) {
          sha1_process_bytes(buffer,len,&ctx);
        }
        sha1_finish_ctx(&ctx,resblock);
        return 0;
      }
    }
    sha1_process_block(buffer,0x1000,&ctx);
  } while( true );
}



undefined8 FUN_002d5280(FILE *param_1,undefined8 param_2)

{
  int iVar1;
  size_t sVar2;
  long lVar3;
  undefined8 local_1128;
  undefined8 local_1120;
  undefined8 local_1118;
  undefined8 local_1110;
  undefined1 local_1088 [4184];
  
  local_1128 = 0xefcdab8967452301;
  local_1120 = 0x1032547698badcfe;
  local_1118 = 0xc3d2e1f0;
  local_1110 = 0;
  do {
    lVar3 = 0;
    while( true ) {
      sVar2 = fread(local_1088 + lVar3,1,0x1000 - lVar3,param_1);
      lVar3 = lVar3 + sVar2;
      if (lVar3 == 0x1000) break;
      if (sVar2 == 0) {
        iVar1 = ferror(param_1);
        if (iVar1 != 0) {
          return 1;
        }
        goto LAB_002d5340;
      }
      iVar1 = feof(param_1);
      if (iVar1 != 0) {
LAB_002d5340:
        if (lVar3 != 0) {
          FUN_002d4f20(local_1088,lVar3,&local_1128);
        }
        FUN_002d4de0(&local_1128,param_2);
        return 0;
      }
    }
    FUN_002d3c40(local_1088,0x1000,&local_1128);
  } while( true );
}


MOV RAX,-0x1032547698badcff
PUSH R15
PUSH R14
MOV R14,RSI
PUSH R13
PUSH R12
PUSH RBP
MOV RBP,RDI
PUSH RBX
SUB RSP,0x10f8
MOV qword ptr [RSP],RAX
LEA R12,[RSP + 0xa0]
MOV R15,RSP
MOV RAX,0x1032547698badcfe
MOV qword ptr [RSP + 0x8],RAX
MOV EAX,0xc3d2e1f0
MOV qword ptr [RSP + 0x10],RAX
MOV qword ptr [RSP + 0x18],0x0
XOR EBX,EBX
MOV R13D,0x1000
JMP 0x002d52f1
MOV RDI,RBP
TEST RAX,RAX
JZ 0x002d5330
CALL 0x00147870
TEST EAX,EAX
JNZ 0x002d5340
MOV RDX,R13
LEA RDI,[R12 + RBX*0x1]
MOV RCX,RBP
MOV ESI,0x1
SUB RDX,RBX
CALL 0x00147710
ADD RBX,RAX
CMP RBX,0x1000
JNZ 0x002d52e0
MOV RDX,R15
MOV ESI,0x1000
MOV RDI,R12
CALL 0x002d3c40
JMP 0x002d52d2
CALL 0x001474b0
MOV EDX,EAX
MOV EAX,0x1
TEST EDX,EDX
JNZ 0x002d5355
MOV RBP,RSP
TEST RBX,RBX
JNZ 0x002d5370
MOV RSI,R14
MOV RDI,RBP
CALL 0x002d4de0
XOR EAX,EAX
ADD RSP,0x10f8
POP RBX
POP RBP
POP R12
POP R13
POP R14
POP R15
RET
MOV RDX,RBP
MOV RSI,RBX
MOV RDI,R12
CALL 0x002d4f20
JMP 0x002d5348
(translation_unit "undefined8 FUN_002d5280(FILE *param_1,undefined8 param_2)\n\n{\n  int iVar1;\n  size_t sVar2;\n  long lVar3;\n  undefined8 local_1128;\n  undefined8 local_1120;\n  undefined8 local_1118;\n  undefined8 local_1110;\n  undefined1 local_1088 [4184];\n  \n  local_1128 = 0xefcdab8967452301;\n  local_1120 = 0x1032547698badcfe;\n  local_1118 = 0xc3d2e1f0;\n  local_1110 = 0;\n  do {\n    lVar3 = 0;\n    while( true ) {\n      sVar2 = fread(local_1088 + lVar3,1,0x1000 - lVar3,param_1);\n      lVar3 = lVar3 + sVar2;\n      if (lVar3 == 0x1000) break;\n      if (sVar2 == 0) {\n        iVar1 = ferror(param_1);\n        if (iVar1 != 0) {\n          return 1;\n        }\n        goto LAB_002d5340;\n      }\n      iVar1 = feof(param_1);\n      if (iVar1 != 0) {\nLAB_002d5340:\n        if (lVar3 != 0) {\n          FUN_002d4f20(local_1088,lVar3,&local_1128);\n        }\n        FUN_002d4de0(&local_1128,param_2);\n        return 0;\n      }\n    }\n    FUN_002d3c40(local_1088,0x1000,&local_1128);\n  } while( true );\n}\n\n" (function_definition "undefined8 FUN_002d5280(FILE *param_1,undefined8 param_2)\n\n{\n  int iVar1;\n  size_t sVar2;\n  long lVar3;\n  undefined8 local_1128;\n  undefined8 local_1120;\n  undefined8 local_1118;\n  undefined8 local_1110;\n  undefined1 local_1088 [4184];\n  \n  local_1128 = 0xefcdab8967452301;\n  local_1120 = 0x1032547698badcfe;\n  local_1118 = 0xc3d2e1f0;\n  local_1110 = 0;\n  do {\n    lVar3 = 0;\n    while( true ) {\n      sVar2 = fread(local_1088 + lVar3,1,0x1000 - lVar3,param_1);\n      lVar3 = lVar3 + sVar2;\n      if (lVar3 == 0x1000) break;\n      if (sVar2 == 0) {\n        iVar1 = ferror(param_1);\n        if (iVar1 != 0) {\n          return 1;\n        }\n        goto LAB_002d5340;\n      }\n      iVar1 = feof(param_1);\n      if (iVar1 != 0) {\nLAB_002d5340:\n        if (lVar3 != 0) {\n          FUN_002d4f20(local_1088,lVar3,&local_1128);\n        }\n        FUN_002d4de0(&local_1128,param_2);\n        return 0;\n      }\n    }\n    FUN_002d3c40(local_1088,0x1000,&local_1128);\n  } while( true );\n}" type_identifier (function_declarator "FUN_002d5280(FILE *param_1,undefined8 param_2)" identifier (parameter_list "(FILE *param_1,undefined8 param_2)" ( (parameter_declaration "FILE *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "undefined8 param_2" type_identifier identifier) ))) (compound_statement "{\n  int iVar1;\n  size_t sVar2;\n  long lVar3;\n  undefined8 local_1128;\n  undefined8 local_1120;\n  undefined8 local_1118;\n  undefined8 local_1110;\n  undefined1 local_1088 [4184];\n  \n  local_1128 = 0xefcdab8967452301;\n  local_1120 = 0x1032547698badcfe;\n  local_1118 = 0xc3d2e1f0;\n  local_1110 = 0;\n  do {\n    lVar3 = 0;\n    while( true ) {\n      sVar2 = fread(local_1088 + lVar3,1,0x1000 - lVar3,param_1);\n      lVar3 = lVar3 + sVar2;\n      if (lVar3 == 0x1000) break;\n      if (sVar2 == 0) {\n        iVar1 = ferror(param_1);\n        if (iVar1 != 0) {\n          return 1;\n        }\n        goto LAB_002d5340;\n      }\n      iVar1 = feof(param_1);\n      if (iVar1 != 0) {\nLAB_002d5340:\n        if (lVar3 != 0) {\n          FUN_002d4f20(local_1088,lVar3,&local_1128);\n        }\n        FUN_002d4de0(&local_1128,param_2);\n        return 0;\n      }\n    }\n    FUN_002d3c40(local_1088,0x1000,&local_1128);\n  } while( true );\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "size_t sVar2;" primitive_type identifier ;) (declaration "long lVar3;" (sized_type_specifier "long" long) identifier ;) (declaration "undefined8 local_1128;" type_identifier identifier ;) (declaration "undefined8 local_1120;" type_identifier identifier ;) (declaration "undefined8 local_1118;" type_identifier identifier ;) (declaration "undefined8 local_1110;" type_identifier identifier ;) (declaration "undefined1 local_1088 [4184];" type_identifier (array_declarator "local_1088 [4184]" identifier [ number_literal ]) ;) (expression_statement "local_1128 = 0xefcdab8967452301;" (assignment_expression "local_1128 = 0xefcdab8967452301" identifier = number_literal) ;) (expression_statement "local_1120 = 0x1032547698badcfe;" (assignment_expression "local_1120 = 0x1032547698badcfe" identifier = number_literal) ;) (expression_statement "local_1118 = 0xc3d2e1f0;" (assignment_expression "local_1118 = 0xc3d2e1f0" identifier = number_literal) ;) (expression_statement "local_1110 = 0;" (assignment_expression "local_1110 = 0" identifier = number_literal) ;) (do_statement "do {\n    lVar3 = 0;\n    while( true ) {\n      sVar2 = fread(local_1088 + lVar3,1,0x1000 - lVar3,param_1);\n      lVar3 = lVar3 + sVar2;\n      if (lVar3 == 0x1000) break;\n      if (sVar2 == 0) {\n        iVar1 = ferror(param_1);\n        if (iVar1 != 0) {\n          return 1;\n        }\n        goto LAB_002d5340;\n      }\n      iVar1 = feof(param_1);\n      if (iVar1 != 0) {\nLAB_002d5340:\n        if (lVar3 != 0) {\n          FUN_002d4f20(local_1088,lVar3,&local_1128);\n        }\n        FUN_002d4de0(&local_1128,param_2);\n        return 0;\n      }\n    }\n    FUN_002d3c40(local_1088,0x1000,&local_1128);\n  } while( true );" do (compound_statement "{\n    lVar3 = 0;\n    while( true ) {\n      sVar2 = fread(local_1088 + lVar3,1,0x1000 - lVar3,param_1);\n      lVar3 = lVar3 + sVar2;\n      if (lVar3 == 0x1000) break;\n      if (sVar2 == 0) {\n        iVar1 = ferror(param_1);\n        if (iVar1 != 0) {\n          return 1;\n        }\n        goto LAB_002d5340;\n      }\n      iVar1 = feof(param_1);\n      if (iVar1 != 0) {\nLAB_002d5340:\n        if (lVar3 != 0) {\n          FUN_002d4f20(local_1088,lVar3,&local_1128);\n        }\n        FUN_002d4de0(&local_1128,param_2);\n        return 0;\n      }\n    }\n    FUN_002d3c40(local_1088,0x1000,&local_1128);\n  }" { (expression_statement "lVar3 = 0;" (assignment_expression "lVar3 = 0" identifier = number_literal) ;) (while_statement "while( true ) {\n      sVar2 = fread(local_1088 + lVar3,1,0x1000 - lVar3,param_1);\n      lVar3 = lVar3 + sVar2;\n      if (lVar3 == 0x1000) break;\n      if (sVar2 == 0) {\n        iVar1 = ferror(param_1);\n        if (iVar1 != 0) {\n          return 1;\n        }\n        goto LAB_002d5340;\n      }\n      iVar1 = feof(param_1);\n      if (iVar1 != 0) {\nLAB_002d5340:\n        if (lVar3 != 0) {\n          FUN_002d4f20(local_1088,lVar3,&local_1128);\n        }\n        FUN_002d4de0(&local_1128,param_2);\n        return 0;\n      }\n    }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n      sVar2 = fread(local_1088 + lVar3,1,0x1000 - lVar3,param_1);\n      lVar3 = lVar3 + sVar2;\n      if (lVar3 == 0x1000) break;\n      if (sVar2 == 0) {\n        iVar1 = ferror(param_1);\n        if (iVar1 != 0) {\n          return 1;\n        }\n        goto LAB_002d5340;\n      }\n      iVar1 = feof(param_1);\n      if (iVar1 != 0) {\nLAB_002d5340:\n        if (lVar3 != 0) {\n          FUN_002d4f20(local_1088,lVar3,&local_1128);\n        }\n        FUN_002d4de0(&local_1128,param_2);\n        return 0;\n      }\n    }" { (expression_statement "sVar2 = fread(local_1088 + lVar3,1,0x1000 - lVar3,param_1);" (assignment_expression "sVar2 = fread(local_1088 + lVar3,1,0x1000 - lVar3,param_1)" identifier = (call_expression "fread(local_1088 + lVar3,1,0x1000 - lVar3,param_1)" identifier (argument_list "(local_1088 + lVar3,1,0x1000 - lVar3,param_1)" ( (binary_expression "local_1088 + lVar3" identifier + identifier) , number_literal , (binary_expression "0x1000 - lVar3" number_literal - identifier) , identifier )))) ;) (expression_statement "lVar3 = lVar3 + sVar2;" (assignment_expression "lVar3 = lVar3 + sVar2" identifier = (binary_expression "lVar3 + sVar2" identifier + identifier)) ;) (if_statement "if (lVar3 == 0x1000) break;" if (parenthesized_expression "(lVar3 == 0x1000)" ( (binary_expression "lVar3 == 0x1000" identifier == number_literal) )) (break_statement "break;" break ;)) (if_statement "if (sVar2 == 0) {\n        iVar1 = ferror(param_1);\n        if (iVar1 != 0) {\n          return 1;\n        }\n        goto LAB_002d5340;\n      }" if (parenthesized_expression "(sVar2 == 0)" ( (binary_expression "sVar2 == 0" identifier == number_literal) )) (compound_statement "{\n        iVar1 = ferror(param_1);\n        if (iVar1 != 0) {\n          return 1;\n        }\n        goto LAB_002d5340;\n      }" { (expression_statement "iVar1 = ferror(param_1);" (assignment_expression "iVar1 = ferror(param_1)" identifier = (call_expression "ferror(param_1)" identifier (argument_list "(param_1)" ( identifier )))) ;) (if_statement "if (iVar1 != 0) {\n          return 1;\n        }" if (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) (compound_statement "{\n          return 1;\n        }" { (return_statement "return 1;" return number_literal ;) })) (goto_statement "goto LAB_002d5340;" goto statement_identifier ;) })) (expression_statement "iVar1 = feof(param_1);" (assignment_expression "iVar1 = feof(param_1)" identifier = (call_expression "feof(param_1)" identifier (argument_list "(param_1)" ( identifier )))) ;) (if_statement "if (iVar1 != 0) {\nLAB_002d5340:\n        if (lVar3 != 0) {\n          FUN_002d4f20(local_1088,lVar3,&local_1128);\n        }\n        FUN_002d4de0(&local_1128,param_2);\n        return 0;\n      }" if (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) (compound_statement "{\nLAB_002d5340:\n        if (lVar3 != 0) {\n          FUN_002d4f20(local_1088,lVar3,&local_1128);\n        }\n        FUN_002d4de0(&local_1128,param_2);\n        return 0;\n      }" { (labeled_statement "LAB_002d5340:\n        if (lVar3 != 0) {\n          FUN_002d4f20(local_1088,lVar3,&local_1128);\n        }" statement_identifier : (if_statement "if (lVar3 != 0) {\n          FUN_002d4f20(local_1088,lVar3,&local_1128);\n        }" if (parenthesized_expression "(lVar3 != 0)" ( (binary_expression "lVar3 != 0" identifier != number_literal) )) (compound_statement "{\n          FUN_002d4f20(local_1088,lVar3,&local_1128);\n        }" { (expression_statement "FUN_002d4f20(local_1088,lVar3,&local_1128);" (call_expression "FUN_002d4f20(local_1088,lVar3,&local_1128)" identifier (argument_list "(local_1088,lVar3,&local_1128)" ( identifier , identifier , (pointer_expression "&local_1128" & identifier) ))) ;) }))) (expression_statement "FUN_002d4de0(&local_1128,param_2);" (call_expression "FUN_002d4de0(&local_1128,param_2)" identifier (argument_list "(&local_1128,param_2)" ( (pointer_expression "&local_1128" & identifier) , identifier ))) ;) (return_statement "return 0;" return number_literal ;) })) })) (expression_statement "FUN_002d3c40(local_1088,0x1000,&local_1128);" (call_expression "FUN_002d3c40(local_1088,0x1000,&local_1128)" identifier (argument_list "(local_1088,0x1000,&local_1128)" ( identifier , number_literal , (pointer_expression "&local_1128" & identifier) ))) ;) }) while (parenthesized_expression "( true )" ( true )) ;) })))
(translation_unit "int sha1_stream(FILE *stream,void *resblock)\n\n{\n  int iVar1;\n  size_t sVar2;\n  size_t len;\n  sha1_ctx ctx;\n  char buffer [4168];\n  \n  ctx.A = 0x67452301;\n  ctx.B = 0xefcdab89;\n  ctx.C = 0x98badcfe;\n  ctx.D = 0x10325476;\n  ctx.E = 0xc3d2e1f0;\n  ctx.total[0] = 0;\n  ctx.total[1] = 0;\n  ctx.buflen = 0;\n  do {\n    len = 0;\n    while( true ) {\n      sVar2 = fread(buffer + len,1,0x1000 - len,(FILE *)stream);\n      len = len + sVar2;\n      if (len == 0x1000) break;\n      if (sVar2 == 0) {\n        iVar1 = ferror((FILE *)stream);\n        if (iVar1 != 0) {\n          return 1;\n        }\n        goto LAB_002d5340;\n      }\n      iVar1 = feof((FILE *)stream);\n      if (iVar1 != 0) {\nLAB_002d5340:\n        if (len != 0) {\n          sha1_process_bytes(buffer,len,&ctx);\n        }\n        sha1_finish_ctx(&ctx,resblock);\n        return 0;\n      }\n    }\n    sha1_process_block(buffer,0x1000,&ctx);\n  } while( true );\n}\n\n" (function_definition "int sha1_stream(FILE *stream,void *resblock)\n\n{\n  int iVar1;\n  size_t sVar2;\n  size_t len;\n  sha1_ctx ctx;\n  char buffer [4168];\n  \n  ctx.A = 0x67452301;\n  ctx.B = 0xefcdab89;\n  ctx.C = 0x98badcfe;\n  ctx.D = 0x10325476;\n  ctx.E = 0xc3d2e1f0;\n  ctx.total[0] = 0;\n  ctx.total[1] = 0;\n  ctx.buflen = 0;\n  do {\n    len = 0;\n    while( true ) {\n      sVar2 = fread(buffer + len,1,0x1000 - len,(FILE *)stream);\n      len = len + sVar2;\n      if (len == 0x1000) break;\n      if (sVar2 == 0) {\n        iVar1 = ferror((FILE *)stream);\n        if (iVar1 != 0) {\n          return 1;\n        }\n        goto LAB_002d5340;\n      }\n      iVar1 = feof((FILE *)stream);\n      if (iVar1 != 0) {\nLAB_002d5340:\n        if (len != 0) {\n          sha1_process_bytes(buffer,len,&ctx);\n        }\n        sha1_finish_ctx(&ctx,resblock);\n        return 0;\n      }\n    }\n    sha1_process_block(buffer,0x1000,&ctx);\n  } while( true );\n}" primitive_type (function_declarator "sha1_stream(FILE *stream,void *resblock)" identifier (parameter_list "(FILE *stream,void *resblock)" ( (parameter_declaration "FILE *stream" type_identifier (pointer_declarator "*stream" * identifier)) , (parameter_declaration "void *resblock" primitive_type (pointer_declarator "*resblock" * identifier)) ))) (compound_statement "{\n  int iVar1;\n  size_t sVar2;\n  size_t len;\n  sha1_ctx ctx;\n  char buffer [4168];\n  \n  ctx.A = 0x67452301;\n  ctx.B = 0xefcdab89;\n  ctx.C = 0x98badcfe;\n  ctx.D = 0x10325476;\n  ctx.E = 0xc3d2e1f0;\n  ctx.total[0] = 0;\n  ctx.total[1] = 0;\n  ctx.buflen = 0;\n  do {\n    len = 0;\n    while( true ) {\n      sVar2 = fread(buffer + len,1,0x1000 - len,(FILE *)stream);\n      len = len + sVar2;\n      if (len == 0x1000) break;\n      if (sVar2 == 0) {\n        iVar1 = ferror((FILE *)stream);\n        if (iVar1 != 0) {\n          return 1;\n        }\n        goto LAB_002d5340;\n      }\n      iVar1 = feof((FILE *)stream);\n      if (iVar1 != 0) {\nLAB_002d5340:\n        if (len != 0) {\n          sha1_process_bytes(buffer,len,&ctx);\n        }\n        sha1_finish_ctx(&ctx,resblock);\n        return 0;\n      }\n    }\n    sha1_process_block(buffer,0x1000,&ctx);\n  } while( true );\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "size_t sVar2;" primitive_type identifier ;) (declaration "size_t len;" primitive_type identifier ;) (declaration "sha1_ctx ctx;" type_identifier identifier ;) (declaration "char buffer [4168];" primitive_type (array_declarator "buffer [4168]" identifier [ number_literal ]) ;) (expression_statement "ctx.A = 0x67452301;" (assignment_expression "ctx.A = 0x67452301" (field_expression "ctx.A" identifier . field_identifier) = number_literal) ;) (expression_statement "ctx.B = 0xefcdab89;" (assignment_expression "ctx.B = 0xefcdab89" (field_expression "ctx.B" identifier . field_identifier) = number_literal) ;) (expression_statement "ctx.C = 0x98badcfe;" (assignment_expression "ctx.C = 0x98badcfe" (field_expression "ctx.C" identifier . field_identifier) = number_literal) ;) (expression_statement "ctx.D = 0x10325476;" (assignment_expression "ctx.D = 0x10325476" (field_expression "ctx.D" identifier . field_identifier) = number_literal) ;) (expression_statement "ctx.E = 0xc3d2e1f0;" (assignment_expression "ctx.E = 0xc3d2e1f0" (field_expression "ctx.E" identifier . field_identifier) = number_literal) ;) (expression_statement "ctx.total[0] = 0;" (assignment_expression "ctx.total[0] = 0" (subscript_expression "ctx.total[0]" (field_expression "ctx.total" identifier . field_identifier) [ number_literal ]) = number_literal) ;) (expression_statement "ctx.total[1] = 0;" (assignment_expression "ctx.total[1] = 0" (subscript_expression "ctx.total[1]" (field_expression "ctx.total" identifier . field_identifier) [ number_literal ]) = number_literal) ;) (expression_statement "ctx.buflen = 0;" (assignment_expression "ctx.buflen = 0" (field_expression "ctx.buflen" identifier . field_identifier) = number_literal) ;) (do_statement "do {\n    len = 0;\n    while( true ) {\n      sVar2 = fread(buffer + len,1,0x1000 - len,(FILE *)stream);\n      len = len + sVar2;\n      if (len == 0x1000) break;\n      if (sVar2 == 0) {\n        iVar1 = ferror((FILE *)stream);\n        if (iVar1 != 0) {\n          return 1;\n        }\n        goto LAB_002d5340;\n      }\n      iVar1 = feof((FILE *)stream);\n      if (iVar1 != 0) {\nLAB_002d5340:\n        if (len != 0) {\n          sha1_process_bytes(buffer,len,&ctx);\n        }\n        sha1_finish_ctx(&ctx,resblock);\n        return 0;\n      }\n    }\n    sha1_process_block(buffer,0x1000,&ctx);\n  } while( true );" do (compound_statement "{\n    len = 0;\n    while( true ) {\n      sVar2 = fread(buffer + len,1,0x1000 - len,(FILE *)stream);\n      len = len + sVar2;\n      if (len == 0x1000) break;\n      if (sVar2 == 0) {\n        iVar1 = ferror((FILE *)stream);\n        if (iVar1 != 0) {\n          return 1;\n        }\n        goto LAB_002d5340;\n      }\n      iVar1 = feof((FILE *)stream);\n      if (iVar1 != 0) {\nLAB_002d5340:\n        if (len != 0) {\n          sha1_process_bytes(buffer,len,&ctx);\n        }\n        sha1_finish_ctx(&ctx,resblock);\n        return 0;\n      }\n    }\n    sha1_process_block(buffer,0x1000,&ctx);\n  }" { (expression_statement "len = 0;" (assignment_expression "len = 0" identifier = number_literal) ;) (while_statement "while( true ) {\n      sVar2 = fread(buffer + len,1,0x1000 - len,(FILE *)stream);\n      len = len + sVar2;\n      if (len == 0x1000) break;\n      if (sVar2 == 0) {\n        iVar1 = ferror((FILE *)stream);\n        if (iVar1 != 0) {\n          return 1;\n        }\n        goto LAB_002d5340;\n      }\n      iVar1 = feof((FILE *)stream);\n      if (iVar1 != 0) {\nLAB_002d5340:\n        if (len != 0) {\n          sha1_process_bytes(buffer,len,&ctx);\n        }\n        sha1_finish_ctx(&ctx,resblock);\n        return 0;\n      }\n    }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n      sVar2 = fread(buffer + len,1,0x1000 - len,(FILE *)stream);\n      len = len + sVar2;\n      if (len == 0x1000) break;\n      if (sVar2 == 0) {\n        iVar1 = ferror((FILE *)stream);\n        if (iVar1 != 0) {\n          return 1;\n        }\n        goto LAB_002d5340;\n      }\n      iVar1 = feof((FILE *)stream);\n      if (iVar1 != 0) {\nLAB_002d5340:\n        if (len != 0) {\n          sha1_process_bytes(buffer,len,&ctx);\n        }\n        sha1_finish_ctx(&ctx,resblock);\n        return 0;\n      }\n    }" { (expression_statement "sVar2 = fread(buffer + len,1,0x1000 - len,(FILE *)stream);" (assignment_expression "sVar2 = fread(buffer + len,1,0x1000 - len,(FILE *)stream)" identifier = (call_expression "fread(buffer + len,1,0x1000 - len,(FILE *)stream)" identifier (argument_list "(buffer + len,1,0x1000 - len,(FILE *)stream)" ( (binary_expression "buffer + len" identifier + identifier) , number_literal , (binary_expression "0x1000 - 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 == 0x1000) break;" if (parenthesized_expression "(len == 0x1000)" ( (binary_expression "len == 0x1000" identifier == number_literal) )) (break_statement "break;" break ;)) (if_statement "if (sVar2 == 0) {\n        iVar1 = ferror((FILE *)stream);\n        if (iVar1 != 0) {\n          return 1;\n        }\n        goto LAB_002d5340;\n      }" if (parenthesized_expression "(sVar2 == 0)" ( (binary_expression "sVar2 == 0" identifier == number_literal) )) (compound_statement "{\n        iVar1 = ferror((FILE *)stream);\n        if (iVar1 != 0) {\n          return 1;\n        }\n        goto LAB_002d5340;\n      }" { (expression_statement "iVar1 = ferror((FILE *)stream);" (assignment_expression "iVar1 = ferror((FILE *)stream)" identifier = (call_expression "ferror((FILE *)stream)" identifier (argument_list "((FILE *)stream)" ( (cast_expression "(FILE *)stream" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier) )))) ;) (if_statement "if (iVar1 != 0) {\n          return 1;\n        }" if (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) (compound_statement "{\n          return 1;\n        }" { (return_statement "return 1;" return number_literal ;) })) (goto_statement "goto LAB_002d5340;" goto statement_identifier ;) })) (expression_statement "iVar1 = feof((FILE *)stream);" (assignment_expression "iVar1 = feof((FILE *)stream)" identifier = (call_expression "feof((FILE *)stream)" identifier (argument_list "((FILE *)stream)" ( (cast_expression "(FILE *)stream" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier) )))) ;) (if_statement "if (iVar1 != 0) {\nLAB_002d5340:\n        if (len != 0) {\n          sha1_process_bytes(buffer,len,&ctx);\n        }\n        sha1_finish_ctx(&ctx,resblock);\n        return 0;\n      }" if (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) (compound_statement "{\nLAB_002d5340:\n        if (len != 0) {\n          sha1_process_bytes(buffer,len,&ctx);\n        }\n        sha1_finish_ctx(&ctx,resblock);\n        return 0;\n      }" { (labeled_statement "LAB_002d5340:\n        if (len != 0) {\n          sha1_process_bytes(buffer,len,&ctx);\n        }" statement_identifier : (if_statement "if (len != 0) {\n          sha1_process_bytes(buffer,len,&ctx);\n        }" if (parenthesized_expression "(len != 0)" ( (binary_expression "len != 0" identifier != number_literal) )) (compound_statement "{\n          sha1_process_bytes(buffer,len,&ctx);\n        }" { (expression_statement "sha1_process_bytes(buffer,len,&ctx);" (call_expression "sha1_process_bytes(buffer,len,&ctx)" identifier (argument_list "(buffer,len,&ctx)" ( identifier , identifier , (pointer_expression "&ctx" & identifier) ))) ;) }))) (expression_statement "sha1_finish_ctx(&ctx,resblock);" (call_expression "sha1_finish_ctx(&ctx,resblock)" identifier (argument_list "(&ctx,resblock)" ( (pointer_expression "&ctx" & identifier) , identifier ))) ;) (return_statement "return 0;" return number_literal ;) })) })) (expression_statement "sha1_process_block(buffer,0x1000,&ctx);" (call_expression "sha1_process_block(buffer,0x1000,&ctx)" identifier (argument_list "(buffer,0x1000,&ctx)" ( identifier , number_literal , (pointer_expression "&ctx" & identifier) ))) ;) }) while (parenthesized_expression "( true )" ( true )) ;) })))
(translation_unit "undefined8 FUN_002d5280(FILE *param_1,undefined8 param_2)\n\n{\n  int iVar1;\n  size_t sVar2;\n  long lVar3;\n  undefined8 local_1128;\n  undefined8 local_1120;\n  undefined8 local_1118;\n  undefined8 local_1110;\n  undefined1 local_1088 [4184];\n  \n  local_1128 = 0xefcdab8967452301;\n  local_1120 = 0x1032547698badcfe;\n  local_1118 = 0xc3d2e1f0;\n  local_1110 = 0;\n  do {\n    lVar3 = 0;\n    while( true ) {\n      sVar2 = fread(local_1088 + lVar3,1,0x1000 - lVar3,param_1);\n      lVar3 = lVar3 + sVar2;\n      if (lVar3 == 0x1000) break;\n      if (sVar2 == 0) {\n        iVar1 = ferror(param_1);\n        if (iVar1 != 0) {\n          return 1;\n        }\n        goto LAB_002d5340;\n      }\n      iVar1 = feof(param_1);\n      if (iVar1 != 0) {\nLAB_002d5340:\n        if (lVar3 != 0) {\n          FUN_002d4f20(local_1088,lVar3,&local_1128);\n        }\n        FUN_002d4de0(&local_1128,param_2);\n        return 0;\n      }\n    }\n    FUN_002d3c40(local_1088,0x1000,&local_1128);\n  } while( true );\n}\n\n" (function_definition "undefined8 FUN_002d5280(FILE *param_1,undefined8 param_2)\n\n{\n  int iVar1;\n  size_t sVar2;\n  long lVar3;\n  undefined8 local_1128;\n  undefined8 local_1120;\n  undefined8 local_1118;\n  undefined8 local_1110;\n  undefined1 local_1088 [4184];\n  \n  local_1128 = 0xefcdab8967452301;\n  local_1120 = 0x1032547698badcfe;\n  local_1118 = 0xc3d2e1f0;\n  local_1110 = 0;\n  do {\n    lVar3 = 0;\n    while( true ) {\n      sVar2 = fread(local_1088 + lVar3,1,0x1000 - lVar3,param_1);\n      lVar3 = lVar3 + sVar2;\n      if (lVar3 == 0x1000) break;\n      if (sVar2 == 0) {\n        iVar1 = ferror(param_1);\n        if (iVar1 != 0) {\n          return 1;\n        }\n        goto LAB_002d5340;\n      }\n      iVar1 = feof(param_1);\n      if (iVar1 != 0) {\nLAB_002d5340:\n        if (lVar3 != 0) {\n          FUN_002d4f20(local_1088,lVar3,&local_1128);\n        }\n        FUN_002d4de0(&local_1128,param_2);\n        return 0;\n      }\n    }\n    FUN_002d3c40(local_1088,0x1000,&local_1128);\n  } while( true );\n}" type_identifier (function_declarator "FUN_002d5280(FILE *param_1,undefined8 param_2)" identifier (parameter_list "(FILE *param_1,undefined8 param_2)" ( (parameter_declaration "FILE *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "undefined8 param_2" type_identifier identifier) ))) (compound_statement "{\n  int iVar1;\n  size_t sVar2;\n  long lVar3;\n  undefined8 local_1128;\n  undefined8 local_1120;\n  undefined8 local_1118;\n  undefined8 local_1110;\n  undefined1 local_1088 [4184];\n  \n  local_1128 = 0xefcdab8967452301;\n  local_1120 = 0x1032547698badcfe;\n  local_1118 = 0xc3d2e1f0;\n  local_1110 = 0;\n  do {\n    lVar3 = 0;\n    while( true ) {\n      sVar2 = fread(local_1088 + lVar3,1,0x1000 - lVar3,param_1);\n      lVar3 = lVar3 + sVar2;\n      if (lVar3 == 0x1000) break;\n      if (sVar2 == 0) {\n        iVar1 = ferror(param_1);\n        if (iVar1 != 0) {\n          return 1;\n        }\n        goto LAB_002d5340;\n      }\n      iVar1 = feof(param_1);\n      if (iVar1 != 0) {\nLAB_002d5340:\n        if (lVar3 != 0) {\n          FUN_002d4f20(local_1088,lVar3,&local_1128);\n        }\n        FUN_002d4de0(&local_1128,param_2);\n        return 0;\n      }\n    }\n    FUN_002d3c40(local_1088,0x1000,&local_1128);\n  } while( true );\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "size_t sVar2;" primitive_type identifier ;) (declaration "long lVar3;" (sized_type_specifier "long" long) identifier ;) (declaration "undefined8 local_1128;" type_identifier identifier ;) (declaration "undefined8 local_1120;" type_identifier identifier ;) (declaration "undefined8 local_1118;" type_identifier identifier ;) (declaration "undefined8 local_1110;" type_identifier identifier ;) (declaration "undefined1 local_1088 [4184];" type_identifier (array_declarator "local_1088 [4184]" identifier [ number_literal ]) ;) (expression_statement "local_1128 = 0xefcdab8967452301;" (assignment_expression "local_1128 = 0xefcdab8967452301" identifier = number_literal) ;) (expression_statement "local_1120 = 0x1032547698badcfe;" (assignment_expression "local_1120 = 0x1032547698badcfe" identifier = number_literal) ;) (expression_statement "local_1118 = 0xc3d2e1f0;" (assignment_expression "local_1118 = 0xc3d2e1f0" identifier = number_literal) ;) (expression_statement "local_1110 = 0;" (assignment_expression "local_1110 = 0" identifier = number_literal) ;) (do_statement "do {\n    lVar3 = 0;\n    while( true ) {\n      sVar2 = fread(local_1088 + lVar3,1,0x1000 - lVar3,param_1);\n      lVar3 = lVar3 + sVar2;\n      if (lVar3 == 0x1000) break;\n      if (sVar2 == 0) {\n        iVar1 = ferror(param_1);\n        if (iVar1 != 0) {\n          return 1;\n        }\n        goto LAB_002d5340;\n      }\n      iVar1 = feof(param_1);\n      if (iVar1 != 0) {\nLAB_002d5340:\n        if (lVar3 != 0) {\n          FUN_002d4f20(local_1088,lVar3,&local_1128);\n        }\n        FUN_002d4de0(&local_1128,param_2);\n        return 0;\n      }\n    }\n    FUN_002d3c40(local_1088,0x1000,&local_1128);\n  } while( true );" do (compound_statement "{\n    lVar3 = 0;\n    while( true ) {\n      sVar2 = fread(local_1088 + lVar3,1,0x1000 - lVar3,param_1);\n      lVar3 = lVar3 + sVar2;\n      if (lVar3 == 0x1000) break;\n      if (sVar2 == 0) {\n        iVar1 = ferror(param_1);\n        if (iVar1 != 0) {\n          return 1;\n        }\n        goto LAB_002d5340;\n      }\n      iVar1 = feof(param_1);\n      if (iVar1 != 0) {\nLAB_002d5340:\n        if (lVar3 != 0) {\n          FUN_002d4f20(local_1088,lVar3,&local_1128);\n        }\n        FUN_002d4de0(&local_1128,param_2);\n        return 0;\n      }\n    }\n    FUN_002d3c40(local_1088,0x1000,&local_1128);\n  }" { (expression_statement "lVar3 = 0;" (assignment_expression "lVar3 = 0" identifier = number_literal) ;) (while_statement "while( true ) {\n      sVar2 = fread(local_1088 + lVar3,1,0x1000 - lVar3,param_1);\n      lVar3 = lVar3 + sVar2;\n      if (lVar3 == 0x1000) break;\n      if (sVar2 == 0) {\n        iVar1 = ferror(param_1);\n        if (iVar1 != 0) {\n          return 1;\n        }\n        goto LAB_002d5340;\n      }\n      iVar1 = feof(param_1);\n      if (iVar1 != 0) {\nLAB_002d5340:\n        if (lVar3 != 0) {\n          FUN_002d4f20(local_1088,lVar3,&local_1128);\n        }\n        FUN_002d4de0(&local_1128,param_2);\n        return 0;\n      }\n    }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n      sVar2 = fread(local_1088 + lVar3,1,0x1000 - lVar3,param_1);\n      lVar3 = lVar3 + sVar2;\n      if (lVar3 == 0x1000) break;\n      if (sVar2 == 0) {\n        iVar1 = ferror(param_1);\n        if (iVar1 != 0) {\n          return 1;\n        }\n        goto LAB_002d5340;\n      }\n      iVar1 = feof(param_1);\n      if (iVar1 != 0) {\nLAB_002d5340:\n        if (lVar3 != 0) {\n          FUN_002d4f20(local_1088,lVar3,&local_1128);\n        }\n        FUN_002d4de0(&local_1128,param_2);\n        return 0;\n      }\n    }" { (expression_statement "sVar2 = fread(local_1088 + lVar3,1,0x1000 - lVar3,param_1);" (assignment_expression "sVar2 = fread(local_1088 + lVar3,1,0x1000 - lVar3,param_1)" identifier = (call_expression "fread(local_1088 + lVar3,1,0x1000 - lVar3,param_1)" identifier (argument_list "(local_1088 + lVar3,1,0x1000 - lVar3,param_1)" ( (binary_expression "local_1088 + lVar3" identifier + identifier) , number_literal , (binary_expression "0x1000 - lVar3" number_literal - identifier) , identifier )))) ;) (expression_statement "lVar3 = lVar3 + sVar2;" (assignment_expression "lVar3 = lVar3 + sVar2" identifier = (binary_expression "lVar3 + sVar2" identifier + identifier)) ;) (if_statement "if (lVar3 == 0x1000) break;" if (parenthesized_expression "(lVar3 == 0x1000)" ( (binary_expression "lVar3 == 0x1000" identifier == number_literal) )) (break_statement "break;" break ;)) (if_statement "if (sVar2 == 0) {\n        iVar1 = ferror(param_1);\n        if (iVar1 != 0) {\n          return 1;\n        }\n        goto LAB_002d5340;\n      }" if (parenthesized_expression "(sVar2 == 0)" ( (binary_expression "sVar2 == 0" identifier == number_literal) )) (compound_statement "{\n        iVar1 = ferror(param_1);\n        if (iVar1 != 0) {\n          return 1;\n        }\n        goto LAB_002d5340;\n      }" { (expression_statement "iVar1 = ferror(param_1);" (assignment_expression "iVar1 = ferror(param_1)" identifier = (call_expression "ferror(param_1)" identifier (argument_list "(param_1)" ( identifier )))) ;) (if_statement "if (iVar1 != 0) {\n          return 1;\n        }" if (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) (compound_statement "{\n          return 1;\n        }" { (return_statement "return 1;" return number_literal ;) })) (goto_statement "goto LAB_002d5340;" goto statement_identifier ;) })) (expression_statement "iVar1 = feof(param_1);" (assignment_expression "iVar1 = feof(param_1)" identifier = (call_expression "feof(param_1)" identifier (argument_list "(param_1)" ( identifier )))) ;) (if_statement "if (iVar1 != 0) {\nLAB_002d5340:\n        if (lVar3 != 0) {\n          FUN_002d4f20(local_1088,lVar3,&local_1128);\n        }\n        FUN_002d4de0(&local_1128,param_2);\n        return 0;\n      }" if (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) (compound_statement "{\nLAB_002d5340:\n        if (lVar3 != 0) {\n          FUN_002d4f20(local_1088,lVar3,&local_1128);\n        }\n        FUN_002d4de0(&local_1128,param_2);\n        return 0;\n      }" { (labeled_statement "LAB_002d5340:\n        if (lVar3 != 0) {\n          FUN_002d4f20(local_1088,lVar3,&local_1128);\n        }" statement_identifier : (if_statement "if (lVar3 != 0) {\n          FUN_002d4f20(local_1088,lVar3,&local_1128);\n        }" if (parenthesized_expression "(lVar3 != 0)" ( (binary_expression "lVar3 != 0" identifier != number_literal) )) (compound_statement "{\n          FUN_002d4f20(local_1088,lVar3,&local_1128);\n        }" { (expression_statement "FUN_002d4f20(local_1088,lVar3,&local_1128);" (call_expression "FUN_002d4f20(local_1088,lVar3,&local_1128)" identifier (argument_list "(local_1088,lVar3,&local_1128)" ( identifier , identifier , (pointer_expression "&local_1128" & identifier) ))) ;) }))) (expression_statement "FUN_002d4de0(&local_1128,param_2);" (call_expression "FUN_002d4de0(&local_1128,param_2)" identifier (argument_list "(&local_1128,param_2)" ( (pointer_expression "&local_1128" & identifier) , identifier ))) ;) (return_statement "return 0;" return number_literal ;) })) })) (expression_statement "FUN_002d3c40(local_1088,0x1000,&local_1128);" (call_expression "FUN_002d3c40(local_1088,0x1000,&local_1128)" identifier (argument_list "(local_1088,0x1000,&local_1128)" ( identifier , number_literal , (pointer_expression "&local_1128" & identifier) ))) ;) }) while (parenthesized_expression "( true )" ( true )) ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration (sized_type_specifier long) IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (array_declarator IDENT [ LIT ]) ;) (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = LIT) ;) (do_statement do (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) (while_statement while (parenthesized_expression ( BOOL )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (binary_expression 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 ;)) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (return_statement return LIT ;) })) (goto_statement goto statement_identifier ;) })) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != 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 , (pointer_expression & IDENT) ))) ;) }))) (expression_statement (call_expression IDENT (argument_list ( (pointer_expression & IDENT) , IDENT ))) ;) (return_statement return LIT ;) })) })) (expression_statement (call_expression IDENT (argument_list ( IDENT , LIT , (pointer_expression & IDENT) ))) ;) }) while (parenthesized_expression ( BOOL )) ;) })))
(function_definition "undefined8 FUN_002d5280(FILE *param_1,undefined8 param_2)\n\n{\n  int iVar1;\n  size_t sVar2;\n  long lVar3;\n  undefined8 local_1128;\n  undefined8 local_1120;\n  undefined8 local_1118;\n  undefined8 local_1110;\n  undefined1 local_1088 [4184];\n  \n  local_1128 = 0xefcdab8967452301;\n  local_1120 = 0x1032547698badcfe;\n  local_1118 = 0xc3d2e1f0;\n  local_1110 = 0;\n  do {\n    lVar3 = 0;\n    while( true ) {\n      sVar2 = fread(local_1088 + lVar3,1,0x1000 - lVar3,param_1);\n      lVar3 = lVar3 + sVar2;\n      if (lVar3 == 0x1000) break;\n      if (sVar2 == 0) {\n        iVar1 = ferror(param_1);\n        if (iVar1 != 0) {\n          return 1;\n        }\n        goto LAB_002d5340;\n      }\n      iVar1 = feof(param_1);\n      if (iVar1 != 0) {\nLAB_002d5340:\n        if (lVar3 != 0) {\n          FUN_002d4f20(local_1088,lVar3,&local_1128);\n        }\n        FUN_002d4de0(&local_1128,param_2);\n        return 0;\n      }\n    }\n    FUN_002d3c40(local_1088,0x1000,&local_1128);\n  } while( true );\n}" (type_identifier "undefined8") (function_declarator "FUN_002d5280(FILE *param_1,undefined8 param_2)" (identifier "FUN_002d5280") (parameter_list "(FILE *param_1,undefined8 param_2)" (( "(") (parameter_declaration "FILE *param_1" (type_identifier "FILE") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "undefined8 param_2" (type_identifier "undefined8") (identifier "param_2")) () ")"))) (compound_statement "{\n  int iVar1;\n  size_t sVar2;\n  long lVar3;\n  undefined8 local_1128;\n  undefined8 local_1120;\n  undefined8 local_1118;\n  undefined8 local_1110;\n  undefined1 local_1088 [4184];\n  \n  local_1128 = 0xefcdab8967452301;\n  local_1120 = 0x1032547698badcfe;\n  local_1118 = 0xc3d2e1f0;\n  local_1110 = 0;\n  do {\n    lVar3 = 0;\n    while( true ) {\n      sVar2 = fread(local_1088 + lVar3,1,0x1000 - lVar3,param_1);\n      lVar3 = lVar3 + sVar2;\n      if (lVar3 == 0x1000) break;\n      if (sVar2 == 0) {\n        iVar1 = ferror(param_1);\n        if (iVar1 != 0) {\n          return 1;\n        }\n        goto LAB_002d5340;\n      }\n      iVar1 = feof(param_1);\n      if (iVar1 != 0) {\nLAB_002d5340:\n        if (lVar3 != 0) {\n          FUN_002d4f20(local_1088,lVar3,&local_1128);\n        }\n        FUN_002d4de0(&local_1128,param_2);\n        return 0;\n      }\n    }\n    FUN_002d3c40(local_1088,0x1000,&local_1128);\n  } while( true );\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "size_t sVar2;" (primitive_type "size_t") (identifier "sVar2") (; ";")) (declaration "long lVar3;" (sized_type_specifier "long" (long "long")) (identifier "lVar3") (; ";")) (declaration "undefined8 local_1128;" (type_identifier "undefined8") (identifier "local_1128") (; ";")) (declaration "undefined8 local_1120;" (type_identifier "undefined8") (identifier "local_1120") (; ";")) (declaration "undefined8 local_1118;" (type_identifier "undefined8") (identifier "local_1118") (; ";")) (declaration "undefined8 local_1110;" (type_identifier "undefined8") (identifier "local_1110") (; ";")) (declaration "undefined1 local_1088 [4184];" (type_identifier "undefined1") (array_declarator "local_1088 [4184]" (identifier "local_1088") ([ "[") (number_literal "4184") (] "]")) (; ";")) (expression_statement "local_1128 = 0xefcdab8967452301;" (assignment_expression "local_1128 = 0xefcdab8967452301" (identifier "local_1128") (= "=") (number_literal "0xefcdab8967452301")) (; ";")) (expression_statement "local_1120 = 0x1032547698badcfe;" (assignment_expression "local_1120 = 0x1032547698badcfe" (identifier "local_1120") (= "=") (number_literal "0x1032547698badcfe")) (; ";")) (expression_statement "local_1118 = 0xc3d2e1f0;" (assignment_expression "local_1118 = 0xc3d2e1f0" (identifier "local_1118") (= "=") (number_literal "0xc3d2e1f0")) (; ";")) (expression_statement "local_1110 = 0;" (assignment_expression "local_1110 = 0" (identifier "local_1110") (= "=") (number_literal "0")) (; ";")) (do_statement "do {\n    lVar3 = 0;\n    while( true ) {\n      sVar2 = fread(local_1088 + lVar3,1,0x1000 - lVar3,param_1);\n      lVar3 = lVar3 + sVar2;\n      if (lVar3 == 0x1000) break;\n      if (sVar2 == 0) {\n        iVar1 = ferror(param_1);\n        if (iVar1 != 0) {\n          return 1;\n        }\n        goto LAB_002d5340;\n      }\n      iVar1 = feof(param_1);\n      if (iVar1 != 0) {\nLAB_002d5340:\n        if (lVar3 != 0) {\n          FUN_002d4f20(local_1088,lVar3,&local_1128);\n        }\n        FUN_002d4de0(&local_1128,param_2);\n        return 0;\n      }\n    }\n    FUN_002d3c40(local_1088,0x1000,&local_1128);\n  } while( true );" (do "do") (compound_statement "{\n    lVar3 = 0;\n    while( true ) {\n      sVar2 = fread(local_1088 + lVar3,1,0x1000 - lVar3,param_1);\n      lVar3 = lVar3 + sVar2;\n      if (lVar3 == 0x1000) break;\n      if (sVar2 == 0) {\n        iVar1 = ferror(param_1);\n        if (iVar1 != 0) {\n          return 1;\n        }\n        goto LAB_002d5340;\n      }\n      iVar1 = feof(param_1);\n      if (iVar1 != 0) {\nLAB_002d5340:\n        if (lVar3 != 0) {\n          FUN_002d4f20(local_1088,lVar3,&local_1128);\n        }\n        FUN_002d4de0(&local_1128,param_2);\n        return 0;\n      }\n    }\n    FUN_002d3c40(local_1088,0x1000,&local_1128);\n  }" ({ "{") (expression_statement "lVar3 = 0;" (assignment_expression "lVar3 = 0" (identifier "lVar3") (= "=") (number_literal "0")) (; ";")) (while_statement "while( true ) {\n      sVar2 = fread(local_1088 + lVar3,1,0x1000 - lVar3,param_1);\n      lVar3 = lVar3 + sVar2;\n      if (lVar3 == 0x1000) break;\n      if (sVar2 == 0) {\n        iVar1 = ferror(param_1);\n        if (iVar1 != 0) {\n          return 1;\n        }\n        goto LAB_002d5340;\n      }\n      iVar1 = feof(param_1);\n      if (iVar1 != 0) {\nLAB_002d5340:\n        if (lVar3 != 0) {\n          FUN_002d4f20(local_1088,lVar3,&local_1128);\n        }\n        FUN_002d4de0(&local_1128,param_2);\n        return 0;\n      }\n    }" (while "while") (parenthesized_expression "( true )" (( "(") (true "true") () ")")) (compound_statement "{\n      sVar2 = fread(local_1088 + lVar3,1,0x1000 - lVar3,param_1);\n      lVar3 = lVar3 + sVar2;\n      if (lVar3 == 0x1000) break;\n      if (sVar2 == 0) {\n        iVar1 = ferror(param_1);\n        if (iVar1 != 0) {\n          return 1;\n        }\n        goto LAB_002d5340;\n      }\n      iVar1 = feof(param_1);\n      if (iVar1 != 0) {\nLAB_002d5340:\n        if (lVar3 != 0) {\n          FUN_002d4f20(local_1088,lVar3,&local_1128);\n        }\n        FUN_002d4de0(&local_1128,param_2);\n        return 0;\n      }\n    }" ({ "{") (expression_statement "sVar2 = fread(local_1088 + lVar3,1,0x1000 - lVar3,param_1);" (assignment_expression "sVar2 = fread(local_1088 + lVar3,1,0x1000 - lVar3,param_1)" (identifier "sVar2") (= "=") (call_expression "fread(local_1088 + lVar3,1,0x1000 - lVar3,param_1)" (identifier "fread") (argument_list "(local_1088 + lVar3,1,0x1000 - lVar3,param_1)" (( "(") (binary_expression "local_1088 + lVar3" (identifier "local_1088") (+ "+") (identifier "lVar3")) (, ",") (number_literal "1") (, ",") (binary_expression "0x1000 - lVar3" (number_literal "0x1000") (- "-") (identifier "lVar3")) (, ",") (identifier "param_1") () ")")))) (; ";")) (expression_statement "lVar3 = lVar3 + sVar2;" (assignment_expression "lVar3 = lVar3 + sVar2" (identifier "lVar3") (= "=") (binary_expression "lVar3 + sVar2" (identifier "lVar3") (+ "+") (identifier "sVar2"))) (; ";")) (if_statement "if (lVar3 == 0x1000) break;" (if "if") (parenthesized_expression "(lVar3 == 0x1000)" (( "(") (binary_expression "lVar3 == 0x1000" (identifier "lVar3") (== "==") (number_literal "0x1000")) () ")")) (break_statement "break;" (break "break") (; ";"))) (if_statement "if (sVar2 == 0) {\n        iVar1 = ferror(param_1);\n        if (iVar1 != 0) {\n          return 1;\n        }\n        goto LAB_002d5340;\n      }" (if "if") (parenthesized_expression "(sVar2 == 0)" (( "(") (binary_expression "sVar2 == 0" (identifier "sVar2") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n        iVar1 = ferror(param_1);\n        if (iVar1 != 0) {\n          return 1;\n        }\n        goto LAB_002d5340;\n      }" ({ "{") (expression_statement "iVar1 = ferror(param_1);" (assignment_expression "iVar1 = ferror(param_1)" (identifier "iVar1") (= "=") (call_expression "ferror(param_1)" (identifier "ferror") (argument_list "(param_1)" (( "(") (identifier "param_1") () ")")))) (; ";")) (if_statement "if (iVar1 != 0) {\n          return 1;\n        }" (if "if") (parenthesized_expression "(iVar1 != 0)" (( "(") (binary_expression "iVar1 != 0" (identifier "iVar1") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n          return 1;\n        }" ({ "{") (return_statement "return 1;" (return "return") (number_literal "1") (; ";")) (} "}"))) (goto_statement "goto LAB_002d5340;" (goto "goto") (statement_identifier "LAB_002d5340") (; ";")) (} "}"))) (expression_statement "iVar1 = feof(param_1);" (assignment_expression "iVar1 = feof(param_1)" (identifier "iVar1") (= "=") (call_expression "feof(param_1)" (identifier "feof") (argument_list "(param_1)" (( "(") (identifier "param_1") () ")")))) (; ";")) (if_statement "if (iVar1 != 0) {\nLAB_002d5340:\n        if (lVar3 != 0) {\n          FUN_002d4f20(local_1088,lVar3,&local_1128);\n        }\n        FUN_002d4de0(&local_1128,param_2);\n        return 0;\n      }" (if "if") (parenthesized_expression "(iVar1 != 0)" (( "(") (binary_expression "iVar1 != 0" (identifier "iVar1") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\nLAB_002d5340:\n        if (lVar3 != 0) {\n          FUN_002d4f20(local_1088,lVar3,&local_1128);\n        }\n        FUN_002d4de0(&local_1128,param_2);\n        return 0;\n      }" ({ "{") (labeled_statement "LAB_002d5340:\n        if (lVar3 != 0) {\n          FUN_002d4f20(local_1088,lVar3,&local_1128);\n        }" (statement_identifier "LAB_002d5340") (: ":") (if_statement "if (lVar3 != 0) {\n          FUN_002d4f20(local_1088,lVar3,&local_1128);\n        }" (if "if") (parenthesized_expression "(lVar3 != 0)" (( "(") (binary_expression "lVar3 != 0" (identifier "lVar3") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n          FUN_002d4f20(local_1088,lVar3,&local_1128);\n        }" ({ "{") (expression_statement "FUN_002d4f20(local_1088,lVar3,&local_1128);" (call_expression "FUN_002d4f20(local_1088,lVar3,&local_1128)" (identifier "FUN_002d4f20") (argument_list "(local_1088,lVar3,&local_1128)" (( "(") (identifier "local_1088") (, ",") (identifier "lVar3") (, ",") (pointer_expression "&local_1128" (& "&") (identifier "local_1128")) () ")"))) (; ";")) (} "}")))) (expression_statement "FUN_002d4de0(&local_1128,param_2);" (call_expression "FUN_002d4de0(&local_1128,param_2)" (identifier "FUN_002d4de0") (argument_list "(&local_1128,param_2)" (( "(") (pointer_expression "&local_1128" (& "&") (identifier "local_1128")) (, ",") (identifier "param_2") () ")"))) (; ";")) (return_statement "return 0;" (return "return") (number_literal "0") (; ";")) (} "}"))) (} "}"))) (expression_statement "FUN_002d3c40(local_1088,0x1000,&local_1128);" (call_expression "FUN_002d3c40(local_1088,0x1000,&local_1128)" (identifier "FUN_002d3c40") (argument_list "(local_1088,0x1000,&local_1128)" (( "(") (identifier "local_1088") (, ",") (number_literal "0x1000") (, ",") (pointer_expression "&local_1128" (& "&") (identifier "local_1128")) () ")"))) (; ";")) (} "}")) (while "while") (parenthesized_expression "( true )" (( "(") (true "true") () ")")) (; ";")) (} "}")))

int function_1(type_1 *stream,void *resblock)

{
  int var_6;
  size_t var_4;
  size_t var_3;
  type_2 ctx;
  char var_2 [4168];
  
  ctx.A = 0x67452301;
  ctx.B = 0xefcdab89;
  ctx.C = 0x98badcfe;
  ctx.D = 0x10325476;
  ctx.E = 0xc3d2e1f0;
  ctx.total[0] = 0;
  ctx.total[1] = 0;
  ctx.buflen = 0;
  do {
    var_3 = 0;
    while( true ) {
      var_4 = var_1(var_2 + var_3,1,0x1000 - var_3,(type_1 *)stream);
      var_3 = var_3 + var_4;
      if (var_3 == 0x1000) break;
      if (var_4 == 0) {
        var_6 = var_5((type_1 *)stream);
        if (var_6 != 0) {
          return 1;
        }
        goto LAB_002d5340;
      }
      var_6 = var_7((type_1 *)stream);
      if (var_6 != 0) {
LAB_002d5340:
        if (var_3 != 0) {
          var_8(var_2,var_3,&ctx);
        }
        var_9(&ctx,resblock);
        return 0;
      }
    }
    var_10(var_2,0x1000,&ctx);
  } while( true );
}


(translation_unit (function_definition type: (type_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)))) body: (compound_statement (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (sized_type_specifier) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (type_identifier) declarator: (array_declarator declarator: (identifier) size: (number_literal))) (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (do_statement body: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (while_statement condition: (parenthesized_expression (true)) body: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (binary_expression left: (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)) (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))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (return_statement (number_literal)))) (goto_statement label: (statement_identifier)))) (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 (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) (pointer_expression argument: (identifier)))))))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (pointer_expression argument: (identifier)) (identifier)))) (return_statement (number_literal)))))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier) (number_literal) (pointer_expression argument: (identifier)))))) condition: (parenthesized_expression (true))))))

undefined8 MASKED(FILE *param_1,undefined8 param_2)

{
  int iVar1;
  size_t sVar2;
  long lVar3;
  undefined8 local_1128;
  undefined8 local_1120;
  undefined8 local_1118;
  undefined8 local_1110;
  undefined1 local_1088 [4184];
  
  local_1128 = 0xefcdab8967452301;
  local_1120 = 0x1032547698badcfe;
  local_1118 = 0xc3d2e1f0;
  local_1110 = 0;
  do {
    lVar3 = 0;
    while( true ) {
      sVar2 = fread(local_1088 + lVar3,1,0x1000 - lVar3,param_1);
      lVar3 = lVar3 + sVar2;
      if (lVar3 == 0x1000) break;
      if (sVar2 == 0) {
        iVar1 = ferror(param_1);
        if (iVar1 != 0) {
          return 1;
        }
        goto LAB_002d5340;
      }
      iVar1 = feof(param_1);
      if (iVar1 != 0) {
LAB_002d5340:
        if (lVar3 != 0) {
          FUN_002d4f20(local_1088,lVar3,&local_1128);
        }
        FUN_002d4de0(&local_1128,param_2);
        return 0;
      }
    }
    FUN_002d3c40(local_1088,0x1000,&local_1128);
  } while( true );
}

