
FILE * try_open(char *name,bfd_boolean *sysrooted)

{
  int iVar1;
  FILE *pFVar2;
  char *pcVar3;
  size_t sVar4;
  uint uVar5;
  
  pFVar2 = fopen(name,"r");
  if (pFVar2 == (FILE *)0x0) {
    if (verbose == 0) {
      return (FILE *)0x0;
    }
    pcVar3 = "cannot find script file %s\n";
  }
  else {
    uVar5 = 0;
    if (ld_canon_sysroot != (char *)0x0) {
      pcVar3 = (char *)lrealpath(name);
      sVar4 = strlen(pcVar3);
      if ((ld_canon_sysroot_len < (int)sVar4) && (pcVar3[ld_canon_sysroot_len] == '/')) {
        pcVar3[ld_canon_sysroot_len] = '\0';
        iVar1 = filename_cmp(ld_canon_sysroot,pcVar3);
        uVar5 = (uint)(iVar1 == 0);
      }
      free(pcVar3);
    }
    *sysrooted = uVar5;
    if (verbose == 0) {
      return (FILE *)pFVar2;
    }
    pcVar3 = "opened script file %s\n";
  }
  pcVar3 = (char *)dcgettext(0,pcVar3,5);
  info_msg(pcVar3,name);
  return (FILE *)pFVar2;
}



FILE * FUN_00129700(char *param_1,uint *param_2)

{
  int iVar1;
  FILE *pFVar2;
  char *pcVar3;
  size_t sVar4;
  undefined8 uVar5;
  uint uVar6;
  
  pFVar2 = fopen(param_1,"r");
  if (pFVar2 == (FILE *)0x0) {
    if (DAT_002b6158 == 0) {
      return (FILE *)0x0;
    }
    pcVar3 = "cannot find script file %s\n";
  }
  else {
    uVar6 = 0;
    if (DAT_002b6160 != 0) {
      pcVar3 = (char *)lrealpath(param_1);
      sVar4 = strlen(pcVar3);
      if ((DAT_002b5f28 < (int)sVar4) && (pcVar3[DAT_002b5f28] == '/')) {
        pcVar3[DAT_002b5f28] = '\0';
        iVar1 = filename_cmp(DAT_002b6160,pcVar3);
        uVar6 = (uint)(iVar1 == 0);
      }
      free(pcVar3);
    }
    *param_2 = uVar6;
    if (DAT_002b6158 == 0) {
      return pFVar2;
    }
    pcVar3 = "opened script file %s\n";
  }
  uVar5 = dcgettext(0,pcVar3,5);
  FUN_001292e0(uVar5,param_1);
  return pFVar2;
}


PUSH R14
PUSH R13
PUSH R12
MOV R12,RSI
LEA RSI,[0x16acd7]
PUSH RBP
MOV RBP,RDI
PUSH RBX
CALL 0x0010da40
MOV RBX,RAX
TEST RAX,RAX
JZ 0x001297a0
XOR R13D,R13D
CMP qword ptr [0x002b6160],0x0
JZ 0x0012975d
MOV RDI,RBP
CALL 0x0010d2c0
MOV RDI,RAX
MOV R14,RAX
CALL 0x0010d330
MOVSXD RDX,dword ptr [0x002b5f28]
CMP EDX,EAX
JGE 0x00129755
ADD RDX,R14
CMP byte ptr [RDX],0x2f
JZ 0x001297c0
MOV RDI,R14
CALL 0x0010dd90
MOV dword ptr [R12],R13D
MOV EDX,dword ptr [0x002b6158]
TEST EDX,EDX
JZ 0x0012978b
MOV EDX,0x5
LEA RSI,[0x16edbe]
XOR EDI,EDI
CALL 0x0010d300
MOV RSI,RBP
MOV RDI,RAX
XOR EAX,EAX
CALL 0x001292e0
MOV RAX,RBX
POP RBX
POP RBP
POP R12
POP R13
POP R14
RET
MOV EAX,dword ptr [0x002b6158]
TEST EAX,EAX
JZ 0x0012978b
MOV EDX,0x5
LEA RSI,[0x16eda2]
JMP 0x00129777
MOV byte ptr [RDX],0x0
MOV RDI,qword ptr [0x002b6160]
MOV RSI,R14
XOR R13D,R13D
CALL 0x0010d260
TEST EAX,EAX
SETZ R13B
JMP 0x00129755
(translation_unit "FILE * FUN_00129700(char *param_1,uint *param_2)\n\n{\n  int iVar1;\n  FILE *pFVar2;\n  char *pcVar3;\n  size_t sVar4;\n  undefined8 uVar5;\n  uint uVar6;\n  \n  pFVar2 = fopen(param_1,"r");\n  if (pFVar2 == (FILE *)0x0) {\n    if (DAT_002b6158 == 0) {\n      return (FILE *)0x0;\n    }\n    pcVar3 = "cannot find script file %s\n";\n  }\n  else {\n    uVar6 = 0;\n    if (DAT_002b6160 != 0) {\n      pcVar3 = (char *)lrealpath(param_1);\n      sVar4 = strlen(pcVar3);\n      if ((DAT_002b5f28 < (int)sVar4) && (pcVar3[DAT_002b5f28] == '/')) {\n        pcVar3[DAT_002b5f28] = '\0';\n        iVar1 = filename_cmp(DAT_002b6160,pcVar3);\n        uVar6 = (uint)(iVar1 == 0);\n      }\n      free(pcVar3);\n    }\n    *param_2 = uVar6;\n    if (DAT_002b6158 == 0) {\n      return pFVar2;\n    }\n    pcVar3 = "opened script file %s\n";\n  }\n  uVar5 = dcgettext(0,pcVar3,5);\n  FUN_001292e0(uVar5,param_1);\n  return pFVar2;\n}\n\n" (function_definition "FILE * FUN_00129700(char *param_1,uint *param_2)\n\n{\n  int iVar1;\n  FILE *pFVar2;\n  char *pcVar3;\n  size_t sVar4;\n  undefined8 uVar5;\n  uint uVar6;\n  \n  pFVar2 = fopen(param_1,"r");\n  if (pFVar2 == (FILE *)0x0) {\n    if (DAT_002b6158 == 0) {\n      return (FILE *)0x0;\n    }\n    pcVar3 = "cannot find script file %s\n";\n  }\n  else {\n    uVar6 = 0;\n    if (DAT_002b6160 != 0) {\n      pcVar3 = (char *)lrealpath(param_1);\n      sVar4 = strlen(pcVar3);\n      if ((DAT_002b5f28 < (int)sVar4) && (pcVar3[DAT_002b5f28] == '/')) {\n        pcVar3[DAT_002b5f28] = '\0';\n        iVar1 = filename_cmp(DAT_002b6160,pcVar3);\n        uVar6 = (uint)(iVar1 == 0);\n      }\n      free(pcVar3);\n    }\n    *param_2 = uVar6;\n    if (DAT_002b6158 == 0) {\n      return pFVar2;\n    }\n    pcVar3 = "opened script file %s\n";\n  }\n  uVar5 = dcgettext(0,pcVar3,5);\n  FUN_001292e0(uVar5,param_1);\n  return pFVar2;\n}" type_identifier (pointer_declarator "* FUN_00129700(char *param_1,uint *param_2)" * (function_declarator "FUN_00129700(char *param_1,uint *param_2)" identifier (parameter_list "(char *param_1,uint *param_2)" ( (parameter_declaration "char *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "uint *param_2" type_identifier (pointer_declarator "*param_2" * identifier)) )))) (compound_statement "{\n  int iVar1;\n  FILE *pFVar2;\n  char *pcVar3;\n  size_t sVar4;\n  undefined8 uVar5;\n  uint uVar6;\n  \n  pFVar2 = fopen(param_1,"r");\n  if (pFVar2 == (FILE *)0x0) {\n    if (DAT_002b6158 == 0) {\n      return (FILE *)0x0;\n    }\n    pcVar3 = "cannot find script file %s\n";\n  }\n  else {\n    uVar6 = 0;\n    if (DAT_002b6160 != 0) {\n      pcVar3 = (char *)lrealpath(param_1);\n      sVar4 = strlen(pcVar3);\n      if ((DAT_002b5f28 < (int)sVar4) && (pcVar3[DAT_002b5f28] == '/')) {\n        pcVar3[DAT_002b5f28] = '\0';\n        iVar1 = filename_cmp(DAT_002b6160,pcVar3);\n        uVar6 = (uint)(iVar1 == 0);\n      }\n      free(pcVar3);\n    }\n    *param_2 = uVar6;\n    if (DAT_002b6158 == 0) {\n      return pFVar2;\n    }\n    pcVar3 = "opened script file %s\n";\n  }\n  uVar5 = dcgettext(0,pcVar3,5);\n  FUN_001292e0(uVar5,param_1);\n  return pFVar2;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "FILE *pFVar2;" type_identifier (pointer_declarator "*pFVar2" * identifier) ;) (declaration "char *pcVar3;" primitive_type (pointer_declarator "*pcVar3" * identifier) ;) (declaration "size_t sVar4;" primitive_type identifier ;) (declaration "undefined8 uVar5;" type_identifier identifier ;) (declaration "uint uVar6;" type_identifier identifier ;) (expression_statement "pFVar2 = fopen(param_1,"r");" (assignment_expression "pFVar2 = fopen(param_1,"r")" identifier = (call_expression "fopen(param_1,"r")" identifier (argument_list "(param_1,"r")" ( identifier , (string_literal ""r"" " string_content ") )))) ;) (if_statement "if (pFVar2 == (FILE *)0x0) {\n    if (DAT_002b6158 == 0) {\n      return (FILE *)0x0;\n    }\n    pcVar3 = "cannot find script file %s\n";\n  }\n  else {\n    uVar6 = 0;\n    if (DAT_002b6160 != 0) {\n      pcVar3 = (char *)lrealpath(param_1);\n      sVar4 = strlen(pcVar3);\n      if ((DAT_002b5f28 < (int)sVar4) && (pcVar3[DAT_002b5f28] == '/')) {\n        pcVar3[DAT_002b5f28] = '\0';\n        iVar1 = filename_cmp(DAT_002b6160,pcVar3);\n        uVar6 = (uint)(iVar1 == 0);\n      }\n      free(pcVar3);\n    }\n    *param_2 = uVar6;\n    if (DAT_002b6158 == 0) {\n      return pFVar2;\n    }\n    pcVar3 = "opened script file %s\n";\n  }" if (parenthesized_expression "(pFVar2 == (FILE *)0x0)" ( (binary_expression "pFVar2 == (FILE *)0x0" identifier == (cast_expression "(FILE *)0x0" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    if (DAT_002b6158 == 0) {\n      return (FILE *)0x0;\n    }\n    pcVar3 = "cannot find script file %s\n";\n  }" { (if_statement "if (DAT_002b6158 == 0) {\n      return (FILE *)0x0;\n    }" if (parenthesized_expression "(DAT_002b6158 == 0)" ( (binary_expression "DAT_002b6158 == 0" identifier == number_literal) )) (compound_statement "{\n      return (FILE *)0x0;\n    }" { (return_statement "return (FILE *)0x0;" return (cast_expression "(FILE *)0x0" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal) ;) })) (expression_statement "pcVar3 = "cannot find script file %s\n";" (assignment_expression "pcVar3 = "cannot find script file %s\n"" identifier = (string_literal ""cannot find script file %s\n"" " string_content escape_sequence ")) ;) }) (else_clause "else {\n    uVar6 = 0;\n    if (DAT_002b6160 != 0) {\n      pcVar3 = (char *)lrealpath(param_1);\n      sVar4 = strlen(pcVar3);\n      if ((DAT_002b5f28 < (int)sVar4) && (pcVar3[DAT_002b5f28] == '/')) {\n        pcVar3[DAT_002b5f28] = '\0';\n        iVar1 = filename_cmp(DAT_002b6160,pcVar3);\n        uVar6 = (uint)(iVar1 == 0);\n      }\n      free(pcVar3);\n    }\n    *param_2 = uVar6;\n    if (DAT_002b6158 == 0) {\n      return pFVar2;\n    }\n    pcVar3 = "opened script file %s\n";\n  }" else (compound_statement "{\n    uVar6 = 0;\n    if (DAT_002b6160 != 0) {\n      pcVar3 = (char *)lrealpath(param_1);\n      sVar4 = strlen(pcVar3);\n      if ((DAT_002b5f28 < (int)sVar4) && (pcVar3[DAT_002b5f28] == '/')) {\n        pcVar3[DAT_002b5f28] = '\0';\n        iVar1 = filename_cmp(DAT_002b6160,pcVar3);\n        uVar6 = (uint)(iVar1 == 0);\n      }\n      free(pcVar3);\n    }\n    *param_2 = uVar6;\n    if (DAT_002b6158 == 0) {\n      return pFVar2;\n    }\n    pcVar3 = "opened script file %s\n";\n  }" { (expression_statement "uVar6 = 0;" (assignment_expression "uVar6 = 0" identifier = number_literal) ;) (if_statement "if (DAT_002b6160 != 0) {\n      pcVar3 = (char *)lrealpath(param_1);\n      sVar4 = strlen(pcVar3);\n      if ((DAT_002b5f28 < (int)sVar4) && (pcVar3[DAT_002b5f28] == '/')) {\n        pcVar3[DAT_002b5f28] = '\0';\n        iVar1 = filename_cmp(DAT_002b6160,pcVar3);\n        uVar6 = (uint)(iVar1 == 0);\n      }\n      free(pcVar3);\n    }" if (parenthesized_expression "(DAT_002b6160 != 0)" ( (binary_expression "DAT_002b6160 != 0" identifier != number_literal) )) (compound_statement "{\n      pcVar3 = (char *)lrealpath(param_1);\n      sVar4 = strlen(pcVar3);\n      if ((DAT_002b5f28 < (int)sVar4) && (pcVar3[DAT_002b5f28] == '/')) {\n        pcVar3[DAT_002b5f28] = '\0';\n        iVar1 = filename_cmp(DAT_002b6160,pcVar3);\n        uVar6 = (uint)(iVar1 == 0);\n      }\n      free(pcVar3);\n    }" { (expression_statement "pcVar3 = (char *)lrealpath(param_1);" (assignment_expression "pcVar3 = (char *)lrealpath(param_1)" identifier = (cast_expression "(char *)lrealpath(param_1)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "lrealpath(param_1)" identifier (argument_list "(param_1)" ( identifier ))))) ;) (expression_statement "sVar4 = strlen(pcVar3);" (assignment_expression "sVar4 = strlen(pcVar3)" identifier = (call_expression "strlen(pcVar3)" identifier (argument_list "(pcVar3)" ( identifier )))) ;) (if_statement "if ((DAT_002b5f28 < (int)sVar4) && (pcVar3[DAT_002b5f28] == '/')) {\n        pcVar3[DAT_002b5f28] = '\0';\n        iVar1 = filename_cmp(DAT_002b6160,pcVar3);\n        uVar6 = (uint)(iVar1 == 0);\n      }" if (parenthesized_expression "((DAT_002b5f28 < (int)sVar4) && (pcVar3[DAT_002b5f28] == '/'))" ( (binary_expression "(DAT_002b5f28 < (int)sVar4) && (pcVar3[DAT_002b5f28] == '/')" (parenthesized_expression "(DAT_002b5f28 < (int)sVar4)" ( (binary_expression "DAT_002b5f28 < (int)sVar4" identifier < (cast_expression "(int)sVar4" ( (type_descriptor "int" primitive_type) ) identifier)) )) && (parenthesized_expression "(pcVar3[DAT_002b5f28] == '/')" ( (binary_expression "pcVar3[DAT_002b5f28] == '/'" (subscript_expression "pcVar3[DAT_002b5f28]" identifier [ identifier ]) == (char_literal "'/'" ' character ')) ))) )) (compound_statement "{\n        pcVar3[DAT_002b5f28] = '\0';\n        iVar1 = filename_cmp(DAT_002b6160,pcVar3);\n        uVar6 = (uint)(iVar1 == 0);\n      }" { (expression_statement "pcVar3[DAT_002b5f28] = '\0';" (assignment_expression "pcVar3[DAT_002b5f28] = '\0'" (subscript_expression "pcVar3[DAT_002b5f28]" identifier [ identifier ]) = (char_literal "'\0'" ' escape_sequence ')) ;) (expression_statement "iVar1 = filename_cmp(DAT_002b6160,pcVar3);" (assignment_expression "iVar1 = filename_cmp(DAT_002b6160,pcVar3)" identifier = (call_expression "filename_cmp(DAT_002b6160,pcVar3)" identifier (argument_list "(DAT_002b6160,pcVar3)" ( identifier , identifier )))) ;) (expression_statement "uVar6 = (uint)(iVar1 == 0);" (assignment_expression "uVar6 = (uint)(iVar1 == 0)" identifier = (call_expression "(uint)(iVar1 == 0)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )))) ;) })) (expression_statement "free(pcVar3);" (call_expression "free(pcVar3)" identifier (argument_list "(pcVar3)" ( identifier ))) ;) })) (expression_statement "*param_2 = uVar6;" (assignment_expression "*param_2 = uVar6" (pointer_expression "*param_2" * identifier) = identifier) ;) (if_statement "if (DAT_002b6158 == 0) {\n      return pFVar2;\n    }" if (parenthesized_expression "(DAT_002b6158 == 0)" ( (binary_expression "DAT_002b6158 == 0" identifier == number_literal) )) (compound_statement "{\n      return pFVar2;\n    }" { (return_statement "return pFVar2;" return identifier ;) })) (expression_statement "pcVar3 = "opened script file %s\n";" (assignment_expression "pcVar3 = "opened script file %s\n"" identifier = (string_literal ""opened script file %s\n"" " string_content escape_sequence ")) ;) }))) (expression_statement "uVar5 = dcgettext(0,pcVar3,5);" (assignment_expression "uVar5 = dcgettext(0,pcVar3,5)" identifier = (call_expression "dcgettext(0,pcVar3,5)" identifier (argument_list "(0,pcVar3,5)" ( number_literal , identifier , number_literal )))) ;) (expression_statement "FUN_001292e0(uVar5,param_1);" (call_expression "FUN_001292e0(uVar5,param_1)" identifier (argument_list "(uVar5,param_1)" ( identifier , identifier ))) ;) (return_statement "return pFVar2;" return identifier ;) })))
(translation_unit "FILE * try_open(char *name,bfd_boolean *sysrooted)\n\n{\n  int iVar1;\n  FILE *pFVar2;\n  char *pcVar3;\n  size_t sVar4;\n  uint uVar5;\n  \n  pFVar2 = fopen(name,"r");\n  if (pFVar2 == (FILE *)0x0) {\n    if (verbose == 0) {\n      return (FILE *)0x0;\n    }\n    pcVar3 = "cannot find script file %s\n";\n  }\n  else {\n    uVar5 = 0;\n    if (ld_canon_sysroot != (char *)0x0) {\n      pcVar3 = (char *)lrealpath(name);\n      sVar4 = strlen(pcVar3);\n      if ((ld_canon_sysroot_len < (int)sVar4) && (pcVar3[ld_canon_sysroot_len] == '/')) {\n        pcVar3[ld_canon_sysroot_len] = '\0';\n        iVar1 = filename_cmp(ld_canon_sysroot,pcVar3);\n        uVar5 = (uint)(iVar1 == 0);\n      }\n      free(pcVar3);\n    }\n    *sysrooted = uVar5;\n    if (verbose == 0) {\n      return (FILE *)pFVar2;\n    }\n    pcVar3 = "opened script file %s\n";\n  }\n  pcVar3 = (char *)dcgettext(0,pcVar3,5);\n  info_msg(pcVar3,name);\n  return (FILE *)pFVar2;\n}\n\n" (function_definition "FILE * try_open(char *name,bfd_boolean *sysrooted)\n\n{\n  int iVar1;\n  FILE *pFVar2;\n  char *pcVar3;\n  size_t sVar4;\n  uint uVar5;\n  \n  pFVar2 = fopen(name,"r");\n  if (pFVar2 == (FILE *)0x0) {\n    if (verbose == 0) {\n      return (FILE *)0x0;\n    }\n    pcVar3 = "cannot find script file %s\n";\n  }\n  else {\n    uVar5 = 0;\n    if (ld_canon_sysroot != (char *)0x0) {\n      pcVar3 = (char *)lrealpath(name);\n      sVar4 = strlen(pcVar3);\n      if ((ld_canon_sysroot_len < (int)sVar4) && (pcVar3[ld_canon_sysroot_len] == '/')) {\n        pcVar3[ld_canon_sysroot_len] = '\0';\n        iVar1 = filename_cmp(ld_canon_sysroot,pcVar3);\n        uVar5 = (uint)(iVar1 == 0);\n      }\n      free(pcVar3);\n    }\n    *sysrooted = uVar5;\n    if (verbose == 0) {\n      return (FILE *)pFVar2;\n    }\n    pcVar3 = "opened script file %s\n";\n  }\n  pcVar3 = (char *)dcgettext(0,pcVar3,5);\n  info_msg(pcVar3,name);\n  return (FILE *)pFVar2;\n}" type_identifier (pointer_declarator "* try_open(char *name,bfd_boolean *sysrooted)" * (function_declarator "try_open(char *name,bfd_boolean *sysrooted)" identifier (parameter_list "(char *name,bfd_boolean *sysrooted)" ( (parameter_declaration "char *name" primitive_type (pointer_declarator "*name" * identifier)) , (parameter_declaration "bfd_boolean *sysrooted" type_identifier (pointer_declarator "*sysrooted" * identifier)) )))) (compound_statement "{\n  int iVar1;\n  FILE *pFVar2;\n  char *pcVar3;\n  size_t sVar4;\n  uint uVar5;\n  \n  pFVar2 = fopen(name,"r");\n  if (pFVar2 == (FILE *)0x0) {\n    if (verbose == 0) {\n      return (FILE *)0x0;\n    }\n    pcVar3 = "cannot find script file %s\n";\n  }\n  else {\n    uVar5 = 0;\n    if (ld_canon_sysroot != (char *)0x0) {\n      pcVar3 = (char *)lrealpath(name);\n      sVar4 = strlen(pcVar3);\n      if ((ld_canon_sysroot_len < (int)sVar4) && (pcVar3[ld_canon_sysroot_len] == '/')) {\n        pcVar3[ld_canon_sysroot_len] = '\0';\n        iVar1 = filename_cmp(ld_canon_sysroot,pcVar3);\n        uVar5 = (uint)(iVar1 == 0);\n      }\n      free(pcVar3);\n    }\n    *sysrooted = uVar5;\n    if (verbose == 0) {\n      return (FILE *)pFVar2;\n    }\n    pcVar3 = "opened script file %s\n";\n  }\n  pcVar3 = (char *)dcgettext(0,pcVar3,5);\n  info_msg(pcVar3,name);\n  return (FILE *)pFVar2;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "FILE *pFVar2;" type_identifier (pointer_declarator "*pFVar2" * identifier) ;) (declaration "char *pcVar3;" primitive_type (pointer_declarator "*pcVar3" * identifier) ;) (declaration "size_t sVar4;" primitive_type identifier ;) (declaration "uint uVar5;" type_identifier identifier ;) (expression_statement "pFVar2 = fopen(name,"r");" (assignment_expression "pFVar2 = fopen(name,"r")" identifier = (call_expression "fopen(name,"r")" identifier (argument_list "(name,"r")" ( identifier , (string_literal ""r"" " string_content ") )))) ;) (if_statement "if (pFVar2 == (FILE *)0x0) {\n    if (verbose == 0) {\n      return (FILE *)0x0;\n    }\n    pcVar3 = "cannot find script file %s\n";\n  }\n  else {\n    uVar5 = 0;\n    if (ld_canon_sysroot != (char *)0x0) {\n      pcVar3 = (char *)lrealpath(name);\n      sVar4 = strlen(pcVar3);\n      if ((ld_canon_sysroot_len < (int)sVar4) && (pcVar3[ld_canon_sysroot_len] == '/')) {\n        pcVar3[ld_canon_sysroot_len] = '\0';\n        iVar1 = filename_cmp(ld_canon_sysroot,pcVar3);\n        uVar5 = (uint)(iVar1 == 0);\n      }\n      free(pcVar3);\n    }\n    *sysrooted = uVar5;\n    if (verbose == 0) {\n      return (FILE *)pFVar2;\n    }\n    pcVar3 = "opened script file %s\n";\n  }" if (parenthesized_expression "(pFVar2 == (FILE *)0x0)" ( (binary_expression "pFVar2 == (FILE *)0x0" identifier == (cast_expression "(FILE *)0x0" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    if (verbose == 0) {\n      return (FILE *)0x0;\n    }\n    pcVar3 = "cannot find script file %s\n";\n  }" { (if_statement "if (verbose == 0) {\n      return (FILE *)0x0;\n    }" if (parenthesized_expression "(verbose == 0)" ( (binary_expression "verbose == 0" identifier == number_literal) )) (compound_statement "{\n      return (FILE *)0x0;\n    }" { (return_statement "return (FILE *)0x0;" return (cast_expression "(FILE *)0x0" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal) ;) })) (expression_statement "pcVar3 = "cannot find script file %s\n";" (assignment_expression "pcVar3 = "cannot find script file %s\n"" identifier = (string_literal ""cannot find script file %s\n"" " string_content escape_sequence ")) ;) }) (else_clause "else {\n    uVar5 = 0;\n    if (ld_canon_sysroot != (char *)0x0) {\n      pcVar3 = (char *)lrealpath(name);\n      sVar4 = strlen(pcVar3);\n      if ((ld_canon_sysroot_len < (int)sVar4) && (pcVar3[ld_canon_sysroot_len] == '/')) {\n        pcVar3[ld_canon_sysroot_len] = '\0';\n        iVar1 = filename_cmp(ld_canon_sysroot,pcVar3);\n        uVar5 = (uint)(iVar1 == 0);\n      }\n      free(pcVar3);\n    }\n    *sysrooted = uVar5;\n    if (verbose == 0) {\n      return (FILE *)pFVar2;\n    }\n    pcVar3 = "opened script file %s\n";\n  }" else (compound_statement "{\n    uVar5 = 0;\n    if (ld_canon_sysroot != (char *)0x0) {\n      pcVar3 = (char *)lrealpath(name);\n      sVar4 = strlen(pcVar3);\n      if ((ld_canon_sysroot_len < (int)sVar4) && (pcVar3[ld_canon_sysroot_len] == '/')) {\n        pcVar3[ld_canon_sysroot_len] = '\0';\n        iVar1 = filename_cmp(ld_canon_sysroot,pcVar3);\n        uVar5 = (uint)(iVar1 == 0);\n      }\n      free(pcVar3);\n    }\n    *sysrooted = uVar5;\n    if (verbose == 0) {\n      return (FILE *)pFVar2;\n    }\n    pcVar3 = "opened script file %s\n";\n  }" { (expression_statement "uVar5 = 0;" (assignment_expression "uVar5 = 0" identifier = number_literal) ;) (if_statement "if (ld_canon_sysroot != (char *)0x0) {\n      pcVar3 = (char *)lrealpath(name);\n      sVar4 = strlen(pcVar3);\n      if ((ld_canon_sysroot_len < (int)sVar4) && (pcVar3[ld_canon_sysroot_len] == '/')) {\n        pcVar3[ld_canon_sysroot_len] = '\0';\n        iVar1 = filename_cmp(ld_canon_sysroot,pcVar3);\n        uVar5 = (uint)(iVar1 == 0);\n      }\n      free(pcVar3);\n    }" if (parenthesized_expression "(ld_canon_sysroot != (char *)0x0)" ( (binary_expression "ld_canon_sysroot != (char *)0x0" identifier != (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      pcVar3 = (char *)lrealpath(name);\n      sVar4 = strlen(pcVar3);\n      if ((ld_canon_sysroot_len < (int)sVar4) && (pcVar3[ld_canon_sysroot_len] == '/')) {\n        pcVar3[ld_canon_sysroot_len] = '\0';\n        iVar1 = filename_cmp(ld_canon_sysroot,pcVar3);\n        uVar5 = (uint)(iVar1 == 0);\n      }\n      free(pcVar3);\n    }" { (expression_statement "pcVar3 = (char *)lrealpath(name);" (assignment_expression "pcVar3 = (char *)lrealpath(name)" identifier = (cast_expression "(char *)lrealpath(name)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "lrealpath(name)" identifier (argument_list "(name)" ( identifier ))))) ;) (expression_statement "sVar4 = strlen(pcVar3);" (assignment_expression "sVar4 = strlen(pcVar3)" identifier = (call_expression "strlen(pcVar3)" identifier (argument_list "(pcVar3)" ( identifier )))) ;) (if_statement "if ((ld_canon_sysroot_len < (int)sVar4) && (pcVar3[ld_canon_sysroot_len] == '/')) {\n        pcVar3[ld_canon_sysroot_len] = '\0';\n        iVar1 = filename_cmp(ld_canon_sysroot,pcVar3);\n        uVar5 = (uint)(iVar1 == 0);\n      }" if (parenthesized_expression "((ld_canon_sysroot_len < (int)sVar4) && (pcVar3[ld_canon_sysroot_len] == '/'))" ( (binary_expression "(ld_canon_sysroot_len < (int)sVar4) && (pcVar3[ld_canon_sysroot_len] == '/')" (parenthesized_expression "(ld_canon_sysroot_len < (int)sVar4)" ( (binary_expression "ld_canon_sysroot_len < (int)sVar4" identifier < (cast_expression "(int)sVar4" ( (type_descriptor "int" primitive_type) ) identifier)) )) && (parenthesized_expression "(pcVar3[ld_canon_sysroot_len] == '/')" ( (binary_expression "pcVar3[ld_canon_sysroot_len] == '/'" (subscript_expression "pcVar3[ld_canon_sysroot_len]" identifier [ identifier ]) == (char_literal "'/'" ' character ')) ))) )) (compound_statement "{\n        pcVar3[ld_canon_sysroot_len] = '\0';\n        iVar1 = filename_cmp(ld_canon_sysroot,pcVar3);\n        uVar5 = (uint)(iVar1 == 0);\n      }" { (expression_statement "pcVar3[ld_canon_sysroot_len] = '\0';" (assignment_expression "pcVar3[ld_canon_sysroot_len] = '\0'" (subscript_expression "pcVar3[ld_canon_sysroot_len]" identifier [ identifier ]) = (char_literal "'\0'" ' escape_sequence ')) ;) (expression_statement "iVar1 = filename_cmp(ld_canon_sysroot,pcVar3);" (assignment_expression "iVar1 = filename_cmp(ld_canon_sysroot,pcVar3)" identifier = (call_expression "filename_cmp(ld_canon_sysroot,pcVar3)" identifier (argument_list "(ld_canon_sysroot,pcVar3)" ( identifier , identifier )))) ;) (expression_statement "uVar5 = (uint)(iVar1 == 0);" (assignment_expression "uVar5 = (uint)(iVar1 == 0)" identifier = (call_expression "(uint)(iVar1 == 0)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )))) ;) })) (expression_statement "free(pcVar3);" (call_expression "free(pcVar3)" identifier (argument_list "(pcVar3)" ( identifier ))) ;) })) (expression_statement "*sysrooted = uVar5;" (assignment_expression "*sysrooted = uVar5" (pointer_expression "*sysrooted" * identifier) = identifier) ;) (if_statement "if (verbose == 0) {\n      return (FILE *)pFVar2;\n    }" if (parenthesized_expression "(verbose == 0)" ( (binary_expression "verbose == 0" identifier == number_literal) )) (compound_statement "{\n      return (FILE *)pFVar2;\n    }" { (return_statement "return (FILE *)pFVar2;" return (cast_expression "(FILE *)pFVar2" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier) ;) })) (expression_statement "pcVar3 = "opened script file %s\n";" (assignment_expression "pcVar3 = "opened script file %s\n"" identifier = (string_literal ""opened script file %s\n"" " string_content escape_sequence ")) ;) }))) (expression_statement "pcVar3 = (char *)dcgettext(0,pcVar3,5);" (assignment_expression "pcVar3 = (char *)dcgettext(0,pcVar3,5)" identifier = (cast_expression "(char *)dcgettext(0,pcVar3,5)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "dcgettext(0,pcVar3,5)" identifier (argument_list "(0,pcVar3,5)" ( number_literal , identifier , number_literal ))))) ;) (expression_statement "info_msg(pcVar3,name);" (call_expression "info_msg(pcVar3,name)" identifier (argument_list "(pcVar3,name)" ( identifier , identifier ))) ;) (return_statement "return (FILE *)pFVar2;" return (cast_expression "(FILE *)pFVar2" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier) ;) })))
(translation_unit "FILE * FUN_00129700(char *param_1,uint *param_2)\n\n{\n  int iVar1;\n  FILE *pFVar2;\n  char *pcVar3;\n  size_t sVar4;\n  undefined8 uVar5;\n  uint uVar6;\n  \n  pFVar2 = fopen(param_1,"r");\n  if (pFVar2 == (FILE *)0x0) {\n    if (DAT_002b6158 == 0) {\n      return (FILE *)0x0;\n    }\n    pcVar3 = "cannot find script file %s\n";\n  }\n  else {\n    uVar6 = 0;\n    if (DAT_002b6160 != 0) {\n      pcVar3 = (char *)lrealpath(param_1);\n      sVar4 = strlen(pcVar3);\n      if ((DAT_002b5f28 < (int)sVar4) && (pcVar3[DAT_002b5f28] == '/')) {\n        pcVar3[DAT_002b5f28] = '\0';\n        iVar1 = filename_cmp(DAT_002b6160,pcVar3);\n        uVar6 = (uint)(iVar1 == 0);\n      }\n      free(pcVar3);\n    }\n    *param_2 = uVar6;\n    if (DAT_002b6158 == 0) {\n      return pFVar2;\n    }\n    pcVar3 = "opened script file %s\n";\n  }\n  uVar5 = dcgettext(0,pcVar3,5);\n  FUN_001292e0(uVar5,param_1);\n  return pFVar2;\n}\n\n" (function_definition "FILE * FUN_00129700(char *param_1,uint *param_2)\n\n{\n  int iVar1;\n  FILE *pFVar2;\n  char *pcVar3;\n  size_t sVar4;\n  undefined8 uVar5;\n  uint uVar6;\n  \n  pFVar2 = fopen(param_1,"r");\n  if (pFVar2 == (FILE *)0x0) {\n    if (DAT_002b6158 == 0) {\n      return (FILE *)0x0;\n    }\n    pcVar3 = "cannot find script file %s\n";\n  }\n  else {\n    uVar6 = 0;\n    if (DAT_002b6160 != 0) {\n      pcVar3 = (char *)lrealpath(param_1);\n      sVar4 = strlen(pcVar3);\n      if ((DAT_002b5f28 < (int)sVar4) && (pcVar3[DAT_002b5f28] == '/')) {\n        pcVar3[DAT_002b5f28] = '\0';\n        iVar1 = filename_cmp(DAT_002b6160,pcVar3);\n        uVar6 = (uint)(iVar1 == 0);\n      }\n      free(pcVar3);\n    }\n    *param_2 = uVar6;\n    if (DAT_002b6158 == 0) {\n      return pFVar2;\n    }\n    pcVar3 = "opened script file %s\n";\n  }\n  uVar5 = dcgettext(0,pcVar3,5);\n  FUN_001292e0(uVar5,param_1);\n  return pFVar2;\n}" type_identifier (pointer_declarator "* FUN_00129700(char *param_1,uint *param_2)" * (function_declarator "FUN_00129700(char *param_1,uint *param_2)" identifier (parameter_list "(char *param_1,uint *param_2)" ( (parameter_declaration "char *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "uint *param_2" type_identifier (pointer_declarator "*param_2" * identifier)) )))) (compound_statement "{\n  int iVar1;\n  FILE *pFVar2;\n  char *pcVar3;\n  size_t sVar4;\n  undefined8 uVar5;\n  uint uVar6;\n  \n  pFVar2 = fopen(param_1,"r");\n  if (pFVar2 == (FILE *)0x0) {\n    if (DAT_002b6158 == 0) {\n      return (FILE *)0x0;\n    }\n    pcVar3 = "cannot find script file %s\n";\n  }\n  else {\n    uVar6 = 0;\n    if (DAT_002b6160 != 0) {\n      pcVar3 = (char *)lrealpath(param_1);\n      sVar4 = strlen(pcVar3);\n      if ((DAT_002b5f28 < (int)sVar4) && (pcVar3[DAT_002b5f28] == '/')) {\n        pcVar3[DAT_002b5f28] = '\0';\n        iVar1 = filename_cmp(DAT_002b6160,pcVar3);\n        uVar6 = (uint)(iVar1 == 0);\n      }\n      free(pcVar3);\n    }\n    *param_2 = uVar6;\n    if (DAT_002b6158 == 0) {\n      return pFVar2;\n    }\n    pcVar3 = "opened script file %s\n";\n  }\n  uVar5 = dcgettext(0,pcVar3,5);\n  FUN_001292e0(uVar5,param_1);\n  return pFVar2;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "FILE *pFVar2;" type_identifier (pointer_declarator "*pFVar2" * identifier) ;) (declaration "char *pcVar3;" primitive_type (pointer_declarator "*pcVar3" * identifier) ;) (declaration "size_t sVar4;" primitive_type identifier ;) (declaration "undefined8 uVar5;" type_identifier identifier ;) (declaration "uint uVar6;" type_identifier identifier ;) (expression_statement "pFVar2 = fopen(param_1,"r");" (assignment_expression "pFVar2 = fopen(param_1,"r")" identifier = (call_expression "fopen(param_1,"r")" identifier (argument_list "(param_1,"r")" ( identifier , (string_literal ""r"" " string_content ") )))) ;) (if_statement "if (pFVar2 == (FILE *)0x0) {\n    if (DAT_002b6158 == 0) {\n      return (FILE *)0x0;\n    }\n    pcVar3 = "cannot find script file %s\n";\n  }\n  else {\n    uVar6 = 0;\n    if (DAT_002b6160 != 0) {\n      pcVar3 = (char *)lrealpath(param_1);\n      sVar4 = strlen(pcVar3);\n      if ((DAT_002b5f28 < (int)sVar4) && (pcVar3[DAT_002b5f28] == '/')) {\n        pcVar3[DAT_002b5f28] = '\0';\n        iVar1 = filename_cmp(DAT_002b6160,pcVar3);\n        uVar6 = (uint)(iVar1 == 0);\n      }\n      free(pcVar3);\n    }\n    *param_2 = uVar6;\n    if (DAT_002b6158 == 0) {\n      return pFVar2;\n    }\n    pcVar3 = "opened script file %s\n";\n  }" if (parenthesized_expression "(pFVar2 == (FILE *)0x0)" ( (binary_expression "pFVar2 == (FILE *)0x0" identifier == (cast_expression "(FILE *)0x0" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    if (DAT_002b6158 == 0) {\n      return (FILE *)0x0;\n    }\n    pcVar3 = "cannot find script file %s\n";\n  }" { (if_statement "if (DAT_002b6158 == 0) {\n      return (FILE *)0x0;\n    }" if (parenthesized_expression "(DAT_002b6158 == 0)" ( (binary_expression "DAT_002b6158 == 0" identifier == number_literal) )) (compound_statement "{\n      return (FILE *)0x0;\n    }" { (return_statement "return (FILE *)0x0;" return (cast_expression "(FILE *)0x0" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal) ;) })) (expression_statement "pcVar3 = "cannot find script file %s\n";" (assignment_expression "pcVar3 = "cannot find script file %s\n"" identifier = (string_literal ""cannot find script file %s\n"" " string_content escape_sequence ")) ;) }) (else_clause "else {\n    uVar6 = 0;\n    if (DAT_002b6160 != 0) {\n      pcVar3 = (char *)lrealpath(param_1);\n      sVar4 = strlen(pcVar3);\n      if ((DAT_002b5f28 < (int)sVar4) && (pcVar3[DAT_002b5f28] == '/')) {\n        pcVar3[DAT_002b5f28] = '\0';\n        iVar1 = filename_cmp(DAT_002b6160,pcVar3);\n        uVar6 = (uint)(iVar1 == 0);\n      }\n      free(pcVar3);\n    }\n    *param_2 = uVar6;\n    if (DAT_002b6158 == 0) {\n      return pFVar2;\n    }\n    pcVar3 = "opened script file %s\n";\n  }" else (compound_statement "{\n    uVar6 = 0;\n    if (DAT_002b6160 != 0) {\n      pcVar3 = (char *)lrealpath(param_1);\n      sVar4 = strlen(pcVar3);\n      if ((DAT_002b5f28 < (int)sVar4) && (pcVar3[DAT_002b5f28] == '/')) {\n        pcVar3[DAT_002b5f28] = '\0';\n        iVar1 = filename_cmp(DAT_002b6160,pcVar3);\n        uVar6 = (uint)(iVar1 == 0);\n      }\n      free(pcVar3);\n    }\n    *param_2 = uVar6;\n    if (DAT_002b6158 == 0) {\n      return pFVar2;\n    }\n    pcVar3 = "opened script file %s\n";\n  }" { (expression_statement "uVar6 = 0;" (assignment_expression "uVar6 = 0" identifier = number_literal) ;) (if_statement "if (DAT_002b6160 != 0) {\n      pcVar3 = (char *)lrealpath(param_1);\n      sVar4 = strlen(pcVar3);\n      if ((DAT_002b5f28 < (int)sVar4) && (pcVar3[DAT_002b5f28] == '/')) {\n        pcVar3[DAT_002b5f28] = '\0';\n        iVar1 = filename_cmp(DAT_002b6160,pcVar3);\n        uVar6 = (uint)(iVar1 == 0);\n      }\n      free(pcVar3);\n    }" if (parenthesized_expression "(DAT_002b6160 != 0)" ( (binary_expression "DAT_002b6160 != 0" identifier != number_literal) )) (compound_statement "{\n      pcVar3 = (char *)lrealpath(param_1);\n      sVar4 = strlen(pcVar3);\n      if ((DAT_002b5f28 < (int)sVar4) && (pcVar3[DAT_002b5f28] == '/')) {\n        pcVar3[DAT_002b5f28] = '\0';\n        iVar1 = filename_cmp(DAT_002b6160,pcVar3);\n        uVar6 = (uint)(iVar1 == 0);\n      }\n      free(pcVar3);\n    }" { (expression_statement "pcVar3 = (char *)lrealpath(param_1);" (assignment_expression "pcVar3 = (char *)lrealpath(param_1)" identifier = (cast_expression "(char *)lrealpath(param_1)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "lrealpath(param_1)" identifier (argument_list "(param_1)" ( identifier ))))) ;) (expression_statement "sVar4 = strlen(pcVar3);" (assignment_expression "sVar4 = strlen(pcVar3)" identifier = (call_expression "strlen(pcVar3)" identifier (argument_list "(pcVar3)" ( identifier )))) ;) (if_statement "if ((DAT_002b5f28 < (int)sVar4) && (pcVar3[DAT_002b5f28] == '/')) {\n        pcVar3[DAT_002b5f28] = '\0';\n        iVar1 = filename_cmp(DAT_002b6160,pcVar3);\n        uVar6 = (uint)(iVar1 == 0);\n      }" if (parenthesized_expression "((DAT_002b5f28 < (int)sVar4) && (pcVar3[DAT_002b5f28] == '/'))" ( (binary_expression "(DAT_002b5f28 < (int)sVar4) && (pcVar3[DAT_002b5f28] == '/')" (parenthesized_expression "(DAT_002b5f28 < (int)sVar4)" ( (binary_expression "DAT_002b5f28 < (int)sVar4" identifier < (cast_expression "(int)sVar4" ( (type_descriptor "int" primitive_type) ) identifier)) )) && (parenthesized_expression "(pcVar3[DAT_002b5f28] == '/')" ( (binary_expression "pcVar3[DAT_002b5f28] == '/'" (subscript_expression "pcVar3[DAT_002b5f28]" identifier [ identifier ]) == (char_literal "'/'" ' character ')) ))) )) (compound_statement "{\n        pcVar3[DAT_002b5f28] = '\0';\n        iVar1 = filename_cmp(DAT_002b6160,pcVar3);\n        uVar6 = (uint)(iVar1 == 0);\n      }" { (expression_statement "pcVar3[DAT_002b5f28] = '\0';" (assignment_expression "pcVar3[DAT_002b5f28] = '\0'" (subscript_expression "pcVar3[DAT_002b5f28]" identifier [ identifier ]) = (char_literal "'\0'" ' escape_sequence ')) ;) (expression_statement "iVar1 = filename_cmp(DAT_002b6160,pcVar3);" (assignment_expression "iVar1 = filename_cmp(DAT_002b6160,pcVar3)" identifier = (call_expression "filename_cmp(DAT_002b6160,pcVar3)" identifier (argument_list "(DAT_002b6160,pcVar3)" ( identifier , identifier )))) ;) (expression_statement "uVar6 = (uint)(iVar1 == 0);" (assignment_expression "uVar6 = (uint)(iVar1 == 0)" identifier = (call_expression "(uint)(iVar1 == 0)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )))) ;) })) (expression_statement "free(pcVar3);" (call_expression "free(pcVar3)" identifier (argument_list "(pcVar3)" ( identifier ))) ;) })) (expression_statement "*param_2 = uVar6;" (assignment_expression "*param_2 = uVar6" (pointer_expression "*param_2" * identifier) = identifier) ;) (if_statement "if (DAT_002b6158 == 0) {\n      return pFVar2;\n    }" if (parenthesized_expression "(DAT_002b6158 == 0)" ( (binary_expression "DAT_002b6158 == 0" identifier == number_literal) )) (compound_statement "{\n      return pFVar2;\n    }" { (return_statement "return pFVar2;" return identifier ;) })) (expression_statement "pcVar3 = "opened script file %s\n";" (assignment_expression "pcVar3 = "opened script file %s\n"" identifier = (string_literal ""opened script file %s\n"" " string_content escape_sequence ")) ;) }))) (expression_statement "uVar5 = dcgettext(0,pcVar3,5);" (assignment_expression "uVar5 = dcgettext(0,pcVar3,5)" identifier = (call_expression "dcgettext(0,pcVar3,5)" identifier (argument_list "(0,pcVar3,5)" ( number_literal , identifier , number_literal )))) ;) (expression_statement "FUN_001292e0(uVar5,param_1);" (call_expression "FUN_001292e0(uVar5,param_1)" identifier (argument_list "(uVar5,param_1)" ( identifier , identifier ))) ;) (return_statement "return pFVar2;" return identifier ;) })))
(translation_unit (function_definition TYPE (pointer_declarator * (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE (pointer_declarator * IDENT)) )))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , (string_literal " string_content ") )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (return_statement return (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT) ;) })) (expression_statement (assignment_expression IDENT = (string_literal " string_content escape_sequence ")) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression IDENT (argument_list ( IDENT ))))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT < (cast_expression ( (type_descriptor TYPE) ) IDENT)) )) && (parenthesized_expression ( (binary_expression (subscript_expression IDENT [ IDENT ]) == (char_literal ' character ')) ))) )) (compound_statement { (expression_statement (assignment_expression (subscript_expression IDENT [ IDENT ]) = (char_literal ' escape_sequence ')) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT )))) ;) (expression_statement (assignment_expression IDENT = (call_expression (parenthesized_expression ( IDENT )) (argument_list ( (binary_expression IDENT == LIT) )))) ;) })) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) })) (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (return_statement return IDENT ;) })) (expression_statement (assignment_expression IDENT = (string_literal " string_content escape_sequence ")) ;) }))) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( LIT , IDENT , LIT )))) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT ))) ;) (return_statement return IDENT ;) })))
(function_definition "FILE * FUN_00129700(char *param_1,uint *param_2)\n\n{\n  int iVar1;\n  FILE *pFVar2;\n  char *pcVar3;\n  size_t sVar4;\n  undefined8 uVar5;\n  uint uVar6;\n  \n  pFVar2 = fopen(param_1,"r");\n  if (pFVar2 == (FILE *)0x0) {\n    if (DAT_002b6158 == 0) {\n      return (FILE *)0x0;\n    }\n    pcVar3 = "cannot find script file %s\n";\n  }\n  else {\n    uVar6 = 0;\n    if (DAT_002b6160 != 0) {\n      pcVar3 = (char *)lrealpath(param_1);\n      sVar4 = strlen(pcVar3);\n      if ((DAT_002b5f28 < (int)sVar4) && (pcVar3[DAT_002b5f28] == '/')) {\n        pcVar3[DAT_002b5f28] = '\0';\n        iVar1 = filename_cmp(DAT_002b6160,pcVar3);\n        uVar6 = (uint)(iVar1 == 0);\n      }\n      free(pcVar3);\n    }\n    *param_2 = uVar6;\n    if (DAT_002b6158 == 0) {\n      return pFVar2;\n    }\n    pcVar3 = "opened script file %s\n";\n  }\n  uVar5 = dcgettext(0,pcVar3,5);\n  FUN_001292e0(uVar5,param_1);\n  return pFVar2;\n}" (type_identifier "FILE") (pointer_declarator "* FUN_00129700(char *param_1,uint *param_2)" (* "*") (function_declarator "FUN_00129700(char *param_1,uint *param_2)" (identifier "FUN_00129700") (parameter_list "(char *param_1,uint *param_2)" (( "(") (parameter_declaration "char *param_1" (primitive_type "char") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "uint *param_2" (type_identifier "uint") (pointer_declarator "*param_2" (* "*") (identifier "param_2"))) () ")")))) (compound_statement "{\n  int iVar1;\n  FILE *pFVar2;\n  char *pcVar3;\n  size_t sVar4;\n  undefined8 uVar5;\n  uint uVar6;\n  \n  pFVar2 = fopen(param_1,"r");\n  if (pFVar2 == (FILE *)0x0) {\n    if (DAT_002b6158 == 0) {\n      return (FILE *)0x0;\n    }\n    pcVar3 = "cannot find script file %s\n";\n  }\n  else {\n    uVar6 = 0;\n    if (DAT_002b6160 != 0) {\n      pcVar3 = (char *)lrealpath(param_1);\n      sVar4 = strlen(pcVar3);\n      if ((DAT_002b5f28 < (int)sVar4) && (pcVar3[DAT_002b5f28] == '/')) {\n        pcVar3[DAT_002b5f28] = '\0';\n        iVar1 = filename_cmp(DAT_002b6160,pcVar3);\n        uVar6 = (uint)(iVar1 == 0);\n      }\n      free(pcVar3);\n    }\n    *param_2 = uVar6;\n    if (DAT_002b6158 == 0) {\n      return pFVar2;\n    }\n    pcVar3 = "opened script file %s\n";\n  }\n  uVar5 = dcgettext(0,pcVar3,5);\n  FUN_001292e0(uVar5,param_1);\n  return pFVar2;\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "FILE *pFVar2;" (type_identifier "FILE") (pointer_declarator "*pFVar2" (* "*") (identifier "pFVar2")) (; ";")) (declaration "char *pcVar3;" (primitive_type "char") (pointer_declarator "*pcVar3" (* "*") (identifier "pcVar3")) (; ";")) (declaration "size_t sVar4;" (primitive_type "size_t") (identifier "sVar4") (; ";")) (declaration "undefined8 uVar5;" (type_identifier "undefined8") (identifier "uVar5") (; ";")) (declaration "uint uVar6;" (type_identifier "uint") (identifier "uVar6") (; ";")) (expression_statement "pFVar2 = fopen(param_1,"r");" (assignment_expression "pFVar2 = fopen(param_1,"r")" (identifier "pFVar2") (= "=") (call_expression "fopen(param_1,"r")" (identifier "fopen") (argument_list "(param_1,"r")" (( "(") (identifier "param_1") (, ",") (string_literal ""r"" (" """) (string_content "r") (" """)) () ")")))) (; ";")) (if_statement "if (pFVar2 == (FILE *)0x0) {\n    if (DAT_002b6158 == 0) {\n      return (FILE *)0x0;\n    }\n    pcVar3 = "cannot find script file %s\n";\n  }\n  else {\n    uVar6 = 0;\n    if (DAT_002b6160 != 0) {\n      pcVar3 = (char *)lrealpath(param_1);\n      sVar4 = strlen(pcVar3);\n      if ((DAT_002b5f28 < (int)sVar4) && (pcVar3[DAT_002b5f28] == '/')) {\n        pcVar3[DAT_002b5f28] = '\0';\n        iVar1 = filename_cmp(DAT_002b6160,pcVar3);\n        uVar6 = (uint)(iVar1 == 0);\n      }\n      free(pcVar3);\n    }\n    *param_2 = uVar6;\n    if (DAT_002b6158 == 0) {\n      return pFVar2;\n    }\n    pcVar3 = "opened script file %s\n";\n  }" (if "if") (parenthesized_expression "(pFVar2 == (FILE *)0x0)" (( "(") (binary_expression "pFVar2 == (FILE *)0x0" (identifier "pFVar2") (== "==") (cast_expression "(FILE *)0x0" (( "(") (type_descriptor "FILE *" (type_identifier "FILE") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n    if (DAT_002b6158 == 0) {\n      return (FILE *)0x0;\n    }\n    pcVar3 = "cannot find script file %s\n";\n  }" ({ "{") (if_statement "if (DAT_002b6158 == 0) {\n      return (FILE *)0x0;\n    }" (if "if") (parenthesized_expression "(DAT_002b6158 == 0)" (( "(") (binary_expression "DAT_002b6158 == 0" (identifier "DAT_002b6158") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n      return (FILE *)0x0;\n    }" ({ "{") (return_statement "return (FILE *)0x0;" (return "return") (cast_expression "(FILE *)0x0" (( "(") (type_descriptor "FILE *" (type_identifier "FILE") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0")) (; ";")) (} "}"))) (expression_statement "pcVar3 = "cannot find script file %s\n";" (assignment_expression "pcVar3 = "cannot find script file %s\n"" (identifier "pcVar3") (= "=") (string_literal ""cannot find script file %s\n"" (" """) (string_content "cannot find script file %s") (escape_sequence "\n") (" """))) (; ";")) (} "}")) (else_clause "else {\n    uVar6 = 0;\n    if (DAT_002b6160 != 0) {\n      pcVar3 = (char *)lrealpath(param_1);\n      sVar4 = strlen(pcVar3);\n      if ((DAT_002b5f28 < (int)sVar4) && (pcVar3[DAT_002b5f28] == '/')) {\n        pcVar3[DAT_002b5f28] = '\0';\n        iVar1 = filename_cmp(DAT_002b6160,pcVar3);\n        uVar6 = (uint)(iVar1 == 0);\n      }\n      free(pcVar3);\n    }\n    *param_2 = uVar6;\n    if (DAT_002b6158 == 0) {\n      return pFVar2;\n    }\n    pcVar3 = "opened script file %s\n";\n  }" (else "else") (compound_statement "{\n    uVar6 = 0;\n    if (DAT_002b6160 != 0) {\n      pcVar3 = (char *)lrealpath(param_1);\n      sVar4 = strlen(pcVar3);\n      if ((DAT_002b5f28 < (int)sVar4) && (pcVar3[DAT_002b5f28] == '/')) {\n        pcVar3[DAT_002b5f28] = '\0';\n        iVar1 = filename_cmp(DAT_002b6160,pcVar3);\n        uVar6 = (uint)(iVar1 == 0);\n      }\n      free(pcVar3);\n    }\n    *param_2 = uVar6;\n    if (DAT_002b6158 == 0) {\n      return pFVar2;\n    }\n    pcVar3 = "opened script file %s\n";\n  }" ({ "{") (expression_statement "uVar6 = 0;" (assignment_expression "uVar6 = 0" (identifier "uVar6") (= "=") (number_literal "0")) (; ";")) (if_statement "if (DAT_002b6160 != 0) {\n      pcVar3 = (char *)lrealpath(param_1);\n      sVar4 = strlen(pcVar3);\n      if ((DAT_002b5f28 < (int)sVar4) && (pcVar3[DAT_002b5f28] == '/')) {\n        pcVar3[DAT_002b5f28] = '\0';\n        iVar1 = filename_cmp(DAT_002b6160,pcVar3);\n        uVar6 = (uint)(iVar1 == 0);\n      }\n      free(pcVar3);\n    }" (if "if") (parenthesized_expression "(DAT_002b6160 != 0)" (( "(") (binary_expression "DAT_002b6160 != 0" (identifier "DAT_002b6160") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n      pcVar3 = (char *)lrealpath(param_1);\n      sVar4 = strlen(pcVar3);\n      if ((DAT_002b5f28 < (int)sVar4) && (pcVar3[DAT_002b5f28] == '/')) {\n        pcVar3[DAT_002b5f28] = '\0';\n        iVar1 = filename_cmp(DAT_002b6160,pcVar3);\n        uVar6 = (uint)(iVar1 == 0);\n      }\n      free(pcVar3);\n    }" ({ "{") (expression_statement "pcVar3 = (char *)lrealpath(param_1);" (assignment_expression "pcVar3 = (char *)lrealpath(param_1)" (identifier "pcVar3") (= "=") (cast_expression "(char *)lrealpath(param_1)" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "lrealpath(param_1)" (identifier "lrealpath") (argument_list "(param_1)" (( "(") (identifier "param_1") () ")"))))) (; ";")) (expression_statement "sVar4 = strlen(pcVar3);" (assignment_expression "sVar4 = strlen(pcVar3)" (identifier "sVar4") (= "=") (call_expression "strlen(pcVar3)" (identifier "strlen") (argument_list "(pcVar3)" (( "(") (identifier "pcVar3") () ")")))) (; ";")) (if_statement "if ((DAT_002b5f28 < (int)sVar4) && (pcVar3[DAT_002b5f28] == '/')) {\n        pcVar3[DAT_002b5f28] = '\0';\n        iVar1 = filename_cmp(DAT_002b6160,pcVar3);\n        uVar6 = (uint)(iVar1 == 0);\n      }" (if "if") (parenthesized_expression "((DAT_002b5f28 < (int)sVar4) && (pcVar3[DAT_002b5f28] == '/'))" (( "(") (binary_expression "(DAT_002b5f28 < (int)sVar4) && (pcVar3[DAT_002b5f28] == '/')" (parenthesized_expression "(DAT_002b5f28 < (int)sVar4)" (( "(") (binary_expression "DAT_002b5f28 < (int)sVar4" (identifier "DAT_002b5f28") (< "<") (cast_expression "(int)sVar4" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "sVar4"))) () ")")) (&& "&&") (parenthesized_expression "(pcVar3[DAT_002b5f28] == '/')" (( "(") (binary_expression "pcVar3[DAT_002b5f28] == '/'" (subscript_expression "pcVar3[DAT_002b5f28]" (identifier "pcVar3") ([ "[") (identifier "DAT_002b5f28") (] "]")) (== "==") (char_literal "'/'" (' "'") (character "/") (' "'"))) () ")"))) () ")")) (compound_statement "{\n        pcVar3[DAT_002b5f28] = '\0';\n        iVar1 = filename_cmp(DAT_002b6160,pcVar3);\n        uVar6 = (uint)(iVar1 == 0);\n      }" ({ "{") (expression_statement "pcVar3[DAT_002b5f28] = '\0';" (assignment_expression "pcVar3[DAT_002b5f28] = '\0'" (subscript_expression "pcVar3[DAT_002b5f28]" (identifier "pcVar3") ([ "[") (identifier "DAT_002b5f28") (] "]")) (= "=") (char_literal "'\0'" (' "'") (escape_sequence "\0") (' "'"))) (; ";")) (expression_statement "iVar1 = filename_cmp(DAT_002b6160,pcVar3);" (assignment_expression "iVar1 = filename_cmp(DAT_002b6160,pcVar3)" (identifier "iVar1") (= "=") (call_expression "filename_cmp(DAT_002b6160,pcVar3)" (identifier "filename_cmp") (argument_list "(DAT_002b6160,pcVar3)" (( "(") (identifier "DAT_002b6160") (, ",") (identifier "pcVar3") () ")")))) (; ";")) (expression_statement "uVar6 = (uint)(iVar1 == 0);" (assignment_expression "uVar6 = (uint)(iVar1 == 0)" (identifier "uVar6") (= "=") (call_expression "(uint)(iVar1 == 0)" (parenthesized_expression "(uint)" (( "(") (identifier "uint") () ")")) (argument_list "(iVar1 == 0)" (( "(") (binary_expression "iVar1 == 0" (identifier "iVar1") (== "==") (number_literal "0")) () ")")))) (; ";")) (} "}"))) (expression_statement "free(pcVar3);" (call_expression "free(pcVar3)" (identifier "free") (argument_list "(pcVar3)" (( "(") (identifier "pcVar3") () ")"))) (; ";")) (} "}"))) (expression_statement "*param_2 = uVar6;" (assignment_expression "*param_2 = uVar6" (pointer_expression "*param_2" (* "*") (identifier "param_2")) (= "=") (identifier "uVar6")) (; ";")) (if_statement "if (DAT_002b6158 == 0) {\n      return pFVar2;\n    }" (if "if") (parenthesized_expression "(DAT_002b6158 == 0)" (( "(") (binary_expression "DAT_002b6158 == 0" (identifier "DAT_002b6158") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n      return pFVar2;\n    }" ({ "{") (return_statement "return pFVar2;" (return "return") (identifier "pFVar2") (; ";")) (} "}"))) (expression_statement "pcVar3 = "opened script file %s\n";" (assignment_expression "pcVar3 = "opened script file %s\n"" (identifier "pcVar3") (= "=") (string_literal ""opened script file %s\n"" (" """) (string_content "opened script file %s") (escape_sequence "\n") (" """))) (; ";")) (} "}")))) (expression_statement "uVar5 = dcgettext(0,pcVar3,5);" (assignment_expression "uVar5 = dcgettext(0,pcVar3,5)" (identifier "uVar5") (= "=") (call_expression "dcgettext(0,pcVar3,5)" (identifier "dcgettext") (argument_list "(0,pcVar3,5)" (( "(") (number_literal "0") (, ",") (identifier "pcVar3") (, ",") (number_literal "5") () ")")))) (; ";")) (expression_statement "FUN_001292e0(uVar5,param_1);" (call_expression "FUN_001292e0(uVar5,param_1)" (identifier "FUN_001292e0") (argument_list "(uVar5,param_1)" (( "(") (identifier "uVar5") (, ",") (identifier "param_1") () ")"))) (; ";")) (return_statement "return pFVar2;" (return "return") (identifier "pFVar2") (; ";")) (} "}")))

type_1 * function_1(char *name,type_2 *sysrooted)

{
  int var_9;
  type_1 *var_2;
  char *pcVar3;
  size_t sVar4;
  type_3 uVar5;
  
  var_2 = var_1(name,"r");
  if (var_2 == (type_1 *)0x0) {
    if (var_3 == 0) {
      return (type_1 *)0x0;
    }
    pcVar3 = "cannot find script file %s\n";
  }
  else {
    uVar5 = 0;
    if (var_4 != (char *)0x0) {
      pcVar3 = (char *)var_5(name);
      sVar4 = var_6(pcVar3);
      if ((var_7 < (int)sVar4) && (pcVar3[var_7] == '/')) {
        pcVar3[var_7] = '\0';
        var_9 = var_8(var_4,pcVar3);
        uVar5 = (type_3)(var_9 == 0);
      }
      var_10(pcVar3);
    }
    *sysrooted = uVar5;
    if (var_3 == 0) {
      return (type_1 *)var_2;
    }
    pcVar3 = "opened script file %s\n";
  }
  pcVar3 = (char *)var_11(0,pcVar3,5);
  var_12(pcVar3,name);
  return (type_1 *)var_2;
}


(translation_unit (function_definition type: (type_identifier) declarator: (pointer_declarator declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (parameter_declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier)))))) body: (compound_statement (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (string_literal (string_content)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (number_literal)))) consequence: (compound_statement (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (return_statement (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (number_literal))))) (expression_statement (assignment_expression left: (identifier) right: (string_literal (string_content) (escape_sequence))))) alternative: (else_clause (compound_statement (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (call_expression function: (identifier) arguments: (argument_list (identifier)))))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (primitive_type)) value: (identifier)))) right: (parenthesized_expression (binary_expression left: (subscript_expression argument: (identifier) index: (identifier)) right: (char_literal (character)))))) consequence: (compound_statement (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (identifier)) right: (char_literal (escape_sequence)))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (parenthesized_expression (identifier)) arguments: (argument_list (binary_expression left: (identifier) right: (number_literal)))))))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier)))))) (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (identifier))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (return_statement (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (string_literal (string_content) (escape_sequence))))))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (number_literal) (identifier) (number_literal))))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier)))) (return_statement (identifier)))))

FILE * MASKED(char *param_1,uint *param_2)

{
  int iVar1;
  FILE *pFVar2;
  char *pcVar3;
  size_t sVar4;
  undefined8 uVar5;
  uint uVar6;
  
  pFVar2 = fopen(param_1,"r");
  if (pFVar2 == (FILE *)0x0) {
    if (DAT_002b6158 == 0) {
      return (FILE *)0x0;
    }
    pcVar3 = "cannot find script file %s\n";
  }
  else {
    uVar6 = 0;
    if (DAT_002b6160 != 0) {
      pcVar3 = (char *)lrealpath(param_1);
      sVar4 = strlen(pcVar3);
      if ((DAT_002b5f28 < (int)sVar4) && (pcVar3[DAT_002b5f28] == '/')) {
        pcVar3[DAT_002b5f28] = '\0';
        iVar1 = filename_cmp(DAT_002b6160,pcVar3);
        uVar6 = (uint)(iVar1 == 0);
      }
      free(pcVar3);
    }
    *param_2 = uVar6;
    if (DAT_002b6158 == 0) {
      return pFVar2;
    }
    pcVar3 = "opened script file %s\n";
  }
  uVar5 = dcgettext(0,pcVar3,5);
  FUN_001292e0(uVar5,param_1);
  return pFVar2;
}

