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

void set_dirstack_element(intmax_t ind,int sign,char *value)

{
  int iVar1;
  size_t sVar2;
  char *pcVar3;
  char **ppcVar4;
  
  iVar1 = get_dirstack_index(0xa71ac00000000,(int)ind,ind._4_4_);
  if (((ind != 0) && (-1 < iVar1)) && (iVar1 <= directory_list_offset)) {
    free(pushd_directory_list[iVar1]);
    sVar2 = strlen(value);
    pcVar3 = (char *)xmalloc(sVar2 + 1);
    ppcVar4 = pushd_directory_list + iVar1;
    pcVar3 = strcpy(pcVar3,value);
    *ppcVar4 = pcVar3;
    return;
  }
  return;
}



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

void set_dirstack_element(int param_1,int param_2,undefined4 param_3,char *param_4)

{
  int iVar1;
  size_t sVar2;
  char *pcVar3;
  undefined4 *puVar4;
  
  iVar1 = FUN_000a61a0(0);
  if (((param_1 != 0 || param_2 != 0) && (-1 < iVar1)) && (iVar1 <= DAT_00151704)) {
    free(*(void **)(DAT_0015170c + iVar1 * 4));
    sVar2 = strlen(param_4);
    pcVar3 = (char *)xmalloc(sVar2 + 1);
    puVar4 = (undefined4 *)(iVar1 * 4 + DAT_0015170c);
    pcVar3 = strcpy(pcVar3,param_4);
    *puVar4 = pcVar3;
    return;
  }
  return;
}


PUSH EDI
PUSH ESI
PUSH EBX
MOV EDI,dword ptr [ESP + 0x10]
CALL 0x00031ed0
ADD EBX,0xa2e54
MOV ESI,dword ptr [ESP + 0x14]
MOV EAX,EDI
SUB ESP,0x4
MOV EDX,ESI
PUSH 0x0
MOV ECX,dword ptr [ESP + 0x20]
CALL 0x000a61a0
OR EDI,ESI
POP EDX
POP ECX
JZ 0x000a71da
TEST EAX,EAX
JS 0x000a71da
CMP dword ptr [EBX + 0x7704],EAX
JGE 0x000a71e0
POP EBX
POP ESI
POP EDI
RET
MOV EDX,dword ptr [EBX + 0x770c]
SUB ESP,0xc
LEA ESI,[EAX*0x4 + 0x0]
PUSH dword ptr [EDX + EAX*0x4]
CALL 0x0002f200
POP EAX
PUSH dword ptr [ESP + 0x28]
CALL 0x0002f760
ADD EAX,0x1
MOV dword ptr [ESP],EAX
CALL 0x00099200
POP EDX
POP ECX
PUSH dword ptr [ESP + 0x24]
ADD ESI,dword ptr [EBX + 0x770c]
PUSH EAX
CALL 0x0002f580
ADD ESP,0x10
MOV dword ptr [ESI],EAX
POP EBX
POP ESI
POP EDI
RET
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nvoid set_dirstack_element(int param_1,int param_2,undefined4 param_3,char *param_4)\n\n{\n  int iVar1;\n  size_t sVar2;\n  char *pcVar3;\n  undefined4 *puVar4;\n  \n  iVar1 = FUN_000a61a0(0);\n  if (((param_1 != 0 || param_2 != 0) && (-1 < iVar1)) && (iVar1 <= DAT_00151704)) {\n    free(*(void **)(DAT_0015170c + iVar1 * 4));\n    sVar2 = strlen(param_4);\n    pcVar3 = (char *)xmalloc(sVar2 + 1);\n    puVar4 = (undefined4 *)(iVar1 * 4 + DAT_0015170c);\n    pcVar3 = strcpy(pcVar3,param_4);\n    *puVar4 = pcVar3;\n    return;\n  }\n  return;\n}\n\n" comment (function_definition "void set_dirstack_element(int param_1,int param_2,undefined4 param_3,char *param_4)\n\n{\n  int iVar1;\n  size_t sVar2;\n  char *pcVar3;\n  undefined4 *puVar4;\n  \n  iVar1 = FUN_000a61a0(0);\n  if (((param_1 != 0 || param_2 != 0) && (-1 < iVar1)) && (iVar1 <= DAT_00151704)) {\n    free(*(void **)(DAT_0015170c + iVar1 * 4));\n    sVar2 = strlen(param_4);\n    pcVar3 = (char *)xmalloc(sVar2 + 1);\n    puVar4 = (undefined4 *)(iVar1 * 4 + DAT_0015170c);\n    pcVar3 = strcpy(pcVar3,param_4);\n    *puVar4 = pcVar3;\n    return;\n  }\n  return;\n}" primitive_type (function_declarator "set_dirstack_element(int param_1,int param_2,undefined4 param_3,char *param_4)" identifier (parameter_list "(int param_1,int param_2,undefined4 param_3,char *param_4)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "int param_2" primitive_type identifier) , (parameter_declaration "undefined4 param_3" type_identifier identifier) , (parameter_declaration "char *param_4" primitive_type (pointer_declarator "*param_4" * identifier)) ))) (compound_statement "{\n  int iVar1;\n  size_t sVar2;\n  char *pcVar3;\n  undefined4 *puVar4;\n  \n  iVar1 = FUN_000a61a0(0);\n  if (((param_1 != 0 || param_2 != 0) && (-1 < iVar1)) && (iVar1 <= DAT_00151704)) {\n    free(*(void **)(DAT_0015170c + iVar1 * 4));\n    sVar2 = strlen(param_4);\n    pcVar3 = (char *)xmalloc(sVar2 + 1);\n    puVar4 = (undefined4 *)(iVar1 * 4 + DAT_0015170c);\n    pcVar3 = strcpy(pcVar3,param_4);\n    *puVar4 = pcVar3;\n    return;\n  }\n  return;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "size_t sVar2;" primitive_type identifier ;) (declaration "char *pcVar3;" primitive_type (pointer_declarator "*pcVar3" * identifier) ;) (declaration "undefined4 *puVar4;" type_identifier (pointer_declarator "*puVar4" * identifier) ;) (expression_statement "iVar1 = FUN_000a61a0(0);" (assignment_expression "iVar1 = FUN_000a61a0(0)" identifier = (call_expression "FUN_000a61a0(0)" identifier (argument_list "(0)" ( number_literal )))) ;) (if_statement "if (((param_1 != 0 || param_2 != 0) && (-1 < iVar1)) && (iVar1 <= DAT_00151704)) {\n    free(*(void **)(DAT_0015170c + iVar1 * 4));\n    sVar2 = strlen(param_4);\n    pcVar3 = (char *)xmalloc(sVar2 + 1);\n    puVar4 = (undefined4 *)(iVar1 * 4 + DAT_0015170c);\n    pcVar3 = strcpy(pcVar3,param_4);\n    *puVar4 = pcVar3;\n    return;\n  }" if (parenthesized_expression "(((param_1 != 0 || param_2 != 0) && (-1 < iVar1)) && (iVar1 <= DAT_00151704))" ( (binary_expression "((param_1 != 0 || param_2 != 0) && (-1 < iVar1)) && (iVar1 <= DAT_00151704)" (parenthesized_expression "((param_1 != 0 || param_2 != 0) && (-1 < iVar1))" ( (binary_expression "(param_1 != 0 || param_2 != 0) && (-1 < iVar1)" (parenthesized_expression "(param_1 != 0 || param_2 != 0)" ( (binary_expression "param_1 != 0 || param_2 != 0" (binary_expression "param_1 != 0" identifier != number_literal) || (binary_expression "param_2 != 0" identifier != number_literal)) )) && (parenthesized_expression "(-1 < iVar1)" ( (binary_expression "-1 < iVar1" number_literal < identifier) ))) )) && (parenthesized_expression "(iVar1 <= DAT_00151704)" ( (binary_expression "iVar1 <= DAT_00151704" identifier <= identifier) ))) )) (compound_statement "{\n    free(*(void **)(DAT_0015170c + iVar1 * 4));\n    sVar2 = strlen(param_4);\n    pcVar3 = (char *)xmalloc(sVar2 + 1);\n    puVar4 = (undefined4 *)(iVar1 * 4 + DAT_0015170c);\n    pcVar3 = strcpy(pcVar3,param_4);\n    *puVar4 = pcVar3;\n    return;\n  }" { (expression_statement "free(*(void **)(DAT_0015170c + iVar1 * 4));" (call_expression "free(*(void **)(DAT_0015170c + iVar1 * 4))" identifier (argument_list "(*(void **)(DAT_0015170c + iVar1 * 4))" ( (pointer_expression "*(void **)(DAT_0015170c + iVar1 * 4)" * (cast_expression "(void **)(DAT_0015170c + iVar1 * 4)" ( (type_descriptor "void **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(DAT_0015170c + iVar1 * 4)" ( (binary_expression "DAT_0015170c + iVar1 * 4" identifier + (binary_expression "iVar1 * 4" identifier * number_literal)) )))) ))) ;) (expression_statement "sVar2 = strlen(param_4);" (assignment_expression "sVar2 = strlen(param_4)" identifier = (call_expression "strlen(param_4)" identifier (argument_list "(param_4)" ( identifier )))) ;) (expression_statement "pcVar3 = (char *)xmalloc(sVar2 + 1);" (assignment_expression "pcVar3 = (char *)xmalloc(sVar2 + 1)" identifier = (cast_expression "(char *)xmalloc(sVar2 + 1)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "xmalloc(sVar2 + 1)" identifier (argument_list "(sVar2 + 1)" ( (binary_expression "sVar2 + 1" identifier + number_literal) ))))) ;) (expression_statement "puVar4 = (undefined4 *)(iVar1 * 4 + DAT_0015170c);" (assignment_expression "puVar4 = (undefined4 *)(iVar1 * 4 + DAT_0015170c)" identifier = (cast_expression "(undefined4 *)(iVar1 * 4 + DAT_0015170c)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 * 4 + DAT_0015170c)" ( (binary_expression "iVar1 * 4 + DAT_0015170c" (binary_expression "iVar1 * 4" identifier * number_literal) + identifier) )))) ;) (expression_statement "pcVar3 = strcpy(pcVar3,param_4);" (assignment_expression "pcVar3 = strcpy(pcVar3,param_4)" identifier = (call_expression "strcpy(pcVar3,param_4)" identifier (argument_list "(pcVar3,param_4)" ( identifier , identifier )))) ;) (expression_statement "*puVar4 = pcVar3;" (assignment_expression "*puVar4 = pcVar3" (pointer_expression "*puVar4" * identifier) = identifier) ;) (return_statement "return;" return ;) })) (return_statement "return;" return ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nvoid set_dirstack_element(intmax_t ind,int sign,char *value)\n\n{\n  int iVar1;\n  size_t sVar2;\n  char *pcVar3;\n  char **ppcVar4;\n  \n  iVar1 = get_dirstack_index(0xa71ac00000000,(int)ind,ind._4_4_);\n  if (((ind != 0) && (-1 < iVar1)) && (iVar1 <= directory_list_offset)) {\n    free(pushd_directory_list[iVar1]);\n    sVar2 = strlen(value);\n    pcVar3 = (char *)xmalloc(sVar2 + 1);\n    ppcVar4 = pushd_directory_list + iVar1;\n    pcVar3 = strcpy(pcVar3,value);\n    *ppcVar4 = pcVar3;\n    return;\n  }\n  return;\n}\n\n" comment (function_definition "void set_dirstack_element(intmax_t ind,int sign,char *value)\n\n{\n  int iVar1;\n  size_t sVar2;\n  char *pcVar3;\n  char **ppcVar4;\n  \n  iVar1 = get_dirstack_index(0xa71ac00000000,(int)ind,ind._4_4_);\n  if (((ind != 0) && (-1 < iVar1)) && (iVar1 <= directory_list_offset)) {\n    free(pushd_directory_list[iVar1]);\n    sVar2 = strlen(value);\n    pcVar3 = (char *)xmalloc(sVar2 + 1);\n    ppcVar4 = pushd_directory_list + iVar1;\n    pcVar3 = strcpy(pcVar3,value);\n    *ppcVar4 = pcVar3;\n    return;\n  }\n  return;\n}" primitive_type (function_declarator "set_dirstack_element(intmax_t ind,int sign,char *value)" identifier (parameter_list "(intmax_t ind,int sign,char *value)" ( (parameter_declaration "intmax_t ind" type_identifier identifier) , (parameter_declaration "int sign" primitive_type identifier) , (parameter_declaration "char *value" primitive_type (pointer_declarator "*value" * identifier)) ))) (compound_statement "{\n  int iVar1;\n  size_t sVar2;\n  char *pcVar3;\n  char **ppcVar4;\n  \n  iVar1 = get_dirstack_index(0xa71ac00000000,(int)ind,ind._4_4_);\n  if (((ind != 0) && (-1 < iVar1)) && (iVar1 <= directory_list_offset)) {\n    free(pushd_directory_list[iVar1]);\n    sVar2 = strlen(value);\n    pcVar3 = (char *)xmalloc(sVar2 + 1);\n    ppcVar4 = pushd_directory_list + iVar1;\n    pcVar3 = strcpy(pcVar3,value);\n    *ppcVar4 = pcVar3;\n    return;\n  }\n  return;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "size_t sVar2;" primitive_type identifier ;) (declaration "char *pcVar3;" primitive_type (pointer_declarator "*pcVar3" * identifier) ;) (declaration "char **ppcVar4;" primitive_type (pointer_declarator "**ppcVar4" * (pointer_declarator "*ppcVar4" * identifier)) ;) (expression_statement "iVar1 = get_dirstack_index(0xa71ac00000000,(int)ind,ind._4_4_);" (assignment_expression "iVar1 = get_dirstack_index(0xa71ac00000000,(int)ind,ind._4_4_)" identifier = (call_expression "get_dirstack_index(0xa71ac00000000,(int)ind,ind._4_4_)" identifier (argument_list "(0xa71ac00000000,(int)ind,ind._4_4_)" ( number_literal , (cast_expression "(int)ind" ( (type_descriptor "int" primitive_type) ) identifier) , (field_expression "ind._4_4_" identifier . field_identifier) )))) ;) (if_statement "if (((ind != 0) && (-1 < iVar1)) && (iVar1 <= directory_list_offset)) {\n    free(pushd_directory_list[iVar1]);\n    sVar2 = strlen(value);\n    pcVar3 = (char *)xmalloc(sVar2 + 1);\n    ppcVar4 = pushd_directory_list + iVar1;\n    pcVar3 = strcpy(pcVar3,value);\n    *ppcVar4 = pcVar3;\n    return;\n  }" if (parenthesized_expression "(((ind != 0) && (-1 < iVar1)) && (iVar1 <= directory_list_offset))" ( (binary_expression "((ind != 0) && (-1 < iVar1)) && (iVar1 <= directory_list_offset)" (parenthesized_expression "((ind != 0) && (-1 < iVar1))" ( (binary_expression "(ind != 0) && (-1 < iVar1)" (parenthesized_expression "(ind != 0)" ( (binary_expression "ind != 0" identifier != number_literal) )) && (parenthesized_expression "(-1 < iVar1)" ( (binary_expression "-1 < iVar1" number_literal < identifier) ))) )) && (parenthesized_expression "(iVar1 <= directory_list_offset)" ( (binary_expression "iVar1 <= directory_list_offset" identifier <= identifier) ))) )) (compound_statement "{\n    free(pushd_directory_list[iVar1]);\n    sVar2 = strlen(value);\n    pcVar3 = (char *)xmalloc(sVar2 + 1);\n    ppcVar4 = pushd_directory_list + iVar1;\n    pcVar3 = strcpy(pcVar3,value);\n    *ppcVar4 = pcVar3;\n    return;\n  }" { (expression_statement "free(pushd_directory_list[iVar1]);" (call_expression "free(pushd_directory_list[iVar1])" identifier (argument_list "(pushd_directory_list[iVar1])" ( (subscript_expression "pushd_directory_list[iVar1]" identifier [ identifier ]) ))) ;) (expression_statement "sVar2 = strlen(value);" (assignment_expression "sVar2 = strlen(value)" identifier = (call_expression "strlen(value)" identifier (argument_list "(value)" ( identifier )))) ;) (expression_statement "pcVar3 = (char *)xmalloc(sVar2 + 1);" (assignment_expression "pcVar3 = (char *)xmalloc(sVar2 + 1)" identifier = (cast_expression "(char *)xmalloc(sVar2 + 1)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "xmalloc(sVar2 + 1)" identifier (argument_list "(sVar2 + 1)" ( (binary_expression "sVar2 + 1" identifier + number_literal) ))))) ;) (expression_statement "ppcVar4 = pushd_directory_list + iVar1;" (assignment_expression "ppcVar4 = pushd_directory_list + iVar1" identifier = (binary_expression "pushd_directory_list + iVar1" identifier + identifier)) ;) (expression_statement "pcVar3 = strcpy(pcVar3,value);" (assignment_expression "pcVar3 = strcpy(pcVar3,value)" identifier = (call_expression "strcpy(pcVar3,value)" identifier (argument_list "(pcVar3,value)" ( identifier , identifier )))) ;) (expression_statement "*ppcVar4 = pcVar3;" (assignment_expression "*ppcVar4 = pcVar3" (pointer_expression "*ppcVar4" * identifier) = identifier) ;) (return_statement "return;" return ;) })) (return_statement "return;" return ;) })))
(translation_unit "void set_dirstack_element(int param_1,int param_2,undefined4 param_3,char *param_4)\n\n{\n  int iVar1;\n  size_t sVar2;\n  char *pcVar3;\n  undefined4 *puVar4;\n  \n  iVar1 = FUN_000a61a0(0);\n  if (((param_1 != 0 || param_2 != 0) && (-1 < iVar1)) && (iVar1 <= DAT_00151704)) {\n    free(*(void **)(DAT_0015170c + iVar1 * 4));\n    sVar2 = strlen(param_4);\n    pcVar3 = (char *)xmalloc(sVar2 + 1);\n    puVar4 = (undefined4 *)(iVar1 * 4 + DAT_0015170c);\n    pcVar3 = strcpy(pcVar3,param_4);\n    *puVar4 = pcVar3;\n    return;\n  }\n  return;\n}\n\n" (function_definition "void set_dirstack_element(int param_1,int param_2,undefined4 param_3,char *param_4)\n\n{\n  int iVar1;\n  size_t sVar2;\n  char *pcVar3;\n  undefined4 *puVar4;\n  \n  iVar1 = FUN_000a61a0(0);\n  if (((param_1 != 0 || param_2 != 0) && (-1 < iVar1)) && (iVar1 <= DAT_00151704)) {\n    free(*(void **)(DAT_0015170c + iVar1 * 4));\n    sVar2 = strlen(param_4);\n    pcVar3 = (char *)xmalloc(sVar2 + 1);\n    puVar4 = (undefined4 *)(iVar1 * 4 + DAT_0015170c);\n    pcVar3 = strcpy(pcVar3,param_4);\n    *puVar4 = pcVar3;\n    return;\n  }\n  return;\n}" primitive_type (function_declarator "set_dirstack_element(int param_1,int param_2,undefined4 param_3,char *param_4)" identifier (parameter_list "(int param_1,int param_2,undefined4 param_3,char *param_4)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "int param_2" primitive_type identifier) , (parameter_declaration "undefined4 param_3" type_identifier identifier) , (parameter_declaration "char *param_4" primitive_type (pointer_declarator "*param_4" * identifier)) ))) (compound_statement "{\n  int iVar1;\n  size_t sVar2;\n  char *pcVar3;\n  undefined4 *puVar4;\n  \n  iVar1 = FUN_000a61a0(0);\n  if (((param_1 != 0 || param_2 != 0) && (-1 < iVar1)) && (iVar1 <= DAT_00151704)) {\n    free(*(void **)(DAT_0015170c + iVar1 * 4));\n    sVar2 = strlen(param_4);\n    pcVar3 = (char *)xmalloc(sVar2 + 1);\n    puVar4 = (undefined4 *)(iVar1 * 4 + DAT_0015170c);\n    pcVar3 = strcpy(pcVar3,param_4);\n    *puVar4 = pcVar3;\n    return;\n  }\n  return;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "size_t sVar2;" primitive_type identifier ;) (declaration "char *pcVar3;" primitive_type (pointer_declarator "*pcVar3" * identifier) ;) (declaration "undefined4 *puVar4;" type_identifier (pointer_declarator "*puVar4" * identifier) ;) (expression_statement "iVar1 = FUN_000a61a0(0);" (assignment_expression "iVar1 = FUN_000a61a0(0)" identifier = (call_expression "FUN_000a61a0(0)" identifier (argument_list "(0)" ( number_literal )))) ;) (if_statement "if (((param_1 != 0 || param_2 != 0) && (-1 < iVar1)) && (iVar1 <= DAT_00151704)) {\n    free(*(void **)(DAT_0015170c + iVar1 * 4));\n    sVar2 = strlen(param_4);\n    pcVar3 = (char *)xmalloc(sVar2 + 1);\n    puVar4 = (undefined4 *)(iVar1 * 4 + DAT_0015170c);\n    pcVar3 = strcpy(pcVar3,param_4);\n    *puVar4 = pcVar3;\n    return;\n  }" if (parenthesized_expression "(((param_1 != 0 || param_2 != 0) && (-1 < iVar1)) && (iVar1 <= DAT_00151704))" ( (binary_expression "((param_1 != 0 || param_2 != 0) && (-1 < iVar1)) && (iVar1 <= DAT_00151704)" (parenthesized_expression "((param_1 != 0 || param_2 != 0) && (-1 < iVar1))" ( (binary_expression "(param_1 != 0 || param_2 != 0) && (-1 < iVar1)" (parenthesized_expression "(param_1 != 0 || param_2 != 0)" ( (binary_expression "param_1 != 0 || param_2 != 0" (binary_expression "param_1 != 0" identifier != number_literal) || (binary_expression "param_2 != 0" identifier != number_literal)) )) && (parenthesized_expression "(-1 < iVar1)" ( (binary_expression "-1 < iVar1" number_literal < identifier) ))) )) && (parenthesized_expression "(iVar1 <= DAT_00151704)" ( (binary_expression "iVar1 <= DAT_00151704" identifier <= identifier) ))) )) (compound_statement "{\n    free(*(void **)(DAT_0015170c + iVar1 * 4));\n    sVar2 = strlen(param_4);\n    pcVar3 = (char *)xmalloc(sVar2 + 1);\n    puVar4 = (undefined4 *)(iVar1 * 4 + DAT_0015170c);\n    pcVar3 = strcpy(pcVar3,param_4);\n    *puVar4 = pcVar3;\n    return;\n  }" { (expression_statement "free(*(void **)(DAT_0015170c + iVar1 * 4));" (call_expression "free(*(void **)(DAT_0015170c + iVar1 * 4))" identifier (argument_list "(*(void **)(DAT_0015170c + iVar1 * 4))" ( (pointer_expression "*(void **)(DAT_0015170c + iVar1 * 4)" * (cast_expression "(void **)(DAT_0015170c + iVar1 * 4)" ( (type_descriptor "void **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(DAT_0015170c + iVar1 * 4)" ( (binary_expression "DAT_0015170c + iVar1 * 4" identifier + (binary_expression "iVar1 * 4" identifier * number_literal)) )))) ))) ;) (expression_statement "sVar2 = strlen(param_4);" (assignment_expression "sVar2 = strlen(param_4)" identifier = (call_expression "strlen(param_4)" identifier (argument_list "(param_4)" ( identifier )))) ;) (expression_statement "pcVar3 = (char *)xmalloc(sVar2 + 1);" (assignment_expression "pcVar3 = (char *)xmalloc(sVar2 + 1)" identifier = (cast_expression "(char *)xmalloc(sVar2 + 1)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "xmalloc(sVar2 + 1)" identifier (argument_list "(sVar2 + 1)" ( (binary_expression "sVar2 + 1" identifier + number_literal) ))))) ;) (expression_statement "puVar4 = (undefined4 *)(iVar1 * 4 + DAT_0015170c);" (assignment_expression "puVar4 = (undefined4 *)(iVar1 * 4 + DAT_0015170c)" identifier = (cast_expression "(undefined4 *)(iVar1 * 4 + DAT_0015170c)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 * 4 + DAT_0015170c)" ( (binary_expression "iVar1 * 4 + DAT_0015170c" (binary_expression "iVar1 * 4" identifier * number_literal) + identifier) )))) ;) (expression_statement "pcVar3 = strcpy(pcVar3,param_4);" (assignment_expression "pcVar3 = strcpy(pcVar3,param_4)" identifier = (call_expression "strcpy(pcVar3,param_4)" identifier (argument_list "(pcVar3,param_4)" ( identifier , identifier )))) ;) (expression_statement "*puVar4 = pcVar3;" (assignment_expression "*puVar4 = pcVar3" (pointer_expression "*puVar4" * identifier) = identifier) ;) (return_statement "return;" return ;) })) (return_statement "return;" return ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE (pointer_declarator * IDENT)) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( LIT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (binary_expression IDENT != LIT) || (binary_expression IDENT != LIT)) )) && (parenthesized_expression ( (binary_expression LIT < IDENT) ))) )) && (parenthesized_expression ( (binary_expression IDENT <= IDENT) ))) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression IDENT + (binary_expression IDENT * LIT)) )))) ))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression IDENT (argument_list ( (binary_expression IDENT + LIT) ))))) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (binary_expression IDENT * LIT) + IDENT) )))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT )))) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (return_statement return ;) })) (return_statement return ;) })))
(function_definition "void set_dirstack_element(int param_1,int param_2,undefined4 param_3,char *param_4)\n\n{\n  int iVar1;\n  size_t sVar2;\n  char *pcVar3;\n  undefined4 *puVar4;\n  \n  iVar1 = FUN_000a61a0(0);\n  if (((param_1 != 0 || param_2 != 0) && (-1 < iVar1)) && (iVar1 <= DAT_00151704)) {\n    free(*(void **)(DAT_0015170c + iVar1 * 4));\n    sVar2 = strlen(param_4);\n    pcVar3 = (char *)xmalloc(sVar2 + 1);\n    puVar4 = (undefined4 *)(iVar1 * 4 + DAT_0015170c);\n    pcVar3 = strcpy(pcVar3,param_4);\n    *puVar4 = pcVar3;\n    return;\n  }\n  return;\n}" (primitive_type "void") (function_declarator "set_dirstack_element(int param_1,int param_2,undefined4 param_3,char *param_4)" (identifier "set_dirstack_element") (parameter_list "(int param_1,int param_2,undefined4 param_3,char *param_4)" (( "(") (parameter_declaration "int param_1" (primitive_type "int") (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 "char *param_4" (primitive_type "char") (pointer_declarator "*param_4" (* "*") (identifier "param_4"))) () ")"))) (compound_statement "{\n  int iVar1;\n  size_t sVar2;\n  char *pcVar3;\n  undefined4 *puVar4;\n  \n  iVar1 = FUN_000a61a0(0);\n  if (((param_1 != 0 || param_2 != 0) && (-1 < iVar1)) && (iVar1 <= DAT_00151704)) {\n    free(*(void **)(DAT_0015170c + iVar1 * 4));\n    sVar2 = strlen(param_4);\n    pcVar3 = (char *)xmalloc(sVar2 + 1);\n    puVar4 = (undefined4 *)(iVar1 * 4 + DAT_0015170c);\n    pcVar3 = strcpy(pcVar3,param_4);\n    *puVar4 = pcVar3;\n    return;\n  }\n  return;\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "size_t sVar2;" (primitive_type "size_t") (identifier "sVar2") (; ";")) (declaration "char *pcVar3;" (primitive_type "char") (pointer_declarator "*pcVar3" (* "*") (identifier "pcVar3")) (; ";")) (declaration "undefined4 *puVar4;" (type_identifier "undefined4") (pointer_declarator "*puVar4" (* "*") (identifier "puVar4")) (; ";")) (expression_statement "iVar1 = FUN_000a61a0(0);" (assignment_expression "iVar1 = FUN_000a61a0(0)" (identifier "iVar1") (= "=") (call_expression "FUN_000a61a0(0)" (identifier "FUN_000a61a0") (argument_list "(0)" (( "(") (number_literal "0") () ")")))) (; ";")) (if_statement "if (((param_1 != 0 || param_2 != 0) && (-1 < iVar1)) && (iVar1 <= DAT_00151704)) {\n    free(*(void **)(DAT_0015170c + iVar1 * 4));\n    sVar2 = strlen(param_4);\n    pcVar3 = (char *)xmalloc(sVar2 + 1);\n    puVar4 = (undefined4 *)(iVar1 * 4 + DAT_0015170c);\n    pcVar3 = strcpy(pcVar3,param_4);\n    *puVar4 = pcVar3;\n    return;\n  }" (if "if") (parenthesized_expression "(((param_1 != 0 || param_2 != 0) && (-1 < iVar1)) && (iVar1 <= DAT_00151704))" (( "(") (binary_expression "((param_1 != 0 || param_2 != 0) && (-1 < iVar1)) && (iVar1 <= DAT_00151704)" (parenthesized_expression "((param_1 != 0 || param_2 != 0) && (-1 < iVar1))" (( "(") (binary_expression "(param_1 != 0 || param_2 != 0) && (-1 < iVar1)" (parenthesized_expression "(param_1 != 0 || param_2 != 0)" (( "(") (binary_expression "param_1 != 0 || param_2 != 0" (binary_expression "param_1 != 0" (identifier "param_1") (!= "!=") (number_literal "0")) (|| "||") (binary_expression "param_2 != 0" (identifier "param_2") (!= "!=") (number_literal "0"))) () ")")) (&& "&&") (parenthesized_expression "(-1 < iVar1)" (( "(") (binary_expression "-1 < iVar1" (number_literal "-1") (< "<") (identifier "iVar1")) () ")"))) () ")")) (&& "&&") (parenthesized_expression "(iVar1 <= DAT_00151704)" (( "(") (binary_expression "iVar1 <= DAT_00151704" (identifier "iVar1") (<= "<=") (identifier "DAT_00151704")) () ")"))) () ")")) (compound_statement "{\n    free(*(void **)(DAT_0015170c + iVar1 * 4));\n    sVar2 = strlen(param_4);\n    pcVar3 = (char *)xmalloc(sVar2 + 1);\n    puVar4 = (undefined4 *)(iVar1 * 4 + DAT_0015170c);\n    pcVar3 = strcpy(pcVar3,param_4);\n    *puVar4 = pcVar3;\n    return;\n  }" ({ "{") (expression_statement "free(*(void **)(DAT_0015170c + iVar1 * 4));" (call_expression "free(*(void **)(DAT_0015170c + iVar1 * 4))" (identifier "free") (argument_list "(*(void **)(DAT_0015170c + iVar1 * 4))" (( "(") (pointer_expression "*(void **)(DAT_0015170c + iVar1 * 4)" (* "*") (cast_expression "(void **)(DAT_0015170c + iVar1 * 4)" (( "(") (type_descriptor "void **" (primitive_type "void") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(DAT_0015170c + iVar1 * 4)" (( "(") (binary_expression "DAT_0015170c + iVar1 * 4" (identifier "DAT_0015170c") (+ "+") (binary_expression "iVar1 * 4" (identifier "iVar1") (* "*") (number_literal "4"))) () ")")))) () ")"))) (; ";")) (expression_statement "sVar2 = strlen(param_4);" (assignment_expression "sVar2 = strlen(param_4)" (identifier "sVar2") (= "=") (call_expression "strlen(param_4)" (identifier "strlen") (argument_list "(param_4)" (( "(") (identifier "param_4") () ")")))) (; ";")) (expression_statement "pcVar3 = (char *)xmalloc(sVar2 + 1);" (assignment_expression "pcVar3 = (char *)xmalloc(sVar2 + 1)" (identifier "pcVar3") (= "=") (cast_expression "(char *)xmalloc(sVar2 + 1)" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "xmalloc(sVar2 + 1)" (identifier "xmalloc") (argument_list "(sVar2 + 1)" (( "(") (binary_expression "sVar2 + 1" (identifier "sVar2") (+ "+") (number_literal "1")) () ")"))))) (; ";")) (expression_statement "puVar4 = (undefined4 *)(iVar1 * 4 + DAT_0015170c);" (assignment_expression "puVar4 = (undefined4 *)(iVar1 * 4 + DAT_0015170c)" (identifier "puVar4") (= "=") (cast_expression "(undefined4 *)(iVar1 * 4 + DAT_0015170c)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar1 * 4 + DAT_0015170c)" (( "(") (binary_expression "iVar1 * 4 + DAT_0015170c" (binary_expression "iVar1 * 4" (identifier "iVar1") (* "*") (number_literal "4")) (+ "+") (identifier "DAT_0015170c")) () ")")))) (; ";")) (expression_statement "pcVar3 = strcpy(pcVar3,param_4);" (assignment_expression "pcVar3 = strcpy(pcVar3,param_4)" (identifier "pcVar3") (= "=") (call_expression "strcpy(pcVar3,param_4)" (identifier "strcpy") (argument_list "(pcVar3,param_4)" (( "(") (identifier "pcVar3") (, ",") (identifier "param_4") () ")")))) (; ";")) (expression_statement "*puVar4 = pcVar3;" (assignment_expression "*puVar4 = pcVar3" (pointer_expression "*puVar4" (* "*") (identifier "puVar4")) (= "=") (identifier "pcVar3")) (; ";")) (return_statement "return;" (return "return") (; ";")) (} "}"))) (return_statement "return;" (return "return") (; ";")) (} "}")))

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

void function_1(type_1 var_2,int sign,char *value)

{
  int var_3;
  size_t var_8;
  char *pcVar3;
  char **ppcVar4;
  
  var_3 = var_1(0xa71ac00000000,(int)var_2,var_2._4_4_);
  if (((var_2 != 0) && (-1 < var_3)) && (var_3 <= var_4)) {
    var_5(var_9[var_3]);
    var_8 = var_6(value);
    pcVar3 = (char *)var_7(var_8 + 1);
    ppcVar4 = var_9 + var_3;
    pcVar3 = var_10(pcVar3,value);
    *ppcVar4 = pcVar3;
    return;
  }
  return;
}


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

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

void MASKED(int param_1,int param_2,undefined4 param_3,char *param_4)

{
  int iVar1;
  size_t sVar2;
  char *pcVar3;
  undefined4 *puVar4;
  
  iVar1 = FUN_000a61a0(0);
  if (((param_1 != 0 || param_2 != 0) && (-1 < iVar1)) && (iVar1 <= DAT_00151704)) {
    free(*(void **)(DAT_0015170c + iVar1 * 4));
    sVar2 = strlen(param_4);
    pcVar3 = (char *)xmalloc(sVar2 + 1);
    puVar4 = (undefined4 *)(iVar1 * 4 + DAT_0015170c);
    pcVar3 = strcpy(pcVar3,param_4);
    *puVar4 = pcVar3;
    return;
  }
  return;
}

