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

int force_linkat(int srcdir,char *srcname,int dstdir,char *dstname,int flags,_Bool force)

{
  int iVar1;
  int iVar2;
  int *piVar3;
  char *tmpl;
  int iVar4;
  int in_GS_OFFSET;
  link_arg arg;
  char buf [256];
  
  iVar1 = *(int *)(in_GS_OFFSET + 0x14);
  iVar2 = linkat(srcdir,srcname,dstdir,dstname,flags);
  if ((force) && (iVar2 != 0)) {
    piVar3 = __errno_location();
    if (*piVar3 == 0x11) {
      tmpl = samedir_template(dstname,buf);
      if (tmpl == (char *)0x0) {
        iVar2 = -1;
      }
      else {
        arg.srcname = srcname;
        arg.srcdir = srcdir;
        arg.dstdir = dstdir;
        arg.flags = flags;
        iVar2 = try_tempname_len(tmpl,0,&arg,try_link,6);
        if (iVar2 == 0) {
          iVar4 = renameat(dstdir,tmpl,dstdir,dstname);
          if (iVar4 != 0) {
            iVar4 = *piVar3;
          }
          unlinkat(dstdir,tmpl,0);
        }
        else {
          iVar4 = *piVar3;
        }
        if (tmpl != buf) {
          free(tmpl);
        }
        iVar2 = 1;
        if (iVar4 != 0) {
          *piVar3 = iVar4;
          iVar2 = -1;
        }
      }
    }
  }
  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {
    return iVar2;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail_local();
}



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

int FUN_0001ac40(int param_1,char *param_2,int param_3,char *param_4,int param_5,char param_6)

{
  int iVar1;
  int *piVar2;
  char *__old;
  int iVar3;
  int in_GS_OFFSET;
  int local_130;
  char *local_12c;
  int local_128;
  int local_124;
  char local_120 [256];
  int local_20;
  undefined4 uStack_14;
  
  uStack_14 = 0x1ac49;
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  iVar1 = linkat(param_1,param_2,param_3,param_4,param_5);
  if ((param_6 == '\x01') && (iVar1 != 0)) {
    piVar2 = __errno_location();
    if (*piVar2 == 0x11) {
      __old = (char *)FUN_0001ab90();
      if (__old == (char *)0x0) {
        iVar1 = -1;
      }
      else {
        local_12c = param_2;
        local_130 = param_1;
        local_128 = param_3;
        local_124 = param_5;
        iVar1 = FUN_00021460(__old,0,&local_130,FUN_0001ab60,6);
        if (iVar1 == 0) {
          iVar3 = renameat(param_3,__old,param_3,param_4);
          if (iVar3 != 0) {
            iVar3 = *piVar2;
          }
          unlinkat(param_3,__old,0);
        }
        else {
          iVar3 = *piVar2;
        }
        if (__old != local_120) {
          free(__old);
        }
        iVar1 = 1;
        if (iVar3 != 0) {
          *piVar2 = iVar3;
          iVar1 = -1;
        }
      }
    }
  }
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return iVar1;
  }
                    /* WARNING: Subroutine does not return */
  FUN_0002bcb0();
}


PUSH EBP
PUSH EDI
PUSH ESI
PUSH EBX
CALL 0x000132c0
ADD EBX,0x1e3b7
SUB ESP,0x148
MOV EAX,GS:[0x14]
MOV dword ptr [ESP + 0x138],EAX
XOR EAX,EAX
MOV EDI,dword ptr [ESP + 0x160]
MOV ESI,dword ptr [ESP + 0x168]
MOV EBP,dword ptr [ESP + 0x170]
PUSH dword ptr [ESP + 0x16c]
PUSH ESI
PUSH dword ptr [ESP + 0x16c]
PUSH EDI
PUSH dword ptr [ESP + 0x16c]
CALL 0x000125e0
ADD ESP,0x20
MOV EDX,EAX
MOV EAX,EBP
CMP AL,0x1
JNZ 0x0001acb8
TEST EDX,EDX
JZ 0x0001acb8
MOV dword ptr [ESP + 0x8],EDX
CALL 0x00012590
MOV EDX,dword ptr [ESP + 0x8]
CMP dword ptr [EAX],0x11
MOV EBP,EAX
JZ 0x0001ace0
MOV ECX,dword ptr [ESP + 0x12c]
XOR ECX,dword ptr GS:[0x14]
MOV EAX,EDX
JNZ 0x0001add2
ADD ESP,0x13c
POP EBX
POP ESI
POP EDI
POP EBP
RET
LEA EAX,[ESP + 0x2c]
MOV EDX,EAX
MOV dword ptr [ESP + 0x8],EAX
MOV EAX,ESI
CALL 0x0001ab90
MOV EDX,EAX
TEST EAX,EAX
JZ 0x0001adc8
MOV EAX,dword ptr [ESP + 0x150]
MOV dword ptr [ESP + 0x20],EDI
SUB ESP,0xc
MOV dword ptr [ESP + 0x28],EAX
MOV EAX,dword ptr [ESP + 0x164]
MOV dword ptr [ESP + 0x30],EAX
MOV EAX,dword ptr [ESP + 0x16c]
MOV dword ptr [ESP + 0x34],EAX
LEA EAX,[EBX + 0xfffe1b60]
PUSH 0x6
PUSH EAX
LEA EAX,[ESP + 0x30]
PUSH EAX
PUSH 0x0
PUSH EDX
MOV dword ptr [ESP + 0x2c],EDX
CALL 0x00021460
ADD ESP,0x20
MOV EDX,dword ptr [ESP + 0xc]
TEST EAX,EAX
JZ 0x0001ad80
MOV ESI,dword ptr [EBP]
CMP EDX,dword ptr [ESP + 0x8]
JZ 0x0001ad5d
SUB ESP,0xc
PUSH EDX
CALL 0x00012970
ADD ESP,0x10
MOV EDX,0x1
TEST ESI,ESI
JZ 0x0001acb8
MOV dword ptr [EBP],ESI
MOV EDX,0xffffffff
JMP 0x0001acb8
PUSH ESI
PUSH dword ptr [ESP + 0x15c]
PUSH EDX
MOV dword ptr [ESP + 0x18],EDX
PUSH dword ptr [ESP + 0x164]
CALL 0x00012760
ADD ESP,0x10
MOV EDX,dword ptr [ESP + 0xc]
TEST EAX,EAX
MOV ESI,EAX
JZ 0x0001ada9
MOV ESI,dword ptr [EBP]
SUB ESP,0x4
PUSH 0x0
PUSH EDX
MOV dword ptr [ESP + 0x18],EDX
PUSH dword ptr [ESP + 0x164]
CALL 0x00012110
ADD ESP,0x10
MOV EDX,dword ptr [ESP + 0xc]
JMP 0x0001ad4b
MOV EDX,0xffffffff
JMP 0x0001acb8
CALL 0x0002bcb0
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nint FUN_0001ac40(int param_1,char *param_2,int param_3,char *param_4,int param_5,char param_6)\n\n{\n  int iVar1;\n  int *piVar2;\n  char *__old;\n  int iVar3;\n  int in_GS_OFFSET;\n  int local_130;\n  char *local_12c;\n  int local_128;\n  int local_124;\n  char local_120 [256];\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x1ac49;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  iVar1 = linkat(param_1,param_2,param_3,param_4,param_5);\n  if ((param_6 == '\x01') && (iVar1 != 0)) {\n    piVar2 = __errno_location();\n    if (*piVar2 == 0x11) {\n      __old = (char *)FUN_0001ab90();\n      if (__old == (char *)0x0) {\n        iVar1 = -1;\n      }\n      else {\n        local_12c = param_2;\n        local_130 = param_1;\n        local_128 = param_3;\n        local_124 = param_5;\n        iVar1 = FUN_00021460(__old,0,&local_130,FUN_0001ab60,6);\n        if (iVar1 == 0) {\n          iVar3 = renameat(param_3,__old,param_3,param_4);\n          if (iVar3 != 0) {\n            iVar3 = *piVar2;\n          }\n          unlinkat(param_3,__old,0);\n        }\n        else {\n          iVar3 = *piVar2;\n        }\n        if (__old != local_120) {\n          free(__old);\n        }\n        iVar1 = 1;\n        if (iVar3 != 0) {\n          *piVar2 = iVar3;\n          iVar1 = -1;\n        }\n      }\n    }\n  }\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return iVar1;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_0002bcb0();\n}\n\n" comment (function_definition "int FUN_0001ac40(int param_1,char *param_2,int param_3,char *param_4,int param_5,char param_6)\n\n{\n  int iVar1;\n  int *piVar2;\n  char *__old;\n  int iVar3;\n  int in_GS_OFFSET;\n  int local_130;\n  char *local_12c;\n  int local_128;\n  int local_124;\n  char local_120 [256];\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x1ac49;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  iVar1 = linkat(param_1,param_2,param_3,param_4,param_5);\n  if ((param_6 == '\x01') && (iVar1 != 0)) {\n    piVar2 = __errno_location();\n    if (*piVar2 == 0x11) {\n      __old = (char *)FUN_0001ab90();\n      if (__old == (char *)0x0) {\n        iVar1 = -1;\n      }\n      else {\n        local_12c = param_2;\n        local_130 = param_1;\n        local_128 = param_3;\n        local_124 = param_5;\n        iVar1 = FUN_00021460(__old,0,&local_130,FUN_0001ab60,6);\n        if (iVar1 == 0) {\n          iVar3 = renameat(param_3,__old,param_3,param_4);\n          if (iVar3 != 0) {\n            iVar3 = *piVar2;\n          }\n          unlinkat(param_3,__old,0);\n        }\n        else {\n          iVar3 = *piVar2;\n        }\n        if (__old != local_120) {\n          free(__old);\n        }\n        iVar1 = 1;\n        if (iVar3 != 0) {\n          *piVar2 = iVar3;\n          iVar1 = -1;\n        }\n      }\n    }\n  }\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return iVar1;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_0002bcb0();\n}" primitive_type (function_declarator "FUN_0001ac40(int param_1,char *param_2,int param_3,char *param_4,int param_5,char param_6)" identifier (parameter_list "(int param_1,char *param_2,int param_3,char *param_4,int param_5,char param_6)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "char *param_2" primitive_type (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "int param_3" primitive_type identifier) , (parameter_declaration "char *param_4" primitive_type (pointer_declarator "*param_4" * identifier)) , (parameter_declaration "int param_5" primitive_type identifier) , (parameter_declaration "char param_6" primitive_type identifier) ))) (compound_statement "{\n  int iVar1;\n  int *piVar2;\n  char *__old;\n  int iVar3;\n  int in_GS_OFFSET;\n  int local_130;\n  char *local_12c;\n  int local_128;\n  int local_124;\n  char local_120 [256];\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x1ac49;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  iVar1 = linkat(param_1,param_2,param_3,param_4,param_5);\n  if ((param_6 == '\x01') && (iVar1 != 0)) {\n    piVar2 = __errno_location();\n    if (*piVar2 == 0x11) {\n      __old = (char *)FUN_0001ab90();\n      if (__old == (char *)0x0) {\n        iVar1 = -1;\n      }\n      else {\n        local_12c = param_2;\n        local_130 = param_1;\n        local_128 = param_3;\n        local_124 = param_5;\n        iVar1 = FUN_00021460(__old,0,&local_130,FUN_0001ab60,6);\n        if (iVar1 == 0) {\n          iVar3 = renameat(param_3,__old,param_3,param_4);\n          if (iVar3 != 0) {\n            iVar3 = *piVar2;\n          }\n          unlinkat(param_3,__old,0);\n        }\n        else {\n          iVar3 = *piVar2;\n        }\n        if (__old != local_120) {\n          free(__old);\n        }\n        iVar1 = 1;\n        if (iVar3 != 0) {\n          *piVar2 = iVar3;\n          iVar1 = -1;\n        }\n      }\n    }\n  }\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return iVar1;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_0002bcb0();\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int *piVar2;" primitive_type (pointer_declarator "*piVar2" * identifier) ;) (declaration "char *__old;" primitive_type (pointer_declarator "*__old" * identifier) ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "int local_130;" primitive_type identifier ;) (declaration "char *local_12c;" primitive_type (pointer_declarator "*local_12c" * identifier) ;) (declaration "int local_128;" primitive_type identifier ;) (declaration "int local_124;" primitive_type identifier ;) (declaration "char local_120 [256];" primitive_type (array_declarator "local_120 [256]" identifier [ number_literal ]) ;) (declaration "int local_20;" primitive_type identifier ;) (declaration "undefined4 uStack_14;" type_identifier identifier ;) (expression_statement "uStack_14 = 0x1ac49;" (assignment_expression "uStack_14 = 0x1ac49" identifier = number_literal) ;) (expression_statement "local_20 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "local_20 = *(int *)(in_GS_OFFSET + 0x14)" identifier = (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) ;) (expression_statement "iVar1 = linkat(param_1,param_2,param_3,param_4,param_5);" (assignment_expression "iVar1 = linkat(param_1,param_2,param_3,param_4,param_5)" identifier = (call_expression "linkat(param_1,param_2,param_3,param_4,param_5)" identifier (argument_list "(param_1,param_2,param_3,param_4,param_5)" ( identifier , identifier , identifier , identifier , identifier )))) ;) (if_statement "if ((param_6 == '\x01') && (iVar1 != 0)) {\n    piVar2 = __errno_location();\n    if (*piVar2 == 0x11) {\n      __old = (char *)FUN_0001ab90();\n      if (__old == (char *)0x0) {\n        iVar1 = -1;\n      }\n      else {\n        local_12c = param_2;\n        local_130 = param_1;\n        local_128 = param_3;\n        local_124 = param_5;\n        iVar1 = FUN_00021460(__old,0,&local_130,FUN_0001ab60,6);\n        if (iVar1 == 0) {\n          iVar3 = renameat(param_3,__old,param_3,param_4);\n          if (iVar3 != 0) {\n            iVar3 = *piVar2;\n          }\n          unlinkat(param_3,__old,0);\n        }\n        else {\n          iVar3 = *piVar2;\n        }\n        if (__old != local_120) {\n          free(__old);\n        }\n        iVar1 = 1;\n        if (iVar3 != 0) {\n          *piVar2 = iVar3;\n          iVar1 = -1;\n        }\n      }\n    }\n  }" if (parenthesized_expression "((param_6 == '\x01') && (iVar1 != 0))" ( (binary_expression "(param_6 == '\x01') && (iVar1 != 0)" (parenthesized_expression "(param_6 == '\x01')" ( (binary_expression "param_6 == '\x01'" identifier == (char_literal "'\x01'" ' escape_sequence ')) )) && (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) ))) )) (compound_statement "{\n    piVar2 = __errno_location();\n    if (*piVar2 == 0x11) {\n      __old = (char *)FUN_0001ab90();\n      if (__old == (char *)0x0) {\n        iVar1 = -1;\n      }\n      else {\n        local_12c = param_2;\n        local_130 = param_1;\n        local_128 = param_3;\n        local_124 = param_5;\n        iVar1 = FUN_00021460(__old,0,&local_130,FUN_0001ab60,6);\n        if (iVar1 == 0) {\n          iVar3 = renameat(param_3,__old,param_3,param_4);\n          if (iVar3 != 0) {\n            iVar3 = *piVar2;\n          }\n          unlinkat(param_3,__old,0);\n        }\n        else {\n          iVar3 = *piVar2;\n        }\n        if (__old != local_120) {\n          free(__old);\n        }\n        iVar1 = 1;\n        if (iVar3 != 0) {\n          *piVar2 = iVar3;\n          iVar1 = -1;\n        }\n      }\n    }\n  }" { (expression_statement "piVar2 = __errno_location();" (assignment_expression "piVar2 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (if_statement "if (*piVar2 == 0x11) {\n      __old = (char *)FUN_0001ab90();\n      if (__old == (char *)0x0) {\n        iVar1 = -1;\n      }\n      else {\n        local_12c = param_2;\n        local_130 = param_1;\n        local_128 = param_3;\n        local_124 = param_5;\n        iVar1 = FUN_00021460(__old,0,&local_130,FUN_0001ab60,6);\n        if (iVar1 == 0) {\n          iVar3 = renameat(param_3,__old,param_3,param_4);\n          if (iVar3 != 0) {\n            iVar3 = *piVar2;\n          }\n          unlinkat(param_3,__old,0);\n        }\n        else {\n          iVar3 = *piVar2;\n        }\n        if (__old != local_120) {\n          free(__old);\n        }\n        iVar1 = 1;\n        if (iVar3 != 0) {\n          *piVar2 = iVar3;\n          iVar1 = -1;\n        }\n      }\n    }" if (parenthesized_expression "(*piVar2 == 0x11)" ( (binary_expression "*piVar2 == 0x11" (pointer_expression "*piVar2" * identifier) == number_literal) )) (compound_statement "{\n      __old = (char *)FUN_0001ab90();\n      if (__old == (char *)0x0) {\n        iVar1 = -1;\n      }\n      else {\n        local_12c = param_2;\n        local_130 = param_1;\n        local_128 = param_3;\n        local_124 = param_5;\n        iVar1 = FUN_00021460(__old,0,&local_130,FUN_0001ab60,6);\n        if (iVar1 == 0) {\n          iVar3 = renameat(param_3,__old,param_3,param_4);\n          if (iVar3 != 0) {\n            iVar3 = *piVar2;\n          }\n          unlinkat(param_3,__old,0);\n        }\n        else {\n          iVar3 = *piVar2;\n        }\n        if (__old != local_120) {\n          free(__old);\n        }\n        iVar1 = 1;\n        if (iVar3 != 0) {\n          *piVar2 = iVar3;\n          iVar1 = -1;\n        }\n      }\n    }" { (expression_statement "__old = (char *)FUN_0001ab90();" (assignment_expression "__old = (char *)FUN_0001ab90()" identifier = (cast_expression "(char *)FUN_0001ab90()" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_0001ab90()" identifier (argument_list "()" ( ))))) ;) (if_statement "if (__old == (char *)0x0) {\n        iVar1 = -1;\n      }\n      else {\n        local_12c = param_2;\n        local_130 = param_1;\n        local_128 = param_3;\n        local_124 = param_5;\n        iVar1 = FUN_00021460(__old,0,&local_130,FUN_0001ab60,6);\n        if (iVar1 == 0) {\n          iVar3 = renameat(param_3,__old,param_3,param_4);\n          if (iVar3 != 0) {\n            iVar3 = *piVar2;\n          }\n          unlinkat(param_3,__old,0);\n        }\n        else {\n          iVar3 = *piVar2;\n        }\n        if (__old != local_120) {\n          free(__old);\n        }\n        iVar1 = 1;\n        if (iVar3 != 0) {\n          *piVar2 = iVar3;\n          iVar1 = -1;\n        }\n      }" if (parenthesized_expression "(__old == (char *)0x0)" ( (binary_expression "__old == (char *)0x0" identifier == (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n        iVar1 = -1;\n      }" { (expression_statement "iVar1 = -1;" (assignment_expression "iVar1 = -1" identifier = number_literal) ;) }) (else_clause "else {\n        local_12c = param_2;\n        local_130 = param_1;\n        local_128 = param_3;\n        local_124 = param_5;\n        iVar1 = FUN_00021460(__old,0,&local_130,FUN_0001ab60,6);\n        if (iVar1 == 0) {\n          iVar3 = renameat(param_3,__old,param_3,param_4);\n          if (iVar3 != 0) {\n            iVar3 = *piVar2;\n          }\n          unlinkat(param_3,__old,0);\n        }\n        else {\n          iVar3 = *piVar2;\n        }\n        if (__old != local_120) {\n          free(__old);\n        }\n        iVar1 = 1;\n        if (iVar3 != 0) {\n          *piVar2 = iVar3;\n          iVar1 = -1;\n        }\n      }" else (compound_statement "{\n        local_12c = param_2;\n        local_130 = param_1;\n        local_128 = param_3;\n        local_124 = param_5;\n        iVar1 = FUN_00021460(__old,0,&local_130,FUN_0001ab60,6);\n        if (iVar1 == 0) {\n          iVar3 = renameat(param_3,__old,param_3,param_4);\n          if (iVar3 != 0) {\n            iVar3 = *piVar2;\n          }\n          unlinkat(param_3,__old,0);\n        }\n        else {\n          iVar3 = *piVar2;\n        }\n        if (__old != local_120) {\n          free(__old);\n        }\n        iVar1 = 1;\n        if (iVar3 != 0) {\n          *piVar2 = iVar3;\n          iVar1 = -1;\n        }\n      }" { (expression_statement "local_12c = param_2;" (assignment_expression "local_12c = param_2" identifier = identifier) ;) (expression_statement "local_130 = param_1;" (assignment_expression "local_130 = param_1" identifier = identifier) ;) (expression_statement "local_128 = param_3;" (assignment_expression "local_128 = param_3" identifier = identifier) ;) (expression_statement "local_124 = param_5;" (assignment_expression "local_124 = param_5" identifier = identifier) ;) (expression_statement "iVar1 = FUN_00021460(__old,0,&local_130,FUN_0001ab60,6);" (assignment_expression "iVar1 = FUN_00021460(__old,0,&local_130,FUN_0001ab60,6)" identifier = (call_expression "FUN_00021460(__old,0,&local_130,FUN_0001ab60,6)" identifier (argument_list "(__old,0,&local_130,FUN_0001ab60,6)" ( identifier , number_literal , (pointer_expression "&local_130" & identifier) , identifier , number_literal )))) ;) (if_statement "if (iVar1 == 0) {\n          iVar3 = renameat(param_3,__old,param_3,param_4);\n          if (iVar3 != 0) {\n            iVar3 = *piVar2;\n          }\n          unlinkat(param_3,__old,0);\n        }\n        else {\n          iVar3 = *piVar2;\n        }" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (compound_statement "{\n          iVar3 = renameat(param_3,__old,param_3,param_4);\n          if (iVar3 != 0) {\n            iVar3 = *piVar2;\n          }\n          unlinkat(param_3,__old,0);\n        }" { (expression_statement "iVar3 = renameat(param_3,__old,param_3,param_4);" (assignment_expression "iVar3 = renameat(param_3,__old,param_3,param_4)" identifier = (call_expression "renameat(param_3,__old,param_3,param_4)" identifier (argument_list "(param_3,__old,param_3,param_4)" ( identifier , identifier , identifier , identifier )))) ;) (if_statement "if (iVar3 != 0) {\n            iVar3 = *piVar2;\n          }" if (parenthesized_expression "(iVar3 != 0)" ( (binary_expression "iVar3 != 0" identifier != number_literal) )) (compound_statement "{\n            iVar3 = *piVar2;\n          }" { (expression_statement "iVar3 = *piVar2;" (assignment_expression "iVar3 = *piVar2" identifier = (pointer_expression "*piVar2" * identifier)) ;) })) (expression_statement "unlinkat(param_3,__old,0);" (call_expression "unlinkat(param_3,__old,0)" identifier (argument_list "(param_3,__old,0)" ( identifier , identifier , number_literal ))) ;) }) (else_clause "else {\n          iVar3 = *piVar2;\n        }" else (compound_statement "{\n          iVar3 = *piVar2;\n        }" { (expression_statement "iVar3 = *piVar2;" (assignment_expression "iVar3 = *piVar2" identifier = (pointer_expression "*piVar2" * identifier)) ;) }))) (if_statement "if (__old != local_120) {\n          free(__old);\n        }" if (parenthesized_expression "(__old != local_120)" ( (binary_expression "__old != local_120" identifier != identifier) )) (compound_statement "{\n          free(__old);\n        }" { (expression_statement "free(__old);" (call_expression "free(__old)" identifier (argument_list "(__old)" ( identifier ))) ;) })) (expression_statement "iVar1 = 1;" (assignment_expression "iVar1 = 1" identifier = number_literal) ;) (if_statement "if (iVar3 != 0) {\n          *piVar2 = iVar3;\n          iVar1 = -1;\n        }" if (parenthesized_expression "(iVar3 != 0)" ( (binary_expression "iVar3 != 0" identifier != number_literal) )) (compound_statement "{\n          *piVar2 = iVar3;\n          iVar1 = -1;\n        }" { (expression_statement "*piVar2 = iVar3;" (assignment_expression "*piVar2 = iVar3" (pointer_expression "*piVar2" * identifier) = identifier) ;) (expression_statement "iVar1 = -1;" (assignment_expression "iVar1 = -1" identifier = number_literal) ;) })) }))) })) })) (if_statement "if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return iVar1;\n  }" if (parenthesized_expression "(local_20 == *(int *)(in_GS_OFFSET + 0x14))" ( (binary_expression "local_20 == *(int *)(in_GS_OFFSET + 0x14)" identifier == (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) )) (compound_statement "{\n    return iVar1;\n  }" { (return_statement "return iVar1;" return identifier ;) })) comment (expression_statement "FUN_0002bcb0();" (call_expression "FUN_0002bcb0()" identifier (argument_list "()" ( ))) ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* WARNING: Unknown calling convention */\n\nint force_linkat(int srcdir,char *srcname,int dstdir,char *dstname,int flags,_Bool force)\n\n{\n  int iVar1;\n  int iVar2;\n  int *piVar3;\n  char *tmpl;\n  int iVar4;\n  int in_GS_OFFSET;\n  link_arg arg;\n  char buf [256];\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  iVar2 = linkat(srcdir,srcname,dstdir,dstname,flags);\n  if ((force) && (iVar2 != 0)) {\n    piVar3 = __errno_location();\n    if (*piVar3 == 0x11) {\n      tmpl = samedir_template(dstname,buf);\n      if (tmpl == (char *)0x0) {\n        iVar2 = -1;\n      }\n      else {\n        arg.srcname = srcname;\n        arg.srcdir = srcdir;\n        arg.dstdir = dstdir;\n        arg.flags = flags;\n        iVar2 = try_tempname_len(tmpl,0,&arg,try_link,6);\n        if (iVar2 == 0) {\n          iVar4 = renameat(dstdir,tmpl,dstdir,dstname);\n          if (iVar4 != 0) {\n            iVar4 = *piVar3;\n          }\n          unlinkat(dstdir,tmpl,0);\n        }\n        else {\n          iVar4 = *piVar3;\n        }\n        if (tmpl != buf) {\n          free(tmpl);\n        }\n        iVar2 = 1;\n        if (iVar4 != 0) {\n          *piVar3 = iVar4;\n          iVar2 = -1;\n        }\n      }\n    }\n  }\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return iVar2;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail_local();\n}\n\n" comment comment (function_definition "int force_linkat(int srcdir,char *srcname,int dstdir,char *dstname,int flags,_Bool force)\n\n{\n  int iVar1;\n  int iVar2;\n  int *piVar3;\n  char *tmpl;\n  int iVar4;\n  int in_GS_OFFSET;\n  link_arg arg;\n  char buf [256];\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  iVar2 = linkat(srcdir,srcname,dstdir,dstname,flags);\n  if ((force) && (iVar2 != 0)) {\n    piVar3 = __errno_location();\n    if (*piVar3 == 0x11) {\n      tmpl = samedir_template(dstname,buf);\n      if (tmpl == (char *)0x0) {\n        iVar2 = -1;\n      }\n      else {\n        arg.srcname = srcname;\n        arg.srcdir = srcdir;\n        arg.dstdir = dstdir;\n        arg.flags = flags;\n        iVar2 = try_tempname_len(tmpl,0,&arg,try_link,6);\n        if (iVar2 == 0) {\n          iVar4 = renameat(dstdir,tmpl,dstdir,dstname);\n          if (iVar4 != 0) {\n            iVar4 = *piVar3;\n          }\n          unlinkat(dstdir,tmpl,0);\n        }\n        else {\n          iVar4 = *piVar3;\n        }\n        if (tmpl != buf) {\n          free(tmpl);\n        }\n        iVar2 = 1;\n        if (iVar4 != 0) {\n          *piVar3 = iVar4;\n          iVar2 = -1;\n        }\n      }\n    }\n  }\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return iVar2;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail_local();\n}" primitive_type (function_declarator "force_linkat(int srcdir,char *srcname,int dstdir,char *dstname,int flags,_Bool force)" identifier (parameter_list "(int srcdir,char *srcname,int dstdir,char *dstname,int flags,_Bool force)" ( (parameter_declaration "int srcdir" primitive_type identifier) , (parameter_declaration "char *srcname" primitive_type (pointer_declarator "*srcname" * identifier)) , (parameter_declaration "int dstdir" primitive_type identifier) , (parameter_declaration "char *dstname" primitive_type (pointer_declarator "*dstname" * identifier)) , (parameter_declaration "int flags" primitive_type identifier) , (parameter_declaration "_Bool force" type_identifier identifier) ))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  int *piVar3;\n  char *tmpl;\n  int iVar4;\n  int in_GS_OFFSET;\n  link_arg arg;\n  char buf [256];\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  iVar2 = linkat(srcdir,srcname,dstdir,dstname,flags);\n  if ((force) && (iVar2 != 0)) {\n    piVar3 = __errno_location();\n    if (*piVar3 == 0x11) {\n      tmpl = samedir_template(dstname,buf);\n      if (tmpl == (char *)0x0) {\n        iVar2 = -1;\n      }\n      else {\n        arg.srcname = srcname;\n        arg.srcdir = srcdir;\n        arg.dstdir = dstdir;\n        arg.flags = flags;\n        iVar2 = try_tempname_len(tmpl,0,&arg,try_link,6);\n        if (iVar2 == 0) {\n          iVar4 = renameat(dstdir,tmpl,dstdir,dstname);\n          if (iVar4 != 0) {\n            iVar4 = *piVar3;\n          }\n          unlinkat(dstdir,tmpl,0);\n        }\n        else {\n          iVar4 = *piVar3;\n        }\n        if (tmpl != buf) {\n          free(tmpl);\n        }\n        iVar2 = 1;\n        if (iVar4 != 0) {\n          *piVar3 = iVar4;\n          iVar2 = -1;\n        }\n      }\n    }\n  }\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return iVar2;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail_local();\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "int *piVar3;" primitive_type (pointer_declarator "*piVar3" * identifier) ;) (declaration "char *tmpl;" primitive_type (pointer_declarator "*tmpl" * identifier) ;) (declaration "int iVar4;" primitive_type identifier ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "link_arg arg;" type_identifier identifier ;) (declaration "char buf [256];" primitive_type (array_declarator "buf [256]" identifier [ number_literal ]) ;) (expression_statement "iVar1 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "iVar1 = *(int *)(in_GS_OFFSET + 0x14)" identifier = (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) ;) (expression_statement "iVar2 = linkat(srcdir,srcname,dstdir,dstname,flags);" (assignment_expression "iVar2 = linkat(srcdir,srcname,dstdir,dstname,flags)" identifier = (call_expression "linkat(srcdir,srcname,dstdir,dstname,flags)" identifier (argument_list "(srcdir,srcname,dstdir,dstname,flags)" ( identifier , identifier , identifier , identifier , identifier )))) ;) (if_statement "if ((force) && (iVar2 != 0)) {\n    piVar3 = __errno_location();\n    if (*piVar3 == 0x11) {\n      tmpl = samedir_template(dstname,buf);\n      if (tmpl == (char *)0x0) {\n        iVar2 = -1;\n      }\n      else {\n        arg.srcname = srcname;\n        arg.srcdir = srcdir;\n        arg.dstdir = dstdir;\n        arg.flags = flags;\n        iVar2 = try_tempname_len(tmpl,0,&arg,try_link,6);\n        if (iVar2 == 0) {\n          iVar4 = renameat(dstdir,tmpl,dstdir,dstname);\n          if (iVar4 != 0) {\n            iVar4 = *piVar3;\n          }\n          unlinkat(dstdir,tmpl,0);\n        }\n        else {\n          iVar4 = *piVar3;\n        }\n        if (tmpl != buf) {\n          free(tmpl);\n        }\n        iVar2 = 1;\n        if (iVar4 != 0) {\n          *piVar3 = iVar4;\n          iVar2 = -1;\n        }\n      }\n    }\n  }" if (parenthesized_expression "((force) && (iVar2 != 0))" ( (binary_expression "(force) && (iVar2 != 0)" (parenthesized_expression "(force)" ( identifier )) && (parenthesized_expression "(iVar2 != 0)" ( (binary_expression "iVar2 != 0" identifier != number_literal) ))) )) (compound_statement "{\n    piVar3 = __errno_location();\n    if (*piVar3 == 0x11) {\n      tmpl = samedir_template(dstname,buf);\n      if (tmpl == (char *)0x0) {\n        iVar2 = -1;\n      }\n      else {\n        arg.srcname = srcname;\n        arg.srcdir = srcdir;\n        arg.dstdir = dstdir;\n        arg.flags = flags;\n        iVar2 = try_tempname_len(tmpl,0,&arg,try_link,6);\n        if (iVar2 == 0) {\n          iVar4 = renameat(dstdir,tmpl,dstdir,dstname);\n          if (iVar4 != 0) {\n            iVar4 = *piVar3;\n          }\n          unlinkat(dstdir,tmpl,0);\n        }\n        else {\n          iVar4 = *piVar3;\n        }\n        if (tmpl != buf) {\n          free(tmpl);\n        }\n        iVar2 = 1;\n        if (iVar4 != 0) {\n          *piVar3 = iVar4;\n          iVar2 = -1;\n        }\n      }\n    }\n  }" { (expression_statement "piVar3 = __errno_location();" (assignment_expression "piVar3 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (if_statement "if (*piVar3 == 0x11) {\n      tmpl = samedir_template(dstname,buf);\n      if (tmpl == (char *)0x0) {\n        iVar2 = -1;\n      }\n      else {\n        arg.srcname = srcname;\n        arg.srcdir = srcdir;\n        arg.dstdir = dstdir;\n        arg.flags = flags;\n        iVar2 = try_tempname_len(tmpl,0,&arg,try_link,6);\n        if (iVar2 == 0) {\n          iVar4 = renameat(dstdir,tmpl,dstdir,dstname);\n          if (iVar4 != 0) {\n            iVar4 = *piVar3;\n          }\n          unlinkat(dstdir,tmpl,0);\n        }\n        else {\n          iVar4 = *piVar3;\n        }\n        if (tmpl != buf) {\n          free(tmpl);\n        }\n        iVar2 = 1;\n        if (iVar4 != 0) {\n          *piVar3 = iVar4;\n          iVar2 = -1;\n        }\n      }\n    }" if (parenthesized_expression "(*piVar3 == 0x11)" ( (binary_expression "*piVar3 == 0x11" (pointer_expression "*piVar3" * identifier) == number_literal) )) (compound_statement "{\n      tmpl = samedir_template(dstname,buf);\n      if (tmpl == (char *)0x0) {\n        iVar2 = -1;\n      }\n      else {\n        arg.srcname = srcname;\n        arg.srcdir = srcdir;\n        arg.dstdir = dstdir;\n        arg.flags = flags;\n        iVar2 = try_tempname_len(tmpl,0,&arg,try_link,6);\n        if (iVar2 == 0) {\n          iVar4 = renameat(dstdir,tmpl,dstdir,dstname);\n          if (iVar4 != 0) {\n            iVar4 = *piVar3;\n          }\n          unlinkat(dstdir,tmpl,0);\n        }\n        else {\n          iVar4 = *piVar3;\n        }\n        if (tmpl != buf) {\n          free(tmpl);\n        }\n        iVar2 = 1;\n        if (iVar4 != 0) {\n          *piVar3 = iVar4;\n          iVar2 = -1;\n        }\n      }\n    }" { (expression_statement "tmpl = samedir_template(dstname,buf);" (assignment_expression "tmpl = samedir_template(dstname,buf)" identifier = (call_expression "samedir_template(dstname,buf)" identifier (argument_list "(dstname,buf)" ( identifier , identifier )))) ;) (if_statement "if (tmpl == (char *)0x0) {\n        iVar2 = -1;\n      }\n      else {\n        arg.srcname = srcname;\n        arg.srcdir = srcdir;\n        arg.dstdir = dstdir;\n        arg.flags = flags;\n        iVar2 = try_tempname_len(tmpl,0,&arg,try_link,6);\n        if (iVar2 == 0) {\n          iVar4 = renameat(dstdir,tmpl,dstdir,dstname);\n          if (iVar4 != 0) {\n            iVar4 = *piVar3;\n          }\n          unlinkat(dstdir,tmpl,0);\n        }\n        else {\n          iVar4 = *piVar3;\n        }\n        if (tmpl != buf) {\n          free(tmpl);\n        }\n        iVar2 = 1;\n        if (iVar4 != 0) {\n          *piVar3 = iVar4;\n          iVar2 = -1;\n        }\n      }" if (parenthesized_expression "(tmpl == (char *)0x0)" ( (binary_expression "tmpl == (char *)0x0" identifier == (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n        iVar2 = -1;\n      }" { (expression_statement "iVar2 = -1;" (assignment_expression "iVar2 = -1" identifier = number_literal) ;) }) (else_clause "else {\n        arg.srcname = srcname;\n        arg.srcdir = srcdir;\n        arg.dstdir = dstdir;\n        arg.flags = flags;\n        iVar2 = try_tempname_len(tmpl,0,&arg,try_link,6);\n        if (iVar2 == 0) {\n          iVar4 = renameat(dstdir,tmpl,dstdir,dstname);\n          if (iVar4 != 0) {\n            iVar4 = *piVar3;\n          }\n          unlinkat(dstdir,tmpl,0);\n        }\n        else {\n          iVar4 = *piVar3;\n        }\n        if (tmpl != buf) {\n          free(tmpl);\n        }\n        iVar2 = 1;\n        if (iVar4 != 0) {\n          *piVar3 = iVar4;\n          iVar2 = -1;\n        }\n      }" else (compound_statement "{\n        arg.srcname = srcname;\n        arg.srcdir = srcdir;\n        arg.dstdir = dstdir;\n        arg.flags = flags;\n        iVar2 = try_tempname_len(tmpl,0,&arg,try_link,6);\n        if (iVar2 == 0) {\n          iVar4 = renameat(dstdir,tmpl,dstdir,dstname);\n          if (iVar4 != 0) {\n            iVar4 = *piVar3;\n          }\n          unlinkat(dstdir,tmpl,0);\n        }\n        else {\n          iVar4 = *piVar3;\n        }\n        if (tmpl != buf) {\n          free(tmpl);\n        }\n        iVar2 = 1;\n        if (iVar4 != 0) {\n          *piVar3 = iVar4;\n          iVar2 = -1;\n        }\n      }" { (expression_statement "arg.srcname = srcname;" (assignment_expression "arg.srcname = srcname" (field_expression "arg.srcname" identifier . field_identifier) = identifier) ;) (expression_statement "arg.srcdir = srcdir;" (assignment_expression "arg.srcdir = srcdir" (field_expression "arg.srcdir" identifier . field_identifier) = identifier) ;) (expression_statement "arg.dstdir = dstdir;" (assignment_expression "arg.dstdir = dstdir" (field_expression "arg.dstdir" identifier . field_identifier) = identifier) ;) (expression_statement "arg.flags = flags;" (assignment_expression "arg.flags = flags" (field_expression "arg.flags" identifier . field_identifier) = identifier) ;) (expression_statement "iVar2 = try_tempname_len(tmpl,0,&arg,try_link,6);" (assignment_expression "iVar2 = try_tempname_len(tmpl,0,&arg,try_link,6)" identifier = (call_expression "try_tempname_len(tmpl,0,&arg,try_link,6)" identifier (argument_list "(tmpl,0,&arg,try_link,6)" ( identifier , number_literal , (pointer_expression "&arg" & identifier) , identifier , number_literal )))) ;) (if_statement "if (iVar2 == 0) {\n          iVar4 = renameat(dstdir,tmpl,dstdir,dstname);\n          if (iVar4 != 0) {\n            iVar4 = *piVar3;\n          }\n          unlinkat(dstdir,tmpl,0);\n        }\n        else {\n          iVar4 = *piVar3;\n        }" if (parenthesized_expression "(iVar2 == 0)" ( (binary_expression "iVar2 == 0" identifier == number_literal) )) (compound_statement "{\n          iVar4 = renameat(dstdir,tmpl,dstdir,dstname);\n          if (iVar4 != 0) {\n            iVar4 = *piVar3;\n          }\n          unlinkat(dstdir,tmpl,0);\n        }" { (expression_statement "iVar4 = renameat(dstdir,tmpl,dstdir,dstname);" (assignment_expression "iVar4 = renameat(dstdir,tmpl,dstdir,dstname)" identifier = (call_expression "renameat(dstdir,tmpl,dstdir,dstname)" identifier (argument_list "(dstdir,tmpl,dstdir,dstname)" ( identifier , identifier , identifier , identifier )))) ;) (if_statement "if (iVar4 != 0) {\n            iVar4 = *piVar3;\n          }" if (parenthesized_expression "(iVar4 != 0)" ( (binary_expression "iVar4 != 0" identifier != number_literal) )) (compound_statement "{\n            iVar4 = *piVar3;\n          }" { (expression_statement "iVar4 = *piVar3;" (assignment_expression "iVar4 = *piVar3" identifier = (pointer_expression "*piVar3" * identifier)) ;) })) (expression_statement "unlinkat(dstdir,tmpl,0);" (call_expression "unlinkat(dstdir,tmpl,0)" identifier (argument_list "(dstdir,tmpl,0)" ( identifier , identifier , number_literal ))) ;) }) (else_clause "else {\n          iVar4 = *piVar3;\n        }" else (compound_statement "{\n          iVar4 = *piVar3;\n        }" { (expression_statement "iVar4 = *piVar3;" (assignment_expression "iVar4 = *piVar3" identifier = (pointer_expression "*piVar3" * identifier)) ;) }))) (if_statement "if (tmpl != buf) {\n          free(tmpl);\n        }" if (parenthesized_expression "(tmpl != buf)" ( (binary_expression "tmpl != buf" identifier != identifier) )) (compound_statement "{\n          free(tmpl);\n        }" { (expression_statement "free(tmpl);" (call_expression "free(tmpl)" identifier (argument_list "(tmpl)" ( identifier ))) ;) })) (expression_statement "iVar2 = 1;" (assignment_expression "iVar2 = 1" identifier = number_literal) ;) (if_statement "if (iVar4 != 0) {\n          *piVar3 = iVar4;\n          iVar2 = -1;\n        }" if (parenthesized_expression "(iVar4 != 0)" ( (binary_expression "iVar4 != 0" identifier != number_literal) )) (compound_statement "{\n          *piVar3 = iVar4;\n          iVar2 = -1;\n        }" { (expression_statement "*piVar3 = iVar4;" (assignment_expression "*piVar3 = iVar4" (pointer_expression "*piVar3" * identifier) = identifier) ;) (expression_statement "iVar2 = -1;" (assignment_expression "iVar2 = -1" identifier = number_literal) ;) })) }))) })) })) (if_statement "if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return iVar2;\n  }" if (parenthesized_expression "(iVar1 == *(int *)(in_GS_OFFSET + 0x14))" ( (binary_expression "iVar1 == *(int *)(in_GS_OFFSET + 0x14)" identifier == (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) )) (compound_statement "{\n    return iVar2;\n  }" { (return_statement "return iVar2;" return identifier ;) })) comment (expression_statement "__stack_chk_fail_local();" (call_expression "__stack_chk_fail_local()" identifier (argument_list "()" ( ))) ;) })))
(translation_unit "int FUN_0001ac40(int param_1,char *param_2,int param_3,char *param_4,int param_5,char param_6)\n\n{\n  int iVar1;\n  int *piVar2;\n  char *__old;\n  int iVar3;\n  int in_GS_OFFSET;\n  int local_130;\n  char *local_12c;\n  int local_128;\n  int local_124;\n  char local_120 [256];\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x1ac49;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  iVar1 = linkat(param_1,param_2,param_3,param_4,param_5);\n  if ((param_6 == '\x01') && (iVar1 != 0)) {\n    piVar2 = __errno_location();\n    if (*piVar2 == 0x11) {\n      __old = (char *)FUN_0001ab90();\n      if (__old == (char *)0x0) {\n        iVar1 = -1;\n      }\n      else {\n        local_12c = param_2;\n        local_130 = param_1;\n        local_128 = param_3;\n        local_124 = param_5;\n        iVar1 = FUN_00021460(__old,0,&local_130,FUN_0001ab60,6);\n        if (iVar1 == 0) {\n          iVar3 = renameat(param_3,__old,param_3,param_4);\n          if (iVar3 != 0) {\n            iVar3 = *piVar2;\n          }\n          unlinkat(param_3,__old,0);\n        }\n        else {\n          iVar3 = *piVar2;\n        }\n        if (__old != local_120) {\n          free(__old);\n        }\n        iVar1 = 1;\n        if (iVar3 != 0) {\n          *piVar2 = iVar3;\n          iVar1 = -1;\n        }\n      }\n    }\n  }\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return iVar1;\n  }\n                    \n  FUN_0002bcb0();\n}\n\n" (function_definition "int FUN_0001ac40(int param_1,char *param_2,int param_3,char *param_4,int param_5,char param_6)\n\n{\n  int iVar1;\n  int *piVar2;\n  char *__old;\n  int iVar3;\n  int in_GS_OFFSET;\n  int local_130;\n  char *local_12c;\n  int local_128;\n  int local_124;\n  char local_120 [256];\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x1ac49;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  iVar1 = linkat(param_1,param_2,param_3,param_4,param_5);\n  if ((param_6 == '\x01') && (iVar1 != 0)) {\n    piVar2 = __errno_location();\n    if (*piVar2 == 0x11) {\n      __old = (char *)FUN_0001ab90();\n      if (__old == (char *)0x0) {\n        iVar1 = -1;\n      }\n      else {\n        local_12c = param_2;\n        local_130 = param_1;\n        local_128 = param_3;\n        local_124 = param_5;\n        iVar1 = FUN_00021460(__old,0,&local_130,FUN_0001ab60,6);\n        if (iVar1 == 0) {\n          iVar3 = renameat(param_3,__old,param_3,param_4);\n          if (iVar3 != 0) {\n            iVar3 = *piVar2;\n          }\n          unlinkat(param_3,__old,0);\n        }\n        else {\n          iVar3 = *piVar2;\n        }\n        if (__old != local_120) {\n          free(__old);\n        }\n        iVar1 = 1;\n        if (iVar3 != 0) {\n          *piVar2 = iVar3;\n          iVar1 = -1;\n        }\n      }\n    }\n  }\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return iVar1;\n  }\n                    \n  FUN_0002bcb0();\n}" primitive_type (function_declarator "FUN_0001ac40(int param_1,char *param_2,int param_3,char *param_4,int param_5,char param_6)" identifier (parameter_list "(int param_1,char *param_2,int param_3,char *param_4,int param_5,char param_6)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "char *param_2" primitive_type (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "int param_3" primitive_type identifier) , (parameter_declaration "char *param_4" primitive_type (pointer_declarator "*param_4" * identifier)) , (parameter_declaration "int param_5" primitive_type identifier) , (parameter_declaration "char param_6" primitive_type identifier) ))) (compound_statement "{\n  int iVar1;\n  int *piVar2;\n  char *__old;\n  int iVar3;\n  int in_GS_OFFSET;\n  int local_130;\n  char *local_12c;\n  int local_128;\n  int local_124;\n  char local_120 [256];\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x1ac49;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  iVar1 = linkat(param_1,param_2,param_3,param_4,param_5);\n  if ((param_6 == '\x01') && (iVar1 != 0)) {\n    piVar2 = __errno_location();\n    if (*piVar2 == 0x11) {\n      __old = (char *)FUN_0001ab90();\n      if (__old == (char *)0x0) {\n        iVar1 = -1;\n      }\n      else {\n        local_12c = param_2;\n        local_130 = param_1;\n        local_128 = param_3;\n        local_124 = param_5;\n        iVar1 = FUN_00021460(__old,0,&local_130,FUN_0001ab60,6);\n        if (iVar1 == 0) {\n          iVar3 = renameat(param_3,__old,param_3,param_4);\n          if (iVar3 != 0) {\n            iVar3 = *piVar2;\n          }\n          unlinkat(param_3,__old,0);\n        }\n        else {\n          iVar3 = *piVar2;\n        }\n        if (__old != local_120) {\n          free(__old);\n        }\n        iVar1 = 1;\n        if (iVar3 != 0) {\n          *piVar2 = iVar3;\n          iVar1 = -1;\n        }\n      }\n    }\n  }\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return iVar1;\n  }\n                    \n  FUN_0002bcb0();\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int *piVar2;" primitive_type (pointer_declarator "*piVar2" * identifier) ;) (declaration "char *__old;" primitive_type (pointer_declarator "*__old" * identifier) ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "int local_130;" primitive_type identifier ;) (declaration "char *local_12c;" primitive_type (pointer_declarator "*local_12c" * identifier) ;) (declaration "int local_128;" primitive_type identifier ;) (declaration "int local_124;" primitive_type identifier ;) (declaration "char local_120 [256];" primitive_type (array_declarator "local_120 [256]" identifier [ number_literal ]) ;) (declaration "int local_20;" primitive_type identifier ;) (declaration "undefined4 uStack_14;" type_identifier identifier ;) (expression_statement "uStack_14 = 0x1ac49;" (assignment_expression "uStack_14 = 0x1ac49" identifier = number_literal) ;) (expression_statement "local_20 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "local_20 = *(int *)(in_GS_OFFSET + 0x14)" identifier = (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) ;) (expression_statement "iVar1 = linkat(param_1,param_2,param_3,param_4,param_5);" (assignment_expression "iVar1 = linkat(param_1,param_2,param_3,param_4,param_5)" identifier = (call_expression "linkat(param_1,param_2,param_3,param_4,param_5)" identifier (argument_list "(param_1,param_2,param_3,param_4,param_5)" ( identifier , identifier , identifier , identifier , identifier )))) ;) (if_statement "if ((param_6 == '\x01') && (iVar1 != 0)) {\n    piVar2 = __errno_location();\n    if (*piVar2 == 0x11) {\n      __old = (char *)FUN_0001ab90();\n      if (__old == (char *)0x0) {\n        iVar1 = -1;\n      }\n      else {\n        local_12c = param_2;\n        local_130 = param_1;\n        local_128 = param_3;\n        local_124 = param_5;\n        iVar1 = FUN_00021460(__old,0,&local_130,FUN_0001ab60,6);\n        if (iVar1 == 0) {\n          iVar3 = renameat(param_3,__old,param_3,param_4);\n          if (iVar3 != 0) {\n            iVar3 = *piVar2;\n          }\n          unlinkat(param_3,__old,0);\n        }\n        else {\n          iVar3 = *piVar2;\n        }\n        if (__old != local_120) {\n          free(__old);\n        }\n        iVar1 = 1;\n        if (iVar3 != 0) {\n          *piVar2 = iVar3;\n          iVar1 = -1;\n        }\n      }\n    }\n  }" if (parenthesized_expression "((param_6 == '\x01') && (iVar1 != 0))" ( (binary_expression "(param_6 == '\x01') && (iVar1 != 0)" (parenthesized_expression "(param_6 == '\x01')" ( (binary_expression "param_6 == '\x01'" identifier == (char_literal "'\x01'" ' escape_sequence ')) )) && (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) ))) )) (compound_statement "{\n    piVar2 = __errno_location();\n    if (*piVar2 == 0x11) {\n      __old = (char *)FUN_0001ab90();\n      if (__old == (char *)0x0) {\n        iVar1 = -1;\n      }\n      else {\n        local_12c = param_2;\n        local_130 = param_1;\n        local_128 = param_3;\n        local_124 = param_5;\n        iVar1 = FUN_00021460(__old,0,&local_130,FUN_0001ab60,6);\n        if (iVar1 == 0) {\n          iVar3 = renameat(param_3,__old,param_3,param_4);\n          if (iVar3 != 0) {\n            iVar3 = *piVar2;\n          }\n          unlinkat(param_3,__old,0);\n        }\n        else {\n          iVar3 = *piVar2;\n        }\n        if (__old != local_120) {\n          free(__old);\n        }\n        iVar1 = 1;\n        if (iVar3 != 0) {\n          *piVar2 = iVar3;\n          iVar1 = -1;\n        }\n      }\n    }\n  }" { (expression_statement "piVar2 = __errno_location();" (assignment_expression "piVar2 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (if_statement "if (*piVar2 == 0x11) {\n      __old = (char *)FUN_0001ab90();\n      if (__old == (char *)0x0) {\n        iVar1 = -1;\n      }\n      else {\n        local_12c = param_2;\n        local_130 = param_1;\n        local_128 = param_3;\n        local_124 = param_5;\n        iVar1 = FUN_00021460(__old,0,&local_130,FUN_0001ab60,6);\n        if (iVar1 == 0) {\n          iVar3 = renameat(param_3,__old,param_3,param_4);\n          if (iVar3 != 0) {\n            iVar3 = *piVar2;\n          }\n          unlinkat(param_3,__old,0);\n        }\n        else {\n          iVar3 = *piVar2;\n        }\n        if (__old != local_120) {\n          free(__old);\n        }\n        iVar1 = 1;\n        if (iVar3 != 0) {\n          *piVar2 = iVar3;\n          iVar1 = -1;\n        }\n      }\n    }" if (parenthesized_expression "(*piVar2 == 0x11)" ( (binary_expression "*piVar2 == 0x11" (pointer_expression "*piVar2" * identifier) == number_literal) )) (compound_statement "{\n      __old = (char *)FUN_0001ab90();\n      if (__old == (char *)0x0) {\n        iVar1 = -1;\n      }\n      else {\n        local_12c = param_2;\n        local_130 = param_1;\n        local_128 = param_3;\n        local_124 = param_5;\n        iVar1 = FUN_00021460(__old,0,&local_130,FUN_0001ab60,6);\n        if (iVar1 == 0) {\n          iVar3 = renameat(param_3,__old,param_3,param_4);\n          if (iVar3 != 0) {\n            iVar3 = *piVar2;\n          }\n          unlinkat(param_3,__old,0);\n        }\n        else {\n          iVar3 = *piVar2;\n        }\n        if (__old != local_120) {\n          free(__old);\n        }\n        iVar1 = 1;\n        if (iVar3 != 0) {\n          *piVar2 = iVar3;\n          iVar1 = -1;\n        }\n      }\n    }" { (expression_statement "__old = (char *)FUN_0001ab90();" (assignment_expression "__old = (char *)FUN_0001ab90()" identifier = (cast_expression "(char *)FUN_0001ab90()" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_0001ab90()" identifier (argument_list "()" ( ))))) ;) (if_statement "if (__old == (char *)0x0) {\n        iVar1 = -1;\n      }\n      else {\n        local_12c = param_2;\n        local_130 = param_1;\n        local_128 = param_3;\n        local_124 = param_5;\n        iVar1 = FUN_00021460(__old,0,&local_130,FUN_0001ab60,6);\n        if (iVar1 == 0) {\n          iVar3 = renameat(param_3,__old,param_3,param_4);\n          if (iVar3 != 0) {\n            iVar3 = *piVar2;\n          }\n          unlinkat(param_3,__old,0);\n        }\n        else {\n          iVar3 = *piVar2;\n        }\n        if (__old != local_120) {\n          free(__old);\n        }\n        iVar1 = 1;\n        if (iVar3 != 0) {\n          *piVar2 = iVar3;\n          iVar1 = -1;\n        }\n      }" if (parenthesized_expression "(__old == (char *)0x0)" ( (binary_expression "__old == (char *)0x0" identifier == (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n        iVar1 = -1;\n      }" { (expression_statement "iVar1 = -1;" (assignment_expression "iVar1 = -1" identifier = number_literal) ;) }) (else_clause "else {\n        local_12c = param_2;\n        local_130 = param_1;\n        local_128 = param_3;\n        local_124 = param_5;\n        iVar1 = FUN_00021460(__old,0,&local_130,FUN_0001ab60,6);\n        if (iVar1 == 0) {\n          iVar3 = renameat(param_3,__old,param_3,param_4);\n          if (iVar3 != 0) {\n            iVar3 = *piVar2;\n          }\n          unlinkat(param_3,__old,0);\n        }\n        else {\n          iVar3 = *piVar2;\n        }\n        if (__old != local_120) {\n          free(__old);\n        }\n        iVar1 = 1;\n        if (iVar3 != 0) {\n          *piVar2 = iVar3;\n          iVar1 = -1;\n        }\n      }" else (compound_statement "{\n        local_12c = param_2;\n        local_130 = param_1;\n        local_128 = param_3;\n        local_124 = param_5;\n        iVar1 = FUN_00021460(__old,0,&local_130,FUN_0001ab60,6);\n        if (iVar1 == 0) {\n          iVar3 = renameat(param_3,__old,param_3,param_4);\n          if (iVar3 != 0) {\n            iVar3 = *piVar2;\n          }\n          unlinkat(param_3,__old,0);\n        }\n        else {\n          iVar3 = *piVar2;\n        }\n        if (__old != local_120) {\n          free(__old);\n        }\n        iVar1 = 1;\n        if (iVar3 != 0) {\n          *piVar2 = iVar3;\n          iVar1 = -1;\n        }\n      }" { (expression_statement "local_12c = param_2;" (assignment_expression "local_12c = param_2" identifier = identifier) ;) (expression_statement "local_130 = param_1;" (assignment_expression "local_130 = param_1" identifier = identifier) ;) (expression_statement "local_128 = param_3;" (assignment_expression "local_128 = param_3" identifier = identifier) ;) (expression_statement "local_124 = param_5;" (assignment_expression "local_124 = param_5" identifier = identifier) ;) (expression_statement "iVar1 = FUN_00021460(__old,0,&local_130,FUN_0001ab60,6);" (assignment_expression "iVar1 = FUN_00021460(__old,0,&local_130,FUN_0001ab60,6)" identifier = (call_expression "FUN_00021460(__old,0,&local_130,FUN_0001ab60,6)" identifier (argument_list "(__old,0,&local_130,FUN_0001ab60,6)" ( identifier , number_literal , (pointer_expression "&local_130" & identifier) , identifier , number_literal )))) ;) (if_statement "if (iVar1 == 0) {\n          iVar3 = renameat(param_3,__old,param_3,param_4);\n          if (iVar3 != 0) {\n            iVar3 = *piVar2;\n          }\n          unlinkat(param_3,__old,0);\n        }\n        else {\n          iVar3 = *piVar2;\n        }" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (compound_statement "{\n          iVar3 = renameat(param_3,__old,param_3,param_4);\n          if (iVar3 != 0) {\n            iVar3 = *piVar2;\n          }\n          unlinkat(param_3,__old,0);\n        }" { (expression_statement "iVar3 = renameat(param_3,__old,param_3,param_4);" (assignment_expression "iVar3 = renameat(param_3,__old,param_3,param_4)" identifier = (call_expression "renameat(param_3,__old,param_3,param_4)" identifier (argument_list "(param_3,__old,param_3,param_4)" ( identifier , identifier , identifier , identifier )))) ;) (if_statement "if (iVar3 != 0) {\n            iVar3 = *piVar2;\n          }" if (parenthesized_expression "(iVar3 != 0)" ( (binary_expression "iVar3 != 0" identifier != number_literal) )) (compound_statement "{\n            iVar3 = *piVar2;\n          }" { (expression_statement "iVar3 = *piVar2;" (assignment_expression "iVar3 = *piVar2" identifier = (pointer_expression "*piVar2" * identifier)) ;) })) (expression_statement "unlinkat(param_3,__old,0);" (call_expression "unlinkat(param_3,__old,0)" identifier (argument_list "(param_3,__old,0)" ( identifier , identifier , number_literal ))) ;) }) (else_clause "else {\n          iVar3 = *piVar2;\n        }" else (compound_statement "{\n          iVar3 = *piVar2;\n        }" { (expression_statement "iVar3 = *piVar2;" (assignment_expression "iVar3 = *piVar2" identifier = (pointer_expression "*piVar2" * identifier)) ;) }))) (if_statement "if (__old != local_120) {\n          free(__old);\n        }" if (parenthesized_expression "(__old != local_120)" ( (binary_expression "__old != local_120" identifier != identifier) )) (compound_statement "{\n          free(__old);\n        }" { (expression_statement "free(__old);" (call_expression "free(__old)" identifier (argument_list "(__old)" ( identifier ))) ;) })) (expression_statement "iVar1 = 1;" (assignment_expression "iVar1 = 1" identifier = number_literal) ;) (if_statement "if (iVar3 != 0) {\n          *piVar2 = iVar3;\n          iVar1 = -1;\n        }" if (parenthesized_expression "(iVar3 != 0)" ( (binary_expression "iVar3 != 0" identifier != number_literal) )) (compound_statement "{\n          *piVar2 = iVar3;\n          iVar1 = -1;\n        }" { (expression_statement "*piVar2 = iVar3;" (assignment_expression "*piVar2 = iVar3" (pointer_expression "*piVar2" * identifier) = identifier) ;) (expression_statement "iVar1 = -1;" (assignment_expression "iVar1 = -1" identifier = number_literal) ;) })) }))) })) })) (if_statement "if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return iVar1;\n  }" if (parenthesized_expression "(local_20 == *(int *)(in_GS_OFFSET + 0x14))" ( (binary_expression "local_20 == *(int *)(in_GS_OFFSET + 0x14)" identifier == (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) )) (compound_statement "{\n    return iVar1;\n  }" { (return_statement "return iVar1;" return identifier ;) })) (expression_statement "FUN_0002bcb0();" (call_expression "FUN_0002bcb0()" identifier (argument_list "()" ( ))) ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (array_declarator IDENT [ LIT ]) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT , IDENT , IDENT , IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT == (char_literal ' escape_sequence ')) )) && (parenthesized_expression ( (binary_expression IDENT != LIT) ))) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( )))) ;) (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression IDENT (argument_list ( ))))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = IDENT) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , LIT , (pointer_expression & IDENT) , IDENT , LIT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT , IDENT , IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) })) (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT , LIT ))) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) }))) (if_statement if (parenthesized_expression ( (binary_expression IDENT != IDENT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) })) (expression_statement (assignment_expression IDENT = LIT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (expression_statement (assignment_expression IDENT = LIT) ;) })) }))) })) })) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) )) (compound_statement { (return_statement return IDENT ;) })) (expression_statement (call_expression IDENT (argument_list ( ))) ;) })))
(function_definition "int FUN_0001ac40(int param_1,char *param_2,int param_3,char *param_4,int param_5,char param_6)\n\n{\n  int iVar1;\n  int *piVar2;\n  char *__old;\n  int iVar3;\n  int in_GS_OFFSET;\n  int local_130;\n  char *local_12c;\n  int local_128;\n  int local_124;\n  char local_120 [256];\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x1ac49;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  iVar1 = linkat(param_1,param_2,param_3,param_4,param_5);\n  if ((param_6 == '\x01') && (iVar1 != 0)) {\n    piVar2 = __errno_location();\n    if (*piVar2 == 0x11) {\n      __old = (char *)FUN_0001ab90();\n      if (__old == (char *)0x0) {\n        iVar1 = -1;\n      }\n      else {\n        local_12c = param_2;\n        local_130 = param_1;\n        local_128 = param_3;\n        local_124 = param_5;\n        iVar1 = FUN_00021460(__old,0,&local_130,FUN_0001ab60,6);\n        if (iVar1 == 0) {\n          iVar3 = renameat(param_3,__old,param_3,param_4);\n          if (iVar3 != 0) {\n            iVar3 = *piVar2;\n          }\n          unlinkat(param_3,__old,0);\n        }\n        else {\n          iVar3 = *piVar2;\n        }\n        if (__old != local_120) {\n          free(__old);\n        }\n        iVar1 = 1;\n        if (iVar3 != 0) {\n          *piVar2 = iVar3;\n          iVar1 = -1;\n        }\n      }\n    }\n  }\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return iVar1;\n  }\n                    \n  FUN_0002bcb0();\n}" (primitive_type "int") (function_declarator "FUN_0001ac40(int param_1,char *param_2,int param_3,char *param_4,int param_5,char param_6)" (identifier "FUN_0001ac40") (parameter_list "(int param_1,char *param_2,int param_3,char *param_4,int param_5,char param_6)" (( "(") (parameter_declaration "int param_1" (primitive_type "int") (identifier "param_1")) (, ",") (parameter_declaration "char *param_2" (primitive_type "char") (pointer_declarator "*param_2" (* "*") (identifier "param_2"))) (, ",") (parameter_declaration "int param_3" (primitive_type "int") (identifier "param_3")) (, ",") (parameter_declaration "char *param_4" (primitive_type "char") (pointer_declarator "*param_4" (* "*") (identifier "param_4"))) (, ",") (parameter_declaration "int param_5" (primitive_type "int") (identifier "param_5")) (, ",") (parameter_declaration "char param_6" (primitive_type "char") (identifier "param_6")) () ")"))) (compound_statement "{\n  int iVar1;\n  int *piVar2;\n  char *__old;\n  int iVar3;\n  int in_GS_OFFSET;\n  int local_130;\n  char *local_12c;\n  int local_128;\n  int local_124;\n  char local_120 [256];\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x1ac49;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  iVar1 = linkat(param_1,param_2,param_3,param_4,param_5);\n  if ((param_6 == '\x01') && (iVar1 != 0)) {\n    piVar2 = __errno_location();\n    if (*piVar2 == 0x11) {\n      __old = (char *)FUN_0001ab90();\n      if (__old == (char *)0x0) {\n        iVar1 = -1;\n      }\n      else {\n        local_12c = param_2;\n        local_130 = param_1;\n        local_128 = param_3;\n        local_124 = param_5;\n        iVar1 = FUN_00021460(__old,0,&local_130,FUN_0001ab60,6);\n        if (iVar1 == 0) {\n          iVar3 = renameat(param_3,__old,param_3,param_4);\n          if (iVar3 != 0) {\n            iVar3 = *piVar2;\n          }\n          unlinkat(param_3,__old,0);\n        }\n        else {\n          iVar3 = *piVar2;\n        }\n        if (__old != local_120) {\n          free(__old);\n        }\n        iVar1 = 1;\n        if (iVar3 != 0) {\n          *piVar2 = iVar3;\n          iVar1 = -1;\n        }\n      }\n    }\n  }\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return iVar1;\n  }\n                    \n  FUN_0002bcb0();\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "int *piVar2;" (primitive_type "int") (pointer_declarator "*piVar2" (* "*") (identifier "piVar2")) (; ";")) (declaration "char *__old;" (primitive_type "char") (pointer_declarator "*__old" (* "*") (identifier "__old")) (; ";")) (declaration "int iVar3;" (primitive_type "int") (identifier "iVar3") (; ";")) (declaration "int in_GS_OFFSET;" (primitive_type "int") (identifier "in_GS_OFFSET") (; ";")) (declaration "int local_130;" (primitive_type "int") (identifier "local_130") (; ";")) (declaration "char *local_12c;" (primitive_type "char") (pointer_declarator "*local_12c" (* "*") (identifier "local_12c")) (; ";")) (declaration "int local_128;" (primitive_type "int") (identifier "local_128") (; ";")) (declaration "int local_124;" (primitive_type "int") (identifier "local_124") (; ";")) (declaration "char local_120 [256];" (primitive_type "char") (array_declarator "local_120 [256]" (identifier "local_120") ([ "[") (number_literal "256") (] "]")) (; ";")) (declaration "int local_20;" (primitive_type "int") (identifier "local_20") (; ";")) (declaration "undefined4 uStack_14;" (type_identifier "undefined4") (identifier "uStack_14") (; ";")) (expression_statement "uStack_14 = 0x1ac49;" (assignment_expression "uStack_14 = 0x1ac49" (identifier "uStack_14") (= "=") (number_literal "0x1ac49")) (; ";")) (expression_statement "local_20 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "local_20 = *(int *)(in_GS_OFFSET + 0x14)" (identifier "local_20") (= "=") (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" (* "*") (cast_expression "(int *)(in_GS_OFFSET + 0x14)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(in_GS_OFFSET + 0x14)" (( "(") (binary_expression "in_GS_OFFSET + 0x14" (identifier "in_GS_OFFSET") (+ "+") (number_literal "0x14")) () ")"))))) (; ";")) (expression_statement "iVar1 = linkat(param_1,param_2,param_3,param_4,param_5);" (assignment_expression "iVar1 = linkat(param_1,param_2,param_3,param_4,param_5)" (identifier "iVar1") (= "=") (call_expression "linkat(param_1,param_2,param_3,param_4,param_5)" (identifier "linkat") (argument_list "(param_1,param_2,param_3,param_4,param_5)" (( "(") (identifier "param_1") (, ",") (identifier "param_2") (, ",") (identifier "param_3") (, ",") (identifier "param_4") (, ",") (identifier "param_5") () ")")))) (; ";")) (if_statement "if ((param_6 == '\x01') && (iVar1 != 0)) {\n    piVar2 = __errno_location();\n    if (*piVar2 == 0x11) {\n      __old = (char *)FUN_0001ab90();\n      if (__old == (char *)0x0) {\n        iVar1 = -1;\n      }\n      else {\n        local_12c = param_2;\n        local_130 = param_1;\n        local_128 = param_3;\n        local_124 = param_5;\n        iVar1 = FUN_00021460(__old,0,&local_130,FUN_0001ab60,6);\n        if (iVar1 == 0) {\n          iVar3 = renameat(param_3,__old,param_3,param_4);\n          if (iVar3 != 0) {\n            iVar3 = *piVar2;\n          }\n          unlinkat(param_3,__old,0);\n        }\n        else {\n          iVar3 = *piVar2;\n        }\n        if (__old != local_120) {\n          free(__old);\n        }\n        iVar1 = 1;\n        if (iVar3 != 0) {\n          *piVar2 = iVar3;\n          iVar1 = -1;\n        }\n      }\n    }\n  }" (if "if") (parenthesized_expression "((param_6 == '\x01') && (iVar1 != 0))" (( "(") (binary_expression "(param_6 == '\x01') && (iVar1 != 0)" (parenthesized_expression "(param_6 == '\x01')" (( "(") (binary_expression "param_6 == '\x01'" (identifier "param_6") (== "==") (char_literal "'\x01'" (' "'") (escape_sequence "\x01") (' "'"))) () ")")) (&& "&&") (parenthesized_expression "(iVar1 != 0)" (( "(") (binary_expression "iVar1 != 0" (identifier "iVar1") (!= "!=") (number_literal "0")) () ")"))) () ")")) (compound_statement "{\n    piVar2 = __errno_location();\n    if (*piVar2 == 0x11) {\n      __old = (char *)FUN_0001ab90();\n      if (__old == (char *)0x0) {\n        iVar1 = -1;\n      }\n      else {\n        local_12c = param_2;\n        local_130 = param_1;\n        local_128 = param_3;\n        local_124 = param_5;\n        iVar1 = FUN_00021460(__old,0,&local_130,FUN_0001ab60,6);\n        if (iVar1 == 0) {\n          iVar3 = renameat(param_3,__old,param_3,param_4);\n          if (iVar3 != 0) {\n            iVar3 = *piVar2;\n          }\n          unlinkat(param_3,__old,0);\n        }\n        else {\n          iVar3 = *piVar2;\n        }\n        if (__old != local_120) {\n          free(__old);\n        }\n        iVar1 = 1;\n        if (iVar3 != 0) {\n          *piVar2 = iVar3;\n          iVar1 = -1;\n        }\n      }\n    }\n  }" ({ "{") (expression_statement "piVar2 = __errno_location();" (assignment_expression "piVar2 = __errno_location()" (identifier "piVar2") (= "=") (call_expression "__errno_location()" (identifier "__errno_location") (argument_list "()" (( "(") () ")")))) (; ";")) (if_statement "if (*piVar2 == 0x11) {\n      __old = (char *)FUN_0001ab90();\n      if (__old == (char *)0x0) {\n        iVar1 = -1;\n      }\n      else {\n        local_12c = param_2;\n        local_130 = param_1;\n        local_128 = param_3;\n        local_124 = param_5;\n        iVar1 = FUN_00021460(__old,0,&local_130,FUN_0001ab60,6);\n        if (iVar1 == 0) {\n          iVar3 = renameat(param_3,__old,param_3,param_4);\n          if (iVar3 != 0) {\n            iVar3 = *piVar2;\n          }\n          unlinkat(param_3,__old,0);\n        }\n        else {\n          iVar3 = *piVar2;\n        }\n        if (__old != local_120) {\n          free(__old);\n        }\n        iVar1 = 1;\n        if (iVar3 != 0) {\n          *piVar2 = iVar3;\n          iVar1 = -1;\n        }\n      }\n    }" (if "if") (parenthesized_expression "(*piVar2 == 0x11)" (( "(") (binary_expression "*piVar2 == 0x11" (pointer_expression "*piVar2" (* "*") (identifier "piVar2")) (== "==") (number_literal "0x11")) () ")")) (compound_statement "{\n      __old = (char *)FUN_0001ab90();\n      if (__old == (char *)0x0) {\n        iVar1 = -1;\n      }\n      else {\n        local_12c = param_2;\n        local_130 = param_1;\n        local_128 = param_3;\n        local_124 = param_5;\n        iVar1 = FUN_00021460(__old,0,&local_130,FUN_0001ab60,6);\n        if (iVar1 == 0) {\n          iVar3 = renameat(param_3,__old,param_3,param_4);\n          if (iVar3 != 0) {\n            iVar3 = *piVar2;\n          }\n          unlinkat(param_3,__old,0);\n        }\n        else {\n          iVar3 = *piVar2;\n        }\n        if (__old != local_120) {\n          free(__old);\n        }\n        iVar1 = 1;\n        if (iVar3 != 0) {\n          *piVar2 = iVar3;\n          iVar1 = -1;\n        }\n      }\n    }" ({ "{") (expression_statement "__old = (char *)FUN_0001ab90();" (assignment_expression "__old = (char *)FUN_0001ab90()" (identifier "__old") (= "=") (cast_expression "(char *)FUN_0001ab90()" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "FUN_0001ab90()" (identifier "FUN_0001ab90") (argument_list "()" (( "(") () ")"))))) (; ";")) (if_statement "if (__old == (char *)0x0) {\n        iVar1 = -1;\n      }\n      else {\n        local_12c = param_2;\n        local_130 = param_1;\n        local_128 = param_3;\n        local_124 = param_5;\n        iVar1 = FUN_00021460(__old,0,&local_130,FUN_0001ab60,6);\n        if (iVar1 == 0) {\n          iVar3 = renameat(param_3,__old,param_3,param_4);\n          if (iVar3 != 0) {\n            iVar3 = *piVar2;\n          }\n          unlinkat(param_3,__old,0);\n        }\n        else {\n          iVar3 = *piVar2;\n        }\n        if (__old != local_120) {\n          free(__old);\n        }\n        iVar1 = 1;\n        if (iVar3 != 0) {\n          *piVar2 = iVar3;\n          iVar1 = -1;\n        }\n      }" (if "if") (parenthesized_expression "(__old == (char *)0x0)" (( "(") (binary_expression "__old == (char *)0x0" (identifier "__old") (== "==") (cast_expression "(char *)0x0" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n        iVar1 = -1;\n      }" ({ "{") (expression_statement "iVar1 = -1;" (assignment_expression "iVar1 = -1" (identifier "iVar1") (= "=") (number_literal "-1")) (; ";")) (} "}")) (else_clause "else {\n        local_12c = param_2;\n        local_130 = param_1;\n        local_128 = param_3;\n        local_124 = param_5;\n        iVar1 = FUN_00021460(__old,0,&local_130,FUN_0001ab60,6);\n        if (iVar1 == 0) {\n          iVar3 = renameat(param_3,__old,param_3,param_4);\n          if (iVar3 != 0) {\n            iVar3 = *piVar2;\n          }\n          unlinkat(param_3,__old,0);\n        }\n        else {\n          iVar3 = *piVar2;\n        }\n        if (__old != local_120) {\n          free(__old);\n        }\n        iVar1 = 1;\n        if (iVar3 != 0) {\n          *piVar2 = iVar3;\n          iVar1 = -1;\n        }\n      }" (else "else") (compound_statement "{\n        local_12c = param_2;\n        local_130 = param_1;\n        local_128 = param_3;\n        local_124 = param_5;\n        iVar1 = FUN_00021460(__old,0,&local_130,FUN_0001ab60,6);\n        if (iVar1 == 0) {\n          iVar3 = renameat(param_3,__old,param_3,param_4);\n          if (iVar3 != 0) {\n            iVar3 = *piVar2;\n          }\n          unlinkat(param_3,__old,0);\n        }\n        else {\n          iVar3 = *piVar2;\n        }\n        if (__old != local_120) {\n          free(__old);\n        }\n        iVar1 = 1;\n        if (iVar3 != 0) {\n          *piVar2 = iVar3;\n          iVar1 = -1;\n        }\n      }" ({ "{") (expression_statement "local_12c = param_2;" (assignment_expression "local_12c = param_2" (identifier "local_12c") (= "=") (identifier "param_2")) (; ";")) (expression_statement "local_130 = param_1;" (assignment_expression "local_130 = param_1" (identifier "local_130") (= "=") (identifier "param_1")) (; ";")) (expression_statement "local_128 = param_3;" (assignment_expression "local_128 = param_3" (identifier "local_128") (= "=") (identifier "param_3")) (; ";")) (expression_statement "local_124 = param_5;" (assignment_expression "local_124 = param_5" (identifier "local_124") (= "=") (identifier "param_5")) (; ";")) (expression_statement "iVar1 = FUN_00021460(__old,0,&local_130,FUN_0001ab60,6);" (assignment_expression "iVar1 = FUN_00021460(__old,0,&local_130,FUN_0001ab60,6)" (identifier "iVar1") (= "=") (call_expression "FUN_00021460(__old,0,&local_130,FUN_0001ab60,6)" (identifier "FUN_00021460") (argument_list "(__old,0,&local_130,FUN_0001ab60,6)" (( "(") (identifier "__old") (, ",") (number_literal "0") (, ",") (pointer_expression "&local_130" (& "&") (identifier "local_130")) (, ",") (identifier "FUN_0001ab60") (, ",") (number_literal "6") () ")")))) (; ";")) (if_statement "if (iVar1 == 0) {\n          iVar3 = renameat(param_3,__old,param_3,param_4);\n          if (iVar3 != 0) {\n            iVar3 = *piVar2;\n          }\n          unlinkat(param_3,__old,0);\n        }\n        else {\n          iVar3 = *piVar2;\n        }" (if "if") (parenthesized_expression "(iVar1 == 0)" (( "(") (binary_expression "iVar1 == 0" (identifier "iVar1") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n          iVar3 = renameat(param_3,__old,param_3,param_4);\n          if (iVar3 != 0) {\n            iVar3 = *piVar2;\n          }\n          unlinkat(param_3,__old,0);\n        }" ({ "{") (expression_statement "iVar3 = renameat(param_3,__old,param_3,param_4);" (assignment_expression "iVar3 = renameat(param_3,__old,param_3,param_4)" (identifier "iVar3") (= "=") (call_expression "renameat(param_3,__old,param_3,param_4)" (identifier "renameat") (argument_list "(param_3,__old,param_3,param_4)" (( "(") (identifier "param_3") (, ",") (identifier "__old") (, ",") (identifier "param_3") (, ",") (identifier "param_4") () ")")))) (; ";")) (if_statement "if (iVar3 != 0) {\n            iVar3 = *piVar2;\n          }" (if "if") (parenthesized_expression "(iVar3 != 0)" (( "(") (binary_expression "iVar3 != 0" (identifier "iVar3") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n            iVar3 = *piVar2;\n          }" ({ "{") (expression_statement "iVar3 = *piVar2;" (assignment_expression "iVar3 = *piVar2" (identifier "iVar3") (= "=") (pointer_expression "*piVar2" (* "*") (identifier "piVar2"))) (; ";")) (} "}"))) (expression_statement "unlinkat(param_3,__old,0);" (call_expression "unlinkat(param_3,__old,0)" (identifier "unlinkat") (argument_list "(param_3,__old,0)" (( "(") (identifier "param_3") (, ",") (identifier "__old") (, ",") (number_literal "0") () ")"))) (; ";")) (} "}")) (else_clause "else {\n          iVar3 = *piVar2;\n        }" (else "else") (compound_statement "{\n          iVar3 = *piVar2;\n        }" ({ "{") (expression_statement "iVar3 = *piVar2;" (assignment_expression "iVar3 = *piVar2" (identifier "iVar3") (= "=") (pointer_expression "*piVar2" (* "*") (identifier "piVar2"))) (; ";")) (} "}")))) (if_statement "if (__old != local_120) {\n          free(__old);\n        }" (if "if") (parenthesized_expression "(__old != local_120)" (( "(") (binary_expression "__old != local_120" (identifier "__old") (!= "!=") (identifier "local_120")) () ")")) (compound_statement "{\n          free(__old);\n        }" ({ "{") (expression_statement "free(__old);" (call_expression "free(__old)" (identifier "free") (argument_list "(__old)" (( "(") (identifier "__old") () ")"))) (; ";")) (} "}"))) (expression_statement "iVar1 = 1;" (assignment_expression "iVar1 = 1" (identifier "iVar1") (= "=") (number_literal "1")) (; ";")) (if_statement "if (iVar3 != 0) {\n          *piVar2 = iVar3;\n          iVar1 = -1;\n        }" (if "if") (parenthesized_expression "(iVar3 != 0)" (( "(") (binary_expression "iVar3 != 0" (identifier "iVar3") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n          *piVar2 = iVar3;\n          iVar1 = -1;\n        }" ({ "{") (expression_statement "*piVar2 = iVar3;" (assignment_expression "*piVar2 = iVar3" (pointer_expression "*piVar2" (* "*") (identifier "piVar2")) (= "=") (identifier "iVar3")) (; ";")) (expression_statement "iVar1 = -1;" (assignment_expression "iVar1 = -1" (identifier "iVar1") (= "=") (number_literal "-1")) (; ";")) (} "}"))) (} "}")))) (} "}"))) (} "}"))) (if_statement "if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return iVar1;\n  }" (if "if") (parenthesized_expression "(local_20 == *(int *)(in_GS_OFFSET + 0x14))" (( "(") (binary_expression "local_20 == *(int *)(in_GS_OFFSET + 0x14)" (identifier "local_20") (== "==") (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" (* "*") (cast_expression "(int *)(in_GS_OFFSET + 0x14)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(in_GS_OFFSET + 0x14)" (( "(") (binary_expression "in_GS_OFFSET + 0x14" (identifier "in_GS_OFFSET") (+ "+") (number_literal "0x14")) () ")"))))) () ")")) (compound_statement "{\n    return iVar1;\n  }" ({ "{") (return_statement "return iVar1;" (return "return") (identifier "iVar1") (; ";")) (} "}"))) (expression_statement "FUN_0002bcb0();" (call_expression "FUN_0002bcb0()" (identifier "FUN_0002bcb0") (argument_list "()" (( "(") () ")"))) (; ";")) (} "}")))

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

int function_1(int srcdir,char *srcname,int dstdir,char *dstname,int flags,type_1 force)

{
  int var_13;
  int var_3;
  int *piVar3;
  char *var_6;
  int var_9;
  int var_1;
  type_2 arg;
  char var_11 [256];
  
  var_13 = *(int *)(var_1 + 0x14);
  var_3 = var_2(srcdir,srcname,dstdir,dstname,flags);
  if ((force) && (var_3 != 0)) {
    piVar3 = var_4();
    if (*piVar3 == 0x11) {
      var_6 = var_5(dstname,var_11);
      if (var_6 == (char *)0x0) {
        var_3 = -1;
      }
      else {
        arg.srcname = srcname;
        arg.srcdir = srcdir;
        arg.dstdir = dstdir;
        arg.flags = flags;
        var_3 = var_7(var_6,0,&arg,try_link,6);
        if (var_3 == 0) {
          var_9 = var_8(dstdir,var_6,dstdir,dstname);
          if (var_9 != 0) {
            var_9 = *piVar3;
          }
          var_10(dstdir,var_6,0);
        }
        else {
          var_9 = *piVar3;
        }
        if (var_6 != var_11) {
          var_12(var_6);
        }
        var_3 = 1;
        if (var_9 != 0) {
          *piVar3 = var_9;
          var_3 = -1;
        }
      }
    }
  }
  if (var_13 == *(int *)(var_1 + 0x14)) {
    return var_3;
  }
                    /* WARNING: Subroutine does not return */
  var_14();
}


(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: (pointer_declarator declarator: (identifier))) (parameter_declaration type: (primitive_type) declarator: (identifier)) (parameter_declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (parameter_declaration type: (primitive_type) declarator: (identifier)) (parameter_declaration type: (primitive_type) declarator: (identifier)))) body: (compound_statement (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)) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (array_declarator declarator: (identifier) size: (number_literal))) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier) (identifier) (identifier) (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (char_literal (escape_sequence)))) right: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list)))) (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: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (call_expression function: (identifier) arguments: (argument_list))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (number_literal)))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (number_literal)))) alternative: (else_clause (compound_statement (expression_statement (assignment_expression left: (identifier) right: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (number_literal) (pointer_expression argument: (identifier)) (identifier) (number_literal))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier) (identifier) (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (identifier)))))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier) (number_literal))))) alternative: (else_clause (compound_statement (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (identifier))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier)))))) (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (number_literal)))))))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))))) consequence: (compound_statement (return_statement (identifier)))) (expression_statement (call_expression function: (identifier) arguments: (argument_list))))))

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

int MASKED(int param_1,char *param_2,int param_3,char *param_4,int param_5,char param_6)

{
  int iVar1;
  int *piVar2;
  char *__old;
  int iVar3;
  int in_GS_OFFSET;
  int local_130;
  char *local_12c;
  int local_128;
  int local_124;
  char local_120 [256];
  int local_20;
  undefined4 uStack_14;
  
  uStack_14 = 0x1ac49;
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  iVar1 = linkat(param_1,param_2,param_3,param_4,param_5);
  if ((param_6 == '\x01') && (iVar1 != 0)) {
    piVar2 = __errno_location();
    if (*piVar2 == 0x11) {
      __old = (char *)FUN_0001ab90();
      if (__old == (char *)0x0) {
        iVar1 = -1;
      }
      else {
        local_12c = param_2;
        local_130 = param_1;
        local_128 = param_3;
        local_124 = param_5;
        iVar1 = FUN_00021460(__old,0,&local_130,FUN_0001ab60,6);
        if (iVar1 == 0) {
          iVar3 = renameat(param_3,__old,param_3,param_4);
          if (iVar3 != 0) {
            iVar3 = *piVar2;
          }
          unlinkat(param_3,__old,0);
        }
        else {
          iVar3 = *piVar2;
        }
        if (__old != local_120) {
          free(__old);
        }
        iVar1 = 1;
        if (iVar3 != 0) {
          *piVar2 = iVar3;
          iVar1 = -1;
        }
      }
    }
  }
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return iVar1;
  }
                    /* WARNING: Subroutine does not return */
  FUN_0002bcb0();
}

