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

bfd_boolean
gld_i386pe_open_dynamic_archive
          (char *arch,search_dirs_type *search,lang_input_statement_type *entry)

{
  char *__s;
  size_t sVar1;
  size_t sVar2;
  size_t sVar3;
  char *pcVar4;
  int iVar5;
  bfd_boolean bVar6;
  uint uVar7;
  char *pcVar8;
  int iVar9;
  uint uVar10;
  undefined **ppuVar11;
  
  if (((ulonglong)entry->flags & 3) != 1) {
    return 0;
  }
  __s = entry->filename;
  uVar10 = format_max_len_12754;
  if (format_max_len_12754 == 0) {
    ppuVar11 = &PTR_s_lib_s_a_001ce510;
    uVar7 = 0xb;
    pcVar8 = "%s.dll.a";
    while( true ) {
      if (uVar10 < uVar7) {
        uVar10 = uVar7;
        format_max_len_12754 = uVar7;
      }
      if (pcVar8 == (char *)0x0) break;
      pcVar4 = *ppuVar11;
      ppuVar11 = ppuVar11 + 2;
      uVar7 = strlen(pcVar8);
      pcVar8 = pcVar4;
    }
  }
  sVar1 = strlen(search->name);
  sVar2 = strlen(__s);
  sVar3 = 0;
  if (pe_dll_search_prefix != (char *)0x0) {
    sVar3 = strlen(pe_dll_search_prefix);
  }
  iVar9 = 0;
  pcVar4 = (char *)xmalloc(sVar2 + uVar10 + 2 + sVar1 + sVar3);
  sprintf(pcVar4,"%s/",search->name);
  sVar1 = strlen(pcVar4);
  pcVar8 = "lib%s.dll.a";
  iVar5 = 0;
  do {
    if (iVar5 == 0) {
      sprintf(pcVar4 + sVar1,pcVar8,__s);
LAB_00058164:
      bVar6 = ldfile_try_open_bfd(pcVar4,entry);
      if (bVar6 != 0) {
        if ((&libname_fmt_12753)[iVar9 * 2] != (undefined *)0x0) {
          entry->filename = pcVar4;
          return 1;
        }
LAB_00058218:
        free(pcVar4);
        return 0;
      }
    }
    else if (pe_dll_search_prefix != (char *)0x0) {
      sprintf(pcVar4 + sVar1,pcVar8,pe_dll_search_prefix,__s);
      goto LAB_00058164;
    }
    iVar9 = iVar9 + 1;
    pcVar8 = (&libname_fmt_12753)[iVar9 * 2];
    if (pcVar8 == (char *)0x0) goto LAB_00058218;
    iVar5 = *(int *)(&UNK_001ce504 + iVar9 * 8);
  } while( true );
}



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

undefined4 FUN_00058080(undefined4 param_1,int param_2,int param_3)

{
  char *__s;
  size_t sVar1;
  size_t sVar2;
  size_t sVar3;
  char *pcVar4;
  int iVar5;
  uint uVar6;
  char *pcVar7;
  int iVar8;
  uint uVar9;
  undefined **ppuVar10;
  
  if ((*(byte *)(param_3 + 0x24) & 3) != 1) {
    return 0;
  }
  __s = *(char **)(param_3 + 8);
  uVar9 = DAT_001d0f84;
  if (DAT_001d0f84 == 0) {
    ppuVar10 = &PTR_s_lib_s_a_001ce510;
    uVar6 = 0xb;
    pcVar7 = "%s.dll.a";
    while( true ) {
      if (uVar9 < uVar6) {
        uVar9 = uVar6;
        DAT_001d0f84 = uVar6;
      }
      if (pcVar7 == (char *)0x0) break;
      pcVar4 = *ppuVar10;
      ppuVar10 = ppuVar10 + 2;
      uVar6 = strlen(pcVar7);
      pcVar7 = pcVar4;
    }
  }
  sVar1 = strlen(*(char **)(param_2 + 4));
  sVar2 = strlen(__s);
  sVar3 = 0;
  if (DAT_001d0f90 != (char *)0x0) {
    sVar3 = strlen(DAT_001d0f90);
  }
  iVar8 = 0;
  pcVar4 = (char *)xmalloc(sVar2 + uVar9 + 2 + sVar1 + sVar3);
  sprintf(pcVar4,"%s/",*(undefined4 *)(param_2 + 4));
  sVar1 = strlen(pcVar4);
  pcVar7 = "lib%s.dll.a";
  iVar5 = 0;
  do {
    if (iVar5 == 0) {
      sprintf(pcVar4 + sVar1,pcVar7,__s);
LAB_00058164:
      iVar5 = FUN_00035320(pcVar4,param_3);
      if (iVar5 != 0) {
        if ((&PTR_s_lib_s_dll_a_001ce500)[iVar8 * 2] != (undefined *)0x0) {
          *(char **)(param_3 + 8) = pcVar4;
          return 1;
        }
LAB_00058218:
        free(pcVar4);
        return 0;
      }
    }
    else if (DAT_001d0f90 != (char *)0x0) {
      sprintf(pcVar4 + sVar1,pcVar7,DAT_001d0f90,__s);
      goto LAB_00058164;
    }
    iVar8 = iVar8 + 1;
    pcVar7 = (&PTR_s_lib_s_dll_a_001ce500)[iVar8 * 2];
    if (pcVar7 == (char *)0x0) goto LAB_00058218;
    iVar5 = *(int *)(&UNK_001ce504 + iVar8 * 8);
  } while( true );
}


PUSH EBP
XOR EAX,EAX
PUSH EDI
PUSH ESI
PUSH EBX
CALL 0x00017b80
ADD EBX,0x176f75
SUB ESP,0x1c
MOV EDI,dword ptr [ESP + 0x38]
MOVZX EDX,byte ptr [EDI + 0x24]
AND EDX,0x3
CMP DL,0x1
JNZ 0x000581c3
MOV EAX,dword ptr [EDI + 0x8]
MOV ESI,dword ptr [EBX + 0x1f84]
MOV dword ptr [ESP + 0x8],EAX
TEST ESI,ESI
JZ 0x000581d0
SUB ESP,0xc
MOV EAX,dword ptr [ESP + 0x40]
PUSH dword ptr [EAX + 0x4]
CALL 0x00016760
POP EDX
PUSH dword ptr [ESP + 0x14]
MOV EBP,EAX
LEA ESI,[ESI + EBP*0x1 + 0x2]
CALL 0x00016760
MOV EDX,dword ptr [EBX + 0x1f90]
ADD ESP,0x10
MOV ECX,EAX
XOR EAX,EAX
TEST EDX,EDX
JZ 0x00058101
MOV dword ptr [ESP + 0xc],ECX
SUB ESP,0xc
PUSH EDX
CALL 0x00016760
ADD ESP,0x10
MOV ECX,dword ptr [ESP + 0xc]
LEA EBP,[ECX + ESI*0x1]
SUB ESP,0xc
XOR ESI,ESI
ADD EBP,EAX
PUSH EBP
CALL 0x00016dc8
ADD ESP,0xc
MOV EBP,EAX
MOV EAX,dword ptr [ESP + 0x38]
PUSH dword ptr [EAX + 0x4]
LEA EAX,[EBX + 0xfffc4e59]
PUSH EAX
PUSH EBP
CALL 0x00016af0
MOV dword ptr [ESP],EBP
CALL 0x00016760
ADD ESP,0x10
LEA EDX,[EBX + 0xfffc4e4d]
ADD EAX,EBP
MOV dword ptr [ESP + 0xc],EAX
XOR EAX,EAX
JMP 0x00058195
MOV EAX,dword ptr [EBX + 0x1f90]
TEST EAX,EAX
JZ 0x00058175
PUSH dword ptr [ESP + 0x8]
PUSH EAX
PUSH EDX
PUSH dword ptr [ESP + 0x18]
CALL 0x00016af0
ADD ESP,0x10
SUB ESP,0x8
PUSH EDI
PUSH EBP
CALL 0x00035320
ADD ESP,0x10
TEST EAX,EAX
JNZ 0x000581b0
ADD ESI,0x1
LEA EAX,[ESI*0x8 + 0x0]
MOV EDX,dword ptr [EAX + EBX*0x1 + 0xfffff500]
TEST EDX,EDX
JZ 0x00058218
MOV EAX,dword ptr [EAX + EBX*0x1 + 0xfffff504]
TEST EAX,EAX
JNZ 0x00058148
SUB ESP,0x4
PUSH dword ptr [ESP + 0xc]
PUSH EDX
PUSH dword ptr [ESP + 0x18]
CALL 0x00016af0
ADD ESP,0x10
JMP 0x00058164
MOV EAX,dword ptr [EBX + ESI*0x8 + 0xfffff500]
TEST EAX,EAX
JZ 0x00058218
MOV dword ptr [EDI + 0x8],EBP
MOV EAX,0x1
ADD ESP,0x1c
POP EBX
POP ESI
POP EDI
POP EBP
RET
LEA EBP,[EBX + 0xfffff510]
MOV EAX,0xb
LEA ECX,[EBX + 0xfffc4e50]
MOV EDI,EBP
JMP 0x000581fb
SUB ESP,0xc
MOV EBP,dword ptr [EDI]
ADD EDI,0x8
PUSH ECX
CALL 0x00016760
ADD ESP,0x10
MOV ECX,EBP
CMP EAX,ESI
JBE 0x00058207
MOV dword ptr [EBX + 0x1f84],EAX
MOV ESI,EAX
TEST ECX,ECX
JNZ 0x000581e8
MOV EDI,dword ptr [ESP + 0x38]
JMP 0x000580bd
SUB ESP,0xc
PUSH EBP
CALL 0x00016db0
ADD ESP,0x10
XOR EAX,EAX
ADD ESP,0x1c
POP EBX
POP ESI
POP EDI
POP EBP
RET
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nundefined4 FUN_00058080(undefined4 param_1,int param_2,int param_3)\n\n{\n  char *__s;\n  size_t sVar1;\n  size_t sVar2;\n  size_t sVar3;\n  char *pcVar4;\n  int iVar5;\n  uint uVar6;\n  char *pcVar7;\n  int iVar8;\n  uint uVar9;\n  undefined **ppuVar10;\n  \n  if ((*(byte *)(param_3 + 0x24) & 3) != 1) {\n    return 0;\n  }\n  __s = *(char **)(param_3 + 8);\n  uVar9 = DAT_001d0f84;\n  if (DAT_001d0f84 == 0) {\n    ppuVar10 = &PTR_s_lib_s_a_001ce510;\n    uVar6 = 0xb;\n    pcVar7 = "%s.dll.a";\n    while( true ) {\n      if (uVar9 < uVar6) {\n        uVar9 = uVar6;\n        DAT_001d0f84 = uVar6;\n      }\n      if (pcVar7 == (char *)0x0) break;\n      pcVar4 = *ppuVar10;\n      ppuVar10 = ppuVar10 + 2;\n      uVar6 = strlen(pcVar7);\n      pcVar7 = pcVar4;\n    }\n  }\n  sVar1 = strlen(*(char **)(param_2 + 4));\n  sVar2 = strlen(__s);\n  sVar3 = 0;\n  if (DAT_001d0f90 != (char *)0x0) {\n    sVar3 = strlen(DAT_001d0f90);\n  }\n  iVar8 = 0;\n  pcVar4 = (char *)xmalloc(sVar2 + uVar9 + 2 + sVar1 + sVar3);\n  sprintf(pcVar4,"%s/",*(undefined4 *)(param_2 + 4));\n  sVar1 = strlen(pcVar4);\n  pcVar7 = "lib%s.dll.a";\n  iVar5 = 0;\n  do {\n    if (iVar5 == 0) {\n      sprintf(pcVar4 + sVar1,pcVar7,__s);\nLAB_00058164:\n      iVar5 = FUN_00035320(pcVar4,param_3);\n      if (iVar5 != 0) {\n        if ((&PTR_s_lib_s_dll_a_001ce500)[iVar8 * 2] != (undefined *)0x0) {\n          *(char **)(param_3 + 8) = pcVar4;\n          return 1;\n        }\nLAB_00058218:\n        free(pcVar4);\n        return 0;\n      }\n    }\n    else if (DAT_001d0f90 != (char *)0x0) {\n      sprintf(pcVar4 + sVar1,pcVar7,DAT_001d0f90,__s);\n      goto LAB_00058164;\n    }\n    iVar8 = iVar8 + 1;\n    pcVar7 = (&PTR_s_lib_s_dll_a_001ce500)[iVar8 * 2];\n    if (pcVar7 == (char *)0x0) goto LAB_00058218;\n    iVar5 = *(int *)(&UNK_001ce504 + iVar8 * 8);\n  } while( true );\n}\n\n" comment (function_definition "undefined4 FUN_00058080(undefined4 param_1,int param_2,int param_3)\n\n{\n  char *__s;\n  size_t sVar1;\n  size_t sVar2;\n  size_t sVar3;\n  char *pcVar4;\n  int iVar5;\n  uint uVar6;\n  char *pcVar7;\n  int iVar8;\n  uint uVar9;\n  undefined **ppuVar10;\n  \n  if ((*(byte *)(param_3 + 0x24) & 3) != 1) {\n    return 0;\n  }\n  __s = *(char **)(param_3 + 8);\n  uVar9 = DAT_001d0f84;\n  if (DAT_001d0f84 == 0) {\n    ppuVar10 = &PTR_s_lib_s_a_001ce510;\n    uVar6 = 0xb;\n    pcVar7 = "%s.dll.a";\n    while( true ) {\n      if (uVar9 < uVar6) {\n        uVar9 = uVar6;\n        DAT_001d0f84 = uVar6;\n      }\n      if (pcVar7 == (char *)0x0) break;\n      pcVar4 = *ppuVar10;\n      ppuVar10 = ppuVar10 + 2;\n      uVar6 = strlen(pcVar7);\n      pcVar7 = pcVar4;\n    }\n  }\n  sVar1 = strlen(*(char **)(param_2 + 4));\n  sVar2 = strlen(__s);\n  sVar3 = 0;\n  if (DAT_001d0f90 != (char *)0x0) {\n    sVar3 = strlen(DAT_001d0f90);\n  }\n  iVar8 = 0;\n  pcVar4 = (char *)xmalloc(sVar2 + uVar9 + 2 + sVar1 + sVar3);\n  sprintf(pcVar4,"%s/",*(undefined4 *)(param_2 + 4));\n  sVar1 = strlen(pcVar4);\n  pcVar7 = "lib%s.dll.a";\n  iVar5 = 0;\n  do {\n    if (iVar5 == 0) {\n      sprintf(pcVar4 + sVar1,pcVar7,__s);\nLAB_00058164:\n      iVar5 = FUN_00035320(pcVar4,param_3);\n      if (iVar5 != 0) {\n        if ((&PTR_s_lib_s_dll_a_001ce500)[iVar8 * 2] != (undefined *)0x0) {\n          *(char **)(param_3 + 8) = pcVar4;\n          return 1;\n        }\nLAB_00058218:\n        free(pcVar4);\n        return 0;\n      }\n    }\n    else if (DAT_001d0f90 != (char *)0x0) {\n      sprintf(pcVar4 + sVar1,pcVar7,DAT_001d0f90,__s);\n      goto LAB_00058164;\n    }\n    iVar8 = iVar8 + 1;\n    pcVar7 = (&PTR_s_lib_s_dll_a_001ce500)[iVar8 * 2];\n    if (pcVar7 == (char *)0x0) goto LAB_00058218;\n    iVar5 = *(int *)(&UNK_001ce504 + iVar8 * 8);\n  } while( true );\n}" type_identifier (function_declarator "FUN_00058080(undefined4 param_1,int param_2,int param_3)" identifier (parameter_list "(undefined4 param_1,int param_2,int param_3)" ( (parameter_declaration "undefined4 param_1" type_identifier identifier) , (parameter_declaration "int param_2" primitive_type identifier) , (parameter_declaration "int param_3" primitive_type identifier) ))) (compound_statement "{\n  char *__s;\n  size_t sVar1;\n  size_t sVar2;\n  size_t sVar3;\n  char *pcVar4;\n  int iVar5;\n  uint uVar6;\n  char *pcVar7;\n  int iVar8;\n  uint uVar9;\n  undefined **ppuVar10;\n  \n  if ((*(byte *)(param_3 + 0x24) & 3) != 1) {\n    return 0;\n  }\n  __s = *(char **)(param_3 + 8);\n  uVar9 = DAT_001d0f84;\n  if (DAT_001d0f84 == 0) {\n    ppuVar10 = &PTR_s_lib_s_a_001ce510;\n    uVar6 = 0xb;\n    pcVar7 = "%s.dll.a";\n    while( true ) {\n      if (uVar9 < uVar6) {\n        uVar9 = uVar6;\n        DAT_001d0f84 = uVar6;\n      }\n      if (pcVar7 == (char *)0x0) break;\n      pcVar4 = *ppuVar10;\n      ppuVar10 = ppuVar10 + 2;\n      uVar6 = strlen(pcVar7);\n      pcVar7 = pcVar4;\n    }\n  }\n  sVar1 = strlen(*(char **)(param_2 + 4));\n  sVar2 = strlen(__s);\n  sVar3 = 0;\n  if (DAT_001d0f90 != (char *)0x0) {\n    sVar3 = strlen(DAT_001d0f90);\n  }\n  iVar8 = 0;\n  pcVar4 = (char *)xmalloc(sVar2 + uVar9 + 2 + sVar1 + sVar3);\n  sprintf(pcVar4,"%s/",*(undefined4 *)(param_2 + 4));\n  sVar1 = strlen(pcVar4);\n  pcVar7 = "lib%s.dll.a";\n  iVar5 = 0;\n  do {\n    if (iVar5 == 0) {\n      sprintf(pcVar4 + sVar1,pcVar7,__s);\nLAB_00058164:\n      iVar5 = FUN_00035320(pcVar4,param_3);\n      if (iVar5 != 0) {\n        if ((&PTR_s_lib_s_dll_a_001ce500)[iVar8 * 2] != (undefined *)0x0) {\n          *(char **)(param_3 + 8) = pcVar4;\n          return 1;\n        }\nLAB_00058218:\n        free(pcVar4);\n        return 0;\n      }\n    }\n    else if (DAT_001d0f90 != (char *)0x0) {\n      sprintf(pcVar4 + sVar1,pcVar7,DAT_001d0f90,__s);\n      goto LAB_00058164;\n    }\n    iVar8 = iVar8 + 1;\n    pcVar7 = (&PTR_s_lib_s_dll_a_001ce500)[iVar8 * 2];\n    if (pcVar7 == (char *)0x0) goto LAB_00058218;\n    iVar5 = *(int *)(&UNK_001ce504 + iVar8 * 8);\n  } while( true );\n}" { (declaration "char *__s;" primitive_type (pointer_declarator "*__s" * identifier) ;) (declaration "size_t sVar1;" primitive_type identifier ;) (declaration "size_t sVar2;" primitive_type identifier ;) (declaration "size_t sVar3;" primitive_type identifier ;) (declaration "char *pcVar4;" primitive_type (pointer_declarator "*pcVar4" * identifier) ;) (declaration "int iVar5;" primitive_type identifier ;) (declaration "uint uVar6;" type_identifier identifier ;) (declaration "char *pcVar7;" primitive_type (pointer_declarator "*pcVar7" * identifier) ;) (declaration "int iVar8;" primitive_type identifier ;) (declaration "uint uVar9;" type_identifier identifier ;) (declaration "undefined **ppuVar10;" type_identifier (pointer_declarator "**ppuVar10" * (pointer_declarator "*ppuVar10" * identifier)) ;) (if_statement "if ((*(byte *)(param_3 + 0x24) & 3) != 1) {\n    return 0;\n  }" if (parenthesized_expression "((*(byte *)(param_3 + 0x24) & 3) != 1)" ( (binary_expression "(*(byte *)(param_3 + 0x24) & 3) != 1" (parenthesized_expression "(*(byte *)(param_3 + 0x24) & 3)" ( (binary_expression "*(byte *)(param_3 + 0x24) & 3" (pointer_expression "*(byte *)(param_3 + 0x24)" * (cast_expression "(byte *)(param_3 + 0x24)" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_3 + 0x24)" ( (binary_expression "param_3 + 0x24" identifier + number_literal) )))) & number_literal) )) != number_literal) )) (compound_statement "{\n    return 0;\n  }" { (return_statement "return 0;" return number_literal ;) })) (expression_statement "__s = *(char **)(param_3 + 8);" (assignment_expression "__s = *(char **)(param_3 + 8)" identifier = (pointer_expression "*(char **)(param_3 + 8)" * (cast_expression "(char **)(param_3 + 8)" ( (type_descriptor "char **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_3 + 8)" ( (binary_expression "param_3 + 8" identifier + number_literal) ))))) ;) (expression_statement "uVar9 = DAT_001d0f84;" (assignment_expression "uVar9 = DAT_001d0f84" identifier = identifier) ;) (if_statement "if (DAT_001d0f84 == 0) {\n    ppuVar10 = &PTR_s_lib_s_a_001ce510;\n    uVar6 = 0xb;\n    pcVar7 = "%s.dll.a";\n    while( true ) {\n      if (uVar9 < uVar6) {\n        uVar9 = uVar6;\n        DAT_001d0f84 = uVar6;\n      }\n      if (pcVar7 == (char *)0x0) break;\n      pcVar4 = *ppuVar10;\n      ppuVar10 = ppuVar10 + 2;\n      uVar6 = strlen(pcVar7);\n      pcVar7 = pcVar4;\n    }\n  }" if (parenthesized_expression "(DAT_001d0f84 == 0)" ( (binary_expression "DAT_001d0f84 == 0" identifier == number_literal) )) (compound_statement "{\n    ppuVar10 = &PTR_s_lib_s_a_001ce510;\n    uVar6 = 0xb;\n    pcVar7 = "%s.dll.a";\n    while( true ) {\n      if (uVar9 < uVar6) {\n        uVar9 = uVar6;\n        DAT_001d0f84 = uVar6;\n      }\n      if (pcVar7 == (char *)0x0) break;\n      pcVar4 = *ppuVar10;\n      ppuVar10 = ppuVar10 + 2;\n      uVar6 = strlen(pcVar7);\n      pcVar7 = pcVar4;\n    }\n  }" { (expression_statement "ppuVar10 = &PTR_s_lib_s_a_001ce510;" (assignment_expression "ppuVar10 = &PTR_s_lib_s_a_001ce510" identifier = (pointer_expression "&PTR_s_lib_s_a_001ce510" & identifier)) ;) (expression_statement "uVar6 = 0xb;" (assignment_expression "uVar6 = 0xb" identifier = number_literal) ;) (expression_statement "pcVar7 = "%s.dll.a";" (assignment_expression "pcVar7 = "%s.dll.a"" identifier = (string_literal ""%s.dll.a"" " string_content ")) ;) (while_statement "while( true ) {\n      if (uVar9 < uVar6) {\n        uVar9 = uVar6;\n        DAT_001d0f84 = uVar6;\n      }\n      if (pcVar7 == (char *)0x0) break;\n      pcVar4 = *ppuVar10;\n      ppuVar10 = ppuVar10 + 2;\n      uVar6 = strlen(pcVar7);\n      pcVar7 = pcVar4;\n    }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n      if (uVar9 < uVar6) {\n        uVar9 = uVar6;\n        DAT_001d0f84 = uVar6;\n      }\n      if (pcVar7 == (char *)0x0) break;\n      pcVar4 = *ppuVar10;\n      ppuVar10 = ppuVar10 + 2;\n      uVar6 = strlen(pcVar7);\n      pcVar7 = pcVar4;\n    }" { (if_statement "if (uVar9 < uVar6) {\n        uVar9 = uVar6;\n        DAT_001d0f84 = uVar6;\n      }" if (parenthesized_expression "(uVar9 < uVar6)" ( (binary_expression "uVar9 < uVar6" identifier < identifier) )) (compound_statement "{\n        uVar9 = uVar6;\n        DAT_001d0f84 = uVar6;\n      }" { (expression_statement "uVar9 = uVar6;" (assignment_expression "uVar9 = uVar6" identifier = identifier) ;) (expression_statement "DAT_001d0f84 = uVar6;" (assignment_expression "DAT_001d0f84 = uVar6" identifier = identifier) ;) })) (if_statement "if (pcVar7 == (char *)0x0) break;" if (parenthesized_expression "(pcVar7 == (char *)0x0)" ( (binary_expression "pcVar7 == (char *)0x0" identifier == (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (break_statement "break;" break ;)) (expression_statement "pcVar4 = *ppuVar10;" (assignment_expression "pcVar4 = *ppuVar10" identifier = (pointer_expression "*ppuVar10" * identifier)) ;) (expression_statement "ppuVar10 = ppuVar10 + 2;" (assignment_expression "ppuVar10 = ppuVar10 + 2" identifier = (binary_expression "ppuVar10 + 2" identifier + number_literal)) ;) (expression_statement "uVar6 = strlen(pcVar7);" (assignment_expression "uVar6 = strlen(pcVar7)" identifier = (call_expression "strlen(pcVar7)" identifier (argument_list "(pcVar7)" ( identifier )))) ;) (expression_statement "pcVar7 = pcVar4;" (assignment_expression "pcVar7 = pcVar4" identifier = identifier) ;) })) })) (expression_statement "sVar1 = strlen(*(char **)(param_2 + 4));" (assignment_expression "sVar1 = strlen(*(char **)(param_2 + 4))" identifier = (call_expression "strlen(*(char **)(param_2 + 4))" identifier (argument_list "(*(char **)(param_2 + 4))" ( (pointer_expression "*(char **)(param_2 + 4)" * (cast_expression "(char **)(param_2 + 4)" ( (type_descriptor "char **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_2 + 4)" ( (binary_expression "param_2 + 4" identifier + number_literal) )))) )))) ;) (expression_statement "sVar2 = strlen(__s);" (assignment_expression "sVar2 = strlen(__s)" identifier = (call_expression "strlen(__s)" identifier (argument_list "(__s)" ( identifier )))) ;) (expression_statement "sVar3 = 0;" (assignment_expression "sVar3 = 0" identifier = number_literal) ;) (if_statement "if (DAT_001d0f90 != (char *)0x0) {\n    sVar3 = strlen(DAT_001d0f90);\n  }" if (parenthesized_expression "(DAT_001d0f90 != (char *)0x0)" ( (binary_expression "DAT_001d0f90 != (char *)0x0" identifier != (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    sVar3 = strlen(DAT_001d0f90);\n  }" { (expression_statement "sVar3 = strlen(DAT_001d0f90);" (assignment_expression "sVar3 = strlen(DAT_001d0f90)" identifier = (call_expression "strlen(DAT_001d0f90)" identifier (argument_list "(DAT_001d0f90)" ( identifier )))) ;) })) (expression_statement "iVar8 = 0;" (assignment_expression "iVar8 = 0" identifier = number_literal) ;) (expression_statement "pcVar4 = (char *)xmalloc(sVar2 + uVar9 + 2 + sVar1 + sVar3);" (assignment_expression "pcVar4 = (char *)xmalloc(sVar2 + uVar9 + 2 + sVar1 + sVar3)" identifier = (cast_expression "(char *)xmalloc(sVar2 + uVar9 + 2 + sVar1 + sVar3)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "xmalloc(sVar2 + uVar9 + 2 + sVar1 + sVar3)" identifier (argument_list "(sVar2 + uVar9 + 2 + sVar1 + sVar3)" ( (binary_expression "sVar2 + uVar9 + 2 + sVar1 + sVar3" (binary_expression "sVar2 + uVar9 + 2 + sVar1" (binary_expression "sVar2 + uVar9 + 2" (binary_expression "sVar2 + uVar9" identifier + identifier) + number_literal) + identifier) + identifier) ))))) ;) (expression_statement "sprintf(pcVar4,"%s/",*(undefined4 *)(param_2 + 4));" (call_expression "sprintf(pcVar4,"%s/",*(undefined4 *)(param_2 + 4))" identifier (argument_list "(pcVar4,"%s/",*(undefined4 *)(param_2 + 4))" ( identifier , (string_literal ""%s/"" " string_content ") , (pointer_expression "*(undefined4 *)(param_2 + 4)" * (cast_expression "(undefined4 *)(param_2 + 4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_2 + 4)" ( (binary_expression "param_2 + 4" identifier + number_literal) )))) ))) ;) (expression_statement "sVar1 = strlen(pcVar4);" (assignment_expression "sVar1 = strlen(pcVar4)" identifier = (call_expression "strlen(pcVar4)" identifier (argument_list "(pcVar4)" ( identifier )))) ;) (expression_statement "pcVar7 = "lib%s.dll.a";" (assignment_expression "pcVar7 = "lib%s.dll.a"" identifier = (string_literal ""lib%s.dll.a"" " string_content ")) ;) (expression_statement "iVar5 = 0;" (assignment_expression "iVar5 = 0" identifier = number_literal) ;) (do_statement "do {\n    if (iVar5 == 0) {\n      sprintf(pcVar4 + sVar1,pcVar7,__s);\nLAB_00058164:\n      iVar5 = FUN_00035320(pcVar4,param_3);\n      if (iVar5 != 0) {\n        if ((&PTR_s_lib_s_dll_a_001ce500)[iVar8 * 2] != (undefined *)0x0) {\n          *(char **)(param_3 + 8) = pcVar4;\n          return 1;\n        }\nLAB_00058218:\n        free(pcVar4);\n        return 0;\n      }\n    }\n    else if (DAT_001d0f90 != (char *)0x0) {\n      sprintf(pcVar4 + sVar1,pcVar7,DAT_001d0f90,__s);\n      goto LAB_00058164;\n    }\n    iVar8 = iVar8 + 1;\n    pcVar7 = (&PTR_s_lib_s_dll_a_001ce500)[iVar8 * 2];\n    if (pcVar7 == (char *)0x0) goto LAB_00058218;\n    iVar5 = *(int *)(&UNK_001ce504 + iVar8 * 8);\n  } while( true );" do (compound_statement "{\n    if (iVar5 == 0) {\n      sprintf(pcVar4 + sVar1,pcVar7,__s);\nLAB_00058164:\n      iVar5 = FUN_00035320(pcVar4,param_3);\n      if (iVar5 != 0) {\n        if ((&PTR_s_lib_s_dll_a_001ce500)[iVar8 * 2] != (undefined *)0x0) {\n          *(char **)(param_3 + 8) = pcVar4;\n          return 1;\n        }\nLAB_00058218:\n        free(pcVar4);\n        return 0;\n      }\n    }\n    else if (DAT_001d0f90 != (char *)0x0) {\n      sprintf(pcVar4 + sVar1,pcVar7,DAT_001d0f90,__s);\n      goto LAB_00058164;\n    }\n    iVar8 = iVar8 + 1;\n    pcVar7 = (&PTR_s_lib_s_dll_a_001ce500)[iVar8 * 2];\n    if (pcVar7 == (char *)0x0) goto LAB_00058218;\n    iVar5 = *(int *)(&UNK_001ce504 + iVar8 * 8);\n  }" { (if_statement "if (iVar5 == 0) {\n      sprintf(pcVar4 + sVar1,pcVar7,__s);\nLAB_00058164:\n      iVar5 = FUN_00035320(pcVar4,param_3);\n      if (iVar5 != 0) {\n        if ((&PTR_s_lib_s_dll_a_001ce500)[iVar8 * 2] != (undefined *)0x0) {\n          *(char **)(param_3 + 8) = pcVar4;\n          return 1;\n        }\nLAB_00058218:\n        free(pcVar4);\n        return 0;\n      }\n    }\n    else if (DAT_001d0f90 != (char *)0x0) {\n      sprintf(pcVar4 + sVar1,pcVar7,DAT_001d0f90,__s);\n      goto LAB_00058164;\n    }" if (parenthesized_expression "(iVar5 == 0)" ( (binary_expression "iVar5 == 0" identifier == number_literal) )) (compound_statement "{\n      sprintf(pcVar4 + sVar1,pcVar7,__s);\nLAB_00058164:\n      iVar5 = FUN_00035320(pcVar4,param_3);\n      if (iVar5 != 0) {\n        if ((&PTR_s_lib_s_dll_a_001ce500)[iVar8 * 2] != (undefined *)0x0) {\n          *(char **)(param_3 + 8) = pcVar4;\n          return 1;\n        }\nLAB_00058218:\n        free(pcVar4);\n        return 0;\n      }\n    }" { (expression_statement "sprintf(pcVar4 + sVar1,pcVar7,__s);" (call_expression "sprintf(pcVar4 + sVar1,pcVar7,__s)" identifier (argument_list "(pcVar4 + sVar1,pcVar7,__s)" ( (binary_expression "pcVar4 + sVar1" identifier + identifier) , identifier , identifier ))) ;) (labeled_statement "LAB_00058164:\n      iVar5 = FUN_00035320(pcVar4,param_3);" statement_identifier : (expression_statement "iVar5 = FUN_00035320(pcVar4,param_3);" (assignment_expression "iVar5 = FUN_00035320(pcVar4,param_3)" identifier = (call_expression "FUN_00035320(pcVar4,param_3)" identifier (argument_list "(pcVar4,param_3)" ( identifier , identifier )))) ;)) (if_statement "if (iVar5 != 0) {\n        if ((&PTR_s_lib_s_dll_a_001ce500)[iVar8 * 2] != (undefined *)0x0) {\n          *(char **)(param_3 + 8) = pcVar4;\n          return 1;\n        }\nLAB_00058218:\n        free(pcVar4);\n        return 0;\n      }" if (parenthesized_expression "(iVar5 != 0)" ( (binary_expression "iVar5 != 0" identifier != number_literal) )) (compound_statement "{\n        if ((&PTR_s_lib_s_dll_a_001ce500)[iVar8 * 2] != (undefined *)0x0) {\n          *(char **)(param_3 + 8) = pcVar4;\n          return 1;\n        }\nLAB_00058218:\n        free(pcVar4);\n        return 0;\n      }" { (if_statement "if ((&PTR_s_lib_s_dll_a_001ce500)[iVar8 * 2] != (undefined *)0x0) {\n          *(char **)(param_3 + 8) = pcVar4;\n          return 1;\n        }" if (parenthesized_expression "((&PTR_s_lib_s_dll_a_001ce500)[iVar8 * 2] != (undefined *)0x0)" ( (binary_expression "(&PTR_s_lib_s_dll_a_001ce500)[iVar8 * 2] != (undefined *)0x0" (subscript_expression "(&PTR_s_lib_s_dll_a_001ce500)[iVar8 * 2]" (parenthesized_expression "(&PTR_s_lib_s_dll_a_001ce500)" ( (pointer_expression "&PTR_s_lib_s_dll_a_001ce500" & identifier) )) [ (binary_expression "iVar8 * 2" identifier * number_literal) ]) != (cast_expression "(undefined *)0x0" ( (type_descriptor "undefined *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n          *(char **)(param_3 + 8) = pcVar4;\n          return 1;\n        }" { (expression_statement "*(char **)(param_3 + 8) = pcVar4;" (assignment_expression "*(char **)(param_3 + 8) = pcVar4" (pointer_expression "*(char **)(param_3 + 8)" * (cast_expression "(char **)(param_3 + 8)" ( (type_descriptor "char **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_3 + 8)" ( (binary_expression "param_3 + 8" identifier + number_literal) )))) = identifier) ;) (return_statement "return 1;" return number_literal ;) })) (labeled_statement "LAB_00058218:\n        free(pcVar4);" statement_identifier : (expression_statement "free(pcVar4);" (call_expression "free(pcVar4)" identifier (argument_list "(pcVar4)" ( identifier ))) ;)) (return_statement "return 0;" return number_literal ;) })) }) (else_clause "else if (DAT_001d0f90 != (char *)0x0) {\n      sprintf(pcVar4 + sVar1,pcVar7,DAT_001d0f90,__s);\n      goto LAB_00058164;\n    }" else (if_statement "if (DAT_001d0f90 != (char *)0x0) {\n      sprintf(pcVar4 + sVar1,pcVar7,DAT_001d0f90,__s);\n      goto LAB_00058164;\n    }" if (parenthesized_expression "(DAT_001d0f90 != (char *)0x0)" ( (binary_expression "DAT_001d0f90 != (char *)0x0" identifier != (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      sprintf(pcVar4 + sVar1,pcVar7,DAT_001d0f90,__s);\n      goto LAB_00058164;\n    }" { (expression_statement "sprintf(pcVar4 + sVar1,pcVar7,DAT_001d0f90,__s);" (call_expression "sprintf(pcVar4 + sVar1,pcVar7,DAT_001d0f90,__s)" identifier (argument_list "(pcVar4 + sVar1,pcVar7,DAT_001d0f90,__s)" ( (binary_expression "pcVar4 + sVar1" identifier + identifier) , identifier , identifier , identifier ))) ;) (goto_statement "goto LAB_00058164;" goto statement_identifier ;) })))) (expression_statement "iVar8 = iVar8 + 1;" (assignment_expression "iVar8 = iVar8 + 1" identifier = (binary_expression "iVar8 + 1" identifier + number_literal)) ;) (expression_statement "pcVar7 = (&PTR_s_lib_s_dll_a_001ce500)[iVar8 * 2];" (assignment_expression "pcVar7 = (&PTR_s_lib_s_dll_a_001ce500)[iVar8 * 2]" identifier = (subscript_expression "(&PTR_s_lib_s_dll_a_001ce500)[iVar8 * 2]" (parenthesized_expression "(&PTR_s_lib_s_dll_a_001ce500)" ( (pointer_expression "&PTR_s_lib_s_dll_a_001ce500" & identifier) )) [ (binary_expression "iVar8 * 2" identifier * number_literal) ])) ;) (if_statement "if (pcVar7 == (char *)0x0) goto LAB_00058218;" if (parenthesized_expression "(pcVar7 == (char *)0x0)" ( (binary_expression "pcVar7 == (char *)0x0" identifier == (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (goto_statement "goto LAB_00058218;" goto statement_identifier ;)) (expression_statement "iVar5 = *(int *)(&UNK_001ce504 + iVar8 * 8);" (assignment_expression "iVar5 = *(int *)(&UNK_001ce504 + iVar8 * 8)" identifier = (pointer_expression "*(int *)(&UNK_001ce504 + iVar8 * 8)" * (cast_expression "(int *)(&UNK_001ce504 + iVar8 * 8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(&UNK_001ce504 + iVar8 * 8)" ( (binary_expression "&UNK_001ce504 + iVar8 * 8" (pointer_expression "&UNK_001ce504" & identifier) + (binary_expression "iVar8 * 8" identifier * number_literal)) ))))) ;) }) while (parenthesized_expression "( true )" ( true )) ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* WARNING: Unknown calling convention */\n\nbfd_boolean\ngld_i386pe_open_dynamic_archive\n          (char *arch,search_dirs_type *search,lang_input_statement_type *entry)\n\n{\n  char *__s;\n  size_t sVar1;\n  size_t sVar2;\n  size_t sVar3;\n  char *pcVar4;\n  int iVar5;\n  bfd_boolean bVar6;\n  uint uVar7;\n  char *pcVar8;\n  int iVar9;\n  uint uVar10;\n  undefined **ppuVar11;\n  \n  if (((ulonglong)entry->flags & 3) != 1) {\n    return 0;\n  }\n  __s = entry->filename;\n  uVar10 = format_max_len_12754;\n  if (format_max_len_12754 == 0) {\n    ppuVar11 = &PTR_s_lib_s_a_001ce510;\n    uVar7 = 0xb;\n    pcVar8 = "%s.dll.a";\n    while( true ) {\n      if (uVar10 < uVar7) {\n        uVar10 = uVar7;\n        format_max_len_12754 = uVar7;\n      }\n      if (pcVar8 == (char *)0x0) break;\n      pcVar4 = *ppuVar11;\n      ppuVar11 = ppuVar11 + 2;\n      uVar7 = strlen(pcVar8);\n      pcVar8 = pcVar4;\n    }\n  }\n  sVar1 = strlen(search->name);\n  sVar2 = strlen(__s);\n  sVar3 = 0;\n  if (pe_dll_search_prefix != (char *)0x0) {\n    sVar3 = strlen(pe_dll_search_prefix);\n  }\n  iVar9 = 0;\n  pcVar4 = (char *)xmalloc(sVar2 + uVar10 + 2 + sVar1 + sVar3);\n  sprintf(pcVar4,"%s/",search->name);\n  sVar1 = strlen(pcVar4);\n  pcVar8 = "lib%s.dll.a";\n  iVar5 = 0;\n  do {\n    if (iVar5 == 0) {\n      sprintf(pcVar4 + sVar1,pcVar8,__s);\nLAB_00058164:\n      bVar6 = ldfile_try_open_bfd(pcVar4,entry);\n      if (bVar6 != 0) {\n        if ((&libname_fmt_12753)[iVar9 * 2] != (undefined *)0x0) {\n          entry->filename = pcVar4;\n          return 1;\n        }\nLAB_00058218:\n        free(pcVar4);\n        return 0;\n      }\n    }\n    else if (pe_dll_search_prefix != (char *)0x0) {\n      sprintf(pcVar4 + sVar1,pcVar8,pe_dll_search_prefix,__s);\n      goto LAB_00058164;\n    }\n    iVar9 = iVar9 + 1;\n    pcVar8 = (&libname_fmt_12753)[iVar9 * 2];\n    if (pcVar8 == (char *)0x0) goto LAB_00058218;\n    iVar5 = *(int *)(&UNK_001ce504 + iVar9 * 8);\n  } while( true );\n}\n\n" comment comment (function_definition "bfd_boolean\ngld_i386pe_open_dynamic_archive\n          (char *arch,search_dirs_type *search,lang_input_statement_type *entry)\n\n{\n  char *__s;\n  size_t sVar1;\n  size_t sVar2;\n  size_t sVar3;\n  char *pcVar4;\n  int iVar5;\n  bfd_boolean bVar6;\n  uint uVar7;\n  char *pcVar8;\n  int iVar9;\n  uint uVar10;\n  undefined **ppuVar11;\n  \n  if (((ulonglong)entry->flags & 3) != 1) {\n    return 0;\n  }\n  __s = entry->filename;\n  uVar10 = format_max_len_12754;\n  if (format_max_len_12754 == 0) {\n    ppuVar11 = &PTR_s_lib_s_a_001ce510;\n    uVar7 = 0xb;\n    pcVar8 = "%s.dll.a";\n    while( true ) {\n      if (uVar10 < uVar7) {\n        uVar10 = uVar7;\n        format_max_len_12754 = uVar7;\n      }\n      if (pcVar8 == (char *)0x0) break;\n      pcVar4 = *ppuVar11;\n      ppuVar11 = ppuVar11 + 2;\n      uVar7 = strlen(pcVar8);\n      pcVar8 = pcVar4;\n    }\n  }\n  sVar1 = strlen(search->name);\n  sVar2 = strlen(__s);\n  sVar3 = 0;\n  if (pe_dll_search_prefix != (char *)0x0) {\n    sVar3 = strlen(pe_dll_search_prefix);\n  }\n  iVar9 = 0;\n  pcVar4 = (char *)xmalloc(sVar2 + uVar10 + 2 + sVar1 + sVar3);\n  sprintf(pcVar4,"%s/",search->name);\n  sVar1 = strlen(pcVar4);\n  pcVar8 = "lib%s.dll.a";\n  iVar5 = 0;\n  do {\n    if (iVar5 == 0) {\n      sprintf(pcVar4 + sVar1,pcVar8,__s);\nLAB_00058164:\n      bVar6 = ldfile_try_open_bfd(pcVar4,entry);\n      if (bVar6 != 0) {\n        if ((&libname_fmt_12753)[iVar9 * 2] != (undefined *)0x0) {\n          entry->filename = pcVar4;\n          return 1;\n        }\nLAB_00058218:\n        free(pcVar4);\n        return 0;\n      }\n    }\n    else if (pe_dll_search_prefix != (char *)0x0) {\n      sprintf(pcVar4 + sVar1,pcVar8,pe_dll_search_prefix,__s);\n      goto LAB_00058164;\n    }\n    iVar9 = iVar9 + 1;\n    pcVar8 = (&libname_fmt_12753)[iVar9 * 2];\n    if (pcVar8 == (char *)0x0) goto LAB_00058218;\n    iVar5 = *(int *)(&UNK_001ce504 + iVar9 * 8);\n  } while( true );\n}" type_identifier (function_declarator "gld_i386pe_open_dynamic_archive\n          (char *arch,search_dirs_type *search,lang_input_statement_type *entry)" identifier (parameter_list "(char *arch,search_dirs_type *search,lang_input_statement_type *entry)" ( (parameter_declaration "char *arch" primitive_type (pointer_declarator "*arch" * identifier)) , (parameter_declaration "search_dirs_type *search" type_identifier (pointer_declarator "*search" * identifier)) , (parameter_declaration "lang_input_statement_type *entry" type_identifier (pointer_declarator "*entry" * identifier)) ))) (compound_statement "{\n  char *__s;\n  size_t sVar1;\n  size_t sVar2;\n  size_t sVar3;\n  char *pcVar4;\n  int iVar5;\n  bfd_boolean bVar6;\n  uint uVar7;\n  char *pcVar8;\n  int iVar9;\n  uint uVar10;\n  undefined **ppuVar11;\n  \n  if (((ulonglong)entry->flags & 3) != 1) {\n    return 0;\n  }\n  __s = entry->filename;\n  uVar10 = format_max_len_12754;\n  if (format_max_len_12754 == 0) {\n    ppuVar11 = &PTR_s_lib_s_a_001ce510;\n    uVar7 = 0xb;\n    pcVar8 = "%s.dll.a";\n    while( true ) {\n      if (uVar10 < uVar7) {\n        uVar10 = uVar7;\n        format_max_len_12754 = uVar7;\n      }\n      if (pcVar8 == (char *)0x0) break;\n      pcVar4 = *ppuVar11;\n      ppuVar11 = ppuVar11 + 2;\n      uVar7 = strlen(pcVar8);\n      pcVar8 = pcVar4;\n    }\n  }\n  sVar1 = strlen(search->name);\n  sVar2 = strlen(__s);\n  sVar3 = 0;\n  if (pe_dll_search_prefix != (char *)0x0) {\n    sVar3 = strlen(pe_dll_search_prefix);\n  }\n  iVar9 = 0;\n  pcVar4 = (char *)xmalloc(sVar2 + uVar10 + 2 + sVar1 + sVar3);\n  sprintf(pcVar4,"%s/",search->name);\n  sVar1 = strlen(pcVar4);\n  pcVar8 = "lib%s.dll.a";\n  iVar5 = 0;\n  do {\n    if (iVar5 == 0) {\n      sprintf(pcVar4 + sVar1,pcVar8,__s);\nLAB_00058164:\n      bVar6 = ldfile_try_open_bfd(pcVar4,entry);\n      if (bVar6 != 0) {\n        if ((&libname_fmt_12753)[iVar9 * 2] != (undefined *)0x0) {\n          entry->filename = pcVar4;\n          return 1;\n        }\nLAB_00058218:\n        free(pcVar4);\n        return 0;\n      }\n    }\n    else if (pe_dll_search_prefix != (char *)0x0) {\n      sprintf(pcVar4 + sVar1,pcVar8,pe_dll_search_prefix,__s);\n      goto LAB_00058164;\n    }\n    iVar9 = iVar9 + 1;\n    pcVar8 = (&libname_fmt_12753)[iVar9 * 2];\n    if (pcVar8 == (char *)0x0) goto LAB_00058218;\n    iVar5 = *(int *)(&UNK_001ce504 + iVar9 * 8);\n  } while( true );\n}" { (declaration "char *__s;" primitive_type (pointer_declarator "*__s" * identifier) ;) (declaration "size_t sVar1;" primitive_type identifier ;) (declaration "size_t sVar2;" primitive_type identifier ;) (declaration "size_t sVar3;" primitive_type identifier ;) (declaration "char *pcVar4;" primitive_type (pointer_declarator "*pcVar4" * identifier) ;) (declaration "int iVar5;" primitive_type identifier ;) (declaration "bfd_boolean bVar6;" type_identifier identifier ;) (declaration "uint uVar7;" type_identifier identifier ;) (declaration "char *pcVar8;" primitive_type (pointer_declarator "*pcVar8" * identifier) ;) (declaration "int iVar9;" primitive_type identifier ;) (declaration "uint uVar10;" type_identifier identifier ;) (declaration "undefined **ppuVar11;" type_identifier (pointer_declarator "**ppuVar11" * (pointer_declarator "*ppuVar11" * identifier)) ;) (if_statement "if (((ulonglong)entry->flags & 3) != 1) {\n    return 0;\n  }" if (parenthesized_expression "(((ulonglong)entry->flags & 3) != 1)" ( (binary_expression "((ulonglong)entry->flags & 3) != 1" (parenthesized_expression "((ulonglong)entry->flags & 3)" ( (binary_expression "(ulonglong)entry->flags & 3" (cast_expression "(ulonglong)entry->flags" ( (type_descriptor "ulonglong" type_identifier) ) (field_expression "entry->flags" identifier -> field_identifier)) & number_literal) )) != number_literal) )) (compound_statement "{\n    return 0;\n  }" { (return_statement "return 0;" return number_literal ;) })) (expression_statement "__s = entry->filename;" (assignment_expression "__s = entry->filename" identifier = (field_expression "entry->filename" identifier -> field_identifier)) ;) (expression_statement "uVar10 = format_max_len_12754;" (assignment_expression "uVar10 = format_max_len_12754" identifier = identifier) ;) (if_statement "if (format_max_len_12754 == 0) {\n    ppuVar11 = &PTR_s_lib_s_a_001ce510;\n    uVar7 = 0xb;\n    pcVar8 = "%s.dll.a";\n    while( true ) {\n      if (uVar10 < uVar7) {\n        uVar10 = uVar7;\n        format_max_len_12754 = uVar7;\n      }\n      if (pcVar8 == (char *)0x0) break;\n      pcVar4 = *ppuVar11;\n      ppuVar11 = ppuVar11 + 2;\n      uVar7 = strlen(pcVar8);\n      pcVar8 = pcVar4;\n    }\n  }" if (parenthesized_expression "(format_max_len_12754 == 0)" ( (binary_expression "format_max_len_12754 == 0" identifier == number_literal) )) (compound_statement "{\n    ppuVar11 = &PTR_s_lib_s_a_001ce510;\n    uVar7 = 0xb;\n    pcVar8 = "%s.dll.a";\n    while( true ) {\n      if (uVar10 < uVar7) {\n        uVar10 = uVar7;\n        format_max_len_12754 = uVar7;\n      }\n      if (pcVar8 == (char *)0x0) break;\n      pcVar4 = *ppuVar11;\n      ppuVar11 = ppuVar11 + 2;\n      uVar7 = strlen(pcVar8);\n      pcVar8 = pcVar4;\n    }\n  }" { (expression_statement "ppuVar11 = &PTR_s_lib_s_a_001ce510;" (assignment_expression "ppuVar11 = &PTR_s_lib_s_a_001ce510" identifier = (pointer_expression "&PTR_s_lib_s_a_001ce510" & identifier)) ;) (expression_statement "uVar7 = 0xb;" (assignment_expression "uVar7 = 0xb" identifier = number_literal) ;) (expression_statement "pcVar8 = "%s.dll.a";" (assignment_expression "pcVar8 = "%s.dll.a"" identifier = (string_literal ""%s.dll.a"" " string_content ")) ;) (while_statement "while( true ) {\n      if (uVar10 < uVar7) {\n        uVar10 = uVar7;\n        format_max_len_12754 = uVar7;\n      }\n      if (pcVar8 == (char *)0x0) break;\n      pcVar4 = *ppuVar11;\n      ppuVar11 = ppuVar11 + 2;\n      uVar7 = strlen(pcVar8);\n      pcVar8 = pcVar4;\n    }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n      if (uVar10 < uVar7) {\n        uVar10 = uVar7;\n        format_max_len_12754 = uVar7;\n      }\n      if (pcVar8 == (char *)0x0) break;\n      pcVar4 = *ppuVar11;\n      ppuVar11 = ppuVar11 + 2;\n      uVar7 = strlen(pcVar8);\n      pcVar8 = pcVar4;\n    }" { (if_statement "if (uVar10 < uVar7) {\n        uVar10 = uVar7;\n        format_max_len_12754 = uVar7;\n      }" if (parenthesized_expression "(uVar10 < uVar7)" ( (binary_expression "uVar10 < uVar7" identifier < identifier) )) (compound_statement "{\n        uVar10 = uVar7;\n        format_max_len_12754 = uVar7;\n      }" { (expression_statement "uVar10 = uVar7;" (assignment_expression "uVar10 = uVar7" identifier = identifier) ;) (expression_statement "format_max_len_12754 = uVar7;" (assignment_expression "format_max_len_12754 = uVar7" identifier = identifier) ;) })) (if_statement "if (pcVar8 == (char *)0x0) break;" if (parenthesized_expression "(pcVar8 == (char *)0x0)" ( (binary_expression "pcVar8 == (char *)0x0" identifier == (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (break_statement "break;" break ;)) (expression_statement "pcVar4 = *ppuVar11;" (assignment_expression "pcVar4 = *ppuVar11" identifier = (pointer_expression "*ppuVar11" * identifier)) ;) (expression_statement "ppuVar11 = ppuVar11 + 2;" (assignment_expression "ppuVar11 = ppuVar11 + 2" identifier = (binary_expression "ppuVar11 + 2" identifier + number_literal)) ;) (expression_statement "uVar7 = strlen(pcVar8);" (assignment_expression "uVar7 = strlen(pcVar8)" identifier = (call_expression "strlen(pcVar8)" identifier (argument_list "(pcVar8)" ( identifier )))) ;) (expression_statement "pcVar8 = pcVar4;" (assignment_expression "pcVar8 = pcVar4" identifier = identifier) ;) })) })) (expression_statement "sVar1 = strlen(search->name);" (assignment_expression "sVar1 = strlen(search->name)" identifier = (call_expression "strlen(search->name)" identifier (argument_list "(search->name)" ( (field_expression "search->name" identifier -> field_identifier) )))) ;) (expression_statement "sVar2 = strlen(__s);" (assignment_expression "sVar2 = strlen(__s)" identifier = (call_expression "strlen(__s)" identifier (argument_list "(__s)" ( identifier )))) ;) (expression_statement "sVar3 = 0;" (assignment_expression "sVar3 = 0" identifier = number_literal) ;) (if_statement "if (pe_dll_search_prefix != (char *)0x0) {\n    sVar3 = strlen(pe_dll_search_prefix);\n  }" if (parenthesized_expression "(pe_dll_search_prefix != (char *)0x0)" ( (binary_expression "pe_dll_search_prefix != (char *)0x0" identifier != (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    sVar3 = strlen(pe_dll_search_prefix);\n  }" { (expression_statement "sVar3 = strlen(pe_dll_search_prefix);" (assignment_expression "sVar3 = strlen(pe_dll_search_prefix)" identifier = (call_expression "strlen(pe_dll_search_prefix)" identifier (argument_list "(pe_dll_search_prefix)" ( identifier )))) ;) })) (expression_statement "iVar9 = 0;" (assignment_expression "iVar9 = 0" identifier = number_literal) ;) (expression_statement "pcVar4 = (char *)xmalloc(sVar2 + uVar10 + 2 + sVar1 + sVar3);" (assignment_expression "pcVar4 = (char *)xmalloc(sVar2 + uVar10 + 2 + sVar1 + sVar3)" identifier = (cast_expression "(char *)xmalloc(sVar2 + uVar10 + 2 + sVar1 + sVar3)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "xmalloc(sVar2 + uVar10 + 2 + sVar1 + sVar3)" identifier (argument_list "(sVar2 + uVar10 + 2 + sVar1 + sVar3)" ( (binary_expression "sVar2 + uVar10 + 2 + sVar1 + sVar3" (binary_expression "sVar2 + uVar10 + 2 + sVar1" (binary_expression "sVar2 + uVar10 + 2" (binary_expression "sVar2 + uVar10" identifier + identifier) + number_literal) + identifier) + identifier) ))))) ;) (expression_statement "sprintf(pcVar4,"%s/",search->name);" (call_expression "sprintf(pcVar4,"%s/",search->name)" identifier (argument_list "(pcVar4,"%s/",search->name)" ( identifier , (string_literal ""%s/"" " string_content ") , (field_expression "search->name" identifier -> field_identifier) ))) ;) (expression_statement "sVar1 = strlen(pcVar4);" (assignment_expression "sVar1 = strlen(pcVar4)" identifier = (call_expression "strlen(pcVar4)" identifier (argument_list "(pcVar4)" ( identifier )))) ;) (expression_statement "pcVar8 = "lib%s.dll.a";" (assignment_expression "pcVar8 = "lib%s.dll.a"" identifier = (string_literal ""lib%s.dll.a"" " string_content ")) ;) (expression_statement "iVar5 = 0;" (assignment_expression "iVar5 = 0" identifier = number_literal) ;) (do_statement "do {\n    if (iVar5 == 0) {\n      sprintf(pcVar4 + sVar1,pcVar8,__s);\nLAB_00058164:\n      bVar6 = ldfile_try_open_bfd(pcVar4,entry);\n      if (bVar6 != 0) {\n        if ((&libname_fmt_12753)[iVar9 * 2] != (undefined *)0x0) {\n          entry->filename = pcVar4;\n          return 1;\n        }\nLAB_00058218:\n        free(pcVar4);\n        return 0;\n      }\n    }\n    else if (pe_dll_search_prefix != (char *)0x0) {\n      sprintf(pcVar4 + sVar1,pcVar8,pe_dll_search_prefix,__s);\n      goto LAB_00058164;\n    }\n    iVar9 = iVar9 + 1;\n    pcVar8 = (&libname_fmt_12753)[iVar9 * 2];\n    if (pcVar8 == (char *)0x0) goto LAB_00058218;\n    iVar5 = *(int *)(&UNK_001ce504 + iVar9 * 8);\n  } while( true );" do (compound_statement "{\n    if (iVar5 == 0) {\n      sprintf(pcVar4 + sVar1,pcVar8,__s);\nLAB_00058164:\n      bVar6 = ldfile_try_open_bfd(pcVar4,entry);\n      if (bVar6 != 0) {\n        if ((&libname_fmt_12753)[iVar9 * 2] != (undefined *)0x0) {\n          entry->filename = pcVar4;\n          return 1;\n        }\nLAB_00058218:\n        free(pcVar4);\n        return 0;\n      }\n    }\n    else if (pe_dll_search_prefix != (char *)0x0) {\n      sprintf(pcVar4 + sVar1,pcVar8,pe_dll_search_prefix,__s);\n      goto LAB_00058164;\n    }\n    iVar9 = iVar9 + 1;\n    pcVar8 = (&libname_fmt_12753)[iVar9 * 2];\n    if (pcVar8 == (char *)0x0) goto LAB_00058218;\n    iVar5 = *(int *)(&UNK_001ce504 + iVar9 * 8);\n  }" { (if_statement "if (iVar5 == 0) {\n      sprintf(pcVar4 + sVar1,pcVar8,__s);\nLAB_00058164:\n      bVar6 = ldfile_try_open_bfd(pcVar4,entry);\n      if (bVar6 != 0) {\n        if ((&libname_fmt_12753)[iVar9 * 2] != (undefined *)0x0) {\n          entry->filename = pcVar4;\n          return 1;\n        }\nLAB_00058218:\n        free(pcVar4);\n        return 0;\n      }\n    }\n    else if (pe_dll_search_prefix != (char *)0x0) {\n      sprintf(pcVar4 + sVar1,pcVar8,pe_dll_search_prefix,__s);\n      goto LAB_00058164;\n    }" if (parenthesized_expression "(iVar5 == 0)" ( (binary_expression "iVar5 == 0" identifier == number_literal) )) (compound_statement "{\n      sprintf(pcVar4 + sVar1,pcVar8,__s);\nLAB_00058164:\n      bVar6 = ldfile_try_open_bfd(pcVar4,entry);\n      if (bVar6 != 0) {\n        if ((&libname_fmt_12753)[iVar9 * 2] != (undefined *)0x0) {\n          entry->filename = pcVar4;\n          return 1;\n        }\nLAB_00058218:\n        free(pcVar4);\n        return 0;\n      }\n    }" { (expression_statement "sprintf(pcVar4 + sVar1,pcVar8,__s);" (call_expression "sprintf(pcVar4 + sVar1,pcVar8,__s)" identifier (argument_list "(pcVar4 + sVar1,pcVar8,__s)" ( (binary_expression "pcVar4 + sVar1" identifier + identifier) , identifier , identifier ))) ;) (labeled_statement "LAB_00058164:\n      bVar6 = ldfile_try_open_bfd(pcVar4,entry);" statement_identifier : (expression_statement "bVar6 = ldfile_try_open_bfd(pcVar4,entry);" (assignment_expression "bVar6 = ldfile_try_open_bfd(pcVar4,entry)" identifier = (call_expression "ldfile_try_open_bfd(pcVar4,entry)" identifier (argument_list "(pcVar4,entry)" ( identifier , identifier )))) ;)) (if_statement "if (bVar6 != 0) {\n        if ((&libname_fmt_12753)[iVar9 * 2] != (undefined *)0x0) {\n          entry->filename = pcVar4;\n          return 1;\n        }\nLAB_00058218:\n        free(pcVar4);\n        return 0;\n      }" if (parenthesized_expression "(bVar6 != 0)" ( (binary_expression "bVar6 != 0" identifier != number_literal) )) (compound_statement "{\n        if ((&libname_fmt_12753)[iVar9 * 2] != (undefined *)0x0) {\n          entry->filename = pcVar4;\n          return 1;\n        }\nLAB_00058218:\n        free(pcVar4);\n        return 0;\n      }" { (if_statement "if ((&libname_fmt_12753)[iVar9 * 2] != (undefined *)0x0) {\n          entry->filename = pcVar4;\n          return 1;\n        }" if (parenthesized_expression "((&libname_fmt_12753)[iVar9 * 2] != (undefined *)0x0)" ( (binary_expression "(&libname_fmt_12753)[iVar9 * 2] != (undefined *)0x0" (subscript_expression "(&libname_fmt_12753)[iVar9 * 2]" (parenthesized_expression "(&libname_fmt_12753)" ( (pointer_expression "&libname_fmt_12753" & identifier) )) [ (binary_expression "iVar9 * 2" identifier * number_literal) ]) != (cast_expression "(undefined *)0x0" ( (type_descriptor "undefined *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n          entry->filename = pcVar4;\n          return 1;\n        }" { (expression_statement "entry->filename = pcVar4;" (assignment_expression "entry->filename = pcVar4" (field_expression "entry->filename" identifier -> field_identifier) = identifier) ;) (return_statement "return 1;" return number_literal ;) })) (labeled_statement "LAB_00058218:\n        free(pcVar4);" statement_identifier : (expression_statement "free(pcVar4);" (call_expression "free(pcVar4)" identifier (argument_list "(pcVar4)" ( identifier ))) ;)) (return_statement "return 0;" return number_literal ;) })) }) (else_clause "else if (pe_dll_search_prefix != (char *)0x0) {\n      sprintf(pcVar4 + sVar1,pcVar8,pe_dll_search_prefix,__s);\n      goto LAB_00058164;\n    }" else (if_statement "if (pe_dll_search_prefix != (char *)0x0) {\n      sprintf(pcVar4 + sVar1,pcVar8,pe_dll_search_prefix,__s);\n      goto LAB_00058164;\n    }" if (parenthesized_expression "(pe_dll_search_prefix != (char *)0x0)" ( (binary_expression "pe_dll_search_prefix != (char *)0x0" identifier != (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      sprintf(pcVar4 + sVar1,pcVar8,pe_dll_search_prefix,__s);\n      goto LAB_00058164;\n    }" { (expression_statement "sprintf(pcVar4 + sVar1,pcVar8,pe_dll_search_prefix,__s);" (call_expression "sprintf(pcVar4 + sVar1,pcVar8,pe_dll_search_prefix,__s)" identifier (argument_list "(pcVar4 + sVar1,pcVar8,pe_dll_search_prefix,__s)" ( (binary_expression "pcVar4 + sVar1" identifier + identifier) , identifier , identifier , identifier ))) ;) (goto_statement "goto LAB_00058164;" goto statement_identifier ;) })))) (expression_statement "iVar9 = iVar9 + 1;" (assignment_expression "iVar9 = iVar9 + 1" identifier = (binary_expression "iVar9 + 1" identifier + number_literal)) ;) (expression_statement "pcVar8 = (&libname_fmt_12753)[iVar9 * 2];" (assignment_expression "pcVar8 = (&libname_fmt_12753)[iVar9 * 2]" identifier = (subscript_expression "(&libname_fmt_12753)[iVar9 * 2]" (parenthesized_expression "(&libname_fmt_12753)" ( (pointer_expression "&libname_fmt_12753" & identifier) )) [ (binary_expression "iVar9 * 2" identifier * number_literal) ])) ;) (if_statement "if (pcVar8 == (char *)0x0) goto LAB_00058218;" if (parenthesized_expression "(pcVar8 == (char *)0x0)" ( (binary_expression "pcVar8 == (char *)0x0" identifier == (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (goto_statement "goto LAB_00058218;" goto statement_identifier ;)) (expression_statement "iVar5 = *(int *)(&UNK_001ce504 + iVar9 * 8);" (assignment_expression "iVar5 = *(int *)(&UNK_001ce504 + iVar9 * 8)" identifier = (pointer_expression "*(int *)(&UNK_001ce504 + iVar9 * 8)" * (cast_expression "(int *)(&UNK_001ce504 + iVar9 * 8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(&UNK_001ce504 + iVar9 * 8)" ( (binary_expression "&UNK_001ce504 + iVar9 * 8" (pointer_expression "&UNK_001ce504" & identifier) + (binary_expression "iVar9 * 8" identifier * number_literal)) ))))) ;) }) while (parenthesized_expression "( true )" ( true )) ;) })))
(translation_unit "undefined4 FUN_00058080(undefined4 param_1,int param_2,int param_3)\n\n{\n  char *__s;\n  size_t sVar1;\n  size_t sVar2;\n  size_t sVar3;\n  char *pcVar4;\n  int iVar5;\n  uint uVar6;\n  char *pcVar7;\n  int iVar8;\n  uint uVar9;\n  undefined **ppuVar10;\n  \n  if ((*(byte *)(param_3 + 0x24) & 3) != 1) {\n    return 0;\n  }\n  __s = *(char **)(param_3 + 8);\n  uVar9 = DAT_001d0f84;\n  if (DAT_001d0f84 == 0) {\n    ppuVar10 = &PTR_s_lib_s_a_001ce510;\n    uVar6 = 0xb;\n    pcVar7 = "%s.dll.a";\n    while( true ) {\n      if (uVar9 < uVar6) {\n        uVar9 = uVar6;\n        DAT_001d0f84 = uVar6;\n      }\n      if (pcVar7 == (char *)0x0) break;\n      pcVar4 = *ppuVar10;\n      ppuVar10 = ppuVar10 + 2;\n      uVar6 = strlen(pcVar7);\n      pcVar7 = pcVar4;\n    }\n  }\n  sVar1 = strlen(*(char **)(param_2 + 4));\n  sVar2 = strlen(__s);\n  sVar3 = 0;\n  if (DAT_001d0f90 != (char *)0x0) {\n    sVar3 = strlen(DAT_001d0f90);\n  }\n  iVar8 = 0;\n  pcVar4 = (char *)xmalloc(sVar2 + uVar9 + 2 + sVar1 + sVar3);\n  sprintf(pcVar4,"%s/",*(undefined4 *)(param_2 + 4));\n  sVar1 = strlen(pcVar4);\n  pcVar7 = "lib%s.dll.a";\n  iVar5 = 0;\n  do {\n    if (iVar5 == 0) {\n      sprintf(pcVar4 + sVar1,pcVar7,__s);\nLAB_00058164:\n      iVar5 = FUN_00035320(pcVar4,param_3);\n      if (iVar5 != 0) {\n        if ((&PTR_s_lib_s_dll_a_001ce500)[iVar8 * 2] != (undefined *)0x0) {\n          *(char **)(param_3 + 8) = pcVar4;\n          return 1;\n        }\nLAB_00058218:\n        free(pcVar4);\n        return 0;\n      }\n    }\n    else if (DAT_001d0f90 != (char *)0x0) {\n      sprintf(pcVar4 + sVar1,pcVar7,DAT_001d0f90,__s);\n      goto LAB_00058164;\n    }\n    iVar8 = iVar8 + 1;\n    pcVar7 = (&PTR_s_lib_s_dll_a_001ce500)[iVar8 * 2];\n    if (pcVar7 == (char *)0x0) goto LAB_00058218;\n    iVar5 = *(int *)(&UNK_001ce504 + iVar8 * 8);\n  } while( true );\n}\n\n" (function_definition "undefined4 FUN_00058080(undefined4 param_1,int param_2,int param_3)\n\n{\n  char *__s;\n  size_t sVar1;\n  size_t sVar2;\n  size_t sVar3;\n  char *pcVar4;\n  int iVar5;\n  uint uVar6;\n  char *pcVar7;\n  int iVar8;\n  uint uVar9;\n  undefined **ppuVar10;\n  \n  if ((*(byte *)(param_3 + 0x24) & 3) != 1) {\n    return 0;\n  }\n  __s = *(char **)(param_3 + 8);\n  uVar9 = DAT_001d0f84;\n  if (DAT_001d0f84 == 0) {\n    ppuVar10 = &PTR_s_lib_s_a_001ce510;\n    uVar6 = 0xb;\n    pcVar7 = "%s.dll.a";\n    while( true ) {\n      if (uVar9 < uVar6) {\n        uVar9 = uVar6;\n        DAT_001d0f84 = uVar6;\n      }\n      if (pcVar7 == (char *)0x0) break;\n      pcVar4 = *ppuVar10;\n      ppuVar10 = ppuVar10 + 2;\n      uVar6 = strlen(pcVar7);\n      pcVar7 = pcVar4;\n    }\n  }\n  sVar1 = strlen(*(char **)(param_2 + 4));\n  sVar2 = strlen(__s);\n  sVar3 = 0;\n  if (DAT_001d0f90 != (char *)0x0) {\n    sVar3 = strlen(DAT_001d0f90);\n  }\n  iVar8 = 0;\n  pcVar4 = (char *)xmalloc(sVar2 + uVar9 + 2 + sVar1 + sVar3);\n  sprintf(pcVar4,"%s/",*(undefined4 *)(param_2 + 4));\n  sVar1 = strlen(pcVar4);\n  pcVar7 = "lib%s.dll.a";\n  iVar5 = 0;\n  do {\n    if (iVar5 == 0) {\n      sprintf(pcVar4 + sVar1,pcVar7,__s);\nLAB_00058164:\n      iVar5 = FUN_00035320(pcVar4,param_3);\n      if (iVar5 != 0) {\n        if ((&PTR_s_lib_s_dll_a_001ce500)[iVar8 * 2] != (undefined *)0x0) {\n          *(char **)(param_3 + 8) = pcVar4;\n          return 1;\n        }\nLAB_00058218:\n        free(pcVar4);\n        return 0;\n      }\n    }\n    else if (DAT_001d0f90 != (char *)0x0) {\n      sprintf(pcVar4 + sVar1,pcVar7,DAT_001d0f90,__s);\n      goto LAB_00058164;\n    }\n    iVar8 = iVar8 + 1;\n    pcVar7 = (&PTR_s_lib_s_dll_a_001ce500)[iVar8 * 2];\n    if (pcVar7 == (char *)0x0) goto LAB_00058218;\n    iVar5 = *(int *)(&UNK_001ce504 + iVar8 * 8);\n  } while( true );\n}" type_identifier (function_declarator "FUN_00058080(undefined4 param_1,int param_2,int param_3)" identifier (parameter_list "(undefined4 param_1,int param_2,int param_3)" ( (parameter_declaration "undefined4 param_1" type_identifier identifier) , (parameter_declaration "int param_2" primitive_type identifier) , (parameter_declaration "int param_3" primitive_type identifier) ))) (compound_statement "{\n  char *__s;\n  size_t sVar1;\n  size_t sVar2;\n  size_t sVar3;\n  char *pcVar4;\n  int iVar5;\n  uint uVar6;\n  char *pcVar7;\n  int iVar8;\n  uint uVar9;\n  undefined **ppuVar10;\n  \n  if ((*(byte *)(param_3 + 0x24) & 3) != 1) {\n    return 0;\n  }\n  __s = *(char **)(param_3 + 8);\n  uVar9 = DAT_001d0f84;\n  if (DAT_001d0f84 == 0) {\n    ppuVar10 = &PTR_s_lib_s_a_001ce510;\n    uVar6 = 0xb;\n    pcVar7 = "%s.dll.a";\n    while( true ) {\n      if (uVar9 < uVar6) {\n        uVar9 = uVar6;\n        DAT_001d0f84 = uVar6;\n      }\n      if (pcVar7 == (char *)0x0) break;\n      pcVar4 = *ppuVar10;\n      ppuVar10 = ppuVar10 + 2;\n      uVar6 = strlen(pcVar7);\n      pcVar7 = pcVar4;\n    }\n  }\n  sVar1 = strlen(*(char **)(param_2 + 4));\n  sVar2 = strlen(__s);\n  sVar3 = 0;\n  if (DAT_001d0f90 != (char *)0x0) {\n    sVar3 = strlen(DAT_001d0f90);\n  }\n  iVar8 = 0;\n  pcVar4 = (char *)xmalloc(sVar2 + uVar9 + 2 + sVar1 + sVar3);\n  sprintf(pcVar4,"%s/",*(undefined4 *)(param_2 + 4));\n  sVar1 = strlen(pcVar4);\n  pcVar7 = "lib%s.dll.a";\n  iVar5 = 0;\n  do {\n    if (iVar5 == 0) {\n      sprintf(pcVar4 + sVar1,pcVar7,__s);\nLAB_00058164:\n      iVar5 = FUN_00035320(pcVar4,param_3);\n      if (iVar5 != 0) {\n        if ((&PTR_s_lib_s_dll_a_001ce500)[iVar8 * 2] != (undefined *)0x0) {\n          *(char **)(param_3 + 8) = pcVar4;\n          return 1;\n        }\nLAB_00058218:\n        free(pcVar4);\n        return 0;\n      }\n    }\n    else if (DAT_001d0f90 != (char *)0x0) {\n      sprintf(pcVar4 + sVar1,pcVar7,DAT_001d0f90,__s);\n      goto LAB_00058164;\n    }\n    iVar8 = iVar8 + 1;\n    pcVar7 = (&PTR_s_lib_s_dll_a_001ce500)[iVar8 * 2];\n    if (pcVar7 == (char *)0x0) goto LAB_00058218;\n    iVar5 = *(int *)(&UNK_001ce504 + iVar8 * 8);\n  } while( true );\n}" { (declaration "char *__s;" primitive_type (pointer_declarator "*__s" * identifier) ;) (declaration "size_t sVar1;" primitive_type identifier ;) (declaration "size_t sVar2;" primitive_type identifier ;) (declaration "size_t sVar3;" primitive_type identifier ;) (declaration "char *pcVar4;" primitive_type (pointer_declarator "*pcVar4" * identifier) ;) (declaration "int iVar5;" primitive_type identifier ;) (declaration "uint uVar6;" type_identifier identifier ;) (declaration "char *pcVar7;" primitive_type (pointer_declarator "*pcVar7" * identifier) ;) (declaration "int iVar8;" primitive_type identifier ;) (declaration "uint uVar9;" type_identifier identifier ;) (declaration "undefined **ppuVar10;" type_identifier (pointer_declarator "**ppuVar10" * (pointer_declarator "*ppuVar10" * identifier)) ;) (if_statement "if ((*(byte *)(param_3 + 0x24) & 3) != 1) {\n    return 0;\n  }" if (parenthesized_expression "((*(byte *)(param_3 + 0x24) & 3) != 1)" ( (binary_expression "(*(byte *)(param_3 + 0x24) & 3) != 1" (parenthesized_expression "(*(byte *)(param_3 + 0x24) & 3)" ( (binary_expression "*(byte *)(param_3 + 0x24) & 3" (pointer_expression "*(byte *)(param_3 + 0x24)" * (cast_expression "(byte *)(param_3 + 0x24)" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_3 + 0x24)" ( (binary_expression "param_3 + 0x24" identifier + number_literal) )))) & number_literal) )) != number_literal) )) (compound_statement "{\n    return 0;\n  }" { (return_statement "return 0;" return number_literal ;) })) (expression_statement "__s = *(char **)(param_3 + 8);" (assignment_expression "__s = *(char **)(param_3 + 8)" identifier = (pointer_expression "*(char **)(param_3 + 8)" * (cast_expression "(char **)(param_3 + 8)" ( (type_descriptor "char **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_3 + 8)" ( (binary_expression "param_3 + 8" identifier + number_literal) ))))) ;) (expression_statement "uVar9 = DAT_001d0f84;" (assignment_expression "uVar9 = DAT_001d0f84" identifier = identifier) ;) (if_statement "if (DAT_001d0f84 == 0) {\n    ppuVar10 = &PTR_s_lib_s_a_001ce510;\n    uVar6 = 0xb;\n    pcVar7 = "%s.dll.a";\n    while( true ) {\n      if (uVar9 < uVar6) {\n        uVar9 = uVar6;\n        DAT_001d0f84 = uVar6;\n      }\n      if (pcVar7 == (char *)0x0) break;\n      pcVar4 = *ppuVar10;\n      ppuVar10 = ppuVar10 + 2;\n      uVar6 = strlen(pcVar7);\n      pcVar7 = pcVar4;\n    }\n  }" if (parenthesized_expression "(DAT_001d0f84 == 0)" ( (binary_expression "DAT_001d0f84 == 0" identifier == number_literal) )) (compound_statement "{\n    ppuVar10 = &PTR_s_lib_s_a_001ce510;\n    uVar6 = 0xb;\n    pcVar7 = "%s.dll.a";\n    while( true ) {\n      if (uVar9 < uVar6) {\n        uVar9 = uVar6;\n        DAT_001d0f84 = uVar6;\n      }\n      if (pcVar7 == (char *)0x0) break;\n      pcVar4 = *ppuVar10;\n      ppuVar10 = ppuVar10 + 2;\n      uVar6 = strlen(pcVar7);\n      pcVar7 = pcVar4;\n    }\n  }" { (expression_statement "ppuVar10 = &PTR_s_lib_s_a_001ce510;" (assignment_expression "ppuVar10 = &PTR_s_lib_s_a_001ce510" identifier = (pointer_expression "&PTR_s_lib_s_a_001ce510" & identifier)) ;) (expression_statement "uVar6 = 0xb;" (assignment_expression "uVar6 = 0xb" identifier = number_literal) ;) (expression_statement "pcVar7 = "%s.dll.a";" (assignment_expression "pcVar7 = "%s.dll.a"" identifier = (string_literal ""%s.dll.a"" " string_content ")) ;) (while_statement "while( true ) {\n      if (uVar9 < uVar6) {\n        uVar9 = uVar6;\n        DAT_001d0f84 = uVar6;\n      }\n      if (pcVar7 == (char *)0x0) break;\n      pcVar4 = *ppuVar10;\n      ppuVar10 = ppuVar10 + 2;\n      uVar6 = strlen(pcVar7);\n      pcVar7 = pcVar4;\n    }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n      if (uVar9 < uVar6) {\n        uVar9 = uVar6;\n        DAT_001d0f84 = uVar6;\n      }\n      if (pcVar7 == (char *)0x0) break;\n      pcVar4 = *ppuVar10;\n      ppuVar10 = ppuVar10 + 2;\n      uVar6 = strlen(pcVar7);\n      pcVar7 = pcVar4;\n    }" { (if_statement "if (uVar9 < uVar6) {\n        uVar9 = uVar6;\n        DAT_001d0f84 = uVar6;\n      }" if (parenthesized_expression "(uVar9 < uVar6)" ( (binary_expression "uVar9 < uVar6" identifier < identifier) )) (compound_statement "{\n        uVar9 = uVar6;\n        DAT_001d0f84 = uVar6;\n      }" { (expression_statement "uVar9 = uVar6;" (assignment_expression "uVar9 = uVar6" identifier = identifier) ;) (expression_statement "DAT_001d0f84 = uVar6;" (assignment_expression "DAT_001d0f84 = uVar6" identifier = identifier) ;) })) (if_statement "if (pcVar7 == (char *)0x0) break;" if (parenthesized_expression "(pcVar7 == (char *)0x0)" ( (binary_expression "pcVar7 == (char *)0x0" identifier == (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (break_statement "break;" break ;)) (expression_statement "pcVar4 = *ppuVar10;" (assignment_expression "pcVar4 = *ppuVar10" identifier = (pointer_expression "*ppuVar10" * identifier)) ;) (expression_statement "ppuVar10 = ppuVar10 + 2;" (assignment_expression "ppuVar10 = ppuVar10 + 2" identifier = (binary_expression "ppuVar10 + 2" identifier + number_literal)) ;) (expression_statement "uVar6 = strlen(pcVar7);" (assignment_expression "uVar6 = strlen(pcVar7)" identifier = (call_expression "strlen(pcVar7)" identifier (argument_list "(pcVar7)" ( identifier )))) ;) (expression_statement "pcVar7 = pcVar4;" (assignment_expression "pcVar7 = pcVar4" identifier = identifier) ;) })) })) (expression_statement "sVar1 = strlen(*(char **)(param_2 + 4));" (assignment_expression "sVar1 = strlen(*(char **)(param_2 + 4))" identifier = (call_expression "strlen(*(char **)(param_2 + 4))" identifier (argument_list "(*(char **)(param_2 + 4))" ( (pointer_expression "*(char **)(param_2 + 4)" * (cast_expression "(char **)(param_2 + 4)" ( (type_descriptor "char **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_2 + 4)" ( (binary_expression "param_2 + 4" identifier + number_literal) )))) )))) ;) (expression_statement "sVar2 = strlen(__s);" (assignment_expression "sVar2 = strlen(__s)" identifier = (call_expression "strlen(__s)" identifier (argument_list "(__s)" ( identifier )))) ;) (expression_statement "sVar3 = 0;" (assignment_expression "sVar3 = 0" identifier = number_literal) ;) (if_statement "if (DAT_001d0f90 != (char *)0x0) {\n    sVar3 = strlen(DAT_001d0f90);\n  }" if (parenthesized_expression "(DAT_001d0f90 != (char *)0x0)" ( (binary_expression "DAT_001d0f90 != (char *)0x0" identifier != (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    sVar3 = strlen(DAT_001d0f90);\n  }" { (expression_statement "sVar3 = strlen(DAT_001d0f90);" (assignment_expression "sVar3 = strlen(DAT_001d0f90)" identifier = (call_expression "strlen(DAT_001d0f90)" identifier (argument_list "(DAT_001d0f90)" ( identifier )))) ;) })) (expression_statement "iVar8 = 0;" (assignment_expression "iVar8 = 0" identifier = number_literal) ;) (expression_statement "pcVar4 = (char *)xmalloc(sVar2 + uVar9 + 2 + sVar1 + sVar3);" (assignment_expression "pcVar4 = (char *)xmalloc(sVar2 + uVar9 + 2 + sVar1 + sVar3)" identifier = (cast_expression "(char *)xmalloc(sVar2 + uVar9 + 2 + sVar1 + sVar3)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "xmalloc(sVar2 + uVar9 + 2 + sVar1 + sVar3)" identifier (argument_list "(sVar2 + uVar9 + 2 + sVar1 + sVar3)" ( (binary_expression "sVar2 + uVar9 + 2 + sVar1 + sVar3" (binary_expression "sVar2 + uVar9 + 2 + sVar1" (binary_expression "sVar2 + uVar9 + 2" (binary_expression "sVar2 + uVar9" identifier + identifier) + number_literal) + identifier) + identifier) ))))) ;) (expression_statement "sprintf(pcVar4,"%s/",*(undefined4 *)(param_2 + 4));" (call_expression "sprintf(pcVar4,"%s/",*(undefined4 *)(param_2 + 4))" identifier (argument_list "(pcVar4,"%s/",*(undefined4 *)(param_2 + 4))" ( identifier , (string_literal ""%s/"" " string_content ") , (pointer_expression "*(undefined4 *)(param_2 + 4)" * (cast_expression "(undefined4 *)(param_2 + 4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_2 + 4)" ( (binary_expression "param_2 + 4" identifier + number_literal) )))) ))) ;) (expression_statement "sVar1 = strlen(pcVar4);" (assignment_expression "sVar1 = strlen(pcVar4)" identifier = (call_expression "strlen(pcVar4)" identifier (argument_list "(pcVar4)" ( identifier )))) ;) (expression_statement "pcVar7 = "lib%s.dll.a";" (assignment_expression "pcVar7 = "lib%s.dll.a"" identifier = (string_literal ""lib%s.dll.a"" " string_content ")) ;) (expression_statement "iVar5 = 0;" (assignment_expression "iVar5 = 0" identifier = number_literal) ;) (do_statement "do {\n    if (iVar5 == 0) {\n      sprintf(pcVar4 + sVar1,pcVar7,__s);\nLAB_00058164:\n      iVar5 = FUN_00035320(pcVar4,param_3);\n      if (iVar5 != 0) {\n        if ((&PTR_s_lib_s_dll_a_001ce500)[iVar8 * 2] != (undefined *)0x0) {\n          *(char **)(param_3 + 8) = pcVar4;\n          return 1;\n        }\nLAB_00058218:\n        free(pcVar4);\n        return 0;\n      }\n    }\n    else if (DAT_001d0f90 != (char *)0x0) {\n      sprintf(pcVar4 + sVar1,pcVar7,DAT_001d0f90,__s);\n      goto LAB_00058164;\n    }\n    iVar8 = iVar8 + 1;\n    pcVar7 = (&PTR_s_lib_s_dll_a_001ce500)[iVar8 * 2];\n    if (pcVar7 == (char *)0x0) goto LAB_00058218;\n    iVar5 = *(int *)(&UNK_001ce504 + iVar8 * 8);\n  } while( true );" do (compound_statement "{\n    if (iVar5 == 0) {\n      sprintf(pcVar4 + sVar1,pcVar7,__s);\nLAB_00058164:\n      iVar5 = FUN_00035320(pcVar4,param_3);\n      if (iVar5 != 0) {\n        if ((&PTR_s_lib_s_dll_a_001ce500)[iVar8 * 2] != (undefined *)0x0) {\n          *(char **)(param_3 + 8) = pcVar4;\n          return 1;\n        }\nLAB_00058218:\n        free(pcVar4);\n        return 0;\n      }\n    }\n    else if (DAT_001d0f90 != (char *)0x0) {\n      sprintf(pcVar4 + sVar1,pcVar7,DAT_001d0f90,__s);\n      goto LAB_00058164;\n    }\n    iVar8 = iVar8 + 1;\n    pcVar7 = (&PTR_s_lib_s_dll_a_001ce500)[iVar8 * 2];\n    if (pcVar7 == (char *)0x0) goto LAB_00058218;\n    iVar5 = *(int *)(&UNK_001ce504 + iVar8 * 8);\n  }" { (if_statement "if (iVar5 == 0) {\n      sprintf(pcVar4 + sVar1,pcVar7,__s);\nLAB_00058164:\n      iVar5 = FUN_00035320(pcVar4,param_3);\n      if (iVar5 != 0) {\n        if ((&PTR_s_lib_s_dll_a_001ce500)[iVar8 * 2] != (undefined *)0x0) {\n          *(char **)(param_3 + 8) = pcVar4;\n          return 1;\n        }\nLAB_00058218:\n        free(pcVar4);\n        return 0;\n      }\n    }\n    else if (DAT_001d0f90 != (char *)0x0) {\n      sprintf(pcVar4 + sVar1,pcVar7,DAT_001d0f90,__s);\n      goto LAB_00058164;\n    }" if (parenthesized_expression "(iVar5 == 0)" ( (binary_expression "iVar5 == 0" identifier == number_literal) )) (compound_statement "{\n      sprintf(pcVar4 + sVar1,pcVar7,__s);\nLAB_00058164:\n      iVar5 = FUN_00035320(pcVar4,param_3);\n      if (iVar5 != 0) {\n        if ((&PTR_s_lib_s_dll_a_001ce500)[iVar8 * 2] != (undefined *)0x0) {\n          *(char **)(param_3 + 8) = pcVar4;\n          return 1;\n        }\nLAB_00058218:\n        free(pcVar4);\n        return 0;\n      }\n    }" { (expression_statement "sprintf(pcVar4 + sVar1,pcVar7,__s);" (call_expression "sprintf(pcVar4 + sVar1,pcVar7,__s)" identifier (argument_list "(pcVar4 + sVar1,pcVar7,__s)" ( (binary_expression "pcVar4 + sVar1" identifier + identifier) , identifier , identifier ))) ;) (labeled_statement "LAB_00058164:\n      iVar5 = FUN_00035320(pcVar4,param_3);" statement_identifier : (expression_statement "iVar5 = FUN_00035320(pcVar4,param_3);" (assignment_expression "iVar5 = FUN_00035320(pcVar4,param_3)" identifier = (call_expression "FUN_00035320(pcVar4,param_3)" identifier (argument_list "(pcVar4,param_3)" ( identifier , identifier )))) ;)) (if_statement "if (iVar5 != 0) {\n        if ((&PTR_s_lib_s_dll_a_001ce500)[iVar8 * 2] != (undefined *)0x0) {\n          *(char **)(param_3 + 8) = pcVar4;\n          return 1;\n        }\nLAB_00058218:\n        free(pcVar4);\n        return 0;\n      }" if (parenthesized_expression "(iVar5 != 0)" ( (binary_expression "iVar5 != 0" identifier != number_literal) )) (compound_statement "{\n        if ((&PTR_s_lib_s_dll_a_001ce500)[iVar8 * 2] != (undefined *)0x0) {\n          *(char **)(param_3 + 8) = pcVar4;\n          return 1;\n        }\nLAB_00058218:\n        free(pcVar4);\n        return 0;\n      }" { (if_statement "if ((&PTR_s_lib_s_dll_a_001ce500)[iVar8 * 2] != (undefined *)0x0) {\n          *(char **)(param_3 + 8) = pcVar4;\n          return 1;\n        }" if (parenthesized_expression "((&PTR_s_lib_s_dll_a_001ce500)[iVar8 * 2] != (undefined *)0x0)" ( (binary_expression "(&PTR_s_lib_s_dll_a_001ce500)[iVar8 * 2] != (undefined *)0x0" (subscript_expression "(&PTR_s_lib_s_dll_a_001ce500)[iVar8 * 2]" (parenthesized_expression "(&PTR_s_lib_s_dll_a_001ce500)" ( (pointer_expression "&PTR_s_lib_s_dll_a_001ce500" & identifier) )) [ (binary_expression "iVar8 * 2" identifier * number_literal) ]) != (cast_expression "(undefined *)0x0" ( (type_descriptor "undefined *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n          *(char **)(param_3 + 8) = pcVar4;\n          return 1;\n        }" { (expression_statement "*(char **)(param_3 + 8) = pcVar4;" (assignment_expression "*(char **)(param_3 + 8) = pcVar4" (pointer_expression "*(char **)(param_3 + 8)" * (cast_expression "(char **)(param_3 + 8)" ( (type_descriptor "char **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_3 + 8)" ( (binary_expression "param_3 + 8" identifier + number_literal) )))) = identifier) ;) (return_statement "return 1;" return number_literal ;) })) (labeled_statement "LAB_00058218:\n        free(pcVar4);" statement_identifier : (expression_statement "free(pcVar4);" (call_expression "free(pcVar4)" identifier (argument_list "(pcVar4)" ( identifier ))) ;)) (return_statement "return 0;" return number_literal ;) })) }) (else_clause "else if (DAT_001d0f90 != (char *)0x0) {\n      sprintf(pcVar4 + sVar1,pcVar7,DAT_001d0f90,__s);\n      goto LAB_00058164;\n    }" else (if_statement "if (DAT_001d0f90 != (char *)0x0) {\n      sprintf(pcVar4 + sVar1,pcVar7,DAT_001d0f90,__s);\n      goto LAB_00058164;\n    }" if (parenthesized_expression "(DAT_001d0f90 != (char *)0x0)" ( (binary_expression "DAT_001d0f90 != (char *)0x0" identifier != (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      sprintf(pcVar4 + sVar1,pcVar7,DAT_001d0f90,__s);\n      goto LAB_00058164;\n    }" { (expression_statement "sprintf(pcVar4 + sVar1,pcVar7,DAT_001d0f90,__s);" (call_expression "sprintf(pcVar4 + sVar1,pcVar7,DAT_001d0f90,__s)" identifier (argument_list "(pcVar4 + sVar1,pcVar7,DAT_001d0f90,__s)" ( (binary_expression "pcVar4 + sVar1" identifier + identifier) , identifier , identifier , identifier ))) ;) (goto_statement "goto LAB_00058164;" goto statement_identifier ;) })))) (expression_statement "iVar8 = iVar8 + 1;" (assignment_expression "iVar8 = iVar8 + 1" identifier = (binary_expression "iVar8 + 1" identifier + number_literal)) ;) (expression_statement "pcVar7 = (&PTR_s_lib_s_dll_a_001ce500)[iVar8 * 2];" (assignment_expression "pcVar7 = (&PTR_s_lib_s_dll_a_001ce500)[iVar8 * 2]" identifier = (subscript_expression "(&PTR_s_lib_s_dll_a_001ce500)[iVar8 * 2]" (parenthesized_expression "(&PTR_s_lib_s_dll_a_001ce500)" ( (pointer_expression "&PTR_s_lib_s_dll_a_001ce500" & identifier) )) [ (binary_expression "iVar8 * 2" identifier * number_literal) ])) ;) (if_statement "if (pcVar7 == (char *)0x0) goto LAB_00058218;" if (parenthesized_expression "(pcVar7 == (char *)0x0)" ( (binary_expression "pcVar7 == (char *)0x0" identifier == (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (goto_statement "goto LAB_00058218;" goto statement_identifier ;)) (expression_statement "iVar5 = *(int *)(&UNK_001ce504 + iVar8 * 8);" (assignment_expression "iVar5 = *(int *)(&UNK_001ce504 + iVar8 * 8)" identifier = (pointer_expression "*(int *)(&UNK_001ce504 + iVar8 * 8)" * (cast_expression "(int *)(&UNK_001ce504 + iVar8 * 8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(&UNK_001ce504 + iVar8 * 8)" ( (binary_expression "&UNK_001ce504 + iVar8 * 8" (pointer_expression "&UNK_001ce504" & identifier) + (binary_expression "iVar8 * 8" identifier * number_literal)) ))))) ;) }) while (parenthesized_expression "( true )" ( true )) ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * (pointer_declarator * IDENT)) ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) & LIT) )) != LIT) )) (compound_statement { (return_statement return LIT ;) })) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (pointer_expression & IDENT)) ;) (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = (string_literal " string_content ")) ;) (while_statement while (parenthesized_expression ( BOOL )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression IDENT < IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = IDENT) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) })) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (break_statement break ;)) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) })) })) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) )))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) (expression_statement (assignment_expression IDENT = LIT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) })) (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression IDENT (argument_list ( (binary_expression (binary_expression (binary_expression (binary_expression IDENT + IDENT) + LIT) + IDENT) + IDENT) ))))) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT , (string_literal " string_content ") , (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) ))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) (expression_statement (assignment_expression IDENT = (string_literal " string_content ")) ;) (expression_statement (assignment_expression IDENT = LIT) ;) (do_statement do (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( (binary_expression IDENT + IDENT) , IDENT , IDENT ))) ;) (labeled_statement statement_identifier : (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT )))) ;)) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression (subscript_expression (parenthesized_expression ( (pointer_expression & IDENT) )) [ (binary_expression IDENT * LIT) ]) != (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = IDENT) ;) (return_statement return LIT ;) })) (labeled_statement statement_identifier : (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;)) (return_statement return LIT ;) })) }) (else_clause else (if_statement if (parenthesized_expression ( (binary_expression IDENT != (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( (binary_expression IDENT + IDENT) , IDENT , IDENT , IDENT ))) ;) (goto_statement goto statement_identifier ;) })))) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (expression_statement (assignment_expression IDENT = (subscript_expression (parenthesized_expression ( (pointer_expression & IDENT) )) [ (binary_expression IDENT * LIT) ])) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (goto_statement goto statement_identifier ;)) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (pointer_expression & IDENT) + (binary_expression IDENT * LIT)) ))))) ;) }) while (parenthesized_expression ( BOOL )) ;) })))
(function_definition "undefined4 FUN_00058080(undefined4 param_1,int param_2,int param_3)\n\n{\n  char *__s;\n  size_t sVar1;\n  size_t sVar2;\n  size_t sVar3;\n  char *pcVar4;\n  int iVar5;\n  uint uVar6;\n  char *pcVar7;\n  int iVar8;\n  uint uVar9;\n  undefined **ppuVar10;\n  \n  if ((*(byte *)(param_3 + 0x24) & 3) != 1) {\n    return 0;\n  }\n  __s = *(char **)(param_3 + 8);\n  uVar9 = DAT_001d0f84;\n  if (DAT_001d0f84 == 0) {\n    ppuVar10 = &PTR_s_lib_s_a_001ce510;\n    uVar6 = 0xb;\n    pcVar7 = "%s.dll.a";\n    while( true ) {\n      if (uVar9 < uVar6) {\n        uVar9 = uVar6;\n        DAT_001d0f84 = uVar6;\n      }\n      if (pcVar7 == (char *)0x0) break;\n      pcVar4 = *ppuVar10;\n      ppuVar10 = ppuVar10 + 2;\n      uVar6 = strlen(pcVar7);\n      pcVar7 = pcVar4;\n    }\n  }\n  sVar1 = strlen(*(char **)(param_2 + 4));\n  sVar2 = strlen(__s);\n  sVar3 = 0;\n  if (DAT_001d0f90 != (char *)0x0) {\n    sVar3 = strlen(DAT_001d0f90);\n  }\n  iVar8 = 0;\n  pcVar4 = (char *)xmalloc(sVar2 + uVar9 + 2 + sVar1 + sVar3);\n  sprintf(pcVar4,"%s/",*(undefined4 *)(param_2 + 4));\n  sVar1 = strlen(pcVar4);\n  pcVar7 = "lib%s.dll.a";\n  iVar5 = 0;\n  do {\n    if (iVar5 == 0) {\n      sprintf(pcVar4 + sVar1,pcVar7,__s);\nLAB_00058164:\n      iVar5 = FUN_00035320(pcVar4,param_3);\n      if (iVar5 != 0) {\n        if ((&PTR_s_lib_s_dll_a_001ce500)[iVar8 * 2] != (undefined *)0x0) {\n          *(char **)(param_3 + 8) = pcVar4;\n          return 1;\n        }\nLAB_00058218:\n        free(pcVar4);\n        return 0;\n      }\n    }\n    else if (DAT_001d0f90 != (char *)0x0) {\n      sprintf(pcVar4 + sVar1,pcVar7,DAT_001d0f90,__s);\n      goto LAB_00058164;\n    }\n    iVar8 = iVar8 + 1;\n    pcVar7 = (&PTR_s_lib_s_dll_a_001ce500)[iVar8 * 2];\n    if (pcVar7 == (char *)0x0) goto LAB_00058218;\n    iVar5 = *(int *)(&UNK_001ce504 + iVar8 * 8);\n  } while( true );\n}" (type_identifier "undefined4") (function_declarator "FUN_00058080(undefined4 param_1,int param_2,int param_3)" (identifier "FUN_00058080") (parameter_list "(undefined4 param_1,int param_2,int param_3)" (( "(") (parameter_declaration "undefined4 param_1" (type_identifier "undefined4") (identifier "param_1")) (, ",") (parameter_declaration "int param_2" (primitive_type "int") (identifier "param_2")) (, ",") (parameter_declaration "int param_3" (primitive_type "int") (identifier "param_3")) () ")"))) (compound_statement "{\n  char *__s;\n  size_t sVar1;\n  size_t sVar2;\n  size_t sVar3;\n  char *pcVar4;\n  int iVar5;\n  uint uVar6;\n  char *pcVar7;\n  int iVar8;\n  uint uVar9;\n  undefined **ppuVar10;\n  \n  if ((*(byte *)(param_3 + 0x24) & 3) != 1) {\n    return 0;\n  }\n  __s = *(char **)(param_3 + 8);\n  uVar9 = DAT_001d0f84;\n  if (DAT_001d0f84 == 0) {\n    ppuVar10 = &PTR_s_lib_s_a_001ce510;\n    uVar6 = 0xb;\n    pcVar7 = "%s.dll.a";\n    while( true ) {\n      if (uVar9 < uVar6) {\n        uVar9 = uVar6;\n        DAT_001d0f84 = uVar6;\n      }\n      if (pcVar7 == (char *)0x0) break;\n      pcVar4 = *ppuVar10;\n      ppuVar10 = ppuVar10 + 2;\n      uVar6 = strlen(pcVar7);\n      pcVar7 = pcVar4;\n    }\n  }\n  sVar1 = strlen(*(char **)(param_2 + 4));\n  sVar2 = strlen(__s);\n  sVar3 = 0;\n  if (DAT_001d0f90 != (char *)0x0) {\n    sVar3 = strlen(DAT_001d0f90);\n  }\n  iVar8 = 0;\n  pcVar4 = (char *)xmalloc(sVar2 + uVar9 + 2 + sVar1 + sVar3);\n  sprintf(pcVar4,"%s/",*(undefined4 *)(param_2 + 4));\n  sVar1 = strlen(pcVar4);\n  pcVar7 = "lib%s.dll.a";\n  iVar5 = 0;\n  do {\n    if (iVar5 == 0) {\n      sprintf(pcVar4 + sVar1,pcVar7,__s);\nLAB_00058164:\n      iVar5 = FUN_00035320(pcVar4,param_3);\n      if (iVar5 != 0) {\n        if ((&PTR_s_lib_s_dll_a_001ce500)[iVar8 * 2] != (undefined *)0x0) {\n          *(char **)(param_3 + 8) = pcVar4;\n          return 1;\n        }\nLAB_00058218:\n        free(pcVar4);\n        return 0;\n      }\n    }\n    else if (DAT_001d0f90 != (char *)0x0) {\n      sprintf(pcVar4 + sVar1,pcVar7,DAT_001d0f90,__s);\n      goto LAB_00058164;\n    }\n    iVar8 = iVar8 + 1;\n    pcVar7 = (&PTR_s_lib_s_dll_a_001ce500)[iVar8 * 2];\n    if (pcVar7 == (char *)0x0) goto LAB_00058218;\n    iVar5 = *(int *)(&UNK_001ce504 + iVar8 * 8);\n  } while( true );\n}" ({ "{") (declaration "char *__s;" (primitive_type "char") (pointer_declarator "*__s" (* "*") (identifier "__s")) (; ";")) (declaration "size_t sVar1;" (primitive_type "size_t") (identifier "sVar1") (; ";")) (declaration "size_t sVar2;" (primitive_type "size_t") (identifier "sVar2") (; ";")) (declaration "size_t sVar3;" (primitive_type "size_t") (identifier "sVar3") (; ";")) (declaration "char *pcVar4;" (primitive_type "char") (pointer_declarator "*pcVar4" (* "*") (identifier "pcVar4")) (; ";")) (declaration "int iVar5;" (primitive_type "int") (identifier "iVar5") (; ";")) (declaration "uint uVar6;" (type_identifier "uint") (identifier "uVar6") (; ";")) (declaration "char *pcVar7;" (primitive_type "char") (pointer_declarator "*pcVar7" (* "*") (identifier "pcVar7")) (; ";")) (declaration "int iVar8;" (primitive_type "int") (identifier "iVar8") (; ";")) (declaration "uint uVar9;" (type_identifier "uint") (identifier "uVar9") (; ";")) (declaration "undefined **ppuVar10;" (type_identifier "undefined") (pointer_declarator "**ppuVar10" (* "*") (pointer_declarator "*ppuVar10" (* "*") (identifier "ppuVar10"))) (; ";")) (if_statement "if ((*(byte *)(param_3 + 0x24) & 3) != 1) {\n    return 0;\n  }" (if "if") (parenthesized_expression "((*(byte *)(param_3 + 0x24) & 3) != 1)" (( "(") (binary_expression "(*(byte *)(param_3 + 0x24) & 3) != 1" (parenthesized_expression "(*(byte *)(param_3 + 0x24) & 3)" (( "(") (binary_expression "*(byte *)(param_3 + 0x24) & 3" (pointer_expression "*(byte *)(param_3 + 0x24)" (* "*") (cast_expression "(byte *)(param_3 + 0x24)" (( "(") (type_descriptor "byte *" (type_identifier "byte") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_3 + 0x24)" (( "(") (binary_expression "param_3 + 0x24" (identifier "param_3") (+ "+") (number_literal "0x24")) () ")")))) (& "&") (number_literal "3")) () ")")) (!= "!=") (number_literal "1")) () ")")) (compound_statement "{\n    return 0;\n  }" ({ "{") (return_statement "return 0;" (return "return") (number_literal "0") (; ";")) (} "}"))) (expression_statement "__s = *(char **)(param_3 + 8);" (assignment_expression "__s = *(char **)(param_3 + 8)" (identifier "__s") (= "=") (pointer_expression "*(char **)(param_3 + 8)" (* "*") (cast_expression "(char **)(param_3 + 8)" (( "(") (type_descriptor "char **" (primitive_type "char") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(param_3 + 8)" (( "(") (binary_expression "param_3 + 8" (identifier "param_3") (+ "+") (number_literal "8")) () ")"))))) (; ";")) (expression_statement "uVar9 = DAT_001d0f84;" (assignment_expression "uVar9 = DAT_001d0f84" (identifier "uVar9") (= "=") (identifier "DAT_001d0f84")) (; ";")) (if_statement "if (DAT_001d0f84 == 0) {\n    ppuVar10 = &PTR_s_lib_s_a_001ce510;\n    uVar6 = 0xb;\n    pcVar7 = "%s.dll.a";\n    while( true ) {\n      if (uVar9 < uVar6) {\n        uVar9 = uVar6;\n        DAT_001d0f84 = uVar6;\n      }\n      if (pcVar7 == (char *)0x0) break;\n      pcVar4 = *ppuVar10;\n      ppuVar10 = ppuVar10 + 2;\n      uVar6 = strlen(pcVar7);\n      pcVar7 = pcVar4;\n    }\n  }" (if "if") (parenthesized_expression "(DAT_001d0f84 == 0)" (( "(") (binary_expression "DAT_001d0f84 == 0" (identifier "DAT_001d0f84") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n    ppuVar10 = &PTR_s_lib_s_a_001ce510;\n    uVar6 = 0xb;\n    pcVar7 = "%s.dll.a";\n    while( true ) {\n      if (uVar9 < uVar6) {\n        uVar9 = uVar6;\n        DAT_001d0f84 = uVar6;\n      }\n      if (pcVar7 == (char *)0x0) break;\n      pcVar4 = *ppuVar10;\n      ppuVar10 = ppuVar10 + 2;\n      uVar6 = strlen(pcVar7);\n      pcVar7 = pcVar4;\n    }\n  }" ({ "{") (expression_statement "ppuVar10 = &PTR_s_lib_s_a_001ce510;" (assignment_expression "ppuVar10 = &PTR_s_lib_s_a_001ce510" (identifier "ppuVar10") (= "=") (pointer_expression "&PTR_s_lib_s_a_001ce510" (& "&") (identifier "PTR_s_lib_s_a_001ce510"))) (; ";")) (expression_statement "uVar6 = 0xb;" (assignment_expression "uVar6 = 0xb" (identifier "uVar6") (= "=") (number_literal "0xb")) (; ";")) (expression_statement "pcVar7 = "%s.dll.a";" (assignment_expression "pcVar7 = "%s.dll.a"" (identifier "pcVar7") (= "=") (string_literal ""%s.dll.a"" (" """) (string_content "%s.dll.a") (" """))) (; ";")) (while_statement "while( true ) {\n      if (uVar9 < uVar6) {\n        uVar9 = uVar6;\n        DAT_001d0f84 = uVar6;\n      }\n      if (pcVar7 == (char *)0x0) break;\n      pcVar4 = *ppuVar10;\n      ppuVar10 = ppuVar10 + 2;\n      uVar6 = strlen(pcVar7);\n      pcVar7 = pcVar4;\n    }" (while "while") (parenthesized_expression "( true )" (( "(") (true "true") () ")")) (compound_statement "{\n      if (uVar9 < uVar6) {\n        uVar9 = uVar6;\n        DAT_001d0f84 = uVar6;\n      }\n      if (pcVar7 == (char *)0x0) break;\n      pcVar4 = *ppuVar10;\n      ppuVar10 = ppuVar10 + 2;\n      uVar6 = strlen(pcVar7);\n      pcVar7 = pcVar4;\n    }" ({ "{") (if_statement "if (uVar9 < uVar6) {\n        uVar9 = uVar6;\n        DAT_001d0f84 = uVar6;\n      }" (if "if") (parenthesized_expression "(uVar9 < uVar6)" (( "(") (binary_expression "uVar9 < uVar6" (identifier "uVar9") (< "<") (identifier "uVar6")) () ")")) (compound_statement "{\n        uVar9 = uVar6;\n        DAT_001d0f84 = uVar6;\n      }" ({ "{") (expression_statement "uVar9 = uVar6;" (assignment_expression "uVar9 = uVar6" (identifier "uVar9") (= "=") (identifier "uVar6")) (; ";")) (expression_statement "DAT_001d0f84 = uVar6;" (assignment_expression "DAT_001d0f84 = uVar6" (identifier "DAT_001d0f84") (= "=") (identifier "uVar6")) (; ";")) (} "}"))) (if_statement "if (pcVar7 == (char *)0x0) break;" (if "if") (parenthesized_expression "(pcVar7 == (char *)0x0)" (( "(") (binary_expression "pcVar7 == (char *)0x0" (identifier "pcVar7") (== "==") (cast_expression "(char *)0x0" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (break_statement "break;" (break "break") (; ";"))) (expression_statement "pcVar4 = *ppuVar10;" (assignment_expression "pcVar4 = *ppuVar10" (identifier "pcVar4") (= "=") (pointer_expression "*ppuVar10" (* "*") (identifier "ppuVar10"))) (; ";")) (expression_statement "ppuVar10 = ppuVar10 + 2;" (assignment_expression "ppuVar10 = ppuVar10 + 2" (identifier "ppuVar10") (= "=") (binary_expression "ppuVar10 + 2" (identifier "ppuVar10") (+ "+") (number_literal "2"))) (; ";")) (expression_statement "uVar6 = strlen(pcVar7);" (assignment_expression "uVar6 = strlen(pcVar7)" (identifier "uVar6") (= "=") (call_expression "strlen(pcVar7)" (identifier "strlen") (argument_list "(pcVar7)" (( "(") (identifier "pcVar7") () ")")))) (; ";")) (expression_statement "pcVar7 = pcVar4;" (assignment_expression "pcVar7 = pcVar4" (identifier "pcVar7") (= "=") (identifier "pcVar4")) (; ";")) (} "}"))) (} "}"))) (expression_statement "sVar1 = strlen(*(char **)(param_2 + 4));" (assignment_expression "sVar1 = strlen(*(char **)(param_2 + 4))" (identifier "sVar1") (= "=") (call_expression "strlen(*(char **)(param_2 + 4))" (identifier "strlen") (argument_list "(*(char **)(param_2 + 4))" (( "(") (pointer_expression "*(char **)(param_2 + 4)" (* "*") (cast_expression "(char **)(param_2 + 4)" (( "(") (type_descriptor "char **" (primitive_type "char") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(param_2 + 4)" (( "(") (binary_expression "param_2 + 4" (identifier "param_2") (+ "+") (number_literal "4")) () ")")))) () ")")))) (; ";")) (expression_statement "sVar2 = strlen(__s);" (assignment_expression "sVar2 = strlen(__s)" (identifier "sVar2") (= "=") (call_expression "strlen(__s)" (identifier "strlen") (argument_list "(__s)" (( "(") (identifier "__s") () ")")))) (; ";")) (expression_statement "sVar3 = 0;" (assignment_expression "sVar3 = 0" (identifier "sVar3") (= "=") (number_literal "0")) (; ";")) (if_statement "if (DAT_001d0f90 != (char *)0x0) {\n    sVar3 = strlen(DAT_001d0f90);\n  }" (if "if") (parenthesized_expression "(DAT_001d0f90 != (char *)0x0)" (( "(") (binary_expression "DAT_001d0f90 != (char *)0x0" (identifier "DAT_001d0f90") (!= "!=") (cast_expression "(char *)0x0" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n    sVar3 = strlen(DAT_001d0f90);\n  }" ({ "{") (expression_statement "sVar3 = strlen(DAT_001d0f90);" (assignment_expression "sVar3 = strlen(DAT_001d0f90)" (identifier "sVar3") (= "=") (call_expression "strlen(DAT_001d0f90)" (identifier "strlen") (argument_list "(DAT_001d0f90)" (( "(") (identifier "DAT_001d0f90") () ")")))) (; ";")) (} "}"))) (expression_statement "iVar8 = 0;" (assignment_expression "iVar8 = 0" (identifier "iVar8") (= "=") (number_literal "0")) (; ";")) (expression_statement "pcVar4 = (char *)xmalloc(sVar2 + uVar9 + 2 + sVar1 + sVar3);" (assignment_expression "pcVar4 = (char *)xmalloc(sVar2 + uVar9 + 2 + sVar1 + sVar3)" (identifier "pcVar4") (= "=") (cast_expression "(char *)xmalloc(sVar2 + uVar9 + 2 + sVar1 + sVar3)" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "xmalloc(sVar2 + uVar9 + 2 + sVar1 + sVar3)" (identifier "xmalloc") (argument_list "(sVar2 + uVar9 + 2 + sVar1 + sVar3)" (( "(") (binary_expression "sVar2 + uVar9 + 2 + sVar1 + sVar3" (binary_expression "sVar2 + uVar9 + 2 + sVar1" (binary_expression "sVar2 + uVar9 + 2" (binary_expression "sVar2 + uVar9" (identifier "sVar2") (+ "+") (identifier "uVar9")) (+ "+") (number_literal "2")) (+ "+") (identifier "sVar1")) (+ "+") (identifier "sVar3")) () ")"))))) (; ";")) (expression_statement "sprintf(pcVar4,"%s/",*(undefined4 *)(param_2 + 4));" (call_expression "sprintf(pcVar4,"%s/",*(undefined4 *)(param_2 + 4))" (identifier "sprintf") (argument_list "(pcVar4,"%s/",*(undefined4 *)(param_2 + 4))" (( "(") (identifier "pcVar4") (, ",") (string_literal ""%s/"" (" """) (string_content "%s/") (" """)) (, ",") (pointer_expression "*(undefined4 *)(param_2 + 4)" (* "*") (cast_expression "(undefined4 *)(param_2 + 4)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_2 + 4)" (( "(") (binary_expression "param_2 + 4" (identifier "param_2") (+ "+") (number_literal "4")) () ")")))) () ")"))) (; ";")) (expression_statement "sVar1 = strlen(pcVar4);" (assignment_expression "sVar1 = strlen(pcVar4)" (identifier "sVar1") (= "=") (call_expression "strlen(pcVar4)" (identifier "strlen") (argument_list "(pcVar4)" (( "(") (identifier "pcVar4") () ")")))) (; ";")) (expression_statement "pcVar7 = "lib%s.dll.a";" (assignment_expression "pcVar7 = "lib%s.dll.a"" (identifier "pcVar7") (= "=") (string_literal ""lib%s.dll.a"" (" """) (string_content "lib%s.dll.a") (" """))) (; ";")) (expression_statement "iVar5 = 0;" (assignment_expression "iVar5 = 0" (identifier "iVar5") (= "=") (number_literal "0")) (; ";")) (do_statement "do {\n    if (iVar5 == 0) {\n      sprintf(pcVar4 + sVar1,pcVar7,__s);\nLAB_00058164:\n      iVar5 = FUN_00035320(pcVar4,param_3);\n      if (iVar5 != 0) {\n        if ((&PTR_s_lib_s_dll_a_001ce500)[iVar8 * 2] != (undefined *)0x0) {\n          *(char **)(param_3 + 8) = pcVar4;\n          return 1;\n        }\nLAB_00058218:\n        free(pcVar4);\n        return 0;\n      }\n    }\n    else if (DAT_001d0f90 != (char *)0x0) {\n      sprintf(pcVar4 + sVar1,pcVar7,DAT_001d0f90,__s);\n      goto LAB_00058164;\n    }\n    iVar8 = iVar8 + 1;\n    pcVar7 = (&PTR_s_lib_s_dll_a_001ce500)[iVar8 * 2];\n    if (pcVar7 == (char *)0x0) goto LAB_00058218;\n    iVar5 = *(int *)(&UNK_001ce504 + iVar8 * 8);\n  } while( true );" (do "do") (compound_statement "{\n    if (iVar5 == 0) {\n      sprintf(pcVar4 + sVar1,pcVar7,__s);\nLAB_00058164:\n      iVar5 = FUN_00035320(pcVar4,param_3);\n      if (iVar5 != 0) {\n        if ((&PTR_s_lib_s_dll_a_001ce500)[iVar8 * 2] != (undefined *)0x0) {\n          *(char **)(param_3 + 8) = pcVar4;\n          return 1;\n        }\nLAB_00058218:\n        free(pcVar4);\n        return 0;\n      }\n    }\n    else if (DAT_001d0f90 != (char *)0x0) {\n      sprintf(pcVar4 + sVar1,pcVar7,DAT_001d0f90,__s);\n      goto LAB_00058164;\n    }\n    iVar8 = iVar8 + 1;\n    pcVar7 = (&PTR_s_lib_s_dll_a_001ce500)[iVar8 * 2];\n    if (pcVar7 == (char *)0x0) goto LAB_00058218;\n    iVar5 = *(int *)(&UNK_001ce504 + iVar8 * 8);\n  }" ({ "{") (if_statement "if (iVar5 == 0) {\n      sprintf(pcVar4 + sVar1,pcVar7,__s);\nLAB_00058164:\n      iVar5 = FUN_00035320(pcVar4,param_3);\n      if (iVar5 != 0) {\n        if ((&PTR_s_lib_s_dll_a_001ce500)[iVar8 * 2] != (undefined *)0x0) {\n          *(char **)(param_3 + 8) = pcVar4;\n          return 1;\n        }\nLAB_00058218:\n        free(pcVar4);\n        return 0;\n      }\n    }\n    else if (DAT_001d0f90 != (char *)0x0) {\n      sprintf(pcVar4 + sVar1,pcVar7,DAT_001d0f90,__s);\n      goto LAB_00058164;\n    }" (if "if") (parenthesized_expression "(iVar5 == 0)" (( "(") (binary_expression "iVar5 == 0" (identifier "iVar5") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n      sprintf(pcVar4 + sVar1,pcVar7,__s);\nLAB_00058164:\n      iVar5 = FUN_00035320(pcVar4,param_3);\n      if (iVar5 != 0) {\n        if ((&PTR_s_lib_s_dll_a_001ce500)[iVar8 * 2] != (undefined *)0x0) {\n          *(char **)(param_3 + 8) = pcVar4;\n          return 1;\n        }\nLAB_00058218:\n        free(pcVar4);\n        return 0;\n      }\n    }" ({ "{") (expression_statement "sprintf(pcVar4 + sVar1,pcVar7,__s);" (call_expression "sprintf(pcVar4 + sVar1,pcVar7,__s)" (identifier "sprintf") (argument_list "(pcVar4 + sVar1,pcVar7,__s)" (( "(") (binary_expression "pcVar4 + sVar1" (identifier "pcVar4") (+ "+") (identifier "sVar1")) (, ",") (identifier "pcVar7") (, ",") (identifier "__s") () ")"))) (; ";")) (labeled_statement "LAB_00058164:\n      iVar5 = FUN_00035320(pcVar4,param_3);" (statement_identifier "LAB_00058164") (: ":") (expression_statement "iVar5 = FUN_00035320(pcVar4,param_3);" (assignment_expression "iVar5 = FUN_00035320(pcVar4,param_3)" (identifier "iVar5") (= "=") (call_expression "FUN_00035320(pcVar4,param_3)" (identifier "FUN_00035320") (argument_list "(pcVar4,param_3)" (( "(") (identifier "pcVar4") (, ",") (identifier "param_3") () ")")))) (; ";"))) (if_statement "if (iVar5 != 0) {\n        if ((&PTR_s_lib_s_dll_a_001ce500)[iVar8 * 2] != (undefined *)0x0) {\n          *(char **)(param_3 + 8) = pcVar4;\n          return 1;\n        }\nLAB_00058218:\n        free(pcVar4);\n        return 0;\n      }" (if "if") (parenthesized_expression "(iVar5 != 0)" (( "(") (binary_expression "iVar5 != 0" (identifier "iVar5") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n        if ((&PTR_s_lib_s_dll_a_001ce500)[iVar8 * 2] != (undefined *)0x0) {\n          *(char **)(param_3 + 8) = pcVar4;\n          return 1;\n        }\nLAB_00058218:\n        free(pcVar4);\n        return 0;\n      }" ({ "{") (if_statement "if ((&PTR_s_lib_s_dll_a_001ce500)[iVar8 * 2] != (undefined *)0x0) {\n          *(char **)(param_3 + 8) = pcVar4;\n          return 1;\n        }" (if "if") (parenthesized_expression "((&PTR_s_lib_s_dll_a_001ce500)[iVar8 * 2] != (undefined *)0x0)" (( "(") (binary_expression "(&PTR_s_lib_s_dll_a_001ce500)[iVar8 * 2] != (undefined *)0x0" (subscript_expression "(&PTR_s_lib_s_dll_a_001ce500)[iVar8 * 2]" (parenthesized_expression "(&PTR_s_lib_s_dll_a_001ce500)" (( "(") (pointer_expression "&PTR_s_lib_s_dll_a_001ce500" (& "&") (identifier "PTR_s_lib_s_dll_a_001ce500")) () ")")) ([ "[") (binary_expression "iVar8 * 2" (identifier "iVar8") (* "*") (number_literal "2")) (] "]")) (!= "!=") (cast_expression "(undefined *)0x0" (( "(") (type_descriptor "undefined *" (type_identifier "undefined") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n          *(char **)(param_3 + 8) = pcVar4;\n          return 1;\n        }" ({ "{") (expression_statement "*(char **)(param_3 + 8) = pcVar4;" (assignment_expression "*(char **)(param_3 + 8) = pcVar4" (pointer_expression "*(char **)(param_3 + 8)" (* "*") (cast_expression "(char **)(param_3 + 8)" (( "(") (type_descriptor "char **" (primitive_type "char") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(param_3 + 8)" (( "(") (binary_expression "param_3 + 8" (identifier "param_3") (+ "+") (number_literal "8")) () ")")))) (= "=") (identifier "pcVar4")) (; ";")) (return_statement "return 1;" (return "return") (number_literal "1") (; ";")) (} "}"))) (labeled_statement "LAB_00058218:\n        free(pcVar4);" (statement_identifier "LAB_00058218") (: ":") (expression_statement "free(pcVar4);" (call_expression "free(pcVar4)" (identifier "free") (argument_list "(pcVar4)" (( "(") (identifier "pcVar4") () ")"))) (; ";"))) (return_statement "return 0;" (return "return") (number_literal "0") (; ";")) (} "}"))) (} "}")) (else_clause "else if (DAT_001d0f90 != (char *)0x0) {\n      sprintf(pcVar4 + sVar1,pcVar7,DAT_001d0f90,__s);\n      goto LAB_00058164;\n    }" (else "else") (if_statement "if (DAT_001d0f90 != (char *)0x0) {\n      sprintf(pcVar4 + sVar1,pcVar7,DAT_001d0f90,__s);\n      goto LAB_00058164;\n    }" (if "if") (parenthesized_expression "(DAT_001d0f90 != (char *)0x0)" (( "(") (binary_expression "DAT_001d0f90 != (char *)0x0" (identifier "DAT_001d0f90") (!= "!=") (cast_expression "(char *)0x0" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n      sprintf(pcVar4 + sVar1,pcVar7,DAT_001d0f90,__s);\n      goto LAB_00058164;\n    }" ({ "{") (expression_statement "sprintf(pcVar4 + sVar1,pcVar7,DAT_001d0f90,__s);" (call_expression "sprintf(pcVar4 + sVar1,pcVar7,DAT_001d0f90,__s)" (identifier "sprintf") (argument_list "(pcVar4 + sVar1,pcVar7,DAT_001d0f90,__s)" (( "(") (binary_expression "pcVar4 + sVar1" (identifier "pcVar4") (+ "+") (identifier "sVar1")) (, ",") (identifier "pcVar7") (, ",") (identifier "DAT_001d0f90") (, ",") (identifier "__s") () ")"))) (; ";")) (goto_statement "goto LAB_00058164;" (goto "goto") (statement_identifier "LAB_00058164") (; ";")) (} "}"))))) (expression_statement "iVar8 = iVar8 + 1;" (assignment_expression "iVar8 = iVar8 + 1" (identifier "iVar8") (= "=") (binary_expression "iVar8 + 1" (identifier "iVar8") (+ "+") (number_literal "1"))) (; ";")) (expression_statement "pcVar7 = (&PTR_s_lib_s_dll_a_001ce500)[iVar8 * 2];" (assignment_expression "pcVar7 = (&PTR_s_lib_s_dll_a_001ce500)[iVar8 * 2]" (identifier "pcVar7") (= "=") (subscript_expression "(&PTR_s_lib_s_dll_a_001ce500)[iVar8 * 2]" (parenthesized_expression "(&PTR_s_lib_s_dll_a_001ce500)" (( "(") (pointer_expression "&PTR_s_lib_s_dll_a_001ce500" (& "&") (identifier "PTR_s_lib_s_dll_a_001ce500")) () ")")) ([ "[") (binary_expression "iVar8 * 2" (identifier "iVar8") (* "*") (number_literal "2")) (] "]"))) (; ";")) (if_statement "if (pcVar7 == (char *)0x0) goto LAB_00058218;" (if "if") (parenthesized_expression "(pcVar7 == (char *)0x0)" (( "(") (binary_expression "pcVar7 == (char *)0x0" (identifier "pcVar7") (== "==") (cast_expression "(char *)0x0" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (goto_statement "goto LAB_00058218;" (goto "goto") (statement_identifier "LAB_00058218") (; ";"))) (expression_statement "iVar5 = *(int *)(&UNK_001ce504 + iVar8 * 8);" (assignment_expression "iVar5 = *(int *)(&UNK_001ce504 + iVar8 * 8)" (identifier "iVar5") (= "=") (pointer_expression "*(int *)(&UNK_001ce504 + iVar8 * 8)" (* "*") (cast_expression "(int *)(&UNK_001ce504 + iVar8 * 8)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(&UNK_001ce504 + iVar8 * 8)" (( "(") (binary_expression "&UNK_001ce504 + iVar8 * 8" (pointer_expression "&UNK_001ce504" (& "&") (identifier "UNK_001ce504")) (+ "+") (binary_expression "iVar8 * 8" (identifier "iVar8") (* "*") (number_literal "8"))) () ")"))))) (; ";")) (} "}")) (while "while") (parenthesized_expression "( true )" (( "(") (true "true") () ")")) (; ";")) (} "}")))

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

type_1
function_1
          (char *arch,type_2 *search,type_3 *entry)

{
  char *__s;
  size_t var_10;
  size_t var_9;
  size_t var_11;
  char *var_14;
  int var_13;
  type_1 var_16;
  type_4 var_3;
  char *var_4;
  int var_17;
  type_4 var_2;
  type_5 **var_5;
  
  if (((type_6)entry->flags & 3) != 1) {
    return 0;
  }
  __s = entry->filename;
  var_2 = var_1;
  if (var_1 == 0) {
    var_5 = &PTR_s_lib_s_a_001ce510;
    var_3 = 0xb;
    var_4 = "%s.dll.a";
    while( true ) {
      if (var_2 < var_3) {
        var_2 = var_3;
        var_1 = var_3;
      }
      if (var_4 == (char *)0x0) break;
      var_14 = *var_5;
      var_5 = var_5 + 2;
      var_3 = var_6(var_4);
      var_4 = var_14;
    }
  }
  var_10 = var_6(search->name);
  var_9 = var_6(__s);
  var_11 = 0;
  if (var_7 != (char *)0x0) {
    var_11 = var_6(var_7);
  }
  var_17 = 0;
  var_14 = (char *)var_8(var_9 + var_2 + 2 + var_10 + var_11);
  var_12(var_14,"%s/",search->name);
  var_10 = var_6(var_14);
  var_4 = "lib%s.dll.a";
  var_13 = 0;
  do {
    if (var_13 == 0) {
      var_12(var_14 + var_10,var_4,__s);
LAB_00058164:
      var_16 = var_15(var_14,entry);
      if (var_16 != 0) {
        if ((&libname_fmt_12753)[var_17 * 2] != (type_5 *)0x0) {
          entry->filename = var_14;
          return 1;
        }
LAB_00058218:
        var_18(var_14);
        return 0;
      }
    }
    else if (var_7 != (char *)0x0) {
      var_12(var_14 + var_10,var_4,var_7,__s);
      goto LAB_00058164;
    }
    var_17 = var_17 + 1;
    var_4 = (&libname_fmt_12753)[var_17 * 2];
    if (var_4 == (char *)0x0) goto LAB_00058218;
    var_13 = *(int *)(&UNK_001ce504 + var_17 * 8);
  } while( true );
}


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

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

undefined4 MASKED(undefined4 param_1,int param_2,int param_3)

{
  char *__s;
  size_t sVar1;
  size_t sVar2;
  size_t sVar3;
  char *pcVar4;
  int iVar5;
  uint uVar6;
  char *pcVar7;
  int iVar8;
  uint uVar9;
  undefined **ppuVar10;
  
  if ((*(byte *)(param_3 + 0x24) & 3) != 1) {
    return 0;
  }
  __s = *(char **)(param_3 + 8);
  uVar9 = DAT_001d0f84;
  if (DAT_001d0f84 == 0) {
    ppuVar10 = &PTR_s_lib_s_a_001ce510;
    uVar6 = 0xb;
    pcVar7 = "%s.dll.a";
    while( true ) {
      if (uVar9 < uVar6) {
        uVar9 = uVar6;
        DAT_001d0f84 = uVar6;
      }
      if (pcVar7 == (char *)0x0) break;
      pcVar4 = *ppuVar10;
      ppuVar10 = ppuVar10 + 2;
      uVar6 = strlen(pcVar7);
      pcVar7 = pcVar4;
    }
  }
  sVar1 = strlen(*(char **)(param_2 + 4));
  sVar2 = strlen(__s);
  sVar3 = 0;
  if (DAT_001d0f90 != (char *)0x0) {
    sVar3 = strlen(DAT_001d0f90);
  }
  iVar8 = 0;
  pcVar4 = (char *)xmalloc(sVar2 + uVar9 + 2 + sVar1 + sVar3);
  sprintf(pcVar4,"%s/",*(undefined4 *)(param_2 + 4));
  sVar1 = strlen(pcVar4);
  pcVar7 = "lib%s.dll.a";
  iVar5 = 0;
  do {
    if (iVar5 == 0) {
      sprintf(pcVar4 + sVar1,pcVar7,__s);
LAB_00058164:
      iVar5 = FUN_00035320(pcVar4,param_3);
      if (iVar5 != 0) {
        if ((&PTR_s_lib_s_dll_a_001ce500)[iVar8 * 2] != (undefined *)0x0) {
          *(char **)(param_3 + 8) = pcVar4;
          return 1;
        }
LAB_00058218:
        free(pcVar4);
        return 0;
      }
    }
    else if (DAT_001d0f90 != (char *)0x0) {
      sprintf(pcVar4 + sVar1,pcVar7,DAT_001d0f90,__s);
      goto LAB_00058164;
    }
    iVar8 = iVar8 + 1;
    pcVar7 = (&PTR_s_lib_s_dll_a_001ce500)[iVar8 * 2];
    if (pcVar7 == (char *)0x0) goto LAB_00058218;
    iVar5 = *(int *)(&UNK_001ce504 + iVar8 * 8);
  } while( true );
}

