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

int device_open(char *device,int mode)

{
}



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

int __regparm3 FUN_000a6314(char *param_1,uint param_2)

{
  int iVar1;
  int unaff_ESI;
  
  iVar1 = 5;
  do {
    unaff_ESI = open64(param_1,param_2 | 0x800,0x180,unaff_ESI);
    if (-1 < unaff_ESI) {
      if (param_2 != (param_2 | 0x800)) {
        fcntl64(unaff_ESI,4,param_2,unaff_ESI);
      }
      return unaff_ESI;
    }
    iVar1 = iVar1 + -1;
  } while (iVar1 != 0);
  return unaff_ESI;
}


PUSH EBP
PUSH EDI
PUSH ESI
PUSH EBX
SUB ESP,0x1c
CALL 0x00017640
ADD EBX,0x2a700
MOV ECX,EAX
MOV EDI,EDX
OR DH,0x8
MOV EBP,0x5
PUSH ESI
PUSH 0x180
PUSH EDX
MOV dword ptr [ESP + 0x18],EDX
PUSH ECX
MOV dword ptr [ESP + 0x18],ECX
CALL 0x00016170
MOV ESI,EAX
ADD ESP,0x10
TEST EAX,EAX
MOV EDX,dword ptr [ESP + 0xc]
JS 0x000a636f
CMP EDI,EDX
JZ 0x000a6365
PUSH EAX
PUSH EDI
PUSH 0x4
PUSH ESI
CALL 0x00016ff0
ADD ESP,0x10
MOV EAX,ESI
ADD ESP,0x1c
POP EBX
POP ESI
POP EDI
POP EBP
RET
DEC EBP
MOV ECX,dword ptr [ESP + 0x8]
JNZ 0x000a6332
MOV EAX,ESI
ADD ESP,0x1c
POP EBX
POP ESI
POP EDI
POP EBP
RET
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nint __regparm3 FUN_000a6314(char *param_1,uint param_2)\n\n{\n  int iVar1;\n  int unaff_ESI;\n  \n  iVar1 = 5;\n  do {\n    unaff_ESI = open64(param_1,param_2 | 0x800,0x180,unaff_ESI);\n    if (-1 < unaff_ESI) {\n      if (param_2 != (param_2 | 0x800)) {\n        fcntl64(unaff_ESI,4,param_2,unaff_ESI);\n      }\n      return unaff_ESI;\n    }\n    iVar1 = iVar1 + -1;\n  } while (iVar1 != 0);\n  return unaff_ESI;\n}\n\n" comment (function_definition "int __regparm3 FUN_000a6314(char *param_1,uint param_2)\n\n{\n  int iVar1;\n  int unaff_ESI;\n  \n  iVar1 = 5;\n  do {\n    unaff_ESI = open64(param_1,param_2 | 0x800,0x180,unaff_ESI);\n    if (-1 < unaff_ESI) {\n      if (param_2 != (param_2 | 0x800)) {\n        fcntl64(unaff_ESI,4,param_2,unaff_ESI);\n      }\n      return unaff_ESI;\n    }\n    iVar1 = iVar1 + -1;\n  } while (iVar1 != 0);\n  return unaff_ESI;\n}" primitive_type (ERROR "__regparm3" identifier) (function_declarator "FUN_000a6314(char *param_1,uint param_2)" identifier (parameter_list "(char *param_1,uint param_2)" ( (parameter_declaration "char *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "uint param_2" type_identifier identifier) ))) (compound_statement "{\n  int iVar1;\n  int unaff_ESI;\n  \n  iVar1 = 5;\n  do {\n    unaff_ESI = open64(param_1,param_2 | 0x800,0x180,unaff_ESI);\n    if (-1 < unaff_ESI) {\n      if (param_2 != (param_2 | 0x800)) {\n        fcntl64(unaff_ESI,4,param_2,unaff_ESI);\n      }\n      return unaff_ESI;\n    }\n    iVar1 = iVar1 + -1;\n  } while (iVar1 != 0);\n  return unaff_ESI;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int unaff_ESI;" primitive_type identifier ;) (expression_statement "iVar1 = 5;" (assignment_expression "iVar1 = 5" identifier = number_literal) ;) (do_statement "do {\n    unaff_ESI = open64(param_1,param_2 | 0x800,0x180,unaff_ESI);\n    if (-1 < unaff_ESI) {\n      if (param_2 != (param_2 | 0x800)) {\n        fcntl64(unaff_ESI,4,param_2,unaff_ESI);\n      }\n      return unaff_ESI;\n    }\n    iVar1 = iVar1 + -1;\n  } while (iVar1 != 0);" do (compound_statement "{\n    unaff_ESI = open64(param_1,param_2 | 0x800,0x180,unaff_ESI);\n    if (-1 < unaff_ESI) {\n      if (param_2 != (param_2 | 0x800)) {\n        fcntl64(unaff_ESI,4,param_2,unaff_ESI);\n      }\n      return unaff_ESI;\n    }\n    iVar1 = iVar1 + -1;\n  }" { (expression_statement "unaff_ESI = open64(param_1,param_2 | 0x800,0x180,unaff_ESI);" (assignment_expression "unaff_ESI = open64(param_1,param_2 | 0x800,0x180,unaff_ESI)" identifier = (call_expression "open64(param_1,param_2 | 0x800,0x180,unaff_ESI)" identifier (argument_list "(param_1,param_2 | 0x800,0x180,unaff_ESI)" ( identifier , (binary_expression "param_2 | 0x800" identifier | number_literal) , number_literal , identifier )))) ;) (if_statement "if (-1 < unaff_ESI) {\n      if (param_2 != (param_2 | 0x800)) {\n        fcntl64(unaff_ESI,4,param_2,unaff_ESI);\n      }\n      return unaff_ESI;\n    }" if (parenthesized_expression "(-1 < unaff_ESI)" ( (binary_expression "-1 < unaff_ESI" number_literal < identifier) )) (compound_statement "{\n      if (param_2 != (param_2 | 0x800)) {\n        fcntl64(unaff_ESI,4,param_2,unaff_ESI);\n      }\n      return unaff_ESI;\n    }" { (if_statement "if (param_2 != (param_2 | 0x800)) {\n        fcntl64(unaff_ESI,4,param_2,unaff_ESI);\n      }" if (parenthesized_expression "(param_2 != (param_2 | 0x800))" ( (binary_expression "param_2 != (param_2 | 0x800)" identifier != (parenthesized_expression "(param_2 | 0x800)" ( (binary_expression "param_2 | 0x800" identifier | number_literal) ))) )) (compound_statement "{\n        fcntl64(unaff_ESI,4,param_2,unaff_ESI);\n      }" { (expression_statement "fcntl64(unaff_ESI,4,param_2,unaff_ESI);" (call_expression "fcntl64(unaff_ESI,4,param_2,unaff_ESI)" identifier (argument_list "(unaff_ESI,4,param_2,unaff_ESI)" ( identifier , number_literal , identifier , identifier ))) ;) })) (return_statement "return unaff_ESI;" return identifier ;) })) (expression_statement "iVar1 = iVar1 + -1;" (assignment_expression "iVar1 = iVar1 + -1" identifier = (binary_expression "iVar1 + -1" identifier + number_literal)) ;) }) while (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) ;) (return_statement "return unaff_ESI;" return identifier ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nint device_open(char *device,int mode)\n\n{\n}\n\n" comment (function_definition "int device_open(char *device,int mode)\n\n{\n}" primitive_type (function_declarator "device_open(char *device,int mode)" identifier (parameter_list "(char *device,int mode)" ( (parameter_declaration "char *device" primitive_type (pointer_declarator "*device" * identifier)) , (parameter_declaration "int mode" primitive_type identifier) ))) (compound_statement "{\n}" { })))
(translation_unit "int __regparm3 FUN_000a6314(char *param_1,uint param_2)\n\n{\n  int iVar1;\n  int unaff_ESI;\n  \n  iVar1 = 5;\n  do {\n    unaff_ESI = open64(param_1,param_2 | 0x800,0x180,unaff_ESI);\n    if (-1 < unaff_ESI) {\n      if (param_2 != (param_2 | 0x800)) {\n        fcntl64(unaff_ESI,4,param_2,unaff_ESI);\n      }\n      return unaff_ESI;\n    }\n    iVar1 = iVar1 + -1;\n  } while (iVar1 != 0);\n  return unaff_ESI;\n}\n\n" (function_definition "int __regparm3 FUN_000a6314(char *param_1,uint param_2)\n\n{\n  int iVar1;\n  int unaff_ESI;\n  \n  iVar1 = 5;\n  do {\n    unaff_ESI = open64(param_1,param_2 | 0x800,0x180,unaff_ESI);\n    if (-1 < unaff_ESI) {\n      if (param_2 != (param_2 | 0x800)) {\n        fcntl64(unaff_ESI,4,param_2,unaff_ESI);\n      }\n      return unaff_ESI;\n    }\n    iVar1 = iVar1 + -1;\n  } while (iVar1 != 0);\n  return unaff_ESI;\n}" primitive_type (ERROR "__regparm3" identifier) (function_declarator "FUN_000a6314(char *param_1,uint param_2)" identifier (parameter_list "(char *param_1,uint param_2)" ( (parameter_declaration "char *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "uint param_2" type_identifier identifier) ))) (compound_statement "{\n  int iVar1;\n  int unaff_ESI;\n  \n  iVar1 = 5;\n  do {\n    unaff_ESI = open64(param_1,param_2 | 0x800,0x180,unaff_ESI);\n    if (-1 < unaff_ESI) {\n      if (param_2 != (param_2 | 0x800)) {\n        fcntl64(unaff_ESI,4,param_2,unaff_ESI);\n      }\n      return unaff_ESI;\n    }\n    iVar1 = iVar1 + -1;\n  } while (iVar1 != 0);\n  return unaff_ESI;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int unaff_ESI;" primitive_type identifier ;) (expression_statement "iVar1 = 5;" (assignment_expression "iVar1 = 5" identifier = number_literal) ;) (do_statement "do {\n    unaff_ESI = open64(param_1,param_2 | 0x800,0x180,unaff_ESI);\n    if (-1 < unaff_ESI) {\n      if (param_2 != (param_2 | 0x800)) {\n        fcntl64(unaff_ESI,4,param_2,unaff_ESI);\n      }\n      return unaff_ESI;\n    }\n    iVar1 = iVar1 + -1;\n  } while (iVar1 != 0);" do (compound_statement "{\n    unaff_ESI = open64(param_1,param_2 | 0x800,0x180,unaff_ESI);\n    if (-1 < unaff_ESI) {\n      if (param_2 != (param_2 | 0x800)) {\n        fcntl64(unaff_ESI,4,param_2,unaff_ESI);\n      }\n      return unaff_ESI;\n    }\n    iVar1 = iVar1 + -1;\n  }" { (expression_statement "unaff_ESI = open64(param_1,param_2 | 0x800,0x180,unaff_ESI);" (assignment_expression "unaff_ESI = open64(param_1,param_2 | 0x800,0x180,unaff_ESI)" identifier = (call_expression "open64(param_1,param_2 | 0x800,0x180,unaff_ESI)" identifier (argument_list "(param_1,param_2 | 0x800,0x180,unaff_ESI)" ( identifier , (binary_expression "param_2 | 0x800" identifier | number_literal) , number_literal , identifier )))) ;) (if_statement "if (-1 < unaff_ESI) {\n      if (param_2 != (param_2 | 0x800)) {\n        fcntl64(unaff_ESI,4,param_2,unaff_ESI);\n      }\n      return unaff_ESI;\n    }" if (parenthesized_expression "(-1 < unaff_ESI)" ( (binary_expression "-1 < unaff_ESI" number_literal < identifier) )) (compound_statement "{\n      if (param_2 != (param_2 | 0x800)) {\n        fcntl64(unaff_ESI,4,param_2,unaff_ESI);\n      }\n      return unaff_ESI;\n    }" { (if_statement "if (param_2 != (param_2 | 0x800)) {\n        fcntl64(unaff_ESI,4,param_2,unaff_ESI);\n      }" if (parenthesized_expression "(param_2 != (param_2 | 0x800))" ( (binary_expression "param_2 != (param_2 | 0x800)" identifier != (parenthesized_expression "(param_2 | 0x800)" ( (binary_expression "param_2 | 0x800" identifier | number_literal) ))) )) (compound_statement "{\n        fcntl64(unaff_ESI,4,param_2,unaff_ESI);\n      }" { (expression_statement "fcntl64(unaff_ESI,4,param_2,unaff_ESI);" (call_expression "fcntl64(unaff_ESI,4,param_2,unaff_ESI)" identifier (argument_list "(unaff_ESI,4,param_2,unaff_ESI)" ( identifier , number_literal , identifier , identifier ))) ;) })) (return_statement "return unaff_ESI;" return identifier ;) })) (expression_statement "iVar1 = iVar1 + -1;" (assignment_expression "iVar1 = iVar1 + -1" identifier = (binary_expression "iVar1 + -1" identifier + number_literal)) ;) }) while (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) ;) (return_statement "return unaff_ESI;" return identifier ;) })))
(translation_unit (function_definition TYPE (ERROR IDENT) (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = LIT) ;) (do_statement do (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , (binary_expression IDENT | LIT) , LIT , IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression LIT < IDENT) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression IDENT != (parenthesized_expression ( (binary_expression IDENT | LIT) ))) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT , LIT , IDENT , IDENT ))) ;) })) (return_statement return IDENT ;) })) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) }) while (parenthesized_expression ( (binary_expression IDENT != LIT) )) ;) (return_statement return IDENT ;) })))
(function_definition "int __regparm3 FUN_000a6314(char *param_1,uint param_2)\n\n{\n  int iVar1;\n  int unaff_ESI;\n  \n  iVar1 = 5;\n  do {\n    unaff_ESI = open64(param_1,param_2 | 0x800,0x180,unaff_ESI);\n    if (-1 < unaff_ESI) {\n      if (param_2 != (param_2 | 0x800)) {\n        fcntl64(unaff_ESI,4,param_2,unaff_ESI);\n      }\n      return unaff_ESI;\n    }\n    iVar1 = iVar1 + -1;\n  } while (iVar1 != 0);\n  return unaff_ESI;\n}" (primitive_type "int") (ERROR "__regparm3" (identifier "__regparm3")) (function_declarator "FUN_000a6314(char *param_1,uint param_2)" (identifier "FUN_000a6314") (parameter_list "(char *param_1,uint param_2)" (( "(") (parameter_declaration "char *param_1" (primitive_type "char") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "uint param_2" (type_identifier "uint") (identifier "param_2")) () ")"))) (compound_statement "{\n  int iVar1;\n  int unaff_ESI;\n  \n  iVar1 = 5;\n  do {\n    unaff_ESI = open64(param_1,param_2 | 0x800,0x180,unaff_ESI);\n    if (-1 < unaff_ESI) {\n      if (param_2 != (param_2 | 0x800)) {\n        fcntl64(unaff_ESI,4,param_2,unaff_ESI);\n      }\n      return unaff_ESI;\n    }\n    iVar1 = iVar1 + -1;\n  } while (iVar1 != 0);\n  return unaff_ESI;\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "int unaff_ESI;" (primitive_type "int") (identifier "unaff_ESI") (; ";")) (expression_statement "iVar1 = 5;" (assignment_expression "iVar1 = 5" (identifier "iVar1") (= "=") (number_literal "5")) (; ";")) (do_statement "do {\n    unaff_ESI = open64(param_1,param_2 | 0x800,0x180,unaff_ESI);\n    if (-1 < unaff_ESI) {\n      if (param_2 != (param_2 | 0x800)) {\n        fcntl64(unaff_ESI,4,param_2,unaff_ESI);\n      }\n      return unaff_ESI;\n    }\n    iVar1 = iVar1 + -1;\n  } while (iVar1 != 0);" (do "do") (compound_statement "{\n    unaff_ESI = open64(param_1,param_2 | 0x800,0x180,unaff_ESI);\n    if (-1 < unaff_ESI) {\n      if (param_2 != (param_2 | 0x800)) {\n        fcntl64(unaff_ESI,4,param_2,unaff_ESI);\n      }\n      return unaff_ESI;\n    }\n    iVar1 = iVar1 + -1;\n  }" ({ "{") (expression_statement "unaff_ESI = open64(param_1,param_2 | 0x800,0x180,unaff_ESI);" (assignment_expression "unaff_ESI = open64(param_1,param_2 | 0x800,0x180,unaff_ESI)" (identifier "unaff_ESI") (= "=") (call_expression "open64(param_1,param_2 | 0x800,0x180,unaff_ESI)" (identifier "open64") (argument_list "(param_1,param_2 | 0x800,0x180,unaff_ESI)" (( "(") (identifier "param_1") (, ",") (binary_expression "param_2 | 0x800" (identifier "param_2") (| "|") (number_literal "0x800")) (, ",") (number_literal "0x180") (, ",") (identifier "unaff_ESI") () ")")))) (; ";")) (if_statement "if (-1 < unaff_ESI) {\n      if (param_2 != (param_2 | 0x800)) {\n        fcntl64(unaff_ESI,4,param_2,unaff_ESI);\n      }\n      return unaff_ESI;\n    }" (if "if") (parenthesized_expression "(-1 < unaff_ESI)" (( "(") (binary_expression "-1 < unaff_ESI" (number_literal "-1") (< "<") (identifier "unaff_ESI")) () ")")) (compound_statement "{\n      if (param_2 != (param_2 | 0x800)) {\n        fcntl64(unaff_ESI,4,param_2,unaff_ESI);\n      }\n      return unaff_ESI;\n    }" ({ "{") (if_statement "if (param_2 != (param_2 | 0x800)) {\n        fcntl64(unaff_ESI,4,param_2,unaff_ESI);\n      }" (if "if") (parenthesized_expression "(param_2 != (param_2 | 0x800))" (( "(") (binary_expression "param_2 != (param_2 | 0x800)" (identifier "param_2") (!= "!=") (parenthesized_expression "(param_2 | 0x800)" (( "(") (binary_expression "param_2 | 0x800" (identifier "param_2") (| "|") (number_literal "0x800")) () ")"))) () ")")) (compound_statement "{\n        fcntl64(unaff_ESI,4,param_2,unaff_ESI);\n      }" ({ "{") (expression_statement "fcntl64(unaff_ESI,4,param_2,unaff_ESI);" (call_expression "fcntl64(unaff_ESI,4,param_2,unaff_ESI)" (identifier "fcntl64") (argument_list "(unaff_ESI,4,param_2,unaff_ESI)" (( "(") (identifier "unaff_ESI") (, ",") (number_literal "4") (, ",") (identifier "param_2") (, ",") (identifier "unaff_ESI") () ")"))) (; ";")) (} "}"))) (return_statement "return unaff_ESI;" (return "return") (identifier "unaff_ESI") (; ";")) (} "}"))) (expression_statement "iVar1 = iVar1 + -1;" (assignment_expression "iVar1 = iVar1 + -1" (identifier "iVar1") (= "=") (binary_expression "iVar1 + -1" (identifier "iVar1") (+ "+") (number_literal "-1"))) (; ";")) (} "}")) (while "while") (parenthesized_expression "(iVar1 != 0)" (( "(") (binary_expression "iVar1 != 0" (identifier "iVar1") (!= "!=") (number_literal "0")) () ")")) (; ";")) (return_statement "return unaff_ESI;" (return "return") (identifier "unaff_ESI") (; ";")) (} "}")))

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

int function_1(char *device,int mode)

{
}


(translation_unit (function_definition type: (primitive_type) (ERROR (identifier)) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (parameter_declaration type: (type_identifier) declarator: (identifier)))) body: (compound_statement (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (do_statement body: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (binary_expression left: (identifier) right: (number_literal)) (number_literal) (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (number_literal) right: (identifier))) consequence: (compound_statement (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))) consequence: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier) (number_literal) (identifier) (identifier)))))) (return_statement (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal))))) condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal)))) (return_statement (identifier)))))

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

int __regparm3 MASKED(char *param_1,uint param_2)

{
  int iVar1;
  int unaff_ESI;
  
  iVar1 = 5;
  do {
    unaff_ESI = open64(param_1,param_2 | 0x800,0x180,unaff_ESI);
    if (-1 < unaff_ESI) {
      if (param_2 != (param_2 | 0x800)) {
        fcntl64(unaff_ESI,4,param_2,unaff_ESI);
      }
      return unaff_ESI;
    }
    iVar1 = iVar1 + -1;
  } while (iVar1 != 0);
  return unaff_ESI;
}

