
int 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)

{
  FILE *stream_00;
  void *buffer;
  int iVar1;
  size_t len;
  undefined *puVar2;
  sha256_ctx ctx;
  
  stream_00 = *(FILE **)PTR___stack_chk_guard_0002f2f0;
  buffer = (void *)(*(code *)PTR_malloc_0002f2ac)(0x8048);
  if (buffer == (void *)0x0) {
    iVar1 = 1;
  }
  else {
    (*init_ctx)(&ctx);
    len = 0;
    do {
      while( true ) {
        if ((stream->_flags & 0x10U) != 0) goto LAB_00017264;
        alg = (char *)0x1;
        iVar1 = (*(code *)PTR_fread_unlocked_0002f22c)((int)buffer + len,1,0x8000 - len,stream);
        len = len + iVar1;
        if (len != 0x8000) break;
        sha256_process_block(buffer,0x8000,&ctx);
        len = 0;
      }
    } while (iVar1 != 0);
    if ((stream->_flags & 0x20U) == 0) {
LAB_00017264:
      if (len != 0) {
        sha256_process_bytes(buffer,len,&ctx);
      }
      (*finish_ctx)(&ctx,resblock);
      (*(code *)PTR_free_0002f2f8)(buffer);
      iVar1 = 0;
      alg = (char *)resblock;
    }
    else {
      (*(code *)PTR_free_0002f2f8)(buffer);
      iVar1 = 1;
    }
  }
  if (stream_00 != *(FILE **)PTR___stack_chk_guard_0002f2f0) {
    puVar2 = PTR___stack_chk_fail_0002f2dc;
    (*(code *)PTR___stack_chk_fail_0002f2dc)();
    iVar1 = shaxxx_stream(stream_00,(char *)(*(int *)(puVar2 + 0x17dc8) + -0x2794),alg,0x20,
                          *(_func_void_sha256_ctx_ptr **)(puVar2 + 0x17e20),
                          *(_func_void_ptr_sha256_ctx_ptr_void_ptr **)(puVar2 + 0x17e28));
    return iVar1;
  }
  return iVar1;
}



undefined4
FUN_00017188(uint *param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4,code *param_5,
            code *param_6)

{
  int iVar1;
  int iVar2;
  undefined4 uVar3;
  int iVar4;
  undefined1 auStack_d0 [172];
  int local_24;
  
  local_24 = *(int *)PTR___stack_chk_guard_0002f2f0;
  iVar1 = (*(code *)PTR_malloc_0002f2ac)(0x8048);
  if (iVar1 == 0) {
    uVar3 = 1;
  }
  else {
    (*param_5)(auStack_d0);
    iVar4 = 0;
    do {
      while( true ) {
        if ((*param_1 & 0x10) != 0) goto LAB_00017264;
        iVar2 = (*(code *)PTR_fread_unlocked_0002f22c)(iVar1 + iVar4,1,0x8000 - iVar4,param_1);
        iVar4 = iVar4 + iVar2;
        if (iVar4 != 0x8000) break;
        sha256_process_block(iVar1,0x8000,auStack_d0);
        iVar4 = 0;
      }
    } while (iVar2 != 0);
    if ((*param_1 & 0x20) == 0) {
LAB_00017264:
      if (iVar4 != 0) {
        sha256_process_bytes(iVar1,iVar4,auStack_d0);
      }
      (*param_6)(auStack_d0,param_3);
      (*(code *)PTR_free_0002f2f8)(iVar1);
      uVar3 = 0;
    }
    else {
      (*(code *)PTR_free_0002f2f8)(iVar1);
      uVar3 = 1;
    }
  }
  if (local_24 != *(int *)PTR___stack_chk_guard_0002f2f0) {
    (*(code *)PTR___stack_chk_fail_0002f2dc)();
    uVar3 = FUN_00017188();
    return uVar3;
  }
  return uVar3;
}


lui gp,0x2
addiu gp,gp,-0xb8
addu gp,gp,t9
addiu sp,sp,-0xe8
sw ra,0xe4(sp)
sw s6,0xe0(sp)
sw s5,0xdc(sp)
sw s4,0xd8(sp)
sw s3,0xd4(sp)
sw s2,0xd0(sp)
sw s1,0xcc(sp)
sw s0,0xc8(sp)
sw gp,0x10(sp)
or s1,a0,zero
or s5,a2,zero
lw s0,0xf8(sp)
lw s4,0xfc(sp)
lw v0,-0x7de0(gp)
lw v0,0x0(v0)
sw v0,0xc4(sp)
ori a0,zero,0x8048
lw t9,-0x7e24(gp)
jalr t9
_nop
lw gp,0x10(sp)
beq v0,zero,0x0001732c
_or s3,v0,zero
addiu a0,sp,0x18
or t9,s0,zero
jalr t9
_nop
lw gp,0x10(sp)
ori s2,zero,0x8000
addiu s6,sp,0x18
or s0,zero,zero
lw v0,0x0(s1)
andi v0,v0,0x10
bne v0,zero,0x00017264
_or a3,s1,zero
subu a2,s2,s0
li a1,0x1
addu a0,s3,s0
lw t9,-0x7ea4(gp)
jalr t9
_nop
lw gp,0x10(sp)
addu s0,s0,v0
beq s0,s2,0x000172ec
_or a2,s6,zero
bne v0,zero,0x00017214
_nop
lw v0,0x0(s1)
andi v0,v0,0x20
bne v0,zero,0x000172d4
_or a0,s3,zero
bne s0,zero,0x0001730c
_addiu a2,sp,0x18
or a1,s5,zero
addiu a0,sp,0x18
or t9,s4,zero
jalr t9
_nop
lw gp,0x10(sp)
or a0,s3,zero
lw t9,-0x7dd8(gp)
jalr t9
_nop
lw gp,0x10(sp)
or v0,zero,zero
lw a0,0xc4(sp)
lw v1,-0x7de0(gp)
lw v1,0x0(v1)
bne a0,v1,0x00017334
_lw ra,0xe4(sp)
lw s6,0xe0(sp)
lw s5,0xdc(sp)
lw s4,0xd8(sp)
lw s3,0xd4(sp)
lw s2,0xd0(sp)
lw s1,0xcc(sp)
lw s0,0xc8(sp)
jr ra
_addiu sp,sp,0xe8
lw t9,-0x7dd8(gp)
jalr t9
_nop
lw gp,0x10(sp)
b 0x0001729c
_li v0,0x1
or a1,s2,zero
or a0,s3,zero
lw t9,-0x7f7c(gp)
bal 0x00014400
_nop
lw gp,0x10(sp)
b 0x00017214
_or s0,zero,zero
or a1,s0,zero
or a0,s3,zero
lw t9,-0x7f6c(gp)
bal 0x00016d6c
_nop
lw gp,0x10(sp)
b 0x00017270
_or a1,s5,zero
b 0x0001729c
_li v0,0x1
lw t9,-0x7df4(gp)
jalr t9
_nop
(translation_unit "undefined4\nFUN_00017188(uint *param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4,code *param_5,\n            code *param_6)\n\n{\n  int iVar1;\n  int iVar2;\n  undefined4 uVar3;\n  int iVar4;\n  undefined1 auStack_d0 [172];\n  int local_24;\n  \n  local_24 = *(int *)PTR___stack_chk_guard_0002f2f0;\n  iVar1 = (*(code *)PTR_malloc_0002f2ac)(0x8048);\n  if (iVar1 == 0) {\n    uVar3 = 1;\n  }\n  else {\n    (*param_5)(auStack_d0);\n    iVar4 = 0;\n    do {\n      while( true ) {\n        if ((*param_1 & 0x10) != 0) goto LAB_00017264;\n        iVar2 = (*(code *)PTR_fread_unlocked_0002f22c)(iVar1 + iVar4,1,0x8000 - iVar4,param_1);\n        iVar4 = iVar4 + iVar2;\n        if (iVar4 != 0x8000) break;\n        sha256_process_block(iVar1,0x8000,auStack_d0);\n        iVar4 = 0;\n      }\n    } while (iVar2 != 0);\n    if ((*param_1 & 0x20) == 0) {\nLAB_00017264:\n      if (iVar4 != 0) {\n        sha256_process_bytes(iVar1,iVar4,auStack_d0);\n      }\n      (*param_6)(auStack_d0,param_3);\n      (*(code *)PTR_free_0002f2f8)(iVar1);\n      uVar3 = 0;\n    }\n    else {\n      (*(code *)PTR_free_0002f2f8)(iVar1);\n      uVar3 = 1;\n    }\n  }\n  if (local_24 != *(int *)PTR___stack_chk_guard_0002f2f0) {\n    (*(code *)PTR___stack_chk_fail_0002f2dc)();\n    uVar3 = FUN_00017188();\n    return uVar3;\n  }\n  return uVar3;\n}\n\n" (function_definition "undefined4\nFUN_00017188(uint *param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4,code *param_5,\n            code *param_6)\n\n{\n  int iVar1;\n  int iVar2;\n  undefined4 uVar3;\n  int iVar4;\n  undefined1 auStack_d0 [172];\n  int local_24;\n  \n  local_24 = *(int *)PTR___stack_chk_guard_0002f2f0;\n  iVar1 = (*(code *)PTR_malloc_0002f2ac)(0x8048);\n  if (iVar1 == 0) {\n    uVar3 = 1;\n  }\n  else {\n    (*param_5)(auStack_d0);\n    iVar4 = 0;\n    do {\n      while( true ) {\n        if ((*param_1 & 0x10) != 0) goto LAB_00017264;\n        iVar2 = (*(code *)PTR_fread_unlocked_0002f22c)(iVar1 + iVar4,1,0x8000 - iVar4,param_1);\n        iVar4 = iVar4 + iVar2;\n        if (iVar4 != 0x8000) break;\n        sha256_process_block(iVar1,0x8000,auStack_d0);\n        iVar4 = 0;\n      }\n    } while (iVar2 != 0);\n    if ((*param_1 & 0x20) == 0) {\nLAB_00017264:\n      if (iVar4 != 0) {\n        sha256_process_bytes(iVar1,iVar4,auStack_d0);\n      }\n      (*param_6)(auStack_d0,param_3);\n      (*(code *)PTR_free_0002f2f8)(iVar1);\n      uVar3 = 0;\n    }\n    else {\n      (*(code *)PTR_free_0002f2f8)(iVar1);\n      uVar3 = 1;\n    }\n  }\n  if (local_24 != *(int *)PTR___stack_chk_guard_0002f2f0) {\n    (*(code *)PTR___stack_chk_fail_0002f2dc)();\n    uVar3 = FUN_00017188();\n    return uVar3;\n  }\n  return uVar3;\n}" type_identifier (function_declarator "FUN_00017188(uint *param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4,code *param_5,\n            code *param_6)" identifier (parameter_list "(uint *param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4,code *param_5,\n            code *param_6)" ( (parameter_declaration "uint *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "undefined4 param_2" type_identifier identifier) , (parameter_declaration "undefined4 param_3" type_identifier identifier) , (parameter_declaration "undefined4 param_4" type_identifier identifier) , (parameter_declaration "code *param_5" type_identifier (pointer_declarator "*param_5" * identifier)) , (parameter_declaration "code *param_6" type_identifier (pointer_declarator "*param_6" * identifier)) ))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  undefined4 uVar3;\n  int iVar4;\n  undefined1 auStack_d0 [172];\n  int local_24;\n  \n  local_24 = *(int *)PTR___stack_chk_guard_0002f2f0;\n  iVar1 = (*(code *)PTR_malloc_0002f2ac)(0x8048);\n  if (iVar1 == 0) {\n    uVar3 = 1;\n  }\n  else {\n    (*param_5)(auStack_d0);\n    iVar4 = 0;\n    do {\n      while( true ) {\n        if ((*param_1 & 0x10) != 0) goto LAB_00017264;\n        iVar2 = (*(code *)PTR_fread_unlocked_0002f22c)(iVar1 + iVar4,1,0x8000 - iVar4,param_1);\n        iVar4 = iVar4 + iVar2;\n        if (iVar4 != 0x8000) break;\n        sha256_process_block(iVar1,0x8000,auStack_d0);\n        iVar4 = 0;\n      }\n    } while (iVar2 != 0);\n    if ((*param_1 & 0x20) == 0) {\nLAB_00017264:\n      if (iVar4 != 0) {\n        sha256_process_bytes(iVar1,iVar4,auStack_d0);\n      }\n      (*param_6)(auStack_d0,param_3);\n      (*(code *)PTR_free_0002f2f8)(iVar1);\n      uVar3 = 0;\n    }\n    else {\n      (*(code *)PTR_free_0002f2f8)(iVar1);\n      uVar3 = 1;\n    }\n  }\n  if (local_24 != *(int *)PTR___stack_chk_guard_0002f2f0) {\n    (*(code *)PTR___stack_chk_fail_0002f2dc)();\n    uVar3 = FUN_00017188();\n    return uVar3;\n  }\n  return uVar3;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "undefined4 uVar3;" type_identifier identifier ;) (declaration "int iVar4;" primitive_type identifier ;) (declaration "undefined1 auStack_d0 [172];" type_identifier (array_declarator "auStack_d0 [172]" identifier [ number_literal ]) ;) (declaration "int local_24;" primitive_type identifier ;) (expression_statement "local_24 = *(int *)PTR___stack_chk_guard_0002f2f0;" (assignment_expression "local_24 = *(int *)PTR___stack_chk_guard_0002f2f0" identifier = (pointer_expression "*(int *)PTR___stack_chk_guard_0002f2f0" * (cast_expression "(int *)PTR___stack_chk_guard_0002f2f0" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) ;) (expression_statement "iVar1 = (*(code *)PTR_malloc_0002f2ac)(0x8048);" (assignment_expression "iVar1 = (*(code *)PTR_malloc_0002f2ac)(0x8048)" identifier = (call_expression "(*(code *)PTR_malloc_0002f2ac)(0x8048)" (parenthesized_expression "(*(code *)PTR_malloc_0002f2ac)" ( (pointer_expression "*(code *)PTR_malloc_0002f2ac" * (cast_expression "(code *)PTR_malloc_0002f2ac" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(0x8048)" ( number_literal )))) ;) (if_statement "if (iVar1 == 0) {\n    uVar3 = 1;\n  }\n  else {\n    (*param_5)(auStack_d0);\n    iVar4 = 0;\n    do {\n      while( true ) {\n        if ((*param_1 & 0x10) != 0) goto LAB_00017264;\n        iVar2 = (*(code *)PTR_fread_unlocked_0002f22c)(iVar1 + iVar4,1,0x8000 - iVar4,param_1);\n        iVar4 = iVar4 + iVar2;\n        if (iVar4 != 0x8000) break;\n        sha256_process_block(iVar1,0x8000,auStack_d0);\n        iVar4 = 0;\n      }\n    } while (iVar2 != 0);\n    if ((*param_1 & 0x20) == 0) {\nLAB_00017264:\n      if (iVar4 != 0) {\n        sha256_process_bytes(iVar1,iVar4,auStack_d0);\n      }\n      (*param_6)(auStack_d0,param_3);\n      (*(code *)PTR_free_0002f2f8)(iVar1);\n      uVar3 = 0;\n    }\n    else {\n      (*(code *)PTR_free_0002f2f8)(iVar1);\n      uVar3 = 1;\n    }\n  }" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (compound_statement "{\n    uVar3 = 1;\n  }" { (expression_statement "uVar3 = 1;" (assignment_expression "uVar3 = 1" identifier = number_literal) ;) }) (else_clause "else {\n    (*param_5)(auStack_d0);\n    iVar4 = 0;\n    do {\n      while( true ) {\n        if ((*param_1 & 0x10) != 0) goto LAB_00017264;\n        iVar2 = (*(code *)PTR_fread_unlocked_0002f22c)(iVar1 + iVar4,1,0x8000 - iVar4,param_1);\n        iVar4 = iVar4 + iVar2;\n        if (iVar4 != 0x8000) break;\n        sha256_process_block(iVar1,0x8000,auStack_d0);\n        iVar4 = 0;\n      }\n    } while (iVar2 != 0);\n    if ((*param_1 & 0x20) == 0) {\nLAB_00017264:\n      if (iVar4 != 0) {\n        sha256_process_bytes(iVar1,iVar4,auStack_d0);\n      }\n      (*param_6)(auStack_d0,param_3);\n      (*(code *)PTR_free_0002f2f8)(iVar1);\n      uVar3 = 0;\n    }\n    else {\n      (*(code *)PTR_free_0002f2f8)(iVar1);\n      uVar3 = 1;\n    }\n  }" else (compound_statement "{\n    (*param_5)(auStack_d0);\n    iVar4 = 0;\n    do {\n      while( true ) {\n        if ((*param_1 & 0x10) != 0) goto LAB_00017264;\n        iVar2 = (*(code *)PTR_fread_unlocked_0002f22c)(iVar1 + iVar4,1,0x8000 - iVar4,param_1);\n        iVar4 = iVar4 + iVar2;\n        if (iVar4 != 0x8000) break;\n        sha256_process_block(iVar1,0x8000,auStack_d0);\n        iVar4 = 0;\n      }\n    } while (iVar2 != 0);\n    if ((*param_1 & 0x20) == 0) {\nLAB_00017264:\n      if (iVar4 != 0) {\n        sha256_process_bytes(iVar1,iVar4,auStack_d0);\n      }\n      (*param_6)(auStack_d0,param_3);\n      (*(code *)PTR_free_0002f2f8)(iVar1);\n      uVar3 = 0;\n    }\n    else {\n      (*(code *)PTR_free_0002f2f8)(iVar1);\n      uVar3 = 1;\n    }\n  }" { (expression_statement "(*param_5)(auStack_d0);" (call_expression "(*param_5)(auStack_d0)" (parenthesized_expression "(*param_5)" ( (pointer_expression "*param_5" * identifier) )) (argument_list "(auStack_d0)" ( identifier ))) ;) (expression_statement "iVar4 = 0;" (assignment_expression "iVar4 = 0" identifier = number_literal) ;) (do_statement "do {\n      while( true ) {\n        if ((*param_1 & 0x10) != 0) goto LAB_00017264;\n        iVar2 = (*(code *)PTR_fread_unlocked_0002f22c)(iVar1 + iVar4,1,0x8000 - iVar4,param_1);\n        iVar4 = iVar4 + iVar2;\n        if (iVar4 != 0x8000) break;\n        sha256_process_block(iVar1,0x8000,auStack_d0);\n        iVar4 = 0;\n      }\n    } while (iVar2 != 0);" do (compound_statement "{\n      while( true ) {\n        if ((*param_1 & 0x10) != 0) goto LAB_00017264;\n        iVar2 = (*(code *)PTR_fread_unlocked_0002f22c)(iVar1 + iVar4,1,0x8000 - iVar4,param_1);\n        iVar4 = iVar4 + iVar2;\n        if (iVar4 != 0x8000) break;\n        sha256_process_block(iVar1,0x8000,auStack_d0);\n        iVar4 = 0;\n      }\n    }" { (while_statement "while( true ) {\n        if ((*param_1 & 0x10) != 0) goto LAB_00017264;\n        iVar2 = (*(code *)PTR_fread_unlocked_0002f22c)(iVar1 + iVar4,1,0x8000 - iVar4,param_1);\n        iVar4 = iVar4 + iVar2;\n        if (iVar4 != 0x8000) break;\n        sha256_process_block(iVar1,0x8000,auStack_d0);\n        iVar4 = 0;\n      }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n        if ((*param_1 & 0x10) != 0) goto LAB_00017264;\n        iVar2 = (*(code *)PTR_fread_unlocked_0002f22c)(iVar1 + iVar4,1,0x8000 - iVar4,param_1);\n        iVar4 = iVar4 + iVar2;\n        if (iVar4 != 0x8000) break;\n        sha256_process_block(iVar1,0x8000,auStack_d0);\n        iVar4 = 0;\n      }" { (if_statement "if ((*param_1 & 0x10) != 0) goto LAB_00017264;" if (parenthesized_expression "((*param_1 & 0x10) != 0)" ( (binary_expression "(*param_1 & 0x10) != 0" (parenthesized_expression "(*param_1 & 0x10)" ( (binary_expression "*param_1 & 0x10" (pointer_expression "*param_1" * identifier) & number_literal) )) != number_literal) )) (goto_statement "goto LAB_00017264;" goto statement_identifier ;)) (expression_statement "iVar2 = (*(code *)PTR_fread_unlocked_0002f22c)(iVar1 + iVar4,1,0x8000 - iVar4,param_1);" (assignment_expression "iVar2 = (*(code *)PTR_fread_unlocked_0002f22c)(iVar1 + iVar4,1,0x8000 - iVar4,param_1)" identifier = (call_expression "(*(code *)PTR_fread_unlocked_0002f22c)(iVar1 + iVar4,1,0x8000 - iVar4,param_1)" (parenthesized_expression "(*(code *)PTR_fread_unlocked_0002f22c)" ( (pointer_expression "*(code *)PTR_fread_unlocked_0002f22c" * (cast_expression "(code *)PTR_fread_unlocked_0002f22c" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar1 + iVar4,1,0x8000 - iVar4,param_1)" ( (binary_expression "iVar1 + iVar4" identifier + identifier) , number_literal , (binary_expression "0x8000 - iVar4" number_literal - identifier) , identifier )))) ;) (expression_statement "iVar4 = iVar4 + iVar2;" (assignment_expression "iVar4 = iVar4 + iVar2" identifier = (binary_expression "iVar4 + iVar2" identifier + identifier)) ;) (if_statement "if (iVar4 != 0x8000) break;" if (parenthesized_expression "(iVar4 != 0x8000)" ( (binary_expression "iVar4 != 0x8000" identifier != number_literal) )) (break_statement "break;" break ;)) (expression_statement "sha256_process_block(iVar1,0x8000,auStack_d0);" (call_expression "sha256_process_block(iVar1,0x8000,auStack_d0)" identifier (argument_list "(iVar1,0x8000,auStack_d0)" ( identifier , number_literal , identifier ))) ;) (expression_statement "iVar4 = 0;" (assignment_expression "iVar4 = 0" identifier = number_literal) ;) })) }) while (parenthesized_expression "(iVar2 != 0)" ( (binary_expression "iVar2 != 0" identifier != number_literal) )) ;) (if_statement "if ((*param_1 & 0x20) == 0) {\nLAB_00017264:\n      if (iVar4 != 0) {\n        sha256_process_bytes(iVar1,iVar4,auStack_d0);\n      }\n      (*param_6)(auStack_d0,param_3);\n      (*(code *)PTR_free_0002f2f8)(iVar1);\n      uVar3 = 0;\n    }\n    else {\n      (*(code *)PTR_free_0002f2f8)(iVar1);\n      uVar3 = 1;\n    }" if (parenthesized_expression "((*param_1 & 0x20) == 0)" ( (binary_expression "(*param_1 & 0x20) == 0" (parenthesized_expression "(*param_1 & 0x20)" ( (binary_expression "*param_1 & 0x20" (pointer_expression "*param_1" * identifier) & number_literal) )) == number_literal) )) (compound_statement "{\nLAB_00017264:\n      if (iVar4 != 0) {\n        sha256_process_bytes(iVar1,iVar4,auStack_d0);\n      }\n      (*param_6)(auStack_d0,param_3);\n      (*(code *)PTR_free_0002f2f8)(iVar1);\n      uVar3 = 0;\n    }" { (labeled_statement "LAB_00017264:\n      if (iVar4 != 0) {\n        sha256_process_bytes(iVar1,iVar4,auStack_d0);\n      }" statement_identifier : (if_statement "if (iVar4 != 0) {\n        sha256_process_bytes(iVar1,iVar4,auStack_d0);\n      }" if (parenthesized_expression "(iVar4 != 0)" ( (binary_expression "iVar4 != 0" identifier != number_literal) )) (compound_statement "{\n        sha256_process_bytes(iVar1,iVar4,auStack_d0);\n      }" { (expression_statement "sha256_process_bytes(iVar1,iVar4,auStack_d0);" (call_expression "sha256_process_bytes(iVar1,iVar4,auStack_d0)" identifier (argument_list "(iVar1,iVar4,auStack_d0)" ( identifier , identifier , identifier ))) ;) }))) (expression_statement "(*param_6)(auStack_d0,param_3);" (call_expression "(*param_6)(auStack_d0,param_3)" (parenthesized_expression "(*param_6)" ( (pointer_expression "*param_6" * identifier) )) (argument_list "(auStack_d0,param_3)" ( identifier , identifier ))) ;) (expression_statement "(*(code *)PTR_free_0002f2f8)(iVar1);" (call_expression "(*(code *)PTR_free_0002f2f8)(iVar1)" (parenthesized_expression "(*(code *)PTR_free_0002f2f8)" ( (pointer_expression "*(code *)PTR_free_0002f2f8" * (cast_expression "(code *)PTR_free_0002f2f8" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar1)" ( identifier ))) ;) (expression_statement "uVar3 = 0;" (assignment_expression "uVar3 = 0" identifier = number_literal) ;) }) (else_clause "else {\n      (*(code *)PTR_free_0002f2f8)(iVar1);\n      uVar3 = 1;\n    }" else (compound_statement "{\n      (*(code *)PTR_free_0002f2f8)(iVar1);\n      uVar3 = 1;\n    }" { (expression_statement "(*(code *)PTR_free_0002f2f8)(iVar1);" (call_expression "(*(code *)PTR_free_0002f2f8)(iVar1)" (parenthesized_expression "(*(code *)PTR_free_0002f2f8)" ( (pointer_expression "*(code *)PTR_free_0002f2f8" * (cast_expression "(code *)PTR_free_0002f2f8" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar1)" ( identifier ))) ;) (expression_statement "uVar3 = 1;" (assignment_expression "uVar3 = 1" identifier = number_literal) ;) }))) }))) (if_statement "if (local_24 != *(int *)PTR___stack_chk_guard_0002f2f0) {\n    (*(code *)PTR___stack_chk_fail_0002f2dc)();\n    uVar3 = FUN_00017188();\n    return uVar3;\n  }" if (parenthesized_expression "(local_24 != *(int *)PTR___stack_chk_guard_0002f2f0)" ( (binary_expression "local_24 != *(int *)PTR___stack_chk_guard_0002f2f0" identifier != (pointer_expression "*(int *)PTR___stack_chk_guard_0002f2f0" * (cast_expression "(int *)PTR___stack_chk_guard_0002f2f0" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) )) (compound_statement "{\n    (*(code *)PTR___stack_chk_fail_0002f2dc)();\n    uVar3 = FUN_00017188();\n    return uVar3;\n  }" { (expression_statement "(*(code *)PTR___stack_chk_fail_0002f2dc)();" (call_expression "(*(code *)PTR___stack_chk_fail_0002f2dc)()" (parenthesized_expression "(*(code *)PTR___stack_chk_fail_0002f2dc)" ( (pointer_expression "*(code *)PTR___stack_chk_fail_0002f2dc" * (cast_expression "(code *)PTR___stack_chk_fail_0002f2dc" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))) ;) (expression_statement "uVar3 = FUN_00017188();" (assignment_expression "uVar3 = FUN_00017188()" identifier = (call_expression "FUN_00017188()" identifier (argument_list "()" ( )))) ;) (return_statement "return uVar3;" return identifier ;) })) (return_statement "return uVar3;" return identifier ;) })))
(translation_unit "int shaxxx_stream(FILE *stream,char *alg,void *resblock,ssize_t hashlen,\n                 _func_void_sha256_ctx_ptr *init_ctx,\n                 _func_void_ptr_sha256_ctx_ptr_void_ptr *finish_ctx)\n\n{\n  FILE *stream_00;\n  void *buffer;\n  int iVar1;\n  size_t len;\n  undefined *puVar2;\n  sha256_ctx ctx;\n  \n  stream_00 = *(FILE **)PTR___stack_chk_guard_0002f2f0;\n  buffer = (void *)(*(code *)PTR_malloc_0002f2ac)(0x8048);\n  if (buffer == (void *)0x0) {\n    iVar1 = 1;\n  }\n  else {\n    (*init_ctx)(&ctx);\n    len = 0;\n    do {\n      while( true ) {\n        if ((stream->_flags & 0x10U) != 0) goto LAB_00017264;\n        alg = (char *)0x1;\n        iVar1 = (*(code *)PTR_fread_unlocked_0002f22c)((int)buffer + len,1,0x8000 - len,stream);\n        len = len + iVar1;\n        if (len != 0x8000) break;\n        sha256_process_block(buffer,0x8000,&ctx);\n        len = 0;\n      }\n    } while (iVar1 != 0);\n    if ((stream->_flags & 0x20U) == 0) {\nLAB_00017264:\n      if (len != 0) {\n        sha256_process_bytes(buffer,len,&ctx);\n      }\n      (*finish_ctx)(&ctx,resblock);\n      (*(code *)PTR_free_0002f2f8)(buffer);\n      iVar1 = 0;\n      alg = (char *)resblock;\n    }\n    else {\n      (*(code *)PTR_free_0002f2f8)(buffer);\n      iVar1 = 1;\n    }\n  }\n  if (stream_00 != *(FILE **)PTR___stack_chk_guard_0002f2f0) {\n    puVar2 = PTR___stack_chk_fail_0002f2dc;\n    (*(code *)PTR___stack_chk_fail_0002f2dc)();\n    iVar1 = shaxxx_stream(stream_00,(char *)(*(int *)(puVar2 + 0x17dc8) + -0x2794),alg,0x20,\n                          *(_func_void_sha256_ctx_ptr **)(puVar2 + 0x17e20),\n                          *(_func_void_ptr_sha256_ctx_ptr_void_ptr **)(puVar2 + 0x17e28));\n    return iVar1;\n  }\n  return iVar1;\n}\n\n" (function_definition "int shaxxx_stream(FILE *stream,char *alg,void *resblock,ssize_t hashlen,\n                 _func_void_sha256_ctx_ptr *init_ctx,\n                 _func_void_ptr_sha256_ctx_ptr_void_ptr *finish_ctx)\n\n{\n  FILE *stream_00;\n  void *buffer;\n  int iVar1;\n  size_t len;\n  undefined *puVar2;\n  sha256_ctx ctx;\n  \n  stream_00 = *(FILE **)PTR___stack_chk_guard_0002f2f0;\n  buffer = (void *)(*(code *)PTR_malloc_0002f2ac)(0x8048);\n  if (buffer == (void *)0x0) {\n    iVar1 = 1;\n  }\n  else {\n    (*init_ctx)(&ctx);\n    len = 0;\n    do {\n      while( true ) {\n        if ((stream->_flags & 0x10U) != 0) goto LAB_00017264;\n        alg = (char *)0x1;\n        iVar1 = (*(code *)PTR_fread_unlocked_0002f22c)((int)buffer + len,1,0x8000 - len,stream);\n        len = len + iVar1;\n        if (len != 0x8000) break;\n        sha256_process_block(buffer,0x8000,&ctx);\n        len = 0;\n      }\n    } while (iVar1 != 0);\n    if ((stream->_flags & 0x20U) == 0) {\nLAB_00017264:\n      if (len != 0) {\n        sha256_process_bytes(buffer,len,&ctx);\n      }\n      (*finish_ctx)(&ctx,resblock);\n      (*(code *)PTR_free_0002f2f8)(buffer);\n      iVar1 = 0;\n      alg = (char *)resblock;\n    }\n    else {\n      (*(code *)PTR_free_0002f2f8)(buffer);\n      iVar1 = 1;\n    }\n  }\n  if (stream_00 != *(FILE **)PTR___stack_chk_guard_0002f2f0) {\n    puVar2 = PTR___stack_chk_fail_0002f2dc;\n    (*(code *)PTR___stack_chk_fail_0002f2dc)();\n    iVar1 = shaxxx_stream(stream_00,(char *)(*(int *)(puVar2 + 0x17dc8) + -0x2794),alg,0x20,\n                          *(_func_void_sha256_ctx_ptr **)(puVar2 + 0x17e20),\n                          *(_func_void_ptr_sha256_ctx_ptr_void_ptr **)(puVar2 + 0x17e28));\n    return iVar1;\n  }\n  return iVar1;\n}" primitive_type (function_declarator "shaxxx_stream(FILE *stream,char *alg,void *resblock,ssize_t hashlen,\n                 _func_void_sha256_ctx_ptr *init_ctx,\n                 _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,\n                 _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  FILE *stream_00;\n  void *buffer;\n  int iVar1;\n  size_t len;\n  undefined *puVar2;\n  sha256_ctx ctx;\n  \n  stream_00 = *(FILE **)PTR___stack_chk_guard_0002f2f0;\n  buffer = (void *)(*(code *)PTR_malloc_0002f2ac)(0x8048);\n  if (buffer == (void *)0x0) {\n    iVar1 = 1;\n  }\n  else {\n    (*init_ctx)(&ctx);\n    len = 0;\n    do {\n      while( true ) {\n        if ((stream->_flags & 0x10U) != 0) goto LAB_00017264;\n        alg = (char *)0x1;\n        iVar1 = (*(code *)PTR_fread_unlocked_0002f22c)((int)buffer + len,1,0x8000 - len,stream);\n        len = len + iVar1;\n        if (len != 0x8000) break;\n        sha256_process_block(buffer,0x8000,&ctx);\n        len = 0;\n      }\n    } while (iVar1 != 0);\n    if ((stream->_flags & 0x20U) == 0) {\nLAB_00017264:\n      if (len != 0) {\n        sha256_process_bytes(buffer,len,&ctx);\n      }\n      (*finish_ctx)(&ctx,resblock);\n      (*(code *)PTR_free_0002f2f8)(buffer);\n      iVar1 = 0;\n      alg = (char *)resblock;\n    }\n    else {\n      (*(code *)PTR_free_0002f2f8)(buffer);\n      iVar1 = 1;\n    }\n  }\n  if (stream_00 != *(FILE **)PTR___stack_chk_guard_0002f2f0) {\n    puVar2 = PTR___stack_chk_fail_0002f2dc;\n    (*(code *)PTR___stack_chk_fail_0002f2dc)();\n    iVar1 = shaxxx_stream(stream_00,(char *)(*(int *)(puVar2 + 0x17dc8) + -0x2794),alg,0x20,\n                          *(_func_void_sha256_ctx_ptr **)(puVar2 + 0x17e20),\n                          *(_func_void_ptr_sha256_ctx_ptr_void_ptr **)(puVar2 + 0x17e28));\n    return iVar1;\n  }\n  return iVar1;\n}" { (declaration "FILE *stream_00;" type_identifier (pointer_declarator "*stream_00" * identifier) ;) (declaration "void *buffer;" primitive_type (pointer_declarator "*buffer" * identifier) ;) (declaration "int iVar1;" primitive_type identifier ;) (declaration "size_t len;" primitive_type identifier ;) (declaration "undefined *puVar2;" type_identifier (pointer_declarator "*puVar2" * identifier) ;) (declaration "sha256_ctx ctx;" type_identifier identifier ;) (expression_statement "stream_00 = *(FILE **)PTR___stack_chk_guard_0002f2f0;" (assignment_expression "stream_00 = *(FILE **)PTR___stack_chk_guard_0002f2f0" identifier = (pointer_expression "*(FILE **)PTR___stack_chk_guard_0002f2f0" * (cast_expression "(FILE **)PTR___stack_chk_guard_0002f2f0" ( (type_descriptor "FILE **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier))) ;) (expression_statement "buffer = (void *)(*(code *)PTR_malloc_0002f2ac)(0x8048);" (assignment_expression "buffer = (void *)(*(code *)PTR_malloc_0002f2ac)(0x8048)" identifier = (cast_expression "(void *)(*(code *)PTR_malloc_0002f2ac)(0x8048)" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "(*(code *)PTR_malloc_0002f2ac)(0x8048)" (parenthesized_expression "(*(code *)PTR_malloc_0002f2ac)" ( (pointer_expression "*(code *)PTR_malloc_0002f2ac" * (cast_expression "(code *)PTR_malloc_0002f2ac" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(0x8048)" ( number_literal ))))) ;) (if_statement "if (buffer == (void *)0x0) {\n    iVar1 = 1;\n  }\n  else {\n    (*init_ctx)(&ctx);\n    len = 0;\n    do {\n      while( true ) {\n        if ((stream->_flags & 0x10U) != 0) goto LAB_00017264;\n        alg = (char *)0x1;\n        iVar1 = (*(code *)PTR_fread_unlocked_0002f22c)((int)buffer + len,1,0x8000 - len,stream);\n        len = len + iVar1;\n        if (len != 0x8000) break;\n        sha256_process_block(buffer,0x8000,&ctx);\n        len = 0;\n      }\n    } while (iVar1 != 0);\n    if ((stream->_flags & 0x20U) == 0) {\nLAB_00017264:\n      if (len != 0) {\n        sha256_process_bytes(buffer,len,&ctx);\n      }\n      (*finish_ctx)(&ctx,resblock);\n      (*(code *)PTR_free_0002f2f8)(buffer);\n      iVar1 = 0;\n      alg = (char *)resblock;\n    }\n    else {\n      (*(code *)PTR_free_0002f2f8)(buffer);\n      iVar1 = 1;\n    }\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    iVar1 = 1;\n  }" { (expression_statement "iVar1 = 1;" (assignment_expression "iVar1 = 1" identifier = number_literal) ;) }) (else_clause "else {\n    (*init_ctx)(&ctx);\n    len = 0;\n    do {\n      while( true ) {\n        if ((stream->_flags & 0x10U) != 0) goto LAB_00017264;\n        alg = (char *)0x1;\n        iVar1 = (*(code *)PTR_fread_unlocked_0002f22c)((int)buffer + len,1,0x8000 - len,stream);\n        len = len + iVar1;\n        if (len != 0x8000) break;\n        sha256_process_block(buffer,0x8000,&ctx);\n        len = 0;\n      }\n    } while (iVar1 != 0);\n    if ((stream->_flags & 0x20U) == 0) {\nLAB_00017264:\n      if (len != 0) {\n        sha256_process_bytes(buffer,len,&ctx);\n      }\n      (*finish_ctx)(&ctx,resblock);\n      (*(code *)PTR_free_0002f2f8)(buffer);\n      iVar1 = 0;\n      alg = (char *)resblock;\n    }\n    else {\n      (*(code *)PTR_free_0002f2f8)(buffer);\n      iVar1 = 1;\n    }\n  }" else (compound_statement "{\n    (*init_ctx)(&ctx);\n    len = 0;\n    do {\n      while( true ) {\n        if ((stream->_flags & 0x10U) != 0) goto LAB_00017264;\n        alg = (char *)0x1;\n        iVar1 = (*(code *)PTR_fread_unlocked_0002f22c)((int)buffer + len,1,0x8000 - len,stream);\n        len = len + iVar1;\n        if (len != 0x8000) break;\n        sha256_process_block(buffer,0x8000,&ctx);\n        len = 0;\n      }\n    } while (iVar1 != 0);\n    if ((stream->_flags & 0x20U) == 0) {\nLAB_00017264:\n      if (len != 0) {\n        sha256_process_bytes(buffer,len,&ctx);\n      }\n      (*finish_ctx)(&ctx,resblock);\n      (*(code *)PTR_free_0002f2f8)(buffer);\n      iVar1 = 0;\n      alg = (char *)resblock;\n    }\n    else {\n      (*(code *)PTR_free_0002f2f8)(buffer);\n      iVar1 = 1;\n    }\n  }" { (expression_statement "(*init_ctx)(&ctx);" (call_expression "(*init_ctx)(&ctx)" (parenthesized_expression "(*init_ctx)" ( (pointer_expression "*init_ctx" * identifier) )) (argument_list "(&ctx)" ( (pointer_expression "&ctx" & identifier) ))) ;) (expression_statement "len = 0;" (assignment_expression "len = 0" identifier = number_literal) ;) (do_statement "do {\n      while( true ) {\n        if ((stream->_flags & 0x10U) != 0) goto LAB_00017264;\n        alg = (char *)0x1;\n        iVar1 = (*(code *)PTR_fread_unlocked_0002f22c)((int)buffer + len,1,0x8000 - len,stream);\n        len = len + iVar1;\n        if (len != 0x8000) break;\n        sha256_process_block(buffer,0x8000,&ctx);\n        len = 0;\n      }\n    } while (iVar1 != 0);" do (compound_statement "{\n      while( true ) {\n        if ((stream->_flags & 0x10U) != 0) goto LAB_00017264;\n        alg = (char *)0x1;\n        iVar1 = (*(code *)PTR_fread_unlocked_0002f22c)((int)buffer + len,1,0x8000 - len,stream);\n        len = len + iVar1;\n        if (len != 0x8000) break;\n        sha256_process_block(buffer,0x8000,&ctx);\n        len = 0;\n      }\n    }" { (while_statement "while( true ) {\n        if ((stream->_flags & 0x10U) != 0) goto LAB_00017264;\n        alg = (char *)0x1;\n        iVar1 = (*(code *)PTR_fread_unlocked_0002f22c)((int)buffer + len,1,0x8000 - len,stream);\n        len = len + iVar1;\n        if (len != 0x8000) break;\n        sha256_process_block(buffer,0x8000,&ctx);\n        len = 0;\n      }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n        if ((stream->_flags & 0x10U) != 0) goto LAB_00017264;\n        alg = (char *)0x1;\n        iVar1 = (*(code *)PTR_fread_unlocked_0002f22c)((int)buffer + len,1,0x8000 - len,stream);\n        len = len + iVar1;\n        if (len != 0x8000) break;\n        sha256_process_block(buffer,0x8000,&ctx);\n        len = 0;\n      }" { (if_statement "if ((stream->_flags & 0x10U) != 0) goto LAB_00017264;" if (parenthesized_expression "((stream->_flags & 0x10U) != 0)" ( (binary_expression "(stream->_flags & 0x10U) != 0" (parenthesized_expression "(stream->_flags & 0x10U)" ( (binary_expression "stream->_flags & 0x10U" (field_expression "stream->_flags" identifier -> field_identifier) & number_literal) )) != number_literal) )) (goto_statement "goto LAB_00017264;" goto statement_identifier ;)) (expression_statement "alg = (char *)0x1;" (assignment_expression "alg = (char *)0x1" identifier = (cast_expression "(char *)0x1" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) ;) (expression_statement "iVar1 = (*(code *)PTR_fread_unlocked_0002f22c)((int)buffer + len,1,0x8000 - len,stream);" (assignment_expression "iVar1 = (*(code *)PTR_fread_unlocked_0002f22c)((int)buffer + len,1,0x8000 - len,stream)" identifier = (call_expression "(*(code *)PTR_fread_unlocked_0002f22c)((int)buffer + len,1,0x8000 - len,stream)" (parenthesized_expression "(*(code *)PTR_fread_unlocked_0002f22c)" ( (pointer_expression "*(code *)PTR_fread_unlocked_0002f22c" * (cast_expression "(code *)PTR_fread_unlocked_0002f22c" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "((int)buffer + len,1,0x8000 - len,stream)" ( (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) , identifier )))) ;) (expression_statement "len = len + iVar1;" (assignment_expression "len = len + iVar1" identifier = (binary_expression "len + iVar1" 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) ))) ;) (expression_statement "len = 0;" (assignment_expression "len = 0" identifier = number_literal) ;) })) }) while (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) ;) (if_statement "if ((stream->_flags & 0x20U) == 0) {\nLAB_00017264:\n      if (len != 0) {\n        sha256_process_bytes(buffer,len,&ctx);\n      }\n      (*finish_ctx)(&ctx,resblock);\n      (*(code *)PTR_free_0002f2f8)(buffer);\n      iVar1 = 0;\n      alg = (char *)resblock;\n    }\n    else {\n      (*(code *)PTR_free_0002f2f8)(buffer);\n      iVar1 = 1;\n    }" if (parenthesized_expression "((stream->_flags & 0x20U) == 0)" ( (binary_expression "(stream->_flags & 0x20U) == 0" (parenthesized_expression "(stream->_flags & 0x20U)" ( (binary_expression "stream->_flags & 0x20U" (field_expression "stream->_flags" identifier -> field_identifier) & number_literal) )) == number_literal) )) (compound_statement "{\nLAB_00017264:\n      if (len != 0) {\n        sha256_process_bytes(buffer,len,&ctx);\n      }\n      (*finish_ctx)(&ctx,resblock);\n      (*(code *)PTR_free_0002f2f8)(buffer);\n      iVar1 = 0;\n      alg = (char *)resblock;\n    }" { (labeled_statement "LAB_00017264:\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 "(*finish_ctx)(&ctx,resblock);" (call_expression "(*finish_ctx)(&ctx,resblock)" (parenthesized_expression "(*finish_ctx)" ( (pointer_expression "*finish_ctx" * identifier) )) (argument_list "(&ctx,resblock)" ( (pointer_expression "&ctx" & identifier) , identifier ))) ;) (expression_statement "(*(code *)PTR_free_0002f2f8)(buffer);" (call_expression "(*(code *)PTR_free_0002f2f8)(buffer)" (parenthesized_expression "(*(code *)PTR_free_0002f2f8)" ( (pointer_expression "*(code *)PTR_free_0002f2f8" * (cast_expression "(code *)PTR_free_0002f2f8" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(buffer)" ( identifier ))) ;) (expression_statement "iVar1 = 0;" (assignment_expression "iVar1 = 0" identifier = number_literal) ;) (expression_statement "alg = (char *)resblock;" (assignment_expression "alg = (char *)resblock" identifier = (cast_expression "(char *)resblock" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier)) ;) }) (else_clause "else {\n      (*(code *)PTR_free_0002f2f8)(buffer);\n      iVar1 = 1;\n    }" else (compound_statement "{\n      (*(code *)PTR_free_0002f2f8)(buffer);\n      iVar1 = 1;\n    }" { (expression_statement "(*(code *)PTR_free_0002f2f8)(buffer);" (call_expression "(*(code *)PTR_free_0002f2f8)(buffer)" (parenthesized_expression "(*(code *)PTR_free_0002f2f8)" ( (pointer_expression "*(code *)PTR_free_0002f2f8" * (cast_expression "(code *)PTR_free_0002f2f8" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(buffer)" ( identifier ))) ;) (expression_statement "iVar1 = 1;" (assignment_expression "iVar1 = 1" identifier = number_literal) ;) }))) }))) (if_statement "if (stream_00 != *(FILE **)PTR___stack_chk_guard_0002f2f0) {\n    puVar2 = PTR___stack_chk_fail_0002f2dc;\n    (*(code *)PTR___stack_chk_fail_0002f2dc)();\n    iVar1 = shaxxx_stream(stream_00,(char *)(*(int *)(puVar2 + 0x17dc8) + -0x2794),alg,0x20,\n                          *(_func_void_sha256_ctx_ptr **)(puVar2 + 0x17e20),\n                          *(_func_void_ptr_sha256_ctx_ptr_void_ptr **)(puVar2 + 0x17e28));\n    return iVar1;\n  }" if (parenthesized_expression "(stream_00 != *(FILE **)PTR___stack_chk_guard_0002f2f0)" ( (binary_expression "stream_00 != *(FILE **)PTR___stack_chk_guard_0002f2f0" identifier != (pointer_expression "*(FILE **)PTR___stack_chk_guard_0002f2f0" * (cast_expression "(FILE **)PTR___stack_chk_guard_0002f2f0" ( (type_descriptor "FILE **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier))) )) (compound_statement "{\n    puVar2 = PTR___stack_chk_fail_0002f2dc;\n    (*(code *)PTR___stack_chk_fail_0002f2dc)();\n    iVar1 = shaxxx_stream(stream_00,(char *)(*(int *)(puVar2 + 0x17dc8) + -0x2794),alg,0x20,\n                          *(_func_void_sha256_ctx_ptr **)(puVar2 + 0x17e20),\n                          *(_func_void_ptr_sha256_ctx_ptr_void_ptr **)(puVar2 + 0x17e28));\n    return iVar1;\n  }" { (expression_statement "puVar2 = PTR___stack_chk_fail_0002f2dc;" (assignment_expression "puVar2 = PTR___stack_chk_fail_0002f2dc" identifier = identifier) ;) (expression_statement "(*(code *)PTR___stack_chk_fail_0002f2dc)();" (call_expression "(*(code *)PTR___stack_chk_fail_0002f2dc)()" (parenthesized_expression "(*(code *)PTR___stack_chk_fail_0002f2dc)" ( (pointer_expression "*(code *)PTR___stack_chk_fail_0002f2dc" * (cast_expression "(code *)PTR___stack_chk_fail_0002f2dc" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))) ;) (expression_statement "iVar1 = shaxxx_stream(stream_00,(char *)(*(int *)(puVar2 + 0x17dc8) + -0x2794),alg,0x20,\n                          *(_func_void_sha256_ctx_ptr **)(puVar2 + 0x17e20),\n                          *(_func_void_ptr_sha256_ctx_ptr_void_ptr **)(puVar2 + 0x17e28));" (assignment_expression "iVar1 = shaxxx_stream(stream_00,(char *)(*(int *)(puVar2 + 0x17dc8) + -0x2794),alg,0x20,\n                          *(_func_void_sha256_ctx_ptr **)(puVar2 + 0x17e20),\n                          *(_func_void_ptr_sha256_ctx_ptr_void_ptr **)(puVar2 + 0x17e28))" identifier = (call_expression "shaxxx_stream(stream_00,(char *)(*(int *)(puVar2 + 0x17dc8) + -0x2794),alg,0x20,\n                          *(_func_void_sha256_ctx_ptr **)(puVar2 + 0x17e20),\n                          *(_func_void_ptr_sha256_ctx_ptr_void_ptr **)(puVar2 + 0x17e28))" identifier (argument_list "(stream_00,(char *)(*(int *)(puVar2 + 0x17dc8) + -0x2794),alg,0x20,\n                          *(_func_void_sha256_ctx_ptr **)(puVar2 + 0x17e20),\n                          *(_func_void_ptr_sha256_ctx_ptr_void_ptr **)(puVar2 + 0x17e28))" ( identifier , (cast_expression "(char *)(*(int *)(puVar2 + 0x17dc8) + -0x2794)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*(int *)(puVar2 + 0x17dc8) + -0x2794)" ( (binary_expression "*(int *)(puVar2 + 0x17dc8) + -0x2794" (pointer_expression "*(int *)(puVar2 + 0x17dc8)" * (cast_expression "(int *)(puVar2 + 0x17dc8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar2 + 0x17dc8)" ( (binary_expression "puVar2 + 0x17dc8" identifier + number_literal) )))) + number_literal) ))) , identifier , number_literal , (pointer_expression "*(_func_void_sha256_ctx_ptr **)(puVar2 + 0x17e20)" * (cast_expression "(_func_void_sha256_ctx_ptr **)(puVar2 + 0x17e20)" ( (type_descriptor "_func_void_sha256_ctx_ptr **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(puVar2 + 0x17e20)" ( (binary_expression "puVar2 + 0x17e20" identifier + number_literal) )))) , (pointer_expression "*(_func_void_ptr_sha256_ctx_ptr_void_ptr **)(puVar2 + 0x17e28)" * (cast_expression "(_func_void_ptr_sha256_ctx_ptr_void_ptr **)(puVar2 + 0x17e28)" ( (type_descriptor "_func_void_ptr_sha256_ctx_ptr_void_ptr **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(puVar2 + 0x17e28)" ( (binary_expression "puVar2 + 0x17e28" identifier + number_literal) )))) )))) ;) (return_statement "return iVar1;" return identifier ;) })) (return_statement "return iVar1;" return identifier ;) })))
(translation_unit "undefined4\nFUN_00017188(uint *param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4,code *param_5,\n            code *param_6)\n\n{\n  int iVar1;\n  int iVar2;\n  undefined4 uVar3;\n  int iVar4;\n  undefined1 auStack_d0 [172];\n  int local_24;\n  \n  local_24 = *(int *)PTR___stack_chk_guard_0002f2f0;\n  iVar1 = (*(code *)PTR_malloc_0002f2ac)(0x8048);\n  if (iVar1 == 0) {\n    uVar3 = 1;\n  }\n  else {\n    (*param_5)(auStack_d0);\n    iVar4 = 0;\n    do {\n      while( true ) {\n        if ((*param_1 & 0x10) != 0) goto LAB_00017264;\n        iVar2 = (*(code *)PTR_fread_unlocked_0002f22c)(iVar1 + iVar4,1,0x8000 - iVar4,param_1);\n        iVar4 = iVar4 + iVar2;\n        if (iVar4 != 0x8000) break;\n        sha256_process_block(iVar1,0x8000,auStack_d0);\n        iVar4 = 0;\n      }\n    } while (iVar2 != 0);\n    if ((*param_1 & 0x20) == 0) {\nLAB_00017264:\n      if (iVar4 != 0) {\n        sha256_process_bytes(iVar1,iVar4,auStack_d0);\n      }\n      (*param_6)(auStack_d0,param_3);\n      (*(code *)PTR_free_0002f2f8)(iVar1);\n      uVar3 = 0;\n    }\n    else {\n      (*(code *)PTR_free_0002f2f8)(iVar1);\n      uVar3 = 1;\n    }\n  }\n  if (local_24 != *(int *)PTR___stack_chk_guard_0002f2f0) {\n    (*(code *)PTR___stack_chk_fail_0002f2dc)();\n    uVar3 = FUN_00017188();\n    return uVar3;\n  }\n  return uVar3;\n}\n\n" (function_definition "undefined4\nFUN_00017188(uint *param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4,code *param_5,\n            code *param_6)\n\n{\n  int iVar1;\n  int iVar2;\n  undefined4 uVar3;\n  int iVar4;\n  undefined1 auStack_d0 [172];\n  int local_24;\n  \n  local_24 = *(int *)PTR___stack_chk_guard_0002f2f0;\n  iVar1 = (*(code *)PTR_malloc_0002f2ac)(0x8048);\n  if (iVar1 == 0) {\n    uVar3 = 1;\n  }\n  else {\n    (*param_5)(auStack_d0);\n    iVar4 = 0;\n    do {\n      while( true ) {\n        if ((*param_1 & 0x10) != 0) goto LAB_00017264;\n        iVar2 = (*(code *)PTR_fread_unlocked_0002f22c)(iVar1 + iVar4,1,0x8000 - iVar4,param_1);\n        iVar4 = iVar4 + iVar2;\n        if (iVar4 != 0x8000) break;\n        sha256_process_block(iVar1,0x8000,auStack_d0);\n        iVar4 = 0;\n      }\n    } while (iVar2 != 0);\n    if ((*param_1 & 0x20) == 0) {\nLAB_00017264:\n      if (iVar4 != 0) {\n        sha256_process_bytes(iVar1,iVar4,auStack_d0);\n      }\n      (*param_6)(auStack_d0,param_3);\n      (*(code *)PTR_free_0002f2f8)(iVar1);\n      uVar3 = 0;\n    }\n    else {\n      (*(code *)PTR_free_0002f2f8)(iVar1);\n      uVar3 = 1;\n    }\n  }\n  if (local_24 != *(int *)PTR___stack_chk_guard_0002f2f0) {\n    (*(code *)PTR___stack_chk_fail_0002f2dc)();\n    uVar3 = FUN_00017188();\n    return uVar3;\n  }\n  return uVar3;\n}" type_identifier (function_declarator "FUN_00017188(uint *param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4,code *param_5,\n            code *param_6)" identifier (parameter_list "(uint *param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4,code *param_5,\n            code *param_6)" ( (parameter_declaration "uint *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "undefined4 param_2" type_identifier identifier) , (parameter_declaration "undefined4 param_3" type_identifier identifier) , (parameter_declaration "undefined4 param_4" type_identifier identifier) , (parameter_declaration "code *param_5" type_identifier (pointer_declarator "*param_5" * identifier)) , (parameter_declaration "code *param_6" type_identifier (pointer_declarator "*param_6" * identifier)) ))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  undefined4 uVar3;\n  int iVar4;\n  undefined1 auStack_d0 [172];\n  int local_24;\n  \n  local_24 = *(int *)PTR___stack_chk_guard_0002f2f0;\n  iVar1 = (*(code *)PTR_malloc_0002f2ac)(0x8048);\n  if (iVar1 == 0) {\n    uVar3 = 1;\n  }\n  else {\n    (*param_5)(auStack_d0);\n    iVar4 = 0;\n    do {\n      while( true ) {\n        if ((*param_1 & 0x10) != 0) goto LAB_00017264;\n        iVar2 = (*(code *)PTR_fread_unlocked_0002f22c)(iVar1 + iVar4,1,0x8000 - iVar4,param_1);\n        iVar4 = iVar4 + iVar2;\n        if (iVar4 != 0x8000) break;\n        sha256_process_block(iVar1,0x8000,auStack_d0);\n        iVar4 = 0;\n      }\n    } while (iVar2 != 0);\n    if ((*param_1 & 0x20) == 0) {\nLAB_00017264:\n      if (iVar4 != 0) {\n        sha256_process_bytes(iVar1,iVar4,auStack_d0);\n      }\n      (*param_6)(auStack_d0,param_3);\n      (*(code *)PTR_free_0002f2f8)(iVar1);\n      uVar3 = 0;\n    }\n    else {\n      (*(code *)PTR_free_0002f2f8)(iVar1);\n      uVar3 = 1;\n    }\n  }\n  if (local_24 != *(int *)PTR___stack_chk_guard_0002f2f0) {\n    (*(code *)PTR___stack_chk_fail_0002f2dc)();\n    uVar3 = FUN_00017188();\n    return uVar3;\n  }\n  return uVar3;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "undefined4 uVar3;" type_identifier identifier ;) (declaration "int iVar4;" primitive_type identifier ;) (declaration "undefined1 auStack_d0 [172];" type_identifier (array_declarator "auStack_d0 [172]" identifier [ number_literal ]) ;) (declaration "int local_24;" primitive_type identifier ;) (expression_statement "local_24 = *(int *)PTR___stack_chk_guard_0002f2f0;" (assignment_expression "local_24 = *(int *)PTR___stack_chk_guard_0002f2f0" identifier = (pointer_expression "*(int *)PTR___stack_chk_guard_0002f2f0" * (cast_expression "(int *)PTR___stack_chk_guard_0002f2f0" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) ;) (expression_statement "iVar1 = (*(code *)PTR_malloc_0002f2ac)(0x8048);" (assignment_expression "iVar1 = (*(code *)PTR_malloc_0002f2ac)(0x8048)" identifier = (call_expression "(*(code *)PTR_malloc_0002f2ac)(0x8048)" (parenthesized_expression "(*(code *)PTR_malloc_0002f2ac)" ( (pointer_expression "*(code *)PTR_malloc_0002f2ac" * (cast_expression "(code *)PTR_malloc_0002f2ac" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(0x8048)" ( number_literal )))) ;) (if_statement "if (iVar1 == 0) {\n    uVar3 = 1;\n  }\n  else {\n    (*param_5)(auStack_d0);\n    iVar4 = 0;\n    do {\n      while( true ) {\n        if ((*param_1 & 0x10) != 0) goto LAB_00017264;\n        iVar2 = (*(code *)PTR_fread_unlocked_0002f22c)(iVar1 + iVar4,1,0x8000 - iVar4,param_1);\n        iVar4 = iVar4 + iVar2;\n        if (iVar4 != 0x8000) break;\n        sha256_process_block(iVar1,0x8000,auStack_d0);\n        iVar4 = 0;\n      }\n    } while (iVar2 != 0);\n    if ((*param_1 & 0x20) == 0) {\nLAB_00017264:\n      if (iVar4 != 0) {\n        sha256_process_bytes(iVar1,iVar4,auStack_d0);\n      }\n      (*param_6)(auStack_d0,param_3);\n      (*(code *)PTR_free_0002f2f8)(iVar1);\n      uVar3 = 0;\n    }\n    else {\n      (*(code *)PTR_free_0002f2f8)(iVar1);\n      uVar3 = 1;\n    }\n  }" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (compound_statement "{\n    uVar3 = 1;\n  }" { (expression_statement "uVar3 = 1;" (assignment_expression "uVar3 = 1" identifier = number_literal) ;) }) (else_clause "else {\n    (*param_5)(auStack_d0);\n    iVar4 = 0;\n    do {\n      while( true ) {\n        if ((*param_1 & 0x10) != 0) goto LAB_00017264;\n        iVar2 = (*(code *)PTR_fread_unlocked_0002f22c)(iVar1 + iVar4,1,0x8000 - iVar4,param_1);\n        iVar4 = iVar4 + iVar2;\n        if (iVar4 != 0x8000) break;\n        sha256_process_block(iVar1,0x8000,auStack_d0);\n        iVar4 = 0;\n      }\n    } while (iVar2 != 0);\n    if ((*param_1 & 0x20) == 0) {\nLAB_00017264:\n      if (iVar4 != 0) {\n        sha256_process_bytes(iVar1,iVar4,auStack_d0);\n      }\n      (*param_6)(auStack_d0,param_3);\n      (*(code *)PTR_free_0002f2f8)(iVar1);\n      uVar3 = 0;\n    }\n    else {\n      (*(code *)PTR_free_0002f2f8)(iVar1);\n      uVar3 = 1;\n    }\n  }" else (compound_statement "{\n    (*param_5)(auStack_d0);\n    iVar4 = 0;\n    do {\n      while( true ) {\n        if ((*param_1 & 0x10) != 0) goto LAB_00017264;\n        iVar2 = (*(code *)PTR_fread_unlocked_0002f22c)(iVar1 + iVar4,1,0x8000 - iVar4,param_1);\n        iVar4 = iVar4 + iVar2;\n        if (iVar4 != 0x8000) break;\n        sha256_process_block(iVar1,0x8000,auStack_d0);\n        iVar4 = 0;\n      }\n    } while (iVar2 != 0);\n    if ((*param_1 & 0x20) == 0) {\nLAB_00017264:\n      if (iVar4 != 0) {\n        sha256_process_bytes(iVar1,iVar4,auStack_d0);\n      }\n      (*param_6)(auStack_d0,param_3);\n      (*(code *)PTR_free_0002f2f8)(iVar1);\n      uVar3 = 0;\n    }\n    else {\n      (*(code *)PTR_free_0002f2f8)(iVar1);\n      uVar3 = 1;\n    }\n  }" { (expression_statement "(*param_5)(auStack_d0);" (call_expression "(*param_5)(auStack_d0)" (parenthesized_expression "(*param_5)" ( (pointer_expression "*param_5" * identifier) )) (argument_list "(auStack_d0)" ( identifier ))) ;) (expression_statement "iVar4 = 0;" (assignment_expression "iVar4 = 0" identifier = number_literal) ;) (do_statement "do {\n      while( true ) {\n        if ((*param_1 & 0x10) != 0) goto LAB_00017264;\n        iVar2 = (*(code *)PTR_fread_unlocked_0002f22c)(iVar1 + iVar4,1,0x8000 - iVar4,param_1);\n        iVar4 = iVar4 + iVar2;\n        if (iVar4 != 0x8000) break;\n        sha256_process_block(iVar1,0x8000,auStack_d0);\n        iVar4 = 0;\n      }\n    } while (iVar2 != 0);" do (compound_statement "{\n      while( true ) {\n        if ((*param_1 & 0x10) != 0) goto LAB_00017264;\n        iVar2 = (*(code *)PTR_fread_unlocked_0002f22c)(iVar1 + iVar4,1,0x8000 - iVar4,param_1);\n        iVar4 = iVar4 + iVar2;\n        if (iVar4 != 0x8000) break;\n        sha256_process_block(iVar1,0x8000,auStack_d0);\n        iVar4 = 0;\n      }\n    }" { (while_statement "while( true ) {\n        if ((*param_1 & 0x10) != 0) goto LAB_00017264;\n        iVar2 = (*(code *)PTR_fread_unlocked_0002f22c)(iVar1 + iVar4,1,0x8000 - iVar4,param_1);\n        iVar4 = iVar4 + iVar2;\n        if (iVar4 != 0x8000) break;\n        sha256_process_block(iVar1,0x8000,auStack_d0);\n        iVar4 = 0;\n      }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n        if ((*param_1 & 0x10) != 0) goto LAB_00017264;\n        iVar2 = (*(code *)PTR_fread_unlocked_0002f22c)(iVar1 + iVar4,1,0x8000 - iVar4,param_1);\n        iVar4 = iVar4 + iVar2;\n        if (iVar4 != 0x8000) break;\n        sha256_process_block(iVar1,0x8000,auStack_d0);\n        iVar4 = 0;\n      }" { (if_statement "if ((*param_1 & 0x10) != 0) goto LAB_00017264;" if (parenthesized_expression "((*param_1 & 0x10) != 0)" ( (binary_expression "(*param_1 & 0x10) != 0" (parenthesized_expression "(*param_1 & 0x10)" ( (binary_expression "*param_1 & 0x10" (pointer_expression "*param_1" * identifier) & number_literal) )) != number_literal) )) (goto_statement "goto LAB_00017264;" goto statement_identifier ;)) (expression_statement "iVar2 = (*(code *)PTR_fread_unlocked_0002f22c)(iVar1 + iVar4,1,0x8000 - iVar4,param_1);" (assignment_expression "iVar2 = (*(code *)PTR_fread_unlocked_0002f22c)(iVar1 + iVar4,1,0x8000 - iVar4,param_1)" identifier = (call_expression "(*(code *)PTR_fread_unlocked_0002f22c)(iVar1 + iVar4,1,0x8000 - iVar4,param_1)" (parenthesized_expression "(*(code *)PTR_fread_unlocked_0002f22c)" ( (pointer_expression "*(code *)PTR_fread_unlocked_0002f22c" * (cast_expression "(code *)PTR_fread_unlocked_0002f22c" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar1 + iVar4,1,0x8000 - iVar4,param_1)" ( (binary_expression "iVar1 + iVar4" identifier + identifier) , number_literal , (binary_expression "0x8000 - iVar4" number_literal - identifier) , identifier )))) ;) (expression_statement "iVar4 = iVar4 + iVar2;" (assignment_expression "iVar4 = iVar4 + iVar2" identifier = (binary_expression "iVar4 + iVar2" identifier + identifier)) ;) (if_statement "if (iVar4 != 0x8000) break;" if (parenthesized_expression "(iVar4 != 0x8000)" ( (binary_expression "iVar4 != 0x8000" identifier != number_literal) )) (break_statement "break;" break ;)) (expression_statement "sha256_process_block(iVar1,0x8000,auStack_d0);" (call_expression "sha256_process_block(iVar1,0x8000,auStack_d0)" identifier (argument_list "(iVar1,0x8000,auStack_d0)" ( identifier , number_literal , identifier ))) ;) (expression_statement "iVar4 = 0;" (assignment_expression "iVar4 = 0" identifier = number_literal) ;) })) }) while (parenthesized_expression "(iVar2 != 0)" ( (binary_expression "iVar2 != 0" identifier != number_literal) )) ;) (if_statement "if ((*param_1 & 0x20) == 0) {\nLAB_00017264:\n      if (iVar4 != 0) {\n        sha256_process_bytes(iVar1,iVar4,auStack_d0);\n      }\n      (*param_6)(auStack_d0,param_3);\n      (*(code *)PTR_free_0002f2f8)(iVar1);\n      uVar3 = 0;\n    }\n    else {\n      (*(code *)PTR_free_0002f2f8)(iVar1);\n      uVar3 = 1;\n    }" if (parenthesized_expression "((*param_1 & 0x20) == 0)" ( (binary_expression "(*param_1 & 0x20) == 0" (parenthesized_expression "(*param_1 & 0x20)" ( (binary_expression "*param_1 & 0x20" (pointer_expression "*param_1" * identifier) & number_literal) )) == number_literal) )) (compound_statement "{\nLAB_00017264:\n      if (iVar4 != 0) {\n        sha256_process_bytes(iVar1,iVar4,auStack_d0);\n      }\n      (*param_6)(auStack_d0,param_3);\n      (*(code *)PTR_free_0002f2f8)(iVar1);\n      uVar3 = 0;\n    }" { (labeled_statement "LAB_00017264:\n      if (iVar4 != 0) {\n        sha256_process_bytes(iVar1,iVar4,auStack_d0);\n      }" statement_identifier : (if_statement "if (iVar4 != 0) {\n        sha256_process_bytes(iVar1,iVar4,auStack_d0);\n      }" if (parenthesized_expression "(iVar4 != 0)" ( (binary_expression "iVar4 != 0" identifier != number_literal) )) (compound_statement "{\n        sha256_process_bytes(iVar1,iVar4,auStack_d0);\n      }" { (expression_statement "sha256_process_bytes(iVar1,iVar4,auStack_d0);" (call_expression "sha256_process_bytes(iVar1,iVar4,auStack_d0)" identifier (argument_list "(iVar1,iVar4,auStack_d0)" ( identifier , identifier , identifier ))) ;) }))) (expression_statement "(*param_6)(auStack_d0,param_3);" (call_expression "(*param_6)(auStack_d0,param_3)" (parenthesized_expression "(*param_6)" ( (pointer_expression "*param_6" * identifier) )) (argument_list "(auStack_d0,param_3)" ( identifier , identifier ))) ;) (expression_statement "(*(code *)PTR_free_0002f2f8)(iVar1);" (call_expression "(*(code *)PTR_free_0002f2f8)(iVar1)" (parenthesized_expression "(*(code *)PTR_free_0002f2f8)" ( (pointer_expression "*(code *)PTR_free_0002f2f8" * (cast_expression "(code *)PTR_free_0002f2f8" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar1)" ( identifier ))) ;) (expression_statement "uVar3 = 0;" (assignment_expression "uVar3 = 0" identifier = number_literal) ;) }) (else_clause "else {\n      (*(code *)PTR_free_0002f2f8)(iVar1);\n      uVar3 = 1;\n    }" else (compound_statement "{\n      (*(code *)PTR_free_0002f2f8)(iVar1);\n      uVar3 = 1;\n    }" { (expression_statement "(*(code *)PTR_free_0002f2f8)(iVar1);" (call_expression "(*(code *)PTR_free_0002f2f8)(iVar1)" (parenthesized_expression "(*(code *)PTR_free_0002f2f8)" ( (pointer_expression "*(code *)PTR_free_0002f2f8" * (cast_expression "(code *)PTR_free_0002f2f8" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar1)" ( identifier ))) ;) (expression_statement "uVar3 = 1;" (assignment_expression "uVar3 = 1" identifier = number_literal) ;) }))) }))) (if_statement "if (local_24 != *(int *)PTR___stack_chk_guard_0002f2f0) {\n    (*(code *)PTR___stack_chk_fail_0002f2dc)();\n    uVar3 = FUN_00017188();\n    return uVar3;\n  }" if (parenthesized_expression "(local_24 != *(int *)PTR___stack_chk_guard_0002f2f0)" ( (binary_expression "local_24 != *(int *)PTR___stack_chk_guard_0002f2f0" identifier != (pointer_expression "*(int *)PTR___stack_chk_guard_0002f2f0" * (cast_expression "(int *)PTR___stack_chk_guard_0002f2f0" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) )) (compound_statement "{\n    (*(code *)PTR___stack_chk_fail_0002f2dc)();\n    uVar3 = FUN_00017188();\n    return uVar3;\n  }" { (expression_statement "(*(code *)PTR___stack_chk_fail_0002f2dc)();" (call_expression "(*(code *)PTR___stack_chk_fail_0002f2dc)()" (parenthesized_expression "(*(code *)PTR___stack_chk_fail_0002f2dc)" ( (pointer_expression "*(code *)PTR___stack_chk_fail_0002f2dc" * (cast_expression "(code *)PTR___stack_chk_fail_0002f2dc" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))) ;) (expression_statement "uVar3 = FUN_00017188();" (assignment_expression "uVar3 = FUN_00017188()" identifier = (call_expression "FUN_00017188()" identifier (argument_list "()" ( )))) ;) (return_statement "return uVar3;" return identifier ;) })) (return_statement "return uVar3;" return identifier ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE (pointer_declarator * IDENT)) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (array_declarator IDENT [ LIT ]) ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT))) ;) (expression_statement (assignment_expression IDENT = (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( LIT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) }) (else_clause else (compound_statement { (expression_statement (call_expression (parenthesized_expression ( (pointer_expression * IDENT) )) (argument_list ( IDENT ))) ;) (expression_statement (assignment_expression IDENT = LIT) ;) (do_statement do (compound_statement { (while_statement while (parenthesized_expression ( BOOL )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) & LIT) )) != LIT) )) (goto_statement goto statement_identifier ;)) (expression_statement (assignment_expression IDENT = (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) 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 ;)) (expression_statement (call_expression IDENT (argument_list ( IDENT , LIT , IDENT ))) ;) (expression_statement (assignment_expression IDENT = LIT) ;) })) }) while (parenthesized_expression ( (binary_expression IDENT != LIT) )) ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) & 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 (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( IDENT ))) ;) (expression_statement (assignment_expression IDENT = LIT) ;) }) (else_clause else (compound_statement { (expression_statement (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( IDENT ))) ;) (expression_statement (assignment_expression IDENT = LIT) ;) }))) }))) (if_statement if (parenthesized_expression ( (binary_expression IDENT != (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT))) )) (compound_statement { (expression_statement (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( ))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( )))) ;) (return_statement return IDENT ;) })) (return_statement return IDENT ;) })))
(function_definition "undefined4\nFUN_00017188(uint *param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4,code *param_5,\n            code *param_6)\n\n{\n  int iVar1;\n  int iVar2;\n  undefined4 uVar3;\n  int iVar4;\n  undefined1 auStack_d0 [172];\n  int local_24;\n  \n  local_24 = *(int *)PTR___stack_chk_guard_0002f2f0;\n  iVar1 = (*(code *)PTR_malloc_0002f2ac)(0x8048);\n  if (iVar1 == 0) {\n    uVar3 = 1;\n  }\n  else {\n    (*param_5)(auStack_d0);\n    iVar4 = 0;\n    do {\n      while( true ) {\n        if ((*param_1 & 0x10) != 0) goto LAB_00017264;\n        iVar2 = (*(code *)PTR_fread_unlocked_0002f22c)(iVar1 + iVar4,1,0x8000 - iVar4,param_1);\n        iVar4 = iVar4 + iVar2;\n        if (iVar4 != 0x8000) break;\n        sha256_process_block(iVar1,0x8000,auStack_d0);\n        iVar4 = 0;\n      }\n    } while (iVar2 != 0);\n    if ((*param_1 & 0x20) == 0) {\nLAB_00017264:\n      if (iVar4 != 0) {\n        sha256_process_bytes(iVar1,iVar4,auStack_d0);\n      }\n      (*param_6)(auStack_d0,param_3);\n      (*(code *)PTR_free_0002f2f8)(iVar1);\n      uVar3 = 0;\n    }\n    else {\n      (*(code *)PTR_free_0002f2f8)(iVar1);\n      uVar3 = 1;\n    }\n  }\n  if (local_24 != *(int *)PTR___stack_chk_guard_0002f2f0) {\n    (*(code *)PTR___stack_chk_fail_0002f2dc)();\n    uVar3 = FUN_00017188();\n    return uVar3;\n  }\n  return uVar3;\n}" (type_identifier "undefined4") (function_declarator "FUN_00017188(uint *param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4,code *param_5,\n            code *param_6)" (identifier "FUN_00017188") (parameter_list "(uint *param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4,code *param_5,\n            code *param_6)" (( "(") (parameter_declaration "uint *param_1" (type_identifier "uint") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "undefined4 param_2" (type_identifier "undefined4") (identifier "param_2")) (, ",") (parameter_declaration "undefined4 param_3" (type_identifier "undefined4") (identifier "param_3")) (, ",") (parameter_declaration "undefined4 param_4" (type_identifier "undefined4") (identifier "param_4")) (, ",") (parameter_declaration "code *param_5" (type_identifier "code") (pointer_declarator "*param_5" (* "*") (identifier "param_5"))) (, ",") (parameter_declaration "code *param_6" (type_identifier "code") (pointer_declarator "*param_6" (* "*") (identifier "param_6"))) () ")"))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  undefined4 uVar3;\n  int iVar4;\n  undefined1 auStack_d0 [172];\n  int local_24;\n  \n  local_24 = *(int *)PTR___stack_chk_guard_0002f2f0;\n  iVar1 = (*(code *)PTR_malloc_0002f2ac)(0x8048);\n  if (iVar1 == 0) {\n    uVar3 = 1;\n  }\n  else {\n    (*param_5)(auStack_d0);\n    iVar4 = 0;\n    do {\n      while( true ) {\n        if ((*param_1 & 0x10) != 0) goto LAB_00017264;\n        iVar2 = (*(code *)PTR_fread_unlocked_0002f22c)(iVar1 + iVar4,1,0x8000 - iVar4,param_1);\n        iVar4 = iVar4 + iVar2;\n        if (iVar4 != 0x8000) break;\n        sha256_process_block(iVar1,0x8000,auStack_d0);\n        iVar4 = 0;\n      }\n    } while (iVar2 != 0);\n    if ((*param_1 & 0x20) == 0) {\nLAB_00017264:\n      if (iVar4 != 0) {\n        sha256_process_bytes(iVar1,iVar4,auStack_d0);\n      }\n      (*param_6)(auStack_d0,param_3);\n      (*(code *)PTR_free_0002f2f8)(iVar1);\n      uVar3 = 0;\n    }\n    else {\n      (*(code *)PTR_free_0002f2f8)(iVar1);\n      uVar3 = 1;\n    }\n  }\n  if (local_24 != *(int *)PTR___stack_chk_guard_0002f2f0) {\n    (*(code *)PTR___stack_chk_fail_0002f2dc)();\n    uVar3 = FUN_00017188();\n    return uVar3;\n  }\n  return uVar3;\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (declaration "undefined4 uVar3;" (type_identifier "undefined4") (identifier "uVar3") (; ";")) (declaration "int iVar4;" (primitive_type "int") (identifier "iVar4") (; ";")) (declaration "undefined1 auStack_d0 [172];" (type_identifier "undefined1") (array_declarator "auStack_d0 [172]" (identifier "auStack_d0") ([ "[") (number_literal "172") (] "]")) (; ";")) (declaration "int local_24;" (primitive_type "int") (identifier "local_24") (; ";")) (expression_statement "local_24 = *(int *)PTR___stack_chk_guard_0002f2f0;" (assignment_expression "local_24 = *(int *)PTR___stack_chk_guard_0002f2f0" (identifier "local_24") (= "=") (pointer_expression "*(int *)PTR___stack_chk_guard_0002f2f0" (* "*") (cast_expression "(int *)PTR___stack_chk_guard_0002f2f0" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR___stack_chk_guard_0002f2f0")))) (; ";")) (expression_statement "iVar1 = (*(code *)PTR_malloc_0002f2ac)(0x8048);" (assignment_expression "iVar1 = (*(code *)PTR_malloc_0002f2ac)(0x8048)" (identifier "iVar1") (= "=") (call_expression "(*(code *)PTR_malloc_0002f2ac)(0x8048)" (parenthesized_expression "(*(code *)PTR_malloc_0002f2ac)" (( "(") (pointer_expression "*(code *)PTR_malloc_0002f2ac" (* "*") (cast_expression "(code *)PTR_malloc_0002f2ac" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_malloc_0002f2ac"))) () ")")) (argument_list "(0x8048)" (( "(") (number_literal "0x8048") () ")")))) (; ";")) (if_statement "if (iVar1 == 0) {\n    uVar3 = 1;\n  }\n  else {\n    (*param_5)(auStack_d0);\n    iVar4 = 0;\n    do {\n      while( true ) {\n        if ((*param_1 & 0x10) != 0) goto LAB_00017264;\n        iVar2 = (*(code *)PTR_fread_unlocked_0002f22c)(iVar1 + iVar4,1,0x8000 - iVar4,param_1);\n        iVar4 = iVar4 + iVar2;\n        if (iVar4 != 0x8000) break;\n        sha256_process_block(iVar1,0x8000,auStack_d0);\n        iVar4 = 0;\n      }\n    } while (iVar2 != 0);\n    if ((*param_1 & 0x20) == 0) {\nLAB_00017264:\n      if (iVar4 != 0) {\n        sha256_process_bytes(iVar1,iVar4,auStack_d0);\n      }\n      (*param_6)(auStack_d0,param_3);\n      (*(code *)PTR_free_0002f2f8)(iVar1);\n      uVar3 = 0;\n    }\n    else {\n      (*(code *)PTR_free_0002f2f8)(iVar1);\n      uVar3 = 1;\n    }\n  }" (if "if") (parenthesized_expression "(iVar1 == 0)" (( "(") (binary_expression "iVar1 == 0" (identifier "iVar1") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n    uVar3 = 1;\n  }" ({ "{") (expression_statement "uVar3 = 1;" (assignment_expression "uVar3 = 1" (identifier "uVar3") (= "=") (number_literal "1")) (; ";")) (} "}")) (else_clause "else {\n    (*param_5)(auStack_d0);\n    iVar4 = 0;\n    do {\n      while( true ) {\n        if ((*param_1 & 0x10) != 0) goto LAB_00017264;\n        iVar2 = (*(code *)PTR_fread_unlocked_0002f22c)(iVar1 + iVar4,1,0x8000 - iVar4,param_1);\n        iVar4 = iVar4 + iVar2;\n        if (iVar4 != 0x8000) break;\n        sha256_process_block(iVar1,0x8000,auStack_d0);\n        iVar4 = 0;\n      }\n    } while (iVar2 != 0);\n    if ((*param_1 & 0x20) == 0) {\nLAB_00017264:\n      if (iVar4 != 0) {\n        sha256_process_bytes(iVar1,iVar4,auStack_d0);\n      }\n      (*param_6)(auStack_d0,param_3);\n      (*(code *)PTR_free_0002f2f8)(iVar1);\n      uVar3 = 0;\n    }\n    else {\n      (*(code *)PTR_free_0002f2f8)(iVar1);\n      uVar3 = 1;\n    }\n  }" (else "else") (compound_statement "{\n    (*param_5)(auStack_d0);\n    iVar4 = 0;\n    do {\n      while( true ) {\n        if ((*param_1 & 0x10) != 0) goto LAB_00017264;\n        iVar2 = (*(code *)PTR_fread_unlocked_0002f22c)(iVar1 + iVar4,1,0x8000 - iVar4,param_1);\n        iVar4 = iVar4 + iVar2;\n        if (iVar4 != 0x8000) break;\n        sha256_process_block(iVar1,0x8000,auStack_d0);\n        iVar4 = 0;\n      }\n    } while (iVar2 != 0);\n    if ((*param_1 & 0x20) == 0) {\nLAB_00017264:\n      if (iVar4 != 0) {\n        sha256_process_bytes(iVar1,iVar4,auStack_d0);\n      }\n      (*param_6)(auStack_d0,param_3);\n      (*(code *)PTR_free_0002f2f8)(iVar1);\n      uVar3 = 0;\n    }\n    else {\n      (*(code *)PTR_free_0002f2f8)(iVar1);\n      uVar3 = 1;\n    }\n  }" ({ "{") (expression_statement "(*param_5)(auStack_d0);" (call_expression "(*param_5)(auStack_d0)" (parenthesized_expression "(*param_5)" (( "(") (pointer_expression "*param_5" (* "*") (identifier "param_5")) () ")")) (argument_list "(auStack_d0)" (( "(") (identifier "auStack_d0") () ")"))) (; ";")) (expression_statement "iVar4 = 0;" (assignment_expression "iVar4 = 0" (identifier "iVar4") (= "=") (number_literal "0")) (; ";")) (do_statement "do {\n      while( true ) {\n        if ((*param_1 & 0x10) != 0) goto LAB_00017264;\n        iVar2 = (*(code *)PTR_fread_unlocked_0002f22c)(iVar1 + iVar4,1,0x8000 - iVar4,param_1);\n        iVar4 = iVar4 + iVar2;\n        if (iVar4 != 0x8000) break;\n        sha256_process_block(iVar1,0x8000,auStack_d0);\n        iVar4 = 0;\n      }\n    } while (iVar2 != 0);" (do "do") (compound_statement "{\n      while( true ) {\n        if ((*param_1 & 0x10) != 0) goto LAB_00017264;\n        iVar2 = (*(code *)PTR_fread_unlocked_0002f22c)(iVar1 + iVar4,1,0x8000 - iVar4,param_1);\n        iVar4 = iVar4 + iVar2;\n        if (iVar4 != 0x8000) break;\n        sha256_process_block(iVar1,0x8000,auStack_d0);\n        iVar4 = 0;\n      }\n    }" ({ "{") (while_statement "while( true ) {\n        if ((*param_1 & 0x10) != 0) goto LAB_00017264;\n        iVar2 = (*(code *)PTR_fread_unlocked_0002f22c)(iVar1 + iVar4,1,0x8000 - iVar4,param_1);\n        iVar4 = iVar4 + iVar2;\n        if (iVar4 != 0x8000) break;\n        sha256_process_block(iVar1,0x8000,auStack_d0);\n        iVar4 = 0;\n      }" (while "while") (parenthesized_expression "( true )" (( "(") (true "true") () ")")) (compound_statement "{\n        if ((*param_1 & 0x10) != 0) goto LAB_00017264;\n        iVar2 = (*(code *)PTR_fread_unlocked_0002f22c)(iVar1 + iVar4,1,0x8000 - iVar4,param_1);\n        iVar4 = iVar4 + iVar2;\n        if (iVar4 != 0x8000) break;\n        sha256_process_block(iVar1,0x8000,auStack_d0);\n        iVar4 = 0;\n      }" ({ "{") (if_statement "if ((*param_1 & 0x10) != 0) goto LAB_00017264;" (if "if") (parenthesized_expression "((*param_1 & 0x10) != 0)" (( "(") (binary_expression "(*param_1 & 0x10) != 0" (parenthesized_expression "(*param_1 & 0x10)" (( "(") (binary_expression "*param_1 & 0x10" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (& "&") (number_literal "0x10")) () ")")) (!= "!=") (number_literal "0")) () ")")) (goto_statement "goto LAB_00017264;" (goto "goto") (statement_identifier "LAB_00017264") (; ";"))) (expression_statement "iVar2 = (*(code *)PTR_fread_unlocked_0002f22c)(iVar1 + iVar4,1,0x8000 - iVar4,param_1);" (assignment_expression "iVar2 = (*(code *)PTR_fread_unlocked_0002f22c)(iVar1 + iVar4,1,0x8000 - iVar4,param_1)" (identifier "iVar2") (= "=") (call_expression "(*(code *)PTR_fread_unlocked_0002f22c)(iVar1 + iVar4,1,0x8000 - iVar4,param_1)" (parenthesized_expression "(*(code *)PTR_fread_unlocked_0002f22c)" (( "(") (pointer_expression "*(code *)PTR_fread_unlocked_0002f22c" (* "*") (cast_expression "(code *)PTR_fread_unlocked_0002f22c" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_fread_unlocked_0002f22c"))) () ")")) (argument_list "(iVar1 + iVar4,1,0x8000 - iVar4,param_1)" (( "(") (binary_expression "iVar1 + iVar4" (identifier "iVar1") (+ "+") (identifier "iVar4")) (, ",") (number_literal "1") (, ",") (binary_expression "0x8000 - iVar4" (number_literal "0x8000") (- "-") (identifier "iVar4")) (, ",") (identifier "param_1") () ")")))) (; ";")) (expression_statement "iVar4 = iVar4 + iVar2;" (assignment_expression "iVar4 = iVar4 + iVar2" (identifier "iVar4") (= "=") (binary_expression "iVar4 + iVar2" (identifier "iVar4") (+ "+") (identifier "iVar2"))) (; ";")) (if_statement "if (iVar4 != 0x8000) break;" (if "if") (parenthesized_expression "(iVar4 != 0x8000)" (( "(") (binary_expression "iVar4 != 0x8000" (identifier "iVar4") (!= "!=") (number_literal "0x8000")) () ")")) (break_statement "break;" (break "break") (; ";"))) (expression_statement "sha256_process_block(iVar1,0x8000,auStack_d0);" (call_expression "sha256_process_block(iVar1,0x8000,auStack_d0)" (identifier "sha256_process_block") (argument_list "(iVar1,0x8000,auStack_d0)" (( "(") (identifier "iVar1") (, ",") (number_literal "0x8000") (, ",") (identifier "auStack_d0") () ")"))) (; ";")) (expression_statement "iVar4 = 0;" (assignment_expression "iVar4 = 0" (identifier "iVar4") (= "=") (number_literal "0")) (; ";")) (} "}"))) (} "}")) (while "while") (parenthesized_expression "(iVar2 != 0)" (( "(") (binary_expression "iVar2 != 0" (identifier "iVar2") (!= "!=") (number_literal "0")) () ")")) (; ";")) (if_statement "if ((*param_1 & 0x20) == 0) {\nLAB_00017264:\n      if (iVar4 != 0) {\n        sha256_process_bytes(iVar1,iVar4,auStack_d0);\n      }\n      (*param_6)(auStack_d0,param_3);\n      (*(code *)PTR_free_0002f2f8)(iVar1);\n      uVar3 = 0;\n    }\n    else {\n      (*(code *)PTR_free_0002f2f8)(iVar1);\n      uVar3 = 1;\n    }" (if "if") (parenthesized_expression "((*param_1 & 0x20) == 0)" (( "(") (binary_expression "(*param_1 & 0x20) == 0" (parenthesized_expression "(*param_1 & 0x20)" (( "(") (binary_expression "*param_1 & 0x20" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (& "&") (number_literal "0x20")) () ")")) (== "==") (number_literal "0")) () ")")) (compound_statement "{\nLAB_00017264:\n      if (iVar4 != 0) {\n        sha256_process_bytes(iVar1,iVar4,auStack_d0);\n      }\n      (*param_6)(auStack_d0,param_3);\n      (*(code *)PTR_free_0002f2f8)(iVar1);\n      uVar3 = 0;\n    }" ({ "{") (labeled_statement "LAB_00017264:\n      if (iVar4 != 0) {\n        sha256_process_bytes(iVar1,iVar4,auStack_d0);\n      }" (statement_identifier "LAB_00017264") (: ":") (if_statement "if (iVar4 != 0) {\n        sha256_process_bytes(iVar1,iVar4,auStack_d0);\n      }" (if "if") (parenthesized_expression "(iVar4 != 0)" (( "(") (binary_expression "iVar4 != 0" (identifier "iVar4") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n        sha256_process_bytes(iVar1,iVar4,auStack_d0);\n      }" ({ "{") (expression_statement "sha256_process_bytes(iVar1,iVar4,auStack_d0);" (call_expression "sha256_process_bytes(iVar1,iVar4,auStack_d0)" (identifier "sha256_process_bytes") (argument_list "(iVar1,iVar4,auStack_d0)" (( "(") (identifier "iVar1") (, ",") (identifier "iVar4") (, ",") (identifier "auStack_d0") () ")"))) (; ";")) (} "}")))) (expression_statement "(*param_6)(auStack_d0,param_3);" (call_expression "(*param_6)(auStack_d0,param_3)" (parenthesized_expression "(*param_6)" (( "(") (pointer_expression "*param_6" (* "*") (identifier "param_6")) () ")")) (argument_list "(auStack_d0,param_3)" (( "(") (identifier "auStack_d0") (, ",") (identifier "param_3") () ")"))) (; ";")) (expression_statement "(*(code *)PTR_free_0002f2f8)(iVar1);" (call_expression "(*(code *)PTR_free_0002f2f8)(iVar1)" (parenthesized_expression "(*(code *)PTR_free_0002f2f8)" (( "(") (pointer_expression "*(code *)PTR_free_0002f2f8" (* "*") (cast_expression "(code *)PTR_free_0002f2f8" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_free_0002f2f8"))) () ")")) (argument_list "(iVar1)" (( "(") (identifier "iVar1") () ")"))) (; ";")) (expression_statement "uVar3 = 0;" (assignment_expression "uVar3 = 0" (identifier "uVar3") (= "=") (number_literal "0")) (; ";")) (} "}")) (else_clause "else {\n      (*(code *)PTR_free_0002f2f8)(iVar1);\n      uVar3 = 1;\n    }" (else "else") (compound_statement "{\n      (*(code *)PTR_free_0002f2f8)(iVar1);\n      uVar3 = 1;\n    }" ({ "{") (expression_statement "(*(code *)PTR_free_0002f2f8)(iVar1);" (call_expression "(*(code *)PTR_free_0002f2f8)(iVar1)" (parenthesized_expression "(*(code *)PTR_free_0002f2f8)" (( "(") (pointer_expression "*(code *)PTR_free_0002f2f8" (* "*") (cast_expression "(code *)PTR_free_0002f2f8" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_free_0002f2f8"))) () ")")) (argument_list "(iVar1)" (( "(") (identifier "iVar1") () ")"))) (; ";")) (expression_statement "uVar3 = 1;" (assignment_expression "uVar3 = 1" (identifier "uVar3") (= "=") (number_literal "1")) (; ";")) (} "}")))) (} "}")))) (if_statement "if (local_24 != *(int *)PTR___stack_chk_guard_0002f2f0) {\n    (*(code *)PTR___stack_chk_fail_0002f2dc)();\n    uVar3 = FUN_00017188();\n    return uVar3;\n  }" (if "if") (parenthesized_expression "(local_24 != *(int *)PTR___stack_chk_guard_0002f2f0)" (( "(") (binary_expression "local_24 != *(int *)PTR___stack_chk_guard_0002f2f0" (identifier "local_24") (!= "!=") (pointer_expression "*(int *)PTR___stack_chk_guard_0002f2f0" (* "*") (cast_expression "(int *)PTR___stack_chk_guard_0002f2f0" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR___stack_chk_guard_0002f2f0")))) () ")")) (compound_statement "{\n    (*(code *)PTR___stack_chk_fail_0002f2dc)();\n    uVar3 = FUN_00017188();\n    return uVar3;\n  }" ({ "{") (expression_statement "(*(code *)PTR___stack_chk_fail_0002f2dc)();" (call_expression "(*(code *)PTR___stack_chk_fail_0002f2dc)()" (parenthesized_expression "(*(code *)PTR___stack_chk_fail_0002f2dc)" (( "(") (pointer_expression "*(code *)PTR___stack_chk_fail_0002f2dc" (* "*") (cast_expression "(code *)PTR___stack_chk_fail_0002f2dc" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR___stack_chk_fail_0002f2dc"))) () ")")) (argument_list "()" (( "(") () ")"))) (; ";")) (expression_statement "uVar3 = FUN_00017188();" (assignment_expression "uVar3 = FUN_00017188()" (identifier "uVar3") (= "=") (call_expression "FUN_00017188()" (identifier "FUN_00017188") (argument_list "()" (( "(") () ")")))) (; ";")) (return_statement "return uVar3;" (return "return") (identifier "uVar3") (; ";")) (} "}"))) (return_statement "return uVar3;" (return "return") (identifier "uVar3") (; ";")) (} "}")))
(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)) (parameter_declaration type: (type_identifier) 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: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (type_identifier) 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)) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (parenthesized_expression (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (identifier)))) arguments: (argument_list (number_literal))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (number_literal)))) alternative: (else_clause (compound_statement (expression_statement (call_expression function: (parenthesized_expression (pointer_expression argument: (identifier))) arguments: (argument_list (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (do_statement body: (compound_statement (while_statement condition: (parenthesized_expression (true)) body: (compound_statement (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (pointer_expression argument: (identifier)) right: (number_literal))) right: (number_literal))) consequence: (goto_statement label: (statement_identifier))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (parenthesized_expression (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (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)) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier) (number_literal) (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (number_literal)))))) condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal)))) (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (pointer_expression argument: (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: (parenthesized_expression (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (identifier)))) arguments: (argument_list (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (number_literal)))) alternative: (else_clause (compound_statement (expression_statement (call_expression function: (parenthesized_expression (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (identifier)))) arguments: (argument_list (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (number_literal))))))))) (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: (identifier))))) consequence: (compound_statement (expression_statement (call_expression function: (parenthesized_expression (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (identifier)))) arguments: (argument_list))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list)))) (return_statement (identifier)))) (return_statement (identifier)))))

undefined4
MASKED(uint *param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4,code *param_5,
            code *param_6)

{
  int iVar1;
  int iVar2;
  undefined4 uVar3;
  int iVar4;
  undefined1 auStack_d0 [172];
  int local_24;
  
  local_24 = *(int *)PTR___stack_chk_guard_0002f2f0;
  iVar1 = (*(code *)PTR_malloc_0002f2ac)(0x8048);
  if (iVar1 == 0) {
    uVar3 = 1;
  }
  else {
    (*param_5)(auStack_d0);
    iVar4 = 0;
    do {
      while( true ) {
        if ((*param_1 & 0x10) != 0) goto LAB_00017264;
        iVar2 = (*(code *)PTR_fread_unlocked_0002f22c)(iVar1 + iVar4,1,0x8000 - iVar4,param_1);
        iVar4 = iVar4 + iVar2;
        if (iVar4 != 0x8000) break;
        sha256_process_block(iVar1,0x8000,auStack_d0);
        iVar4 = 0;
      }
    } while (iVar2 != 0);
    if ((*param_1 & 0x20) == 0) {
LAB_00017264:
      if (iVar4 != 0) {
        sha256_process_bytes(iVar1,iVar4,auStack_d0);
      }
      (*param_6)(auStack_d0,param_3);
      (*(code *)PTR_free_0002f2f8)(iVar1);
      uVar3 = 0;
    }
    else {
      (*(code *)PTR_free_0002f2f8)(iVar1);
      uVar3 = 1;
    }
  }
  if (local_24 != *(int *)PTR___stack_chk_guard_0002f2f0) {
    (*(code *)PTR___stack_chk_fail_0002f2dc)();
    uVar3 = MASKED();
    return uVar3;
  }
  return uVar3;
}

