
int smart_rename(char *from,char *to,int preserve_dates)

{
  int iVar1;
  int *piVar2;
  char *pcVar3;
  char *pcVar4;
  stat s;
  
  iVar1 = __lxstat(1,to,(stat *)&s);
  if (iVar1 == 0) {
    if (((s.st_mode & 0xf080) != 0x8080) || (s.st_nlink != 1)) {
      iVar1 = simple_copy(from,to);
      if (iVar1 != 0) {
        piVar2 = __errno_location();
        pcVar3 = strerror(*piVar2);
        pcVar4 = (char *)dcgettext(0,"unable to copy file \'%s\'; reason: %s",5);
        non_fatal(pcVar4,to,pcVar3);
      }
      if (preserve_dates != 0) {
        set_times(to,&s);
      }
      unlink(from);
      return iVar1;
    }
    iVar1 = rename(from,to);
    if (iVar1 != 0) {
LAB_001071a8:
      piVar2 = __errno_location();
      pcVar3 = strerror(*piVar2);
      pcVar4 = (char *)dcgettext(0,"unable to rename \'%s\'; reason: %s",5);
      non_fatal(pcVar4,to,pcVar3);
      unlink(from);
      return iVar1;
    }
    chmod(to,s.st_mode & 0x1ff);
    iVar1 = chown(to,s.st_uid,s.st_gid);
    if (-1 < iVar1) {
      chmod(to,s.st_mode & 0xfff);
      return 0;
    }
  }
  else {
    iVar1 = rename(from,to);
    if (iVar1 != 0) goto LAB_001071a8;
  }
  return 0;
}



int FUN_001070c0(char *param_1,char *param_2,int param_3)

{
  int iVar1;
  int *piVar2;
  char *pcVar3;
  undefined8 uVar4;
  stat sStack_c8;
  
  iVar1 = __lxstat(1,param_2,&sStack_c8);
  if (iVar1 == 0) {
    if (((sStack_c8.st_mode & 0xf080) != 0x8080) || (sStack_c8.st_nlink != 1)) {
      iVar1 = FUN_00106f50(param_1,param_2);
      if (iVar1 != 0) {
        piVar2 = __errno_location();
        pcVar3 = strerror(*piVar2);
        uVar4 = dcgettext(0,"unable to copy file \'%s\'; reason: %s",5);
        FUN_00107900(uVar4,param_2,pcVar3);
      }
      if (param_3 != 0) {
        FUN_00107050(param_2,&sStack_c8);
      }
      unlink(param_1);
      return iVar1;
    }
    iVar1 = rename(param_1,param_2);
    if (iVar1 != 0) {
LAB_001071a8:
      piVar2 = __errno_location();
      pcVar3 = strerror(*piVar2);
      uVar4 = dcgettext(0,"unable to rename \'%s\'; reason: %s",5);
      FUN_00107900(uVar4,param_2,pcVar3);
      unlink(param_1);
      return iVar1;
    }
    chmod(param_2,sStack_c8.st_mode & 0x1ff);
    iVar1 = chown(param_2,sStack_c8.st_uid,sStack_c8.st_gid);
    if (-1 < iVar1) {
      chmod(param_2,sStack_c8.st_mode & 0xfff);
      return 0;
    }
  }
  else {
    iVar1 = rename(param_1,param_2);
    if (iVar1 != 0) goto LAB_001071a8;
  }
  return 0;
}


PUSH R15
PUSH R14
MOV R14D,EDX
PUSH R13
PUSH R12
MOV R12,RDI
MOV EDI,0x1
PUSH RBP
PUSH RBX
MOV RBX,RSI
SUB RSP,0x98
MOV R13,RSP
MOV RDX,R13
CALL 0x001021d0
TEST EAX,EAX
JNZ 0x00107140
MOV EAX,dword ptr [RSP + 0x18]
AND EAX,0xf080
CMP EAX,0x8080
JNZ 0x0010710a
CMP qword ptr [RSP + 0x10],0x1
JZ 0x001071f0
MOV RSI,RBX
MOV RDI,R12
CALL 0x00106f50
MOV EBP,EAX
TEST EAX,EAX
JNZ 0x00107168
TEST R14D,R14D
JNZ 0x00107158
MOV RDI,R12
CALL 0x001020b0
ADD RSP,0x98
MOV EAX,EBP
POP RBX
POP RBP
POP R12
POP R13
POP R14
POP R15
RET
MOV RSI,RBX
MOV RDI,R12
CALL 0x00102530
MOV EBP,EAX
TEST EAX,EAX
JNZ 0x001071a8
XOR EBP,EBP
JMP 0x00107128
MOV RSI,R13
MOV RDI,RBX
CALL 0x00107050
JMP 0x00107120
CALL 0x001020a0
MOV EDI,dword ptr [RAX]
CALL 0x001025d0
XOR EDI,EDI
MOV EDX,0x5
LEA RSI,[0x10c220]
MOV R15,RAX
CALL 0x001021b0
MOV RDX,R15
MOV RSI,RBX
MOV RDI,RAX
XOR EAX,EAX
CALL 0x00107900
TEST R14D,R14D
JZ 0x00107120
JMP 0x00107158
CALL 0x001020a0
MOV EDI,dword ptr [RAX]
CALL 0x001025d0
XOR EDI,EDI
MOV EDX,0x5
LEA RSI,[0x10c1f8]
MOV R13,RAX
CALL 0x001021b0
MOV RDX,R13
MOV RSI,RBX
MOV RDI,RAX
XOR EAX,EAX
CALL 0x00107900
MOV RDI,R12
CALL 0x001020b0
JMP 0x00107128
MOV RSI,RBX
MOV RDI,R12
CALL 0x00102530
MOV EBP,EAX
TEST EAX,EAX
JNZ 0x001071a8
MOV ESI,dword ptr [RSP + 0x18]
MOV RDI,RBX
AND ESI,0x1ff
CALL 0x001024a0
MOV EDX,dword ptr [RSP + 0x20]
MOV ESI,dword ptr [RSP + 0x1c]
MOV RDI,RBX
CALL 0x00102450
TEST EAX,EAX
JS 0x00107151
MOV ESI,dword ptr [RSP + 0x18]
MOV RDI,RBX
AND ESI,0xfff
CALL 0x001024a0
JMP 0x00107128
(translation_unit "int FUN_001070c0(char *param_1,char *param_2,int param_3)\n\n{\n  int iVar1;\n  int *piVar2;\n  char *pcVar3;\n  undefined8 uVar4;\n  stat sStack_c8;\n  \n  iVar1 = __lxstat(1,param_2,&sStack_c8);\n  if (iVar1 == 0) {\n    if (((sStack_c8.st_mode & 0xf080) != 0x8080) || (sStack_c8.st_nlink != 1)) {\n      iVar1 = FUN_00106f50(param_1,param_2);\n      if (iVar1 != 0) {\n        piVar2 = __errno_location();\n        pcVar3 = strerror(*piVar2);\n        uVar4 = dcgettext(0,"unable to copy file \'%s\'; reason: %s",5);\n        FUN_00107900(uVar4,param_2,pcVar3);\n      }\n      if (param_3 != 0) {\n        FUN_00107050(param_2,&sStack_c8);\n      }\n      unlink(param_1);\n      return iVar1;\n    }\n    iVar1 = rename(param_1,param_2);\n    if (iVar1 != 0) {\nLAB_001071a8:\n      piVar2 = __errno_location();\n      pcVar3 = strerror(*piVar2);\n      uVar4 = dcgettext(0,"unable to rename \'%s\'; reason: %s",5);\n      FUN_00107900(uVar4,param_2,pcVar3);\n      unlink(param_1);\n      return iVar1;\n    }\n    chmod(param_2,sStack_c8.st_mode & 0x1ff);\n    iVar1 = chown(param_2,sStack_c8.st_uid,sStack_c8.st_gid);\n    if (-1 < iVar1) {\n      chmod(param_2,sStack_c8.st_mode & 0xfff);\n      return 0;\n    }\n  }\n  else {\n    iVar1 = rename(param_1,param_2);\n    if (iVar1 != 0) goto LAB_001071a8;\n  }\n  return 0;\n}\n\n" (function_definition "int FUN_001070c0(char *param_1,char *param_2,int param_3)\n\n{\n  int iVar1;\n  int *piVar2;\n  char *pcVar3;\n  undefined8 uVar4;\n  stat sStack_c8;\n  \n  iVar1 = __lxstat(1,param_2,&sStack_c8);\n  if (iVar1 == 0) {\n    if (((sStack_c8.st_mode & 0xf080) != 0x8080) || (sStack_c8.st_nlink != 1)) {\n      iVar1 = FUN_00106f50(param_1,param_2);\n      if (iVar1 != 0) {\n        piVar2 = __errno_location();\n        pcVar3 = strerror(*piVar2);\n        uVar4 = dcgettext(0,"unable to copy file \'%s\'; reason: %s",5);\n        FUN_00107900(uVar4,param_2,pcVar3);\n      }\n      if (param_3 != 0) {\n        FUN_00107050(param_2,&sStack_c8);\n      }\n      unlink(param_1);\n      return iVar1;\n    }\n    iVar1 = rename(param_1,param_2);\n    if (iVar1 != 0) {\nLAB_001071a8:\n      piVar2 = __errno_location();\n      pcVar3 = strerror(*piVar2);\n      uVar4 = dcgettext(0,"unable to rename \'%s\'; reason: %s",5);\n      FUN_00107900(uVar4,param_2,pcVar3);\n      unlink(param_1);\n      return iVar1;\n    }\n    chmod(param_2,sStack_c8.st_mode & 0x1ff);\n    iVar1 = chown(param_2,sStack_c8.st_uid,sStack_c8.st_gid);\n    if (-1 < iVar1) {\n      chmod(param_2,sStack_c8.st_mode & 0xfff);\n      return 0;\n    }\n  }\n  else {\n    iVar1 = rename(param_1,param_2);\n    if (iVar1 != 0) goto LAB_001071a8;\n  }\n  return 0;\n}" primitive_type (function_declarator "FUN_001070c0(char *param_1,char *param_2,int param_3)" identifier (parameter_list "(char *param_1,char *param_2,int param_3)" ( (parameter_declaration "char *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "char *param_2" primitive_type (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "int param_3" primitive_type identifier) ))) (compound_statement "{\n  int iVar1;\n  int *piVar2;\n  char *pcVar3;\n  undefined8 uVar4;\n  stat sStack_c8;\n  \n  iVar1 = __lxstat(1,param_2,&sStack_c8);\n  if (iVar1 == 0) {\n    if (((sStack_c8.st_mode & 0xf080) != 0x8080) || (sStack_c8.st_nlink != 1)) {\n      iVar1 = FUN_00106f50(param_1,param_2);\n      if (iVar1 != 0) {\n        piVar2 = __errno_location();\n        pcVar3 = strerror(*piVar2);\n        uVar4 = dcgettext(0,"unable to copy file \'%s\'; reason: %s",5);\n        FUN_00107900(uVar4,param_2,pcVar3);\n      }\n      if (param_3 != 0) {\n        FUN_00107050(param_2,&sStack_c8);\n      }\n      unlink(param_1);\n      return iVar1;\n    }\n    iVar1 = rename(param_1,param_2);\n    if (iVar1 != 0) {\nLAB_001071a8:\n      piVar2 = __errno_location();\n      pcVar3 = strerror(*piVar2);\n      uVar4 = dcgettext(0,"unable to rename \'%s\'; reason: %s",5);\n      FUN_00107900(uVar4,param_2,pcVar3);\n      unlink(param_1);\n      return iVar1;\n    }\n    chmod(param_2,sStack_c8.st_mode & 0x1ff);\n    iVar1 = chown(param_2,sStack_c8.st_uid,sStack_c8.st_gid);\n    if (-1 < iVar1) {\n      chmod(param_2,sStack_c8.st_mode & 0xfff);\n      return 0;\n    }\n  }\n  else {\n    iVar1 = rename(param_1,param_2);\n    if (iVar1 != 0) goto LAB_001071a8;\n  }\n  return 0;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int *piVar2;" primitive_type (pointer_declarator "*piVar2" * identifier) ;) (declaration "char *pcVar3;" primitive_type (pointer_declarator "*pcVar3" * identifier) ;) (declaration "undefined8 uVar4;" type_identifier identifier ;) (declaration "stat sStack_c8;" type_identifier identifier ;) (expression_statement "iVar1 = __lxstat(1,param_2,&sStack_c8);" (assignment_expression "iVar1 = __lxstat(1,param_2,&sStack_c8)" identifier = (call_expression "__lxstat(1,param_2,&sStack_c8)" identifier (argument_list "(1,param_2,&sStack_c8)" ( number_literal , identifier , (pointer_expression "&sStack_c8" & identifier) )))) ;) (if_statement "if (iVar1 == 0) {\n    if (((sStack_c8.st_mode & 0xf080) != 0x8080) || (sStack_c8.st_nlink != 1)) {\n      iVar1 = FUN_00106f50(param_1,param_2);\n      if (iVar1 != 0) {\n        piVar2 = __errno_location();\n        pcVar3 = strerror(*piVar2);\n        uVar4 = dcgettext(0,"unable to copy file \'%s\'; reason: %s",5);\n        FUN_00107900(uVar4,param_2,pcVar3);\n      }\n      if (param_3 != 0) {\n        FUN_00107050(param_2,&sStack_c8);\n      }\n      unlink(param_1);\n      return iVar1;\n    }\n    iVar1 = rename(param_1,param_2);\n    if (iVar1 != 0) {\nLAB_001071a8:\n      piVar2 = __errno_location();\n      pcVar3 = strerror(*piVar2);\n      uVar4 = dcgettext(0,"unable to rename \'%s\'; reason: %s",5);\n      FUN_00107900(uVar4,param_2,pcVar3);\n      unlink(param_1);\n      return iVar1;\n    }\n    chmod(param_2,sStack_c8.st_mode & 0x1ff);\n    iVar1 = chown(param_2,sStack_c8.st_uid,sStack_c8.st_gid);\n    if (-1 < iVar1) {\n      chmod(param_2,sStack_c8.st_mode & 0xfff);\n      return 0;\n    }\n  }\n  else {\n    iVar1 = rename(param_1,param_2);\n    if (iVar1 != 0) goto LAB_001071a8;\n  }" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (compound_statement "{\n    if (((sStack_c8.st_mode & 0xf080) != 0x8080) || (sStack_c8.st_nlink != 1)) {\n      iVar1 = FUN_00106f50(param_1,param_2);\n      if (iVar1 != 0) {\n        piVar2 = __errno_location();\n        pcVar3 = strerror(*piVar2);\n        uVar4 = dcgettext(0,"unable to copy file \'%s\'; reason: %s",5);\n        FUN_00107900(uVar4,param_2,pcVar3);\n      }\n      if (param_3 != 0) {\n        FUN_00107050(param_2,&sStack_c8);\n      }\n      unlink(param_1);\n      return iVar1;\n    }\n    iVar1 = rename(param_1,param_2);\n    if (iVar1 != 0) {\nLAB_001071a8:\n      piVar2 = __errno_location();\n      pcVar3 = strerror(*piVar2);\n      uVar4 = dcgettext(0,"unable to rename \'%s\'; reason: %s",5);\n      FUN_00107900(uVar4,param_2,pcVar3);\n      unlink(param_1);\n      return iVar1;\n    }\n    chmod(param_2,sStack_c8.st_mode & 0x1ff);\n    iVar1 = chown(param_2,sStack_c8.st_uid,sStack_c8.st_gid);\n    if (-1 < iVar1) {\n      chmod(param_2,sStack_c8.st_mode & 0xfff);\n      return 0;\n    }\n  }" { (if_statement "if (((sStack_c8.st_mode & 0xf080) != 0x8080) || (sStack_c8.st_nlink != 1)) {\n      iVar1 = FUN_00106f50(param_1,param_2);\n      if (iVar1 != 0) {\n        piVar2 = __errno_location();\n        pcVar3 = strerror(*piVar2);\n        uVar4 = dcgettext(0,"unable to copy file \'%s\'; reason: %s",5);\n        FUN_00107900(uVar4,param_2,pcVar3);\n      }\n      if (param_3 != 0) {\n        FUN_00107050(param_2,&sStack_c8);\n      }\n      unlink(param_1);\n      return iVar1;\n    }" if (parenthesized_expression "(((sStack_c8.st_mode & 0xf080) != 0x8080) || (sStack_c8.st_nlink != 1))" ( (binary_expression "((sStack_c8.st_mode & 0xf080) != 0x8080) || (sStack_c8.st_nlink != 1)" (parenthesized_expression "((sStack_c8.st_mode & 0xf080) != 0x8080)" ( (binary_expression "(sStack_c8.st_mode & 0xf080) != 0x8080" (parenthesized_expression "(sStack_c8.st_mode & 0xf080)" ( (binary_expression "sStack_c8.st_mode & 0xf080" (field_expression "sStack_c8.st_mode" identifier . field_identifier) & number_literal) )) != number_literal) )) || (parenthesized_expression "(sStack_c8.st_nlink != 1)" ( (binary_expression "sStack_c8.st_nlink != 1" (field_expression "sStack_c8.st_nlink" identifier . field_identifier) != number_literal) ))) )) (compound_statement "{\n      iVar1 = FUN_00106f50(param_1,param_2);\n      if (iVar1 != 0) {\n        piVar2 = __errno_location();\n        pcVar3 = strerror(*piVar2);\n        uVar4 = dcgettext(0,"unable to copy file \'%s\'; reason: %s",5);\n        FUN_00107900(uVar4,param_2,pcVar3);\n      }\n      if (param_3 != 0) {\n        FUN_00107050(param_2,&sStack_c8);\n      }\n      unlink(param_1);\n      return iVar1;\n    }" { (expression_statement "iVar1 = FUN_00106f50(param_1,param_2);" (assignment_expression "iVar1 = FUN_00106f50(param_1,param_2)" identifier = (call_expression "FUN_00106f50(param_1,param_2)" identifier (argument_list "(param_1,param_2)" ( identifier , identifier )))) ;) (if_statement "if (iVar1 != 0) {\n        piVar2 = __errno_location();\n        pcVar3 = strerror(*piVar2);\n        uVar4 = dcgettext(0,"unable to copy file \'%s\'; reason: %s",5);\n        FUN_00107900(uVar4,param_2,pcVar3);\n      }" if (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) (compound_statement "{\n        piVar2 = __errno_location();\n        pcVar3 = strerror(*piVar2);\n        uVar4 = dcgettext(0,"unable to copy file \'%s\'; reason: %s",5);\n        FUN_00107900(uVar4,param_2,pcVar3);\n      }" { (expression_statement "piVar2 = __errno_location();" (assignment_expression "piVar2 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (expression_statement "pcVar3 = strerror(*piVar2);" (assignment_expression "pcVar3 = strerror(*piVar2)" identifier = (call_expression "strerror(*piVar2)" identifier (argument_list "(*piVar2)" ( (pointer_expression "*piVar2" * identifier) )))) ;) (expression_statement "uVar4 = dcgettext(0,"unable to copy file \'%s\'; reason: %s",5);" (assignment_expression "uVar4 = dcgettext(0,"unable to copy file \'%s\'; reason: %s",5)" identifier = (call_expression "dcgettext(0,"unable to copy file \'%s\'; reason: %s",5)" identifier (argument_list "(0,"unable to copy file \'%s\'; reason: %s",5)" ( number_literal , (string_literal ""unable to copy file \'%s\'; reason: %s"" " string_content escape_sequence string_content escape_sequence string_content ") , number_literal )))) ;) (expression_statement "FUN_00107900(uVar4,param_2,pcVar3);" (call_expression "FUN_00107900(uVar4,param_2,pcVar3)" identifier (argument_list "(uVar4,param_2,pcVar3)" ( identifier , identifier , identifier ))) ;) })) (if_statement "if (param_3 != 0) {\n        FUN_00107050(param_2,&sStack_c8);\n      }" if (parenthesized_expression "(param_3 != 0)" ( (binary_expression "param_3 != 0" identifier != number_literal) )) (compound_statement "{\n        FUN_00107050(param_2,&sStack_c8);\n      }" { (expression_statement "FUN_00107050(param_2,&sStack_c8);" (call_expression "FUN_00107050(param_2,&sStack_c8)" identifier (argument_list "(param_2,&sStack_c8)" ( identifier , (pointer_expression "&sStack_c8" & identifier) ))) ;) })) (expression_statement "unlink(param_1);" (call_expression "unlink(param_1)" identifier (argument_list "(param_1)" ( identifier ))) ;) (return_statement "return iVar1;" return identifier ;) })) (expression_statement "iVar1 = rename(param_1,param_2);" (assignment_expression "iVar1 = rename(param_1,param_2)" identifier = (call_expression "rename(param_1,param_2)" identifier (argument_list "(param_1,param_2)" ( identifier , identifier )))) ;) (if_statement "if (iVar1 != 0) {\nLAB_001071a8:\n      piVar2 = __errno_location();\n      pcVar3 = strerror(*piVar2);\n      uVar4 = dcgettext(0,"unable to rename \'%s\'; reason: %s",5);\n      FUN_00107900(uVar4,param_2,pcVar3);\n      unlink(param_1);\n      return iVar1;\n    }" if (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) (compound_statement "{\nLAB_001071a8:\n      piVar2 = __errno_location();\n      pcVar3 = strerror(*piVar2);\n      uVar4 = dcgettext(0,"unable to rename \'%s\'; reason: %s",5);\n      FUN_00107900(uVar4,param_2,pcVar3);\n      unlink(param_1);\n      return iVar1;\n    }" { (labeled_statement "LAB_001071a8:\n      piVar2 = __errno_location();" statement_identifier : (expression_statement "piVar2 = __errno_location();" (assignment_expression "piVar2 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;)) (expression_statement "pcVar3 = strerror(*piVar2);" (assignment_expression "pcVar3 = strerror(*piVar2)" identifier = (call_expression "strerror(*piVar2)" identifier (argument_list "(*piVar2)" ( (pointer_expression "*piVar2" * identifier) )))) ;) (expression_statement "uVar4 = dcgettext(0,"unable to rename \'%s\'; reason: %s",5);" (assignment_expression "uVar4 = dcgettext(0,"unable to rename \'%s\'; reason: %s",5)" identifier = (call_expression "dcgettext(0,"unable to rename \'%s\'; reason: %s",5)" identifier (argument_list "(0,"unable to rename \'%s\'; reason: %s",5)" ( number_literal , (string_literal ""unable to rename \'%s\'; reason: %s"" " string_content escape_sequence string_content escape_sequence string_content ") , number_literal )))) ;) (expression_statement "FUN_00107900(uVar4,param_2,pcVar3);" (call_expression "FUN_00107900(uVar4,param_2,pcVar3)" identifier (argument_list "(uVar4,param_2,pcVar3)" ( identifier , identifier , identifier ))) ;) (expression_statement "unlink(param_1);" (call_expression "unlink(param_1)" identifier (argument_list "(param_1)" ( identifier ))) ;) (return_statement "return iVar1;" return identifier ;) })) (expression_statement "chmod(param_2,sStack_c8.st_mode & 0x1ff);" (call_expression "chmod(param_2,sStack_c8.st_mode & 0x1ff)" identifier (argument_list "(param_2,sStack_c8.st_mode & 0x1ff)" ( identifier , (binary_expression "sStack_c8.st_mode & 0x1ff" (field_expression "sStack_c8.st_mode" identifier . field_identifier) & number_literal) ))) ;) (expression_statement "iVar1 = chown(param_2,sStack_c8.st_uid,sStack_c8.st_gid);" (assignment_expression "iVar1 = chown(param_2,sStack_c8.st_uid,sStack_c8.st_gid)" identifier = (call_expression "chown(param_2,sStack_c8.st_uid,sStack_c8.st_gid)" identifier (argument_list "(param_2,sStack_c8.st_uid,sStack_c8.st_gid)" ( identifier , (field_expression "sStack_c8.st_uid" identifier . field_identifier) , (field_expression "sStack_c8.st_gid" identifier . field_identifier) )))) ;) (if_statement "if (-1 < iVar1) {\n      chmod(param_2,sStack_c8.st_mode & 0xfff);\n      return 0;\n    }" if (parenthesized_expression "(-1 < iVar1)" ( (binary_expression "-1 < iVar1" number_literal < identifier) )) (compound_statement "{\n      chmod(param_2,sStack_c8.st_mode & 0xfff);\n      return 0;\n    }" { (expression_statement "chmod(param_2,sStack_c8.st_mode & 0xfff);" (call_expression "chmod(param_2,sStack_c8.st_mode & 0xfff)" identifier (argument_list "(param_2,sStack_c8.st_mode & 0xfff)" ( identifier , (binary_expression "sStack_c8.st_mode & 0xfff" (field_expression "sStack_c8.st_mode" identifier . field_identifier) & number_literal) ))) ;) (return_statement "return 0;" return number_literal ;) })) }) (else_clause "else {\n    iVar1 = rename(param_1,param_2);\n    if (iVar1 != 0) goto LAB_001071a8;\n  }" else (compound_statement "{\n    iVar1 = rename(param_1,param_2);\n    if (iVar1 != 0) goto LAB_001071a8;\n  }" { (expression_statement "iVar1 = rename(param_1,param_2);" (assignment_expression "iVar1 = rename(param_1,param_2)" identifier = (call_expression "rename(param_1,param_2)" identifier (argument_list "(param_1,param_2)" ( identifier , identifier )))) ;) (if_statement "if (iVar1 != 0) goto LAB_001071a8;" if (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) (goto_statement "goto LAB_001071a8;" goto statement_identifier ;)) }))) (return_statement "return 0;" return number_literal ;) })))
(translation_unit "int smart_rename(char *from,char *to,int preserve_dates)\n\n{\n  int iVar1;\n  int *piVar2;\n  char *pcVar3;\n  char *pcVar4;\n  stat s;\n  \n  iVar1 = __lxstat(1,to,(stat *)&s);\n  if (iVar1 == 0) {\n    if (((s.st_mode & 0xf080) != 0x8080) || (s.st_nlink != 1)) {\n      iVar1 = simple_copy(from,to);\n      if (iVar1 != 0) {\n        piVar2 = __errno_location();\n        pcVar3 = strerror(*piVar2);\n        pcVar4 = (char *)dcgettext(0,"unable to copy file \'%s\'; reason: %s",5);\n        non_fatal(pcVar4,to,pcVar3);\n      }\n      if (preserve_dates != 0) {\n        set_times(to,&s);\n      }\n      unlink(from);\n      return iVar1;\n    }\n    iVar1 = rename(from,to);\n    if (iVar1 != 0) {\nLAB_001071a8:\n      piVar2 = __errno_location();\n      pcVar3 = strerror(*piVar2);\n      pcVar4 = (char *)dcgettext(0,"unable to rename \'%s\'; reason: %s",5);\n      non_fatal(pcVar4,to,pcVar3);\n      unlink(from);\n      return iVar1;\n    }\n    chmod(to,s.st_mode & 0x1ff);\n    iVar1 = chown(to,s.st_uid,s.st_gid);\n    if (-1 < iVar1) {\n      chmod(to,s.st_mode & 0xfff);\n      return 0;\n    }\n  }\n  else {\n    iVar1 = rename(from,to);\n    if (iVar1 != 0) goto LAB_001071a8;\n  }\n  return 0;\n}\n\n" (function_definition "int smart_rename(char *from,char *to,int preserve_dates)\n\n{\n  int iVar1;\n  int *piVar2;\n  char *pcVar3;\n  char *pcVar4;\n  stat s;\n  \n  iVar1 = __lxstat(1,to,(stat *)&s);\n  if (iVar1 == 0) {\n    if (((s.st_mode & 0xf080) != 0x8080) || (s.st_nlink != 1)) {\n      iVar1 = simple_copy(from,to);\n      if (iVar1 != 0) {\n        piVar2 = __errno_location();\n        pcVar3 = strerror(*piVar2);\n        pcVar4 = (char *)dcgettext(0,"unable to copy file \'%s\'; reason: %s",5);\n        non_fatal(pcVar4,to,pcVar3);\n      }\n      if (preserve_dates != 0) {\n        set_times(to,&s);\n      }\n      unlink(from);\n      return iVar1;\n    }\n    iVar1 = rename(from,to);\n    if (iVar1 != 0) {\nLAB_001071a8:\n      piVar2 = __errno_location();\n      pcVar3 = strerror(*piVar2);\n      pcVar4 = (char *)dcgettext(0,"unable to rename \'%s\'; reason: %s",5);\n      non_fatal(pcVar4,to,pcVar3);\n      unlink(from);\n      return iVar1;\n    }\n    chmod(to,s.st_mode & 0x1ff);\n    iVar1 = chown(to,s.st_uid,s.st_gid);\n    if (-1 < iVar1) {\n      chmod(to,s.st_mode & 0xfff);\n      return 0;\n    }\n  }\n  else {\n    iVar1 = rename(from,to);\n    if (iVar1 != 0) goto LAB_001071a8;\n  }\n  return 0;\n}" primitive_type (function_declarator "smart_rename(char *from,char *to,int preserve_dates)" identifier (parameter_list "(char *from,char *to,int preserve_dates)" ( (parameter_declaration "char *from" primitive_type (pointer_declarator "*from" * identifier)) , (parameter_declaration "char *to" primitive_type (pointer_declarator "*to" * identifier)) , (parameter_declaration "int preserve_dates" primitive_type identifier) ))) (compound_statement "{\n  int iVar1;\n  int *piVar2;\n  char *pcVar3;\n  char *pcVar4;\n  stat s;\n  \n  iVar1 = __lxstat(1,to,(stat *)&s);\n  if (iVar1 == 0) {\n    if (((s.st_mode & 0xf080) != 0x8080) || (s.st_nlink != 1)) {\n      iVar1 = simple_copy(from,to);\n      if (iVar1 != 0) {\n        piVar2 = __errno_location();\n        pcVar3 = strerror(*piVar2);\n        pcVar4 = (char *)dcgettext(0,"unable to copy file \'%s\'; reason: %s",5);\n        non_fatal(pcVar4,to,pcVar3);\n      }\n      if (preserve_dates != 0) {\n        set_times(to,&s);\n      }\n      unlink(from);\n      return iVar1;\n    }\n    iVar1 = rename(from,to);\n    if (iVar1 != 0) {\nLAB_001071a8:\n      piVar2 = __errno_location();\n      pcVar3 = strerror(*piVar2);\n      pcVar4 = (char *)dcgettext(0,"unable to rename \'%s\'; reason: %s",5);\n      non_fatal(pcVar4,to,pcVar3);\n      unlink(from);\n      return iVar1;\n    }\n    chmod(to,s.st_mode & 0x1ff);\n    iVar1 = chown(to,s.st_uid,s.st_gid);\n    if (-1 < iVar1) {\n      chmod(to,s.st_mode & 0xfff);\n      return 0;\n    }\n  }\n  else {\n    iVar1 = rename(from,to);\n    if (iVar1 != 0) goto LAB_001071a8;\n  }\n  return 0;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int *piVar2;" primitive_type (pointer_declarator "*piVar2" * identifier) ;) (declaration "char *pcVar3;" primitive_type (pointer_declarator "*pcVar3" * identifier) ;) (declaration "char *pcVar4;" primitive_type (pointer_declarator "*pcVar4" * identifier) ;) (declaration "stat s;" type_identifier identifier ;) (expression_statement "iVar1 = __lxstat(1,to,(stat *)&s);" (assignment_expression "iVar1 = __lxstat(1,to,(stat *)&s)" identifier = (call_expression "__lxstat(1,to,(stat *)&s)" identifier (argument_list "(1,to,(stat *)&s)" ( number_literal , identifier , (cast_expression "(stat *)&s" ( (type_descriptor "stat *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "&s" & identifier)) )))) ;) (if_statement "if (iVar1 == 0) {\n    if (((s.st_mode & 0xf080) != 0x8080) || (s.st_nlink != 1)) {\n      iVar1 = simple_copy(from,to);\n      if (iVar1 != 0) {\n        piVar2 = __errno_location();\n        pcVar3 = strerror(*piVar2);\n        pcVar4 = (char *)dcgettext(0,"unable to copy file \'%s\'; reason: %s",5);\n        non_fatal(pcVar4,to,pcVar3);\n      }\n      if (preserve_dates != 0) {\n        set_times(to,&s);\n      }\n      unlink(from);\n      return iVar1;\n    }\n    iVar1 = rename(from,to);\n    if (iVar1 != 0) {\nLAB_001071a8:\n      piVar2 = __errno_location();\n      pcVar3 = strerror(*piVar2);\n      pcVar4 = (char *)dcgettext(0,"unable to rename \'%s\'; reason: %s",5);\n      non_fatal(pcVar4,to,pcVar3);\n      unlink(from);\n      return iVar1;\n    }\n    chmod(to,s.st_mode & 0x1ff);\n    iVar1 = chown(to,s.st_uid,s.st_gid);\n    if (-1 < iVar1) {\n      chmod(to,s.st_mode & 0xfff);\n      return 0;\n    }\n  }\n  else {\n    iVar1 = rename(from,to);\n    if (iVar1 != 0) goto LAB_001071a8;\n  }" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (compound_statement "{\n    if (((s.st_mode & 0xf080) != 0x8080) || (s.st_nlink != 1)) {\n      iVar1 = simple_copy(from,to);\n      if (iVar1 != 0) {\n        piVar2 = __errno_location();\n        pcVar3 = strerror(*piVar2);\n        pcVar4 = (char *)dcgettext(0,"unable to copy file \'%s\'; reason: %s",5);\n        non_fatal(pcVar4,to,pcVar3);\n      }\n      if (preserve_dates != 0) {\n        set_times(to,&s);\n      }\n      unlink(from);\n      return iVar1;\n    }\n    iVar1 = rename(from,to);\n    if (iVar1 != 0) {\nLAB_001071a8:\n      piVar2 = __errno_location();\n      pcVar3 = strerror(*piVar2);\n      pcVar4 = (char *)dcgettext(0,"unable to rename \'%s\'; reason: %s",5);\n      non_fatal(pcVar4,to,pcVar3);\n      unlink(from);\n      return iVar1;\n    }\n    chmod(to,s.st_mode & 0x1ff);\n    iVar1 = chown(to,s.st_uid,s.st_gid);\n    if (-1 < iVar1) {\n      chmod(to,s.st_mode & 0xfff);\n      return 0;\n    }\n  }" { (if_statement "if (((s.st_mode & 0xf080) != 0x8080) || (s.st_nlink != 1)) {\n      iVar1 = simple_copy(from,to);\n      if (iVar1 != 0) {\n        piVar2 = __errno_location();\n        pcVar3 = strerror(*piVar2);\n        pcVar4 = (char *)dcgettext(0,"unable to copy file \'%s\'; reason: %s",5);\n        non_fatal(pcVar4,to,pcVar3);\n      }\n      if (preserve_dates != 0) {\n        set_times(to,&s);\n      }\n      unlink(from);\n      return iVar1;\n    }" if (parenthesized_expression "(((s.st_mode & 0xf080) != 0x8080) || (s.st_nlink != 1))" ( (binary_expression "((s.st_mode & 0xf080) != 0x8080) || (s.st_nlink != 1)" (parenthesized_expression "((s.st_mode & 0xf080) != 0x8080)" ( (binary_expression "(s.st_mode & 0xf080) != 0x8080" (parenthesized_expression "(s.st_mode & 0xf080)" ( (binary_expression "s.st_mode & 0xf080" (field_expression "s.st_mode" identifier . field_identifier) & number_literal) )) != number_literal) )) || (parenthesized_expression "(s.st_nlink != 1)" ( (binary_expression "s.st_nlink != 1" (field_expression "s.st_nlink" identifier . field_identifier) != number_literal) ))) )) (compound_statement "{\n      iVar1 = simple_copy(from,to);\n      if (iVar1 != 0) {\n        piVar2 = __errno_location();\n        pcVar3 = strerror(*piVar2);\n        pcVar4 = (char *)dcgettext(0,"unable to copy file \'%s\'; reason: %s",5);\n        non_fatal(pcVar4,to,pcVar3);\n      }\n      if (preserve_dates != 0) {\n        set_times(to,&s);\n      }\n      unlink(from);\n      return iVar1;\n    }" { (expression_statement "iVar1 = simple_copy(from,to);" (assignment_expression "iVar1 = simple_copy(from,to)" identifier = (call_expression "simple_copy(from,to)" identifier (argument_list "(from,to)" ( identifier , identifier )))) ;) (if_statement "if (iVar1 != 0) {\n        piVar2 = __errno_location();\n        pcVar3 = strerror(*piVar2);\n        pcVar4 = (char *)dcgettext(0,"unable to copy file \'%s\'; reason: %s",5);\n        non_fatal(pcVar4,to,pcVar3);\n      }" if (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) (compound_statement "{\n        piVar2 = __errno_location();\n        pcVar3 = strerror(*piVar2);\n        pcVar4 = (char *)dcgettext(0,"unable to copy file \'%s\'; reason: %s",5);\n        non_fatal(pcVar4,to,pcVar3);\n      }" { (expression_statement "piVar2 = __errno_location();" (assignment_expression "piVar2 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (expression_statement "pcVar3 = strerror(*piVar2);" (assignment_expression "pcVar3 = strerror(*piVar2)" identifier = (call_expression "strerror(*piVar2)" identifier (argument_list "(*piVar2)" ( (pointer_expression "*piVar2" * identifier) )))) ;) (expression_statement "pcVar4 = (char *)dcgettext(0,"unable to copy file \'%s\'; reason: %s",5);" (assignment_expression "pcVar4 = (char *)dcgettext(0,"unable to copy file \'%s\'; reason: %s",5)" identifier = (cast_expression "(char *)dcgettext(0,"unable to copy file \'%s\'; reason: %s",5)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "dcgettext(0,"unable to copy file \'%s\'; reason: %s",5)" identifier (argument_list "(0,"unable to copy file \'%s\'; reason: %s",5)" ( number_literal , (string_literal ""unable to copy file \'%s\'; reason: %s"" " string_content escape_sequence string_content escape_sequence string_content ") , number_literal ))))) ;) (expression_statement "non_fatal(pcVar4,to,pcVar3);" (call_expression "non_fatal(pcVar4,to,pcVar3)" identifier (argument_list "(pcVar4,to,pcVar3)" ( identifier , identifier , identifier ))) ;) })) (if_statement "if (preserve_dates != 0) {\n        set_times(to,&s);\n      }" if (parenthesized_expression "(preserve_dates != 0)" ( (binary_expression "preserve_dates != 0" identifier != number_literal) )) (compound_statement "{\n        set_times(to,&s);\n      }" { (expression_statement "set_times(to,&s);" (call_expression "set_times(to,&s)" identifier (argument_list "(to,&s)" ( identifier , (pointer_expression "&s" & identifier) ))) ;) })) (expression_statement "unlink(from);" (call_expression "unlink(from)" identifier (argument_list "(from)" ( identifier ))) ;) (return_statement "return iVar1;" return identifier ;) })) (expression_statement "iVar1 = rename(from,to);" (assignment_expression "iVar1 = rename(from,to)" identifier = (call_expression "rename(from,to)" identifier (argument_list "(from,to)" ( identifier , identifier )))) ;) (if_statement "if (iVar1 != 0) {\nLAB_001071a8:\n      piVar2 = __errno_location();\n      pcVar3 = strerror(*piVar2);\n      pcVar4 = (char *)dcgettext(0,"unable to rename \'%s\'; reason: %s",5);\n      non_fatal(pcVar4,to,pcVar3);\n      unlink(from);\n      return iVar1;\n    }" if (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) (compound_statement "{\nLAB_001071a8:\n      piVar2 = __errno_location();\n      pcVar3 = strerror(*piVar2);\n      pcVar4 = (char *)dcgettext(0,"unable to rename \'%s\'; reason: %s",5);\n      non_fatal(pcVar4,to,pcVar3);\n      unlink(from);\n      return iVar1;\n    }" { (labeled_statement "LAB_001071a8:\n      piVar2 = __errno_location();" statement_identifier : (expression_statement "piVar2 = __errno_location();" (assignment_expression "piVar2 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;)) (expression_statement "pcVar3 = strerror(*piVar2);" (assignment_expression "pcVar3 = strerror(*piVar2)" identifier = (call_expression "strerror(*piVar2)" identifier (argument_list "(*piVar2)" ( (pointer_expression "*piVar2" * identifier) )))) ;) (expression_statement "pcVar4 = (char *)dcgettext(0,"unable to rename \'%s\'; reason: %s",5);" (assignment_expression "pcVar4 = (char *)dcgettext(0,"unable to rename \'%s\'; reason: %s",5)" identifier = (cast_expression "(char *)dcgettext(0,"unable to rename \'%s\'; reason: %s",5)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "dcgettext(0,"unable to rename \'%s\'; reason: %s",5)" identifier (argument_list "(0,"unable to rename \'%s\'; reason: %s",5)" ( number_literal , (string_literal ""unable to rename \'%s\'; reason: %s"" " string_content escape_sequence string_content escape_sequence string_content ") , number_literal ))))) ;) (expression_statement "non_fatal(pcVar4,to,pcVar3);" (call_expression "non_fatal(pcVar4,to,pcVar3)" identifier (argument_list "(pcVar4,to,pcVar3)" ( identifier , identifier , identifier ))) ;) (expression_statement "unlink(from);" (call_expression "unlink(from)" identifier (argument_list "(from)" ( identifier ))) ;) (return_statement "return iVar1;" return identifier ;) })) (expression_statement "chmod(to,s.st_mode & 0x1ff);" (call_expression "chmod(to,s.st_mode & 0x1ff)" identifier (argument_list "(to,s.st_mode & 0x1ff)" ( identifier , (binary_expression "s.st_mode & 0x1ff" (field_expression "s.st_mode" identifier . field_identifier) & number_literal) ))) ;) (expression_statement "iVar1 = chown(to,s.st_uid,s.st_gid);" (assignment_expression "iVar1 = chown(to,s.st_uid,s.st_gid)" identifier = (call_expression "chown(to,s.st_uid,s.st_gid)" identifier (argument_list "(to,s.st_uid,s.st_gid)" ( identifier , (field_expression "s.st_uid" identifier . field_identifier) , (field_expression "s.st_gid" identifier . field_identifier) )))) ;) (if_statement "if (-1 < iVar1) {\n      chmod(to,s.st_mode & 0xfff);\n      return 0;\n    }" if (parenthesized_expression "(-1 < iVar1)" ( (binary_expression "-1 < iVar1" number_literal < identifier) )) (compound_statement "{\n      chmod(to,s.st_mode & 0xfff);\n      return 0;\n    }" { (expression_statement "chmod(to,s.st_mode & 0xfff);" (call_expression "chmod(to,s.st_mode & 0xfff)" identifier (argument_list "(to,s.st_mode & 0xfff)" ( identifier , (binary_expression "s.st_mode & 0xfff" (field_expression "s.st_mode" identifier . field_identifier) & number_literal) ))) ;) (return_statement "return 0;" return number_literal ;) })) }) (else_clause "else {\n    iVar1 = rename(from,to);\n    if (iVar1 != 0) goto LAB_001071a8;\n  }" else (compound_statement "{\n    iVar1 = rename(from,to);\n    if (iVar1 != 0) goto LAB_001071a8;\n  }" { (expression_statement "iVar1 = rename(from,to);" (assignment_expression "iVar1 = rename(from,to)" identifier = (call_expression "rename(from,to)" identifier (argument_list "(from,to)" ( identifier , identifier )))) ;) (if_statement "if (iVar1 != 0) goto LAB_001071a8;" if (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) (goto_statement "goto LAB_001071a8;" goto statement_identifier ;)) }))) (return_statement "return 0;" return number_literal ;) })))
(translation_unit "int FUN_001070c0(char *param_1,char *param_2,int param_3)\n\n{\n  int iVar1;\n  int *piVar2;\n  char *pcVar3;\n  undefined8 uVar4;\n  stat sStack_c8;\n  \n  iVar1 = __lxstat(1,param_2,&sStack_c8);\n  if (iVar1 == 0) {\n    if (((sStack_c8.st_mode & 0xf080) != 0x8080) || (sStack_c8.st_nlink != 1)) {\n      iVar1 = FUN_00106f50(param_1,param_2);\n      if (iVar1 != 0) {\n        piVar2 = __errno_location();\n        pcVar3 = strerror(*piVar2);\n        uVar4 = dcgettext(0,"unable to copy file \'%s\'; reason: %s",5);\n        FUN_00107900(uVar4,param_2,pcVar3);\n      }\n      if (param_3 != 0) {\n        FUN_00107050(param_2,&sStack_c8);\n      }\n      unlink(param_1);\n      return iVar1;\n    }\n    iVar1 = rename(param_1,param_2);\n    if (iVar1 != 0) {\nLAB_001071a8:\n      piVar2 = __errno_location();\n      pcVar3 = strerror(*piVar2);\n      uVar4 = dcgettext(0,"unable to rename \'%s\'; reason: %s",5);\n      FUN_00107900(uVar4,param_2,pcVar3);\n      unlink(param_1);\n      return iVar1;\n    }\n    chmod(param_2,sStack_c8.st_mode & 0x1ff);\n    iVar1 = chown(param_2,sStack_c8.st_uid,sStack_c8.st_gid);\n    if (-1 < iVar1) {\n      chmod(param_2,sStack_c8.st_mode & 0xfff);\n      return 0;\n    }\n  }\n  else {\n    iVar1 = rename(param_1,param_2);\n    if (iVar1 != 0) goto LAB_001071a8;\n  }\n  return 0;\n}\n\n" (function_definition "int FUN_001070c0(char *param_1,char *param_2,int param_3)\n\n{\n  int iVar1;\n  int *piVar2;\n  char *pcVar3;\n  undefined8 uVar4;\n  stat sStack_c8;\n  \n  iVar1 = __lxstat(1,param_2,&sStack_c8);\n  if (iVar1 == 0) {\n    if (((sStack_c8.st_mode & 0xf080) != 0x8080) || (sStack_c8.st_nlink != 1)) {\n      iVar1 = FUN_00106f50(param_1,param_2);\n      if (iVar1 != 0) {\n        piVar2 = __errno_location();\n        pcVar3 = strerror(*piVar2);\n        uVar4 = dcgettext(0,"unable to copy file \'%s\'; reason: %s",5);\n        FUN_00107900(uVar4,param_2,pcVar3);\n      }\n      if (param_3 != 0) {\n        FUN_00107050(param_2,&sStack_c8);\n      }\n      unlink(param_1);\n      return iVar1;\n    }\n    iVar1 = rename(param_1,param_2);\n    if (iVar1 != 0) {\nLAB_001071a8:\n      piVar2 = __errno_location();\n      pcVar3 = strerror(*piVar2);\n      uVar4 = dcgettext(0,"unable to rename \'%s\'; reason: %s",5);\n      FUN_00107900(uVar4,param_2,pcVar3);\n      unlink(param_1);\n      return iVar1;\n    }\n    chmod(param_2,sStack_c8.st_mode & 0x1ff);\n    iVar1 = chown(param_2,sStack_c8.st_uid,sStack_c8.st_gid);\n    if (-1 < iVar1) {\n      chmod(param_2,sStack_c8.st_mode & 0xfff);\n      return 0;\n    }\n  }\n  else {\n    iVar1 = rename(param_1,param_2);\n    if (iVar1 != 0) goto LAB_001071a8;\n  }\n  return 0;\n}" primitive_type (function_declarator "FUN_001070c0(char *param_1,char *param_2,int param_3)" identifier (parameter_list "(char *param_1,char *param_2,int param_3)" ( (parameter_declaration "char *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "char *param_2" primitive_type (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "int param_3" primitive_type identifier) ))) (compound_statement "{\n  int iVar1;\n  int *piVar2;\n  char *pcVar3;\n  undefined8 uVar4;\n  stat sStack_c8;\n  \n  iVar1 = __lxstat(1,param_2,&sStack_c8);\n  if (iVar1 == 0) {\n    if (((sStack_c8.st_mode & 0xf080) != 0x8080) || (sStack_c8.st_nlink != 1)) {\n      iVar1 = FUN_00106f50(param_1,param_2);\n      if (iVar1 != 0) {\n        piVar2 = __errno_location();\n        pcVar3 = strerror(*piVar2);\n        uVar4 = dcgettext(0,"unable to copy file \'%s\'; reason: %s",5);\n        FUN_00107900(uVar4,param_2,pcVar3);\n      }\n      if (param_3 != 0) {\n        FUN_00107050(param_2,&sStack_c8);\n      }\n      unlink(param_1);\n      return iVar1;\n    }\n    iVar1 = rename(param_1,param_2);\n    if (iVar1 != 0) {\nLAB_001071a8:\n      piVar2 = __errno_location();\n      pcVar3 = strerror(*piVar2);\n      uVar4 = dcgettext(0,"unable to rename \'%s\'; reason: %s",5);\n      FUN_00107900(uVar4,param_2,pcVar3);\n      unlink(param_1);\n      return iVar1;\n    }\n    chmod(param_2,sStack_c8.st_mode & 0x1ff);\n    iVar1 = chown(param_2,sStack_c8.st_uid,sStack_c8.st_gid);\n    if (-1 < iVar1) {\n      chmod(param_2,sStack_c8.st_mode & 0xfff);\n      return 0;\n    }\n  }\n  else {\n    iVar1 = rename(param_1,param_2);\n    if (iVar1 != 0) goto LAB_001071a8;\n  }\n  return 0;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int *piVar2;" primitive_type (pointer_declarator "*piVar2" * identifier) ;) (declaration "char *pcVar3;" primitive_type (pointer_declarator "*pcVar3" * identifier) ;) (declaration "undefined8 uVar4;" type_identifier identifier ;) (declaration "stat sStack_c8;" type_identifier identifier ;) (expression_statement "iVar1 = __lxstat(1,param_2,&sStack_c8);" (assignment_expression "iVar1 = __lxstat(1,param_2,&sStack_c8)" identifier = (call_expression "__lxstat(1,param_2,&sStack_c8)" identifier (argument_list "(1,param_2,&sStack_c8)" ( number_literal , identifier , (pointer_expression "&sStack_c8" & identifier) )))) ;) (if_statement "if (iVar1 == 0) {\n    if (((sStack_c8.st_mode & 0xf080) != 0x8080) || (sStack_c8.st_nlink != 1)) {\n      iVar1 = FUN_00106f50(param_1,param_2);\n      if (iVar1 != 0) {\n        piVar2 = __errno_location();\n        pcVar3 = strerror(*piVar2);\n        uVar4 = dcgettext(0,"unable to copy file \'%s\'; reason: %s",5);\n        FUN_00107900(uVar4,param_2,pcVar3);\n      }\n      if (param_3 != 0) {\n        FUN_00107050(param_2,&sStack_c8);\n      }\n      unlink(param_1);\n      return iVar1;\n    }\n    iVar1 = rename(param_1,param_2);\n    if (iVar1 != 0) {\nLAB_001071a8:\n      piVar2 = __errno_location();\n      pcVar3 = strerror(*piVar2);\n      uVar4 = dcgettext(0,"unable to rename \'%s\'; reason: %s",5);\n      FUN_00107900(uVar4,param_2,pcVar3);\n      unlink(param_1);\n      return iVar1;\n    }\n    chmod(param_2,sStack_c8.st_mode & 0x1ff);\n    iVar1 = chown(param_2,sStack_c8.st_uid,sStack_c8.st_gid);\n    if (-1 < iVar1) {\n      chmod(param_2,sStack_c8.st_mode & 0xfff);\n      return 0;\n    }\n  }\n  else {\n    iVar1 = rename(param_1,param_2);\n    if (iVar1 != 0) goto LAB_001071a8;\n  }" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (compound_statement "{\n    if (((sStack_c8.st_mode & 0xf080) != 0x8080) || (sStack_c8.st_nlink != 1)) {\n      iVar1 = FUN_00106f50(param_1,param_2);\n      if (iVar1 != 0) {\n        piVar2 = __errno_location();\n        pcVar3 = strerror(*piVar2);\n        uVar4 = dcgettext(0,"unable to copy file \'%s\'; reason: %s",5);\n        FUN_00107900(uVar4,param_2,pcVar3);\n      }\n      if (param_3 != 0) {\n        FUN_00107050(param_2,&sStack_c8);\n      }\n      unlink(param_1);\n      return iVar1;\n    }\n    iVar1 = rename(param_1,param_2);\n    if (iVar1 != 0) {\nLAB_001071a8:\n      piVar2 = __errno_location();\n      pcVar3 = strerror(*piVar2);\n      uVar4 = dcgettext(0,"unable to rename \'%s\'; reason: %s",5);\n      FUN_00107900(uVar4,param_2,pcVar3);\n      unlink(param_1);\n      return iVar1;\n    }\n    chmod(param_2,sStack_c8.st_mode & 0x1ff);\n    iVar1 = chown(param_2,sStack_c8.st_uid,sStack_c8.st_gid);\n    if (-1 < iVar1) {\n      chmod(param_2,sStack_c8.st_mode & 0xfff);\n      return 0;\n    }\n  }" { (if_statement "if (((sStack_c8.st_mode & 0xf080) != 0x8080) || (sStack_c8.st_nlink != 1)) {\n      iVar1 = FUN_00106f50(param_1,param_2);\n      if (iVar1 != 0) {\n        piVar2 = __errno_location();\n        pcVar3 = strerror(*piVar2);\n        uVar4 = dcgettext(0,"unable to copy file \'%s\'; reason: %s",5);\n        FUN_00107900(uVar4,param_2,pcVar3);\n      }\n      if (param_3 != 0) {\n        FUN_00107050(param_2,&sStack_c8);\n      }\n      unlink(param_1);\n      return iVar1;\n    }" if (parenthesized_expression "(((sStack_c8.st_mode & 0xf080) != 0x8080) || (sStack_c8.st_nlink != 1))" ( (binary_expression "((sStack_c8.st_mode & 0xf080) != 0x8080) || (sStack_c8.st_nlink != 1)" (parenthesized_expression "((sStack_c8.st_mode & 0xf080) != 0x8080)" ( (binary_expression "(sStack_c8.st_mode & 0xf080) != 0x8080" (parenthesized_expression "(sStack_c8.st_mode & 0xf080)" ( (binary_expression "sStack_c8.st_mode & 0xf080" (field_expression "sStack_c8.st_mode" identifier . field_identifier) & number_literal) )) != number_literal) )) || (parenthesized_expression "(sStack_c8.st_nlink != 1)" ( (binary_expression "sStack_c8.st_nlink != 1" (field_expression "sStack_c8.st_nlink" identifier . field_identifier) != number_literal) ))) )) (compound_statement "{\n      iVar1 = FUN_00106f50(param_1,param_2);\n      if (iVar1 != 0) {\n        piVar2 = __errno_location();\n        pcVar3 = strerror(*piVar2);\n        uVar4 = dcgettext(0,"unable to copy file \'%s\'; reason: %s",5);\n        FUN_00107900(uVar4,param_2,pcVar3);\n      }\n      if (param_3 != 0) {\n        FUN_00107050(param_2,&sStack_c8);\n      }\n      unlink(param_1);\n      return iVar1;\n    }" { (expression_statement "iVar1 = FUN_00106f50(param_1,param_2);" (assignment_expression "iVar1 = FUN_00106f50(param_1,param_2)" identifier = (call_expression "FUN_00106f50(param_1,param_2)" identifier (argument_list "(param_1,param_2)" ( identifier , identifier )))) ;) (if_statement "if (iVar1 != 0) {\n        piVar2 = __errno_location();\n        pcVar3 = strerror(*piVar2);\n        uVar4 = dcgettext(0,"unable to copy file \'%s\'; reason: %s",5);\n        FUN_00107900(uVar4,param_2,pcVar3);\n      }" if (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) (compound_statement "{\n        piVar2 = __errno_location();\n        pcVar3 = strerror(*piVar2);\n        uVar4 = dcgettext(0,"unable to copy file \'%s\'; reason: %s",5);\n        FUN_00107900(uVar4,param_2,pcVar3);\n      }" { (expression_statement "piVar2 = __errno_location();" (assignment_expression "piVar2 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (expression_statement "pcVar3 = strerror(*piVar2);" (assignment_expression "pcVar3 = strerror(*piVar2)" identifier = (call_expression "strerror(*piVar2)" identifier (argument_list "(*piVar2)" ( (pointer_expression "*piVar2" * identifier) )))) ;) (expression_statement "uVar4 = dcgettext(0,"unable to copy file \'%s\'; reason: %s",5);" (assignment_expression "uVar4 = dcgettext(0,"unable to copy file \'%s\'; reason: %s",5)" identifier = (call_expression "dcgettext(0,"unable to copy file \'%s\'; reason: %s",5)" identifier (argument_list "(0,"unable to copy file \'%s\'; reason: %s",5)" ( number_literal , (string_literal ""unable to copy file \'%s\'; reason: %s"" " string_content escape_sequence string_content escape_sequence string_content ") , number_literal )))) ;) (expression_statement "FUN_00107900(uVar4,param_2,pcVar3);" (call_expression "FUN_00107900(uVar4,param_2,pcVar3)" identifier (argument_list "(uVar4,param_2,pcVar3)" ( identifier , identifier , identifier ))) ;) })) (if_statement "if (param_3 != 0) {\n        FUN_00107050(param_2,&sStack_c8);\n      }" if (parenthesized_expression "(param_3 != 0)" ( (binary_expression "param_3 != 0" identifier != number_literal) )) (compound_statement "{\n        FUN_00107050(param_2,&sStack_c8);\n      }" { (expression_statement "FUN_00107050(param_2,&sStack_c8);" (call_expression "FUN_00107050(param_2,&sStack_c8)" identifier (argument_list "(param_2,&sStack_c8)" ( identifier , (pointer_expression "&sStack_c8" & identifier) ))) ;) })) (expression_statement "unlink(param_1);" (call_expression "unlink(param_1)" identifier (argument_list "(param_1)" ( identifier ))) ;) (return_statement "return iVar1;" return identifier ;) })) (expression_statement "iVar1 = rename(param_1,param_2);" (assignment_expression "iVar1 = rename(param_1,param_2)" identifier = (call_expression "rename(param_1,param_2)" identifier (argument_list "(param_1,param_2)" ( identifier , identifier )))) ;) (if_statement "if (iVar1 != 0) {\nLAB_001071a8:\n      piVar2 = __errno_location();\n      pcVar3 = strerror(*piVar2);\n      uVar4 = dcgettext(0,"unable to rename \'%s\'; reason: %s",5);\n      FUN_00107900(uVar4,param_2,pcVar3);\n      unlink(param_1);\n      return iVar1;\n    }" if (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) (compound_statement "{\nLAB_001071a8:\n      piVar2 = __errno_location();\n      pcVar3 = strerror(*piVar2);\n      uVar4 = dcgettext(0,"unable to rename \'%s\'; reason: %s",5);\n      FUN_00107900(uVar4,param_2,pcVar3);\n      unlink(param_1);\n      return iVar1;\n    }" { (labeled_statement "LAB_001071a8:\n      piVar2 = __errno_location();" statement_identifier : (expression_statement "piVar2 = __errno_location();" (assignment_expression "piVar2 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;)) (expression_statement "pcVar3 = strerror(*piVar2);" (assignment_expression "pcVar3 = strerror(*piVar2)" identifier = (call_expression "strerror(*piVar2)" identifier (argument_list "(*piVar2)" ( (pointer_expression "*piVar2" * identifier) )))) ;) (expression_statement "uVar4 = dcgettext(0,"unable to rename \'%s\'; reason: %s",5);" (assignment_expression "uVar4 = dcgettext(0,"unable to rename \'%s\'; reason: %s",5)" identifier = (call_expression "dcgettext(0,"unable to rename \'%s\'; reason: %s",5)" identifier (argument_list "(0,"unable to rename \'%s\'; reason: %s",5)" ( number_literal , (string_literal ""unable to rename \'%s\'; reason: %s"" " string_content escape_sequence string_content escape_sequence string_content ") , number_literal )))) ;) (expression_statement "FUN_00107900(uVar4,param_2,pcVar3);" (call_expression "FUN_00107900(uVar4,param_2,pcVar3)" identifier (argument_list "(uVar4,param_2,pcVar3)" ( identifier , identifier , identifier ))) ;) (expression_statement "unlink(param_1);" (call_expression "unlink(param_1)" identifier (argument_list "(param_1)" ( identifier ))) ;) (return_statement "return iVar1;" return identifier ;) })) (expression_statement "chmod(param_2,sStack_c8.st_mode & 0x1ff);" (call_expression "chmod(param_2,sStack_c8.st_mode & 0x1ff)" identifier (argument_list "(param_2,sStack_c8.st_mode & 0x1ff)" ( identifier , (binary_expression "sStack_c8.st_mode & 0x1ff" (field_expression "sStack_c8.st_mode" identifier . field_identifier) & number_literal) ))) ;) (expression_statement "iVar1 = chown(param_2,sStack_c8.st_uid,sStack_c8.st_gid);" (assignment_expression "iVar1 = chown(param_2,sStack_c8.st_uid,sStack_c8.st_gid)" identifier = (call_expression "chown(param_2,sStack_c8.st_uid,sStack_c8.st_gid)" identifier (argument_list "(param_2,sStack_c8.st_uid,sStack_c8.st_gid)" ( identifier , (field_expression "sStack_c8.st_uid" identifier . field_identifier) , (field_expression "sStack_c8.st_gid" identifier . field_identifier) )))) ;) (if_statement "if (-1 < iVar1) {\n      chmod(param_2,sStack_c8.st_mode & 0xfff);\n      return 0;\n    }" if (parenthesized_expression "(-1 < iVar1)" ( (binary_expression "-1 < iVar1" number_literal < identifier) )) (compound_statement "{\n      chmod(param_2,sStack_c8.st_mode & 0xfff);\n      return 0;\n    }" { (expression_statement "chmod(param_2,sStack_c8.st_mode & 0xfff);" (call_expression "chmod(param_2,sStack_c8.st_mode & 0xfff)" identifier (argument_list "(param_2,sStack_c8.st_mode & 0xfff)" ( identifier , (binary_expression "sStack_c8.st_mode & 0xfff" (field_expression "sStack_c8.st_mode" identifier . field_identifier) & number_literal) ))) ;) (return_statement "return 0;" return number_literal ;) })) }) (else_clause "else {\n    iVar1 = rename(param_1,param_2);\n    if (iVar1 != 0) goto LAB_001071a8;\n  }" else (compound_statement "{\n    iVar1 = rename(param_1,param_2);\n    if (iVar1 != 0) goto LAB_001071a8;\n  }" { (expression_statement "iVar1 = rename(param_1,param_2);" (assignment_expression "iVar1 = rename(param_1,param_2)" identifier = (call_expression "rename(param_1,param_2)" identifier (argument_list "(param_1,param_2)" ( identifier , identifier )))) ;) (if_statement "if (iVar1 != 0) goto LAB_001071a8;" if (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) (goto_statement "goto LAB_001071a8;" goto statement_identifier ;)) }))) (return_statement "return 0;" return number_literal ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE (pointer_declarator * 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 ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( LIT , IDENT , (pointer_expression & IDENT) )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (field_expression IDENT . field_identifier) & LIT) )) != LIT) )) || (parenthesized_expression ( (binary_expression (field_expression IDENT . field_identifier) != LIT) ))) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( )))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (pointer_expression * IDENT) )))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( LIT , (string_literal " string_content escape_sequence string_content escape_sequence string_content ") , LIT )))) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT , IDENT ))) ;) })) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT , (pointer_expression & IDENT) ))) ;) })) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (return_statement return IDENT ;) })) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (labeled_statement statement_identifier : (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( )))) ;)) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (pointer_expression * IDENT) )))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( LIT , (string_literal " string_content escape_sequence string_content escape_sequence string_content ") , LIT )))) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT , IDENT ))) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (return_statement return IDENT ;) })) (expression_statement (call_expression IDENT (argument_list ( IDENT , (binary_expression (field_expression IDENT . field_identifier) & LIT) ))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , (field_expression IDENT . field_identifier) , (field_expression IDENT . field_identifier) )))) ;) (if_statement if (parenthesized_expression ( (binary_expression LIT < IDENT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT , (binary_expression (field_expression IDENT . field_identifier) & LIT) ))) ;) (return_statement return LIT ;) })) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (goto_statement goto statement_identifier ;)) }))) (return_statement return LIT ;) })))
(function_definition "int FUN_001070c0(char *param_1,char *param_2,int param_3)\n\n{\n  int iVar1;\n  int *piVar2;\n  char *pcVar3;\n  undefined8 uVar4;\n  stat sStack_c8;\n  \n  iVar1 = __lxstat(1,param_2,&sStack_c8);\n  if (iVar1 == 0) {\n    if (((sStack_c8.st_mode & 0xf080) != 0x8080) || (sStack_c8.st_nlink != 1)) {\n      iVar1 = FUN_00106f50(param_1,param_2);\n      if (iVar1 != 0) {\n        piVar2 = __errno_location();\n        pcVar3 = strerror(*piVar2);\n        uVar4 = dcgettext(0,"unable to copy file \'%s\'; reason: %s",5);\n        FUN_00107900(uVar4,param_2,pcVar3);\n      }\n      if (param_3 != 0) {\n        FUN_00107050(param_2,&sStack_c8);\n      }\n      unlink(param_1);\n      return iVar1;\n    }\n    iVar1 = rename(param_1,param_2);\n    if (iVar1 != 0) {\nLAB_001071a8:\n      piVar2 = __errno_location();\n      pcVar3 = strerror(*piVar2);\n      uVar4 = dcgettext(0,"unable to rename \'%s\'; reason: %s",5);\n      FUN_00107900(uVar4,param_2,pcVar3);\n      unlink(param_1);\n      return iVar1;\n    }\n    chmod(param_2,sStack_c8.st_mode & 0x1ff);\n    iVar1 = chown(param_2,sStack_c8.st_uid,sStack_c8.st_gid);\n    if (-1 < iVar1) {\n      chmod(param_2,sStack_c8.st_mode & 0xfff);\n      return 0;\n    }\n  }\n  else {\n    iVar1 = rename(param_1,param_2);\n    if (iVar1 != 0) goto LAB_001071a8;\n  }\n  return 0;\n}" (primitive_type "int") (function_declarator "FUN_001070c0(char *param_1,char *param_2,int param_3)" (identifier "FUN_001070c0") (parameter_list "(char *param_1,char *param_2,int param_3)" (( "(") (parameter_declaration "char *param_1" (primitive_type "char") (pointer_declarator "*param_1" (* "*") (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")) () ")"))) (compound_statement "{\n  int iVar1;\n  int *piVar2;\n  char *pcVar3;\n  undefined8 uVar4;\n  stat sStack_c8;\n  \n  iVar1 = __lxstat(1,param_2,&sStack_c8);\n  if (iVar1 == 0) {\n    if (((sStack_c8.st_mode & 0xf080) != 0x8080) || (sStack_c8.st_nlink != 1)) {\n      iVar1 = FUN_00106f50(param_1,param_2);\n      if (iVar1 != 0) {\n        piVar2 = __errno_location();\n        pcVar3 = strerror(*piVar2);\n        uVar4 = dcgettext(0,"unable to copy file \'%s\'; reason: %s",5);\n        FUN_00107900(uVar4,param_2,pcVar3);\n      }\n      if (param_3 != 0) {\n        FUN_00107050(param_2,&sStack_c8);\n      }\n      unlink(param_1);\n      return iVar1;\n    }\n    iVar1 = rename(param_1,param_2);\n    if (iVar1 != 0) {\nLAB_001071a8:\n      piVar2 = __errno_location();\n      pcVar3 = strerror(*piVar2);\n      uVar4 = dcgettext(0,"unable to rename \'%s\'; reason: %s",5);\n      FUN_00107900(uVar4,param_2,pcVar3);\n      unlink(param_1);\n      return iVar1;\n    }\n    chmod(param_2,sStack_c8.st_mode & 0x1ff);\n    iVar1 = chown(param_2,sStack_c8.st_uid,sStack_c8.st_gid);\n    if (-1 < iVar1) {\n      chmod(param_2,sStack_c8.st_mode & 0xfff);\n      return 0;\n    }\n  }\n  else {\n    iVar1 = rename(param_1,param_2);\n    if (iVar1 != 0) goto LAB_001071a8;\n  }\n  return 0;\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "int *piVar2;" (primitive_type "int") (pointer_declarator "*piVar2" (* "*") (identifier "piVar2")) (; ";")) (declaration "char *pcVar3;" (primitive_type "char") (pointer_declarator "*pcVar3" (* "*") (identifier "pcVar3")) (; ";")) (declaration "undefined8 uVar4;" (type_identifier "undefined8") (identifier "uVar4") (; ";")) (declaration "stat sStack_c8;" (type_identifier "stat") (identifier "sStack_c8") (; ";")) (expression_statement "iVar1 = __lxstat(1,param_2,&sStack_c8);" (assignment_expression "iVar1 = __lxstat(1,param_2,&sStack_c8)" (identifier "iVar1") (= "=") (call_expression "__lxstat(1,param_2,&sStack_c8)" (identifier "__lxstat") (argument_list "(1,param_2,&sStack_c8)" (( "(") (number_literal "1") (, ",") (identifier "param_2") (, ",") (pointer_expression "&sStack_c8" (& "&") (identifier "sStack_c8")) () ")")))) (; ";")) (if_statement "if (iVar1 == 0) {\n    if (((sStack_c8.st_mode & 0xf080) != 0x8080) || (sStack_c8.st_nlink != 1)) {\n      iVar1 = FUN_00106f50(param_1,param_2);\n      if (iVar1 != 0) {\n        piVar2 = __errno_location();\n        pcVar3 = strerror(*piVar2);\n        uVar4 = dcgettext(0,"unable to copy file \'%s\'; reason: %s",5);\n        FUN_00107900(uVar4,param_2,pcVar3);\n      }\n      if (param_3 != 0) {\n        FUN_00107050(param_2,&sStack_c8);\n      }\n      unlink(param_1);\n      return iVar1;\n    }\n    iVar1 = rename(param_1,param_2);\n    if (iVar1 != 0) {\nLAB_001071a8:\n      piVar2 = __errno_location();\n      pcVar3 = strerror(*piVar2);\n      uVar4 = dcgettext(0,"unable to rename \'%s\'; reason: %s",5);\n      FUN_00107900(uVar4,param_2,pcVar3);\n      unlink(param_1);\n      return iVar1;\n    }\n    chmod(param_2,sStack_c8.st_mode & 0x1ff);\n    iVar1 = chown(param_2,sStack_c8.st_uid,sStack_c8.st_gid);\n    if (-1 < iVar1) {\n      chmod(param_2,sStack_c8.st_mode & 0xfff);\n      return 0;\n    }\n  }\n  else {\n    iVar1 = rename(param_1,param_2);\n    if (iVar1 != 0) goto LAB_001071a8;\n  }" (if "if") (parenthesized_expression "(iVar1 == 0)" (( "(") (binary_expression "iVar1 == 0" (identifier "iVar1") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n    if (((sStack_c8.st_mode & 0xf080) != 0x8080) || (sStack_c8.st_nlink != 1)) {\n      iVar1 = FUN_00106f50(param_1,param_2);\n      if (iVar1 != 0) {\n        piVar2 = __errno_location();\n        pcVar3 = strerror(*piVar2);\n        uVar4 = dcgettext(0,"unable to copy file \'%s\'; reason: %s",5);\n        FUN_00107900(uVar4,param_2,pcVar3);\n      }\n      if (param_3 != 0) {\n        FUN_00107050(param_2,&sStack_c8);\n      }\n      unlink(param_1);\n      return iVar1;\n    }\n    iVar1 = rename(param_1,param_2);\n    if (iVar1 != 0) {\nLAB_001071a8:\n      piVar2 = __errno_location();\n      pcVar3 = strerror(*piVar2);\n      uVar4 = dcgettext(0,"unable to rename \'%s\'; reason: %s",5);\n      FUN_00107900(uVar4,param_2,pcVar3);\n      unlink(param_1);\n      return iVar1;\n    }\n    chmod(param_2,sStack_c8.st_mode & 0x1ff);\n    iVar1 = chown(param_2,sStack_c8.st_uid,sStack_c8.st_gid);\n    if (-1 < iVar1) {\n      chmod(param_2,sStack_c8.st_mode & 0xfff);\n      return 0;\n    }\n  }" ({ "{") (if_statement "if (((sStack_c8.st_mode & 0xf080) != 0x8080) || (sStack_c8.st_nlink != 1)) {\n      iVar1 = FUN_00106f50(param_1,param_2);\n      if (iVar1 != 0) {\n        piVar2 = __errno_location();\n        pcVar3 = strerror(*piVar2);\n        uVar4 = dcgettext(0,"unable to copy file \'%s\'; reason: %s",5);\n        FUN_00107900(uVar4,param_2,pcVar3);\n      }\n      if (param_3 != 0) {\n        FUN_00107050(param_2,&sStack_c8);\n      }\n      unlink(param_1);\n      return iVar1;\n    }" (if "if") (parenthesized_expression "(((sStack_c8.st_mode & 0xf080) != 0x8080) || (sStack_c8.st_nlink != 1))" (( "(") (binary_expression "((sStack_c8.st_mode & 0xf080) != 0x8080) || (sStack_c8.st_nlink != 1)" (parenthesized_expression "((sStack_c8.st_mode & 0xf080) != 0x8080)" (( "(") (binary_expression "(sStack_c8.st_mode & 0xf080) != 0x8080" (parenthesized_expression "(sStack_c8.st_mode & 0xf080)" (( "(") (binary_expression "sStack_c8.st_mode & 0xf080" (field_expression "sStack_c8.st_mode" (identifier "sStack_c8") (. ".") (field_identifier "st_mode")) (& "&") (number_literal "0xf080")) () ")")) (!= "!=") (number_literal "0x8080")) () ")")) (|| "||") (parenthesized_expression "(sStack_c8.st_nlink != 1)" (( "(") (binary_expression "sStack_c8.st_nlink != 1" (field_expression "sStack_c8.st_nlink" (identifier "sStack_c8") (. ".") (field_identifier "st_nlink")) (!= "!=") (number_literal "1")) () ")"))) () ")")) (compound_statement "{\n      iVar1 = FUN_00106f50(param_1,param_2);\n      if (iVar1 != 0) {\n        piVar2 = __errno_location();\n        pcVar3 = strerror(*piVar2);\n        uVar4 = dcgettext(0,"unable to copy file \'%s\'; reason: %s",5);\n        FUN_00107900(uVar4,param_2,pcVar3);\n      }\n      if (param_3 != 0) {\n        FUN_00107050(param_2,&sStack_c8);\n      }\n      unlink(param_1);\n      return iVar1;\n    }" ({ "{") (expression_statement "iVar1 = FUN_00106f50(param_1,param_2);" (assignment_expression "iVar1 = FUN_00106f50(param_1,param_2)" (identifier "iVar1") (= "=") (call_expression "FUN_00106f50(param_1,param_2)" (identifier "FUN_00106f50") (argument_list "(param_1,param_2)" (( "(") (identifier "param_1") (, ",") (identifier "param_2") () ")")))) (; ";")) (if_statement "if (iVar1 != 0) {\n        piVar2 = __errno_location();\n        pcVar3 = strerror(*piVar2);\n        uVar4 = dcgettext(0,"unable to copy file \'%s\'; reason: %s",5);\n        FUN_00107900(uVar4,param_2,pcVar3);\n      }" (if "if") (parenthesized_expression "(iVar1 != 0)" (( "(") (binary_expression "iVar1 != 0" (identifier "iVar1") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n        piVar2 = __errno_location();\n        pcVar3 = strerror(*piVar2);\n        uVar4 = dcgettext(0,"unable to copy file \'%s\'; reason: %s",5);\n        FUN_00107900(uVar4,param_2,pcVar3);\n      }" ({ "{") (expression_statement "piVar2 = __errno_location();" (assignment_expression "piVar2 = __errno_location()" (identifier "piVar2") (= "=") (call_expression "__errno_location()" (identifier "__errno_location") (argument_list "()" (( "(") () ")")))) (; ";")) (expression_statement "pcVar3 = strerror(*piVar2);" (assignment_expression "pcVar3 = strerror(*piVar2)" (identifier "pcVar3") (= "=") (call_expression "strerror(*piVar2)" (identifier "strerror") (argument_list "(*piVar2)" (( "(") (pointer_expression "*piVar2" (* "*") (identifier "piVar2")) () ")")))) (; ";")) (expression_statement "uVar4 = dcgettext(0,"unable to copy file \'%s\'; reason: %s",5);" (assignment_expression "uVar4 = dcgettext(0,"unable to copy file \'%s\'; reason: %s",5)" (identifier "uVar4") (= "=") (call_expression "dcgettext(0,"unable to copy file \'%s\'; reason: %s",5)" (identifier "dcgettext") (argument_list "(0,"unable to copy file \'%s\'; reason: %s",5)" (( "(") (number_literal "0") (, ",") (string_literal ""unable to copy file \'%s\'; reason: %s"" (" """) (string_content "unable to copy file ") (escape_sequence "\'") (string_content "%s") (escape_sequence "\'") (string_content "; reason: %s") (" """)) (, ",") (number_literal "5") () ")")))) (; ";")) (expression_statement "FUN_00107900(uVar4,param_2,pcVar3);" (call_expression "FUN_00107900(uVar4,param_2,pcVar3)" (identifier "FUN_00107900") (argument_list "(uVar4,param_2,pcVar3)" (( "(") (identifier "uVar4") (, ",") (identifier "param_2") (, ",") (identifier "pcVar3") () ")"))) (; ";")) (} "}"))) (if_statement "if (param_3 != 0) {\n        FUN_00107050(param_2,&sStack_c8);\n      }" (if "if") (parenthesized_expression "(param_3 != 0)" (( "(") (binary_expression "param_3 != 0" (identifier "param_3") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n        FUN_00107050(param_2,&sStack_c8);\n      }" ({ "{") (expression_statement "FUN_00107050(param_2,&sStack_c8);" (call_expression "FUN_00107050(param_2,&sStack_c8)" (identifier "FUN_00107050") (argument_list "(param_2,&sStack_c8)" (( "(") (identifier "param_2") (, ",") (pointer_expression "&sStack_c8" (& "&") (identifier "sStack_c8")) () ")"))) (; ";")) (} "}"))) (expression_statement "unlink(param_1);" (call_expression "unlink(param_1)" (identifier "unlink") (argument_list "(param_1)" (( "(") (identifier "param_1") () ")"))) (; ";")) (return_statement "return iVar1;" (return "return") (identifier "iVar1") (; ";")) (} "}"))) (expression_statement "iVar1 = rename(param_1,param_2);" (assignment_expression "iVar1 = rename(param_1,param_2)" (identifier "iVar1") (= "=") (call_expression "rename(param_1,param_2)" (identifier "rename") (argument_list "(param_1,param_2)" (( "(") (identifier "param_1") (, ",") (identifier "param_2") () ")")))) (; ";")) (if_statement "if (iVar1 != 0) {\nLAB_001071a8:\n      piVar2 = __errno_location();\n      pcVar3 = strerror(*piVar2);\n      uVar4 = dcgettext(0,"unable to rename \'%s\'; reason: %s",5);\n      FUN_00107900(uVar4,param_2,pcVar3);\n      unlink(param_1);\n      return iVar1;\n    }" (if "if") (parenthesized_expression "(iVar1 != 0)" (( "(") (binary_expression "iVar1 != 0" (identifier "iVar1") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\nLAB_001071a8:\n      piVar2 = __errno_location();\n      pcVar3 = strerror(*piVar2);\n      uVar4 = dcgettext(0,"unable to rename \'%s\'; reason: %s",5);\n      FUN_00107900(uVar4,param_2,pcVar3);\n      unlink(param_1);\n      return iVar1;\n    }" ({ "{") (labeled_statement "LAB_001071a8:\n      piVar2 = __errno_location();" (statement_identifier "LAB_001071a8") (: ":") (expression_statement "piVar2 = __errno_location();" (assignment_expression "piVar2 = __errno_location()" (identifier "piVar2") (= "=") (call_expression "__errno_location()" (identifier "__errno_location") (argument_list "()" (( "(") () ")")))) (; ";"))) (expression_statement "pcVar3 = strerror(*piVar2);" (assignment_expression "pcVar3 = strerror(*piVar2)" (identifier "pcVar3") (= "=") (call_expression "strerror(*piVar2)" (identifier "strerror") (argument_list "(*piVar2)" (( "(") (pointer_expression "*piVar2" (* "*") (identifier "piVar2")) () ")")))) (; ";")) (expression_statement "uVar4 = dcgettext(0,"unable to rename \'%s\'; reason: %s",5);" (assignment_expression "uVar4 = dcgettext(0,"unable to rename \'%s\'; reason: %s",5)" (identifier "uVar4") (= "=") (call_expression "dcgettext(0,"unable to rename \'%s\'; reason: %s",5)" (identifier "dcgettext") (argument_list "(0,"unable to rename \'%s\'; reason: %s",5)" (( "(") (number_literal "0") (, ",") (string_literal ""unable to rename \'%s\'; reason: %s"" (" """) (string_content "unable to rename ") (escape_sequence "\'") (string_content "%s") (escape_sequence "\'") (string_content "; reason: %s") (" """)) (, ",") (number_literal "5") () ")")))) (; ";")) (expression_statement "FUN_00107900(uVar4,param_2,pcVar3);" (call_expression "FUN_00107900(uVar4,param_2,pcVar3)" (identifier "FUN_00107900") (argument_list "(uVar4,param_2,pcVar3)" (( "(") (identifier "uVar4") (, ",") (identifier "param_2") (, ",") (identifier "pcVar3") () ")"))) (; ";")) (expression_statement "unlink(param_1);" (call_expression "unlink(param_1)" (identifier "unlink") (argument_list "(param_1)" (( "(") (identifier "param_1") () ")"))) (; ";")) (return_statement "return iVar1;" (return "return") (identifier "iVar1") (; ";")) (} "}"))) (expression_statement "chmod(param_2,sStack_c8.st_mode & 0x1ff);" (call_expression "chmod(param_2,sStack_c8.st_mode & 0x1ff)" (identifier "chmod") (argument_list "(param_2,sStack_c8.st_mode & 0x1ff)" (( "(") (identifier "param_2") (, ",") (binary_expression "sStack_c8.st_mode & 0x1ff" (field_expression "sStack_c8.st_mode" (identifier "sStack_c8") (. ".") (field_identifier "st_mode")) (& "&") (number_literal "0x1ff")) () ")"))) (; ";")) (expression_statement "iVar1 = chown(param_2,sStack_c8.st_uid,sStack_c8.st_gid);" (assignment_expression "iVar1 = chown(param_2,sStack_c8.st_uid,sStack_c8.st_gid)" (identifier "iVar1") (= "=") (call_expression "chown(param_2,sStack_c8.st_uid,sStack_c8.st_gid)" (identifier "chown") (argument_list "(param_2,sStack_c8.st_uid,sStack_c8.st_gid)" (( "(") (identifier "param_2") (, ",") (field_expression "sStack_c8.st_uid" (identifier "sStack_c8") (. ".") (field_identifier "st_uid")) (, ",") (field_expression "sStack_c8.st_gid" (identifier "sStack_c8") (. ".") (field_identifier "st_gid")) () ")")))) (; ";")) (if_statement "if (-1 < iVar1) {\n      chmod(param_2,sStack_c8.st_mode & 0xfff);\n      return 0;\n    }" (if "if") (parenthesized_expression "(-1 < iVar1)" (( "(") (binary_expression "-1 < iVar1" (number_literal "-1") (< "<") (identifier "iVar1")) () ")")) (compound_statement "{\n      chmod(param_2,sStack_c8.st_mode & 0xfff);\n      return 0;\n    }" ({ "{") (expression_statement "chmod(param_2,sStack_c8.st_mode & 0xfff);" (call_expression "chmod(param_2,sStack_c8.st_mode & 0xfff)" (identifier "chmod") (argument_list "(param_2,sStack_c8.st_mode & 0xfff)" (( "(") (identifier "param_2") (, ",") (binary_expression "sStack_c8.st_mode & 0xfff" (field_expression "sStack_c8.st_mode" (identifier "sStack_c8") (. ".") (field_identifier "st_mode")) (& "&") (number_literal "0xfff")) () ")"))) (; ";")) (return_statement "return 0;" (return "return") (number_literal "0") (; ";")) (} "}"))) (} "}")) (else_clause "else {\n    iVar1 = rename(param_1,param_2);\n    if (iVar1 != 0) goto LAB_001071a8;\n  }" (else "else") (compound_statement "{\n    iVar1 = rename(param_1,param_2);\n    if (iVar1 != 0) goto LAB_001071a8;\n  }" ({ "{") (expression_statement "iVar1 = rename(param_1,param_2);" (assignment_expression "iVar1 = rename(param_1,param_2)" (identifier "iVar1") (= "=") (call_expression "rename(param_1,param_2)" (identifier "rename") (argument_list "(param_1,param_2)" (( "(") (identifier "param_1") (, ",") (identifier "param_2") () ")")))) (; ";")) (if_statement "if (iVar1 != 0) goto LAB_001071a8;" (if "if") (parenthesized_expression "(iVar1 != 0)" (( "(") (binary_expression "iVar1 != 0" (identifier "iVar1") (!= "!=") (number_literal "0")) () ")")) (goto_statement "goto LAB_001071a8;" (goto "goto") (statement_identifier "LAB_001071a8") (; ";"))) (} "}")))) (return_statement "return 0;" (return "return") (number_literal "0") (; ";")) (} "}")))

int function_1(char *from,char *to,int var_8)

{
  int var_2;
  int *piVar2;
  char *pcVar3;
  char *pcVar4;
  type_1 s;
  
  var_2 = var_1(1,to,(type_1 *)&s);
  if (var_2 == 0) {
    if (((s.st_mode & 0xf080) != 0x8080) || (s.st_nlink != 1)) {
      var_2 = var_3(from,to);
      if (var_2 != 0) {
        piVar2 = var_4();
        pcVar3 = var_5(*piVar2);
        pcVar4 = (char *)var_6(0,"unable to copy file \'%s\'; reason: %s",5);
        var_7(pcVar4,to,pcVar3);
      }
      if (var_8 != 0) {
        var_9(to,&s);
      }
      var_10(from);
      return var_2;
    }
    var_2 = var_11(from,to);
    if (var_2 != 0) {
LAB_001071a8:
      piVar2 = var_4();
      pcVar3 = var_5(*piVar2);
      pcVar4 = (char *)var_6(0,"unable to rename \'%s\'; reason: %s",5);
      var_7(pcVar4,to,pcVar3);
      var_10(from);
      return var_2;
    }
    var_12(to,s.st_mode & 0x1ff);
    var_2 = var_13(to,s.st_uid,s.st_gid);
    if (-1 < var_2) {
      var_12(to,s.st_mode & 0xfff);
      return 0;
    }
  }
  else {
    var_2 = var_11(from,to);
    if (var_2 != 0) goto LAB_001071a8;
  }
  return 0;
}


(translation_unit (function_definition type: (primitive_type) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (parameter_declaration type: (primitive_type) declarator: (pointer_declarator 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: (type_identifier) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (number_literal) (identifier) (pointer_expression argument: (identifier)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (field_expression argument: (identifier) field: (field_identifier)) right: (number_literal))) right: (number_literal))) right: (parenthesized_expression (binary_expression left: (field_expression argument: (identifier) field: (field_identifier)) right: (number_literal))))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list)))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (pointer_expression argument: (identifier)))))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (number_literal) (string_literal (string_content) (escape_sequence) (string_content) (escape_sequence) (string_content)) (number_literal))))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier) (identifier)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier) (pointer_expression argument: (identifier))))))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier)))) (return_statement (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (labeled_statement label: (statement_identifier) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list))))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (pointer_expression argument: (identifier)))))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (number_literal) (string_literal (string_content) (escape_sequence) (string_content) (escape_sequence) (string_content)) (number_literal))))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier) (identifier)))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier)))) (return_statement (identifier)))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier) (binary_expression left: (field_expression argument: (identifier) field: (field_identifier)) right: (number_literal))))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (field_expression argument: (identifier) field: (field_identifier)) (field_expression argument: (identifier) field: (field_identifier)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (number_literal) right: (identifier))) consequence: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier) (binary_expression left: (field_expression argument: (identifier) field: (field_identifier)) right: (number_literal))))) (return_statement (number_literal))))) alternative: (else_clause (compound_statement (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (goto_statement label: (statement_identifier)))))) (return_statement (number_literal)))))

int MASKED(char *param_1,char *param_2,int param_3)

{
  int iVar1;
  int *piVar2;
  char *pcVar3;
  undefined8 uVar4;
  stat sStack_c8;
  
  iVar1 = __lxstat(1,param_2,&sStack_c8);
  if (iVar1 == 0) {
    if (((sStack_c8.st_mode & 0xf080) != 0x8080) || (sStack_c8.st_nlink != 1)) {
      iVar1 = FUN_00106f50(param_1,param_2);
      if (iVar1 != 0) {
        piVar2 = __errno_location();
        pcVar3 = strerror(*piVar2);
        uVar4 = dcgettext(0,"unable to copy file \'%s\'; reason: %s",5);
        FUN_00107900(uVar4,param_2,pcVar3);
      }
      if (param_3 != 0) {
        FUN_00107050(param_2,&sStack_c8);
      }
      unlink(param_1);
      return iVar1;
    }
    iVar1 = rename(param_1,param_2);
    if (iVar1 != 0) {
LAB_001071a8:
      piVar2 = __errno_location();
      pcVar3 = strerror(*piVar2);
      uVar4 = dcgettext(0,"unable to rename \'%s\'; reason: %s",5);
      FUN_00107900(uVar4,param_2,pcVar3);
      unlink(param_1);
      return iVar1;
    }
    chmod(param_2,sStack_c8.st_mode & 0x1ff);
    iVar1 = chown(param_2,sStack_c8.st_uid,sStack_c8.st_gid);
    if (-1 < iVar1) {
      chmod(param_2,sStack_c8.st_mode & 0xfff);
      return 0;
    }
  }
  else {
    iVar1 = rename(param_1,param_2);
    if (iVar1 != 0) goto LAB_001071a8;
  }
  return 0;
}

