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

bfd_boolean __regparm3 check_for_scripts_dir(char *dir)

{
  char *__filename;
  int iVar1;
  uint uVar2;
  stat s;
  
  uVar2 = 0;
  s.st_ino._4_4_ = 0x3182a;
  __filename = (char *)concat(dir,"/ldscripts",0);
  iVar1 = __xstat64(3,__filename,(stat64 *)&s);
  if (iVar1 == 0) {
    uVar2 = (uint)((s.st_mode & 0xf000) == 0x4000);
  }
  free(__filename);
  return uVar2;
}



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

bool __regparm3 FUN_00031820(undefined4 param_1)

{
  char *__filename;
  int iVar1;
  stat64 local_6c;
  
  local_6c.st_ino._4_4_ = 0x3182a;
  __filename = (char *)concat(param_1,"/ldscripts",0);
  iVar1 = __xstat64(3,__filename,&local_6c);
  free(__filename);
  return iVar1 == 0 && (local_6c.st_mode & 0xf000) == 0x4000;
}


PUSH EDI
XOR EDI,EDI
PUSH ESI
PUSH EBX
CALL 0x00015a10
ADD EBX,0x627d6
SUB ESP,0x64
PUSH 0x0
LEA EDX,[EBX + 0xfffbdaf3]
PUSH EDX
PUSH EAX
CALL 0x000143e0
ADD ESP,0xc
MOV ESI,EAX
LEA EAX,[ESP + 0x4]
PUSH EAX
PUSH ESI
PUSH 0x3
CALL 0x00014b70
ADD ESP,0x10
TEST EAX,EAX
JNZ 0x00031871
MOV EAX,dword ptr [ESP + 0x10]
AND EAX,0xf000
CMP EAX,0x4000
SETZ AL
MOVZX EAX,AL
MOV EDI,EAX
SUB ESP,0xc
PUSH ESI
CALL 0x00014c40
ADD ESP,0x70
MOV EAX,EDI
POP EBX
POP ESI
POP EDI
RET
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nbool __regparm3 FUN_00031820(undefined4 param_1)\n\n{\n  char *__filename;\n  int iVar1;\n  stat64 local_6c;\n  \n  local_6c.st_ino._4_4_ = 0x3182a;\n  __filename = (char *)concat(param_1,"/ldscripts",0);\n  iVar1 = __xstat64(3,__filename,&local_6c);\n  free(__filename);\n  return iVar1 == 0 && (local_6c.st_mode & 0xf000) == 0x4000;\n}\n\n" comment (function_definition "bool __regparm3 FUN_00031820(undefined4 param_1)\n\n{\n  char *__filename;\n  int iVar1;\n  stat64 local_6c;\n  \n  local_6c.st_ino._4_4_ = 0x3182a;\n  __filename = (char *)concat(param_1,"/ldscripts",0);\n  iVar1 = __xstat64(3,__filename,&local_6c);\n  free(__filename);\n  return iVar1 == 0 && (local_6c.st_mode & 0xf000) == 0x4000;\n}" primitive_type (ERROR "__regparm3" identifier) (function_declarator "FUN_00031820(undefined4 param_1)" identifier (parameter_list "(undefined4 param_1)" ( (parameter_declaration "undefined4 param_1" type_identifier identifier) ))) (compound_statement "{\n  char *__filename;\n  int iVar1;\n  stat64 local_6c;\n  \n  local_6c.st_ino._4_4_ = 0x3182a;\n  __filename = (char *)concat(param_1,"/ldscripts",0);\n  iVar1 = __xstat64(3,__filename,&local_6c);\n  free(__filename);\n  return iVar1 == 0 && (local_6c.st_mode & 0xf000) == 0x4000;\n}" { (declaration "char *__filename;" primitive_type (pointer_declarator "*__filename" * identifier) ;) (declaration "int iVar1;" primitive_type identifier ;) (declaration "stat64 local_6c;" type_identifier identifier ;) (expression_statement "local_6c.st_ino._4_4_ = 0x3182a;" (assignment_expression "local_6c.st_ino._4_4_ = 0x3182a" (field_expression "local_6c.st_ino._4_4_" (field_expression "local_6c.st_ino" identifier . field_identifier) . field_identifier) = number_literal) ;) (expression_statement "__filename = (char *)concat(param_1,"/ldscripts",0);" (assignment_expression "__filename = (char *)concat(param_1,"/ldscripts",0)" identifier = (cast_expression "(char *)concat(param_1,"/ldscripts",0)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "concat(param_1,"/ldscripts",0)" identifier (argument_list "(param_1,"/ldscripts",0)" ( identifier , (string_literal ""/ldscripts"" " string_content ") , number_literal ))))) ;) (expression_statement "iVar1 = __xstat64(3,__filename,&local_6c);" (assignment_expression "iVar1 = __xstat64(3,__filename,&local_6c)" identifier = (call_expression "__xstat64(3,__filename,&local_6c)" identifier (argument_list "(3,__filename,&local_6c)" ( number_literal , identifier , (pointer_expression "&local_6c" & identifier) )))) ;) (expression_statement "free(__filename);" (call_expression "free(__filename)" identifier (argument_list "(__filename)" ( identifier ))) ;) (return_statement "return iVar1 == 0 && (local_6c.st_mode & 0xf000) == 0x4000;" return (binary_expression "iVar1 == 0 && (local_6c.st_mode & 0xf000) == 0x4000" (binary_expression "iVar1 == 0" identifier == number_literal) && (binary_expression "(local_6c.st_mode & 0xf000) == 0x4000" (parenthesized_expression "(local_6c.st_mode & 0xf000)" ( (binary_expression "local_6c.st_mode & 0xf000" (field_expression "local_6c.st_mode" identifier . field_identifier) & number_literal) )) == number_literal)) ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nbfd_boolean __regparm3 check_for_scripts_dir(char *dir)\n\n{\n  char *__filename;\n  int iVar1;\n  uint uVar2;\n  stat s;\n  \n  uVar2 = 0;\n  s.st_ino._4_4_ = 0x3182a;\n  __filename = (char *)concat(dir,"/ldscripts",0);\n  iVar1 = __xstat64(3,__filename,(stat64 *)&s);\n  if (iVar1 == 0) {\n    uVar2 = (uint)((s.st_mode & 0xf000) == 0x4000);\n  }\n  free(__filename);\n  return uVar2;\n}\n\n" comment (function_definition "bfd_boolean __regparm3 check_for_scripts_dir(char *dir)\n\n{\n  char *__filename;\n  int iVar1;\n  uint uVar2;\n  stat s;\n  \n  uVar2 = 0;\n  s.st_ino._4_4_ = 0x3182a;\n  __filename = (char *)concat(dir,"/ldscripts",0);\n  iVar1 = __xstat64(3,__filename,(stat64 *)&s);\n  if (iVar1 == 0) {\n    uVar2 = (uint)((s.st_mode & 0xf000) == 0x4000);\n  }\n  free(__filename);\n  return uVar2;\n}" type_identifier (ERROR "__regparm3" identifier) (function_declarator "check_for_scripts_dir(char *dir)" identifier (parameter_list "(char *dir)" ( (parameter_declaration "char *dir" primitive_type (pointer_declarator "*dir" * identifier)) ))) (compound_statement "{\n  char *__filename;\n  int iVar1;\n  uint uVar2;\n  stat s;\n  \n  uVar2 = 0;\n  s.st_ino._4_4_ = 0x3182a;\n  __filename = (char *)concat(dir,"/ldscripts",0);\n  iVar1 = __xstat64(3,__filename,(stat64 *)&s);\n  if (iVar1 == 0) {\n    uVar2 = (uint)((s.st_mode & 0xf000) == 0x4000);\n  }\n  free(__filename);\n  return uVar2;\n}" { (declaration "char *__filename;" primitive_type (pointer_declarator "*__filename" * identifier) ;) (declaration "int iVar1;" primitive_type identifier ;) (declaration "uint uVar2;" type_identifier identifier ;) (declaration "stat s;" type_identifier identifier ;) (expression_statement "uVar2 = 0;" (assignment_expression "uVar2 = 0" identifier = number_literal) ;) (expression_statement "s.st_ino._4_4_ = 0x3182a;" (assignment_expression "s.st_ino._4_4_ = 0x3182a" (field_expression "s.st_ino._4_4_" (field_expression "s.st_ino" identifier . field_identifier) . field_identifier) = number_literal) ;) (expression_statement "__filename = (char *)concat(dir,"/ldscripts",0);" (assignment_expression "__filename = (char *)concat(dir,"/ldscripts",0)" identifier = (cast_expression "(char *)concat(dir,"/ldscripts",0)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "concat(dir,"/ldscripts",0)" identifier (argument_list "(dir,"/ldscripts",0)" ( identifier , (string_literal ""/ldscripts"" " string_content ") , number_literal ))))) ;) (expression_statement "iVar1 = __xstat64(3,__filename,(stat64 *)&s);" (assignment_expression "iVar1 = __xstat64(3,__filename,(stat64 *)&s)" identifier = (call_expression "__xstat64(3,__filename,(stat64 *)&s)" identifier (argument_list "(3,__filename,(stat64 *)&s)" ( number_literal , identifier , (cast_expression "(stat64 *)&s" ( (type_descriptor "stat64 *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "&s" & identifier)) )))) ;) (if_statement "if (iVar1 == 0) {\n    uVar2 = (uint)((s.st_mode & 0xf000) == 0x4000);\n  }" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (compound_statement "{\n    uVar2 = (uint)((s.st_mode & 0xf000) == 0x4000);\n  }" { (expression_statement "uVar2 = (uint)((s.st_mode & 0xf000) == 0x4000);" (assignment_expression "uVar2 = (uint)((s.st_mode & 0xf000) == 0x4000)" identifier = (call_expression "(uint)((s.st_mode & 0xf000) == 0x4000)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "((s.st_mode & 0xf000) == 0x4000)" ( (binary_expression "(s.st_mode & 0xf000) == 0x4000" (parenthesized_expression "(s.st_mode & 0xf000)" ( (binary_expression "s.st_mode & 0xf000" (field_expression "s.st_mode" identifier . field_identifier) & number_literal) )) == number_literal) )))) ;) })) (expression_statement "free(__filename);" (call_expression "free(__filename)" identifier (argument_list "(__filename)" ( identifier ))) ;) (return_statement "return uVar2;" return identifier ;) })))
(translation_unit "bool __regparm3 FUN_00031820(undefined4 param_1)\n\n{\n  char *__filename;\n  int iVar1;\n  stat64 local_6c;\n  \n  local_6c.st_ino._4_4_ = 0x3182a;\n  __filename = (char *)concat(param_1,"/ldscripts",0);\n  iVar1 = __xstat64(3,__filename,&local_6c);\n  free(__filename);\n  return iVar1 == 0 && (local_6c.st_mode & 0xf000) == 0x4000;\n}\n\n" (function_definition "bool __regparm3 FUN_00031820(undefined4 param_1)\n\n{\n  char *__filename;\n  int iVar1;\n  stat64 local_6c;\n  \n  local_6c.st_ino._4_4_ = 0x3182a;\n  __filename = (char *)concat(param_1,"/ldscripts",0);\n  iVar1 = __xstat64(3,__filename,&local_6c);\n  free(__filename);\n  return iVar1 == 0 && (local_6c.st_mode & 0xf000) == 0x4000;\n}" primitive_type (ERROR "__regparm3" identifier) (function_declarator "FUN_00031820(undefined4 param_1)" identifier (parameter_list "(undefined4 param_1)" ( (parameter_declaration "undefined4 param_1" type_identifier identifier) ))) (compound_statement "{\n  char *__filename;\n  int iVar1;\n  stat64 local_6c;\n  \n  local_6c.st_ino._4_4_ = 0x3182a;\n  __filename = (char *)concat(param_1,"/ldscripts",0);\n  iVar1 = __xstat64(3,__filename,&local_6c);\n  free(__filename);\n  return iVar1 == 0 && (local_6c.st_mode & 0xf000) == 0x4000;\n}" { (declaration "char *__filename;" primitive_type (pointer_declarator "*__filename" * identifier) ;) (declaration "int iVar1;" primitive_type identifier ;) (declaration "stat64 local_6c;" type_identifier identifier ;) (expression_statement "local_6c.st_ino._4_4_ = 0x3182a;" (assignment_expression "local_6c.st_ino._4_4_ = 0x3182a" (field_expression "local_6c.st_ino._4_4_" (field_expression "local_6c.st_ino" identifier . field_identifier) . field_identifier) = number_literal) ;) (expression_statement "__filename = (char *)concat(param_1,"/ldscripts",0);" (assignment_expression "__filename = (char *)concat(param_1,"/ldscripts",0)" identifier = (cast_expression "(char *)concat(param_1,"/ldscripts",0)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "concat(param_1,"/ldscripts",0)" identifier (argument_list "(param_1,"/ldscripts",0)" ( identifier , (string_literal ""/ldscripts"" " string_content ") , number_literal ))))) ;) (expression_statement "iVar1 = __xstat64(3,__filename,&local_6c);" (assignment_expression "iVar1 = __xstat64(3,__filename,&local_6c)" identifier = (call_expression "__xstat64(3,__filename,&local_6c)" identifier (argument_list "(3,__filename,&local_6c)" ( number_literal , identifier , (pointer_expression "&local_6c" & identifier) )))) ;) (expression_statement "free(__filename);" (call_expression "free(__filename)" identifier (argument_list "(__filename)" ( identifier ))) ;) (return_statement "return iVar1 == 0 && (local_6c.st_mode & 0xf000) == 0x4000;" return (binary_expression "iVar1 == 0 && (local_6c.st_mode & 0xf000) == 0x4000" (binary_expression "iVar1 == 0" identifier == number_literal) && (binary_expression "(local_6c.st_mode & 0xf000) == 0x4000" (parenthesized_expression "(local_6c.st_mode & 0xf000)" ( (binary_expression "local_6c.st_mode & 0xf000" (field_expression "local_6c.st_mode" identifier . field_identifier) & number_literal) )) == number_literal)) ;) })))
(translation_unit (function_definition TYPE (ERROR IDENT) (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression (field_expression (field_expression IDENT . field_identifier) . field_identifier) = LIT) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression IDENT (argument_list ( IDENT , (string_literal " string_content ") , LIT ))))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( LIT , IDENT , (pointer_expression & IDENT) )))) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (return_statement return (binary_expression (binary_expression IDENT == LIT) && (binary_expression (parenthesized_expression ( (binary_expression (field_expression IDENT . field_identifier) & LIT) )) == LIT)) ;) })))
(function_definition "bool __regparm3 FUN_00031820(undefined4 param_1)\n\n{\n  char *__filename;\n  int iVar1;\n  stat64 local_6c;\n  \n  local_6c.st_ino._4_4_ = 0x3182a;\n  __filename = (char *)concat(param_1,"/ldscripts",0);\n  iVar1 = __xstat64(3,__filename,&local_6c);\n  free(__filename);\n  return iVar1 == 0 && (local_6c.st_mode & 0xf000) == 0x4000;\n}" (primitive_type "bool") (ERROR "__regparm3" (identifier "__regparm3")) (function_declarator "FUN_00031820(undefined4 param_1)" (identifier "FUN_00031820") (parameter_list "(undefined4 param_1)" (( "(") (parameter_declaration "undefined4 param_1" (type_identifier "undefined4") (identifier "param_1")) () ")"))) (compound_statement "{\n  char *__filename;\n  int iVar1;\n  stat64 local_6c;\n  \n  local_6c.st_ino._4_4_ = 0x3182a;\n  __filename = (char *)concat(param_1,"/ldscripts",0);\n  iVar1 = __xstat64(3,__filename,&local_6c);\n  free(__filename);\n  return iVar1 == 0 && (local_6c.st_mode & 0xf000) == 0x4000;\n}" ({ "{") (declaration "char *__filename;" (primitive_type "char") (pointer_declarator "*__filename" (* "*") (identifier "__filename")) (; ";")) (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "stat64 local_6c;" (type_identifier "stat64") (identifier "local_6c") (; ";")) (expression_statement "local_6c.st_ino._4_4_ = 0x3182a;" (assignment_expression "local_6c.st_ino._4_4_ = 0x3182a" (field_expression "local_6c.st_ino._4_4_" (field_expression "local_6c.st_ino" (identifier "local_6c") (. ".") (field_identifier "st_ino")) (. ".") (field_identifier "_4_4_")) (= "=") (number_literal "0x3182a")) (; ";")) (expression_statement "__filename = (char *)concat(param_1,"/ldscripts",0);" (assignment_expression "__filename = (char *)concat(param_1,"/ldscripts",0)" (identifier "__filename") (= "=") (cast_expression "(char *)concat(param_1,"/ldscripts",0)" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "concat(param_1,"/ldscripts",0)" (identifier "concat") (argument_list "(param_1,"/ldscripts",0)" (( "(") (identifier "param_1") (, ",") (string_literal ""/ldscripts"" (" """) (string_content "/ldscripts") (" """)) (, ",") (number_literal "0") () ")"))))) (; ";")) (expression_statement "iVar1 = __xstat64(3,__filename,&local_6c);" (assignment_expression "iVar1 = __xstat64(3,__filename,&local_6c)" (identifier "iVar1") (= "=") (call_expression "__xstat64(3,__filename,&local_6c)" (identifier "__xstat64") (argument_list "(3,__filename,&local_6c)" (( "(") (number_literal "3") (, ",") (identifier "__filename") (, ",") (pointer_expression "&local_6c" (& "&") (identifier "local_6c")) () ")")))) (; ";")) (expression_statement "free(__filename);" (call_expression "free(__filename)" (identifier "free") (argument_list "(__filename)" (( "(") (identifier "__filename") () ")"))) (; ";")) (return_statement "return iVar1 == 0 && (local_6c.st_mode & 0xf000) == 0x4000;" (return "return") (binary_expression "iVar1 == 0 && (local_6c.st_mode & 0xf000) == 0x4000" (binary_expression "iVar1 == 0" (identifier "iVar1") (== "==") (number_literal "0")) (&& "&&") (binary_expression "(local_6c.st_mode & 0xf000) == 0x4000" (parenthesized_expression "(local_6c.st_mode & 0xf000)" (( "(") (binary_expression "local_6c.st_mode & 0xf000" (field_expression "local_6c.st_mode" (identifier "local_6c") (. ".") (field_identifier "st_mode")) (& "&") (number_literal "0xf000")) () ")")) (== "==") (number_literal "0x4000"))) (; ";")) (} "}")))

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

type_1 __regparm3 function_1(char *dir)

{
  char *__filename;
  int var_3;
  type_2 uVar2;
  type_3 s;
  
  uVar2 = 0;
  s.st_ino._4_4_ = 0x3182a;
  __filename = (char *)var_1(dir,"/ldscripts",0);
  var_3 = var_2(3,__filename,(type_4 *)&s);
  if (var_3 == 0) {
    uVar2 = (type_2)((s.st_mode & 0xf000) == 0x4000);
  }
  var_4(__filename);
  return uVar2;
}


(translation_unit (function_definition type: (primitive_type) (ERROR (identifier)) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (type_identifier) declarator: (identifier)))) body: (compound_statement (declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (expression_statement (assignment_expression left: (field_expression argument: (field_expression argument: (identifier) field: (field_identifier)) field: (field_identifier)) right: (number_literal))) (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) (string_literal (string_content)) (number_literal)))))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (number_literal) (identifier) (pointer_expression argument: (identifier)))))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier)))) (return_statement (binary_expression left: (binary_expression left: (identifier) right: (number_literal)) right: (binary_expression left: (parenthesized_expression (binary_expression left: (field_expression argument: (identifier) field: (field_identifier)) right: (number_literal))) right: (number_literal)))))))

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

bool __regparm3 MASKED(undefined4 param_1)

{
  char *__filename;
  int iVar1;
  stat64 local_6c;
  
  local_6c.st_ino._4_4_ = 0x3182a;
  __filename = (char *)concat(param_1,"/ldscripts",0);
  iVar1 = __xstat64(3,__filename,&local_6c);
  free(__filename);
  return iVar1 == 0 && (local_6c.st_mode & 0xf000) == 0x4000;
}

