
/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */
/* WARNING: Unknown calling convention */
/* WARNING: Enum "anon_enum_32": Some values do not have unique names */

FILE * warc_tempfile(void)

{
  int iVar1;
  int iVar2;
  int iVar3;
  FILE *pFVar4;
  int in_GS_OFFSET;
  char filename [100];
  
  iVar1 = *(int *)(in_GS_OFFSET + 0x14);
  iVar2 = path_search(filename,100,opt.warc_tempdir,"wget",true);
  if (iVar2 != -1) {
    iVar2 = mkostemp64(filename,0);
    if (-1 < iVar2) {
      iVar3 = unlink(filename);
      if (-1 < iVar3) {
        pFVar4 = fdopen(iVar2,"wb+");
        goto LAB_00047aed;
      }
      close(iVar2);
    }
  }
  pFVar4 = (FILE *)0x0;
LAB_00047aed:
  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {
    return (FILE *)pFVar4;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail_local();
}



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

FILE * FUN_00047a70(void)

{
  int iVar1;
  int iVar2;
  FILE *pFVar3;
  int in_GS_OFFSET;
  char local_74 [100];
  int local_10;
  
  local_10 = *(int *)(in_GS_OFFSET + 0x14);
  iVar1 = FUN_0005ab10(local_74,100,DAT_000a8adc,&DAT_0007bbd6,1);
  if (iVar1 != -1) {
    iVar1 = mkostemp64(local_74,0);
    if (-1 < iVar1) {
      iVar2 = unlink(local_74);
      if (-1 < iVar2) {
        pFVar3 = fdopen(iVar1,"wb+");
        goto LAB_00047aed;
      }
      close(iVar1);
    }
  }
  pFVar3 = (FILE *)0x0;
LAB_00047aed:
  if (local_10 == *(int *)(in_GS_OFFSET + 0x14)) {
    return pFVar3;
  }
                    /* WARNING: Subroutine does not return */
  FUN_0006da50();
}


PUSH EDI
PUSH ESI
PUSH EBX
CALL 0x00019070
ADD EBX,0x59158
SUB ESP,0x7c
MOV EAX,GS:[0x14]
MOV dword ptr [ESP + 0x78],EAX
XOR EAX,EAX
PUSH 0x1
LEA EAX,[EBX + 0xfffdb006]
PUSH EAX
LEA EAX,[EBX + 0x7e70]
PUSH dword ptr [EAX + 0x9c]
PUSH 0x64
LEA ESI,[ESP + 0x24]
PUSH ESI
CALL 0x0005ab10
ADD ESP,0x20
CMP EAX,-0x1
JZ 0x00047b18
SUB ESP,0x8
PUSH 0x0
PUSH ESI
CALL 0x00016540
ADD ESP,0x10
MOV EDI,EAX
TEST EAX,EAX
JS 0x00047b18
SUB ESP,0xc
PUSH ESI
CALL 0x000168e0
ADD ESP,0x10
TEST EAX,EAX
JS 0x00047b08
SUB ESP,0x8
LEA EAX,[EBX + 0xfffe14b0]
PUSH EAX
PUSH EDI
CALL 0x00016650
ADD ESP,0x10
MOV EDX,dword ptr [ESP + 0x6c]
XOR EDX,dword ptr GS:[0x14]
JNZ 0x00047b1c
ADD ESP,0x70
POP EBX
POP ESI
POP EDI
RET
SUB ESP,0xc
PUSH EDI
CALL 0x00016a40
ADD ESP,0x10
LEA ESI,[ESI]
XOR EAX,EAX
JMP 0x00047aed
CALL 0x0006da50
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nFILE * FUN_00047a70(void)\n\n{\n  int iVar1;\n  int iVar2;\n  FILE *pFVar3;\n  int in_GS_OFFSET;\n  char local_74 [100];\n  int local_10;\n  \n  local_10 = *(int *)(in_GS_OFFSET + 0x14);\n  iVar1 = FUN_0005ab10(local_74,100,DAT_000a8adc,&DAT_0007bbd6,1);\n  if (iVar1 != -1) {\n    iVar1 = mkostemp64(local_74,0);\n    if (-1 < iVar1) {\n      iVar2 = unlink(local_74);\n      if (-1 < iVar2) {\n        pFVar3 = fdopen(iVar1,"wb+");\n        goto LAB_00047aed;\n      }\n      close(iVar1);\n    }\n  }\n  pFVar3 = (FILE *)0x0;\nLAB_00047aed:\n  if (local_10 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return pFVar3;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_0006da50();\n}\n\n" comment (function_definition "FILE * FUN_00047a70(void)\n\n{\n  int iVar1;\n  int iVar2;\n  FILE *pFVar3;\n  int in_GS_OFFSET;\n  char local_74 [100];\n  int local_10;\n  \n  local_10 = *(int *)(in_GS_OFFSET + 0x14);\n  iVar1 = FUN_0005ab10(local_74,100,DAT_000a8adc,&DAT_0007bbd6,1);\n  if (iVar1 != -1) {\n    iVar1 = mkostemp64(local_74,0);\n    if (-1 < iVar1) {\n      iVar2 = unlink(local_74);\n      if (-1 < iVar2) {\n        pFVar3 = fdopen(iVar1,"wb+");\n        goto LAB_00047aed;\n      }\n      close(iVar1);\n    }\n  }\n  pFVar3 = (FILE *)0x0;\nLAB_00047aed:\n  if (local_10 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return pFVar3;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_0006da50();\n}" type_identifier (pointer_declarator "* FUN_00047a70(void)" * (function_declarator "FUN_00047a70(void)" identifier (parameter_list "(void)" ( (parameter_declaration "void" primitive_type) )))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  FILE *pFVar3;\n  int in_GS_OFFSET;\n  char local_74 [100];\n  int local_10;\n  \n  local_10 = *(int *)(in_GS_OFFSET + 0x14);\n  iVar1 = FUN_0005ab10(local_74,100,DAT_000a8adc,&DAT_0007bbd6,1);\n  if (iVar1 != -1) {\n    iVar1 = mkostemp64(local_74,0);\n    if (-1 < iVar1) {\n      iVar2 = unlink(local_74);\n      if (-1 < iVar2) {\n        pFVar3 = fdopen(iVar1,"wb+");\n        goto LAB_00047aed;\n      }\n      close(iVar1);\n    }\n  }\n  pFVar3 = (FILE *)0x0;\nLAB_00047aed:\n  if (local_10 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return pFVar3;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_0006da50();\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "FILE *pFVar3;" type_identifier (pointer_declarator "*pFVar3" * identifier) ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "char local_74 [100];" primitive_type (array_declarator "local_74 [100]" identifier [ number_literal ]) ;) (declaration "int local_10;" primitive_type identifier ;) (expression_statement "local_10 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "local_10 = *(int *)(in_GS_OFFSET + 0x14)" identifier = (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) ;) (expression_statement "iVar1 = FUN_0005ab10(local_74,100,DAT_000a8adc,&DAT_0007bbd6,1);" (assignment_expression "iVar1 = FUN_0005ab10(local_74,100,DAT_000a8adc,&DAT_0007bbd6,1)" identifier = (call_expression "FUN_0005ab10(local_74,100,DAT_000a8adc,&DAT_0007bbd6,1)" identifier (argument_list "(local_74,100,DAT_000a8adc,&DAT_0007bbd6,1)" ( identifier , number_literal , identifier , (pointer_expression "&DAT_0007bbd6" & identifier) , number_literal )))) ;) (if_statement "if (iVar1 != -1) {\n    iVar1 = mkostemp64(local_74,0);\n    if (-1 < iVar1) {\n      iVar2 = unlink(local_74);\n      if (-1 < iVar2) {\n        pFVar3 = fdopen(iVar1,"wb+");\n        goto LAB_00047aed;\n      }\n      close(iVar1);\n    }\n  }" if (parenthesized_expression "(iVar1 != -1)" ( (binary_expression "iVar1 != -1" identifier != number_literal) )) (compound_statement "{\n    iVar1 = mkostemp64(local_74,0);\n    if (-1 < iVar1) {\n      iVar2 = unlink(local_74);\n      if (-1 < iVar2) {\n        pFVar3 = fdopen(iVar1,"wb+");\n        goto LAB_00047aed;\n      }\n      close(iVar1);\n    }\n  }" { (expression_statement "iVar1 = mkostemp64(local_74,0);" (assignment_expression "iVar1 = mkostemp64(local_74,0)" identifier = (call_expression "mkostemp64(local_74,0)" identifier (argument_list "(local_74,0)" ( identifier , number_literal )))) ;) (if_statement "if (-1 < iVar1) {\n      iVar2 = unlink(local_74);\n      if (-1 < iVar2) {\n        pFVar3 = fdopen(iVar1,"wb+");\n        goto LAB_00047aed;\n      }\n      close(iVar1);\n    }" if (parenthesized_expression "(-1 < iVar1)" ( (binary_expression "-1 < iVar1" number_literal < identifier) )) (compound_statement "{\n      iVar2 = unlink(local_74);\n      if (-1 < iVar2) {\n        pFVar3 = fdopen(iVar1,"wb+");\n        goto LAB_00047aed;\n      }\n      close(iVar1);\n    }" { (expression_statement "iVar2 = unlink(local_74);" (assignment_expression "iVar2 = unlink(local_74)" identifier = (call_expression "unlink(local_74)" identifier (argument_list "(local_74)" ( identifier )))) ;) (if_statement "if (-1 < iVar2) {\n        pFVar3 = fdopen(iVar1,"wb+");\n        goto LAB_00047aed;\n      }" if (parenthesized_expression "(-1 < iVar2)" ( (binary_expression "-1 < iVar2" number_literal < identifier) )) (compound_statement "{\n        pFVar3 = fdopen(iVar1,"wb+");\n        goto LAB_00047aed;\n      }" { (expression_statement "pFVar3 = fdopen(iVar1,"wb+");" (assignment_expression "pFVar3 = fdopen(iVar1,"wb+")" identifier = (call_expression "fdopen(iVar1,"wb+")" identifier (argument_list "(iVar1,"wb+")" ( identifier , (string_literal ""wb+"" " string_content ") )))) ;) (goto_statement "goto LAB_00047aed;" goto statement_identifier ;) })) (expression_statement "close(iVar1);" (call_expression "close(iVar1)" identifier (argument_list "(iVar1)" ( identifier ))) ;) })) })) (expression_statement "pFVar3 = (FILE *)0x0;" (assignment_expression "pFVar3 = (FILE *)0x0" identifier = (cast_expression "(FILE *)0x0" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) ;) (labeled_statement "LAB_00047aed:\n  if (local_10 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return pFVar3;\n  }" statement_identifier : (if_statement "if (local_10 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return pFVar3;\n  }" if (parenthesized_expression "(local_10 == *(int *)(in_GS_OFFSET + 0x14))" ( (binary_expression "local_10 == *(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 pFVar3;\n  }" { (return_statement "return pFVar3;" return identifier ;) }))) comment (expression_statement "FUN_0006da50();" (call_expression "FUN_0006da50()" 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/* WARNING: Enum "anon_enum_32": Some values do not have unique names */\n\nFILE * warc_tempfile(void)\n\n{\n  int iVar1;\n  int iVar2;\n  int iVar3;\n  FILE *pFVar4;\n  int in_GS_OFFSET;\n  char filename [100];\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  iVar2 = path_search(filename,100,opt.warc_tempdir,"wget",true);\n  if (iVar2 != -1) {\n    iVar2 = mkostemp64(filename,0);\n    if (-1 < iVar2) {\n      iVar3 = unlink(filename);\n      if (-1 < iVar3) {\n        pFVar4 = fdopen(iVar2,"wb+");\n        goto LAB_00047aed;\n      }\n      close(iVar2);\n    }\n  }\n  pFVar4 = (FILE *)0x0;\nLAB_00047aed:\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return (FILE *)pFVar4;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail_local();\n}\n\n" comment comment comment (function_definition "FILE * warc_tempfile(void)\n\n{\n  int iVar1;\n  int iVar2;\n  int iVar3;\n  FILE *pFVar4;\n  int in_GS_OFFSET;\n  char filename [100];\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  iVar2 = path_search(filename,100,opt.warc_tempdir,"wget",true);\n  if (iVar2 != -1) {\n    iVar2 = mkostemp64(filename,0);\n    if (-1 < iVar2) {\n      iVar3 = unlink(filename);\n      if (-1 < iVar3) {\n        pFVar4 = fdopen(iVar2,"wb+");\n        goto LAB_00047aed;\n      }\n      close(iVar2);\n    }\n  }\n  pFVar4 = (FILE *)0x0;\nLAB_00047aed:\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return (FILE *)pFVar4;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail_local();\n}" type_identifier (pointer_declarator "* warc_tempfile(void)" * (function_declarator "warc_tempfile(void)" identifier (parameter_list "(void)" ( (parameter_declaration "void" primitive_type) )))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  int iVar3;\n  FILE *pFVar4;\n  int in_GS_OFFSET;\n  char filename [100];\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  iVar2 = path_search(filename,100,opt.warc_tempdir,"wget",true);\n  if (iVar2 != -1) {\n    iVar2 = mkostemp64(filename,0);\n    if (-1 < iVar2) {\n      iVar3 = unlink(filename);\n      if (-1 < iVar3) {\n        pFVar4 = fdopen(iVar2,"wb+");\n        goto LAB_00047aed;\n      }\n      close(iVar2);\n    }\n  }\n  pFVar4 = (FILE *)0x0;\nLAB_00047aed:\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return (FILE *)pFVar4;\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 "int iVar3;" primitive_type identifier ;) (declaration "FILE *pFVar4;" type_identifier (pointer_declarator "*pFVar4" * identifier) ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "char filename [100];" primitive_type (array_declarator "filename [100]" 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) ))))) ;) (expression_statement "iVar2 = path_search(filename,100,opt.warc_tempdir,"wget",true);" (assignment_expression "iVar2 = path_search(filename,100,opt.warc_tempdir,"wget",true)" identifier = (call_expression "path_search(filename,100,opt.warc_tempdir,"wget",true)" identifier (argument_list "(filename,100,opt.warc_tempdir,"wget",true)" ( identifier , number_literal , (field_expression "opt.warc_tempdir" identifier . field_identifier) , (string_literal ""wget"" " string_content ") , true )))) ;) (if_statement "if (iVar2 != -1) {\n    iVar2 = mkostemp64(filename,0);\n    if (-1 < iVar2) {\n      iVar3 = unlink(filename);\n      if (-1 < iVar3) {\n        pFVar4 = fdopen(iVar2,"wb+");\n        goto LAB_00047aed;\n      }\n      close(iVar2);\n    }\n  }" if (parenthesized_expression "(iVar2 != -1)" ( (binary_expression "iVar2 != -1" identifier != number_literal) )) (compound_statement "{\n    iVar2 = mkostemp64(filename,0);\n    if (-1 < iVar2) {\n      iVar3 = unlink(filename);\n      if (-1 < iVar3) {\n        pFVar4 = fdopen(iVar2,"wb+");\n        goto LAB_00047aed;\n      }\n      close(iVar2);\n    }\n  }" { (expression_statement "iVar2 = mkostemp64(filename,0);" (assignment_expression "iVar2 = mkostemp64(filename,0)" identifier = (call_expression "mkostemp64(filename,0)" identifier (argument_list "(filename,0)" ( identifier , number_literal )))) ;) (if_statement "if (-1 < iVar2) {\n      iVar3 = unlink(filename);\n      if (-1 < iVar3) {\n        pFVar4 = fdopen(iVar2,"wb+");\n        goto LAB_00047aed;\n      }\n      close(iVar2);\n    }" if (parenthesized_expression "(-1 < iVar2)" ( (binary_expression "-1 < iVar2" number_literal < identifier) )) (compound_statement "{\n      iVar3 = unlink(filename);\n      if (-1 < iVar3) {\n        pFVar4 = fdopen(iVar2,"wb+");\n        goto LAB_00047aed;\n      }\n      close(iVar2);\n    }" { (expression_statement "iVar3 = unlink(filename);" (assignment_expression "iVar3 = unlink(filename)" identifier = (call_expression "unlink(filename)" identifier (argument_list "(filename)" ( identifier )))) ;) (if_statement "if (-1 < iVar3) {\n        pFVar4 = fdopen(iVar2,"wb+");\n        goto LAB_00047aed;\n      }" if (parenthesized_expression "(-1 < iVar3)" ( (binary_expression "-1 < iVar3" number_literal < identifier) )) (compound_statement "{\n        pFVar4 = fdopen(iVar2,"wb+");\n        goto LAB_00047aed;\n      }" { (expression_statement "pFVar4 = fdopen(iVar2,"wb+");" (assignment_expression "pFVar4 = fdopen(iVar2,"wb+")" identifier = (call_expression "fdopen(iVar2,"wb+")" identifier (argument_list "(iVar2,"wb+")" ( identifier , (string_literal ""wb+"" " string_content ") )))) ;) (goto_statement "goto LAB_00047aed;" goto statement_identifier ;) })) (expression_statement "close(iVar2);" (call_expression "close(iVar2)" identifier (argument_list "(iVar2)" ( identifier ))) ;) })) })) (expression_statement "pFVar4 = (FILE *)0x0;" (assignment_expression "pFVar4 = (FILE *)0x0" identifier = (cast_expression "(FILE *)0x0" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) ;) (labeled_statement "LAB_00047aed:\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return (FILE *)pFVar4;\n  }" statement_identifier : (if_statement "if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return (FILE *)pFVar4;\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 (FILE *)pFVar4;\n  }" { (return_statement "return (FILE *)pFVar4;" return (cast_expression "(FILE *)pFVar4" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier) ;) }))) comment (expression_statement "__stack_chk_fail_local();" (call_expression "__stack_chk_fail_local()" identifier (argument_list "()" ( ))) ;) })))
(translation_unit "FILE * FUN_00047a70(void)\n\n{\n  int iVar1;\n  int iVar2;\n  FILE *pFVar3;\n  int in_GS_OFFSET;\n  char local_74 [100];\n  int local_10;\n  \n  local_10 = *(int *)(in_GS_OFFSET + 0x14);\n  iVar1 = FUN_0005ab10(local_74,100,DAT_000a8adc,&DAT_0007bbd6,1);\n  if (iVar1 != -1) {\n    iVar1 = mkostemp64(local_74,0);\n    if (-1 < iVar1) {\n      iVar2 = unlink(local_74);\n      if (-1 < iVar2) {\n        pFVar3 = fdopen(iVar1,"wb+");\n        goto LAB_00047aed;\n      }\n      close(iVar1);\n    }\n  }\n  pFVar3 = (FILE *)0x0;\nLAB_00047aed:\n  if (local_10 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return pFVar3;\n  }\n                    \n  FUN_0006da50();\n}\n\n" (function_definition "FILE * FUN_00047a70(void)\n\n{\n  int iVar1;\n  int iVar2;\n  FILE *pFVar3;\n  int in_GS_OFFSET;\n  char local_74 [100];\n  int local_10;\n  \n  local_10 = *(int *)(in_GS_OFFSET + 0x14);\n  iVar1 = FUN_0005ab10(local_74,100,DAT_000a8adc,&DAT_0007bbd6,1);\n  if (iVar1 != -1) {\n    iVar1 = mkostemp64(local_74,0);\n    if (-1 < iVar1) {\n      iVar2 = unlink(local_74);\n      if (-1 < iVar2) {\n        pFVar3 = fdopen(iVar1,"wb+");\n        goto LAB_00047aed;\n      }\n      close(iVar1);\n    }\n  }\n  pFVar3 = (FILE *)0x0;\nLAB_00047aed:\n  if (local_10 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return pFVar3;\n  }\n                    \n  FUN_0006da50();\n}" type_identifier (pointer_declarator "* FUN_00047a70(void)" * (function_declarator "FUN_00047a70(void)" identifier (parameter_list "(void)" ( (parameter_declaration "void" primitive_type) )))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  FILE *pFVar3;\n  int in_GS_OFFSET;\n  char local_74 [100];\n  int local_10;\n  \n  local_10 = *(int *)(in_GS_OFFSET + 0x14);\n  iVar1 = FUN_0005ab10(local_74,100,DAT_000a8adc,&DAT_0007bbd6,1);\n  if (iVar1 != -1) {\n    iVar1 = mkostemp64(local_74,0);\n    if (-1 < iVar1) {\n      iVar2 = unlink(local_74);\n      if (-1 < iVar2) {\n        pFVar3 = fdopen(iVar1,"wb+");\n        goto LAB_00047aed;\n      }\n      close(iVar1);\n    }\n  }\n  pFVar3 = (FILE *)0x0;\nLAB_00047aed:\n  if (local_10 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return pFVar3;\n  }\n                    \n  FUN_0006da50();\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "FILE *pFVar3;" type_identifier (pointer_declarator "*pFVar3" * identifier) ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "char local_74 [100];" primitive_type (array_declarator "local_74 [100]" identifier [ number_literal ]) ;) (declaration "int local_10;" primitive_type identifier ;) (expression_statement "local_10 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "local_10 = *(int *)(in_GS_OFFSET + 0x14)" identifier = (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) ;) (expression_statement "iVar1 = FUN_0005ab10(local_74,100,DAT_000a8adc,&DAT_0007bbd6,1);" (assignment_expression "iVar1 = FUN_0005ab10(local_74,100,DAT_000a8adc,&DAT_0007bbd6,1)" identifier = (call_expression "FUN_0005ab10(local_74,100,DAT_000a8adc,&DAT_0007bbd6,1)" identifier (argument_list "(local_74,100,DAT_000a8adc,&DAT_0007bbd6,1)" ( identifier , number_literal , identifier , (pointer_expression "&DAT_0007bbd6" & identifier) , number_literal )))) ;) (if_statement "if (iVar1 != -1) {\n    iVar1 = mkostemp64(local_74,0);\n    if (-1 < iVar1) {\n      iVar2 = unlink(local_74);\n      if (-1 < iVar2) {\n        pFVar3 = fdopen(iVar1,"wb+");\n        goto LAB_00047aed;\n      }\n      close(iVar1);\n    }\n  }" if (parenthesized_expression "(iVar1 != -1)" ( (binary_expression "iVar1 != -1" identifier != number_literal) )) (compound_statement "{\n    iVar1 = mkostemp64(local_74,0);\n    if (-1 < iVar1) {\n      iVar2 = unlink(local_74);\n      if (-1 < iVar2) {\n        pFVar3 = fdopen(iVar1,"wb+");\n        goto LAB_00047aed;\n      }\n      close(iVar1);\n    }\n  }" { (expression_statement "iVar1 = mkostemp64(local_74,0);" (assignment_expression "iVar1 = mkostemp64(local_74,0)" identifier = (call_expression "mkostemp64(local_74,0)" identifier (argument_list "(local_74,0)" ( identifier , number_literal )))) ;) (if_statement "if (-1 < iVar1) {\n      iVar2 = unlink(local_74);\n      if (-1 < iVar2) {\n        pFVar3 = fdopen(iVar1,"wb+");\n        goto LAB_00047aed;\n      }\n      close(iVar1);\n    }" if (parenthesized_expression "(-1 < iVar1)" ( (binary_expression "-1 < iVar1" number_literal < identifier) )) (compound_statement "{\n      iVar2 = unlink(local_74);\n      if (-1 < iVar2) {\n        pFVar3 = fdopen(iVar1,"wb+");\n        goto LAB_00047aed;\n      }\n      close(iVar1);\n    }" { (expression_statement "iVar2 = unlink(local_74);" (assignment_expression "iVar2 = unlink(local_74)" identifier = (call_expression "unlink(local_74)" identifier (argument_list "(local_74)" ( identifier )))) ;) (if_statement "if (-1 < iVar2) {\n        pFVar3 = fdopen(iVar1,"wb+");\n        goto LAB_00047aed;\n      }" if (parenthesized_expression "(-1 < iVar2)" ( (binary_expression "-1 < iVar2" number_literal < identifier) )) (compound_statement "{\n        pFVar3 = fdopen(iVar1,"wb+");\n        goto LAB_00047aed;\n      }" { (expression_statement "pFVar3 = fdopen(iVar1,"wb+");" (assignment_expression "pFVar3 = fdopen(iVar1,"wb+")" identifier = (call_expression "fdopen(iVar1,"wb+")" identifier (argument_list "(iVar1,"wb+")" ( identifier , (string_literal ""wb+"" " string_content ") )))) ;) (goto_statement "goto LAB_00047aed;" goto statement_identifier ;) })) (expression_statement "close(iVar1);" (call_expression "close(iVar1)" identifier (argument_list "(iVar1)" ( identifier ))) ;) })) })) (expression_statement "pFVar3 = (FILE *)0x0;" (assignment_expression "pFVar3 = (FILE *)0x0" identifier = (cast_expression "(FILE *)0x0" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) ;) (labeled_statement "LAB_00047aed:\n  if (local_10 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return pFVar3;\n  }" statement_identifier : (if_statement "if (local_10 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return pFVar3;\n  }" if (parenthesized_expression "(local_10 == *(int *)(in_GS_OFFSET + 0x14))" ( (binary_expression "local_10 == *(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 pFVar3;\n  }" { (return_statement "return pFVar3;" return identifier ;) }))) (expression_statement "FUN_0006da50();" (call_expression "FUN_0006da50()" identifier (argument_list "()" ( ))) ;) })))
(translation_unit (function_definition TYPE (pointer_declarator * (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE) )))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * 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 *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , LIT , IDENT , (pointer_expression & IDENT) , LIT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , LIT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression LIT < IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression LIT < IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , (string_literal " string_content ") )))) ;) (goto_statement goto statement_identifier ;) })) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) })) })) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) 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 "FILE * FUN_00047a70(void)\n\n{\n  int iVar1;\n  int iVar2;\n  FILE *pFVar3;\n  int in_GS_OFFSET;\n  char local_74 [100];\n  int local_10;\n  \n  local_10 = *(int *)(in_GS_OFFSET + 0x14);\n  iVar1 = FUN_0005ab10(local_74,100,DAT_000a8adc,&DAT_0007bbd6,1);\n  if (iVar1 != -1) {\n    iVar1 = mkostemp64(local_74,0);\n    if (-1 < iVar1) {\n      iVar2 = unlink(local_74);\n      if (-1 < iVar2) {\n        pFVar3 = fdopen(iVar1,"wb+");\n        goto LAB_00047aed;\n      }\n      close(iVar1);\n    }\n  }\n  pFVar3 = (FILE *)0x0;\nLAB_00047aed:\n  if (local_10 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return pFVar3;\n  }\n                    \n  FUN_0006da50();\n}" (type_identifier "FILE") (pointer_declarator "* FUN_00047a70(void)" (* "*") (function_declarator "FUN_00047a70(void)" (identifier "FUN_00047a70") (parameter_list "(void)" (( "(") (parameter_declaration "void" (primitive_type "void")) () ")")))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  FILE *pFVar3;\n  int in_GS_OFFSET;\n  char local_74 [100];\n  int local_10;\n  \n  local_10 = *(int *)(in_GS_OFFSET + 0x14);\n  iVar1 = FUN_0005ab10(local_74,100,DAT_000a8adc,&DAT_0007bbd6,1);\n  if (iVar1 != -1) {\n    iVar1 = mkostemp64(local_74,0);\n    if (-1 < iVar1) {\n      iVar2 = unlink(local_74);\n      if (-1 < iVar2) {\n        pFVar3 = fdopen(iVar1,"wb+");\n        goto LAB_00047aed;\n      }\n      close(iVar1);\n    }\n  }\n  pFVar3 = (FILE *)0x0;\nLAB_00047aed:\n  if (local_10 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return pFVar3;\n  }\n                    \n  FUN_0006da50();\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (declaration "FILE *pFVar3;" (type_identifier "FILE") (pointer_declarator "*pFVar3" (* "*") (identifier "pFVar3")) (; ";")) (declaration "int in_GS_OFFSET;" (primitive_type "int") (identifier "in_GS_OFFSET") (; ";")) (declaration "char local_74 [100];" (primitive_type "char") (array_declarator "local_74 [100]" (identifier "local_74") ([ "[") (number_literal "100") (] "]")) (; ";")) (declaration "int local_10;" (primitive_type "int") (identifier "local_10") (; ";")) (expression_statement "local_10 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "local_10 = *(int *)(in_GS_OFFSET + 0x14)" (identifier "local_10") (= "=") (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" (* "*") (cast_expression "(int *)(in_GS_OFFSET + 0x14)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(in_GS_OFFSET + 0x14)" (( "(") (binary_expression "in_GS_OFFSET + 0x14" (identifier "in_GS_OFFSET") (+ "+") (number_literal "0x14")) () ")"))))) (; ";")) (expression_statement "iVar1 = FUN_0005ab10(local_74,100,DAT_000a8adc,&DAT_0007bbd6,1);" (assignment_expression "iVar1 = FUN_0005ab10(local_74,100,DAT_000a8adc,&DAT_0007bbd6,1)" (identifier "iVar1") (= "=") (call_expression "FUN_0005ab10(local_74,100,DAT_000a8adc,&DAT_0007bbd6,1)" (identifier "FUN_0005ab10") (argument_list "(local_74,100,DAT_000a8adc,&DAT_0007bbd6,1)" (( "(") (identifier "local_74") (, ",") (number_literal "100") (, ",") (identifier "DAT_000a8adc") (, ",") (pointer_expression "&DAT_0007bbd6" (& "&") (identifier "DAT_0007bbd6")) (, ",") (number_literal "1") () ")")))) (; ";")) (if_statement "if (iVar1 != -1) {\n    iVar1 = mkostemp64(local_74,0);\n    if (-1 < iVar1) {\n      iVar2 = unlink(local_74);\n      if (-1 < iVar2) {\n        pFVar3 = fdopen(iVar1,"wb+");\n        goto LAB_00047aed;\n      }\n      close(iVar1);\n    }\n  }" (if "if") (parenthesized_expression "(iVar1 != -1)" (( "(") (binary_expression "iVar1 != -1" (identifier "iVar1") (!= "!=") (number_literal "-1")) () ")")) (compound_statement "{\n    iVar1 = mkostemp64(local_74,0);\n    if (-1 < iVar1) {\n      iVar2 = unlink(local_74);\n      if (-1 < iVar2) {\n        pFVar3 = fdopen(iVar1,"wb+");\n        goto LAB_00047aed;\n      }\n      close(iVar1);\n    }\n  }" ({ "{") (expression_statement "iVar1 = mkostemp64(local_74,0);" (assignment_expression "iVar1 = mkostemp64(local_74,0)" (identifier "iVar1") (= "=") (call_expression "mkostemp64(local_74,0)" (identifier "mkostemp64") (argument_list "(local_74,0)" (( "(") (identifier "local_74") (, ",") (number_literal "0") () ")")))) (; ";")) (if_statement "if (-1 < iVar1) {\n      iVar2 = unlink(local_74);\n      if (-1 < iVar2) {\n        pFVar3 = fdopen(iVar1,"wb+");\n        goto LAB_00047aed;\n      }\n      close(iVar1);\n    }" (if "if") (parenthesized_expression "(-1 < iVar1)" (( "(") (binary_expression "-1 < iVar1" (number_literal "-1") (< "<") (identifier "iVar1")) () ")")) (compound_statement "{\n      iVar2 = unlink(local_74);\n      if (-1 < iVar2) {\n        pFVar3 = fdopen(iVar1,"wb+");\n        goto LAB_00047aed;\n      }\n      close(iVar1);\n    }" ({ "{") (expression_statement "iVar2 = unlink(local_74);" (assignment_expression "iVar2 = unlink(local_74)" (identifier "iVar2") (= "=") (call_expression "unlink(local_74)" (identifier "unlink") (argument_list "(local_74)" (( "(") (identifier "local_74") () ")")))) (; ";")) (if_statement "if (-1 < iVar2) {\n        pFVar3 = fdopen(iVar1,"wb+");\n        goto LAB_00047aed;\n      }" (if "if") (parenthesized_expression "(-1 < iVar2)" (( "(") (binary_expression "-1 < iVar2" (number_literal "-1") (< "<") (identifier "iVar2")) () ")")) (compound_statement "{\n        pFVar3 = fdopen(iVar1,"wb+");\n        goto LAB_00047aed;\n      }" ({ "{") (expression_statement "pFVar3 = fdopen(iVar1,"wb+");" (assignment_expression "pFVar3 = fdopen(iVar1,"wb+")" (identifier "pFVar3") (= "=") (call_expression "fdopen(iVar1,"wb+")" (identifier "fdopen") (argument_list "(iVar1,"wb+")" (( "(") (identifier "iVar1") (, ",") (string_literal ""wb+"" (" """) (string_content "wb+") (" """)) () ")")))) (; ";")) (goto_statement "goto LAB_00047aed;" (goto "goto") (statement_identifier "LAB_00047aed") (; ";")) (} "}"))) (expression_statement "close(iVar1);" (call_expression "close(iVar1)" (identifier "close") (argument_list "(iVar1)" (( "(") (identifier "iVar1") () ")"))) (; ";")) (} "}"))) (} "}"))) (expression_statement "pFVar3 = (FILE *)0x0;" (assignment_expression "pFVar3 = (FILE *)0x0" (identifier "pFVar3") (= "=") (cast_expression "(FILE *)0x0" (( "(") (type_descriptor "FILE *" (type_identifier "FILE") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) (; ";")) (labeled_statement "LAB_00047aed:\n  if (local_10 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return pFVar3;\n  }" (statement_identifier "LAB_00047aed") (: ":") (if_statement "if (local_10 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return pFVar3;\n  }" (if "if") (parenthesized_expression "(local_10 == *(int *)(in_GS_OFFSET + 0x14))" (( "(") (binary_expression "local_10 == *(int *)(in_GS_OFFSET + 0x14)" (identifier "local_10") (== "==") (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 pFVar3;\n  }" ({ "{") (return_statement "return pFVar3;" (return "return") (identifier "pFVar3") (; ";")) (} "}")))) (expression_statement "FUN_0006da50();" (call_expression "FUN_0006da50()" (identifier "FUN_0006da50") (argument_list "()" (( "(") () ")"))) (; ";")) (} "}")))

/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */
/* WARNING: Unknown calling convention */
/* WARNING: Enum "anon_enum_32": Some values do not have unique names */

type_1 * function_1(void)

{
  int var_9;
  int var_3;
  int var_6;
  type_1 *pFVar4;
  int var_1;
  char filename [100];
  
  var_9 = *(int *)(var_1 + 0x14);
  var_3 = var_2(filename,100,opt.warc_tempdir,"wget",true);
  if (var_3 != -1) {
    var_3 = var_4(filename,0);
    if (-1 < var_3) {
      var_6 = var_5(filename);
      if (-1 < var_6) {
        pFVar4 = var_7(var_3,"wb+");
        goto LAB_00047aed;
      }
      var_8(var_3);
    }
  }
  pFVar4 = (type_1 *)0x0;
LAB_00047aed:
  if (var_9 == *(int *)(var_1 + 0x14)) {
    return (type_1 *)pFVar4;
  }
                    /* WARNING: Subroutine does not return */
  var_10();
}


(translation_unit (function_definition type: (type_identifier) declarator: (pointer_declarator declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (primitive_type))))) body: (compound_statement (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) 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: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (number_literal) (identifier) (pointer_expression argument: (identifier)) (number_literal))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (number_literal))))) (if_statement condition: (parenthesized_expression (binary_expression left: (number_literal) right: (identifier))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (number_literal) right: (identifier))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (string_literal (string_content)))))) (goto_statement label: (statement_identifier)))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier)))))))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (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 */

FILE * MASKED(void)

{
  int iVar1;
  int iVar2;
  FILE *pFVar3;
  int in_GS_OFFSET;
  char local_74 [100];
  int local_10;
  
  local_10 = *(int *)(in_GS_OFFSET + 0x14);
  iVar1 = FUN_0005ab10(local_74,100,DAT_000a8adc,&DAT_0007bbd6,1);
  if (iVar1 != -1) {
    iVar1 = mkostemp64(local_74,0);
    if (-1 < iVar1) {
      iVar2 = unlink(local_74);
      if (-1 < iVar2) {
        pFVar3 = fdopen(iVar1,"wb+");
        goto LAB_00047aed;
      }
      close(iVar1);
    }
  }
  pFVar3 = (FILE *)0x0;
LAB_00047aed:
  if (local_10 == *(int *)(in_GS_OFFSET + 0x14)) {
    return pFVar3;
  }
                    /* WARNING: Subroutine does not return */
  FUN_0006da50();
}

