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

_func_void_int * putty_signal(int sig,_func_void_int *func)

{
  int iVar1;
  int iVar2;
  int in_GS_OFFSET;
  sigaction sa;
  sigaction old;
  
  iVar1 = *(int *)(in_GS_OFFSET + 0x14);
  sa.__sigaction_handler.sa_handler = func;
  iVar2 = sigemptyset((sigset_t *)&sa.sa_mask);
  if (-1 < iVar2) {
    sa.sa_flags = 0x10000000;
    iVar2 = sigaction(sig,(sigaction *)&sa,(sigaction *)&old);
    if (-1 < iVar2) goto LAB_0009f2ad;
  }
  old.__sigaction_handler = (anon_union_4_2_5ad2d23e_for___sigaction_handler)0xffffffff;
LAB_0009f2ad:
  if (iVar1 != *(int *)(in_GS_OFFSET + 0x14)) {
                    /* WARNING: Subroutine does not return */
    __stack_chk_fail_local();
  }
  return old.__sigaction_handler.sa_handler;
}



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

_union_1051 FUN_0009f230(int param_1,_union_1051 param_2)

{
  int iVar1;
  int in_GS_OFFSET;
  _union_1051 local_128;
  sigset_t local_124;
  undefined4 local_a4;
  _union_1051 local_9c [35];
  int local_10;
  undefined4 uStack_c;
  
  uStack_c = 0x9f237;
  local_10 = *(int *)(in_GS_OFFSET + 0x14);
  local_128 = param_2;
  iVar1 = sigemptyset(&local_124);
  if (-1 < iVar1) {
    local_a4 = 0x10000000;
    iVar1 = sigaction(param_1,(sigaction *)&local_128,(sigaction *)local_9c);
    if (-1 < iVar1) goto LAB_0009f2ad;
  }
  local_9c[0] = (_union_1051)0xffffffff;
LAB_0009f2ad:
  if (local_10 != *(int *)(in_GS_OFFSET + 0x14)) {
                    /* WARNING: Subroutine does not return */
    FUN_000a39d0();
  }
  return (_union_1051)local_9c[0].sa_handler;
}


PUSH ESI
PUSH EBX
CALL 0x0001c4f0
ADD EBX,0x71519
SUB ESP,0x130
MOV EAX,GS:[0x14]
MOV dword ptr [ESP + 0x128],EAX
XOR EAX,EAX
MOV EAX,dword ptr [ESP + 0x140]
LEA ESI,[ESP + 0x10]
MOV dword ptr [ESP + 0x10],EAX
LEA EAX,[ESP + 0x14]
PUSH EAX
CALL 0x0001ad60
ADD ESP,0x10
TEST EAX,EAX
JS 0x0009f2a8
MOV dword ptr [ESP + 0x88],0x10000000
SUB ESP,0x4
LEA EAX,[ESP + 0x94]
PUSH EAX
PUSH ESI
PUSH dword ptr [ESP + 0x13c]
CALL 0x0001a220
ADD ESP,0x10
TEST EAX,EAX
JS 0x0009f2a8
MOV EAX,dword ptr [ESP + 0x90]
JMP 0x0009f2ad
MOV EAX,0xffffffff
MOV EDX,dword ptr [ESP + 0x11c]
XOR EDX,dword ptr GS:[0x14]
JNZ 0x0009f2c6
ADD ESP,0x124
POP EBX
POP ESI
RET
CALL 0x000a39d0
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\n_union_1051 FUN_0009f230(int param_1,_union_1051 param_2)\n\n{\n  int iVar1;\n  int in_GS_OFFSET;\n  _union_1051 local_128;\n  sigset_t local_124;\n  undefined4 local_a4;\n  _union_1051 local_9c [35];\n  int local_10;\n  undefined4 uStack_c;\n  \n  uStack_c = 0x9f237;\n  local_10 = *(int *)(in_GS_OFFSET + 0x14);\n  local_128 = param_2;\n  iVar1 = sigemptyset(&local_124);\n  if (-1 < iVar1) {\n    local_a4 = 0x10000000;\n    iVar1 = sigaction(param_1,(sigaction *)&local_128,(sigaction *)local_9c);\n    if (-1 < iVar1) goto LAB_0009f2ad;\n  }\n  local_9c[0] = (_union_1051)0xffffffff;\nLAB_0009f2ad:\n  if (local_10 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    /* WARNING: Subroutine does not return */\n    FUN_000a39d0();\n  }\n  return (_union_1051)local_9c[0].sa_handler;\n}\n\n" comment (function_definition "_union_1051 FUN_0009f230(int param_1,_union_1051 param_2)\n\n{\n  int iVar1;\n  int in_GS_OFFSET;\n  _union_1051 local_128;\n  sigset_t local_124;\n  undefined4 local_a4;\n  _union_1051 local_9c [35];\n  int local_10;\n  undefined4 uStack_c;\n  \n  uStack_c = 0x9f237;\n  local_10 = *(int *)(in_GS_OFFSET + 0x14);\n  local_128 = param_2;\n  iVar1 = sigemptyset(&local_124);\n  if (-1 < iVar1) {\n    local_a4 = 0x10000000;\n    iVar1 = sigaction(param_1,(sigaction *)&local_128,(sigaction *)local_9c);\n    if (-1 < iVar1) goto LAB_0009f2ad;\n  }\n  local_9c[0] = (_union_1051)0xffffffff;\nLAB_0009f2ad:\n  if (local_10 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    /* WARNING: Subroutine does not return */\n    FUN_000a39d0();\n  }\n  return (_union_1051)local_9c[0].sa_handler;\n}" type_identifier (function_declarator "FUN_0009f230(int param_1,_union_1051 param_2)" identifier (parameter_list "(int param_1,_union_1051 param_2)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "_union_1051 param_2" type_identifier identifier) ))) (compound_statement "{\n  int iVar1;\n  int in_GS_OFFSET;\n  _union_1051 local_128;\n  sigset_t local_124;\n  undefined4 local_a4;\n  _union_1051 local_9c [35];\n  int local_10;\n  undefined4 uStack_c;\n  \n  uStack_c = 0x9f237;\n  local_10 = *(int *)(in_GS_OFFSET + 0x14);\n  local_128 = param_2;\n  iVar1 = sigemptyset(&local_124);\n  if (-1 < iVar1) {\n    local_a4 = 0x10000000;\n    iVar1 = sigaction(param_1,(sigaction *)&local_128,(sigaction *)local_9c);\n    if (-1 < iVar1) goto LAB_0009f2ad;\n  }\n  local_9c[0] = (_union_1051)0xffffffff;\nLAB_0009f2ad:\n  if (local_10 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    /* WARNING: Subroutine does not return */\n    FUN_000a39d0();\n  }\n  return (_union_1051)local_9c[0].sa_handler;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "_union_1051 local_128;" type_identifier identifier ;) (declaration "sigset_t local_124;" type_identifier identifier ;) (declaration "undefined4 local_a4;" type_identifier identifier ;) (declaration "_union_1051 local_9c [35];" type_identifier (array_declarator "local_9c [35]" identifier [ number_literal ]) ;) (declaration "int local_10;" primitive_type identifier ;) (declaration "undefined4 uStack_c;" type_identifier identifier ;) (expression_statement "uStack_c = 0x9f237;" (assignment_expression "uStack_c = 0x9f237" identifier = number_literal) ;) (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 "local_128 = param_2;" (assignment_expression "local_128 = param_2" identifier = identifier) ;) (expression_statement "iVar1 = sigemptyset(&local_124);" (assignment_expression "iVar1 = sigemptyset(&local_124)" identifier = (call_expression "sigemptyset(&local_124)" identifier (argument_list "(&local_124)" ( (pointer_expression "&local_124" & identifier) )))) ;) (if_statement "if (-1 < iVar1) {\n    local_a4 = 0x10000000;\n    iVar1 = sigaction(param_1,(sigaction *)&local_128,(sigaction *)local_9c);\n    if (-1 < iVar1) goto LAB_0009f2ad;\n  }" if (parenthesized_expression "(-1 < iVar1)" ( (binary_expression "-1 < iVar1" number_literal < identifier) )) (compound_statement "{\n    local_a4 = 0x10000000;\n    iVar1 = sigaction(param_1,(sigaction *)&local_128,(sigaction *)local_9c);\n    if (-1 < iVar1) goto LAB_0009f2ad;\n  }" { (expression_statement "local_a4 = 0x10000000;" (assignment_expression "local_a4 = 0x10000000" identifier = number_literal) ;) (expression_statement "iVar1 = sigaction(param_1,(sigaction *)&local_128,(sigaction *)local_9c);" (assignment_expression "iVar1 = sigaction(param_1,(sigaction *)&local_128,(sigaction *)local_9c)" identifier = (call_expression "sigaction(param_1,(sigaction *)&local_128,(sigaction *)local_9c)" identifier (argument_list "(param_1,(sigaction *)&local_128,(sigaction *)local_9c)" ( identifier , (cast_expression "(sigaction *)&local_128" ( (type_descriptor "sigaction *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "&local_128" & identifier)) , (cast_expression "(sigaction *)local_9c" ( (type_descriptor "sigaction *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier) )))) ;) (if_statement "if (-1 < iVar1) goto LAB_0009f2ad;" if (parenthesized_expression "(-1 < iVar1)" ( (binary_expression "-1 < iVar1" number_literal < identifier) )) (goto_statement "goto LAB_0009f2ad;" goto statement_identifier ;)) })) (expression_statement "local_9c[0] = (_union_1051)0xffffffff;" (assignment_expression "local_9c[0] = (_union_1051)0xffffffff" (subscript_expression "local_9c[0]" identifier [ number_literal ]) = (cast_expression "(_union_1051)0xffffffff" ( (type_descriptor "_union_1051" type_identifier) ) number_literal)) ;) (labeled_statement "LAB_0009f2ad:\n  if (local_10 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    /* WARNING: Subroutine does not return */\n    FUN_000a39d0();\n  }" statement_identifier : (if_statement "if (local_10 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    /* WARNING: Subroutine does not return */\n    FUN_000a39d0();\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                    /* WARNING: Subroutine does not return */\n    FUN_000a39d0();\n  }" { comment (expression_statement "FUN_000a39d0();" (call_expression "FUN_000a39d0()" identifier (argument_list "()" ( ))) ;) }))) (return_statement "return (_union_1051)local_9c[0].sa_handler;" return (cast_expression "(_union_1051)local_9c[0].sa_handler" ( (type_descriptor "_union_1051" type_identifier) ) (field_expression "local_9c[0].sa_handler" (subscript_expression "local_9c[0]" identifier [ number_literal ]) . field_identifier)) ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* WARNING: Unknown calling convention */\n\n_func_void_int * putty_signal(int sig,_func_void_int *func)\n\n{\n  int iVar1;\n  int iVar2;\n  int in_GS_OFFSET;\n  sigaction sa;\n  sigaction old;\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  sa.__sigaction_handler.sa_handler = func;\n  iVar2 = sigemptyset((sigset_t *)&sa.sa_mask);\n  if (-1 < iVar2) {\n    sa.sa_flags = 0x10000000;\n    iVar2 = sigaction(sig,(sigaction *)&sa,(sigaction *)&old);\n    if (-1 < iVar2) goto LAB_0009f2ad;\n  }\n  old.__sigaction_handler = (anon_union_4_2_5ad2d23e_for___sigaction_handler)0xffffffff;\nLAB_0009f2ad:\n  if (iVar1 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    /* WARNING: Subroutine does not return */\n    __stack_chk_fail_local();\n  }\n  return old.__sigaction_handler.sa_handler;\n}\n\n" comment comment (function_definition "_func_void_int * putty_signal(int sig,_func_void_int *func)\n\n{\n  int iVar1;\n  int iVar2;\n  int in_GS_OFFSET;\n  sigaction sa;\n  sigaction old;\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  sa.__sigaction_handler.sa_handler = func;\n  iVar2 = sigemptyset((sigset_t *)&sa.sa_mask);\n  if (-1 < iVar2) {\n    sa.sa_flags = 0x10000000;\n    iVar2 = sigaction(sig,(sigaction *)&sa,(sigaction *)&old);\n    if (-1 < iVar2) goto LAB_0009f2ad;\n  }\n  old.__sigaction_handler = (anon_union_4_2_5ad2d23e_for___sigaction_handler)0xffffffff;\nLAB_0009f2ad:\n  if (iVar1 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    /* WARNING: Subroutine does not return */\n    __stack_chk_fail_local();\n  }\n  return old.__sigaction_handler.sa_handler;\n}" type_identifier (pointer_declarator "* putty_signal(int sig,_func_void_int *func)" * (function_declarator "putty_signal(int sig,_func_void_int *func)" identifier (parameter_list "(int sig,_func_void_int *func)" ( (parameter_declaration "int sig" primitive_type identifier) , (parameter_declaration "_func_void_int *func" type_identifier (pointer_declarator "*func" * identifier)) )))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  int in_GS_OFFSET;\n  sigaction sa;\n  sigaction old;\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  sa.__sigaction_handler.sa_handler = func;\n  iVar2 = sigemptyset((sigset_t *)&sa.sa_mask);\n  if (-1 < iVar2) {\n    sa.sa_flags = 0x10000000;\n    iVar2 = sigaction(sig,(sigaction *)&sa,(sigaction *)&old);\n    if (-1 < iVar2) goto LAB_0009f2ad;\n  }\n  old.__sigaction_handler = (anon_union_4_2_5ad2d23e_for___sigaction_handler)0xffffffff;\nLAB_0009f2ad:\n  if (iVar1 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    /* WARNING: Subroutine does not return */\n    __stack_chk_fail_local();\n  }\n  return old.__sigaction_handler.sa_handler;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "sigaction sa;" type_identifier identifier ;) (declaration "sigaction old;" 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 "sa.__sigaction_handler.sa_handler = func;" (assignment_expression "sa.__sigaction_handler.sa_handler = func" (field_expression "sa.__sigaction_handler.sa_handler" (field_expression "sa.__sigaction_handler" identifier . field_identifier) . field_identifier) = identifier) ;) (expression_statement "iVar2 = sigemptyset((sigset_t *)&sa.sa_mask);" (assignment_expression "iVar2 = sigemptyset((sigset_t *)&sa.sa_mask)" identifier = (call_expression "sigemptyset((sigset_t *)&sa.sa_mask)" identifier (argument_list "((sigset_t *)&sa.sa_mask)" ( (cast_expression "(sigset_t *)&sa.sa_mask" ( (type_descriptor "sigset_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "&sa.sa_mask" & (field_expression "sa.sa_mask" identifier . field_identifier))) )))) ;) (if_statement "if (-1 < iVar2) {\n    sa.sa_flags = 0x10000000;\n    iVar2 = sigaction(sig,(sigaction *)&sa,(sigaction *)&old);\n    if (-1 < iVar2) goto LAB_0009f2ad;\n  }" if (parenthesized_expression "(-1 < iVar2)" ( (binary_expression "-1 < iVar2" number_literal < identifier) )) (compound_statement "{\n    sa.sa_flags = 0x10000000;\n    iVar2 = sigaction(sig,(sigaction *)&sa,(sigaction *)&old);\n    if (-1 < iVar2) goto LAB_0009f2ad;\n  }" { (expression_statement "sa.sa_flags = 0x10000000;" (assignment_expression "sa.sa_flags = 0x10000000" (field_expression "sa.sa_flags" identifier . field_identifier) = number_literal) ;) (expression_statement "iVar2 = sigaction(sig,(sigaction *)&sa,(sigaction *)&old);" (assignment_expression "iVar2 = sigaction(sig,(sigaction *)&sa,(sigaction *)&old)" identifier = (call_expression "sigaction(sig,(sigaction *)&sa,(sigaction *)&old)" identifier (argument_list "(sig,(sigaction *)&sa,(sigaction *)&old)" ( identifier , (cast_expression "(sigaction *)&sa" ( (type_descriptor "sigaction *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "&sa" & identifier)) , (cast_expression "(sigaction *)&old" ( (type_descriptor "sigaction *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "&old" & identifier)) )))) ;) (if_statement "if (-1 < iVar2) goto LAB_0009f2ad;" if (parenthesized_expression "(-1 < iVar2)" ( (binary_expression "-1 < iVar2" number_literal < identifier) )) (goto_statement "goto LAB_0009f2ad;" goto statement_identifier ;)) })) (expression_statement "old.__sigaction_handler = (anon_union_4_2_5ad2d23e_for___sigaction_handler)0xffffffff;" (assignment_expression "old.__sigaction_handler = (anon_union_4_2_5ad2d23e_for___sigaction_handler)0xffffffff" (field_expression "old.__sigaction_handler" identifier . field_identifier) = (cast_expression "(anon_union_4_2_5ad2d23e_for___sigaction_handler)0xffffffff" ( (type_descriptor "anon_union_4_2_5ad2d23e_for___sigaction_handler" type_identifier) ) number_literal)) ;) (labeled_statement "LAB_0009f2ad:\n  if (iVar1 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    /* WARNING: Subroutine does not return */\n    __stack_chk_fail_local();\n  }" statement_identifier : (if_statement "if (iVar1 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    /* WARNING: Subroutine does not return */\n    __stack_chk_fail_local();\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                    /* WARNING: Subroutine does not return */\n    __stack_chk_fail_local();\n  }" { comment (expression_statement "__stack_chk_fail_local();" (call_expression "__stack_chk_fail_local()" identifier (argument_list "()" ( ))) ;) }))) (return_statement "return old.__sigaction_handler.sa_handler;" return (field_expression "old.__sigaction_handler.sa_handler" (field_expression "old.__sigaction_handler" identifier . field_identifier) . field_identifier) ;) })))
(translation_unit "_union_1051 FUN_0009f230(int param_1,_union_1051 param_2)\n\n{\n  int iVar1;\n  int in_GS_OFFSET;\n  _union_1051 local_128;\n  sigset_t local_124;\n  undefined4 local_a4;\n  _union_1051 local_9c [35];\n  int local_10;\n  undefined4 uStack_c;\n  \n  uStack_c = 0x9f237;\n  local_10 = *(int *)(in_GS_OFFSET + 0x14);\n  local_128 = param_2;\n  iVar1 = sigemptyset(&local_124);\n  if (-1 < iVar1) {\n    local_a4 = 0x10000000;\n    iVar1 = sigaction(param_1,(sigaction *)&local_128,(sigaction *)local_9c);\n    if (-1 < iVar1) goto LAB_0009f2ad;\n  }\n  local_9c[0] = (_union_1051)0xffffffff;\nLAB_0009f2ad:\n  if (local_10 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    \n    FUN_000a39d0();\n  }\n  return (_union_1051)local_9c[0].sa_handler;\n}\n\n" (function_definition "_union_1051 FUN_0009f230(int param_1,_union_1051 param_2)\n\n{\n  int iVar1;\n  int in_GS_OFFSET;\n  _union_1051 local_128;\n  sigset_t local_124;\n  undefined4 local_a4;\n  _union_1051 local_9c [35];\n  int local_10;\n  undefined4 uStack_c;\n  \n  uStack_c = 0x9f237;\n  local_10 = *(int *)(in_GS_OFFSET + 0x14);\n  local_128 = param_2;\n  iVar1 = sigemptyset(&local_124);\n  if (-1 < iVar1) {\n    local_a4 = 0x10000000;\n    iVar1 = sigaction(param_1,(sigaction *)&local_128,(sigaction *)local_9c);\n    if (-1 < iVar1) goto LAB_0009f2ad;\n  }\n  local_9c[0] = (_union_1051)0xffffffff;\nLAB_0009f2ad:\n  if (local_10 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    \n    FUN_000a39d0();\n  }\n  return (_union_1051)local_9c[0].sa_handler;\n}" type_identifier (function_declarator "FUN_0009f230(int param_1,_union_1051 param_2)" identifier (parameter_list "(int param_1,_union_1051 param_2)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "_union_1051 param_2" type_identifier identifier) ))) (compound_statement "{\n  int iVar1;\n  int in_GS_OFFSET;\n  _union_1051 local_128;\n  sigset_t local_124;\n  undefined4 local_a4;\n  _union_1051 local_9c [35];\n  int local_10;\n  undefined4 uStack_c;\n  \n  uStack_c = 0x9f237;\n  local_10 = *(int *)(in_GS_OFFSET + 0x14);\n  local_128 = param_2;\n  iVar1 = sigemptyset(&local_124);\n  if (-1 < iVar1) {\n    local_a4 = 0x10000000;\n    iVar1 = sigaction(param_1,(sigaction *)&local_128,(sigaction *)local_9c);\n    if (-1 < iVar1) goto LAB_0009f2ad;\n  }\n  local_9c[0] = (_union_1051)0xffffffff;\nLAB_0009f2ad:\n  if (local_10 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    \n    FUN_000a39d0();\n  }\n  return (_union_1051)local_9c[0].sa_handler;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "_union_1051 local_128;" type_identifier identifier ;) (declaration "sigset_t local_124;" type_identifier identifier ;) (declaration "undefined4 local_a4;" type_identifier identifier ;) (declaration "_union_1051 local_9c [35];" type_identifier (array_declarator "local_9c [35]" identifier [ number_literal ]) ;) (declaration "int local_10;" primitive_type identifier ;) (declaration "undefined4 uStack_c;" type_identifier identifier ;) (expression_statement "uStack_c = 0x9f237;" (assignment_expression "uStack_c = 0x9f237" identifier = number_literal) ;) (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 "local_128 = param_2;" (assignment_expression "local_128 = param_2" identifier = identifier) ;) (expression_statement "iVar1 = sigemptyset(&local_124);" (assignment_expression "iVar1 = sigemptyset(&local_124)" identifier = (call_expression "sigemptyset(&local_124)" identifier (argument_list "(&local_124)" ( (pointer_expression "&local_124" & identifier) )))) ;) (if_statement "if (-1 < iVar1) {\n    local_a4 = 0x10000000;\n    iVar1 = sigaction(param_1,(sigaction *)&local_128,(sigaction *)local_9c);\n    if (-1 < iVar1) goto LAB_0009f2ad;\n  }" if (parenthesized_expression "(-1 < iVar1)" ( (binary_expression "-1 < iVar1" number_literal < identifier) )) (compound_statement "{\n    local_a4 = 0x10000000;\n    iVar1 = sigaction(param_1,(sigaction *)&local_128,(sigaction *)local_9c);\n    if (-1 < iVar1) goto LAB_0009f2ad;\n  }" { (expression_statement "local_a4 = 0x10000000;" (assignment_expression "local_a4 = 0x10000000" identifier = number_literal) ;) (expression_statement "iVar1 = sigaction(param_1,(sigaction *)&local_128,(sigaction *)local_9c);" (assignment_expression "iVar1 = sigaction(param_1,(sigaction *)&local_128,(sigaction *)local_9c)" identifier = (call_expression "sigaction(param_1,(sigaction *)&local_128,(sigaction *)local_9c)" identifier (argument_list "(param_1,(sigaction *)&local_128,(sigaction *)local_9c)" ( identifier , (cast_expression "(sigaction *)&local_128" ( (type_descriptor "sigaction *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "&local_128" & identifier)) , (cast_expression "(sigaction *)local_9c" ( (type_descriptor "sigaction *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier) )))) ;) (if_statement "if (-1 < iVar1) goto LAB_0009f2ad;" if (parenthesized_expression "(-1 < iVar1)" ( (binary_expression "-1 < iVar1" number_literal < identifier) )) (goto_statement "goto LAB_0009f2ad;" goto statement_identifier ;)) })) (expression_statement "local_9c[0] = (_union_1051)0xffffffff;" (assignment_expression "local_9c[0] = (_union_1051)0xffffffff" (subscript_expression "local_9c[0]" identifier [ number_literal ]) = (cast_expression "(_union_1051)0xffffffff" ( (type_descriptor "_union_1051" type_identifier) ) number_literal)) ;) (labeled_statement "LAB_0009f2ad:\n  if (local_10 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    \n    FUN_000a39d0();\n  }" statement_identifier : (if_statement "if (local_10 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    \n    FUN_000a39d0();\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                    \n    FUN_000a39d0();\n  }" { (expression_statement "FUN_000a39d0();" (call_expression "FUN_000a39d0()" identifier (argument_list "()" ( ))) ;) }))) (return_statement "return (_union_1051)local_9c[0].sa_handler;" return (cast_expression "(_union_1051)local_9c[0].sa_handler" ( (type_descriptor "_union_1051" type_identifier) ) (field_expression "local_9c[0].sa_handler" (subscript_expression "local_9c[0]" identifier [ number_literal ]) . field_identifier)) ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (array_declarator IDENT [ LIT ]) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (pointer_expression & IDENT) )))) ;) (if_statement if (parenthesized_expression ( (binary_expression LIT < IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (pointer_expression & IDENT)) , (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT) )))) ;) (if_statement if (parenthesized_expression ( (binary_expression LIT < IDENT) )) (goto_statement goto statement_identifier ;)) })) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (cast_expression ( (type_descriptor TYPE) ) LIT)) ;) (labeled_statement statement_identifier : (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 { (expression_statement (call_expression IDENT (argument_list ( ))) ;) }))) (return_statement return (cast_expression ( (type_descriptor TYPE) ) (field_expression (subscript_expression IDENT [ LIT ]) . field_identifier)) ;) })))
(function_definition "_union_1051 FUN_0009f230(int param_1,_union_1051 param_2)\n\n{\n  int iVar1;\n  int in_GS_OFFSET;\n  _union_1051 local_128;\n  sigset_t local_124;\n  undefined4 local_a4;\n  _union_1051 local_9c [35];\n  int local_10;\n  undefined4 uStack_c;\n  \n  uStack_c = 0x9f237;\n  local_10 = *(int *)(in_GS_OFFSET + 0x14);\n  local_128 = param_2;\n  iVar1 = sigemptyset(&local_124);\n  if (-1 < iVar1) {\n    local_a4 = 0x10000000;\n    iVar1 = sigaction(param_1,(sigaction *)&local_128,(sigaction *)local_9c);\n    if (-1 < iVar1) goto LAB_0009f2ad;\n  }\n  local_9c[0] = (_union_1051)0xffffffff;\nLAB_0009f2ad:\n  if (local_10 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    \n    FUN_000a39d0();\n  }\n  return (_union_1051)local_9c[0].sa_handler;\n}" (type_identifier "_union_1051") (function_declarator "FUN_0009f230(int param_1,_union_1051 param_2)" (identifier "FUN_0009f230") (parameter_list "(int param_1,_union_1051 param_2)" (( "(") (parameter_declaration "int param_1" (primitive_type "int") (identifier "param_1")) (, ",") (parameter_declaration "_union_1051 param_2" (type_identifier "_union_1051") (identifier "param_2")) () ")"))) (compound_statement "{\n  int iVar1;\n  int in_GS_OFFSET;\n  _union_1051 local_128;\n  sigset_t local_124;\n  undefined4 local_a4;\n  _union_1051 local_9c [35];\n  int local_10;\n  undefined4 uStack_c;\n  \n  uStack_c = 0x9f237;\n  local_10 = *(int *)(in_GS_OFFSET + 0x14);\n  local_128 = param_2;\n  iVar1 = sigemptyset(&local_124);\n  if (-1 < iVar1) {\n    local_a4 = 0x10000000;\n    iVar1 = sigaction(param_1,(sigaction *)&local_128,(sigaction *)local_9c);\n    if (-1 < iVar1) goto LAB_0009f2ad;\n  }\n  local_9c[0] = (_union_1051)0xffffffff;\nLAB_0009f2ad:\n  if (local_10 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    \n    FUN_000a39d0();\n  }\n  return (_union_1051)local_9c[0].sa_handler;\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "int in_GS_OFFSET;" (primitive_type "int") (identifier "in_GS_OFFSET") (; ";")) (declaration "_union_1051 local_128;" (type_identifier "_union_1051") (identifier "local_128") (; ";")) (declaration "sigset_t local_124;" (type_identifier "sigset_t") (identifier "local_124") (; ";")) (declaration "undefined4 local_a4;" (type_identifier "undefined4") (identifier "local_a4") (; ";")) (declaration "_union_1051 local_9c [35];" (type_identifier "_union_1051") (array_declarator "local_9c [35]" (identifier "local_9c") ([ "[") (number_literal "35") (] "]")) (; ";")) (declaration "int local_10;" (primitive_type "int") (identifier "local_10") (; ";")) (declaration "undefined4 uStack_c;" (type_identifier "undefined4") (identifier "uStack_c") (; ";")) (expression_statement "uStack_c = 0x9f237;" (assignment_expression "uStack_c = 0x9f237" (identifier "uStack_c") (= "=") (number_literal "0x9f237")) (; ";")) (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 "local_128 = param_2;" (assignment_expression "local_128 = param_2" (identifier "local_128") (= "=") (identifier "param_2")) (; ";")) (expression_statement "iVar1 = sigemptyset(&local_124);" (assignment_expression "iVar1 = sigemptyset(&local_124)" (identifier "iVar1") (= "=") (call_expression "sigemptyset(&local_124)" (identifier "sigemptyset") (argument_list "(&local_124)" (( "(") (pointer_expression "&local_124" (& "&") (identifier "local_124")) () ")")))) (; ";")) (if_statement "if (-1 < iVar1) {\n    local_a4 = 0x10000000;\n    iVar1 = sigaction(param_1,(sigaction *)&local_128,(sigaction *)local_9c);\n    if (-1 < iVar1) goto LAB_0009f2ad;\n  }" (if "if") (parenthesized_expression "(-1 < iVar1)" (( "(") (binary_expression "-1 < iVar1" (number_literal "-1") (< "<") (identifier "iVar1")) () ")")) (compound_statement "{\n    local_a4 = 0x10000000;\n    iVar1 = sigaction(param_1,(sigaction *)&local_128,(sigaction *)local_9c);\n    if (-1 < iVar1) goto LAB_0009f2ad;\n  }" ({ "{") (expression_statement "local_a4 = 0x10000000;" (assignment_expression "local_a4 = 0x10000000" (identifier "local_a4") (= "=") (number_literal "0x10000000")) (; ";")) (expression_statement "iVar1 = sigaction(param_1,(sigaction *)&local_128,(sigaction *)local_9c);" (assignment_expression "iVar1 = sigaction(param_1,(sigaction *)&local_128,(sigaction *)local_9c)" (identifier "iVar1") (= "=") (call_expression "sigaction(param_1,(sigaction *)&local_128,(sigaction *)local_9c)" (identifier "sigaction") (argument_list "(param_1,(sigaction *)&local_128,(sigaction *)local_9c)" (( "(") (identifier "param_1") (, ",") (cast_expression "(sigaction *)&local_128" (( "(") (type_descriptor "sigaction *" (type_identifier "sigaction") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "&local_128" (& "&") (identifier "local_128"))) (, ",") (cast_expression "(sigaction *)local_9c" (( "(") (type_descriptor "sigaction *" (type_identifier "sigaction") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "local_9c")) () ")")))) (; ";")) (if_statement "if (-1 < iVar1) goto LAB_0009f2ad;" (if "if") (parenthesized_expression "(-1 < iVar1)" (( "(") (binary_expression "-1 < iVar1" (number_literal "-1") (< "<") (identifier "iVar1")) () ")")) (goto_statement "goto LAB_0009f2ad;" (goto "goto") (statement_identifier "LAB_0009f2ad") (; ";"))) (} "}"))) (expression_statement "local_9c[0] = (_union_1051)0xffffffff;" (assignment_expression "local_9c[0] = (_union_1051)0xffffffff" (subscript_expression "local_9c[0]" (identifier "local_9c") ([ "[") (number_literal "0") (] "]")) (= "=") (cast_expression "(_union_1051)0xffffffff" (( "(") (type_descriptor "_union_1051" (type_identifier "_union_1051")) () ")") (number_literal "0xffffffff"))) (; ";")) (labeled_statement "LAB_0009f2ad:\n  if (local_10 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    \n    FUN_000a39d0();\n  }" (statement_identifier "LAB_0009f2ad") (: ":") (if_statement "if (local_10 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    \n    FUN_000a39d0();\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                    \n    FUN_000a39d0();\n  }" ({ "{") (expression_statement "FUN_000a39d0();" (call_expression "FUN_000a39d0()" (identifier "FUN_000a39d0") (argument_list "()" (( "(") () ")"))) (; ";")) (} "}")))) (return_statement "return (_union_1051)local_9c[0].sa_handler;" (return "return") (cast_expression "(_union_1051)local_9c[0].sa_handler" (( "(") (type_descriptor "_union_1051" (type_identifier "_union_1051")) () ")") (field_expression "local_9c[0].sa_handler" (subscript_expression "local_9c[0]" (identifier "local_9c") ([ "[") (number_literal "0") (] "]")) (. ".") (field_identifier "sa_handler"))) (; ";")) (} "}")))

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

type_1 * function_1(int sig,type_1 *func)

{
  int var_4;
  int var_3;
  int var_1;
  type_2 sa;
  type_2 old;
  
  var_4 = *(int *)(var_1 + 0x14);
  sa.__sigaction_handler.sa_handler = func;
  var_3 = var_2((type_3 *)&sa.sa_mask);
  if (-1 < var_3) {
    sa.sa_flags = 0x10000000;
    var_3 = type_2(sig,(type_2 *)&sa,(type_2 *)&old);
    if (-1 < var_3) goto LAB_0009f2ad;
  }
  old.__sigaction_handler = (type_4)0xffffffff;
LAB_0009f2ad:
  if (var_4 != *(int *)(var_1 + 0x14)) {
                    /* WARNING: Subroutine does not return */
    var_5();
  }
  return old.__sigaction_handler.sa_handler;
}


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

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

_union_1051 MASKED(int param_1,_union_1051 param_2)

{
  int iVar1;
  int in_GS_OFFSET;
  _union_1051 local_128;
  sigset_t local_124;
  undefined4 local_a4;
  _union_1051 local_9c [35];
  int local_10;
  undefined4 uStack_c;
  
  uStack_c = 0x9f237;
  local_10 = *(int *)(in_GS_OFFSET + 0x14);
  local_128 = param_2;
  iVar1 = sigemptyset(&local_124);
  if (-1 < iVar1) {
    local_a4 = 0x10000000;
    iVar1 = sigaction(param_1,(sigaction *)&local_128,(sigaction *)local_9c);
    if (-1 < iVar1) goto LAB_0009f2ad;
  }
  local_9c[0] = (_union_1051)0xffffffff;
LAB_0009f2ad:
  if (local_10 != *(int *)(in_GS_OFFSET + 0x14)) {
                    /* WARNING: Subroutine does not return */
    FUN_000a39d0();
  }
  return (_union_1051)local_9c[0].sa_handler;
}

