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

int try_tempname_len(char *tmpl,int suffixlen,void *args,_func_int_char_ptr_void_ptr *tryfunc,
                    size_t x_suffix_len)

{
  int *piVar1;
  size_t sVar2;
  int iVar3;
  randint_source *s;
  int iVar4;
  int iVar5;
  char *pcVar6;
  char *pcVar7;
  randint rVar8;
  int local_24;
  
  piVar1 = __errno_location();
  iVar5 = *piVar1;
  sVar2 = strlen(tmpl);
  if (suffixlen + x_suffix_len <= sVar2) {
    iVar3 = sVar2 - (suffixlen + x_suffix_len);
    sVar2 = strspn(tmpl + iVar3,"X");
    if (x_suffix_len <= sVar2) {
      s = randint_all_new((char *)0x0,x_suffix_len);
      if (s == (randint_source *)0x0) {
        return -1;
      }
      local_24 = 0x3a2f8;
      while( true ) {
        pcVar6 = tmpl + iVar3;
        if (x_suffix_len != 0) {
          do {
            pcVar7 = pcVar6 + 1;
            rVar8 = randint_genmax(s,0x3d);
            *pcVar6 = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[(int)rVar8];
            pcVar6 = pcVar7;
          } while (pcVar7 != tmpl + iVar3 + x_suffix_len);
        }
        iVar4 = (*tryfunc)(tmpl,args);
        if (-1 < iVar4) break;
        if (*piVar1 != 0x11) {
          iVar4 = -1;
          iVar5 = *piVar1;
          goto LAB_00022c73;
        }
        local_24 = local_24 + -1;
        if (local_24 == 0) {
          randint_all_free(s);
          *piVar1 = 0x11;
          return -1;
        }
      }
      *piVar1 = iVar5;
LAB_00022c73:
      randint_all_free(s);
      *piVar1 = iVar5;
      return iVar4;
    }
  }
  *piVar1 = 0x16;
  return -1;
}



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

int FUN_00022b40(char *param_1,int param_2,undefined4 param_3,code *param_4,uint param_5)

{
  int *piVar1;
  size_t sVar2;
  int iVar3;
  int iVar4;
  int iVar5;
  int iVar6;
  char *pcVar7;
  char *pcVar8;
  int local_24;
  
  piVar1 = __errno_location();
  iVar6 = *piVar1;
  sVar2 = strlen(param_1);
  if (param_2 + param_5 <= sVar2) {
    iVar3 = sVar2 - (param_2 + param_5);
    sVar2 = strspn(param_1 + iVar3,"X");
    if (param_5 <= sVar2) {
      iVar4 = FUN_0002b1b0(0,param_5);
      if (iVar4 == 0) {
        return -1;
      }
      local_24 = 0x3a2f8;
      while( true ) {
        pcVar7 = param_1 + iVar3;
        if (param_5 != 0) {
          do {
            pcVar8 = pcVar7 + 1;
            iVar5 = FUN_0002b200(iVar4,0x3d,0);
            *pcVar7 = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[iVar5];
            pcVar7 = pcVar8;
          } while (pcVar8 != param_1 + iVar3 + param_5);
        }
        iVar5 = (*param_4)(param_1,param_3);
        if (-1 < iVar5) break;
        if (*piVar1 != 0x11) {
          iVar5 = -1;
          iVar6 = *piVar1;
          goto LAB_00022c73;
        }
        local_24 = local_24 + -1;
        if (local_24 == 0) {
          FUN_0002b6c0(iVar4);
          *piVar1 = 0x11;
          return -1;
        }
      }
      *piVar1 = iVar6;
LAB_00022c73:
      FUN_0002b6c0(iVar4);
      *piVar1 = iVar6;
      return iVar5;
    }
  }
  *piVar1 = 0x16;
  return -1;
}


PUSH EBP
PUSH EDI
PUSH ESI
PUSH EBX
CALL 0x00013960
ADD EBX,0x1a4b7
SUB ESP,0x2c
CALL 0x00012640
SUB ESP,0xc
MOV dword ptr [ESP + 0x1c],EAX
MOV EAX,dword ptr [EAX]
MOV dword ptr [ESP + 0x28],EAX
PUSH dword ptr [ESP + 0x4c]
CALL 0x00012560
ADD ESP,0x10
MOV EDX,dword ptr [ESP + 0x44]
ADD EDX,dword ptr [ESP + 0x50]
CMP EDX,EAX
JA 0x00022c9e
SUB EAX,EDX
SUB ESP,0x8
MOV ESI,EAX
ADD EAX,dword ptr [ESP + 0x48]
MOV dword ptr [ESP + 0x1c],EAX
MOV ECX,EAX
LEA EAX,[EBX + 0xffff4d78]
PUSH EAX
PUSH ECX
CALL 0x000129f0
ADD ESP,0x10
CMP dword ptr [ESP + 0x50],EAX
JA 0x00022c9e
SUB ESP,0x8
PUSH dword ptr [ESP + 0x58]
PUSH 0x0
CALL 0x0002b1b0
ADD ESP,0x10
MOV EBP,EAX
TEST EAX,EAX
JZ 0x00022caf
MOV EDI,dword ptr [ESP + 0x40]
ADD EDI,dword ptr [ESP + 0x50]
MOV dword ptr [ESP + 0x18],0x3a2f8
LEA EAX,[EDI + ESI*0x1]
MOV dword ptr [ESP + 0xc],EAX
LEA ESI,[ESI]
MOV EAX,dword ptr [ESP + 0x50]
MOV ESI,dword ptr [ESP + 0x14]
LEA EDI,[EBX + 0xffff5820]
TEST EAX,EAX
JZ 0x00022c18
LEA ESI,[ESI]
SUB ESP,0x4
ADD ESI,0x1
PUSH 0x0
PUSH 0x3d
PUSH EBP
CALL 0x0002b200
ADD ESP,0x10
MOVZX EAX,byte ptr [EDI + EAX*0x1]
MOV byte ptr [ESI + -0x1],AL
CMP ESI,dword ptr [ESP + 0xc]
JNZ 0x00022bf8
SUB ESP,0x8
PUSH dword ptr [ESP + 0x50]
PUSH dword ptr [ESP + 0x4c]
CALL dword ptr [ESP + 0x5c]
ADD ESP,0x10
TEST EAX,EAX
JNS 0x00022c65
MOV EAX,dword ptr [ESP + 0x10]
MOV EDX,dword ptr [EAX]
CMP EDX,0x11
JNZ 0x00022c97
SUB dword ptr [ESP + 0x18],0x1
JNZ 0x00022be0
SUB ESP,0xc
MOV ESI,0xffffffff
PUSH EBP
CALL 0x0002b6c0
MOV EAX,dword ptr [ESP + 0x20]
ADD ESP,0x10
MOV dword ptr [EAX],0x11
ADD ESP,0x2c
MOV EAX,ESI
POP EBX
POP ESI
POP EDI
POP EBP
RET
MOV ESI,EAX
MOV ECX,dword ptr [ESP + 0x10]
MOV EAX,dword ptr [ESP + 0x1c]
MOV dword ptr [ECX],EAX
MOV EDX,EAX
MOV dword ptr [ESP + 0xc],EDX
SUB ESP,0xc
PUSH EBP
CALL 0x0002b6c0
MOV EAX,dword ptr [ESP + 0x20]
MOV EDX,dword ptr [ESP + 0x1c]
ADD ESP,0x10
MOV dword ptr [EAX],EDX
ADD ESP,0x2c
MOV EAX,ESI
POP EBX
POP ESI
POP EDI
POP EBP
RET
MOV ESI,0xffffffff
JMP 0x00022c73
MOV EAX,dword ptr [ESP + 0x10]
MOV ESI,0xffffffff
MOV dword ptr [EAX],0x16
JMP 0x00022c8d
MOV ESI,0xffffffff
JMP 0x00022c8d
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nint FUN_00022b40(char *param_1,int param_2,undefined4 param_3,code *param_4,uint param_5)\n\n{\n  int *piVar1;\n  size_t sVar2;\n  int iVar3;\n  int iVar4;\n  int iVar5;\n  int iVar6;\n  char *pcVar7;\n  char *pcVar8;\n  int local_24;\n  \n  piVar1 = __errno_location();\n  iVar6 = *piVar1;\n  sVar2 = strlen(param_1);\n  if (param_2 + param_5 <= sVar2) {\n    iVar3 = sVar2 - (param_2 + param_5);\n    sVar2 = strspn(param_1 + iVar3,"X");\n    if (param_5 <= sVar2) {\n      iVar4 = FUN_0002b1b0(0,param_5);\n      if (iVar4 == 0) {\n        return -1;\n      }\n      local_24 = 0x3a2f8;\n      while( true ) {\n        pcVar7 = param_1 + iVar3;\n        if (param_5 != 0) {\n          do {\n            pcVar8 = pcVar7 + 1;\n            iVar5 = FUN_0002b200(iVar4,0x3d,0);\n            *pcVar7 = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[iVar5];\n            pcVar7 = pcVar8;\n          } while (pcVar8 != param_1 + iVar3 + param_5);\n        }\n        iVar5 = (*param_4)(param_1,param_3);\n        if (-1 < iVar5) break;\n        if (*piVar1 != 0x11) {\n          iVar5 = -1;\n          iVar6 = *piVar1;\n          goto LAB_00022c73;\n        }\n        local_24 = local_24 + -1;\n        if (local_24 == 0) {\n          FUN_0002b6c0(iVar4);\n          *piVar1 = 0x11;\n          return -1;\n        }\n      }\n      *piVar1 = iVar6;\nLAB_00022c73:\n      FUN_0002b6c0(iVar4);\n      *piVar1 = iVar6;\n      return iVar5;\n    }\n  }\n  *piVar1 = 0x16;\n  return -1;\n}\n\n" comment (function_definition "int FUN_00022b40(char *param_1,int param_2,undefined4 param_3,code *param_4,uint param_5)\n\n{\n  int *piVar1;\n  size_t sVar2;\n  int iVar3;\n  int iVar4;\n  int iVar5;\n  int iVar6;\n  char *pcVar7;\n  char *pcVar8;\n  int local_24;\n  \n  piVar1 = __errno_location();\n  iVar6 = *piVar1;\n  sVar2 = strlen(param_1);\n  if (param_2 + param_5 <= sVar2) {\n    iVar3 = sVar2 - (param_2 + param_5);\n    sVar2 = strspn(param_1 + iVar3,"X");\n    if (param_5 <= sVar2) {\n      iVar4 = FUN_0002b1b0(0,param_5);\n      if (iVar4 == 0) {\n        return -1;\n      }\n      local_24 = 0x3a2f8;\n      while( true ) {\n        pcVar7 = param_1 + iVar3;\n        if (param_5 != 0) {\n          do {\n            pcVar8 = pcVar7 + 1;\n            iVar5 = FUN_0002b200(iVar4,0x3d,0);\n            *pcVar7 = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[iVar5];\n            pcVar7 = pcVar8;\n          } while (pcVar8 != param_1 + iVar3 + param_5);\n        }\n        iVar5 = (*param_4)(param_1,param_3);\n        if (-1 < iVar5) break;\n        if (*piVar1 != 0x11) {\n          iVar5 = -1;\n          iVar6 = *piVar1;\n          goto LAB_00022c73;\n        }\n        local_24 = local_24 + -1;\n        if (local_24 == 0) {\n          FUN_0002b6c0(iVar4);\n          *piVar1 = 0x11;\n          return -1;\n        }\n      }\n      *piVar1 = iVar6;\nLAB_00022c73:\n      FUN_0002b6c0(iVar4);\n      *piVar1 = iVar6;\n      return iVar5;\n    }\n  }\n  *piVar1 = 0x16;\n  return -1;\n}" primitive_type (function_declarator "FUN_00022b40(char *param_1,int param_2,undefined4 param_3,code *param_4,uint param_5)" identifier (parameter_list "(char *param_1,int param_2,undefined4 param_3,code *param_4,uint param_5)" ( (parameter_declaration "char *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "int param_2" primitive_type identifier) , (parameter_declaration "undefined4 param_3" type_identifier identifier) , (parameter_declaration "code *param_4" type_identifier (pointer_declarator "*param_4" * identifier)) , (parameter_declaration "uint param_5" type_identifier identifier) ))) (compound_statement "{\n  int *piVar1;\n  size_t sVar2;\n  int iVar3;\n  int iVar4;\n  int iVar5;\n  int iVar6;\n  char *pcVar7;\n  char *pcVar8;\n  int local_24;\n  \n  piVar1 = __errno_location();\n  iVar6 = *piVar1;\n  sVar2 = strlen(param_1);\n  if (param_2 + param_5 <= sVar2) {\n    iVar3 = sVar2 - (param_2 + param_5);\n    sVar2 = strspn(param_1 + iVar3,"X");\n    if (param_5 <= sVar2) {\n      iVar4 = FUN_0002b1b0(0,param_5);\n      if (iVar4 == 0) {\n        return -1;\n      }\n      local_24 = 0x3a2f8;\n      while( true ) {\n        pcVar7 = param_1 + iVar3;\n        if (param_5 != 0) {\n          do {\n            pcVar8 = pcVar7 + 1;\n            iVar5 = FUN_0002b200(iVar4,0x3d,0);\n            *pcVar7 = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[iVar5];\n            pcVar7 = pcVar8;\n          } while (pcVar8 != param_1 + iVar3 + param_5);\n        }\n        iVar5 = (*param_4)(param_1,param_3);\n        if (-1 < iVar5) break;\n        if (*piVar1 != 0x11) {\n          iVar5 = -1;\n          iVar6 = *piVar1;\n          goto LAB_00022c73;\n        }\n        local_24 = local_24 + -1;\n        if (local_24 == 0) {\n          FUN_0002b6c0(iVar4);\n          *piVar1 = 0x11;\n          return -1;\n        }\n      }\n      *piVar1 = iVar6;\nLAB_00022c73:\n      FUN_0002b6c0(iVar4);\n      *piVar1 = iVar6;\n      return iVar5;\n    }\n  }\n  *piVar1 = 0x16;\n  return -1;\n}" { (declaration "int *piVar1;" primitive_type (pointer_declarator "*piVar1" * identifier) ;) (declaration "size_t sVar2;" primitive_type identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "int iVar4;" primitive_type identifier ;) (declaration "int iVar5;" primitive_type identifier ;) (declaration "int iVar6;" primitive_type identifier ;) (declaration "char *pcVar7;" primitive_type (pointer_declarator "*pcVar7" * identifier) ;) (declaration "char *pcVar8;" primitive_type (pointer_declarator "*pcVar8" * identifier) ;) (declaration "int local_24;" primitive_type identifier ;) (expression_statement "piVar1 = __errno_location();" (assignment_expression "piVar1 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (expression_statement "iVar6 = *piVar1;" (assignment_expression "iVar6 = *piVar1" identifier = (pointer_expression "*piVar1" * identifier)) ;) (expression_statement "sVar2 = strlen(param_1);" (assignment_expression "sVar2 = strlen(param_1)" identifier = (call_expression "strlen(param_1)" identifier (argument_list "(param_1)" ( identifier )))) ;) (if_statement "if (param_2 + param_5 <= sVar2) {\n    iVar3 = sVar2 - (param_2 + param_5);\n    sVar2 = strspn(param_1 + iVar3,"X");\n    if (param_5 <= sVar2) {\n      iVar4 = FUN_0002b1b0(0,param_5);\n      if (iVar4 == 0) {\n        return -1;\n      }\n      local_24 = 0x3a2f8;\n      while( true ) {\n        pcVar7 = param_1 + iVar3;\n        if (param_5 != 0) {\n          do {\n            pcVar8 = pcVar7 + 1;\n            iVar5 = FUN_0002b200(iVar4,0x3d,0);\n            *pcVar7 = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[iVar5];\n            pcVar7 = pcVar8;\n          } while (pcVar8 != param_1 + iVar3 + param_5);\n        }\n        iVar5 = (*param_4)(param_1,param_3);\n        if (-1 < iVar5) break;\n        if (*piVar1 != 0x11) {\n          iVar5 = -1;\n          iVar6 = *piVar1;\n          goto LAB_00022c73;\n        }\n        local_24 = local_24 + -1;\n        if (local_24 == 0) {\n          FUN_0002b6c0(iVar4);\n          *piVar1 = 0x11;\n          return -1;\n        }\n      }\n      *piVar1 = iVar6;\nLAB_00022c73:\n      FUN_0002b6c0(iVar4);\n      *piVar1 = iVar6;\n      return iVar5;\n    }\n  }" if (parenthesized_expression "(param_2 + param_5 <= sVar2)" ( (binary_expression "param_2 + param_5 <= sVar2" (binary_expression "param_2 + param_5" identifier + identifier) <= identifier) )) (compound_statement "{\n    iVar3 = sVar2 - (param_2 + param_5);\n    sVar2 = strspn(param_1 + iVar3,"X");\n    if (param_5 <= sVar2) {\n      iVar4 = FUN_0002b1b0(0,param_5);\n      if (iVar4 == 0) {\n        return -1;\n      }\n      local_24 = 0x3a2f8;\n      while( true ) {\n        pcVar7 = param_1 + iVar3;\n        if (param_5 != 0) {\n          do {\n            pcVar8 = pcVar7 + 1;\n            iVar5 = FUN_0002b200(iVar4,0x3d,0);\n            *pcVar7 = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[iVar5];\n            pcVar7 = pcVar8;\n          } while (pcVar8 != param_1 + iVar3 + param_5);\n        }\n        iVar5 = (*param_4)(param_1,param_3);\n        if (-1 < iVar5) break;\n        if (*piVar1 != 0x11) {\n          iVar5 = -1;\n          iVar6 = *piVar1;\n          goto LAB_00022c73;\n        }\n        local_24 = local_24 + -1;\n        if (local_24 == 0) {\n          FUN_0002b6c0(iVar4);\n          *piVar1 = 0x11;\n          return -1;\n        }\n      }\n      *piVar1 = iVar6;\nLAB_00022c73:\n      FUN_0002b6c0(iVar4);\n      *piVar1 = iVar6;\n      return iVar5;\n    }\n  }" { (expression_statement "iVar3 = sVar2 - (param_2 + param_5);" (assignment_expression "iVar3 = sVar2 - (param_2 + param_5)" identifier = (binary_expression "sVar2 - (param_2 + param_5)" identifier - (parenthesized_expression "(param_2 + param_5)" ( (binary_expression "param_2 + param_5" identifier + identifier) )))) ;) (expression_statement "sVar2 = strspn(param_1 + iVar3,"X");" (assignment_expression "sVar2 = strspn(param_1 + iVar3,"X")" identifier = (call_expression "strspn(param_1 + iVar3,"X")" identifier (argument_list "(param_1 + iVar3,"X")" ( (binary_expression "param_1 + iVar3" identifier + identifier) , (string_literal ""X"" " string_content ") )))) ;) (if_statement "if (param_5 <= sVar2) {\n      iVar4 = FUN_0002b1b0(0,param_5);\n      if (iVar4 == 0) {\n        return -1;\n      }\n      local_24 = 0x3a2f8;\n      while( true ) {\n        pcVar7 = param_1 + iVar3;\n        if (param_5 != 0) {\n          do {\n            pcVar8 = pcVar7 + 1;\n            iVar5 = FUN_0002b200(iVar4,0x3d,0);\n            *pcVar7 = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[iVar5];\n            pcVar7 = pcVar8;\n          } while (pcVar8 != param_1 + iVar3 + param_5);\n        }\n        iVar5 = (*param_4)(param_1,param_3);\n        if (-1 < iVar5) break;\n        if (*piVar1 != 0x11) {\n          iVar5 = -1;\n          iVar6 = *piVar1;\n          goto LAB_00022c73;\n        }\n        local_24 = local_24 + -1;\n        if (local_24 == 0) {\n          FUN_0002b6c0(iVar4);\n          *piVar1 = 0x11;\n          return -1;\n        }\n      }\n      *piVar1 = iVar6;\nLAB_00022c73:\n      FUN_0002b6c0(iVar4);\n      *piVar1 = iVar6;\n      return iVar5;\n    }" if (parenthesized_expression "(param_5 <= sVar2)" ( (binary_expression "param_5 <= sVar2" identifier <= identifier) )) (compound_statement "{\n      iVar4 = FUN_0002b1b0(0,param_5);\n      if (iVar4 == 0) {\n        return -1;\n      }\n      local_24 = 0x3a2f8;\n      while( true ) {\n        pcVar7 = param_1 + iVar3;\n        if (param_5 != 0) {\n          do {\n            pcVar8 = pcVar7 + 1;\n            iVar5 = FUN_0002b200(iVar4,0x3d,0);\n            *pcVar7 = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[iVar5];\n            pcVar7 = pcVar8;\n          } while (pcVar8 != param_1 + iVar3 + param_5);\n        }\n        iVar5 = (*param_4)(param_1,param_3);\n        if (-1 < iVar5) break;\n        if (*piVar1 != 0x11) {\n          iVar5 = -1;\n          iVar6 = *piVar1;\n          goto LAB_00022c73;\n        }\n        local_24 = local_24 + -1;\n        if (local_24 == 0) {\n          FUN_0002b6c0(iVar4);\n          *piVar1 = 0x11;\n          return -1;\n        }\n      }\n      *piVar1 = iVar6;\nLAB_00022c73:\n      FUN_0002b6c0(iVar4);\n      *piVar1 = iVar6;\n      return iVar5;\n    }" { (expression_statement "iVar4 = FUN_0002b1b0(0,param_5);" (assignment_expression "iVar4 = FUN_0002b1b0(0,param_5)" identifier = (call_expression "FUN_0002b1b0(0,param_5)" identifier (argument_list "(0,param_5)" ( number_literal , identifier )))) ;) (if_statement "if (iVar4 == 0) {\n        return -1;\n      }" if (parenthesized_expression "(iVar4 == 0)" ( (binary_expression "iVar4 == 0" identifier == number_literal) )) (compound_statement "{\n        return -1;\n      }" { (return_statement "return -1;" return number_literal ;) })) (expression_statement "local_24 = 0x3a2f8;" (assignment_expression "local_24 = 0x3a2f8" identifier = number_literal) ;) (while_statement "while( true ) {\n        pcVar7 = param_1 + iVar3;\n        if (param_5 != 0) {\n          do {\n            pcVar8 = pcVar7 + 1;\n            iVar5 = FUN_0002b200(iVar4,0x3d,0);\n            *pcVar7 = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[iVar5];\n            pcVar7 = pcVar8;\n          } while (pcVar8 != param_1 + iVar3 + param_5);\n        }\n        iVar5 = (*param_4)(param_1,param_3);\n        if (-1 < iVar5) break;\n        if (*piVar1 != 0x11) {\n          iVar5 = -1;\n          iVar6 = *piVar1;\n          goto LAB_00022c73;\n        }\n        local_24 = local_24 + -1;\n        if (local_24 == 0) {\n          FUN_0002b6c0(iVar4);\n          *piVar1 = 0x11;\n          return -1;\n        }\n      }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n        pcVar7 = param_1 + iVar3;\n        if (param_5 != 0) {\n          do {\n            pcVar8 = pcVar7 + 1;\n            iVar5 = FUN_0002b200(iVar4,0x3d,0);\n            *pcVar7 = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[iVar5];\n            pcVar7 = pcVar8;\n          } while (pcVar8 != param_1 + iVar3 + param_5);\n        }\n        iVar5 = (*param_4)(param_1,param_3);\n        if (-1 < iVar5) break;\n        if (*piVar1 != 0x11) {\n          iVar5 = -1;\n          iVar6 = *piVar1;\n          goto LAB_00022c73;\n        }\n        local_24 = local_24 + -1;\n        if (local_24 == 0) {\n          FUN_0002b6c0(iVar4);\n          *piVar1 = 0x11;\n          return -1;\n        }\n      }" { (expression_statement "pcVar7 = param_1 + iVar3;" (assignment_expression "pcVar7 = param_1 + iVar3" identifier = (binary_expression "param_1 + iVar3" identifier + identifier)) ;) (if_statement "if (param_5 != 0) {\n          do {\n            pcVar8 = pcVar7 + 1;\n            iVar5 = FUN_0002b200(iVar4,0x3d,0);\n            *pcVar7 = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[iVar5];\n            pcVar7 = pcVar8;\n          } while (pcVar8 != param_1 + iVar3 + param_5);\n        }" if (parenthesized_expression "(param_5 != 0)" ( (binary_expression "param_5 != 0" identifier != number_literal) )) (compound_statement "{\n          do {\n            pcVar8 = pcVar7 + 1;\n            iVar5 = FUN_0002b200(iVar4,0x3d,0);\n            *pcVar7 = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[iVar5];\n            pcVar7 = pcVar8;\n          } while (pcVar8 != param_1 + iVar3 + param_5);\n        }" { (do_statement "do {\n            pcVar8 = pcVar7 + 1;\n            iVar5 = FUN_0002b200(iVar4,0x3d,0);\n            *pcVar7 = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[iVar5];\n            pcVar7 = pcVar8;\n          } while (pcVar8 != param_1 + iVar3 + param_5);" do (compound_statement "{\n            pcVar8 = pcVar7 + 1;\n            iVar5 = FUN_0002b200(iVar4,0x3d,0);\n            *pcVar7 = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[iVar5];\n            pcVar7 = pcVar8;\n          }" { (expression_statement "pcVar8 = pcVar7 + 1;" (assignment_expression "pcVar8 = pcVar7 + 1" identifier = (binary_expression "pcVar7 + 1" identifier + number_literal)) ;) (expression_statement "iVar5 = FUN_0002b200(iVar4,0x3d,0);" (assignment_expression "iVar5 = FUN_0002b200(iVar4,0x3d,0)" identifier = (call_expression "FUN_0002b200(iVar4,0x3d,0)" identifier (argument_list "(iVar4,0x3d,0)" ( identifier , number_literal , number_literal )))) ;) (expression_statement "*pcVar7 = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[iVar5];" (assignment_expression "*pcVar7 = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[iVar5]" (pointer_expression "*pcVar7" * identifier) = (subscript_expression ""abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[iVar5]" (string_literal ""abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"" " string_content ") [ identifier ])) ;) (expression_statement "pcVar7 = pcVar8;" (assignment_expression "pcVar7 = pcVar8" identifier = identifier) ;) }) while (parenthesized_expression "(pcVar8 != param_1 + iVar3 + param_5)" ( (binary_expression "pcVar8 != param_1 + iVar3 + param_5" identifier != (binary_expression "param_1 + iVar3 + param_5" (binary_expression "param_1 + iVar3" identifier + identifier) + identifier)) )) ;) })) (expression_statement "iVar5 = (*param_4)(param_1,param_3);" (assignment_expression "iVar5 = (*param_4)(param_1,param_3)" identifier = (call_expression "(*param_4)(param_1,param_3)" (parenthesized_expression "(*param_4)" ( (pointer_expression "*param_4" * identifier) )) (argument_list "(param_1,param_3)" ( identifier , identifier )))) ;) (if_statement "if (-1 < iVar5) break;" if (parenthesized_expression "(-1 < iVar5)" ( (binary_expression "-1 < iVar5" number_literal < identifier) )) (break_statement "break;" break ;)) (if_statement "if (*piVar1 != 0x11) {\n          iVar5 = -1;\n          iVar6 = *piVar1;\n          goto LAB_00022c73;\n        }" if (parenthesized_expression "(*piVar1 != 0x11)" ( (binary_expression "*piVar1 != 0x11" (pointer_expression "*piVar1" * identifier) != number_literal) )) (compound_statement "{\n          iVar5 = -1;\n          iVar6 = *piVar1;\n          goto LAB_00022c73;\n        }" { (expression_statement "iVar5 = -1;" (assignment_expression "iVar5 = -1" identifier = number_literal) ;) (expression_statement "iVar6 = *piVar1;" (assignment_expression "iVar6 = *piVar1" identifier = (pointer_expression "*piVar1" * identifier)) ;) (goto_statement "goto LAB_00022c73;" goto statement_identifier ;) })) (expression_statement "local_24 = local_24 + -1;" (assignment_expression "local_24 = local_24 + -1" identifier = (binary_expression "local_24 + -1" identifier + number_literal)) ;) (if_statement "if (local_24 == 0) {\n          FUN_0002b6c0(iVar4);\n          *piVar1 = 0x11;\n          return -1;\n        }" if (parenthesized_expression "(local_24 == 0)" ( (binary_expression "local_24 == 0" identifier == number_literal) )) (compound_statement "{\n          FUN_0002b6c0(iVar4);\n          *piVar1 = 0x11;\n          return -1;\n        }" { (expression_statement "FUN_0002b6c0(iVar4);" (call_expression "FUN_0002b6c0(iVar4)" identifier (argument_list "(iVar4)" ( identifier ))) ;) (expression_statement "*piVar1 = 0x11;" (assignment_expression "*piVar1 = 0x11" (pointer_expression "*piVar1" * identifier) = number_literal) ;) (return_statement "return -1;" return number_literal ;) })) })) (expression_statement "*piVar1 = iVar6;" (assignment_expression "*piVar1 = iVar6" (pointer_expression "*piVar1" * identifier) = identifier) ;) (labeled_statement "LAB_00022c73:\n      FUN_0002b6c0(iVar4);" statement_identifier : (expression_statement "FUN_0002b6c0(iVar4);" (call_expression "FUN_0002b6c0(iVar4)" identifier (argument_list "(iVar4)" ( identifier ))) ;)) (expression_statement "*piVar1 = iVar6;" (assignment_expression "*piVar1 = iVar6" (pointer_expression "*piVar1" * identifier) = identifier) ;) (return_statement "return iVar5;" return identifier ;) })) })) (expression_statement "*piVar1 = 0x16;" (assignment_expression "*piVar1 = 0x16" (pointer_expression "*piVar1" * identifier) = number_literal) ;) (return_statement "return -1;" return number_literal ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* WARNING: Unknown calling convention */\n\nint try_tempname_len(char *tmpl,int suffixlen,void *args,_func_int_char_ptr_void_ptr *tryfunc,\n                    size_t x_suffix_len)\n\n{\n  int *piVar1;\n  size_t sVar2;\n  int iVar3;\n  randint_source *s;\n  int iVar4;\n  int iVar5;\n  char *pcVar6;\n  char *pcVar7;\n  randint rVar8;\n  int local_24;\n  \n  piVar1 = __errno_location();\n  iVar5 = *piVar1;\n  sVar2 = strlen(tmpl);\n  if (suffixlen + x_suffix_len <= sVar2) {\n    iVar3 = sVar2 - (suffixlen + x_suffix_len);\n    sVar2 = strspn(tmpl + iVar3,"X");\n    if (x_suffix_len <= sVar2) {\n      s = randint_all_new((char *)0x0,x_suffix_len);\n      if (s == (randint_source *)0x0) {\n        return -1;\n      }\n      local_24 = 0x3a2f8;\n      while( true ) {\n        pcVar6 = tmpl + iVar3;\n        if (x_suffix_len != 0) {\n          do {\n            pcVar7 = pcVar6 + 1;\n            rVar8 = randint_genmax(s,0x3d);\n            *pcVar6 = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[(int)rVar8];\n            pcVar6 = pcVar7;\n          } while (pcVar7 != tmpl + iVar3 + x_suffix_len);\n        }\n        iVar4 = (*tryfunc)(tmpl,args);\n        if (-1 < iVar4) break;\n        if (*piVar1 != 0x11) {\n          iVar4 = -1;\n          iVar5 = *piVar1;\n          goto LAB_00022c73;\n        }\n        local_24 = local_24 + -1;\n        if (local_24 == 0) {\n          randint_all_free(s);\n          *piVar1 = 0x11;\n          return -1;\n        }\n      }\n      *piVar1 = iVar5;\nLAB_00022c73:\n      randint_all_free(s);\n      *piVar1 = iVar5;\n      return iVar4;\n    }\n  }\n  *piVar1 = 0x16;\n  return -1;\n}\n\n" comment comment (function_definition "int try_tempname_len(char *tmpl,int suffixlen,void *args,_func_int_char_ptr_void_ptr *tryfunc,\n                    size_t x_suffix_len)\n\n{\n  int *piVar1;\n  size_t sVar2;\n  int iVar3;\n  randint_source *s;\n  int iVar4;\n  int iVar5;\n  char *pcVar6;\n  char *pcVar7;\n  randint rVar8;\n  int local_24;\n  \n  piVar1 = __errno_location();\n  iVar5 = *piVar1;\n  sVar2 = strlen(tmpl);\n  if (suffixlen + x_suffix_len <= sVar2) {\n    iVar3 = sVar2 - (suffixlen + x_suffix_len);\n    sVar2 = strspn(tmpl + iVar3,"X");\n    if (x_suffix_len <= sVar2) {\n      s = randint_all_new((char *)0x0,x_suffix_len);\n      if (s == (randint_source *)0x0) {\n        return -1;\n      }\n      local_24 = 0x3a2f8;\n      while( true ) {\n        pcVar6 = tmpl + iVar3;\n        if (x_suffix_len != 0) {\n          do {\n            pcVar7 = pcVar6 + 1;\n            rVar8 = randint_genmax(s,0x3d);\n            *pcVar6 = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[(int)rVar8];\n            pcVar6 = pcVar7;\n          } while (pcVar7 != tmpl + iVar3 + x_suffix_len);\n        }\n        iVar4 = (*tryfunc)(tmpl,args);\n        if (-1 < iVar4) break;\n        if (*piVar1 != 0x11) {\n          iVar4 = -1;\n          iVar5 = *piVar1;\n          goto LAB_00022c73;\n        }\n        local_24 = local_24 + -1;\n        if (local_24 == 0) {\n          randint_all_free(s);\n          *piVar1 = 0x11;\n          return -1;\n        }\n      }\n      *piVar1 = iVar5;\nLAB_00022c73:\n      randint_all_free(s);\n      *piVar1 = iVar5;\n      return iVar4;\n    }\n  }\n  *piVar1 = 0x16;\n  return -1;\n}" primitive_type (function_declarator "try_tempname_len(char *tmpl,int suffixlen,void *args,_func_int_char_ptr_void_ptr *tryfunc,\n                    size_t x_suffix_len)" identifier (parameter_list "(char *tmpl,int suffixlen,void *args,_func_int_char_ptr_void_ptr *tryfunc,\n                    size_t x_suffix_len)" ( (parameter_declaration "char *tmpl" primitive_type (pointer_declarator "*tmpl" * identifier)) , (parameter_declaration "int suffixlen" primitive_type identifier) , (parameter_declaration "void *args" primitive_type (pointer_declarator "*args" * identifier)) , (parameter_declaration "_func_int_char_ptr_void_ptr *tryfunc" type_identifier (pointer_declarator "*tryfunc" * identifier)) , (parameter_declaration "size_t x_suffix_len" primitive_type identifier) ))) (compound_statement "{\n  int *piVar1;\n  size_t sVar2;\n  int iVar3;\n  randint_source *s;\n  int iVar4;\n  int iVar5;\n  char *pcVar6;\n  char *pcVar7;\n  randint rVar8;\n  int local_24;\n  \n  piVar1 = __errno_location();\n  iVar5 = *piVar1;\n  sVar2 = strlen(tmpl);\n  if (suffixlen + x_suffix_len <= sVar2) {\n    iVar3 = sVar2 - (suffixlen + x_suffix_len);\n    sVar2 = strspn(tmpl + iVar3,"X");\n    if (x_suffix_len <= sVar2) {\n      s = randint_all_new((char *)0x0,x_suffix_len);\n      if (s == (randint_source *)0x0) {\n        return -1;\n      }\n      local_24 = 0x3a2f8;\n      while( true ) {\n        pcVar6 = tmpl + iVar3;\n        if (x_suffix_len != 0) {\n          do {\n            pcVar7 = pcVar6 + 1;\n            rVar8 = randint_genmax(s,0x3d);\n            *pcVar6 = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[(int)rVar8];\n            pcVar6 = pcVar7;\n          } while (pcVar7 != tmpl + iVar3 + x_suffix_len);\n        }\n        iVar4 = (*tryfunc)(tmpl,args);\n        if (-1 < iVar4) break;\n        if (*piVar1 != 0x11) {\n          iVar4 = -1;\n          iVar5 = *piVar1;\n          goto LAB_00022c73;\n        }\n        local_24 = local_24 + -1;\n        if (local_24 == 0) {\n          randint_all_free(s);\n          *piVar1 = 0x11;\n          return -1;\n        }\n      }\n      *piVar1 = iVar5;\nLAB_00022c73:\n      randint_all_free(s);\n      *piVar1 = iVar5;\n      return iVar4;\n    }\n  }\n  *piVar1 = 0x16;\n  return -1;\n}" { (declaration "int *piVar1;" primitive_type (pointer_declarator "*piVar1" * identifier) ;) (declaration "size_t sVar2;" primitive_type identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "randint_source *s;" type_identifier (pointer_declarator "*s" * identifier) ;) (declaration "int iVar4;" primitive_type identifier ;) (declaration "int iVar5;" primitive_type identifier ;) (declaration "char *pcVar6;" primitive_type (pointer_declarator "*pcVar6" * identifier) ;) (declaration "char *pcVar7;" primitive_type (pointer_declarator "*pcVar7" * identifier) ;) (declaration "randint rVar8;" type_identifier identifier ;) (declaration "int local_24;" primitive_type identifier ;) (expression_statement "piVar1 = __errno_location();" (assignment_expression "piVar1 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (expression_statement "iVar5 = *piVar1;" (assignment_expression "iVar5 = *piVar1" identifier = (pointer_expression "*piVar1" * identifier)) ;) (expression_statement "sVar2 = strlen(tmpl);" (assignment_expression "sVar2 = strlen(tmpl)" identifier = (call_expression "strlen(tmpl)" identifier (argument_list "(tmpl)" ( identifier )))) ;) (if_statement "if (suffixlen + x_suffix_len <= sVar2) {\n    iVar3 = sVar2 - (suffixlen + x_suffix_len);\n    sVar2 = strspn(tmpl + iVar3,"X");\n    if (x_suffix_len <= sVar2) {\n      s = randint_all_new((char *)0x0,x_suffix_len);\n      if (s == (randint_source *)0x0) {\n        return -1;\n      }\n      local_24 = 0x3a2f8;\n      while( true ) {\n        pcVar6 = tmpl + iVar3;\n        if (x_suffix_len != 0) {\n          do {\n            pcVar7 = pcVar6 + 1;\n            rVar8 = randint_genmax(s,0x3d);\n            *pcVar6 = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[(int)rVar8];\n            pcVar6 = pcVar7;\n          } while (pcVar7 != tmpl + iVar3 + x_suffix_len);\n        }\n        iVar4 = (*tryfunc)(tmpl,args);\n        if (-1 < iVar4) break;\n        if (*piVar1 != 0x11) {\n          iVar4 = -1;\n          iVar5 = *piVar1;\n          goto LAB_00022c73;\n        }\n        local_24 = local_24 + -1;\n        if (local_24 == 0) {\n          randint_all_free(s);\n          *piVar1 = 0x11;\n          return -1;\n        }\n      }\n      *piVar1 = iVar5;\nLAB_00022c73:\n      randint_all_free(s);\n      *piVar1 = iVar5;\n      return iVar4;\n    }\n  }" if (parenthesized_expression "(suffixlen + x_suffix_len <= sVar2)" ( (binary_expression "suffixlen + x_suffix_len <= sVar2" (binary_expression "suffixlen + x_suffix_len" identifier + identifier) <= identifier) )) (compound_statement "{\n    iVar3 = sVar2 - (suffixlen + x_suffix_len);\n    sVar2 = strspn(tmpl + iVar3,"X");\n    if (x_suffix_len <= sVar2) {\n      s = randint_all_new((char *)0x0,x_suffix_len);\n      if (s == (randint_source *)0x0) {\n        return -1;\n      }\n      local_24 = 0x3a2f8;\n      while( true ) {\n        pcVar6 = tmpl + iVar3;\n        if (x_suffix_len != 0) {\n          do {\n            pcVar7 = pcVar6 + 1;\n            rVar8 = randint_genmax(s,0x3d);\n            *pcVar6 = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[(int)rVar8];\n            pcVar6 = pcVar7;\n          } while (pcVar7 != tmpl + iVar3 + x_suffix_len);\n        }\n        iVar4 = (*tryfunc)(tmpl,args);\n        if (-1 < iVar4) break;\n        if (*piVar1 != 0x11) {\n          iVar4 = -1;\n          iVar5 = *piVar1;\n          goto LAB_00022c73;\n        }\n        local_24 = local_24 + -1;\n        if (local_24 == 0) {\n          randint_all_free(s);\n          *piVar1 = 0x11;\n          return -1;\n        }\n      }\n      *piVar1 = iVar5;\nLAB_00022c73:\n      randint_all_free(s);\n      *piVar1 = iVar5;\n      return iVar4;\n    }\n  }" { (expression_statement "iVar3 = sVar2 - (suffixlen + x_suffix_len);" (assignment_expression "iVar3 = sVar2 - (suffixlen + x_suffix_len)" identifier = (binary_expression "sVar2 - (suffixlen + x_suffix_len)" identifier - (parenthesized_expression "(suffixlen + x_suffix_len)" ( (binary_expression "suffixlen + x_suffix_len" identifier + identifier) )))) ;) (expression_statement "sVar2 = strspn(tmpl + iVar3,"X");" (assignment_expression "sVar2 = strspn(tmpl + iVar3,"X")" identifier = (call_expression "strspn(tmpl + iVar3,"X")" identifier (argument_list "(tmpl + iVar3,"X")" ( (binary_expression "tmpl + iVar3" identifier + identifier) , (string_literal ""X"" " string_content ") )))) ;) (if_statement "if (x_suffix_len <= sVar2) {\n      s = randint_all_new((char *)0x0,x_suffix_len);\n      if (s == (randint_source *)0x0) {\n        return -1;\n      }\n      local_24 = 0x3a2f8;\n      while( true ) {\n        pcVar6 = tmpl + iVar3;\n        if (x_suffix_len != 0) {\n          do {\n            pcVar7 = pcVar6 + 1;\n            rVar8 = randint_genmax(s,0x3d);\n            *pcVar6 = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[(int)rVar8];\n            pcVar6 = pcVar7;\n          } while (pcVar7 != tmpl + iVar3 + x_suffix_len);\n        }\n        iVar4 = (*tryfunc)(tmpl,args);\n        if (-1 < iVar4) break;\n        if (*piVar1 != 0x11) {\n          iVar4 = -1;\n          iVar5 = *piVar1;\n          goto LAB_00022c73;\n        }\n        local_24 = local_24 + -1;\n        if (local_24 == 0) {\n          randint_all_free(s);\n          *piVar1 = 0x11;\n          return -1;\n        }\n      }\n      *piVar1 = iVar5;\nLAB_00022c73:\n      randint_all_free(s);\n      *piVar1 = iVar5;\n      return iVar4;\n    }" if (parenthesized_expression "(x_suffix_len <= sVar2)" ( (binary_expression "x_suffix_len <= sVar2" identifier <= identifier) )) (compound_statement "{\n      s = randint_all_new((char *)0x0,x_suffix_len);\n      if (s == (randint_source *)0x0) {\n        return -1;\n      }\n      local_24 = 0x3a2f8;\n      while( true ) {\n        pcVar6 = tmpl + iVar3;\n        if (x_suffix_len != 0) {\n          do {\n            pcVar7 = pcVar6 + 1;\n            rVar8 = randint_genmax(s,0x3d);\n            *pcVar6 = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[(int)rVar8];\n            pcVar6 = pcVar7;\n          } while (pcVar7 != tmpl + iVar3 + x_suffix_len);\n        }\n        iVar4 = (*tryfunc)(tmpl,args);\n        if (-1 < iVar4) break;\n        if (*piVar1 != 0x11) {\n          iVar4 = -1;\n          iVar5 = *piVar1;\n          goto LAB_00022c73;\n        }\n        local_24 = local_24 + -1;\n        if (local_24 == 0) {\n          randint_all_free(s);\n          *piVar1 = 0x11;\n          return -1;\n        }\n      }\n      *piVar1 = iVar5;\nLAB_00022c73:\n      randint_all_free(s);\n      *piVar1 = iVar5;\n      return iVar4;\n    }" { (expression_statement "s = randint_all_new((char *)0x0,x_suffix_len);" (assignment_expression "s = randint_all_new((char *)0x0,x_suffix_len)" identifier = (call_expression "randint_all_new((char *)0x0,x_suffix_len)" identifier (argument_list "((char *)0x0,x_suffix_len)" ( (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal) , identifier )))) ;) (if_statement "if (s == (randint_source *)0x0) {\n        return -1;\n      }" if (parenthesized_expression "(s == (randint_source *)0x0)" ( (binary_expression "s == (randint_source *)0x0" identifier == (cast_expression "(randint_source *)0x0" ( (type_descriptor "randint_source *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n        return -1;\n      }" { (return_statement "return -1;" return number_literal ;) })) (expression_statement "local_24 = 0x3a2f8;" (assignment_expression "local_24 = 0x3a2f8" identifier = number_literal) ;) (while_statement "while( true ) {\n        pcVar6 = tmpl + iVar3;\n        if (x_suffix_len != 0) {\n          do {\n            pcVar7 = pcVar6 + 1;\n            rVar8 = randint_genmax(s,0x3d);\n            *pcVar6 = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[(int)rVar8];\n            pcVar6 = pcVar7;\n          } while (pcVar7 != tmpl + iVar3 + x_suffix_len);\n        }\n        iVar4 = (*tryfunc)(tmpl,args);\n        if (-1 < iVar4) break;\n        if (*piVar1 != 0x11) {\n          iVar4 = -1;\n          iVar5 = *piVar1;\n          goto LAB_00022c73;\n        }\n        local_24 = local_24 + -1;\n        if (local_24 == 0) {\n          randint_all_free(s);\n          *piVar1 = 0x11;\n          return -1;\n        }\n      }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n        pcVar6 = tmpl + iVar3;\n        if (x_suffix_len != 0) {\n          do {\n            pcVar7 = pcVar6 + 1;\n            rVar8 = randint_genmax(s,0x3d);\n            *pcVar6 = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[(int)rVar8];\n            pcVar6 = pcVar7;\n          } while (pcVar7 != tmpl + iVar3 + x_suffix_len);\n        }\n        iVar4 = (*tryfunc)(tmpl,args);\n        if (-1 < iVar4) break;\n        if (*piVar1 != 0x11) {\n          iVar4 = -1;\n          iVar5 = *piVar1;\n          goto LAB_00022c73;\n        }\n        local_24 = local_24 + -1;\n        if (local_24 == 0) {\n          randint_all_free(s);\n          *piVar1 = 0x11;\n          return -1;\n        }\n      }" { (expression_statement "pcVar6 = tmpl + iVar3;" (assignment_expression "pcVar6 = tmpl + iVar3" identifier = (binary_expression "tmpl + iVar3" identifier + identifier)) ;) (if_statement "if (x_suffix_len != 0) {\n          do {\n            pcVar7 = pcVar6 + 1;\n            rVar8 = randint_genmax(s,0x3d);\n            *pcVar6 = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[(int)rVar8];\n            pcVar6 = pcVar7;\n          } while (pcVar7 != tmpl + iVar3 + x_suffix_len);\n        }" if (parenthesized_expression "(x_suffix_len != 0)" ( (binary_expression "x_suffix_len != 0" identifier != number_literal) )) (compound_statement "{\n          do {\n            pcVar7 = pcVar6 + 1;\n            rVar8 = randint_genmax(s,0x3d);\n            *pcVar6 = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[(int)rVar8];\n            pcVar6 = pcVar7;\n          } while (pcVar7 != tmpl + iVar3 + x_suffix_len);\n        }" { (do_statement "do {\n            pcVar7 = pcVar6 + 1;\n            rVar8 = randint_genmax(s,0x3d);\n            *pcVar6 = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[(int)rVar8];\n            pcVar6 = pcVar7;\n          } while (pcVar7 != tmpl + iVar3 + x_suffix_len);" do (compound_statement "{\n            pcVar7 = pcVar6 + 1;\n            rVar8 = randint_genmax(s,0x3d);\n            *pcVar6 = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[(int)rVar8];\n            pcVar6 = pcVar7;\n          }" { (expression_statement "pcVar7 = pcVar6 + 1;" (assignment_expression "pcVar7 = pcVar6 + 1" identifier = (binary_expression "pcVar6 + 1" identifier + number_literal)) ;) (expression_statement "rVar8 = randint_genmax(s,0x3d);" (assignment_expression "rVar8 = randint_genmax(s,0x3d)" identifier = (call_expression "randint_genmax(s,0x3d)" identifier (argument_list "(s,0x3d)" ( identifier , number_literal )))) ;) (expression_statement "*pcVar6 = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[(int)rVar8];" (assignment_expression "*pcVar6 = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[(int)rVar8]" (pointer_expression "*pcVar6" * identifier) = (subscript_expression ""abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[(int)rVar8]" (string_literal ""abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"" " string_content ") [ (cast_expression "(int)rVar8" ( (type_descriptor "int" primitive_type) ) identifier) ])) ;) (expression_statement "pcVar6 = pcVar7;" (assignment_expression "pcVar6 = pcVar7" identifier = identifier) ;) }) while (parenthesized_expression "(pcVar7 != tmpl + iVar3 + x_suffix_len)" ( (binary_expression "pcVar7 != tmpl + iVar3 + x_suffix_len" identifier != (binary_expression "tmpl + iVar3 + x_suffix_len" (binary_expression "tmpl + iVar3" identifier + identifier) + identifier)) )) ;) })) (expression_statement "iVar4 = (*tryfunc)(tmpl,args);" (assignment_expression "iVar4 = (*tryfunc)(tmpl,args)" identifier = (call_expression "(*tryfunc)(tmpl,args)" (parenthesized_expression "(*tryfunc)" ( (pointer_expression "*tryfunc" * identifier) )) (argument_list "(tmpl,args)" ( identifier , identifier )))) ;) (if_statement "if (-1 < iVar4) break;" if (parenthesized_expression "(-1 < iVar4)" ( (binary_expression "-1 < iVar4" number_literal < identifier) )) (break_statement "break;" break ;)) (if_statement "if (*piVar1 != 0x11) {\n          iVar4 = -1;\n          iVar5 = *piVar1;\n          goto LAB_00022c73;\n        }" if (parenthesized_expression "(*piVar1 != 0x11)" ( (binary_expression "*piVar1 != 0x11" (pointer_expression "*piVar1" * identifier) != number_literal) )) (compound_statement "{\n          iVar4 = -1;\n          iVar5 = *piVar1;\n          goto LAB_00022c73;\n        }" { (expression_statement "iVar4 = -1;" (assignment_expression "iVar4 = -1" identifier = number_literal) ;) (expression_statement "iVar5 = *piVar1;" (assignment_expression "iVar5 = *piVar1" identifier = (pointer_expression "*piVar1" * identifier)) ;) (goto_statement "goto LAB_00022c73;" goto statement_identifier ;) })) (expression_statement "local_24 = local_24 + -1;" (assignment_expression "local_24 = local_24 + -1" identifier = (binary_expression "local_24 + -1" identifier + number_literal)) ;) (if_statement "if (local_24 == 0) {\n          randint_all_free(s);\n          *piVar1 = 0x11;\n          return -1;\n        }" if (parenthesized_expression "(local_24 == 0)" ( (binary_expression "local_24 == 0" identifier == number_literal) )) (compound_statement "{\n          randint_all_free(s);\n          *piVar1 = 0x11;\n          return -1;\n        }" { (expression_statement "randint_all_free(s);" (call_expression "randint_all_free(s)" identifier (argument_list "(s)" ( identifier ))) ;) (expression_statement "*piVar1 = 0x11;" (assignment_expression "*piVar1 = 0x11" (pointer_expression "*piVar1" * identifier) = number_literal) ;) (return_statement "return -1;" return number_literal ;) })) })) (expression_statement "*piVar1 = iVar5;" (assignment_expression "*piVar1 = iVar5" (pointer_expression "*piVar1" * identifier) = identifier) ;) (labeled_statement "LAB_00022c73:\n      randint_all_free(s);" statement_identifier : (expression_statement "randint_all_free(s);" (call_expression "randint_all_free(s)" identifier (argument_list "(s)" ( identifier ))) ;)) (expression_statement "*piVar1 = iVar5;" (assignment_expression "*piVar1 = iVar5" (pointer_expression "*piVar1" * identifier) = identifier) ;) (return_statement "return iVar4;" return identifier ;) })) })) (expression_statement "*piVar1 = 0x16;" (assignment_expression "*piVar1 = 0x16" (pointer_expression "*piVar1" * identifier) = number_literal) ;) (return_statement "return -1;" return number_literal ;) })))
(translation_unit "int FUN_00022b40(char *param_1,int param_2,undefined4 param_3,code *param_4,uint param_5)\n\n{\n  int *piVar1;\n  size_t sVar2;\n  int iVar3;\n  int iVar4;\n  int iVar5;\n  int iVar6;\n  char *pcVar7;\n  char *pcVar8;\n  int local_24;\n  \n  piVar1 = __errno_location();\n  iVar6 = *piVar1;\n  sVar2 = strlen(param_1);\n  if (param_2 + param_5 <= sVar2) {\n    iVar3 = sVar2 - (param_2 + param_5);\n    sVar2 = strspn(param_1 + iVar3,"X");\n    if (param_5 <= sVar2) {\n      iVar4 = FUN_0002b1b0(0,param_5);\n      if (iVar4 == 0) {\n        return -1;\n      }\n      local_24 = 0x3a2f8;\n      while( true ) {\n        pcVar7 = param_1 + iVar3;\n        if (param_5 != 0) {\n          do {\n            pcVar8 = pcVar7 + 1;\n            iVar5 = FUN_0002b200(iVar4,0x3d,0);\n            *pcVar7 = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[iVar5];\n            pcVar7 = pcVar8;\n          } while (pcVar8 != param_1 + iVar3 + param_5);\n        }\n        iVar5 = (*param_4)(param_1,param_3);\n        if (-1 < iVar5) break;\n        if (*piVar1 != 0x11) {\n          iVar5 = -1;\n          iVar6 = *piVar1;\n          goto LAB_00022c73;\n        }\n        local_24 = local_24 + -1;\n        if (local_24 == 0) {\n          FUN_0002b6c0(iVar4);\n          *piVar1 = 0x11;\n          return -1;\n        }\n      }\n      *piVar1 = iVar6;\nLAB_00022c73:\n      FUN_0002b6c0(iVar4);\n      *piVar1 = iVar6;\n      return iVar5;\n    }\n  }\n  *piVar1 = 0x16;\n  return -1;\n}\n\n" (function_definition "int FUN_00022b40(char *param_1,int param_2,undefined4 param_3,code *param_4,uint param_5)\n\n{\n  int *piVar1;\n  size_t sVar2;\n  int iVar3;\n  int iVar4;\n  int iVar5;\n  int iVar6;\n  char *pcVar7;\n  char *pcVar8;\n  int local_24;\n  \n  piVar1 = __errno_location();\n  iVar6 = *piVar1;\n  sVar2 = strlen(param_1);\n  if (param_2 + param_5 <= sVar2) {\n    iVar3 = sVar2 - (param_2 + param_5);\n    sVar2 = strspn(param_1 + iVar3,"X");\n    if (param_5 <= sVar2) {\n      iVar4 = FUN_0002b1b0(0,param_5);\n      if (iVar4 == 0) {\n        return -1;\n      }\n      local_24 = 0x3a2f8;\n      while( true ) {\n        pcVar7 = param_1 + iVar3;\n        if (param_5 != 0) {\n          do {\n            pcVar8 = pcVar7 + 1;\n            iVar5 = FUN_0002b200(iVar4,0x3d,0);\n            *pcVar7 = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[iVar5];\n            pcVar7 = pcVar8;\n          } while (pcVar8 != param_1 + iVar3 + param_5);\n        }\n        iVar5 = (*param_4)(param_1,param_3);\n        if (-1 < iVar5) break;\n        if (*piVar1 != 0x11) {\n          iVar5 = -1;\n          iVar6 = *piVar1;\n          goto LAB_00022c73;\n        }\n        local_24 = local_24 + -1;\n        if (local_24 == 0) {\n          FUN_0002b6c0(iVar4);\n          *piVar1 = 0x11;\n          return -1;\n        }\n      }\n      *piVar1 = iVar6;\nLAB_00022c73:\n      FUN_0002b6c0(iVar4);\n      *piVar1 = iVar6;\n      return iVar5;\n    }\n  }\n  *piVar1 = 0x16;\n  return -1;\n}" primitive_type (function_declarator "FUN_00022b40(char *param_1,int param_2,undefined4 param_3,code *param_4,uint param_5)" identifier (parameter_list "(char *param_1,int param_2,undefined4 param_3,code *param_4,uint param_5)" ( (parameter_declaration "char *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "int param_2" primitive_type identifier) , (parameter_declaration "undefined4 param_3" type_identifier identifier) , (parameter_declaration "code *param_4" type_identifier (pointer_declarator "*param_4" * identifier)) , (parameter_declaration "uint param_5" type_identifier identifier) ))) (compound_statement "{\n  int *piVar1;\n  size_t sVar2;\n  int iVar3;\n  int iVar4;\n  int iVar5;\n  int iVar6;\n  char *pcVar7;\n  char *pcVar8;\n  int local_24;\n  \n  piVar1 = __errno_location();\n  iVar6 = *piVar1;\n  sVar2 = strlen(param_1);\n  if (param_2 + param_5 <= sVar2) {\n    iVar3 = sVar2 - (param_2 + param_5);\n    sVar2 = strspn(param_1 + iVar3,"X");\n    if (param_5 <= sVar2) {\n      iVar4 = FUN_0002b1b0(0,param_5);\n      if (iVar4 == 0) {\n        return -1;\n      }\n      local_24 = 0x3a2f8;\n      while( true ) {\n        pcVar7 = param_1 + iVar3;\n        if (param_5 != 0) {\n          do {\n            pcVar8 = pcVar7 + 1;\n            iVar5 = FUN_0002b200(iVar4,0x3d,0);\n            *pcVar7 = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[iVar5];\n            pcVar7 = pcVar8;\n          } while (pcVar8 != param_1 + iVar3 + param_5);\n        }\n        iVar5 = (*param_4)(param_1,param_3);\n        if (-1 < iVar5) break;\n        if (*piVar1 != 0x11) {\n          iVar5 = -1;\n          iVar6 = *piVar1;\n          goto LAB_00022c73;\n        }\n        local_24 = local_24 + -1;\n        if (local_24 == 0) {\n          FUN_0002b6c0(iVar4);\n          *piVar1 = 0x11;\n          return -1;\n        }\n      }\n      *piVar1 = iVar6;\nLAB_00022c73:\n      FUN_0002b6c0(iVar4);\n      *piVar1 = iVar6;\n      return iVar5;\n    }\n  }\n  *piVar1 = 0x16;\n  return -1;\n}" { (declaration "int *piVar1;" primitive_type (pointer_declarator "*piVar1" * identifier) ;) (declaration "size_t sVar2;" primitive_type identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "int iVar4;" primitive_type identifier ;) (declaration "int iVar5;" primitive_type identifier ;) (declaration "int iVar6;" primitive_type identifier ;) (declaration "char *pcVar7;" primitive_type (pointer_declarator "*pcVar7" * identifier) ;) (declaration "char *pcVar8;" primitive_type (pointer_declarator "*pcVar8" * identifier) ;) (declaration "int local_24;" primitive_type identifier ;) (expression_statement "piVar1 = __errno_location();" (assignment_expression "piVar1 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (expression_statement "iVar6 = *piVar1;" (assignment_expression "iVar6 = *piVar1" identifier = (pointer_expression "*piVar1" * identifier)) ;) (expression_statement "sVar2 = strlen(param_1);" (assignment_expression "sVar2 = strlen(param_1)" identifier = (call_expression "strlen(param_1)" identifier (argument_list "(param_1)" ( identifier )))) ;) (if_statement "if (param_2 + param_5 <= sVar2) {\n    iVar3 = sVar2 - (param_2 + param_5);\n    sVar2 = strspn(param_1 + iVar3,"X");\n    if (param_5 <= sVar2) {\n      iVar4 = FUN_0002b1b0(0,param_5);\n      if (iVar4 == 0) {\n        return -1;\n      }\n      local_24 = 0x3a2f8;\n      while( true ) {\n        pcVar7 = param_1 + iVar3;\n        if (param_5 != 0) {\n          do {\n            pcVar8 = pcVar7 + 1;\n            iVar5 = FUN_0002b200(iVar4,0x3d,0);\n            *pcVar7 = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[iVar5];\n            pcVar7 = pcVar8;\n          } while (pcVar8 != param_1 + iVar3 + param_5);\n        }\n        iVar5 = (*param_4)(param_1,param_3);\n        if (-1 < iVar5) break;\n        if (*piVar1 != 0x11) {\n          iVar5 = -1;\n          iVar6 = *piVar1;\n          goto LAB_00022c73;\n        }\n        local_24 = local_24 + -1;\n        if (local_24 == 0) {\n          FUN_0002b6c0(iVar4);\n          *piVar1 = 0x11;\n          return -1;\n        }\n      }\n      *piVar1 = iVar6;\nLAB_00022c73:\n      FUN_0002b6c0(iVar4);\n      *piVar1 = iVar6;\n      return iVar5;\n    }\n  }" if (parenthesized_expression "(param_2 + param_5 <= sVar2)" ( (binary_expression "param_2 + param_5 <= sVar2" (binary_expression "param_2 + param_5" identifier + identifier) <= identifier) )) (compound_statement "{\n    iVar3 = sVar2 - (param_2 + param_5);\n    sVar2 = strspn(param_1 + iVar3,"X");\n    if (param_5 <= sVar2) {\n      iVar4 = FUN_0002b1b0(0,param_5);\n      if (iVar4 == 0) {\n        return -1;\n      }\n      local_24 = 0x3a2f8;\n      while( true ) {\n        pcVar7 = param_1 + iVar3;\n        if (param_5 != 0) {\n          do {\n            pcVar8 = pcVar7 + 1;\n            iVar5 = FUN_0002b200(iVar4,0x3d,0);\n            *pcVar7 = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[iVar5];\n            pcVar7 = pcVar8;\n          } while (pcVar8 != param_1 + iVar3 + param_5);\n        }\n        iVar5 = (*param_4)(param_1,param_3);\n        if (-1 < iVar5) break;\n        if (*piVar1 != 0x11) {\n          iVar5 = -1;\n          iVar6 = *piVar1;\n          goto LAB_00022c73;\n        }\n        local_24 = local_24 + -1;\n        if (local_24 == 0) {\n          FUN_0002b6c0(iVar4);\n          *piVar1 = 0x11;\n          return -1;\n        }\n      }\n      *piVar1 = iVar6;\nLAB_00022c73:\n      FUN_0002b6c0(iVar4);\n      *piVar1 = iVar6;\n      return iVar5;\n    }\n  }" { (expression_statement "iVar3 = sVar2 - (param_2 + param_5);" (assignment_expression "iVar3 = sVar2 - (param_2 + param_5)" identifier = (binary_expression "sVar2 - (param_2 + param_5)" identifier - (parenthesized_expression "(param_2 + param_5)" ( (binary_expression "param_2 + param_5" identifier + identifier) )))) ;) (expression_statement "sVar2 = strspn(param_1 + iVar3,"X");" (assignment_expression "sVar2 = strspn(param_1 + iVar3,"X")" identifier = (call_expression "strspn(param_1 + iVar3,"X")" identifier (argument_list "(param_1 + iVar3,"X")" ( (binary_expression "param_1 + iVar3" identifier + identifier) , (string_literal ""X"" " string_content ") )))) ;) (if_statement "if (param_5 <= sVar2) {\n      iVar4 = FUN_0002b1b0(0,param_5);\n      if (iVar4 == 0) {\n        return -1;\n      }\n      local_24 = 0x3a2f8;\n      while( true ) {\n        pcVar7 = param_1 + iVar3;\n        if (param_5 != 0) {\n          do {\n            pcVar8 = pcVar7 + 1;\n            iVar5 = FUN_0002b200(iVar4,0x3d,0);\n            *pcVar7 = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[iVar5];\n            pcVar7 = pcVar8;\n          } while (pcVar8 != param_1 + iVar3 + param_5);\n        }\n        iVar5 = (*param_4)(param_1,param_3);\n        if (-1 < iVar5) break;\n        if (*piVar1 != 0x11) {\n          iVar5 = -1;\n          iVar6 = *piVar1;\n          goto LAB_00022c73;\n        }\n        local_24 = local_24 + -1;\n        if (local_24 == 0) {\n          FUN_0002b6c0(iVar4);\n          *piVar1 = 0x11;\n          return -1;\n        }\n      }\n      *piVar1 = iVar6;\nLAB_00022c73:\n      FUN_0002b6c0(iVar4);\n      *piVar1 = iVar6;\n      return iVar5;\n    }" if (parenthesized_expression "(param_5 <= sVar2)" ( (binary_expression "param_5 <= sVar2" identifier <= identifier) )) (compound_statement "{\n      iVar4 = FUN_0002b1b0(0,param_5);\n      if (iVar4 == 0) {\n        return -1;\n      }\n      local_24 = 0x3a2f8;\n      while( true ) {\n        pcVar7 = param_1 + iVar3;\n        if (param_5 != 0) {\n          do {\n            pcVar8 = pcVar7 + 1;\n            iVar5 = FUN_0002b200(iVar4,0x3d,0);\n            *pcVar7 = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[iVar5];\n            pcVar7 = pcVar8;\n          } while (pcVar8 != param_1 + iVar3 + param_5);\n        }\n        iVar5 = (*param_4)(param_1,param_3);\n        if (-1 < iVar5) break;\n        if (*piVar1 != 0x11) {\n          iVar5 = -1;\n          iVar6 = *piVar1;\n          goto LAB_00022c73;\n        }\n        local_24 = local_24 + -1;\n        if (local_24 == 0) {\n          FUN_0002b6c0(iVar4);\n          *piVar1 = 0x11;\n          return -1;\n        }\n      }\n      *piVar1 = iVar6;\nLAB_00022c73:\n      FUN_0002b6c0(iVar4);\n      *piVar1 = iVar6;\n      return iVar5;\n    }" { (expression_statement "iVar4 = FUN_0002b1b0(0,param_5);" (assignment_expression "iVar4 = FUN_0002b1b0(0,param_5)" identifier = (call_expression "FUN_0002b1b0(0,param_5)" identifier (argument_list "(0,param_5)" ( number_literal , identifier )))) ;) (if_statement "if (iVar4 == 0) {\n        return -1;\n      }" if (parenthesized_expression "(iVar4 == 0)" ( (binary_expression "iVar4 == 0" identifier == number_literal) )) (compound_statement "{\n        return -1;\n      }" { (return_statement "return -1;" return number_literal ;) })) (expression_statement "local_24 = 0x3a2f8;" (assignment_expression "local_24 = 0x3a2f8" identifier = number_literal) ;) (while_statement "while( true ) {\n        pcVar7 = param_1 + iVar3;\n        if (param_5 != 0) {\n          do {\n            pcVar8 = pcVar7 + 1;\n            iVar5 = FUN_0002b200(iVar4,0x3d,0);\n            *pcVar7 = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[iVar5];\n            pcVar7 = pcVar8;\n          } while (pcVar8 != param_1 + iVar3 + param_5);\n        }\n        iVar5 = (*param_4)(param_1,param_3);\n        if (-1 < iVar5) break;\n        if (*piVar1 != 0x11) {\n          iVar5 = -1;\n          iVar6 = *piVar1;\n          goto LAB_00022c73;\n        }\n        local_24 = local_24 + -1;\n        if (local_24 == 0) {\n          FUN_0002b6c0(iVar4);\n          *piVar1 = 0x11;\n          return -1;\n        }\n      }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n        pcVar7 = param_1 + iVar3;\n        if (param_5 != 0) {\n          do {\n            pcVar8 = pcVar7 + 1;\n            iVar5 = FUN_0002b200(iVar4,0x3d,0);\n            *pcVar7 = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[iVar5];\n            pcVar7 = pcVar8;\n          } while (pcVar8 != param_1 + iVar3 + param_5);\n        }\n        iVar5 = (*param_4)(param_1,param_3);\n        if (-1 < iVar5) break;\n        if (*piVar1 != 0x11) {\n          iVar5 = -1;\n          iVar6 = *piVar1;\n          goto LAB_00022c73;\n        }\n        local_24 = local_24 + -1;\n        if (local_24 == 0) {\n          FUN_0002b6c0(iVar4);\n          *piVar1 = 0x11;\n          return -1;\n        }\n      }" { (expression_statement "pcVar7 = param_1 + iVar3;" (assignment_expression "pcVar7 = param_1 + iVar3" identifier = (binary_expression "param_1 + iVar3" identifier + identifier)) ;) (if_statement "if (param_5 != 0) {\n          do {\n            pcVar8 = pcVar7 + 1;\n            iVar5 = FUN_0002b200(iVar4,0x3d,0);\n            *pcVar7 = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[iVar5];\n            pcVar7 = pcVar8;\n          } while (pcVar8 != param_1 + iVar3 + param_5);\n        }" if (parenthesized_expression "(param_5 != 0)" ( (binary_expression "param_5 != 0" identifier != number_literal) )) (compound_statement "{\n          do {\n            pcVar8 = pcVar7 + 1;\n            iVar5 = FUN_0002b200(iVar4,0x3d,0);\n            *pcVar7 = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[iVar5];\n            pcVar7 = pcVar8;\n          } while (pcVar8 != param_1 + iVar3 + param_5);\n        }" { (do_statement "do {\n            pcVar8 = pcVar7 + 1;\n            iVar5 = FUN_0002b200(iVar4,0x3d,0);\n            *pcVar7 = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[iVar5];\n            pcVar7 = pcVar8;\n          } while (pcVar8 != param_1 + iVar3 + param_5);" do (compound_statement "{\n            pcVar8 = pcVar7 + 1;\n            iVar5 = FUN_0002b200(iVar4,0x3d,0);\n            *pcVar7 = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[iVar5];\n            pcVar7 = pcVar8;\n          }" { (expression_statement "pcVar8 = pcVar7 + 1;" (assignment_expression "pcVar8 = pcVar7 + 1" identifier = (binary_expression "pcVar7 + 1" identifier + number_literal)) ;) (expression_statement "iVar5 = FUN_0002b200(iVar4,0x3d,0);" (assignment_expression "iVar5 = FUN_0002b200(iVar4,0x3d,0)" identifier = (call_expression "FUN_0002b200(iVar4,0x3d,0)" identifier (argument_list "(iVar4,0x3d,0)" ( identifier , number_literal , number_literal )))) ;) (expression_statement "*pcVar7 = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[iVar5];" (assignment_expression "*pcVar7 = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[iVar5]" (pointer_expression "*pcVar7" * identifier) = (subscript_expression ""abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[iVar5]" (string_literal ""abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"" " string_content ") [ identifier ])) ;) (expression_statement "pcVar7 = pcVar8;" (assignment_expression "pcVar7 = pcVar8" identifier = identifier) ;) }) while (parenthesized_expression "(pcVar8 != param_1 + iVar3 + param_5)" ( (binary_expression "pcVar8 != param_1 + iVar3 + param_5" identifier != (binary_expression "param_1 + iVar3 + param_5" (binary_expression "param_1 + iVar3" identifier + identifier) + identifier)) )) ;) })) (expression_statement "iVar5 = (*param_4)(param_1,param_3);" (assignment_expression "iVar5 = (*param_4)(param_1,param_3)" identifier = (call_expression "(*param_4)(param_1,param_3)" (parenthesized_expression "(*param_4)" ( (pointer_expression "*param_4" * identifier) )) (argument_list "(param_1,param_3)" ( identifier , identifier )))) ;) (if_statement "if (-1 < iVar5) break;" if (parenthesized_expression "(-1 < iVar5)" ( (binary_expression "-1 < iVar5" number_literal < identifier) )) (break_statement "break;" break ;)) (if_statement "if (*piVar1 != 0x11) {\n          iVar5 = -1;\n          iVar6 = *piVar1;\n          goto LAB_00022c73;\n        }" if (parenthesized_expression "(*piVar1 != 0x11)" ( (binary_expression "*piVar1 != 0x11" (pointer_expression "*piVar1" * identifier) != number_literal) )) (compound_statement "{\n          iVar5 = -1;\n          iVar6 = *piVar1;\n          goto LAB_00022c73;\n        }" { (expression_statement "iVar5 = -1;" (assignment_expression "iVar5 = -1" identifier = number_literal) ;) (expression_statement "iVar6 = *piVar1;" (assignment_expression "iVar6 = *piVar1" identifier = (pointer_expression "*piVar1" * identifier)) ;) (goto_statement "goto LAB_00022c73;" goto statement_identifier ;) })) (expression_statement "local_24 = local_24 + -1;" (assignment_expression "local_24 = local_24 + -1" identifier = (binary_expression "local_24 + -1" identifier + number_literal)) ;) (if_statement "if (local_24 == 0) {\n          FUN_0002b6c0(iVar4);\n          *piVar1 = 0x11;\n          return -1;\n        }" if (parenthesized_expression "(local_24 == 0)" ( (binary_expression "local_24 == 0" identifier == number_literal) )) (compound_statement "{\n          FUN_0002b6c0(iVar4);\n          *piVar1 = 0x11;\n          return -1;\n        }" { (expression_statement "FUN_0002b6c0(iVar4);" (call_expression "FUN_0002b6c0(iVar4)" identifier (argument_list "(iVar4)" ( identifier ))) ;) (expression_statement "*piVar1 = 0x11;" (assignment_expression "*piVar1 = 0x11" (pointer_expression "*piVar1" * identifier) = number_literal) ;) (return_statement "return -1;" return number_literal ;) })) })) (expression_statement "*piVar1 = iVar6;" (assignment_expression "*piVar1 = iVar6" (pointer_expression "*piVar1" * identifier) = identifier) ;) (labeled_statement "LAB_00022c73:\n      FUN_0002b6c0(iVar4);" statement_identifier : (expression_statement "FUN_0002b6c0(iVar4);" (call_expression "FUN_0002b6c0(iVar4)" identifier (argument_list "(iVar4)" ( identifier ))) ;)) (expression_statement "*piVar1 = iVar6;" (assignment_expression "*piVar1 = iVar6" (pointer_expression "*piVar1" * identifier) = identifier) ;) (return_statement "return iVar5;" return identifier ;) })) })) (expression_statement "*piVar1 = 0x16;" (assignment_expression "*piVar1 = 0x16" (pointer_expression "*piVar1" * identifier) = number_literal) ;) (return_statement "return -1;" return number_literal ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( )))) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression (binary_expression IDENT + IDENT) <= IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression IDENT - (parenthesized_expression ( (binary_expression IDENT + IDENT) )))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (binary_expression IDENT + IDENT) , (string_literal " string_content ") )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT <= IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( LIT , IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (return_statement return LIT ;) })) (expression_statement (assignment_expression IDENT = LIT) ;) (while_statement while (parenthesized_expression ( BOOL )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression IDENT + IDENT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (do_statement do (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , LIT , LIT )))) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = (subscript_expression (string_literal " string_content ") [ IDENT ])) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) }) while (parenthesized_expression ( (binary_expression IDENT != (binary_expression (binary_expression IDENT + IDENT) + IDENT)) )) ;) })) (expression_statement (assignment_expression IDENT = (call_expression (parenthesized_expression ( (pointer_expression * IDENT) )) (argument_list ( IDENT , IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression LIT < IDENT) )) (break_statement break ;)) (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) != LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (goto_statement goto statement_identifier ;) })) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = LIT) ;) (return_statement return LIT ;) })) })) (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (labeled_statement statement_identifier : (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;)) (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (return_statement return IDENT ;) })) })) (expression_statement (assignment_expression (pointer_expression * IDENT) = LIT) ;) (return_statement return LIT ;) })))
(function_definition "int FUN_00022b40(char *param_1,int param_2,undefined4 param_3,code *param_4,uint param_5)\n\n{\n  int *piVar1;\n  size_t sVar2;\n  int iVar3;\n  int iVar4;\n  int iVar5;\n  int iVar6;\n  char *pcVar7;\n  char *pcVar8;\n  int local_24;\n  \n  piVar1 = __errno_location();\n  iVar6 = *piVar1;\n  sVar2 = strlen(param_1);\n  if (param_2 + param_5 <= sVar2) {\n    iVar3 = sVar2 - (param_2 + param_5);\n    sVar2 = strspn(param_1 + iVar3,"X");\n    if (param_5 <= sVar2) {\n      iVar4 = FUN_0002b1b0(0,param_5);\n      if (iVar4 == 0) {\n        return -1;\n      }\n      local_24 = 0x3a2f8;\n      while( true ) {\n        pcVar7 = param_1 + iVar3;\n        if (param_5 != 0) {\n          do {\n            pcVar8 = pcVar7 + 1;\n            iVar5 = FUN_0002b200(iVar4,0x3d,0);\n            *pcVar7 = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[iVar5];\n            pcVar7 = pcVar8;\n          } while (pcVar8 != param_1 + iVar3 + param_5);\n        }\n        iVar5 = (*param_4)(param_1,param_3);\n        if (-1 < iVar5) break;\n        if (*piVar1 != 0x11) {\n          iVar5 = -1;\n          iVar6 = *piVar1;\n          goto LAB_00022c73;\n        }\n        local_24 = local_24 + -1;\n        if (local_24 == 0) {\n          FUN_0002b6c0(iVar4);\n          *piVar1 = 0x11;\n          return -1;\n        }\n      }\n      *piVar1 = iVar6;\nLAB_00022c73:\n      FUN_0002b6c0(iVar4);\n      *piVar1 = iVar6;\n      return iVar5;\n    }\n  }\n  *piVar1 = 0x16;\n  return -1;\n}" (primitive_type "int") (function_declarator "FUN_00022b40(char *param_1,int param_2,undefined4 param_3,code *param_4,uint param_5)" (identifier "FUN_00022b40") (parameter_list "(char *param_1,int param_2,undefined4 param_3,code *param_4,uint param_5)" (( "(") (parameter_declaration "char *param_1" (primitive_type "char") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "int param_2" (primitive_type "int") (identifier "param_2")) (, ",") (parameter_declaration "undefined4 param_3" (type_identifier "undefined4") (identifier "param_3")) (, ",") (parameter_declaration "code *param_4" (type_identifier "code") (pointer_declarator "*param_4" (* "*") (identifier "param_4"))) (, ",") (parameter_declaration "uint param_5" (type_identifier "uint") (identifier "param_5")) () ")"))) (compound_statement "{\n  int *piVar1;\n  size_t sVar2;\n  int iVar3;\n  int iVar4;\n  int iVar5;\n  int iVar6;\n  char *pcVar7;\n  char *pcVar8;\n  int local_24;\n  \n  piVar1 = __errno_location();\n  iVar6 = *piVar1;\n  sVar2 = strlen(param_1);\n  if (param_2 + param_5 <= sVar2) {\n    iVar3 = sVar2 - (param_2 + param_5);\n    sVar2 = strspn(param_1 + iVar3,"X");\n    if (param_5 <= sVar2) {\n      iVar4 = FUN_0002b1b0(0,param_5);\n      if (iVar4 == 0) {\n        return -1;\n      }\n      local_24 = 0x3a2f8;\n      while( true ) {\n        pcVar7 = param_1 + iVar3;\n        if (param_5 != 0) {\n          do {\n            pcVar8 = pcVar7 + 1;\n            iVar5 = FUN_0002b200(iVar4,0x3d,0);\n            *pcVar7 = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[iVar5];\n            pcVar7 = pcVar8;\n          } while (pcVar8 != param_1 + iVar3 + param_5);\n        }\n        iVar5 = (*param_4)(param_1,param_3);\n        if (-1 < iVar5) break;\n        if (*piVar1 != 0x11) {\n          iVar5 = -1;\n          iVar6 = *piVar1;\n          goto LAB_00022c73;\n        }\n        local_24 = local_24 + -1;\n        if (local_24 == 0) {\n          FUN_0002b6c0(iVar4);\n          *piVar1 = 0x11;\n          return -1;\n        }\n      }\n      *piVar1 = iVar6;\nLAB_00022c73:\n      FUN_0002b6c0(iVar4);\n      *piVar1 = iVar6;\n      return iVar5;\n    }\n  }\n  *piVar1 = 0x16;\n  return -1;\n}" ({ "{") (declaration "int *piVar1;" (primitive_type "int") (pointer_declarator "*piVar1" (* "*") (identifier "piVar1")) (; ";")) (declaration "size_t sVar2;" (primitive_type "size_t") (identifier "sVar2") (; ";")) (declaration "int iVar3;" (primitive_type "int") (identifier "iVar3") (; ";")) (declaration "int iVar4;" (primitive_type "int") (identifier "iVar4") (; ";")) (declaration "int iVar5;" (primitive_type "int") (identifier "iVar5") (; ";")) (declaration "int iVar6;" (primitive_type "int") (identifier "iVar6") (; ";")) (declaration "char *pcVar7;" (primitive_type "char") (pointer_declarator "*pcVar7" (* "*") (identifier "pcVar7")) (; ";")) (declaration "char *pcVar8;" (primitive_type "char") (pointer_declarator "*pcVar8" (* "*") (identifier "pcVar8")) (; ";")) (declaration "int local_24;" (primitive_type "int") (identifier "local_24") (; ";")) (expression_statement "piVar1 = __errno_location();" (assignment_expression "piVar1 = __errno_location()" (identifier "piVar1") (= "=") (call_expression "__errno_location()" (identifier "__errno_location") (argument_list "()" (( "(") () ")")))) (; ";")) (expression_statement "iVar6 = *piVar1;" (assignment_expression "iVar6 = *piVar1" (identifier "iVar6") (= "=") (pointer_expression "*piVar1" (* "*") (identifier "piVar1"))) (; ";")) (expression_statement "sVar2 = strlen(param_1);" (assignment_expression "sVar2 = strlen(param_1)" (identifier "sVar2") (= "=") (call_expression "strlen(param_1)" (identifier "strlen") (argument_list "(param_1)" (( "(") (identifier "param_1") () ")")))) (; ";")) (if_statement "if (param_2 + param_5 <= sVar2) {\n    iVar3 = sVar2 - (param_2 + param_5);\n    sVar2 = strspn(param_1 + iVar3,"X");\n    if (param_5 <= sVar2) {\n      iVar4 = FUN_0002b1b0(0,param_5);\n      if (iVar4 == 0) {\n        return -1;\n      }\n      local_24 = 0x3a2f8;\n      while( true ) {\n        pcVar7 = param_1 + iVar3;\n        if (param_5 != 0) {\n          do {\n            pcVar8 = pcVar7 + 1;\n            iVar5 = FUN_0002b200(iVar4,0x3d,0);\n            *pcVar7 = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[iVar5];\n            pcVar7 = pcVar8;\n          } while (pcVar8 != param_1 + iVar3 + param_5);\n        }\n        iVar5 = (*param_4)(param_1,param_3);\n        if (-1 < iVar5) break;\n        if (*piVar1 != 0x11) {\n          iVar5 = -1;\n          iVar6 = *piVar1;\n          goto LAB_00022c73;\n        }\n        local_24 = local_24 + -1;\n        if (local_24 == 0) {\n          FUN_0002b6c0(iVar4);\n          *piVar1 = 0x11;\n          return -1;\n        }\n      }\n      *piVar1 = iVar6;\nLAB_00022c73:\n      FUN_0002b6c0(iVar4);\n      *piVar1 = iVar6;\n      return iVar5;\n    }\n  }" (if "if") (parenthesized_expression "(param_2 + param_5 <= sVar2)" (( "(") (binary_expression "param_2 + param_5 <= sVar2" (binary_expression "param_2 + param_5" (identifier "param_2") (+ "+") (identifier "param_5")) (<= "<=") (identifier "sVar2")) () ")")) (compound_statement "{\n    iVar3 = sVar2 - (param_2 + param_5);\n    sVar2 = strspn(param_1 + iVar3,"X");\n    if (param_5 <= sVar2) {\n      iVar4 = FUN_0002b1b0(0,param_5);\n      if (iVar4 == 0) {\n        return -1;\n      }\n      local_24 = 0x3a2f8;\n      while( true ) {\n        pcVar7 = param_1 + iVar3;\n        if (param_5 != 0) {\n          do {\n            pcVar8 = pcVar7 + 1;\n            iVar5 = FUN_0002b200(iVar4,0x3d,0);\n            *pcVar7 = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[iVar5];\n            pcVar7 = pcVar8;\n          } while (pcVar8 != param_1 + iVar3 + param_5);\n        }\n        iVar5 = (*param_4)(param_1,param_3);\n        if (-1 < iVar5) break;\n        if (*piVar1 != 0x11) {\n          iVar5 = -1;\n          iVar6 = *piVar1;\n          goto LAB_00022c73;\n        }\n        local_24 = local_24 + -1;\n        if (local_24 == 0) {\n          FUN_0002b6c0(iVar4);\n          *piVar1 = 0x11;\n          return -1;\n        }\n      }\n      *piVar1 = iVar6;\nLAB_00022c73:\n      FUN_0002b6c0(iVar4);\n      *piVar1 = iVar6;\n      return iVar5;\n    }\n  }" ({ "{") (expression_statement "iVar3 = sVar2 - (param_2 + param_5);" (assignment_expression "iVar3 = sVar2 - (param_2 + param_5)" (identifier "iVar3") (= "=") (binary_expression "sVar2 - (param_2 + param_5)" (identifier "sVar2") (- "-") (parenthesized_expression "(param_2 + param_5)" (( "(") (binary_expression "param_2 + param_5" (identifier "param_2") (+ "+") (identifier "param_5")) () ")")))) (; ";")) (expression_statement "sVar2 = strspn(param_1 + iVar3,"X");" (assignment_expression "sVar2 = strspn(param_1 + iVar3,"X")" (identifier "sVar2") (= "=") (call_expression "strspn(param_1 + iVar3,"X")" (identifier "strspn") (argument_list "(param_1 + iVar3,"X")" (( "(") (binary_expression "param_1 + iVar3" (identifier "param_1") (+ "+") (identifier "iVar3")) (, ",") (string_literal ""X"" (" """) (string_content "X") (" """)) () ")")))) (; ";")) (if_statement "if (param_5 <= sVar2) {\n      iVar4 = FUN_0002b1b0(0,param_5);\n      if (iVar4 == 0) {\n        return -1;\n      }\n      local_24 = 0x3a2f8;\n      while( true ) {\n        pcVar7 = param_1 + iVar3;\n        if (param_5 != 0) {\n          do {\n            pcVar8 = pcVar7 + 1;\n            iVar5 = FUN_0002b200(iVar4,0x3d,0);\n            *pcVar7 = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[iVar5];\n            pcVar7 = pcVar8;\n          } while (pcVar8 != param_1 + iVar3 + param_5);\n        }\n        iVar5 = (*param_4)(param_1,param_3);\n        if (-1 < iVar5) break;\n        if (*piVar1 != 0x11) {\n          iVar5 = -1;\n          iVar6 = *piVar1;\n          goto LAB_00022c73;\n        }\n        local_24 = local_24 + -1;\n        if (local_24 == 0) {\n          FUN_0002b6c0(iVar4);\n          *piVar1 = 0x11;\n          return -1;\n        }\n      }\n      *piVar1 = iVar6;\nLAB_00022c73:\n      FUN_0002b6c0(iVar4);\n      *piVar1 = iVar6;\n      return iVar5;\n    }" (if "if") (parenthesized_expression "(param_5 <= sVar2)" (( "(") (binary_expression "param_5 <= sVar2" (identifier "param_5") (<= "<=") (identifier "sVar2")) () ")")) (compound_statement "{\n      iVar4 = FUN_0002b1b0(0,param_5);\n      if (iVar4 == 0) {\n        return -1;\n      }\n      local_24 = 0x3a2f8;\n      while( true ) {\n        pcVar7 = param_1 + iVar3;\n        if (param_5 != 0) {\n          do {\n            pcVar8 = pcVar7 + 1;\n            iVar5 = FUN_0002b200(iVar4,0x3d,0);\n            *pcVar7 = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[iVar5];\n            pcVar7 = pcVar8;\n          } while (pcVar8 != param_1 + iVar3 + param_5);\n        }\n        iVar5 = (*param_4)(param_1,param_3);\n        if (-1 < iVar5) break;\n        if (*piVar1 != 0x11) {\n          iVar5 = -1;\n          iVar6 = *piVar1;\n          goto LAB_00022c73;\n        }\n        local_24 = local_24 + -1;\n        if (local_24 == 0) {\n          FUN_0002b6c0(iVar4);\n          *piVar1 = 0x11;\n          return -1;\n        }\n      }\n      *piVar1 = iVar6;\nLAB_00022c73:\n      FUN_0002b6c0(iVar4);\n      *piVar1 = iVar6;\n      return iVar5;\n    }" ({ "{") (expression_statement "iVar4 = FUN_0002b1b0(0,param_5);" (assignment_expression "iVar4 = FUN_0002b1b0(0,param_5)" (identifier "iVar4") (= "=") (call_expression "FUN_0002b1b0(0,param_5)" (identifier "FUN_0002b1b0") (argument_list "(0,param_5)" (( "(") (number_literal "0") (, ",") (identifier "param_5") () ")")))) (; ";")) (if_statement "if (iVar4 == 0) {\n        return -1;\n      }" (if "if") (parenthesized_expression "(iVar4 == 0)" (( "(") (binary_expression "iVar4 == 0" (identifier "iVar4") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n        return -1;\n      }" ({ "{") (return_statement "return -1;" (return "return") (number_literal "-1") (; ";")) (} "}"))) (expression_statement "local_24 = 0x3a2f8;" (assignment_expression "local_24 = 0x3a2f8" (identifier "local_24") (= "=") (number_literal "0x3a2f8")) (; ";")) (while_statement "while( true ) {\n        pcVar7 = param_1 + iVar3;\n        if (param_5 != 0) {\n          do {\n            pcVar8 = pcVar7 + 1;\n            iVar5 = FUN_0002b200(iVar4,0x3d,0);\n            *pcVar7 = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[iVar5];\n            pcVar7 = pcVar8;\n          } while (pcVar8 != param_1 + iVar3 + param_5);\n        }\n        iVar5 = (*param_4)(param_1,param_3);\n        if (-1 < iVar5) break;\n        if (*piVar1 != 0x11) {\n          iVar5 = -1;\n          iVar6 = *piVar1;\n          goto LAB_00022c73;\n        }\n        local_24 = local_24 + -1;\n        if (local_24 == 0) {\n          FUN_0002b6c0(iVar4);\n          *piVar1 = 0x11;\n          return -1;\n        }\n      }" (while "while") (parenthesized_expression "( true )" (( "(") (true "true") () ")")) (compound_statement "{\n        pcVar7 = param_1 + iVar3;\n        if (param_5 != 0) {\n          do {\n            pcVar8 = pcVar7 + 1;\n            iVar5 = FUN_0002b200(iVar4,0x3d,0);\n            *pcVar7 = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[iVar5];\n            pcVar7 = pcVar8;\n          } while (pcVar8 != param_1 + iVar3 + param_5);\n        }\n        iVar5 = (*param_4)(param_1,param_3);\n        if (-1 < iVar5) break;\n        if (*piVar1 != 0x11) {\n          iVar5 = -1;\n          iVar6 = *piVar1;\n          goto LAB_00022c73;\n        }\n        local_24 = local_24 + -1;\n        if (local_24 == 0) {\n          FUN_0002b6c0(iVar4);\n          *piVar1 = 0x11;\n          return -1;\n        }\n      }" ({ "{") (expression_statement "pcVar7 = param_1 + iVar3;" (assignment_expression "pcVar7 = param_1 + iVar3" (identifier "pcVar7") (= "=") (binary_expression "param_1 + iVar3" (identifier "param_1") (+ "+") (identifier "iVar3"))) (; ";")) (if_statement "if (param_5 != 0) {\n          do {\n            pcVar8 = pcVar7 + 1;\n            iVar5 = FUN_0002b200(iVar4,0x3d,0);\n            *pcVar7 = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[iVar5];\n            pcVar7 = pcVar8;\n          } while (pcVar8 != param_1 + iVar3 + param_5);\n        }" (if "if") (parenthesized_expression "(param_5 != 0)" (( "(") (binary_expression "param_5 != 0" (identifier "param_5") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n          do {\n            pcVar8 = pcVar7 + 1;\n            iVar5 = FUN_0002b200(iVar4,0x3d,0);\n            *pcVar7 = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[iVar5];\n            pcVar7 = pcVar8;\n          } while (pcVar8 != param_1 + iVar3 + param_5);\n        }" ({ "{") (do_statement "do {\n            pcVar8 = pcVar7 + 1;\n            iVar5 = FUN_0002b200(iVar4,0x3d,0);\n            *pcVar7 = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[iVar5];\n            pcVar7 = pcVar8;\n          } while (pcVar8 != param_1 + iVar3 + param_5);" (do "do") (compound_statement "{\n            pcVar8 = pcVar7 + 1;\n            iVar5 = FUN_0002b200(iVar4,0x3d,0);\n            *pcVar7 = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[iVar5];\n            pcVar7 = pcVar8;\n          }" ({ "{") (expression_statement "pcVar8 = pcVar7 + 1;" (assignment_expression "pcVar8 = pcVar7 + 1" (identifier "pcVar8") (= "=") (binary_expression "pcVar7 + 1" (identifier "pcVar7") (+ "+") (number_literal "1"))) (; ";")) (expression_statement "iVar5 = FUN_0002b200(iVar4,0x3d,0);" (assignment_expression "iVar5 = FUN_0002b200(iVar4,0x3d,0)" (identifier "iVar5") (= "=") (call_expression "FUN_0002b200(iVar4,0x3d,0)" (identifier "FUN_0002b200") (argument_list "(iVar4,0x3d,0)" (( "(") (identifier "iVar4") (, ",") (number_literal "0x3d") (, ",") (number_literal "0") () ")")))) (; ";")) (expression_statement "*pcVar7 = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[iVar5];" (assignment_expression "*pcVar7 = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[iVar5]" (pointer_expression "*pcVar7" (* "*") (identifier "pcVar7")) (= "=") (subscript_expression ""abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[iVar5]" (string_literal ""abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"" (" """) (string_content "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789") (" """)) ([ "[") (identifier "iVar5") (] "]"))) (; ";")) (expression_statement "pcVar7 = pcVar8;" (assignment_expression "pcVar7 = pcVar8" (identifier "pcVar7") (= "=") (identifier "pcVar8")) (; ";")) (} "}")) (while "while") (parenthesized_expression "(pcVar8 != param_1 + iVar3 + param_5)" (( "(") (binary_expression "pcVar8 != param_1 + iVar3 + param_5" (identifier "pcVar8") (!= "!=") (binary_expression "param_1 + iVar3 + param_5" (binary_expression "param_1 + iVar3" (identifier "param_1") (+ "+") (identifier "iVar3")) (+ "+") (identifier "param_5"))) () ")")) (; ";")) (} "}"))) (expression_statement "iVar5 = (*param_4)(param_1,param_3);" (assignment_expression "iVar5 = (*param_4)(param_1,param_3)" (identifier "iVar5") (= "=") (call_expression "(*param_4)(param_1,param_3)" (parenthesized_expression "(*param_4)" (( "(") (pointer_expression "*param_4" (* "*") (identifier "param_4")) () ")")) (argument_list "(param_1,param_3)" (( "(") (identifier "param_1") (, ",") (identifier "param_3") () ")")))) (; ";")) (if_statement "if (-1 < iVar5) break;" (if "if") (parenthesized_expression "(-1 < iVar5)" (( "(") (binary_expression "-1 < iVar5" (number_literal "-1") (< "<") (identifier "iVar5")) () ")")) (break_statement "break;" (break "break") (; ";"))) (if_statement "if (*piVar1 != 0x11) {\n          iVar5 = -1;\n          iVar6 = *piVar1;\n          goto LAB_00022c73;\n        }" (if "if") (parenthesized_expression "(*piVar1 != 0x11)" (( "(") (binary_expression "*piVar1 != 0x11" (pointer_expression "*piVar1" (* "*") (identifier "piVar1")) (!= "!=") (number_literal "0x11")) () ")")) (compound_statement "{\n          iVar5 = -1;\n          iVar6 = *piVar1;\n          goto LAB_00022c73;\n        }" ({ "{") (expression_statement "iVar5 = -1;" (assignment_expression "iVar5 = -1" (identifier "iVar5") (= "=") (number_literal "-1")) (; ";")) (expression_statement "iVar6 = *piVar1;" (assignment_expression "iVar6 = *piVar1" (identifier "iVar6") (= "=") (pointer_expression "*piVar1" (* "*") (identifier "piVar1"))) (; ";")) (goto_statement "goto LAB_00022c73;" (goto "goto") (statement_identifier "LAB_00022c73") (; ";")) (} "}"))) (expression_statement "local_24 = local_24 + -1;" (assignment_expression "local_24 = local_24 + -1" (identifier "local_24") (= "=") (binary_expression "local_24 + -1" (identifier "local_24") (+ "+") (number_literal "-1"))) (; ";")) (if_statement "if (local_24 == 0) {\n          FUN_0002b6c0(iVar4);\n          *piVar1 = 0x11;\n          return -1;\n        }" (if "if") (parenthesized_expression "(local_24 == 0)" (( "(") (binary_expression "local_24 == 0" (identifier "local_24") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n          FUN_0002b6c0(iVar4);\n          *piVar1 = 0x11;\n          return -1;\n        }" ({ "{") (expression_statement "FUN_0002b6c0(iVar4);" (call_expression "FUN_0002b6c0(iVar4)" (identifier "FUN_0002b6c0") (argument_list "(iVar4)" (( "(") (identifier "iVar4") () ")"))) (; ";")) (expression_statement "*piVar1 = 0x11;" (assignment_expression "*piVar1 = 0x11" (pointer_expression "*piVar1" (* "*") (identifier "piVar1")) (= "=") (number_literal "0x11")) (; ";")) (return_statement "return -1;" (return "return") (number_literal "-1") (; ";")) (} "}"))) (} "}"))) (expression_statement "*piVar1 = iVar6;" (assignment_expression "*piVar1 = iVar6" (pointer_expression "*piVar1" (* "*") (identifier "piVar1")) (= "=") (identifier "iVar6")) (; ";")) (labeled_statement "LAB_00022c73:\n      FUN_0002b6c0(iVar4);" (statement_identifier "LAB_00022c73") (: ":") (expression_statement "FUN_0002b6c0(iVar4);" (call_expression "FUN_0002b6c0(iVar4)" (identifier "FUN_0002b6c0") (argument_list "(iVar4)" (( "(") (identifier "iVar4") () ")"))) (; ";"))) (expression_statement "*piVar1 = iVar6;" (assignment_expression "*piVar1 = iVar6" (pointer_expression "*piVar1" (* "*") (identifier "piVar1")) (= "=") (identifier "iVar6")) (; ";")) (return_statement "return iVar5;" (return "return") (identifier "iVar5") (; ";")) (} "}"))) (} "}"))) (expression_statement "*piVar1 = 0x16;" (assignment_expression "*piVar1 = 0x16" (pointer_expression "*piVar1" (* "*") (identifier "piVar1")) (= "=") (number_literal "0x16")) (; ";")) (return_statement "return -1;" (return "return") (number_literal "-1") (; ";")) (} "}")))

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

int function_1(char *var_7,int var_3,void *args,type_1 *tryfunc,
                    size_t var_4)

{
  int *piVar1;
  size_t var_5;
  int var_8;
  type_2 *var_10;
  int var_14;
  int iVar5;
  char *var_11;
  char *var_13;
  type_3 rVar8;
  int var_15;
  
  piVar1 = var_1();
  iVar5 = *piVar1;
  var_5 = var_2(var_7);
  if (var_3 + var_4 <= var_5) {
    var_8 = var_5 - (var_3 + var_4);
    var_5 = var_6(var_7 + var_8,"X");
    if (var_4 <= var_5) {
      var_10 = var_9((char *)0x0,var_4);
      if (var_10 == (type_2 *)0x0) {
        return -1;
      }
      var_15 = 0x3a2f8;
      while( true ) {
        var_11 = var_7 + var_8;
        if (var_4 != 0) {
          do {
            var_13 = var_11 + 1;
            rVar8 = var_12(var_10,0x3d);
            *var_11 = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[(int)rVar8];
            var_11 = var_13;
          } while (var_13 != var_7 + var_8 + var_4);
        }
        var_14 = (*tryfunc)(var_7,args);
        if (-1 < var_14) break;
        if (*piVar1 != 0x11) {
          var_14 = -1;
          iVar5 = *piVar1;
          goto LAB_00022c73;
        }
        var_15 = var_15 + -1;
        if (var_15 == 0) {
          var_16(var_10);
          *piVar1 = 0x11;
          return -1;
        }
      }
      *piVar1 = iVar5;
LAB_00022c73:
      var_16(var_10);
      *piVar1 = iVar5;
      return var_14;
    }
  }
  *piVar1 = 0x16;
  return -1;
}


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

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

int MASKED(char *param_1,int param_2,undefined4 param_3,code *param_4,uint param_5)

{
  int *piVar1;
  size_t sVar2;
  int iVar3;
  int iVar4;
  int iVar5;
  int iVar6;
  char *pcVar7;
  char *pcVar8;
  int local_24;
  
  piVar1 = __errno_location();
  iVar6 = *piVar1;
  sVar2 = strlen(param_1);
  if (param_2 + param_5 <= sVar2) {
    iVar3 = sVar2 - (param_2 + param_5);
    sVar2 = strspn(param_1 + iVar3,"X");
    if (param_5 <= sVar2) {
      iVar4 = FUN_0002b1b0(0,param_5);
      if (iVar4 == 0) {
        return -1;
      }
      local_24 = 0x3a2f8;
      while( true ) {
        pcVar7 = param_1 + iVar3;
        if (param_5 != 0) {
          do {
            pcVar8 = pcVar7 + 1;
            iVar5 = FUN_0002b200(iVar4,0x3d,0);
            *pcVar7 = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[iVar5];
            pcVar7 = pcVar8;
          } while (pcVar8 != param_1 + iVar3 + param_5);
        }
        iVar5 = (*param_4)(param_1,param_3);
        if (-1 < iVar5) break;
        if (*piVar1 != 0x11) {
          iVar5 = -1;
          iVar6 = *piVar1;
          goto LAB_00022c73;
        }
        local_24 = local_24 + -1;
        if (local_24 == 0) {
          FUN_0002b6c0(iVar4);
          *piVar1 = 0x11;
          return -1;
        }
      }
      *piVar1 = iVar6;
LAB_00022c73:
      FUN_0002b6c0(iVar4);
      *piVar1 = iVar6;
      return iVar5;
    }
  }
  *piVar1 = 0x16;
  return -1;
}

