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

FILE * f_open(Filename *filename,char *mode,int is_private)

{
  int __fd;
  FILE *pFVar1;
  
  if (is_private == 0) {
    pFVar1 = fopen64(filename->path,mode);
    return (FILE *)pFVar1;
  }
  if (*mode == 'w') {
    __fd = open64(filename->path,0x241,0x180);
    pFVar1 = (FILE *)0x0;
    if (-1 < __fd) {
      pFVar1 = fdopen(__fd,mode);
    }
    return (FILE *)pFVar1;
  }
                    /* WARNING: Subroutine does not return */
  __assert_fail("mode[0] == \'w\'","unix/uxmisc.c",0xfe,"f_open");
}



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

FILE * FUN_00051f30(undefined4 *param_1,char *param_2,int param_3)

{
  int __fd;
  FILE *pFVar1;
  
  if (param_3 == 0) {
    pFVar1 = fopen64((char *)*param_1,param_2);
    return pFVar1;
  }
  if (*param_2 == 'w') {
    __fd = open64((char *)*param_1,0x241,0x180);
    pFVar1 = (FILE *)0x0;
    if (-1 < __fd) {
      pFVar1 = fdopen(__fd,param_2);
    }
    return pFVar1;
  }
                    /* WARNING: Subroutine does not return */
  __assert_fail("mode[0] == \'w\'","unix/uxmisc.c",0xfe,"f_open");
}


PUSH ESI
PUSH EBX
CALL 0x00015340
ADD EBX,0x32db1
SUB ESP,0x4
MOV EAX,dword ptr [ESP + 0x18]
MOV ESI,dword ptr [ESP + 0x14]
TEST EAX,EAX
JZ 0x00051f90
CMP byte ptr [ESI],0x77
JNZ 0x00051fa8
SUB ESP,0x4
PUSH 0x180
PUSH 0x241
MOV EAX,dword ptr [ESP + 0x1c]
PUSH dword ptr [EAX]
CALL 0x00014120
ADD ESP,0x10
MOV EDX,EAX
XOR EAX,EAX
TEST EDX,EDX
JS 0x00051f81
SUB ESP,0x8
PUSH ESI
PUSH EDX
CALL 0x00014570
ADD ESP,0x10
ADD ESP,0x4
POP EBX
POP ESI
RET
SUB ESP,0x8
PUSH ESI
MOV EAX,dword ptr [ESP + 0x1c]
PUSH dword ptr [EAX]
CALL 0x00014310
ADD ESP,0x10
ADD ESP,0x4
POP EBX
POP ESI
RET
LEA EAX,[EBX + 0xfffe0a24]
PUSH EAX
LEA EAX,[EBX + 0xfffe09e7]
PUSH 0xfe
PUSH EAX
LEA EAX,[EBX + 0xfffe09f5]
PUSH EAX
CALL 0x00014ad0
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nFILE * FUN_00051f30(undefined4 *param_1,char *param_2,int param_3)\n\n{\n  int __fd;\n  FILE *pFVar1;\n  \n  if (param_3 == 0) {\n    pFVar1 = fopen64((char *)*param_1,param_2);\n    return pFVar1;\n  }\n  if (*param_2 == 'w') {\n    __fd = open64((char *)*param_1,0x241,0x180);\n    pFVar1 = (FILE *)0x0;\n    if (-1 < __fd) {\n      pFVar1 = fdopen(__fd,param_2);\n    }\n    return pFVar1;\n  }\n                    /* WARNING: Subroutine does not return */\n  __assert_fail("mode[0] == \'w\'","unix/uxmisc.c",0xfe,"f_open");\n}\n\n" comment (function_definition "FILE * FUN_00051f30(undefined4 *param_1,char *param_2,int param_3)\n\n{\n  int __fd;\n  FILE *pFVar1;\n  \n  if (param_3 == 0) {\n    pFVar1 = fopen64((char *)*param_1,param_2);\n    return pFVar1;\n  }\n  if (*param_2 == 'w') {\n    __fd = open64((char *)*param_1,0x241,0x180);\n    pFVar1 = (FILE *)0x0;\n    if (-1 < __fd) {\n      pFVar1 = fdopen(__fd,param_2);\n    }\n    return pFVar1;\n  }\n                    /* WARNING: Subroutine does not return */\n  __assert_fail("mode[0] == \'w\'","unix/uxmisc.c",0xfe,"f_open");\n}" type_identifier (pointer_declarator "* FUN_00051f30(undefined4 *param_1,char *param_2,int param_3)" * (function_declarator "FUN_00051f30(undefined4 *param_1,char *param_2,int param_3)" identifier (parameter_list "(undefined4 *param_1,char *param_2,int param_3)" ( (parameter_declaration "undefined4 *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "char *param_2" primitive_type (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "int param_3" primitive_type identifier) )))) (compound_statement "{\n  int __fd;\n  FILE *pFVar1;\n  \n  if (param_3 == 0) {\n    pFVar1 = fopen64((char *)*param_1,param_2);\n    return pFVar1;\n  }\n  if (*param_2 == 'w') {\n    __fd = open64((char *)*param_1,0x241,0x180);\n    pFVar1 = (FILE *)0x0;\n    if (-1 < __fd) {\n      pFVar1 = fdopen(__fd,param_2);\n    }\n    return pFVar1;\n  }\n                    /* WARNING: Subroutine does not return */\n  __assert_fail("mode[0] == \'w\'","unix/uxmisc.c",0xfe,"f_open");\n}" { (declaration "int __fd;" primitive_type identifier ;) (declaration "FILE *pFVar1;" type_identifier (pointer_declarator "*pFVar1" * identifier) ;) (if_statement "if (param_3 == 0) {\n    pFVar1 = fopen64((char *)*param_1,param_2);\n    return pFVar1;\n  }" if (parenthesized_expression "(param_3 == 0)" ( (binary_expression "param_3 == 0" identifier == number_literal) )) (compound_statement "{\n    pFVar1 = fopen64((char *)*param_1,param_2);\n    return pFVar1;\n  }" { (expression_statement "pFVar1 = fopen64((char *)*param_1,param_2);" (assignment_expression "pFVar1 = fopen64((char *)*param_1,param_2)" identifier = (call_expression "fopen64((char *)*param_1,param_2)" identifier (argument_list "((char *)*param_1,param_2)" ( (cast_expression "(char *)*param_1" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier)) , identifier )))) ;) (return_statement "return pFVar1;" return identifier ;) })) (if_statement "if (*param_2 == 'w') {\n    __fd = open64((char *)*param_1,0x241,0x180);\n    pFVar1 = (FILE *)0x0;\n    if (-1 < __fd) {\n      pFVar1 = fdopen(__fd,param_2);\n    }\n    return pFVar1;\n  }" if (parenthesized_expression "(*param_2 == 'w')" ( (binary_expression "*param_2 == 'w'" (pointer_expression "*param_2" * identifier) == (char_literal "'w'" ' character ')) )) (compound_statement "{\n    __fd = open64((char *)*param_1,0x241,0x180);\n    pFVar1 = (FILE *)0x0;\n    if (-1 < __fd) {\n      pFVar1 = fdopen(__fd,param_2);\n    }\n    return pFVar1;\n  }" { (expression_statement "__fd = open64((char *)*param_1,0x241,0x180);" (assignment_expression "__fd = open64((char *)*param_1,0x241,0x180)" identifier = (call_expression "open64((char *)*param_1,0x241,0x180)" identifier (argument_list "((char *)*param_1,0x241,0x180)" ( (cast_expression "(char *)*param_1" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier)) , number_literal , number_literal )))) ;) (expression_statement "pFVar1 = (FILE *)0x0;" (assignment_expression "pFVar1 = (FILE *)0x0" identifier = (cast_expression "(FILE *)0x0" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) ;) (if_statement "if (-1 < __fd) {\n      pFVar1 = fdopen(__fd,param_2);\n    }" if (parenthesized_expression "(-1 < __fd)" ( (binary_expression "-1 < __fd" number_literal < identifier) )) (compound_statement "{\n      pFVar1 = fdopen(__fd,param_2);\n    }" { (expression_statement "pFVar1 = fdopen(__fd,param_2);" (assignment_expression "pFVar1 = fdopen(__fd,param_2)" identifier = (call_expression "fdopen(__fd,param_2)" identifier (argument_list "(__fd,param_2)" ( identifier , identifier )))) ;) })) (return_statement "return pFVar1;" return identifier ;) })) comment (expression_statement "__assert_fail("mode[0] == \'w\'","unix/uxmisc.c",0xfe,"f_open");" (call_expression "__assert_fail("mode[0] == \'w\'","unix/uxmisc.c",0xfe,"f_open")" identifier (argument_list "("mode[0] == \'w\'","unix/uxmisc.c",0xfe,"f_open")" ( (string_literal ""mode[0] == \'w\'"" " string_content escape_sequence string_content escape_sequence ") , (string_literal ""unix/uxmisc.c"" " string_content ") , number_literal , (string_literal ""f_open"" " string_content ") ))) ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* WARNING: Unknown calling convention */\n\nFILE * f_open(Filename *filename,char *mode,int is_private)\n\n{\n  int __fd;\n  FILE *pFVar1;\n  \n  if (is_private == 0) {\n    pFVar1 = fopen64(filename->path,mode);\n    return (FILE *)pFVar1;\n  }\n  if (*mode == 'w') {\n    __fd = open64(filename->path,0x241,0x180);\n    pFVar1 = (FILE *)0x0;\n    if (-1 < __fd) {\n      pFVar1 = fdopen(__fd,mode);\n    }\n    return (FILE *)pFVar1;\n  }\n                    /* WARNING: Subroutine does not return */\n  __assert_fail("mode[0] == \'w\'","unix/uxmisc.c",0xfe,"f_open");\n}\n\n" comment comment (function_definition "FILE * f_open(Filename *filename,char *mode,int is_private)\n\n{\n  int __fd;\n  FILE *pFVar1;\n  \n  if (is_private == 0) {\n    pFVar1 = fopen64(filename->path,mode);\n    return (FILE *)pFVar1;\n  }\n  if (*mode == 'w') {\n    __fd = open64(filename->path,0x241,0x180);\n    pFVar1 = (FILE *)0x0;\n    if (-1 < __fd) {\n      pFVar1 = fdopen(__fd,mode);\n    }\n    return (FILE *)pFVar1;\n  }\n                    /* WARNING: Subroutine does not return */\n  __assert_fail("mode[0] == \'w\'","unix/uxmisc.c",0xfe,"f_open");\n}" type_identifier (pointer_declarator "* f_open(Filename *filename,char *mode,int is_private)" * (function_declarator "f_open(Filename *filename,char *mode,int is_private)" identifier (parameter_list "(Filename *filename,char *mode,int is_private)" ( (parameter_declaration "Filename *filename" type_identifier (pointer_declarator "*filename" * identifier)) , (parameter_declaration "char *mode" primitive_type (pointer_declarator "*mode" * identifier)) , (parameter_declaration "int is_private" primitive_type identifier) )))) (compound_statement "{\n  int __fd;\n  FILE *pFVar1;\n  \n  if (is_private == 0) {\n    pFVar1 = fopen64(filename->path,mode);\n    return (FILE *)pFVar1;\n  }\n  if (*mode == 'w') {\n    __fd = open64(filename->path,0x241,0x180);\n    pFVar1 = (FILE *)0x0;\n    if (-1 < __fd) {\n      pFVar1 = fdopen(__fd,mode);\n    }\n    return (FILE *)pFVar1;\n  }\n                    /* WARNING: Subroutine does not return */\n  __assert_fail("mode[0] == \'w\'","unix/uxmisc.c",0xfe,"f_open");\n}" { (declaration "int __fd;" primitive_type identifier ;) (declaration "FILE *pFVar1;" type_identifier (pointer_declarator "*pFVar1" * identifier) ;) (if_statement "if (is_private == 0) {\n    pFVar1 = fopen64(filename->path,mode);\n    return (FILE *)pFVar1;\n  }" if (parenthesized_expression "(is_private == 0)" ( (binary_expression "is_private == 0" identifier == number_literal) )) (compound_statement "{\n    pFVar1 = fopen64(filename->path,mode);\n    return (FILE *)pFVar1;\n  }" { (expression_statement "pFVar1 = fopen64(filename->path,mode);" (assignment_expression "pFVar1 = fopen64(filename->path,mode)" identifier = (call_expression "fopen64(filename->path,mode)" identifier (argument_list "(filename->path,mode)" ( (field_expression "filename->path" identifier -> field_identifier) , identifier )))) ;) (return_statement "return (FILE *)pFVar1;" return (cast_expression "(FILE *)pFVar1" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier) ;) })) (if_statement "if (*mode == 'w') {\n    __fd = open64(filename->path,0x241,0x180);\n    pFVar1 = (FILE *)0x0;\n    if (-1 < __fd) {\n      pFVar1 = fdopen(__fd,mode);\n    }\n    return (FILE *)pFVar1;\n  }" if (parenthesized_expression "(*mode == 'w')" ( (binary_expression "*mode == 'w'" (pointer_expression "*mode" * identifier) == (char_literal "'w'" ' character ')) )) (compound_statement "{\n    __fd = open64(filename->path,0x241,0x180);\n    pFVar1 = (FILE *)0x0;\n    if (-1 < __fd) {\n      pFVar1 = fdopen(__fd,mode);\n    }\n    return (FILE *)pFVar1;\n  }" { (expression_statement "__fd = open64(filename->path,0x241,0x180);" (assignment_expression "__fd = open64(filename->path,0x241,0x180)" identifier = (call_expression "open64(filename->path,0x241,0x180)" identifier (argument_list "(filename->path,0x241,0x180)" ( (field_expression "filename->path" identifier -> field_identifier) , number_literal , number_literal )))) ;) (expression_statement "pFVar1 = (FILE *)0x0;" (assignment_expression "pFVar1 = (FILE *)0x0" identifier = (cast_expression "(FILE *)0x0" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) ;) (if_statement "if (-1 < __fd) {\n      pFVar1 = fdopen(__fd,mode);\n    }" if (parenthesized_expression "(-1 < __fd)" ( (binary_expression "-1 < __fd" number_literal < identifier) )) (compound_statement "{\n      pFVar1 = fdopen(__fd,mode);\n    }" { (expression_statement "pFVar1 = fdopen(__fd,mode);" (assignment_expression "pFVar1 = fdopen(__fd,mode)" identifier = (call_expression "fdopen(__fd,mode)" identifier (argument_list "(__fd,mode)" ( identifier , identifier )))) ;) })) (return_statement "return (FILE *)pFVar1;" return (cast_expression "(FILE *)pFVar1" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier) ;) })) comment (expression_statement "__assert_fail("mode[0] == \'w\'","unix/uxmisc.c",0xfe,"f_open");" (call_expression "__assert_fail("mode[0] == \'w\'","unix/uxmisc.c",0xfe,"f_open")" identifier (argument_list "("mode[0] == \'w\'","unix/uxmisc.c",0xfe,"f_open")" ( (string_literal ""mode[0] == \'w\'"" " string_content escape_sequence string_content escape_sequence ") , (string_literal ""unix/uxmisc.c"" " string_content ") , number_literal , (string_literal ""f_open"" " string_content ") ))) ;) })))
(translation_unit "FILE * FUN_00051f30(undefined4 *param_1,char *param_2,int param_3)\n\n{\n  int __fd;\n  FILE *pFVar1;\n  \n  if (param_3 == 0) {\n    pFVar1 = fopen64((char *)*param_1,param_2);\n    return pFVar1;\n  }\n  if (*param_2 == 'w') {\n    __fd = open64((char *)*param_1,0x241,0x180);\n    pFVar1 = (FILE *)0x0;\n    if (-1 < __fd) {\n      pFVar1 = fdopen(__fd,param_2);\n    }\n    return pFVar1;\n  }\n                    \n  __assert_fail("mode[0] == \'w\'","unix/uxmisc.c",0xfe,"f_open");\n}\n\n" (function_definition "FILE * FUN_00051f30(undefined4 *param_1,char *param_2,int param_3)\n\n{\n  int __fd;\n  FILE *pFVar1;\n  \n  if (param_3 == 0) {\n    pFVar1 = fopen64((char *)*param_1,param_2);\n    return pFVar1;\n  }\n  if (*param_2 == 'w') {\n    __fd = open64((char *)*param_1,0x241,0x180);\n    pFVar1 = (FILE *)0x0;\n    if (-1 < __fd) {\n      pFVar1 = fdopen(__fd,param_2);\n    }\n    return pFVar1;\n  }\n                    \n  __assert_fail("mode[0] == \'w\'","unix/uxmisc.c",0xfe,"f_open");\n}" type_identifier (pointer_declarator "* FUN_00051f30(undefined4 *param_1,char *param_2,int param_3)" * (function_declarator "FUN_00051f30(undefined4 *param_1,char *param_2,int param_3)" identifier (parameter_list "(undefined4 *param_1,char *param_2,int param_3)" ( (parameter_declaration "undefined4 *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "char *param_2" primitive_type (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "int param_3" primitive_type identifier) )))) (compound_statement "{\n  int __fd;\n  FILE *pFVar1;\n  \n  if (param_3 == 0) {\n    pFVar1 = fopen64((char *)*param_1,param_2);\n    return pFVar1;\n  }\n  if (*param_2 == 'w') {\n    __fd = open64((char *)*param_1,0x241,0x180);\n    pFVar1 = (FILE *)0x0;\n    if (-1 < __fd) {\n      pFVar1 = fdopen(__fd,param_2);\n    }\n    return pFVar1;\n  }\n                    \n  __assert_fail("mode[0] == \'w\'","unix/uxmisc.c",0xfe,"f_open");\n}" { (declaration "int __fd;" primitive_type identifier ;) (declaration "FILE *pFVar1;" type_identifier (pointer_declarator "*pFVar1" * identifier) ;) (if_statement "if (param_3 == 0) {\n    pFVar1 = fopen64((char *)*param_1,param_2);\n    return pFVar1;\n  }" if (parenthesized_expression "(param_3 == 0)" ( (binary_expression "param_3 == 0" identifier == number_literal) )) (compound_statement "{\n    pFVar1 = fopen64((char *)*param_1,param_2);\n    return pFVar1;\n  }" { (expression_statement "pFVar1 = fopen64((char *)*param_1,param_2);" (assignment_expression "pFVar1 = fopen64((char *)*param_1,param_2)" identifier = (call_expression "fopen64((char *)*param_1,param_2)" identifier (argument_list "((char *)*param_1,param_2)" ( (cast_expression "(char *)*param_1" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier)) , identifier )))) ;) (return_statement "return pFVar1;" return identifier ;) })) (if_statement "if (*param_2 == 'w') {\n    __fd = open64((char *)*param_1,0x241,0x180);\n    pFVar1 = (FILE *)0x0;\n    if (-1 < __fd) {\n      pFVar1 = fdopen(__fd,param_2);\n    }\n    return pFVar1;\n  }" if (parenthesized_expression "(*param_2 == 'w')" ( (binary_expression "*param_2 == 'w'" (pointer_expression "*param_2" * identifier) == (char_literal "'w'" ' character ')) )) (compound_statement "{\n    __fd = open64((char *)*param_1,0x241,0x180);\n    pFVar1 = (FILE *)0x0;\n    if (-1 < __fd) {\n      pFVar1 = fdopen(__fd,param_2);\n    }\n    return pFVar1;\n  }" { (expression_statement "__fd = open64((char *)*param_1,0x241,0x180);" (assignment_expression "__fd = open64((char *)*param_1,0x241,0x180)" identifier = (call_expression "open64((char *)*param_1,0x241,0x180)" identifier (argument_list "((char *)*param_1,0x241,0x180)" ( (cast_expression "(char *)*param_1" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier)) , number_literal , number_literal )))) ;) (expression_statement "pFVar1 = (FILE *)0x0;" (assignment_expression "pFVar1 = (FILE *)0x0" identifier = (cast_expression "(FILE *)0x0" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) ;) (if_statement "if (-1 < __fd) {\n      pFVar1 = fdopen(__fd,param_2);\n    }" if (parenthesized_expression "(-1 < __fd)" ( (binary_expression "-1 < __fd" number_literal < identifier) )) (compound_statement "{\n      pFVar1 = fdopen(__fd,param_2);\n    }" { (expression_statement "pFVar1 = fdopen(__fd,param_2);" (assignment_expression "pFVar1 = fdopen(__fd,param_2)" identifier = (call_expression "fdopen(__fd,param_2)" identifier (argument_list "(__fd,param_2)" ( identifier , identifier )))) ;) })) (return_statement "return pFVar1;" return identifier ;) })) (expression_statement "__assert_fail("mode[0] == \'w\'","unix/uxmisc.c",0xfe,"f_open");" (call_expression "__assert_fail("mode[0] == \'w\'","unix/uxmisc.c",0xfe,"f_open")" identifier (argument_list "("mode[0] == \'w\'","unix/uxmisc.c",0xfe,"f_open")" ( (string_literal ""mode[0] == \'w\'"" " string_content escape_sequence string_content escape_sequence ") , (string_literal ""unix/uxmisc.c"" " string_content ") , number_literal , (string_literal ""f_open"" " string_content ") ))) ;) })))
(translation_unit (function_definition TYPE (pointer_declarator * (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) )))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (pointer_expression * IDENT)) , IDENT )))) ;) (return_statement return IDENT ;) })) (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) == (char_literal ' character ')) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (pointer_expression * IDENT)) , LIT , LIT )))) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) ;) (if_statement if (parenthesized_expression ( (binary_expression LIT < IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT )))) ;) })) (return_statement return IDENT ;) })) (expression_statement (call_expression IDENT (argument_list ( (string_literal " string_content escape_sequence string_content escape_sequence ") , (string_literal " string_content ") , LIT , (string_literal " string_content ") ))) ;) })))
(function_definition "FILE * FUN_00051f30(undefined4 *param_1,char *param_2,int param_3)\n\n{\n  int __fd;\n  FILE *pFVar1;\n  \n  if (param_3 == 0) {\n    pFVar1 = fopen64((char *)*param_1,param_2);\n    return pFVar1;\n  }\n  if (*param_2 == 'w') {\n    __fd = open64((char *)*param_1,0x241,0x180);\n    pFVar1 = (FILE *)0x0;\n    if (-1 < __fd) {\n      pFVar1 = fdopen(__fd,param_2);\n    }\n    return pFVar1;\n  }\n                    \n  __assert_fail("mode[0] == \'w\'","unix/uxmisc.c",0xfe,"f_open");\n}" (type_identifier "FILE") (pointer_declarator "* FUN_00051f30(undefined4 *param_1,char *param_2,int param_3)" (* "*") (function_declarator "FUN_00051f30(undefined4 *param_1,char *param_2,int param_3)" (identifier "FUN_00051f30") (parameter_list "(undefined4 *param_1,char *param_2,int param_3)" (( "(") (parameter_declaration "undefined4 *param_1" (type_identifier "undefined4") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "char *param_2" (primitive_type "char") (pointer_declarator "*param_2" (* "*") (identifier "param_2"))) (, ",") (parameter_declaration "int param_3" (primitive_type "int") (identifier "param_3")) () ")")))) (compound_statement "{\n  int __fd;\n  FILE *pFVar1;\n  \n  if (param_3 == 0) {\n    pFVar1 = fopen64((char *)*param_1,param_2);\n    return pFVar1;\n  }\n  if (*param_2 == 'w') {\n    __fd = open64((char *)*param_1,0x241,0x180);\n    pFVar1 = (FILE *)0x0;\n    if (-1 < __fd) {\n      pFVar1 = fdopen(__fd,param_2);\n    }\n    return pFVar1;\n  }\n                    \n  __assert_fail("mode[0] == \'w\'","unix/uxmisc.c",0xfe,"f_open");\n}" ({ "{") (declaration "int __fd;" (primitive_type "int") (identifier "__fd") (; ";")) (declaration "FILE *pFVar1;" (type_identifier "FILE") (pointer_declarator "*pFVar1" (* "*") (identifier "pFVar1")) (; ";")) (if_statement "if (param_3 == 0) {\n    pFVar1 = fopen64((char *)*param_1,param_2);\n    return pFVar1;\n  }" (if "if") (parenthesized_expression "(param_3 == 0)" (( "(") (binary_expression "param_3 == 0" (identifier "param_3") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n    pFVar1 = fopen64((char *)*param_1,param_2);\n    return pFVar1;\n  }" ({ "{") (expression_statement "pFVar1 = fopen64((char *)*param_1,param_2);" (assignment_expression "pFVar1 = fopen64((char *)*param_1,param_2)" (identifier "pFVar1") (= "=") (call_expression "fopen64((char *)*param_1,param_2)" (identifier "fopen64") (argument_list "((char *)*param_1,param_2)" (( "(") (cast_expression "(char *)*param_1" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*param_1" (* "*") (identifier "param_1"))) (, ",") (identifier "param_2") () ")")))) (; ";")) (return_statement "return pFVar1;" (return "return") (identifier "pFVar1") (; ";")) (} "}"))) (if_statement "if (*param_2 == 'w') {\n    __fd = open64((char *)*param_1,0x241,0x180);\n    pFVar1 = (FILE *)0x0;\n    if (-1 < __fd) {\n      pFVar1 = fdopen(__fd,param_2);\n    }\n    return pFVar1;\n  }" (if "if") (parenthesized_expression "(*param_2 == 'w')" (( "(") (binary_expression "*param_2 == 'w'" (pointer_expression "*param_2" (* "*") (identifier "param_2")) (== "==") (char_literal "'w'" (' "'") (character "w") (' "'"))) () ")")) (compound_statement "{\n    __fd = open64((char *)*param_1,0x241,0x180);\n    pFVar1 = (FILE *)0x0;\n    if (-1 < __fd) {\n      pFVar1 = fdopen(__fd,param_2);\n    }\n    return pFVar1;\n  }" ({ "{") (expression_statement "__fd = open64((char *)*param_1,0x241,0x180);" (assignment_expression "__fd = open64((char *)*param_1,0x241,0x180)" (identifier "__fd") (= "=") (call_expression "open64((char *)*param_1,0x241,0x180)" (identifier "open64") (argument_list "((char *)*param_1,0x241,0x180)" (( "(") (cast_expression "(char *)*param_1" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*param_1" (* "*") (identifier "param_1"))) (, ",") (number_literal "0x241") (, ",") (number_literal "0x180") () ")")))) (; ";")) (expression_statement "pFVar1 = (FILE *)0x0;" (assignment_expression "pFVar1 = (FILE *)0x0" (identifier "pFVar1") (= "=") (cast_expression "(FILE *)0x0" (( "(") (type_descriptor "FILE *" (type_identifier "FILE") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) (; ";")) (if_statement "if (-1 < __fd) {\n      pFVar1 = fdopen(__fd,param_2);\n    }" (if "if") (parenthesized_expression "(-1 < __fd)" (( "(") (binary_expression "-1 < __fd" (number_literal "-1") (< "<") (identifier "__fd")) () ")")) (compound_statement "{\n      pFVar1 = fdopen(__fd,param_2);\n    }" ({ "{") (expression_statement "pFVar1 = fdopen(__fd,param_2);" (assignment_expression "pFVar1 = fdopen(__fd,param_2)" (identifier "pFVar1") (= "=") (call_expression "fdopen(__fd,param_2)" (identifier "fdopen") (argument_list "(__fd,param_2)" (( "(") (identifier "__fd") (, ",") (identifier "param_2") () ")")))) (; ";")) (} "}"))) (return_statement "return pFVar1;" (return "return") (identifier "pFVar1") (; ";")) (} "}"))) (expression_statement "__assert_fail("mode[0] == \'w\'","unix/uxmisc.c",0xfe,"f_open");" (call_expression "__assert_fail("mode[0] == \'w\'","unix/uxmisc.c",0xfe,"f_open")" (identifier "__assert_fail") (argument_list "("mode[0] == \'w\'","unix/uxmisc.c",0xfe,"f_open")" (( "(") (string_literal ""mode[0] == \'w\'"" (" """) (string_content "mode[0] == ") (escape_sequence "\'") (string_content "w") (escape_sequence "\'") (" """)) (, ",") (string_literal ""unix/uxmisc.c"" (" """) (string_content "unix/uxmisc.c") (" """)) (, ",") (number_literal "0xfe") (, ",") (string_literal ""f_open"" (" """) (string_content "f_open") (" """)) () ")"))) (; ";")) (} "}")))

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

type_1 * function_1(type_2 *filename,char *mode,int var_1)

{
  int var_4;
  type_1 *pFVar1;
  
  if (var_1 == 0) {
    pFVar1 = var_2(filename->path,mode);
    return (type_1 *)pFVar1;
  }
  if (*mode == 'w') {
    var_4 = var_3(filename->path,0x241,0x180);
    pFVar1 = (type_1 *)0x0;
    if (-1 < var_4) {
      pFVar1 = var_5(var_4,mode);
    }
    return (type_1 *)pFVar1;
  }
                    /* WARNING: Subroutine does not return */
  var_6("mode[0] == \'w\'","unix/uxmisc.c",0xfe,"f_open");
}


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

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

FILE * MASKED(undefined4 *param_1,char *param_2,int param_3)

{
  int __fd;
  FILE *pFVar1;
  
  if (param_3 == 0) {
    pFVar1 = fopen64((char *)*param_1,param_2);
    return pFVar1;
  }
  if (*param_2 == 'w') {
    __fd = open64((char *)*param_1,0x241,0x180);
    pFVar1 = (FILE *)0x0;
    if (-1 < __fd) {
      pFVar1 = fdopen(__fd,param_2);
    }
    return pFVar1;
  }
                    /* WARNING: Subroutine does not return */
  __assert_fail("mode[0] == \'w\'","unix/uxmisc.c",0xfe,"f_open");
}

