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

int __regparm3 histfile_restore(char *backup,char *orig)

{
  int iVar1;
  ssize_t sVar2;
  int iVar3;
  int in_GS_OFFSET;
  char linkbuf [4097];
  
  iVar1 = *(int *)(in_GS_OFFSET + 0x14);
  sVar2 = readlink(orig,linkbuf,0x1000);
  if (sVar2 < 1) {
    iVar3 = rename(backup,orig);
  }
  else {
    linkbuf[sVar2] = '\0';
    iVar3 = rename(backup,linkbuf);
  }
  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {
    return iVar3;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail_local();
}



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

void __regparm3 FUN_0010b630(char *param_1,char *param_2)

{
  ssize_t sVar1;
  int in_GS_OFFSET;
  char local_1021 [4097];
  int local_20;
  undefined4 uStack_14;
  
  uStack_14 = 0x10b63d;
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  sVar1 = readlink(param_2,local_1021,0x1000);
  if (sVar1 < 1) {
    rename(param_1,param_2);
  }
  else {
    local_1021[sVar1] = '\0';
    rename(param_1,local_1021);
  }
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return;
  }
                    /* WARNING: Subroutine does not return */
  FUN_0010f8b0();
}


PUSH EBP
PUSH EDI
MOV EDI,EAX
PUSH ESI
MOV ESI,EDX
PUSH EBX
CALL 0x000312b0
ADD EBX,0x669c3
SUB ESP,0x1020
MOV EAX,GS:[0x14]
MOV dword ptr [ESP + 0x1010],EAX
XOR EAX,EAX
PUSH 0x1000
LEA EBP,[ESP + 0x13]
PUSH EBP
PUSH EDX
CALL 0x0002e480
ADD ESP,0x10
TEST EAX,EAX
JG 0x0010b6a0
SUB ESP,0x8
PUSH ESI
PUSH EDI
CALL 0x0002e710
ADD ESP,0x10
MOV ECX,dword ptr [ESP + 0x100c]
XOR ECX,dword ptr GS:[0x14]
JNZ 0x0010b6b4
ADD ESP,0x101c
POP EBX
POP ESI
POP EDI
POP EBP
RET
MOV byte ptr [ESP + EAX*0x1 + 0xb],0x0
SUB ESP,0x8
PUSH EBP
PUSH EDI
CALL 0x0002e710
ADD ESP,0x10
JMP 0x0010b67c
CALL 0x0010f8b0
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nvoid __regparm3 FUN_0010b630(char *param_1,char *param_2)\n\n{\n  ssize_t sVar1;\n  int in_GS_OFFSET;\n  char local_1021 [4097];\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x10b63d;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  sVar1 = readlink(param_2,local_1021,0x1000);\n  if (sVar1 < 1) {\n    rename(param_1,param_2);\n  }\n  else {\n    local_1021[sVar1] = '\0';\n    rename(param_1,local_1021);\n  }\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_0010f8b0();\n}\n\n" comment (function_definition "void __regparm3 FUN_0010b630(char *param_1,char *param_2)\n\n{\n  ssize_t sVar1;\n  int in_GS_OFFSET;\n  char local_1021 [4097];\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x10b63d;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  sVar1 = readlink(param_2,local_1021,0x1000);\n  if (sVar1 < 1) {\n    rename(param_1,param_2);\n  }\n  else {\n    local_1021[sVar1] = '\0';\n    rename(param_1,local_1021);\n  }\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_0010f8b0();\n}" primitive_type (ERROR "__regparm3" identifier) (function_declarator "FUN_0010b630(char *param_1,char *param_2)" identifier (parameter_list "(char *param_1,char *param_2)" ( (parameter_declaration "char *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "char *param_2" primitive_type (pointer_declarator "*param_2" * identifier)) ))) (compound_statement "{\n  ssize_t sVar1;\n  int in_GS_OFFSET;\n  char local_1021 [4097];\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x10b63d;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  sVar1 = readlink(param_2,local_1021,0x1000);\n  if (sVar1 < 1) {\n    rename(param_1,param_2);\n  }\n  else {\n    local_1021[sVar1] = '\0';\n    rename(param_1,local_1021);\n  }\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_0010f8b0();\n}" { (declaration "ssize_t sVar1;" primitive_type identifier ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "char local_1021 [4097];" primitive_type (array_declarator "local_1021 [4097]" identifier [ number_literal ]) ;) (declaration "int local_20;" primitive_type identifier ;) (declaration "undefined4 uStack_14;" type_identifier identifier ;) (expression_statement "uStack_14 = 0x10b63d;" (assignment_expression "uStack_14 = 0x10b63d" 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 "sVar1 = readlink(param_2,local_1021,0x1000);" (assignment_expression "sVar1 = readlink(param_2,local_1021,0x1000)" identifier = (call_expression "readlink(param_2,local_1021,0x1000)" identifier (argument_list "(param_2,local_1021,0x1000)" ( identifier , identifier , number_literal )))) ;) (if_statement "if (sVar1 < 1) {\n    rename(param_1,param_2);\n  }\n  else {\n    local_1021[sVar1] = '\0';\n    rename(param_1,local_1021);\n  }" if (parenthesized_expression "(sVar1 < 1)" ( (binary_expression "sVar1 < 1" identifier < number_literal) )) (compound_statement "{\n    rename(param_1,param_2);\n  }" { (expression_statement "rename(param_1,param_2);" (call_expression "rename(param_1,param_2)" identifier (argument_list "(param_1,param_2)" ( identifier , identifier ))) ;) }) (else_clause "else {\n    local_1021[sVar1] = '\0';\n    rename(param_1,local_1021);\n  }" else (compound_statement "{\n    local_1021[sVar1] = '\0';\n    rename(param_1,local_1021);\n  }" { (expression_statement "local_1021[sVar1] = '\0';" (assignment_expression "local_1021[sVar1] = '\0'" (subscript_expression "local_1021[sVar1]" identifier [ identifier ]) = (char_literal "'\0'" ' escape_sequence ')) ;) (expression_statement "rename(param_1,local_1021);" (call_expression "rename(param_1,local_1021)" identifier (argument_list "(param_1,local_1021)" ( identifier , identifier ))) ;) }))) (if_statement "if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\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;\n  }" { (return_statement "return;" return ;) })) comment (expression_statement "FUN_0010f8b0();" (call_expression "FUN_0010f8b0()" identifier (argument_list "()" ( ))) ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nint __regparm3 histfile_restore(char *backup,char *orig)\n\n{\n  int iVar1;\n  ssize_t sVar2;\n  int iVar3;\n  int in_GS_OFFSET;\n  char linkbuf [4097];\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  sVar2 = readlink(orig,linkbuf,0x1000);\n  if (sVar2 < 1) {\n    iVar3 = rename(backup,orig);\n  }\n  else {\n    linkbuf[sVar2] = '\0';\n    iVar3 = rename(backup,linkbuf);\n  }\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return iVar3;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail_local();\n}\n\n" comment (function_definition "int __regparm3 histfile_restore(char *backup,char *orig)\n\n{\n  int iVar1;\n  ssize_t sVar2;\n  int iVar3;\n  int in_GS_OFFSET;\n  char linkbuf [4097];\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  sVar2 = readlink(orig,linkbuf,0x1000);\n  if (sVar2 < 1) {\n    iVar3 = rename(backup,orig);\n  }\n  else {\n    linkbuf[sVar2] = '\0';\n    iVar3 = rename(backup,linkbuf);\n  }\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return iVar3;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail_local();\n}" primitive_type (ERROR "__regparm3" identifier) (function_declarator "histfile_restore(char *backup,char *orig)" identifier (parameter_list "(char *backup,char *orig)" ( (parameter_declaration "char *backup" primitive_type (pointer_declarator "*backup" * identifier)) , (parameter_declaration "char *orig" primitive_type (pointer_declarator "*orig" * identifier)) ))) (compound_statement "{\n  int iVar1;\n  ssize_t sVar2;\n  int iVar3;\n  int in_GS_OFFSET;\n  char linkbuf [4097];\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  sVar2 = readlink(orig,linkbuf,0x1000);\n  if (sVar2 < 1) {\n    iVar3 = rename(backup,orig);\n  }\n  else {\n    linkbuf[sVar2] = '\0';\n    iVar3 = rename(backup,linkbuf);\n  }\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return iVar3;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail_local();\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "ssize_t sVar2;" primitive_type identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "char linkbuf [4097];" primitive_type (array_declarator "linkbuf [4097]" 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 "sVar2 = readlink(orig,linkbuf,0x1000);" (assignment_expression "sVar2 = readlink(orig,linkbuf,0x1000)" identifier = (call_expression "readlink(orig,linkbuf,0x1000)" identifier (argument_list "(orig,linkbuf,0x1000)" ( identifier , identifier , number_literal )))) ;) (if_statement "if (sVar2 < 1) {\n    iVar3 = rename(backup,orig);\n  }\n  else {\n    linkbuf[sVar2] = '\0';\n    iVar3 = rename(backup,linkbuf);\n  }" if (parenthesized_expression "(sVar2 < 1)" ( (binary_expression "sVar2 < 1" identifier < number_literal) )) (compound_statement "{\n    iVar3 = rename(backup,orig);\n  }" { (expression_statement "iVar3 = rename(backup,orig);" (assignment_expression "iVar3 = rename(backup,orig)" identifier = (call_expression "rename(backup,orig)" identifier (argument_list "(backup,orig)" ( identifier , identifier )))) ;) }) (else_clause "else {\n    linkbuf[sVar2] = '\0';\n    iVar3 = rename(backup,linkbuf);\n  }" else (compound_statement "{\n    linkbuf[sVar2] = '\0';\n    iVar3 = rename(backup,linkbuf);\n  }" { (expression_statement "linkbuf[sVar2] = '\0';" (assignment_expression "linkbuf[sVar2] = '\0'" (subscript_expression "linkbuf[sVar2]" identifier [ identifier ]) = (char_literal "'\0'" ' escape_sequence ')) ;) (expression_statement "iVar3 = rename(backup,linkbuf);" (assignment_expression "iVar3 = rename(backup,linkbuf)" identifier = (call_expression "rename(backup,linkbuf)" identifier (argument_list "(backup,linkbuf)" ( identifier , identifier )))) ;) }))) (if_statement "if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return iVar3;\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 iVar3;\n  }" { (return_statement "return iVar3;" return identifier ;) })) comment (expression_statement "__stack_chk_fail_local();" (call_expression "__stack_chk_fail_local()" identifier (argument_list "()" ( ))) ;) })))
(translation_unit "void __regparm3 FUN_0010b630(char *param_1,char *param_2)\n\n{\n  ssize_t sVar1;\n  int in_GS_OFFSET;\n  char local_1021 [4097];\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x10b63d;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  sVar1 = readlink(param_2,local_1021,0x1000);\n  if (sVar1 < 1) {\n    rename(param_1,param_2);\n  }\n  else {\n    local_1021[sVar1] = '\0';\n    rename(param_1,local_1021);\n  }\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }\n                    \n  FUN_0010f8b0();\n}\n\n" (function_definition "void __regparm3 FUN_0010b630(char *param_1,char *param_2)\n\n{\n  ssize_t sVar1;\n  int in_GS_OFFSET;\n  char local_1021 [4097];\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x10b63d;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  sVar1 = readlink(param_2,local_1021,0x1000);\n  if (sVar1 < 1) {\n    rename(param_1,param_2);\n  }\n  else {\n    local_1021[sVar1] = '\0';\n    rename(param_1,local_1021);\n  }\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }\n                    \n  FUN_0010f8b0();\n}" primitive_type (ERROR "__regparm3" identifier) (function_declarator "FUN_0010b630(char *param_1,char *param_2)" identifier (parameter_list "(char *param_1,char *param_2)" ( (parameter_declaration "char *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "char *param_2" primitive_type (pointer_declarator "*param_2" * identifier)) ))) (compound_statement "{\n  ssize_t sVar1;\n  int in_GS_OFFSET;\n  char local_1021 [4097];\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x10b63d;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  sVar1 = readlink(param_2,local_1021,0x1000);\n  if (sVar1 < 1) {\n    rename(param_1,param_2);\n  }\n  else {\n    local_1021[sVar1] = '\0';\n    rename(param_1,local_1021);\n  }\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }\n                    \n  FUN_0010f8b0();\n}" { (declaration "ssize_t sVar1;" primitive_type identifier ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "char local_1021 [4097];" primitive_type (array_declarator "local_1021 [4097]" identifier [ number_literal ]) ;) (declaration "int local_20;" primitive_type identifier ;) (declaration "undefined4 uStack_14;" type_identifier identifier ;) (expression_statement "uStack_14 = 0x10b63d;" (assignment_expression "uStack_14 = 0x10b63d" 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 "sVar1 = readlink(param_2,local_1021,0x1000);" (assignment_expression "sVar1 = readlink(param_2,local_1021,0x1000)" identifier = (call_expression "readlink(param_2,local_1021,0x1000)" identifier (argument_list "(param_2,local_1021,0x1000)" ( identifier , identifier , number_literal )))) ;) (if_statement "if (sVar1 < 1) {\n    rename(param_1,param_2);\n  }\n  else {\n    local_1021[sVar1] = '\0';\n    rename(param_1,local_1021);\n  }" if (parenthesized_expression "(sVar1 < 1)" ( (binary_expression "sVar1 < 1" identifier < number_literal) )) (compound_statement "{\n    rename(param_1,param_2);\n  }" { (expression_statement "rename(param_1,param_2);" (call_expression "rename(param_1,param_2)" identifier (argument_list "(param_1,param_2)" ( identifier , identifier ))) ;) }) (else_clause "else {\n    local_1021[sVar1] = '\0';\n    rename(param_1,local_1021);\n  }" else (compound_statement "{\n    local_1021[sVar1] = '\0';\n    rename(param_1,local_1021);\n  }" { (expression_statement "local_1021[sVar1] = '\0';" (assignment_expression "local_1021[sVar1] = '\0'" (subscript_expression "local_1021[sVar1]" identifier [ identifier ]) = (char_literal "'\0'" ' escape_sequence ')) ;) (expression_statement "rename(param_1,local_1021);" (call_expression "rename(param_1,local_1021)" identifier (argument_list "(param_1,local_1021)" ( identifier , identifier ))) ;) }))) (if_statement "if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\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;\n  }" { (return_statement "return;" return ;) })) (expression_statement "FUN_0010f8b0();" (call_expression "FUN_0010f8b0()" identifier (argument_list "()" ( ))) ;) })))
(translation_unit (function_definition TYPE (ERROR IDENT) (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE (pointer_declarator * IDENT)) ))) (compound_statement { (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 , LIT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT ))) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression (subscript_expression IDENT [ IDENT ]) = (char_literal ' escape_sequence ')) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT ))) ;) }))) (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 ;) })) (expression_statement (call_expression IDENT (argument_list ( ))) ;) })))
(function_definition "void __regparm3 FUN_0010b630(char *param_1,char *param_2)\n\n{\n  ssize_t sVar1;\n  int in_GS_OFFSET;\n  char local_1021 [4097];\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x10b63d;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  sVar1 = readlink(param_2,local_1021,0x1000);\n  if (sVar1 < 1) {\n    rename(param_1,param_2);\n  }\n  else {\n    local_1021[sVar1] = '\0';\n    rename(param_1,local_1021);\n  }\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }\n                    \n  FUN_0010f8b0();\n}" (primitive_type "void") (ERROR "__regparm3" (identifier "__regparm3")) (function_declarator "FUN_0010b630(char *param_1,char *param_2)" (identifier "FUN_0010b630") (parameter_list "(char *param_1,char *param_2)" (( "(") (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"))) () ")"))) (compound_statement "{\n  ssize_t sVar1;\n  int in_GS_OFFSET;\n  char local_1021 [4097];\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x10b63d;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  sVar1 = readlink(param_2,local_1021,0x1000);\n  if (sVar1 < 1) {\n    rename(param_1,param_2);\n  }\n  else {\n    local_1021[sVar1] = '\0';\n    rename(param_1,local_1021);\n  }\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }\n                    \n  FUN_0010f8b0();\n}" ({ "{") (declaration "ssize_t sVar1;" (primitive_type "ssize_t") (identifier "sVar1") (; ";")) (declaration "int in_GS_OFFSET;" (primitive_type "int") (identifier "in_GS_OFFSET") (; ";")) (declaration "char local_1021 [4097];" (primitive_type "char") (array_declarator "local_1021 [4097]" (identifier "local_1021") ([ "[") (number_literal "4097") (] "]")) (; ";")) (declaration "int local_20;" (primitive_type "int") (identifier "local_20") (; ";")) (declaration "undefined4 uStack_14;" (type_identifier "undefined4") (identifier "uStack_14") (; ";")) (expression_statement "uStack_14 = 0x10b63d;" (assignment_expression "uStack_14 = 0x10b63d" (identifier "uStack_14") (= "=") (number_literal "0x10b63d")) (; ";")) (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 "sVar1 = readlink(param_2,local_1021,0x1000);" (assignment_expression "sVar1 = readlink(param_2,local_1021,0x1000)" (identifier "sVar1") (= "=") (call_expression "readlink(param_2,local_1021,0x1000)" (identifier "readlink") (argument_list "(param_2,local_1021,0x1000)" (( "(") (identifier "param_2") (, ",") (identifier "local_1021") (, ",") (number_literal "0x1000") () ")")))) (; ";")) (if_statement "if (sVar1 < 1) {\n    rename(param_1,param_2);\n  }\n  else {\n    local_1021[sVar1] = '\0';\n    rename(param_1,local_1021);\n  }" (if "if") (parenthesized_expression "(sVar1 < 1)" (( "(") (binary_expression "sVar1 < 1" (identifier "sVar1") (< "<") (number_literal "1")) () ")")) (compound_statement "{\n    rename(param_1,param_2);\n  }" ({ "{") (expression_statement "rename(param_1,param_2);" (call_expression "rename(param_1,param_2)" (identifier "rename") (argument_list "(param_1,param_2)" (( "(") (identifier "param_1") (, ",") (identifier "param_2") () ")"))) (; ";")) (} "}")) (else_clause "else {\n    local_1021[sVar1] = '\0';\n    rename(param_1,local_1021);\n  }" (else "else") (compound_statement "{\n    local_1021[sVar1] = '\0';\n    rename(param_1,local_1021);\n  }" ({ "{") (expression_statement "local_1021[sVar1] = '\0';" (assignment_expression "local_1021[sVar1] = '\0'" (subscript_expression "local_1021[sVar1]" (identifier "local_1021") ([ "[") (identifier "sVar1") (] "]")) (= "=") (char_literal "'\0'" (' "'") (escape_sequence "\0") (' "'"))) (; ";")) (expression_statement "rename(param_1,local_1021);" (call_expression "rename(param_1,local_1021)" (identifier "rename") (argument_list "(param_1,local_1021)" (( "(") (identifier "param_1") (, ",") (identifier "local_1021") () ")"))) (; ";")) (} "}")))) (if_statement "if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\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;\n  }" ({ "{") (return_statement "return;" (return "return") (; ";")) (} "}"))) (expression_statement "FUN_0010f8b0();" (call_expression "FUN_0010f8b0()" (identifier "FUN_0010f8b0") (argument_list "()" (( "(") () ")"))) (; ";")) (} "}")))

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

int __regparm3 function_1(char *backup,char *orig)

{
  int var_5;
  ssize_t var_3;
  int iVar3;
  int var_1;
  char linkbuf [4097];
  
  var_5 = *(int *)(var_1 + 0x14);
  var_3 = var_2(orig,linkbuf,0x1000);
  if (var_3 < 1) {
    iVar3 = var_4(backup,orig);
  }
  else {
    linkbuf[var_3] = '\0';
    iVar3 = var_4(backup,linkbuf);
  }
  if (var_5 == *(int *)(var_1 + 0x14)) {
    return iVar3;
  }
                    /* WARNING: Subroutine does not return */
  var_6();
}


(translation_unit (function_definition type: (primitive_type) (ERROR (identifier)) 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))))) body: (compound_statement (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) (number_literal))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier))))) alternative: (else_clause (compound_statement (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (identifier)) right: (char_literal (escape_sequence)))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier))))))) (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))) (expression_statement (call_expression function: (identifier) arguments: (argument_list))))))

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

void __regparm3 MASKED(char *param_1,char *param_2)

{
  ssize_t sVar1;
  int in_GS_OFFSET;
  char local_1021 [4097];
  int local_20;
  undefined4 uStack_14;
  
  uStack_14 = 0x10b63d;
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  sVar1 = readlink(param_2,local_1021,0x1000);
  if (sVar1 < 1) {
    rename(param_1,param_2);
  }
  else {
    local_1021[sVar1] = '\0';
    rename(param_1,local_1021);
  }
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return;
  }
                    /* WARNING: Subroutine does not return */
  FUN_0010f8b0();
}

