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

int __regparm3 gz_load(gz_statep state,uchar *buf,uint len,uint *have)

{
  uint uVar1;
  ssize_t sVar2;
  int *piVar3;
  char *msg;
  int iVar4;
  size_t __nbytes;
  
  uVar1 = 0;
  *have = 0;
  while( true ) {
    __nbytes = len - uVar1;
    if (0x40000000 < __nbytes) {
      __nbytes = 0x40000000;
    }
    sVar2 = read(state->fd,buf + uVar1,__nbytes);
    if (sVar2 < 1) break;
    uVar1 = sVar2 + *have;
    *have = uVar1;
    if (len <= uVar1) {
      return 0;
    }
  }
  if (sVar2 == 0) {
    state->eof = 1;
    iVar4 = 0;
  }
  else {
    piVar3 = __errno_location();
    msg = strerror(*piVar3);
    gz_error(state,-1,msg);
    iVar4 = -1;
  }
  return iVar4;
}



undefined4 __regparm3 FUN_0001d330(undefined4 param_1,int param_2,uint param_3)

{
  uint uVar1;
  ssize_t sVar2;
  int *piVar3;
  char *pcVar4;
  undefined4 uVar5;
  size_t __nbytes;
  int extraout_EDI;
  uint *unaff_retaddr;
  
  entry(param_2,0x1d33d);
  uVar1 = 0;
  *unaff_retaddr = 0;
  while( true ) {
    __nbytes = param_3 - uVar1;
    if (0x40000000 < __nbytes) {
      __nbytes = 0x40000000;
    }
    sVar2 = read(*(int *)(extraout_EDI + 0x14),(void *)(uVar1 + param_2),__nbytes);
    if (sVar2 < 1) break;
    uVar1 = sVar2 + *unaff_retaddr;
    *unaff_retaddr = uVar1;
    if (param_3 <= uVar1) {
      return 0;
    }
  }
  if (sVar2 == 0) {
    *(undefined4 *)(extraout_EDI + 0x3c) = 1;
    uVar5 = 0;
  }
  else {
    piVar3 = __errno_location();
    pcVar4 = strerror(*piVar3);
    FUN_0001cae0(extraout_EDI,0xffffffff,pcVar4);
    uVar5 = 0xffffffff;
  }
  return uVar5;
}


PUSH EBP
PUSH EDI
MOV EBP,ECX
PUSH ESI
PUSH EBX
MOV EDI,EAX
CALL 0x00011aa0
ADD EBX,0xacc3
SUB ESP,0x1c
XOR EAX,EAX
MOV ESI,dword ptr [ESP + 0x30]
MOV dword ptr [ESP + 0xc],EDX
MOV dword ptr [ESI],0x0
JMP 0x0001d368
ADD EAX,dword ptr [ESI]
CMP EAX,EBP
MOV dword ptr [ESI],EAX
JNC 0x0001d3a8
MOV EDX,EBP
SUB ESP,0x4
MOV ECX,0x40000000
SUB EDX,EAX
CMP EDX,0x40000000
CMOVA EDX,ECX
PUSH EDX
ADD EAX,dword ptr [ESP + 0x14]
PUSH EAX
PUSH dword ptr [EDI + 0x14]
CALL 0x00011800
ADD ESP,0x10
CMP EAX,0x0
JG 0x0001d360
JNZ 0x0001d3b2
MOV dword ptr [EDI + 0x3c],0x1
ADD ESP,0x1c
POP EBX
POP ESI
POP EDI
POP EBP
RET
ADD ESP,0x1c
XOR EAX,EAX
POP EBX
POP ESI
POP EDI
POP EBP
RET
CALL 0x00011990
SUB ESP,0xc
PUSH dword ptr [EAX]
CALL 0x00011900
ADD ESP,0xc
PUSH EAX
PUSH -0x1
PUSH EDI
CALL 0x0001cae0
ADD ESP,0x10
MOV EAX,0xffffffff
JMP 0x0001d39c
(translation_unit "undefined4 __regparm3 FUN_0001d330(undefined4 param_1,int param_2,uint param_3)\n\n{\n  uint uVar1;\n  ssize_t sVar2;\n  int *piVar3;\n  char *pcVar4;\n  undefined4 uVar5;\n  size_t __nbytes;\n  int extraout_EDI;\n  uint *unaff_retaddr;\n  \n  entry(param_2,0x1d33d);\n  uVar1 = 0;\n  *unaff_retaddr = 0;\n  while( true ) {\n    __nbytes = param_3 - uVar1;\n    if (0x40000000 < __nbytes) {\n      __nbytes = 0x40000000;\n    }\n    sVar2 = read(*(int *)(extraout_EDI + 0x14),(void *)(uVar1 + param_2),__nbytes);\n    if (sVar2 < 1) break;\n    uVar1 = sVar2 + *unaff_retaddr;\n    *unaff_retaddr = uVar1;\n    if (param_3 <= uVar1) {\n      return 0;\n    }\n  }\n  if (sVar2 == 0) {\n    *(undefined4 *)(extraout_EDI + 0x3c) = 1;\n    uVar5 = 0;\n  }\n  else {\n    piVar3 = __errno_location();\n    pcVar4 = strerror(*piVar3);\n    FUN_0001cae0(extraout_EDI,0xffffffff,pcVar4);\n    uVar5 = 0xffffffff;\n  }\n  return uVar5;\n}\n\n" (function_definition "undefined4 __regparm3 FUN_0001d330(undefined4 param_1,int param_2,uint param_3)\n\n{\n  uint uVar1;\n  ssize_t sVar2;\n  int *piVar3;\n  char *pcVar4;\n  undefined4 uVar5;\n  size_t __nbytes;\n  int extraout_EDI;\n  uint *unaff_retaddr;\n  \n  entry(param_2,0x1d33d);\n  uVar1 = 0;\n  *unaff_retaddr = 0;\n  while( true ) {\n    __nbytes = param_3 - uVar1;\n    if (0x40000000 < __nbytes) {\n      __nbytes = 0x40000000;\n    }\n    sVar2 = read(*(int *)(extraout_EDI + 0x14),(void *)(uVar1 + param_2),__nbytes);\n    if (sVar2 < 1) break;\n    uVar1 = sVar2 + *unaff_retaddr;\n    *unaff_retaddr = uVar1;\n    if (param_3 <= uVar1) {\n      return 0;\n    }\n  }\n  if (sVar2 == 0) {\n    *(undefined4 *)(extraout_EDI + 0x3c) = 1;\n    uVar5 = 0;\n  }\n  else {\n    piVar3 = __errno_location();\n    pcVar4 = strerror(*piVar3);\n    FUN_0001cae0(extraout_EDI,0xffffffff,pcVar4);\n    uVar5 = 0xffffffff;\n  }\n  return uVar5;\n}" type_identifier (ERROR "__regparm3" identifier) (function_declarator "FUN_0001d330(undefined4 param_1,int param_2,uint param_3)" identifier (parameter_list "(undefined4 param_1,int param_2,uint param_3)" ( (parameter_declaration "undefined4 param_1" type_identifier identifier) , (parameter_declaration "int param_2" primitive_type identifier) , (parameter_declaration "uint param_3" type_identifier identifier) ))) (compound_statement "{\n  uint uVar1;\n  ssize_t sVar2;\n  int *piVar3;\n  char *pcVar4;\n  undefined4 uVar5;\n  size_t __nbytes;\n  int extraout_EDI;\n  uint *unaff_retaddr;\n  \n  entry(param_2,0x1d33d);\n  uVar1 = 0;\n  *unaff_retaddr = 0;\n  while( true ) {\n    __nbytes = param_3 - uVar1;\n    if (0x40000000 < __nbytes) {\n      __nbytes = 0x40000000;\n    }\n    sVar2 = read(*(int *)(extraout_EDI + 0x14),(void *)(uVar1 + param_2),__nbytes);\n    if (sVar2 < 1) break;\n    uVar1 = sVar2 + *unaff_retaddr;\n    *unaff_retaddr = uVar1;\n    if (param_3 <= uVar1) {\n      return 0;\n    }\n  }\n  if (sVar2 == 0) {\n    *(undefined4 *)(extraout_EDI + 0x3c) = 1;\n    uVar5 = 0;\n  }\n  else {\n    piVar3 = __errno_location();\n    pcVar4 = strerror(*piVar3);\n    FUN_0001cae0(extraout_EDI,0xffffffff,pcVar4);\n    uVar5 = 0xffffffff;\n  }\n  return uVar5;\n}" { (declaration "uint uVar1;" type_identifier identifier ;) (declaration "ssize_t sVar2;" primitive_type identifier ;) (declaration "int *piVar3;" primitive_type (pointer_declarator "*piVar3" * identifier) ;) (declaration "char *pcVar4;" primitive_type (pointer_declarator "*pcVar4" * identifier) ;) (declaration "undefined4 uVar5;" type_identifier identifier ;) (declaration "size_t __nbytes;" primitive_type identifier ;) (declaration "int extraout_EDI;" primitive_type identifier ;) (declaration "uint *unaff_retaddr;" type_identifier (pointer_declarator "*unaff_retaddr" * identifier) ;) (expression_statement "entry(param_2,0x1d33d);" (call_expression "entry(param_2,0x1d33d)" identifier (argument_list "(param_2,0x1d33d)" ( identifier , number_literal ))) ;) (expression_statement "uVar1 = 0;" (assignment_expression "uVar1 = 0" identifier = number_literal) ;) (expression_statement "*unaff_retaddr = 0;" (assignment_expression "*unaff_retaddr = 0" (pointer_expression "*unaff_retaddr" * identifier) = number_literal) ;) (while_statement "while( true ) {\n    __nbytes = param_3 - uVar1;\n    if (0x40000000 < __nbytes) {\n      __nbytes = 0x40000000;\n    }\n    sVar2 = read(*(int *)(extraout_EDI + 0x14),(void *)(uVar1 + param_2),__nbytes);\n    if (sVar2 < 1) break;\n    uVar1 = sVar2 + *unaff_retaddr;\n    *unaff_retaddr = uVar1;\n    if (param_3 <= uVar1) {\n      return 0;\n    }\n  }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n    __nbytes = param_3 - uVar1;\n    if (0x40000000 < __nbytes) {\n      __nbytes = 0x40000000;\n    }\n    sVar2 = read(*(int *)(extraout_EDI + 0x14),(void *)(uVar1 + param_2),__nbytes);\n    if (sVar2 < 1) break;\n    uVar1 = sVar2 + *unaff_retaddr;\n    *unaff_retaddr = uVar1;\n    if (param_3 <= uVar1) {\n      return 0;\n    }\n  }" { (expression_statement "__nbytes = param_3 - uVar1;" (assignment_expression "__nbytes = param_3 - uVar1" identifier = (binary_expression "param_3 - uVar1" identifier - identifier)) ;) (if_statement "if (0x40000000 < __nbytes) {\n      __nbytes = 0x40000000;\n    }" if (parenthesized_expression "(0x40000000 < __nbytes)" ( (binary_expression "0x40000000 < __nbytes" number_literal < identifier) )) (compound_statement "{\n      __nbytes = 0x40000000;\n    }" { (expression_statement "__nbytes = 0x40000000;" (assignment_expression "__nbytes = 0x40000000" identifier = number_literal) ;) })) (expression_statement "sVar2 = read(*(int *)(extraout_EDI + 0x14),(void *)(uVar1 + param_2),__nbytes);" (assignment_expression "sVar2 = read(*(int *)(extraout_EDI + 0x14),(void *)(uVar1 + param_2),__nbytes)" identifier = (call_expression "read(*(int *)(extraout_EDI + 0x14),(void *)(uVar1 + param_2),__nbytes)" identifier (argument_list "(*(int *)(extraout_EDI + 0x14),(void *)(uVar1 + param_2),__nbytes)" ( (pointer_expression "*(int *)(extraout_EDI + 0x14)" * (cast_expression "(int *)(extraout_EDI + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(extraout_EDI + 0x14)" ( (binary_expression "extraout_EDI + 0x14" identifier + number_literal) )))) , (cast_expression "(void *)(uVar1 + param_2)" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(uVar1 + param_2)" ( (binary_expression "uVar1 + param_2" identifier + identifier) ))) , identifier )))) ;) (if_statement "if (sVar2 < 1) break;" if (parenthesized_expression "(sVar2 < 1)" ( (binary_expression "sVar2 < 1" identifier < number_literal) )) (break_statement "break;" break ;)) (expression_statement "uVar1 = sVar2 + *unaff_retaddr;" (assignment_expression "uVar1 = sVar2 + *unaff_retaddr" identifier = (binary_expression "sVar2 + *unaff_retaddr" identifier + (pointer_expression "*unaff_retaddr" * identifier))) ;) (expression_statement "*unaff_retaddr = uVar1;" (assignment_expression "*unaff_retaddr = uVar1" (pointer_expression "*unaff_retaddr" * identifier) = identifier) ;) (if_statement "if (param_3 <= uVar1) {\n      return 0;\n    }" if (parenthesized_expression "(param_3 <= uVar1)" ( (binary_expression "param_3 <= uVar1" identifier <= identifier) )) (compound_statement "{\n      return 0;\n    }" { (return_statement "return 0;" return number_literal ;) })) })) (if_statement "if (sVar2 == 0) {\n    *(undefined4 *)(extraout_EDI + 0x3c) = 1;\n    uVar5 = 0;\n  }\n  else {\n    piVar3 = __errno_location();\n    pcVar4 = strerror(*piVar3);\n    FUN_0001cae0(extraout_EDI,0xffffffff,pcVar4);\n    uVar5 = 0xffffffff;\n  }" if (parenthesized_expression "(sVar2 == 0)" ( (binary_expression "sVar2 == 0" identifier == number_literal) )) (compound_statement "{\n    *(undefined4 *)(extraout_EDI + 0x3c) = 1;\n    uVar5 = 0;\n  }" { (expression_statement "*(undefined4 *)(extraout_EDI + 0x3c) = 1;" (assignment_expression "*(undefined4 *)(extraout_EDI + 0x3c) = 1" (pointer_expression "*(undefined4 *)(extraout_EDI + 0x3c)" * (cast_expression "(undefined4 *)(extraout_EDI + 0x3c)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(extraout_EDI + 0x3c)" ( (binary_expression "extraout_EDI + 0x3c" identifier + number_literal) )))) = number_literal) ;) (expression_statement "uVar5 = 0;" (assignment_expression "uVar5 = 0" identifier = number_literal) ;) }) (else_clause "else {\n    piVar3 = __errno_location();\n    pcVar4 = strerror(*piVar3);\n    FUN_0001cae0(extraout_EDI,0xffffffff,pcVar4);\n    uVar5 = 0xffffffff;\n  }" else (compound_statement "{\n    piVar3 = __errno_location();\n    pcVar4 = strerror(*piVar3);\n    FUN_0001cae0(extraout_EDI,0xffffffff,pcVar4);\n    uVar5 = 0xffffffff;\n  }" { (expression_statement "piVar3 = __errno_location();" (assignment_expression "piVar3 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (expression_statement "pcVar4 = strerror(*piVar3);" (assignment_expression "pcVar4 = strerror(*piVar3)" identifier = (call_expression "strerror(*piVar3)" identifier (argument_list "(*piVar3)" ( (pointer_expression "*piVar3" * identifier) )))) ;) (expression_statement "FUN_0001cae0(extraout_EDI,0xffffffff,pcVar4);" (call_expression "FUN_0001cae0(extraout_EDI,0xffffffff,pcVar4)" identifier (argument_list "(extraout_EDI,0xffffffff,pcVar4)" ( identifier , number_literal , identifier ))) ;) (expression_statement "uVar5 = 0xffffffff;" (assignment_expression "uVar5 = 0xffffffff" identifier = number_literal) ;) }))) (return_statement "return uVar5;" return identifier ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nint __regparm3 gz_load(gz_statep state,uchar *buf,uint len,uint *have)\n\n{\n  uint uVar1;\n  ssize_t sVar2;\n  int *piVar3;\n  char *msg;\n  int iVar4;\n  size_t __nbytes;\n  \n  uVar1 = 0;\n  *have = 0;\n  while( true ) {\n    __nbytes = len - uVar1;\n    if (0x40000000 < __nbytes) {\n      __nbytes = 0x40000000;\n    }\n    sVar2 = read(state->fd,buf + uVar1,__nbytes);\n    if (sVar2 < 1) break;\n    uVar1 = sVar2 + *have;\n    *have = uVar1;\n    if (len <= uVar1) {\n      return 0;\n    }\n  }\n  if (sVar2 == 0) {\n    state->eof = 1;\n    iVar4 = 0;\n  }\n  else {\n    piVar3 = __errno_location();\n    msg = strerror(*piVar3);\n    gz_error(state,-1,msg);\n    iVar4 = -1;\n  }\n  return iVar4;\n}\n\n" comment (function_definition "int __regparm3 gz_load(gz_statep state,uchar *buf,uint len,uint *have)\n\n{\n  uint uVar1;\n  ssize_t sVar2;\n  int *piVar3;\n  char *msg;\n  int iVar4;\n  size_t __nbytes;\n  \n  uVar1 = 0;\n  *have = 0;\n  while( true ) {\n    __nbytes = len - uVar1;\n    if (0x40000000 < __nbytes) {\n      __nbytes = 0x40000000;\n    }\n    sVar2 = read(state->fd,buf + uVar1,__nbytes);\n    if (sVar2 < 1) break;\n    uVar1 = sVar2 + *have;\n    *have = uVar1;\n    if (len <= uVar1) {\n      return 0;\n    }\n  }\n  if (sVar2 == 0) {\n    state->eof = 1;\n    iVar4 = 0;\n  }\n  else {\n    piVar3 = __errno_location();\n    msg = strerror(*piVar3);\n    gz_error(state,-1,msg);\n    iVar4 = -1;\n  }\n  return iVar4;\n}" primitive_type (ERROR "__regparm3" identifier) (function_declarator "gz_load(gz_statep state,uchar *buf,uint len,uint *have)" identifier (parameter_list "(gz_statep state,uchar *buf,uint len,uint *have)" ( (parameter_declaration "gz_statep state" type_identifier identifier) , (parameter_declaration "uchar *buf" type_identifier (pointer_declarator "*buf" * identifier)) , (parameter_declaration "uint len" type_identifier identifier) , (parameter_declaration "uint *have" type_identifier (pointer_declarator "*have" * identifier)) ))) (compound_statement "{\n  uint uVar1;\n  ssize_t sVar2;\n  int *piVar3;\n  char *msg;\n  int iVar4;\n  size_t __nbytes;\n  \n  uVar1 = 0;\n  *have = 0;\n  while( true ) {\n    __nbytes = len - uVar1;\n    if (0x40000000 < __nbytes) {\n      __nbytes = 0x40000000;\n    }\n    sVar2 = read(state->fd,buf + uVar1,__nbytes);\n    if (sVar2 < 1) break;\n    uVar1 = sVar2 + *have;\n    *have = uVar1;\n    if (len <= uVar1) {\n      return 0;\n    }\n  }\n  if (sVar2 == 0) {\n    state->eof = 1;\n    iVar4 = 0;\n  }\n  else {\n    piVar3 = __errno_location();\n    msg = strerror(*piVar3);\n    gz_error(state,-1,msg);\n    iVar4 = -1;\n  }\n  return iVar4;\n}" { (declaration "uint uVar1;" type_identifier identifier ;) (declaration "ssize_t sVar2;" primitive_type identifier ;) (declaration "int *piVar3;" primitive_type (pointer_declarator "*piVar3" * identifier) ;) (declaration "char *msg;" primitive_type (pointer_declarator "*msg" * identifier) ;) (declaration "int iVar4;" primitive_type identifier ;) (declaration "size_t __nbytes;" primitive_type identifier ;) (expression_statement "uVar1 = 0;" (assignment_expression "uVar1 = 0" identifier = number_literal) ;) (expression_statement "*have = 0;" (assignment_expression "*have = 0" (pointer_expression "*have" * identifier) = number_literal) ;) (while_statement "while( true ) {\n    __nbytes = len - uVar1;\n    if (0x40000000 < __nbytes) {\n      __nbytes = 0x40000000;\n    }\n    sVar2 = read(state->fd,buf + uVar1,__nbytes);\n    if (sVar2 < 1) break;\n    uVar1 = sVar2 + *have;\n    *have = uVar1;\n    if (len <= uVar1) {\n      return 0;\n    }\n  }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n    __nbytes = len - uVar1;\n    if (0x40000000 < __nbytes) {\n      __nbytes = 0x40000000;\n    }\n    sVar2 = read(state->fd,buf + uVar1,__nbytes);\n    if (sVar2 < 1) break;\n    uVar1 = sVar2 + *have;\n    *have = uVar1;\n    if (len <= uVar1) {\n      return 0;\n    }\n  }" { (expression_statement "__nbytes = len - uVar1;" (assignment_expression "__nbytes = len - uVar1" identifier = (binary_expression "len - uVar1" identifier - identifier)) ;) (if_statement "if (0x40000000 < __nbytes) {\n      __nbytes = 0x40000000;\n    }" if (parenthesized_expression "(0x40000000 < __nbytes)" ( (binary_expression "0x40000000 < __nbytes" number_literal < identifier) )) (compound_statement "{\n      __nbytes = 0x40000000;\n    }" { (expression_statement "__nbytes = 0x40000000;" (assignment_expression "__nbytes = 0x40000000" identifier = number_literal) ;) })) (expression_statement "sVar2 = read(state->fd,buf + uVar1,__nbytes);" (assignment_expression "sVar2 = read(state->fd,buf + uVar1,__nbytes)" identifier = (call_expression "read(state->fd,buf + uVar1,__nbytes)" identifier (argument_list "(state->fd,buf + uVar1,__nbytes)" ( (field_expression "state->fd" identifier -> field_identifier) , (binary_expression "buf + uVar1" identifier + identifier) , identifier )))) ;) (if_statement "if (sVar2 < 1) break;" if (parenthesized_expression "(sVar2 < 1)" ( (binary_expression "sVar2 < 1" identifier < number_literal) )) (break_statement "break;" break ;)) (expression_statement "uVar1 = sVar2 + *have;" (assignment_expression "uVar1 = sVar2 + *have" identifier = (binary_expression "sVar2 + *have" identifier + (pointer_expression "*have" * identifier))) ;) (expression_statement "*have = uVar1;" (assignment_expression "*have = uVar1" (pointer_expression "*have" * identifier) = identifier) ;) (if_statement "if (len <= uVar1) {\n      return 0;\n    }" if (parenthesized_expression "(len <= uVar1)" ( (binary_expression "len <= uVar1" identifier <= identifier) )) (compound_statement "{\n      return 0;\n    }" { (return_statement "return 0;" return number_literal ;) })) })) (if_statement "if (sVar2 == 0) {\n    state->eof = 1;\n    iVar4 = 0;\n  }\n  else {\n    piVar3 = __errno_location();\n    msg = strerror(*piVar3);\n    gz_error(state,-1,msg);\n    iVar4 = -1;\n  }" if (parenthesized_expression "(sVar2 == 0)" ( (binary_expression "sVar2 == 0" identifier == number_literal) )) (compound_statement "{\n    state->eof = 1;\n    iVar4 = 0;\n  }" { (expression_statement "state->eof = 1;" (assignment_expression "state->eof = 1" (field_expression "state->eof" identifier -> field_identifier) = number_literal) ;) (expression_statement "iVar4 = 0;" (assignment_expression "iVar4 = 0" identifier = number_literal) ;) }) (else_clause "else {\n    piVar3 = __errno_location();\n    msg = strerror(*piVar3);\n    gz_error(state,-1,msg);\n    iVar4 = -1;\n  }" else (compound_statement "{\n    piVar3 = __errno_location();\n    msg = strerror(*piVar3);\n    gz_error(state,-1,msg);\n    iVar4 = -1;\n  }" { (expression_statement "piVar3 = __errno_location();" (assignment_expression "piVar3 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (expression_statement "msg = strerror(*piVar3);" (assignment_expression "msg = strerror(*piVar3)" identifier = (call_expression "strerror(*piVar3)" identifier (argument_list "(*piVar3)" ( (pointer_expression "*piVar3" * identifier) )))) ;) (expression_statement "gz_error(state,-1,msg);" (call_expression "gz_error(state,-1,msg)" identifier (argument_list "(state,-1,msg)" ( identifier , number_literal , identifier ))) ;) (expression_statement "iVar4 = -1;" (assignment_expression "iVar4 = -1" identifier = number_literal) ;) }))) (return_statement "return iVar4;" return identifier ;) })))
(translation_unit "undefined4 __regparm3 FUN_0001d330(undefined4 param_1,int param_2,uint param_3)\n\n{\n  uint uVar1;\n  ssize_t sVar2;\n  int *piVar3;\n  char *pcVar4;\n  undefined4 uVar5;\n  size_t __nbytes;\n  int extraout_EDI;\n  uint *unaff_retaddr;\n  \n  entry(param_2,0x1d33d);\n  uVar1 = 0;\n  *unaff_retaddr = 0;\n  while( true ) {\n    __nbytes = param_3 - uVar1;\n    if (0x40000000 < __nbytes) {\n      __nbytes = 0x40000000;\n    }\n    sVar2 = read(*(int *)(extraout_EDI + 0x14),(void *)(uVar1 + param_2),__nbytes);\n    if (sVar2 < 1) break;\n    uVar1 = sVar2 + *unaff_retaddr;\n    *unaff_retaddr = uVar1;\n    if (param_3 <= uVar1) {\n      return 0;\n    }\n  }\n  if (sVar2 == 0) {\n    *(undefined4 *)(extraout_EDI + 0x3c) = 1;\n    uVar5 = 0;\n  }\n  else {\n    piVar3 = __errno_location();\n    pcVar4 = strerror(*piVar3);\n    FUN_0001cae0(extraout_EDI,0xffffffff,pcVar4);\n    uVar5 = 0xffffffff;\n  }\n  return uVar5;\n}\n\n" (function_definition "undefined4 __regparm3 FUN_0001d330(undefined4 param_1,int param_2,uint param_3)\n\n{\n  uint uVar1;\n  ssize_t sVar2;\n  int *piVar3;\n  char *pcVar4;\n  undefined4 uVar5;\n  size_t __nbytes;\n  int extraout_EDI;\n  uint *unaff_retaddr;\n  \n  entry(param_2,0x1d33d);\n  uVar1 = 0;\n  *unaff_retaddr = 0;\n  while( true ) {\n    __nbytes = param_3 - uVar1;\n    if (0x40000000 < __nbytes) {\n      __nbytes = 0x40000000;\n    }\n    sVar2 = read(*(int *)(extraout_EDI + 0x14),(void *)(uVar1 + param_2),__nbytes);\n    if (sVar2 < 1) break;\n    uVar1 = sVar2 + *unaff_retaddr;\n    *unaff_retaddr = uVar1;\n    if (param_3 <= uVar1) {\n      return 0;\n    }\n  }\n  if (sVar2 == 0) {\n    *(undefined4 *)(extraout_EDI + 0x3c) = 1;\n    uVar5 = 0;\n  }\n  else {\n    piVar3 = __errno_location();\n    pcVar4 = strerror(*piVar3);\n    FUN_0001cae0(extraout_EDI,0xffffffff,pcVar4);\n    uVar5 = 0xffffffff;\n  }\n  return uVar5;\n}" type_identifier (ERROR "__regparm3" identifier) (function_declarator "FUN_0001d330(undefined4 param_1,int param_2,uint param_3)" identifier (parameter_list "(undefined4 param_1,int param_2,uint param_3)" ( (parameter_declaration "undefined4 param_1" type_identifier identifier) , (parameter_declaration "int param_2" primitive_type identifier) , (parameter_declaration "uint param_3" type_identifier identifier) ))) (compound_statement "{\n  uint uVar1;\n  ssize_t sVar2;\n  int *piVar3;\n  char *pcVar4;\n  undefined4 uVar5;\n  size_t __nbytes;\n  int extraout_EDI;\n  uint *unaff_retaddr;\n  \n  entry(param_2,0x1d33d);\n  uVar1 = 0;\n  *unaff_retaddr = 0;\n  while( true ) {\n    __nbytes = param_3 - uVar1;\n    if (0x40000000 < __nbytes) {\n      __nbytes = 0x40000000;\n    }\n    sVar2 = read(*(int *)(extraout_EDI + 0x14),(void *)(uVar1 + param_2),__nbytes);\n    if (sVar2 < 1) break;\n    uVar1 = sVar2 + *unaff_retaddr;\n    *unaff_retaddr = uVar1;\n    if (param_3 <= uVar1) {\n      return 0;\n    }\n  }\n  if (sVar2 == 0) {\n    *(undefined4 *)(extraout_EDI + 0x3c) = 1;\n    uVar5 = 0;\n  }\n  else {\n    piVar3 = __errno_location();\n    pcVar4 = strerror(*piVar3);\n    FUN_0001cae0(extraout_EDI,0xffffffff,pcVar4);\n    uVar5 = 0xffffffff;\n  }\n  return uVar5;\n}" { (declaration "uint uVar1;" type_identifier identifier ;) (declaration "ssize_t sVar2;" primitive_type identifier ;) (declaration "int *piVar3;" primitive_type (pointer_declarator "*piVar3" * identifier) ;) (declaration "char *pcVar4;" primitive_type (pointer_declarator "*pcVar4" * identifier) ;) (declaration "undefined4 uVar5;" type_identifier identifier ;) (declaration "size_t __nbytes;" primitive_type identifier ;) (declaration "int extraout_EDI;" primitive_type identifier ;) (declaration "uint *unaff_retaddr;" type_identifier (pointer_declarator "*unaff_retaddr" * identifier) ;) (expression_statement "entry(param_2,0x1d33d);" (call_expression "entry(param_2,0x1d33d)" identifier (argument_list "(param_2,0x1d33d)" ( identifier , number_literal ))) ;) (expression_statement "uVar1 = 0;" (assignment_expression "uVar1 = 0" identifier = number_literal) ;) (expression_statement "*unaff_retaddr = 0;" (assignment_expression "*unaff_retaddr = 0" (pointer_expression "*unaff_retaddr" * identifier) = number_literal) ;) (while_statement "while( true ) {\n    __nbytes = param_3 - uVar1;\n    if (0x40000000 < __nbytes) {\n      __nbytes = 0x40000000;\n    }\n    sVar2 = read(*(int *)(extraout_EDI + 0x14),(void *)(uVar1 + param_2),__nbytes);\n    if (sVar2 < 1) break;\n    uVar1 = sVar2 + *unaff_retaddr;\n    *unaff_retaddr = uVar1;\n    if (param_3 <= uVar1) {\n      return 0;\n    }\n  }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n    __nbytes = param_3 - uVar1;\n    if (0x40000000 < __nbytes) {\n      __nbytes = 0x40000000;\n    }\n    sVar2 = read(*(int *)(extraout_EDI + 0x14),(void *)(uVar1 + param_2),__nbytes);\n    if (sVar2 < 1) break;\n    uVar1 = sVar2 + *unaff_retaddr;\n    *unaff_retaddr = uVar1;\n    if (param_3 <= uVar1) {\n      return 0;\n    }\n  }" { (expression_statement "__nbytes = param_3 - uVar1;" (assignment_expression "__nbytes = param_3 - uVar1" identifier = (binary_expression "param_3 - uVar1" identifier - identifier)) ;) (if_statement "if (0x40000000 < __nbytes) {\n      __nbytes = 0x40000000;\n    }" if (parenthesized_expression "(0x40000000 < __nbytes)" ( (binary_expression "0x40000000 < __nbytes" number_literal < identifier) )) (compound_statement "{\n      __nbytes = 0x40000000;\n    }" { (expression_statement "__nbytes = 0x40000000;" (assignment_expression "__nbytes = 0x40000000" identifier = number_literal) ;) })) (expression_statement "sVar2 = read(*(int *)(extraout_EDI + 0x14),(void *)(uVar1 + param_2),__nbytes);" (assignment_expression "sVar2 = read(*(int *)(extraout_EDI + 0x14),(void *)(uVar1 + param_2),__nbytes)" identifier = (call_expression "read(*(int *)(extraout_EDI + 0x14),(void *)(uVar1 + param_2),__nbytes)" identifier (argument_list "(*(int *)(extraout_EDI + 0x14),(void *)(uVar1 + param_2),__nbytes)" ( (pointer_expression "*(int *)(extraout_EDI + 0x14)" * (cast_expression "(int *)(extraout_EDI + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(extraout_EDI + 0x14)" ( (binary_expression "extraout_EDI + 0x14" identifier + number_literal) )))) , (cast_expression "(void *)(uVar1 + param_2)" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(uVar1 + param_2)" ( (binary_expression "uVar1 + param_2" identifier + identifier) ))) , identifier )))) ;) (if_statement "if (sVar2 < 1) break;" if (parenthesized_expression "(sVar2 < 1)" ( (binary_expression "sVar2 < 1" identifier < number_literal) )) (break_statement "break;" break ;)) (expression_statement "uVar1 = sVar2 + *unaff_retaddr;" (assignment_expression "uVar1 = sVar2 + *unaff_retaddr" identifier = (binary_expression "sVar2 + *unaff_retaddr" identifier + (pointer_expression "*unaff_retaddr" * identifier))) ;) (expression_statement "*unaff_retaddr = uVar1;" (assignment_expression "*unaff_retaddr = uVar1" (pointer_expression "*unaff_retaddr" * identifier) = identifier) ;) (if_statement "if (param_3 <= uVar1) {\n      return 0;\n    }" if (parenthesized_expression "(param_3 <= uVar1)" ( (binary_expression "param_3 <= uVar1" identifier <= identifier) )) (compound_statement "{\n      return 0;\n    }" { (return_statement "return 0;" return number_literal ;) })) })) (if_statement "if (sVar2 == 0) {\n    *(undefined4 *)(extraout_EDI + 0x3c) = 1;\n    uVar5 = 0;\n  }\n  else {\n    piVar3 = __errno_location();\n    pcVar4 = strerror(*piVar3);\n    FUN_0001cae0(extraout_EDI,0xffffffff,pcVar4);\n    uVar5 = 0xffffffff;\n  }" if (parenthesized_expression "(sVar2 == 0)" ( (binary_expression "sVar2 == 0" identifier == number_literal) )) (compound_statement "{\n    *(undefined4 *)(extraout_EDI + 0x3c) = 1;\n    uVar5 = 0;\n  }" { (expression_statement "*(undefined4 *)(extraout_EDI + 0x3c) = 1;" (assignment_expression "*(undefined4 *)(extraout_EDI + 0x3c) = 1" (pointer_expression "*(undefined4 *)(extraout_EDI + 0x3c)" * (cast_expression "(undefined4 *)(extraout_EDI + 0x3c)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(extraout_EDI + 0x3c)" ( (binary_expression "extraout_EDI + 0x3c" identifier + number_literal) )))) = number_literal) ;) (expression_statement "uVar5 = 0;" (assignment_expression "uVar5 = 0" identifier = number_literal) ;) }) (else_clause "else {\n    piVar3 = __errno_location();\n    pcVar4 = strerror(*piVar3);\n    FUN_0001cae0(extraout_EDI,0xffffffff,pcVar4);\n    uVar5 = 0xffffffff;\n  }" else (compound_statement "{\n    piVar3 = __errno_location();\n    pcVar4 = strerror(*piVar3);\n    FUN_0001cae0(extraout_EDI,0xffffffff,pcVar4);\n    uVar5 = 0xffffffff;\n  }" { (expression_statement "piVar3 = __errno_location();" (assignment_expression "piVar3 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (expression_statement "pcVar4 = strerror(*piVar3);" (assignment_expression "pcVar4 = strerror(*piVar3)" identifier = (call_expression "strerror(*piVar3)" identifier (argument_list "(*piVar3)" ( (pointer_expression "*piVar3" * identifier) )))) ;) (expression_statement "FUN_0001cae0(extraout_EDI,0xffffffff,pcVar4);" (call_expression "FUN_0001cae0(extraout_EDI,0xffffffff,pcVar4)" identifier (argument_list "(extraout_EDI,0xffffffff,pcVar4)" ( identifier , number_literal , identifier ))) ;) (expression_statement "uVar5 = 0xffffffff;" (assignment_expression "uVar5 = 0xffffffff" identifier = number_literal) ;) }))) (return_statement "return uVar5;" return identifier ;) })))
(translation_unit (function_definition TYPE (ERROR IDENT) (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT , LIT ))) ;) (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = LIT) ;) (while_statement while (parenthesized_expression ( BOOL )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression IDENT - IDENT)) ;) (if_statement if (parenthesized_expression ( (binary_expression LIT < IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) })) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) , (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + IDENT) ))) , IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < LIT) )) (break_statement break ;)) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + (pointer_expression * IDENT))) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT <= IDENT) )) (compound_statement { (return_statement return LIT ;) })) })) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = LIT) ;) (expression_statement (assignment_expression IDENT = LIT) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( )))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (pointer_expression * IDENT) )))) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT , LIT , IDENT ))) ;) (expression_statement (assignment_expression IDENT = LIT) ;) }))) (return_statement return IDENT ;) })))
(function_definition "undefined4 __regparm3 FUN_0001d330(undefined4 param_1,int param_2,uint param_3)\n\n{\n  uint uVar1;\n  ssize_t sVar2;\n  int *piVar3;\n  char *pcVar4;\n  undefined4 uVar5;\n  size_t __nbytes;\n  int extraout_EDI;\n  uint *unaff_retaddr;\n  \n  entry(param_2,0x1d33d);\n  uVar1 = 0;\n  *unaff_retaddr = 0;\n  while( true ) {\n    __nbytes = param_3 - uVar1;\n    if (0x40000000 < __nbytes) {\n      __nbytes = 0x40000000;\n    }\n    sVar2 = read(*(int *)(extraout_EDI + 0x14),(void *)(uVar1 + param_2),__nbytes);\n    if (sVar2 < 1) break;\n    uVar1 = sVar2 + *unaff_retaddr;\n    *unaff_retaddr = uVar1;\n    if (param_3 <= uVar1) {\n      return 0;\n    }\n  }\n  if (sVar2 == 0) {\n    *(undefined4 *)(extraout_EDI + 0x3c) = 1;\n    uVar5 = 0;\n  }\n  else {\n    piVar3 = __errno_location();\n    pcVar4 = strerror(*piVar3);\n    FUN_0001cae0(extraout_EDI,0xffffffff,pcVar4);\n    uVar5 = 0xffffffff;\n  }\n  return uVar5;\n}" (type_identifier "undefined4") (ERROR "__regparm3" (identifier "__regparm3")) (function_declarator "FUN_0001d330(undefined4 param_1,int param_2,uint param_3)" (identifier "FUN_0001d330") (parameter_list "(undefined4 param_1,int param_2,uint param_3)" (( "(") (parameter_declaration "undefined4 param_1" (type_identifier "undefined4") (identifier "param_1")) (, ",") (parameter_declaration "int param_2" (primitive_type "int") (identifier "param_2")) (, ",") (parameter_declaration "uint param_3" (type_identifier "uint") (identifier "param_3")) () ")"))) (compound_statement "{\n  uint uVar1;\n  ssize_t sVar2;\n  int *piVar3;\n  char *pcVar4;\n  undefined4 uVar5;\n  size_t __nbytes;\n  int extraout_EDI;\n  uint *unaff_retaddr;\n  \n  entry(param_2,0x1d33d);\n  uVar1 = 0;\n  *unaff_retaddr = 0;\n  while( true ) {\n    __nbytes = param_3 - uVar1;\n    if (0x40000000 < __nbytes) {\n      __nbytes = 0x40000000;\n    }\n    sVar2 = read(*(int *)(extraout_EDI + 0x14),(void *)(uVar1 + param_2),__nbytes);\n    if (sVar2 < 1) break;\n    uVar1 = sVar2 + *unaff_retaddr;\n    *unaff_retaddr = uVar1;\n    if (param_3 <= uVar1) {\n      return 0;\n    }\n  }\n  if (sVar2 == 0) {\n    *(undefined4 *)(extraout_EDI + 0x3c) = 1;\n    uVar5 = 0;\n  }\n  else {\n    piVar3 = __errno_location();\n    pcVar4 = strerror(*piVar3);\n    FUN_0001cae0(extraout_EDI,0xffffffff,pcVar4);\n    uVar5 = 0xffffffff;\n  }\n  return uVar5;\n}" ({ "{") (declaration "uint uVar1;" (type_identifier "uint") (identifier "uVar1") (; ";")) (declaration "ssize_t sVar2;" (primitive_type "ssize_t") (identifier "sVar2") (; ";")) (declaration "int *piVar3;" (primitive_type "int") (pointer_declarator "*piVar3" (* "*") (identifier "piVar3")) (; ";")) (declaration "char *pcVar4;" (primitive_type "char") (pointer_declarator "*pcVar4" (* "*") (identifier "pcVar4")) (; ";")) (declaration "undefined4 uVar5;" (type_identifier "undefined4") (identifier "uVar5") (; ";")) (declaration "size_t __nbytes;" (primitive_type "size_t") (identifier "__nbytes") (; ";")) (declaration "int extraout_EDI;" (primitive_type "int") (identifier "extraout_EDI") (; ";")) (declaration "uint *unaff_retaddr;" (type_identifier "uint") (pointer_declarator "*unaff_retaddr" (* "*") (identifier "unaff_retaddr")) (; ";")) (expression_statement "entry(param_2,0x1d33d);" (call_expression "entry(param_2,0x1d33d)" (identifier "entry") (argument_list "(param_2,0x1d33d)" (( "(") (identifier "param_2") (, ",") (number_literal "0x1d33d") () ")"))) (; ";")) (expression_statement "uVar1 = 0;" (assignment_expression "uVar1 = 0" (identifier "uVar1") (= "=") (number_literal "0")) (; ";")) (expression_statement "*unaff_retaddr = 0;" (assignment_expression "*unaff_retaddr = 0" (pointer_expression "*unaff_retaddr" (* "*") (identifier "unaff_retaddr")) (= "=") (number_literal "0")) (; ";")) (while_statement "while( true ) {\n    __nbytes = param_3 - uVar1;\n    if (0x40000000 < __nbytes) {\n      __nbytes = 0x40000000;\n    }\n    sVar2 = read(*(int *)(extraout_EDI + 0x14),(void *)(uVar1 + param_2),__nbytes);\n    if (sVar2 < 1) break;\n    uVar1 = sVar2 + *unaff_retaddr;\n    *unaff_retaddr = uVar1;\n    if (param_3 <= uVar1) {\n      return 0;\n    }\n  }" (while "while") (parenthesized_expression "( true )" (( "(") (true "true") () ")")) (compound_statement "{\n    __nbytes = param_3 - uVar1;\n    if (0x40000000 < __nbytes) {\n      __nbytes = 0x40000000;\n    }\n    sVar2 = read(*(int *)(extraout_EDI + 0x14),(void *)(uVar1 + param_2),__nbytes);\n    if (sVar2 < 1) break;\n    uVar1 = sVar2 + *unaff_retaddr;\n    *unaff_retaddr = uVar1;\n    if (param_3 <= uVar1) {\n      return 0;\n    }\n  }" ({ "{") (expression_statement "__nbytes = param_3 - uVar1;" (assignment_expression "__nbytes = param_3 - uVar1" (identifier "__nbytes") (= "=") (binary_expression "param_3 - uVar1" (identifier "param_3") (- "-") (identifier "uVar1"))) (; ";")) (if_statement "if (0x40000000 < __nbytes) {\n      __nbytes = 0x40000000;\n    }" (if "if") (parenthesized_expression "(0x40000000 < __nbytes)" (( "(") (binary_expression "0x40000000 < __nbytes" (number_literal "0x40000000") (< "<") (identifier "__nbytes")) () ")")) (compound_statement "{\n      __nbytes = 0x40000000;\n    }" ({ "{") (expression_statement "__nbytes = 0x40000000;" (assignment_expression "__nbytes = 0x40000000" (identifier "__nbytes") (= "=") (number_literal "0x40000000")) (; ";")) (} "}"))) (expression_statement "sVar2 = read(*(int *)(extraout_EDI + 0x14),(void *)(uVar1 + param_2),__nbytes);" (assignment_expression "sVar2 = read(*(int *)(extraout_EDI + 0x14),(void *)(uVar1 + param_2),__nbytes)" (identifier "sVar2") (= "=") (call_expression "read(*(int *)(extraout_EDI + 0x14),(void *)(uVar1 + param_2),__nbytes)" (identifier "read") (argument_list "(*(int *)(extraout_EDI + 0x14),(void *)(uVar1 + param_2),__nbytes)" (( "(") (pointer_expression "*(int *)(extraout_EDI + 0x14)" (* "*") (cast_expression "(int *)(extraout_EDI + 0x14)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(extraout_EDI + 0x14)" (( "(") (binary_expression "extraout_EDI + 0x14" (identifier "extraout_EDI") (+ "+") (number_literal "0x14")) () ")")))) (, ",") (cast_expression "(void *)(uVar1 + param_2)" (( "(") (type_descriptor "void *" (primitive_type "void") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(uVar1 + param_2)" (( "(") (binary_expression "uVar1 + param_2" (identifier "uVar1") (+ "+") (identifier "param_2")) () ")"))) (, ",") (identifier "__nbytes") () ")")))) (; ";")) (if_statement "if (sVar2 < 1) break;" (if "if") (parenthesized_expression "(sVar2 < 1)" (( "(") (binary_expression "sVar2 < 1" (identifier "sVar2") (< "<") (number_literal "1")) () ")")) (break_statement "break;" (break "break") (; ";"))) (expression_statement "uVar1 = sVar2 + *unaff_retaddr;" (assignment_expression "uVar1 = sVar2 + *unaff_retaddr" (identifier "uVar1") (= "=") (binary_expression "sVar2 + *unaff_retaddr" (identifier "sVar2") (+ "+") (pointer_expression "*unaff_retaddr" (* "*") (identifier "unaff_retaddr")))) (; ";")) (expression_statement "*unaff_retaddr = uVar1;" (assignment_expression "*unaff_retaddr = uVar1" (pointer_expression "*unaff_retaddr" (* "*") (identifier "unaff_retaddr")) (= "=") (identifier "uVar1")) (; ";")) (if_statement "if (param_3 <= uVar1) {\n      return 0;\n    }" (if "if") (parenthesized_expression "(param_3 <= uVar1)" (( "(") (binary_expression "param_3 <= uVar1" (identifier "param_3") (<= "<=") (identifier "uVar1")) () ")")) (compound_statement "{\n      return 0;\n    }" ({ "{") (return_statement "return 0;" (return "return") (number_literal "0") (; ";")) (} "}"))) (} "}"))) (if_statement "if (sVar2 == 0) {\n    *(undefined4 *)(extraout_EDI + 0x3c) = 1;\n    uVar5 = 0;\n  }\n  else {\n    piVar3 = __errno_location();\n    pcVar4 = strerror(*piVar3);\n    FUN_0001cae0(extraout_EDI,0xffffffff,pcVar4);\n    uVar5 = 0xffffffff;\n  }" (if "if") (parenthesized_expression "(sVar2 == 0)" (( "(") (binary_expression "sVar2 == 0" (identifier "sVar2") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n    *(undefined4 *)(extraout_EDI + 0x3c) = 1;\n    uVar5 = 0;\n  }" ({ "{") (expression_statement "*(undefined4 *)(extraout_EDI + 0x3c) = 1;" (assignment_expression "*(undefined4 *)(extraout_EDI + 0x3c) = 1" (pointer_expression "*(undefined4 *)(extraout_EDI + 0x3c)" (* "*") (cast_expression "(undefined4 *)(extraout_EDI + 0x3c)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(extraout_EDI + 0x3c)" (( "(") (binary_expression "extraout_EDI + 0x3c" (identifier "extraout_EDI") (+ "+") (number_literal "0x3c")) () ")")))) (= "=") (number_literal "1")) (; ";")) (expression_statement "uVar5 = 0;" (assignment_expression "uVar5 = 0" (identifier "uVar5") (= "=") (number_literal "0")) (; ";")) (} "}")) (else_clause "else {\n    piVar3 = __errno_location();\n    pcVar4 = strerror(*piVar3);\n    FUN_0001cae0(extraout_EDI,0xffffffff,pcVar4);\n    uVar5 = 0xffffffff;\n  }" (else "else") (compound_statement "{\n    piVar3 = __errno_location();\n    pcVar4 = strerror(*piVar3);\n    FUN_0001cae0(extraout_EDI,0xffffffff,pcVar4);\n    uVar5 = 0xffffffff;\n  }" ({ "{") (expression_statement "piVar3 = __errno_location();" (assignment_expression "piVar3 = __errno_location()" (identifier "piVar3") (= "=") (call_expression "__errno_location()" (identifier "__errno_location") (argument_list "()" (( "(") () ")")))) (; ";")) (expression_statement "pcVar4 = strerror(*piVar3);" (assignment_expression "pcVar4 = strerror(*piVar3)" (identifier "pcVar4") (= "=") (call_expression "strerror(*piVar3)" (identifier "strerror") (argument_list "(*piVar3)" (( "(") (pointer_expression "*piVar3" (* "*") (identifier "piVar3")) () ")")))) (; ";")) (expression_statement "FUN_0001cae0(extraout_EDI,0xffffffff,pcVar4);" (call_expression "FUN_0001cae0(extraout_EDI,0xffffffff,pcVar4)" (identifier "FUN_0001cae0") (argument_list "(extraout_EDI,0xffffffff,pcVar4)" (( "(") (identifier "extraout_EDI") (, ",") (number_literal "0xffffffff") (, ",") (identifier "pcVar4") () ")"))) (; ";")) (expression_statement "uVar5 = 0xffffffff;" (assignment_expression "uVar5 = 0xffffffff" (identifier "uVar5") (= "=") (number_literal "0xffffffff")) (; ";")) (} "}")))) (return_statement "return uVar5;" (return "return") (identifier "uVar5") (; ";")) (} "}")))

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

int __regparm3 function_1(type_1 state,type_2 *var_5,type_3 var_1,type_3 *have)

{
  type_3 var_2;
  ssize_t var_6;
  int *piVar3;
  char *msg;
  int iVar4;
  size_t var_3;
  
  var_2 = 0;
  *have = 0;
  while( true ) {
    var_3 = var_1 - var_2;
    if (0x40000000 < var_3) {
      var_3 = 0x40000000;
    }
    var_6 = var_4(state->fd,var_5 + var_2,var_3);
    if (var_6 < 1) break;
    var_2 = var_6 + *have;
    *have = var_2;
    if (var_1 <= var_2) {
      return 0;
    }
  }
  if (var_6 == 0) {
    state->eof = 1;
    iVar4 = 0;
  }
  else {
    piVar3 = var_7();
    msg = var_8(*piVar3);
    var_9(state,-1,msg);
    iVar4 = -1;
  }
  return iVar4;
}


(translation_unit (function_definition type: (type_identifier) (ERROR (identifier)) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (type_identifier) declarator: (identifier)) (parameter_declaration type: (primitive_type) declarator: (identifier)) (parameter_declaration type: (type_identifier) declarator: (identifier)))) body: (compound_statement (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier) (number_literal)))) (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (number_literal))) (while_statement condition: (parenthesized_expression (true)) body: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (number_literal) right: (identifier))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (number_literal))))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))) (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (identifier)))) (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (break_statement)) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (pointer_expression argument: (identifier))))) (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (identifier))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (compound_statement (return_statement (number_literal)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))) right: (number_literal))) (expression_statement (assignment_expression left: (identifier) right: (number_literal)))) alternative: (else_clause (compound_statement (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list)))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (pointer_expression argument: (identifier)))))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier) (number_literal) (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (number_literal)))))) (return_statement (identifier)))))

undefined4 __regparm3 MASKED(undefined4 param_1,int param_2,uint param_3)

{
  uint uVar1;
  ssize_t sVar2;
  int *piVar3;
  char *pcVar4;
  undefined4 uVar5;
  size_t __nbytes;
  int extraout_EDI;
  uint *unaff_retaddr;
  
  entry(param_2,0x1d33d);
  uVar1 = 0;
  *unaff_retaddr = 0;
  while( true ) {
    __nbytes = param_3 - uVar1;
    if (0x40000000 < __nbytes) {
      __nbytes = 0x40000000;
    }
    sVar2 = read(*(int *)(extraout_EDI + 0x14),(void *)(uVar1 + param_2),__nbytes);
    if (sVar2 < 1) break;
    uVar1 = sVar2 + *unaff_retaddr;
    *unaff_retaddr = uVar1;
    if (param_3 <= uVar1) {
      return 0;
    }
  }
  if (sVar2 == 0) {
    *(undefined4 *)(extraout_EDI + 0x3c) = 1;
    uVar5 = 0;
  }
  else {
    piVar3 = __errno_location();
    pcVar4 = strerror(*piVar3);
    FUN_0001cae0(extraout_EDI,0xffffffff,pcVar4);
    uVar5 = 0xffffffff;
  }
  return uVar5;
}

