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

int zcatfd(int fd,int ofd,char *fn)

{
  int iVar1;
  int iVar2;
  size_t nb;
  int in_GS_OFFSET;
  char lbuf [128];
  
  iVar1 = *(int *)(in_GS_OFFSET + 0x14);
  do {
    nb = zread(fd,lbuf,0x80);
    if (nb == 0) goto LAB_000c19da;
    if ((int)nb < 0) break;
    iVar2 = zwrite(ofd,lbuf,nb);
  } while (-1 < iVar2);
  nb = 0xffffffff;
LAB_000c19da:
  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {
    return nb;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail_local();
}



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

int zcatfd(undefined4 param_1,undefined4 param_2)

{
  int iVar1;
  int in_GS_OFFSET;
  undefined1 local_a0 [128];
  int local_20;
  undefined4 uStack_14;
  
  uStack_14 = 0xc1979;
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  do {
    iVar1 = zread(param_1,local_a0,0x80);
    if (iVar1 == 0) goto LAB_000c19da;
    if (iVar1 < 0) break;
    iVar1 = zwrite(param_2,local_a0,iVar1);
  } while (-1 < iVar1);
  iVar1 = -1;
LAB_000c19da:
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return iVar1;
  }
                    /* WARNING: Subroutine does not return */
  FUN_000ecc40();
}


PUSH EBP
PUSH EDI
PUSH ESI
PUSH EBX
CALL 0x00031ed0
ADD EBX,0x88687
SUB ESP,0x9c
MOV EAX,GS:[0x14]
MOV dword ptr [ESP + 0x8c],EAX
XOR EAX,EAX
MOV EDI,dword ptr [ESP + 0xb0]
MOV EBP,dword ptr [ESP + 0xb4]
LEA ESI,[ESP + 0xc]
JMP 0x000c19c4
JS 0x000c19f8
SUB ESP,0x4
PUSH EAX
PUSH ESI
PUSH EBP
CALL 0x000c3fe0
ADD ESP,0x10
TEST EAX,EAX
JS 0x000c19f8
SUB ESP,0x4
PUSH 0x80
PUSH ESI
PUSH EDI
CALL 0x000bc0d0
ADD ESP,0x10
TEST EAX,EAX
JNZ 0x000c19b0
MOV EDX,dword ptr [ESP + 0x8c]
XOR EDX,dword ptr GS:[0x14]
JNZ 0x000c19ff
ADD ESP,0x9c
POP EBX
POP ESI
POP EDI
POP EBP
RET
MOV EAX,0xffffffff
JMP 0x000c19da
CALL 0x000ecc40
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nint zcatfd(undefined4 param_1,undefined4 param_2)\n\n{\n  int iVar1;\n  int in_GS_OFFSET;\n  undefined1 local_a0 [128];\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0xc1979;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  do {\n    iVar1 = zread(param_1,local_a0,0x80);\n    if (iVar1 == 0) goto LAB_000c19da;\n    if (iVar1 < 0) break;\n    iVar1 = zwrite(param_2,local_a0,iVar1);\n  } while (-1 < iVar1);\n  iVar1 = -1;\nLAB_000c19da:\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return iVar1;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_000ecc40();\n}\n\n" comment (function_definition "int zcatfd(undefined4 param_1,undefined4 param_2)\n\n{\n  int iVar1;\n  int in_GS_OFFSET;\n  undefined1 local_a0 [128];\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0xc1979;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  do {\n    iVar1 = zread(param_1,local_a0,0x80);\n    if (iVar1 == 0) goto LAB_000c19da;\n    if (iVar1 < 0) break;\n    iVar1 = zwrite(param_2,local_a0,iVar1);\n  } while (-1 < iVar1);\n  iVar1 = -1;\nLAB_000c19da:\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return iVar1;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_000ecc40();\n}" primitive_type (function_declarator "zcatfd(undefined4 param_1,undefined4 param_2)" identifier (parameter_list "(undefined4 param_1,undefined4 param_2)" ( (parameter_declaration "undefined4 param_1" type_identifier identifier) , (parameter_declaration "undefined4 param_2" type_identifier identifier) ))) (compound_statement "{\n  int iVar1;\n  int in_GS_OFFSET;\n  undefined1 local_a0 [128];\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0xc1979;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  do {\n    iVar1 = zread(param_1,local_a0,0x80);\n    if (iVar1 == 0) goto LAB_000c19da;\n    if (iVar1 < 0) break;\n    iVar1 = zwrite(param_2,local_a0,iVar1);\n  } while (-1 < iVar1);\n  iVar1 = -1;\nLAB_000c19da:\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return iVar1;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_000ecc40();\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "undefined1 local_a0 [128];" type_identifier (array_declarator "local_a0 [128]" identifier [ number_literal ]) ;) (declaration "int local_20;" primitive_type identifier ;) (declaration "undefined4 uStack_14;" type_identifier identifier ;) (expression_statement "uStack_14 = 0xc1979;" (assignment_expression "uStack_14 = 0xc1979" identifier = number_literal) ;) (expression_statement "local_20 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "local_20 = *(int *)(in_GS_OFFSET + 0x14)" identifier = (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) ;) (do_statement "do {\n    iVar1 = zread(param_1,local_a0,0x80);\n    if (iVar1 == 0) goto LAB_000c19da;\n    if (iVar1 < 0) break;\n    iVar1 = zwrite(param_2,local_a0,iVar1);\n  } while (-1 < iVar1);" do (compound_statement "{\n    iVar1 = zread(param_1,local_a0,0x80);\n    if (iVar1 == 0) goto LAB_000c19da;\n    if (iVar1 < 0) break;\n    iVar1 = zwrite(param_2,local_a0,iVar1);\n  }" { (expression_statement "iVar1 = zread(param_1,local_a0,0x80);" (assignment_expression "iVar1 = zread(param_1,local_a0,0x80)" identifier = (call_expression "zread(param_1,local_a0,0x80)" identifier (argument_list "(param_1,local_a0,0x80)" ( identifier , identifier , number_literal )))) ;) (if_statement "if (iVar1 == 0) goto LAB_000c19da;" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (goto_statement "goto LAB_000c19da;" goto statement_identifier ;)) (if_statement "if (iVar1 < 0) break;" if (parenthesized_expression "(iVar1 < 0)" ( (binary_expression "iVar1 < 0" identifier < number_literal) )) (break_statement "break;" break ;)) (expression_statement "iVar1 = zwrite(param_2,local_a0,iVar1);" (assignment_expression "iVar1 = zwrite(param_2,local_a0,iVar1)" identifier = (call_expression "zwrite(param_2,local_a0,iVar1)" identifier (argument_list "(param_2,local_a0,iVar1)" ( identifier , identifier , identifier )))) ;) }) while (parenthesized_expression "(-1 < iVar1)" ( (binary_expression "-1 < iVar1" number_literal < identifier) )) ;) (expression_statement "iVar1 = -1;" (assignment_expression "iVar1 = -1" identifier = number_literal) ;) (labeled_statement "LAB_000c19da:\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return iVar1;\n  }" statement_identifier : (if_statement "if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return iVar1;\n  }" if (parenthesized_expression "(local_20 == *(int *)(in_GS_OFFSET + 0x14))" ( (binary_expression "local_20 == *(int *)(in_GS_OFFSET + 0x14)" identifier == (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) )) (compound_statement "{\n    return iVar1;\n  }" { (return_statement "return iVar1;" return identifier ;) }))) comment (expression_statement "FUN_000ecc40();" (call_expression "FUN_000ecc40()" identifier (argument_list "()" ( ))) ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* WARNING: Unknown calling convention */\n\nint zcatfd(int fd,int ofd,char *fn)\n\n{\n  int iVar1;\n  int iVar2;\n  size_t nb;\n  int in_GS_OFFSET;\n  char lbuf [128];\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  do {\n    nb = zread(fd,lbuf,0x80);\n    if (nb == 0) goto LAB_000c19da;\n    if ((int)nb < 0) break;\n    iVar2 = zwrite(ofd,lbuf,nb);\n  } while (-1 < iVar2);\n  nb = 0xffffffff;\nLAB_000c19da:\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return nb;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail_local();\n}\n\n" comment comment (function_definition "int zcatfd(int fd,int ofd,char *fn)\n\n{\n  int iVar1;\n  int iVar2;\n  size_t nb;\n  int in_GS_OFFSET;\n  char lbuf [128];\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  do {\n    nb = zread(fd,lbuf,0x80);\n    if (nb == 0) goto LAB_000c19da;\n    if ((int)nb < 0) break;\n    iVar2 = zwrite(ofd,lbuf,nb);\n  } while (-1 < iVar2);\n  nb = 0xffffffff;\nLAB_000c19da:\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return nb;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail_local();\n}" primitive_type (function_declarator "zcatfd(int fd,int ofd,char *fn)" identifier (parameter_list "(int fd,int ofd,char *fn)" ( (parameter_declaration "int fd" primitive_type identifier) , (parameter_declaration "int ofd" primitive_type identifier) , (parameter_declaration "char *fn" primitive_type (pointer_declarator "*fn" * identifier)) ))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  size_t nb;\n  int in_GS_OFFSET;\n  char lbuf [128];\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  do {\n    nb = zread(fd,lbuf,0x80);\n    if (nb == 0) goto LAB_000c19da;\n    if ((int)nb < 0) break;\n    iVar2 = zwrite(ofd,lbuf,nb);\n  } while (-1 < iVar2);\n  nb = 0xffffffff;\nLAB_000c19da:\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return nb;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail_local();\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "size_t nb;" primitive_type identifier ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "char lbuf [128];" primitive_type (array_declarator "lbuf [128]" identifier [ number_literal ]) ;) (expression_statement "iVar1 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "iVar1 = *(int *)(in_GS_OFFSET + 0x14)" identifier = (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) ;) (do_statement "do {\n    nb = zread(fd,lbuf,0x80);\n    if (nb == 0) goto LAB_000c19da;\n    if ((int)nb < 0) break;\n    iVar2 = zwrite(ofd,lbuf,nb);\n  } while (-1 < iVar2);" do (compound_statement "{\n    nb = zread(fd,lbuf,0x80);\n    if (nb == 0) goto LAB_000c19da;\n    if ((int)nb < 0) break;\n    iVar2 = zwrite(ofd,lbuf,nb);\n  }" { (expression_statement "nb = zread(fd,lbuf,0x80);" (assignment_expression "nb = zread(fd,lbuf,0x80)" identifier = (call_expression "zread(fd,lbuf,0x80)" identifier (argument_list "(fd,lbuf,0x80)" ( identifier , identifier , number_literal )))) ;) (if_statement "if (nb == 0) goto LAB_000c19da;" if (parenthesized_expression "(nb == 0)" ( (binary_expression "nb == 0" identifier == number_literal) )) (goto_statement "goto LAB_000c19da;" goto statement_identifier ;)) (if_statement "if ((int)nb < 0) break;" if (parenthesized_expression "((int)nb < 0)" ( (binary_expression "(int)nb < 0" (cast_expression "(int)nb" ( (type_descriptor "int" primitive_type) ) identifier) < number_literal) )) (break_statement "break;" break ;)) (expression_statement "iVar2 = zwrite(ofd,lbuf,nb);" (assignment_expression "iVar2 = zwrite(ofd,lbuf,nb)" identifier = (call_expression "zwrite(ofd,lbuf,nb)" identifier (argument_list "(ofd,lbuf,nb)" ( identifier , identifier , identifier )))) ;) }) while (parenthesized_expression "(-1 < iVar2)" ( (binary_expression "-1 < iVar2" number_literal < identifier) )) ;) (expression_statement "nb = 0xffffffff;" (assignment_expression "nb = 0xffffffff" identifier = number_literal) ;) (labeled_statement "LAB_000c19da:\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return nb;\n  }" statement_identifier : (if_statement "if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return nb;\n  }" if (parenthesized_expression "(iVar1 == *(int *)(in_GS_OFFSET + 0x14))" ( (binary_expression "iVar1 == *(int *)(in_GS_OFFSET + 0x14)" identifier == (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) )) (compound_statement "{\n    return nb;\n  }" { (return_statement "return nb;" return identifier ;) }))) comment (expression_statement "__stack_chk_fail_local();" (call_expression "__stack_chk_fail_local()" identifier (argument_list "()" ( ))) ;) })))
(translation_unit "int zcatfd(undefined4 param_1,undefined4 param_2)\n\n{\n  int iVar1;\n  int in_GS_OFFSET;\n  undefined1 local_a0 [128];\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0xc1979;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  do {\n    iVar1 = zread(param_1,local_a0,0x80);\n    if (iVar1 == 0) goto LAB_000c19da;\n    if (iVar1 < 0) break;\n    iVar1 = zwrite(param_2,local_a0,iVar1);\n  } while (-1 < iVar1);\n  iVar1 = -1;\nLAB_000c19da:\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return iVar1;\n  }\n                    \n  FUN_000ecc40();\n}\n\n" (function_definition "int zcatfd(undefined4 param_1,undefined4 param_2)\n\n{\n  int iVar1;\n  int in_GS_OFFSET;\n  undefined1 local_a0 [128];\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0xc1979;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  do {\n    iVar1 = zread(param_1,local_a0,0x80);\n    if (iVar1 == 0) goto LAB_000c19da;\n    if (iVar1 < 0) break;\n    iVar1 = zwrite(param_2,local_a0,iVar1);\n  } while (-1 < iVar1);\n  iVar1 = -1;\nLAB_000c19da:\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return iVar1;\n  }\n                    \n  FUN_000ecc40();\n}" primitive_type (function_declarator "zcatfd(undefined4 param_1,undefined4 param_2)" identifier (parameter_list "(undefined4 param_1,undefined4 param_2)" ( (parameter_declaration "undefined4 param_1" type_identifier identifier) , (parameter_declaration "undefined4 param_2" type_identifier identifier) ))) (compound_statement "{\n  int iVar1;\n  int in_GS_OFFSET;\n  undefined1 local_a0 [128];\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0xc1979;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  do {\n    iVar1 = zread(param_1,local_a0,0x80);\n    if (iVar1 == 0) goto LAB_000c19da;\n    if (iVar1 < 0) break;\n    iVar1 = zwrite(param_2,local_a0,iVar1);\n  } while (-1 < iVar1);\n  iVar1 = -1;\nLAB_000c19da:\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return iVar1;\n  }\n                    \n  FUN_000ecc40();\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "undefined1 local_a0 [128];" type_identifier (array_declarator "local_a0 [128]" identifier [ number_literal ]) ;) (declaration "int local_20;" primitive_type identifier ;) (declaration "undefined4 uStack_14;" type_identifier identifier ;) (expression_statement "uStack_14 = 0xc1979;" (assignment_expression "uStack_14 = 0xc1979" identifier = number_literal) ;) (expression_statement "local_20 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "local_20 = *(int *)(in_GS_OFFSET + 0x14)" identifier = (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) ;) (do_statement "do {\n    iVar1 = zread(param_1,local_a0,0x80);\n    if (iVar1 == 0) goto LAB_000c19da;\n    if (iVar1 < 0) break;\n    iVar1 = zwrite(param_2,local_a0,iVar1);\n  } while (-1 < iVar1);" do (compound_statement "{\n    iVar1 = zread(param_1,local_a0,0x80);\n    if (iVar1 == 0) goto LAB_000c19da;\n    if (iVar1 < 0) break;\n    iVar1 = zwrite(param_2,local_a0,iVar1);\n  }" { (expression_statement "iVar1 = zread(param_1,local_a0,0x80);" (assignment_expression "iVar1 = zread(param_1,local_a0,0x80)" identifier = (call_expression "zread(param_1,local_a0,0x80)" identifier (argument_list "(param_1,local_a0,0x80)" ( identifier , identifier , number_literal )))) ;) (if_statement "if (iVar1 == 0) goto LAB_000c19da;" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (goto_statement "goto LAB_000c19da;" goto statement_identifier ;)) (if_statement "if (iVar1 < 0) break;" if (parenthesized_expression "(iVar1 < 0)" ( (binary_expression "iVar1 < 0" identifier < number_literal) )) (break_statement "break;" break ;)) (expression_statement "iVar1 = zwrite(param_2,local_a0,iVar1);" (assignment_expression "iVar1 = zwrite(param_2,local_a0,iVar1)" identifier = (call_expression "zwrite(param_2,local_a0,iVar1)" identifier (argument_list "(param_2,local_a0,iVar1)" ( identifier , identifier , identifier )))) ;) }) while (parenthesized_expression "(-1 < iVar1)" ( (binary_expression "-1 < iVar1" number_literal < identifier) )) ;) (expression_statement "iVar1 = -1;" (assignment_expression "iVar1 = -1" identifier = number_literal) ;) (labeled_statement "LAB_000c19da:\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return iVar1;\n  }" statement_identifier : (if_statement "if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return iVar1;\n  }" if (parenthesized_expression "(local_20 == *(int *)(in_GS_OFFSET + 0x14))" ( (binary_expression "local_20 == *(int *)(in_GS_OFFSET + 0x14)" identifier == (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) )) (compound_statement "{\n    return iVar1;\n  }" { (return_statement "return iVar1;" return identifier ;) }))) (expression_statement "FUN_000ecc40();" (call_expression "FUN_000ecc40()" identifier (argument_list "()" ( ))) ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (array_declarator IDENT [ LIT ]) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (do_statement do (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT , LIT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (goto_statement goto statement_identifier ;)) (if_statement if (parenthesized_expression ( (binary_expression IDENT < LIT) )) (break_statement break ;)) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT , IDENT )))) ;) }) while (parenthesized_expression ( (binary_expression LIT < IDENT) )) ;) (expression_statement (assignment_expression IDENT = LIT) ;) (labeled_statement statement_identifier : (if_statement if (parenthesized_expression ( (binary_expression IDENT == (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) )) (compound_statement { (return_statement return IDENT ;) }))) (expression_statement (call_expression IDENT (argument_list ( ))) ;) })))
(function_definition "int zcatfd(undefined4 param_1,undefined4 param_2)\n\n{\n  int iVar1;\n  int in_GS_OFFSET;\n  undefined1 local_a0 [128];\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0xc1979;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  do {\n    iVar1 = zread(param_1,local_a0,0x80);\n    if (iVar1 == 0) goto LAB_000c19da;\n    if (iVar1 < 0) break;\n    iVar1 = zwrite(param_2,local_a0,iVar1);\n  } while (-1 < iVar1);\n  iVar1 = -1;\nLAB_000c19da:\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return iVar1;\n  }\n                    \n  FUN_000ecc40();\n}" (primitive_type "int") (function_declarator "zcatfd(undefined4 param_1,undefined4 param_2)" (identifier "zcatfd") (parameter_list "(undefined4 param_1,undefined4 param_2)" (( "(") (parameter_declaration "undefined4 param_1" (type_identifier "undefined4") (identifier "param_1")) (, ",") (parameter_declaration "undefined4 param_2" (type_identifier "undefined4") (identifier "param_2")) () ")"))) (compound_statement "{\n  int iVar1;\n  int in_GS_OFFSET;\n  undefined1 local_a0 [128];\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0xc1979;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  do {\n    iVar1 = zread(param_1,local_a0,0x80);\n    if (iVar1 == 0) goto LAB_000c19da;\n    if (iVar1 < 0) break;\n    iVar1 = zwrite(param_2,local_a0,iVar1);\n  } while (-1 < iVar1);\n  iVar1 = -1;\nLAB_000c19da:\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return iVar1;\n  }\n                    \n  FUN_000ecc40();\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "int in_GS_OFFSET;" (primitive_type "int") (identifier "in_GS_OFFSET") (; ";")) (declaration "undefined1 local_a0 [128];" (type_identifier "undefined1") (array_declarator "local_a0 [128]" (identifier "local_a0") ([ "[") (number_literal "128") (] "]")) (; ";")) (declaration "int local_20;" (primitive_type "int") (identifier "local_20") (; ";")) (declaration "undefined4 uStack_14;" (type_identifier "undefined4") (identifier "uStack_14") (; ";")) (expression_statement "uStack_14 = 0xc1979;" (assignment_expression "uStack_14 = 0xc1979" (identifier "uStack_14") (= "=") (number_literal "0xc1979")) (; ";")) (expression_statement "local_20 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "local_20 = *(int *)(in_GS_OFFSET + 0x14)" (identifier "local_20") (= "=") (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" (* "*") (cast_expression "(int *)(in_GS_OFFSET + 0x14)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(in_GS_OFFSET + 0x14)" (( "(") (binary_expression "in_GS_OFFSET + 0x14" (identifier "in_GS_OFFSET") (+ "+") (number_literal "0x14")) () ")"))))) (; ";")) (do_statement "do {\n    iVar1 = zread(param_1,local_a0,0x80);\n    if (iVar1 == 0) goto LAB_000c19da;\n    if (iVar1 < 0) break;\n    iVar1 = zwrite(param_2,local_a0,iVar1);\n  } while (-1 < iVar1);" (do "do") (compound_statement "{\n    iVar1 = zread(param_1,local_a0,0x80);\n    if (iVar1 == 0) goto LAB_000c19da;\n    if (iVar1 < 0) break;\n    iVar1 = zwrite(param_2,local_a0,iVar1);\n  }" ({ "{") (expression_statement "iVar1 = zread(param_1,local_a0,0x80);" (assignment_expression "iVar1 = zread(param_1,local_a0,0x80)" (identifier "iVar1") (= "=") (call_expression "zread(param_1,local_a0,0x80)" (identifier "zread") (argument_list "(param_1,local_a0,0x80)" (( "(") (identifier "param_1") (, ",") (identifier "local_a0") (, ",") (number_literal "0x80") () ")")))) (; ";")) (if_statement "if (iVar1 == 0) goto LAB_000c19da;" (if "if") (parenthesized_expression "(iVar1 == 0)" (( "(") (binary_expression "iVar1 == 0" (identifier "iVar1") (== "==") (number_literal "0")) () ")")) (goto_statement "goto LAB_000c19da;" (goto "goto") (statement_identifier "LAB_000c19da") (; ";"))) (if_statement "if (iVar1 < 0) break;" (if "if") (parenthesized_expression "(iVar1 < 0)" (( "(") (binary_expression "iVar1 < 0" (identifier "iVar1") (< "<") (number_literal "0")) () ")")) (break_statement "break;" (break "break") (; ";"))) (expression_statement "iVar1 = zwrite(param_2,local_a0,iVar1);" (assignment_expression "iVar1 = zwrite(param_2,local_a0,iVar1)" (identifier "iVar1") (= "=") (call_expression "zwrite(param_2,local_a0,iVar1)" (identifier "zwrite") (argument_list "(param_2,local_a0,iVar1)" (( "(") (identifier "param_2") (, ",") (identifier "local_a0") (, ",") (identifier "iVar1") () ")")))) (; ";")) (} "}")) (while "while") (parenthesized_expression "(-1 < iVar1)" (( "(") (binary_expression "-1 < iVar1" (number_literal "-1") (< "<") (identifier "iVar1")) () ")")) (; ";")) (expression_statement "iVar1 = -1;" (assignment_expression "iVar1 = -1" (identifier "iVar1") (= "=") (number_literal "-1")) (; ";")) (labeled_statement "LAB_000c19da:\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return iVar1;\n  }" (statement_identifier "LAB_000c19da") (: ":") (if_statement "if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return iVar1;\n  }" (if "if") (parenthesized_expression "(local_20 == *(int *)(in_GS_OFFSET + 0x14))" (( "(") (binary_expression "local_20 == *(int *)(in_GS_OFFSET + 0x14)" (identifier "local_20") (== "==") (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" (* "*") (cast_expression "(int *)(in_GS_OFFSET + 0x14)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(in_GS_OFFSET + 0x14)" (( "(") (binary_expression "in_GS_OFFSET + 0x14" (identifier "in_GS_OFFSET") (+ "+") (number_literal "0x14")) () ")"))))) () ")")) (compound_statement "{\n    return iVar1;\n  }" ({ "{") (return_statement "return iVar1;" (return "return") (identifier "iVar1") (; ";")) (} "}")))) (expression_statement "FUN_000ecc40();" (call_expression "FUN_000ecc40()" (identifier "FUN_000ecc40") (argument_list "()" (( "(") () ")"))) (; ";")) (} "}")))

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

int function_1(int fd,int ofd,char *fn)

{
  int var_6;
  int var_5;
  size_t var_3;
  int var_1;
  char lbuf [128];
  
  var_6 = *(int *)(var_1 + 0x14);
  do {
    var_3 = var_2(fd,lbuf,0x80);
    if (var_3 == 0) goto LAB_000c19da;
    if ((int)var_3 < 0) break;
    var_5 = var_4(ofd,lbuf,var_3);
  } while (-1 < var_5);
  var_3 = 0xffffffff;
LAB_000c19da:
  if (var_6 == *(int *)(var_1 + 0x14)) {
    return var_3;
  }
                    /* WARNING: Subroutine does not return */
  var_7();
}


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

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

int MASKED(undefined4 param_1,undefined4 param_2)

{
  int iVar1;
  int in_GS_OFFSET;
  undefined1 local_a0 [128];
  int local_20;
  undefined4 uStack_14;
  
  uStack_14 = 0xc1979;
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  do {
    iVar1 = zread(param_1,local_a0,0x80);
    if (iVar1 == 0) goto LAB_000c19da;
    if (iVar1 < 0) break;
    iVar1 = zwrite(param_2,local_a0,iVar1);
  } while (-1 < iVar1);
  iVar1 = -1;
LAB_000c19da:
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return iVar1;
  }
                    /* WARNING: Subroutine does not return */
  FUN_000ecc40();
}

