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

int settime(timespec *ts)

{
  int iVar1;
  int iVar2;
  int *piVar3;
  int in_GS_OFFSET;
  timeval tv;
  
  iVar1 = *(int *)(in_GS_OFFSET + 0x14);
  iVar2 = clock_settime(0,(timespec *)ts);
  if (iVar2 != 0) {
    piVar3 = __errno_location();
    if (*piVar3 != 1) {
      tv.tv_sec = ts->tv_sec;
      tv.tv_usec = ts->tv_nsec / 1000;
      iVar2 = settimeofday((timeval *)&tv,(timezone *)0x0);
    }
  }
  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {
    return iVar2;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail_local();
}



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

int FUN_0001eb70(timespec *param_1)

{
  int iVar1;
  int *piVar2;
  int in_GS_OFFSET;
  timeval local_18;
  int local_10;
  
  local_10 = *(int *)(in_GS_OFFSET + 0x14);
  iVar1 = clock_settime(0,param_1);
  if (iVar1 != 0) {
    piVar2 = __errno_location();
    if (*piVar2 != 1) {
      local_18.tv_sec = param_1->tv_sec;
      local_18.tv_usec = param_1->tv_nsec / 1000;
      iVar1 = settimeofday(&local_18,(timezone *)0x0);
    }
  }
  if (local_10 == *(int *)(in_GS_OFFSET + 0x14)) {
    return iVar1;
  }
                    /* WARNING: Subroutine does not return */
  FUN_00026270();
}


PUSH EDI
PUSH ESI
PUSH EBX
CALL 0x00012e10
ADD EBX,0x12488
SUB ESP,0x18
MOV EAX,GS:[0x14]
MOV dword ptr [ESP + 0x14],EAX
XOR EAX,EAX
MOV EDI,dword ptr [ESP + 0x28]
PUSH EDI
PUSH 0x0
CALL 0x00012310
ADD ESP,0x10
MOV ESI,EAX
TEST EAX,EAX
JZ 0x0001ebde
CALL 0x00012300
CMP dword ptr [EAX],0x1
JZ 0x0001ebde
MOV EAX,dword ptr [EDI]
MOV ECX,dword ptr [EDI + 0x4]
MOV EDX,0x10624dd3
SUB ESP,0x8
MOV dword ptr [ESP + 0xc],EAX
MOV EAX,ECX
SAR ECX,0x1f
IMUL EDX
SAR EDX,0x6
SUB EDX,ECX
MOV dword ptr [ESP + 0x10],EDX
PUSH 0x0
LEA EAX,[ESP + 0x10]
PUSH EAX
CALL 0x00012420
ADD ESP,0x10
MOV ESI,EAX
MOV ECX,dword ptr [ESP + 0xc]
XOR ECX,dword ptr GS:[0x14]
MOV EAX,ESI
JNZ 0x0001ebf4
ADD ESP,0x10
POP EBX
POP ESI
POP EDI
RET
CALL 0x00026270
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nint FUN_0001eb70(timespec *param_1)\n\n{\n  int iVar1;\n  int *piVar2;\n  int in_GS_OFFSET;\n  timeval local_18;\n  int local_10;\n  \n  local_10 = *(int *)(in_GS_OFFSET + 0x14);\n  iVar1 = clock_settime(0,param_1);\n  if (iVar1 != 0) {\n    piVar2 = __errno_location();\n    if (*piVar2 != 1) {\n      local_18.tv_sec = param_1->tv_sec;\n      local_18.tv_usec = param_1->tv_nsec / 1000;\n      iVar1 = settimeofday(&local_18,(timezone *)0x0);\n    }\n  }\n  if (local_10 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return iVar1;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_00026270();\n}\n\n" comment (function_definition "int FUN_0001eb70(timespec *param_1)\n\n{\n  int iVar1;\n  int *piVar2;\n  int in_GS_OFFSET;\n  timeval local_18;\n  int local_10;\n  \n  local_10 = *(int *)(in_GS_OFFSET + 0x14);\n  iVar1 = clock_settime(0,param_1);\n  if (iVar1 != 0) {\n    piVar2 = __errno_location();\n    if (*piVar2 != 1) {\n      local_18.tv_sec = param_1->tv_sec;\n      local_18.tv_usec = param_1->tv_nsec / 1000;\n      iVar1 = settimeofday(&local_18,(timezone *)0x0);\n    }\n  }\n  if (local_10 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return iVar1;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_00026270();\n}" primitive_type (function_declarator "FUN_0001eb70(timespec *param_1)" identifier (parameter_list "(timespec *param_1)" ( (parameter_declaration "timespec *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) ))) (compound_statement "{\n  int iVar1;\n  int *piVar2;\n  int in_GS_OFFSET;\n  timeval local_18;\n  int local_10;\n  \n  local_10 = *(int *)(in_GS_OFFSET + 0x14);\n  iVar1 = clock_settime(0,param_1);\n  if (iVar1 != 0) {\n    piVar2 = __errno_location();\n    if (*piVar2 != 1) {\n      local_18.tv_sec = param_1->tv_sec;\n      local_18.tv_usec = param_1->tv_nsec / 1000;\n      iVar1 = settimeofday(&local_18,(timezone *)0x0);\n    }\n  }\n  if (local_10 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return iVar1;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_00026270();\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int *piVar2;" primitive_type (pointer_declarator "*piVar2" * identifier) ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "timeval local_18;" type_identifier identifier ;) (declaration "int local_10;" primitive_type identifier ;) (expression_statement "local_10 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "local_10 = *(int *)(in_GS_OFFSET + 0x14)" identifier = (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) ;) (expression_statement "iVar1 = clock_settime(0,param_1);" (assignment_expression "iVar1 = clock_settime(0,param_1)" identifier = (call_expression "clock_settime(0,param_1)" identifier (argument_list "(0,param_1)" ( number_literal , identifier )))) ;) (if_statement "if (iVar1 != 0) {\n    piVar2 = __errno_location();\n    if (*piVar2 != 1) {\n      local_18.tv_sec = param_1->tv_sec;\n      local_18.tv_usec = param_1->tv_nsec / 1000;\n      iVar1 = settimeofday(&local_18,(timezone *)0x0);\n    }\n  }" if (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) (compound_statement "{\n    piVar2 = __errno_location();\n    if (*piVar2 != 1) {\n      local_18.tv_sec = param_1->tv_sec;\n      local_18.tv_usec = param_1->tv_nsec / 1000;\n      iVar1 = settimeofday(&local_18,(timezone *)0x0);\n    }\n  }" { (expression_statement "piVar2 = __errno_location();" (assignment_expression "piVar2 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (if_statement "if (*piVar2 != 1) {\n      local_18.tv_sec = param_1->tv_sec;\n      local_18.tv_usec = param_1->tv_nsec / 1000;\n      iVar1 = settimeofday(&local_18,(timezone *)0x0);\n    }" if (parenthesized_expression "(*piVar2 != 1)" ( (binary_expression "*piVar2 != 1" (pointer_expression "*piVar2" * identifier) != number_literal) )) (compound_statement "{\n      local_18.tv_sec = param_1->tv_sec;\n      local_18.tv_usec = param_1->tv_nsec / 1000;\n      iVar1 = settimeofday(&local_18,(timezone *)0x0);\n    }" { (expression_statement "local_18.tv_sec = param_1->tv_sec;" (assignment_expression "local_18.tv_sec = param_1->tv_sec" (field_expression "local_18.tv_sec" identifier . field_identifier) = (field_expression "param_1->tv_sec" identifier -> field_identifier)) ;) (expression_statement "local_18.tv_usec = param_1->tv_nsec / 1000;" (assignment_expression "local_18.tv_usec = param_1->tv_nsec / 1000" (field_expression "local_18.tv_usec" identifier . field_identifier) = (binary_expression "param_1->tv_nsec / 1000" (field_expression "param_1->tv_nsec" identifier -> field_identifier) / number_literal)) ;) (expression_statement "iVar1 = settimeofday(&local_18,(timezone *)0x0);" (assignment_expression "iVar1 = settimeofday(&local_18,(timezone *)0x0)" identifier = (call_expression "settimeofday(&local_18,(timezone *)0x0)" identifier (argument_list "(&local_18,(timezone *)0x0)" ( (pointer_expression "&local_18" & identifier) , (cast_expression "(timezone *)0x0" ( (type_descriptor "timezone *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal) )))) ;) })) })) (if_statement "if (local_10 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return iVar1;\n  }" if (parenthesized_expression "(local_10 == *(int *)(in_GS_OFFSET + 0x14))" ( (binary_expression "local_10 == *(int *)(in_GS_OFFSET + 0x14)" identifier == (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) )) (compound_statement "{\n    return iVar1;\n  }" { (return_statement "return iVar1;" return identifier ;) })) comment (expression_statement "FUN_00026270();" (call_expression "FUN_00026270()" identifier (argument_list "()" ( ))) ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* WARNING: Unknown calling convention */\n\nint settime(timespec *ts)\n\n{\n  int iVar1;\n  int iVar2;\n  int *piVar3;\n  int in_GS_OFFSET;\n  timeval tv;\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  iVar2 = clock_settime(0,(timespec *)ts);\n  if (iVar2 != 0) {\n    piVar3 = __errno_location();\n    if (*piVar3 != 1) {\n      tv.tv_sec = ts->tv_sec;\n      tv.tv_usec = ts->tv_nsec / 1000;\n      iVar2 = settimeofday((timeval *)&tv,(timezone *)0x0);\n    }\n  }\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return iVar2;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail_local();\n}\n\n" comment comment (function_definition "int settime(timespec *ts)\n\n{\n  int iVar1;\n  int iVar2;\n  int *piVar3;\n  int in_GS_OFFSET;\n  timeval tv;\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  iVar2 = clock_settime(0,(timespec *)ts);\n  if (iVar2 != 0) {\n    piVar3 = __errno_location();\n    if (*piVar3 != 1) {\n      tv.tv_sec = ts->tv_sec;\n      tv.tv_usec = ts->tv_nsec / 1000;\n      iVar2 = settimeofday((timeval *)&tv,(timezone *)0x0);\n    }\n  }\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return iVar2;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail_local();\n}" primitive_type (function_declarator "settime(timespec *ts)" identifier (parameter_list "(timespec *ts)" ( (parameter_declaration "timespec *ts" type_identifier (pointer_declarator "*ts" * identifier)) ))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  int *piVar3;\n  int in_GS_OFFSET;\n  timeval tv;\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  iVar2 = clock_settime(0,(timespec *)ts);\n  if (iVar2 != 0) {\n    piVar3 = __errno_location();\n    if (*piVar3 != 1) {\n      tv.tv_sec = ts->tv_sec;\n      tv.tv_usec = ts->tv_nsec / 1000;\n      iVar2 = settimeofday((timeval *)&tv,(timezone *)0x0);\n    }\n  }\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return iVar2;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail_local();\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "int *piVar3;" primitive_type (pointer_declarator "*piVar3" * identifier) ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "timeval tv;" type_identifier identifier ;) (expression_statement "iVar1 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "iVar1 = *(int *)(in_GS_OFFSET + 0x14)" identifier = (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) ;) (expression_statement "iVar2 = clock_settime(0,(timespec *)ts);" (assignment_expression "iVar2 = clock_settime(0,(timespec *)ts)" identifier = (call_expression "clock_settime(0,(timespec *)ts)" identifier (argument_list "(0,(timespec *)ts)" ( number_literal , (cast_expression "(timespec *)ts" ( (type_descriptor "timespec *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier) )))) ;) (if_statement "if (iVar2 != 0) {\n    piVar3 = __errno_location();\n    if (*piVar3 != 1) {\n      tv.tv_sec = ts->tv_sec;\n      tv.tv_usec = ts->tv_nsec / 1000;\n      iVar2 = settimeofday((timeval *)&tv,(timezone *)0x0);\n    }\n  }" if (parenthesized_expression "(iVar2 != 0)" ( (binary_expression "iVar2 != 0" identifier != number_literal) )) (compound_statement "{\n    piVar3 = __errno_location();\n    if (*piVar3 != 1) {\n      tv.tv_sec = ts->tv_sec;\n      tv.tv_usec = ts->tv_nsec / 1000;\n      iVar2 = settimeofday((timeval *)&tv,(timezone *)0x0);\n    }\n  }" { (expression_statement "piVar3 = __errno_location();" (assignment_expression "piVar3 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (if_statement "if (*piVar3 != 1) {\n      tv.tv_sec = ts->tv_sec;\n      tv.tv_usec = ts->tv_nsec / 1000;\n      iVar2 = settimeofday((timeval *)&tv,(timezone *)0x0);\n    }" if (parenthesized_expression "(*piVar3 != 1)" ( (binary_expression "*piVar3 != 1" (pointer_expression "*piVar3" * identifier) != number_literal) )) (compound_statement "{\n      tv.tv_sec = ts->tv_sec;\n      tv.tv_usec = ts->tv_nsec / 1000;\n      iVar2 = settimeofday((timeval *)&tv,(timezone *)0x0);\n    }" { (expression_statement "tv.tv_sec = ts->tv_sec;" (assignment_expression "tv.tv_sec = ts->tv_sec" (field_expression "tv.tv_sec" identifier . field_identifier) = (field_expression "ts->tv_sec" identifier -> field_identifier)) ;) (expression_statement "tv.tv_usec = ts->tv_nsec / 1000;" (assignment_expression "tv.tv_usec = ts->tv_nsec / 1000" (field_expression "tv.tv_usec" identifier . field_identifier) = (binary_expression "ts->tv_nsec / 1000" (field_expression "ts->tv_nsec" identifier -> field_identifier) / number_literal)) ;) (expression_statement "iVar2 = settimeofday((timeval *)&tv,(timezone *)0x0);" (assignment_expression "iVar2 = settimeofday((timeval *)&tv,(timezone *)0x0)" identifier = (call_expression "settimeofday((timeval *)&tv,(timezone *)0x0)" identifier (argument_list "((timeval *)&tv,(timezone *)0x0)" ( (cast_expression "(timeval *)&tv" ( (type_descriptor "timeval *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "&tv" & identifier)) , (cast_expression "(timezone *)0x0" ( (type_descriptor "timezone *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal) )))) ;) })) })) (if_statement "if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return iVar2;\n  }" if (parenthesized_expression "(iVar1 == *(int *)(in_GS_OFFSET + 0x14))" ( (binary_expression "iVar1 == *(int *)(in_GS_OFFSET + 0x14)" identifier == (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) )) (compound_statement "{\n    return iVar2;\n  }" { (return_statement "return iVar2;" return identifier ;) })) comment (expression_statement "__stack_chk_fail_local();" (call_expression "__stack_chk_fail_local()" identifier (argument_list "()" ( ))) ;) })))
(translation_unit "int FUN_0001eb70(timespec *param_1)\n\n{\n  int iVar1;\n  int *piVar2;\n  int in_GS_OFFSET;\n  timeval local_18;\n  int local_10;\n  \n  local_10 = *(int *)(in_GS_OFFSET + 0x14);\n  iVar1 = clock_settime(0,param_1);\n  if (iVar1 != 0) {\n    piVar2 = __errno_location();\n    if (*piVar2 != 1) {\n      local_18.tv_sec = param_1->tv_sec;\n      local_18.tv_usec = param_1->tv_nsec / 1000;\n      iVar1 = settimeofday(&local_18,(timezone *)0x0);\n    }\n  }\n  if (local_10 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return iVar1;\n  }\n                    \n  FUN_00026270();\n}\n\n" (function_definition "int FUN_0001eb70(timespec *param_1)\n\n{\n  int iVar1;\n  int *piVar2;\n  int in_GS_OFFSET;\n  timeval local_18;\n  int local_10;\n  \n  local_10 = *(int *)(in_GS_OFFSET + 0x14);\n  iVar1 = clock_settime(0,param_1);\n  if (iVar1 != 0) {\n    piVar2 = __errno_location();\n    if (*piVar2 != 1) {\n      local_18.tv_sec = param_1->tv_sec;\n      local_18.tv_usec = param_1->tv_nsec / 1000;\n      iVar1 = settimeofday(&local_18,(timezone *)0x0);\n    }\n  }\n  if (local_10 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return iVar1;\n  }\n                    \n  FUN_00026270();\n}" primitive_type (function_declarator "FUN_0001eb70(timespec *param_1)" identifier (parameter_list "(timespec *param_1)" ( (parameter_declaration "timespec *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) ))) (compound_statement "{\n  int iVar1;\n  int *piVar2;\n  int in_GS_OFFSET;\n  timeval local_18;\n  int local_10;\n  \n  local_10 = *(int *)(in_GS_OFFSET + 0x14);\n  iVar1 = clock_settime(0,param_1);\n  if (iVar1 != 0) {\n    piVar2 = __errno_location();\n    if (*piVar2 != 1) {\n      local_18.tv_sec = param_1->tv_sec;\n      local_18.tv_usec = param_1->tv_nsec / 1000;\n      iVar1 = settimeofday(&local_18,(timezone *)0x0);\n    }\n  }\n  if (local_10 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return iVar1;\n  }\n                    \n  FUN_00026270();\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int *piVar2;" primitive_type (pointer_declarator "*piVar2" * identifier) ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "timeval local_18;" type_identifier identifier ;) (declaration "int local_10;" primitive_type identifier ;) (expression_statement "local_10 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "local_10 = *(int *)(in_GS_OFFSET + 0x14)" identifier = (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) ;) (expression_statement "iVar1 = clock_settime(0,param_1);" (assignment_expression "iVar1 = clock_settime(0,param_1)" identifier = (call_expression "clock_settime(0,param_1)" identifier (argument_list "(0,param_1)" ( number_literal , identifier )))) ;) (if_statement "if (iVar1 != 0) {\n    piVar2 = __errno_location();\n    if (*piVar2 != 1) {\n      local_18.tv_sec = param_1->tv_sec;\n      local_18.tv_usec = param_1->tv_nsec / 1000;\n      iVar1 = settimeofday(&local_18,(timezone *)0x0);\n    }\n  }" if (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) (compound_statement "{\n    piVar2 = __errno_location();\n    if (*piVar2 != 1) {\n      local_18.tv_sec = param_1->tv_sec;\n      local_18.tv_usec = param_1->tv_nsec / 1000;\n      iVar1 = settimeofday(&local_18,(timezone *)0x0);\n    }\n  }" { (expression_statement "piVar2 = __errno_location();" (assignment_expression "piVar2 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (if_statement "if (*piVar2 != 1) {\n      local_18.tv_sec = param_1->tv_sec;\n      local_18.tv_usec = param_1->tv_nsec / 1000;\n      iVar1 = settimeofday(&local_18,(timezone *)0x0);\n    }" if (parenthesized_expression "(*piVar2 != 1)" ( (binary_expression "*piVar2 != 1" (pointer_expression "*piVar2" * identifier) != number_literal) )) (compound_statement "{\n      local_18.tv_sec = param_1->tv_sec;\n      local_18.tv_usec = param_1->tv_nsec / 1000;\n      iVar1 = settimeofday(&local_18,(timezone *)0x0);\n    }" { (expression_statement "local_18.tv_sec = param_1->tv_sec;" (assignment_expression "local_18.tv_sec = param_1->tv_sec" (field_expression "local_18.tv_sec" identifier . field_identifier) = (field_expression "param_1->tv_sec" identifier -> field_identifier)) ;) (expression_statement "local_18.tv_usec = param_1->tv_nsec / 1000;" (assignment_expression "local_18.tv_usec = param_1->tv_nsec / 1000" (field_expression "local_18.tv_usec" identifier . field_identifier) = (binary_expression "param_1->tv_nsec / 1000" (field_expression "param_1->tv_nsec" identifier -> field_identifier) / number_literal)) ;) (expression_statement "iVar1 = settimeofday(&local_18,(timezone *)0x0);" (assignment_expression "iVar1 = settimeofday(&local_18,(timezone *)0x0)" identifier = (call_expression "settimeofday(&local_18,(timezone *)0x0)" identifier (argument_list "(&local_18,(timezone *)0x0)" ( (pointer_expression "&local_18" & identifier) , (cast_expression "(timezone *)0x0" ( (type_descriptor "timezone *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal) )))) ;) })) })) (if_statement "if (local_10 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return iVar1;\n  }" if (parenthesized_expression "(local_10 == *(int *)(in_GS_OFFSET + 0x14))" ( (binary_expression "local_10 == *(int *)(in_GS_OFFSET + 0x14)" identifier == (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) )) (compound_statement "{\n    return iVar1;\n  }" { (return_statement "return iVar1;" return identifier ;) })) (expression_statement "FUN_00026270();" (call_expression "FUN_00026270()" identifier (argument_list "()" ( ))) ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (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 ( LIT , IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( )))) ;) (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) != LIT) )) (compound_statement { (expression_statement (assignment_expression (field_expression IDENT . field_identifier) = (field_expression IDENT -> field_identifier)) ;) (expression_statement (assignment_expression (field_expression IDENT . field_identifier) = (binary_expression (field_expression IDENT -> field_identifier) / LIT)) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (pointer_expression & IDENT) , (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT) )))) ;) })) })) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) )) (compound_statement { (return_statement return IDENT ;) })) (expression_statement (call_expression IDENT (argument_list ( ))) ;) })))
(function_definition "int FUN_0001eb70(timespec *param_1)\n\n{\n  int iVar1;\n  int *piVar2;\n  int in_GS_OFFSET;\n  timeval local_18;\n  int local_10;\n  \n  local_10 = *(int *)(in_GS_OFFSET + 0x14);\n  iVar1 = clock_settime(0,param_1);\n  if (iVar1 != 0) {\n    piVar2 = __errno_location();\n    if (*piVar2 != 1) {\n      local_18.tv_sec = param_1->tv_sec;\n      local_18.tv_usec = param_1->tv_nsec / 1000;\n      iVar1 = settimeofday(&local_18,(timezone *)0x0);\n    }\n  }\n  if (local_10 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return iVar1;\n  }\n                    \n  FUN_00026270();\n}" (primitive_type "int") (function_declarator "FUN_0001eb70(timespec *param_1)" (identifier "FUN_0001eb70") (parameter_list "(timespec *param_1)" (( "(") (parameter_declaration "timespec *param_1" (type_identifier "timespec") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) () ")"))) (compound_statement "{\n  int iVar1;\n  int *piVar2;\n  int in_GS_OFFSET;\n  timeval local_18;\n  int local_10;\n  \n  local_10 = *(int *)(in_GS_OFFSET + 0x14);\n  iVar1 = clock_settime(0,param_1);\n  if (iVar1 != 0) {\n    piVar2 = __errno_location();\n    if (*piVar2 != 1) {\n      local_18.tv_sec = param_1->tv_sec;\n      local_18.tv_usec = param_1->tv_nsec / 1000;\n      iVar1 = settimeofday(&local_18,(timezone *)0x0);\n    }\n  }\n  if (local_10 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return iVar1;\n  }\n                    \n  FUN_00026270();\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "int *piVar2;" (primitive_type "int") (pointer_declarator "*piVar2" (* "*") (identifier "piVar2")) (; ";")) (declaration "int in_GS_OFFSET;" (primitive_type "int") (identifier "in_GS_OFFSET") (; ";")) (declaration "timeval local_18;" (type_identifier "timeval") (identifier "local_18") (; ";")) (declaration "int local_10;" (primitive_type "int") (identifier "local_10") (; ";")) (expression_statement "local_10 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "local_10 = *(int *)(in_GS_OFFSET + 0x14)" (identifier "local_10") (= "=") (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" (* "*") (cast_expression "(int *)(in_GS_OFFSET + 0x14)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(in_GS_OFFSET + 0x14)" (( "(") (binary_expression "in_GS_OFFSET + 0x14" (identifier "in_GS_OFFSET") (+ "+") (number_literal "0x14")) () ")"))))) (; ";")) (expression_statement "iVar1 = clock_settime(0,param_1);" (assignment_expression "iVar1 = clock_settime(0,param_1)" (identifier "iVar1") (= "=") (call_expression "clock_settime(0,param_1)" (identifier "clock_settime") (argument_list "(0,param_1)" (( "(") (number_literal "0") (, ",") (identifier "param_1") () ")")))) (; ";")) (if_statement "if (iVar1 != 0) {\n    piVar2 = __errno_location();\n    if (*piVar2 != 1) {\n      local_18.tv_sec = param_1->tv_sec;\n      local_18.tv_usec = param_1->tv_nsec / 1000;\n      iVar1 = settimeofday(&local_18,(timezone *)0x0);\n    }\n  }" (if "if") (parenthesized_expression "(iVar1 != 0)" (( "(") (binary_expression "iVar1 != 0" (identifier "iVar1") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n    piVar2 = __errno_location();\n    if (*piVar2 != 1) {\n      local_18.tv_sec = param_1->tv_sec;\n      local_18.tv_usec = param_1->tv_nsec / 1000;\n      iVar1 = settimeofday(&local_18,(timezone *)0x0);\n    }\n  }" ({ "{") (expression_statement "piVar2 = __errno_location();" (assignment_expression "piVar2 = __errno_location()" (identifier "piVar2") (= "=") (call_expression "__errno_location()" (identifier "__errno_location") (argument_list "()" (( "(") () ")")))) (; ";")) (if_statement "if (*piVar2 != 1) {\n      local_18.tv_sec = param_1->tv_sec;\n      local_18.tv_usec = param_1->tv_nsec / 1000;\n      iVar1 = settimeofday(&local_18,(timezone *)0x0);\n    }" (if "if") (parenthesized_expression "(*piVar2 != 1)" (( "(") (binary_expression "*piVar2 != 1" (pointer_expression "*piVar2" (* "*") (identifier "piVar2")) (!= "!=") (number_literal "1")) () ")")) (compound_statement "{\n      local_18.tv_sec = param_1->tv_sec;\n      local_18.tv_usec = param_1->tv_nsec / 1000;\n      iVar1 = settimeofday(&local_18,(timezone *)0x0);\n    }" ({ "{") (expression_statement "local_18.tv_sec = param_1->tv_sec;" (assignment_expression "local_18.tv_sec = param_1->tv_sec" (field_expression "local_18.tv_sec" (identifier "local_18") (. ".") (field_identifier "tv_sec")) (= "=") (field_expression "param_1->tv_sec" (identifier "param_1") (-> "->") (field_identifier "tv_sec"))) (; ";")) (expression_statement "local_18.tv_usec = param_1->tv_nsec / 1000;" (assignment_expression "local_18.tv_usec = param_1->tv_nsec / 1000" (field_expression "local_18.tv_usec" (identifier "local_18") (. ".") (field_identifier "tv_usec")) (= "=") (binary_expression "param_1->tv_nsec / 1000" (field_expression "param_1->tv_nsec" (identifier "param_1") (-> "->") (field_identifier "tv_nsec")) (/ "/") (number_literal "1000"))) (; ";")) (expression_statement "iVar1 = settimeofday(&local_18,(timezone *)0x0);" (assignment_expression "iVar1 = settimeofday(&local_18,(timezone *)0x0)" (identifier "iVar1") (= "=") (call_expression "settimeofday(&local_18,(timezone *)0x0)" (identifier "settimeofday") (argument_list "(&local_18,(timezone *)0x0)" (( "(") (pointer_expression "&local_18" (& "&") (identifier "local_18")) (, ",") (cast_expression "(timezone *)0x0" (( "(") (type_descriptor "timezone *" (type_identifier "timezone") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0")) () ")")))) (; ";")) (} "}"))) (} "}"))) (if_statement "if (local_10 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return iVar1;\n  }" (if "if") (parenthesized_expression "(local_10 == *(int *)(in_GS_OFFSET + 0x14))" (( "(") (binary_expression "local_10 == *(int *)(in_GS_OFFSET + 0x14)" (identifier "local_10") (== "==") (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" (* "*") (cast_expression "(int *)(in_GS_OFFSET + 0x14)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(in_GS_OFFSET + 0x14)" (( "(") (binary_expression "in_GS_OFFSET + 0x14" (identifier "in_GS_OFFSET") (+ "+") (number_literal "0x14")) () ")"))))) () ")")) (compound_statement "{\n    return iVar1;\n  }" ({ "{") (return_statement "return iVar1;" (return "return") (identifier "iVar1") (; ";")) (} "}"))) (expression_statement "FUN_00026270();" (call_expression "FUN_00026270()" (identifier "FUN_00026270") (argument_list "()" (( "(") () ")"))) (; ";")) (} "}")))

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

int function_1(type_1 *ts)

{
  int var_6;
  int var_3;
  int *piVar3;
  int var_1;
  type_2 tv;
  
  var_6 = *(int *)(var_1 + 0x14);
  var_3 = var_2(0,(type_1 *)ts);
  if (var_3 != 0) {
    piVar3 = var_4();
    if (*piVar3 != 1) {
      tv.tv_sec = ts->tv_sec;
      tv.tv_usec = ts->tv_nsec / 1000;
      var_3 = var_5((type_2 *)&tv,(type_3 *)0x0);
    }
  }
  if (var_6 == *(int *)(var_1 + 0x14)) {
    return var_3;
  }
                    /* WARNING: Subroutine does not return */
  var_7();
}


(translation_unit (function_definition type: (primitive_type) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (type_identifier) declarator: (pointer_declarator 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: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (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 (number_literal) (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)))) (if_statement condition: (parenthesized_expression (binary_expression left: (pointer_expression argument: (identifier)) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (field_expression argument: (identifier) field: (field_identifier)) right: (field_expression argument: (identifier) field: (field_identifier)))) (expression_statement (assignment_expression left: (field_expression argument: (identifier) field: (field_identifier)) right: (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 (pointer_expression argument: (identifier)) (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (number_literal)))))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))))) consequence: (compound_statement (return_statement (identifier)))) (expression_statement (call_expression function: (identifier) arguments: (argument_list))))))

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

int MASKED(timespec *param_1)

{
  int iVar1;
  int *piVar2;
  int in_GS_OFFSET;
  timeval local_18;
  int local_10;
  
  local_10 = *(int *)(in_GS_OFFSET + 0x14);
  iVar1 = clock_settime(0,param_1);
  if (iVar1 != 0) {
    piVar2 = __errno_location();
    if (*piVar2 != 1) {
      local_18.tv_sec = param_1->tv_sec;
      local_18.tv_usec = param_1->tv_nsec / 1000;
      iVar1 = settimeofday(&local_18,(timezone *)0x0);
    }
  }
  if (local_10 == *(int *)(in_GS_OFFSET + 0x14)) {
    return iVar1;
  }
                    /* WARNING: Subroutine does not return */
  FUN_00026270();
}

