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

int set_job_control(int arg)

{
  int iVar1;
  
  iVar1 = job_control;
  job_control = arg;
  if (terminal_pgrp == -1) {
    terminal_pgrp = tcgetpgrp(shell_tty);
  }
  running_in_background = (uint)(shell_pgrp != terminal_pgrp);
  if ((iVar1 != job_control) && (job_control != 0)) {
    pipeline_pgrp = 0;
    return iVar1;
  }
  return iVar1;
}



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

int set_job_control(int param_1)

{
  int iVar1;
  
  iVar1 = job_control;
  job_control = param_1;
  if (terminal_pgrp == -1) {
    terminal_pgrp = tcgetpgrp(shell_tty);
  }
  running_in_background = (uint)(shell_pgrp != terminal_pgrp);
  if ((iVar1 != job_control) && (job_control != 0)) {
    pipeline_pgrp = 0;
    return iVar1;
  }
  return iVar1;
}


PUSH ESI
PUSH EBX
CALL 0x000312b0
ADD EBX,0x101fc9
SUB ESP,0x4
MOV EDX,dword ptr [ESP + 0x10]
MOV EAX,dword ptr [EBX + 0x7a4]
MOV ESI,dword ptr [EBX + 0x78c]
MOV dword ptr [EBX + 0x78c],EDX
CMP EAX,-0x1
JZ 0x00070098
CMP dword ptr [EBX + 0x7a8],EAX
SETNZ AL
MOVZX EAX,AL
MOV dword ptr [EBX + 0x5ee8],EAX
CMP ESI,EDX
JZ 0x00070075
TEST EDX,EDX
JNZ 0x00070080
ADD ESP,0x4
MOV EAX,ESI
POP EBX
POP ESI
RET
MOV dword ptr [EBX + 0x5ef0],0x0
ADD ESP,0x4
MOV EAX,ESI
POP EBX
POP ESI
RET
SUB ESP,0xc
PUSH dword ptr [EBX + 0x7ac]
CALL 0x0002e8d0
MOV EDX,dword ptr [EBX + 0x78c]
ADD ESP,0x10
MOV dword ptr [EBX + 0x7a4],EAX
JMP 0x0007005b
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nint set_job_control(int param_1)\n\n{\n  int iVar1;\n  \n  iVar1 = job_control;\n  job_control = param_1;\n  if (terminal_pgrp == -1) {\n    terminal_pgrp = tcgetpgrp(shell_tty);\n  }\n  running_in_background = (uint)(shell_pgrp != terminal_pgrp);\n  if ((iVar1 != job_control) && (job_control != 0)) {\n    pipeline_pgrp = 0;\n    return iVar1;\n  }\n  return iVar1;\n}\n\n" comment (function_definition "int set_job_control(int param_1)\n\n{\n  int iVar1;\n  \n  iVar1 = job_control;\n  job_control = param_1;\n  if (terminal_pgrp == -1) {\n    terminal_pgrp = tcgetpgrp(shell_tty);\n  }\n  running_in_background = (uint)(shell_pgrp != terminal_pgrp);\n  if ((iVar1 != job_control) && (job_control != 0)) {\n    pipeline_pgrp = 0;\n    return iVar1;\n  }\n  return iVar1;\n}" primitive_type (function_declarator "set_job_control(int param_1)" identifier (parameter_list "(int param_1)" ( (parameter_declaration "int param_1" primitive_type identifier) ))) (compound_statement "{\n  int iVar1;\n  \n  iVar1 = job_control;\n  job_control = param_1;\n  if (terminal_pgrp == -1) {\n    terminal_pgrp = tcgetpgrp(shell_tty);\n  }\n  running_in_background = (uint)(shell_pgrp != terminal_pgrp);\n  if ((iVar1 != job_control) && (job_control != 0)) {\n    pipeline_pgrp = 0;\n    return iVar1;\n  }\n  return iVar1;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (expression_statement "iVar1 = job_control;" (assignment_expression "iVar1 = job_control" identifier = identifier) ;) (expression_statement "job_control = param_1;" (assignment_expression "job_control = param_1" identifier = identifier) ;) (if_statement "if (terminal_pgrp == -1) {\n    terminal_pgrp = tcgetpgrp(shell_tty);\n  }" if (parenthesized_expression "(terminal_pgrp == -1)" ( (binary_expression "terminal_pgrp == -1" identifier == number_literal) )) (compound_statement "{\n    terminal_pgrp = tcgetpgrp(shell_tty);\n  }" { (expression_statement "terminal_pgrp = tcgetpgrp(shell_tty);" (assignment_expression "terminal_pgrp = tcgetpgrp(shell_tty)" identifier = (call_expression "tcgetpgrp(shell_tty)" identifier (argument_list "(shell_tty)" ( identifier )))) ;) })) (expression_statement "running_in_background = (uint)(shell_pgrp != terminal_pgrp);" (assignment_expression "running_in_background = (uint)(shell_pgrp != terminal_pgrp)" identifier = (call_expression "(uint)(shell_pgrp != terminal_pgrp)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(shell_pgrp != terminal_pgrp)" ( (binary_expression "shell_pgrp != terminal_pgrp" identifier != identifier) )))) ;) (if_statement "if ((iVar1 != job_control) && (job_control != 0)) {\n    pipeline_pgrp = 0;\n    return iVar1;\n  }" if (parenthesized_expression "((iVar1 != job_control) && (job_control != 0))" ( (binary_expression "(iVar1 != job_control) && (job_control != 0)" (parenthesized_expression "(iVar1 != job_control)" ( (binary_expression "iVar1 != job_control" identifier != identifier) )) && (parenthesized_expression "(job_control != 0)" ( (binary_expression "job_control != 0" identifier != number_literal) ))) )) (compound_statement "{\n    pipeline_pgrp = 0;\n    return iVar1;\n  }" { (expression_statement "pipeline_pgrp = 0;" (assignment_expression "pipeline_pgrp = 0" identifier = number_literal) ;) (return_statement "return iVar1;" return identifier ;) })) (return_statement "return iVar1;" return identifier ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* WARNING: Unknown calling convention */\n\nint set_job_control(int arg)\n\n{\n  int iVar1;\n  \n  iVar1 = job_control;\n  job_control = arg;\n  if (terminal_pgrp == -1) {\n    terminal_pgrp = tcgetpgrp(shell_tty);\n  }\n  running_in_background = (uint)(shell_pgrp != terminal_pgrp);\n  if ((iVar1 != job_control) && (job_control != 0)) {\n    pipeline_pgrp = 0;\n    return iVar1;\n  }\n  return iVar1;\n}\n\n" comment comment (function_definition "int set_job_control(int arg)\n\n{\n  int iVar1;\n  \n  iVar1 = job_control;\n  job_control = arg;\n  if (terminal_pgrp == -1) {\n    terminal_pgrp = tcgetpgrp(shell_tty);\n  }\n  running_in_background = (uint)(shell_pgrp != terminal_pgrp);\n  if ((iVar1 != job_control) && (job_control != 0)) {\n    pipeline_pgrp = 0;\n    return iVar1;\n  }\n  return iVar1;\n}" primitive_type (function_declarator "set_job_control(int arg)" identifier (parameter_list "(int arg)" ( (parameter_declaration "int arg" primitive_type identifier) ))) (compound_statement "{\n  int iVar1;\n  \n  iVar1 = job_control;\n  job_control = arg;\n  if (terminal_pgrp == -1) {\n    terminal_pgrp = tcgetpgrp(shell_tty);\n  }\n  running_in_background = (uint)(shell_pgrp != terminal_pgrp);\n  if ((iVar1 != job_control) && (job_control != 0)) {\n    pipeline_pgrp = 0;\n    return iVar1;\n  }\n  return iVar1;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (expression_statement "iVar1 = job_control;" (assignment_expression "iVar1 = job_control" identifier = identifier) ;) (expression_statement "job_control = arg;" (assignment_expression "job_control = arg" identifier = identifier) ;) (if_statement "if (terminal_pgrp == -1) {\n    terminal_pgrp = tcgetpgrp(shell_tty);\n  }" if (parenthesized_expression "(terminal_pgrp == -1)" ( (binary_expression "terminal_pgrp == -1" identifier == number_literal) )) (compound_statement "{\n    terminal_pgrp = tcgetpgrp(shell_tty);\n  }" { (expression_statement "terminal_pgrp = tcgetpgrp(shell_tty);" (assignment_expression "terminal_pgrp = tcgetpgrp(shell_tty)" identifier = (call_expression "tcgetpgrp(shell_tty)" identifier (argument_list "(shell_tty)" ( identifier )))) ;) })) (expression_statement "running_in_background = (uint)(shell_pgrp != terminal_pgrp);" (assignment_expression "running_in_background = (uint)(shell_pgrp != terminal_pgrp)" identifier = (call_expression "(uint)(shell_pgrp != terminal_pgrp)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(shell_pgrp != terminal_pgrp)" ( (binary_expression "shell_pgrp != terminal_pgrp" identifier != identifier) )))) ;) (if_statement "if ((iVar1 != job_control) && (job_control != 0)) {\n    pipeline_pgrp = 0;\n    return iVar1;\n  }" if (parenthesized_expression "((iVar1 != job_control) && (job_control != 0))" ( (binary_expression "(iVar1 != job_control) && (job_control != 0)" (parenthesized_expression "(iVar1 != job_control)" ( (binary_expression "iVar1 != job_control" identifier != identifier) )) && (parenthesized_expression "(job_control != 0)" ( (binary_expression "job_control != 0" identifier != number_literal) ))) )) (compound_statement "{\n    pipeline_pgrp = 0;\n    return iVar1;\n  }" { (expression_statement "pipeline_pgrp = 0;" (assignment_expression "pipeline_pgrp = 0" identifier = number_literal) ;) (return_statement "return iVar1;" return identifier ;) })) (return_statement "return iVar1;" return identifier ;) })))
(translation_unit "int set_job_control(int param_1)\n\n{\n  int iVar1;\n  \n  iVar1 = job_control;\n  job_control = param_1;\n  if (terminal_pgrp == -1) {\n    terminal_pgrp = tcgetpgrp(shell_tty);\n  }\n  running_in_background = (uint)(shell_pgrp != terminal_pgrp);\n  if ((iVar1 != job_control) && (job_control != 0)) {\n    pipeline_pgrp = 0;\n    return iVar1;\n  }\n  return iVar1;\n}\n\n" (function_definition "int set_job_control(int param_1)\n\n{\n  int iVar1;\n  \n  iVar1 = job_control;\n  job_control = param_1;\n  if (terminal_pgrp == -1) {\n    terminal_pgrp = tcgetpgrp(shell_tty);\n  }\n  running_in_background = (uint)(shell_pgrp != terminal_pgrp);\n  if ((iVar1 != job_control) && (job_control != 0)) {\n    pipeline_pgrp = 0;\n    return iVar1;\n  }\n  return iVar1;\n}" primitive_type (function_declarator "set_job_control(int param_1)" identifier (parameter_list "(int param_1)" ( (parameter_declaration "int param_1" primitive_type identifier) ))) (compound_statement "{\n  int iVar1;\n  \n  iVar1 = job_control;\n  job_control = param_1;\n  if (terminal_pgrp == -1) {\n    terminal_pgrp = tcgetpgrp(shell_tty);\n  }\n  running_in_background = (uint)(shell_pgrp != terminal_pgrp);\n  if ((iVar1 != job_control) && (job_control != 0)) {\n    pipeline_pgrp = 0;\n    return iVar1;\n  }\n  return iVar1;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (expression_statement "iVar1 = job_control;" (assignment_expression "iVar1 = job_control" identifier = identifier) ;) (expression_statement "job_control = param_1;" (assignment_expression "job_control = param_1" identifier = identifier) ;) (if_statement "if (terminal_pgrp == -1) {\n    terminal_pgrp = tcgetpgrp(shell_tty);\n  }" if (parenthesized_expression "(terminal_pgrp == -1)" ( (binary_expression "terminal_pgrp == -1" identifier == number_literal) )) (compound_statement "{\n    terminal_pgrp = tcgetpgrp(shell_tty);\n  }" { (expression_statement "terminal_pgrp = tcgetpgrp(shell_tty);" (assignment_expression "terminal_pgrp = tcgetpgrp(shell_tty)" identifier = (call_expression "tcgetpgrp(shell_tty)" identifier (argument_list "(shell_tty)" ( identifier )))) ;) })) (expression_statement "running_in_background = (uint)(shell_pgrp != terminal_pgrp);" (assignment_expression "running_in_background = (uint)(shell_pgrp != terminal_pgrp)" identifier = (call_expression "(uint)(shell_pgrp != terminal_pgrp)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(shell_pgrp != terminal_pgrp)" ( (binary_expression "shell_pgrp != terminal_pgrp" identifier != identifier) )))) ;) (if_statement "if ((iVar1 != job_control) && (job_control != 0)) {\n    pipeline_pgrp = 0;\n    return iVar1;\n  }" if (parenthesized_expression "((iVar1 != job_control) && (job_control != 0))" ( (binary_expression "(iVar1 != job_control) && (job_control != 0)" (parenthesized_expression "(iVar1 != job_control)" ( (binary_expression "iVar1 != job_control" identifier != identifier) )) && (parenthesized_expression "(job_control != 0)" ( (binary_expression "job_control != 0" identifier != number_literal) ))) )) (compound_statement "{\n    pipeline_pgrp = 0;\n    return iVar1;\n  }" { (expression_statement "pipeline_pgrp = 0;" (assignment_expression "pipeline_pgrp = 0" identifier = number_literal) ;) (return_statement "return iVar1;" return identifier ;) })) (return_statement "return iVar1;" return identifier ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) })) (expression_statement (assignment_expression IDENT = (call_expression (parenthesized_expression ( IDENT )) (argument_list ( (binary_expression IDENT != IDENT) )))) ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT != IDENT) )) && (parenthesized_expression ( (binary_expression IDENT != LIT) ))) )) (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) (return_statement return IDENT ;) })) (return_statement return IDENT ;) })))
(function_definition "int set_job_control(int param_1)\n\n{\n  int iVar1;\n  \n  iVar1 = job_control;\n  job_control = param_1;\n  if (terminal_pgrp == -1) {\n    terminal_pgrp = tcgetpgrp(shell_tty);\n  }\n  running_in_background = (uint)(shell_pgrp != terminal_pgrp);\n  if ((iVar1 != job_control) && (job_control != 0)) {\n    pipeline_pgrp = 0;\n    return iVar1;\n  }\n  return iVar1;\n}" (primitive_type "int") (function_declarator "set_job_control(int param_1)" (identifier "set_job_control") (parameter_list "(int param_1)" (( "(") (parameter_declaration "int param_1" (primitive_type "int") (identifier "param_1")) () ")"))) (compound_statement "{\n  int iVar1;\n  \n  iVar1 = job_control;\n  job_control = param_1;\n  if (terminal_pgrp == -1) {\n    terminal_pgrp = tcgetpgrp(shell_tty);\n  }\n  running_in_background = (uint)(shell_pgrp != terminal_pgrp);\n  if ((iVar1 != job_control) && (job_control != 0)) {\n    pipeline_pgrp = 0;\n    return iVar1;\n  }\n  return iVar1;\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (expression_statement "iVar1 = job_control;" (assignment_expression "iVar1 = job_control" (identifier "iVar1") (= "=") (identifier "job_control")) (; ";")) (expression_statement "job_control = param_1;" (assignment_expression "job_control = param_1" (identifier "job_control") (= "=") (identifier "param_1")) (; ";")) (if_statement "if (terminal_pgrp == -1) {\n    terminal_pgrp = tcgetpgrp(shell_tty);\n  }" (if "if") (parenthesized_expression "(terminal_pgrp == -1)" (( "(") (binary_expression "terminal_pgrp == -1" (identifier "terminal_pgrp") (== "==") (number_literal "-1")) () ")")) (compound_statement "{\n    terminal_pgrp = tcgetpgrp(shell_tty);\n  }" ({ "{") (expression_statement "terminal_pgrp = tcgetpgrp(shell_tty);" (assignment_expression "terminal_pgrp = tcgetpgrp(shell_tty)" (identifier "terminal_pgrp") (= "=") (call_expression "tcgetpgrp(shell_tty)" (identifier "tcgetpgrp") (argument_list "(shell_tty)" (( "(") (identifier "shell_tty") () ")")))) (; ";")) (} "}"))) (expression_statement "running_in_background = (uint)(shell_pgrp != terminal_pgrp);" (assignment_expression "running_in_background = (uint)(shell_pgrp != terminal_pgrp)" (identifier "running_in_background") (= "=") (call_expression "(uint)(shell_pgrp != terminal_pgrp)" (parenthesized_expression "(uint)" (( "(") (identifier "uint") () ")")) (argument_list "(shell_pgrp != terminal_pgrp)" (( "(") (binary_expression "shell_pgrp != terminal_pgrp" (identifier "shell_pgrp") (!= "!=") (identifier "terminal_pgrp")) () ")")))) (; ";")) (if_statement "if ((iVar1 != job_control) && (job_control != 0)) {\n    pipeline_pgrp = 0;\n    return iVar1;\n  }" (if "if") (parenthesized_expression "((iVar1 != job_control) && (job_control != 0))" (( "(") (binary_expression "(iVar1 != job_control) && (job_control != 0)" (parenthesized_expression "(iVar1 != job_control)" (( "(") (binary_expression "iVar1 != job_control" (identifier "iVar1") (!= "!=") (identifier "job_control")) () ")")) (&& "&&") (parenthesized_expression "(job_control != 0)" (( "(") (binary_expression "job_control != 0" (identifier "job_control") (!= "!=") (number_literal "0")) () ")"))) () ")")) (compound_statement "{\n    pipeline_pgrp = 0;\n    return iVar1;\n  }" ({ "{") (expression_statement "pipeline_pgrp = 0;" (assignment_expression "pipeline_pgrp = 0" (identifier "pipeline_pgrp") (= "=") (number_literal "0")) (; ";")) (return_statement "return iVar1;" (return "return") (identifier "iVar1") (; ";")) (} "}"))) (return_statement "return iVar1;" (return "return") (identifier "iVar1") (; ";")) (} "}")))

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

int function_1(int arg)

{
  int var_4;
  
  var_4 = var_5;
  var_5 = arg;
  if (var_1 == -1) {
    var_1 = var_2(shell_tty);
  }
  running_in_background = (uint)(var_3 != var_1);
  if ((var_4 != var_5) && (var_5 != 0)) {
    pipeline_pgrp = 0;
    return var_4;
  }
  return var_4;
}


(translation_unit (function_definition type: (primitive_type) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (primitive_type) declarator: (identifier)))) body: (compound_statement (declaration type: (primitive_type) declarator: (identifier)) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (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 (identifier))))))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (parenthesized_expression (identifier)) arguments: (argument_list (binary_expression left: (identifier) right: (identifier)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) right: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (return_statement (identifier)))) (return_statement (identifier)))))

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

int MASKED(int param_1)

{
  int iVar1;
  
  iVar1 = job_control;
  job_control = param_1;
  if (terminal_pgrp == -1) {
    terminal_pgrp = tcgetpgrp(shell_tty);
  }
  running_in_background = (uint)(shell_pgrp != terminal_pgrp);
  if ((iVar1 != job_control) && (job_control != 0)) {
    pipeline_pgrp = 0;
    return iVar1;
  }
  return iVar1;
}

