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

libusb_error uhd_iface_attach(uhd_iface *iface)

{
  libusb_error lVar1;
  
  lVar1 = LIBUSB_SUCCESS;
  if (iface->detached != false) {
    lVar1 = libusb_attach_kernel_driver(iface->dev->handle,iface->number);
    if (lVar1 == LIBUSB_SUCCESS) {
      iface->detached = false;
      return LIBUSB_SUCCESS;
    }
  }
  return lVar1;
}



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

int FUN_00013680(int param_1)

{
  int iVar1;
  
  iVar1 = 0;
  if (*(char *)(param_1 + 0x1a) != '\0') {
    iVar1 = libusb_attach_kernel_driver
                      (*(undefined4 *)(*(int *)(param_1 + 4) + 4),*(undefined1 *)(param_1 + 8));
    if (iVar1 == 0) {
      *(undefined1 *)(param_1 + 0x1a) = 0;
      return 0;
    }
  }
  return iVar1;
}


PUSH ESI
XOR EAX,EAX
PUSH EBX
CALL 0x00012480
ADD EBX,0x3977
SUB ESP,0x4
MOV ESI,dword ptr [ESP + 0x10]
CMP byte ptr [ESI + 0x1a],0x0
JNZ 0x000136a8
ADD ESP,0x4
POP EBX
POP ESI
RET
MOVZX EAX,byte ptr [ESI + 0x8]
SUB ESP,0x8
PUSH EAX
MOV EAX,dword ptr [ESI + 0x4]
PUSH dword ptr [EAX + 0x4]
CALL 0x00011190
ADD ESP,0x10
TEST EAX,EAX
JNZ 0x0001369c
MOV byte ptr [ESI + 0x1a],0x0
ADD ESP,0x4
POP EBX
POP ESI
RET
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nint FUN_00013680(int param_1)\n\n{\n  int iVar1;\n  \n  iVar1 = 0;\n  if (*(char *)(param_1 + 0x1a) != '\0') {\n    iVar1 = libusb_attach_kernel_driver\n                      (*(undefined4 *)(*(int *)(param_1 + 4) + 4),*(undefined1 *)(param_1 + 8));\n    if (iVar1 == 0) {\n      *(undefined1 *)(param_1 + 0x1a) = 0;\n      return 0;\n    }\n  }\n  return iVar1;\n}\n\n" comment (function_definition "int FUN_00013680(int param_1)\n\n{\n  int iVar1;\n  \n  iVar1 = 0;\n  if (*(char *)(param_1 + 0x1a) != '\0') {\n    iVar1 = libusb_attach_kernel_driver\n                      (*(undefined4 *)(*(int *)(param_1 + 4) + 4),*(undefined1 *)(param_1 + 8));\n    if (iVar1 == 0) {\n      *(undefined1 *)(param_1 + 0x1a) = 0;\n      return 0;\n    }\n  }\n  return iVar1;\n}" primitive_type (function_declarator "FUN_00013680(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 = 0;\n  if (*(char *)(param_1 + 0x1a) != '\0') {\n    iVar1 = libusb_attach_kernel_driver\n                      (*(undefined4 *)(*(int *)(param_1 + 4) + 4),*(undefined1 *)(param_1 + 8));\n    if (iVar1 == 0) {\n      *(undefined1 *)(param_1 + 0x1a) = 0;\n      return 0;\n    }\n  }\n  return iVar1;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (expression_statement "iVar1 = 0;" (assignment_expression "iVar1 = 0" identifier = number_literal) ;) (if_statement "if (*(char *)(param_1 + 0x1a) != '\0') {\n    iVar1 = libusb_attach_kernel_driver\n                      (*(undefined4 *)(*(int *)(param_1 + 4) + 4),*(undefined1 *)(param_1 + 8));\n    if (iVar1 == 0) {\n      *(undefined1 *)(param_1 + 0x1a) = 0;\n      return 0;\n    }\n  }" if (parenthesized_expression "(*(char *)(param_1 + 0x1a) != '\0')" ( (binary_expression "*(char *)(param_1 + 0x1a) != '\0'" (pointer_expression "*(char *)(param_1 + 0x1a)" * (cast_expression "(char *)(param_1 + 0x1a)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x1a)" ( (binary_expression "param_1 + 0x1a" identifier + number_literal) )))) != (char_literal "'\0'" ' escape_sequence ')) )) (compound_statement "{\n    iVar1 = libusb_attach_kernel_driver\n                      (*(undefined4 *)(*(int *)(param_1 + 4) + 4),*(undefined1 *)(param_1 + 8));\n    if (iVar1 == 0) {\n      *(undefined1 *)(param_1 + 0x1a) = 0;\n      return 0;\n    }\n  }" { (expression_statement "iVar1 = libusb_attach_kernel_driver\n                      (*(undefined4 *)(*(int *)(param_1 + 4) + 4),*(undefined1 *)(param_1 + 8));" (assignment_expression "iVar1 = libusb_attach_kernel_driver\n                      (*(undefined4 *)(*(int *)(param_1 + 4) + 4),*(undefined1 *)(param_1 + 8))" identifier = (call_expression "libusb_attach_kernel_driver\n                      (*(undefined4 *)(*(int *)(param_1 + 4) + 4),*(undefined1 *)(param_1 + 8))" identifier (argument_list "(*(undefined4 *)(*(int *)(param_1 + 4) + 4),*(undefined1 *)(param_1 + 8))" ( (pointer_expression "*(undefined4 *)(*(int *)(param_1 + 4) + 4)" * (cast_expression "(undefined4 *)(*(int *)(param_1 + 4) + 4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*(int *)(param_1 + 4) + 4)" ( (binary_expression "*(int *)(param_1 + 4) + 4" (pointer_expression "*(int *)(param_1 + 4)" * (cast_expression "(int *)(param_1 + 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 4)" ( (binary_expression "param_1 + 4" identifier + number_literal) )))) + number_literal) )))) , (pointer_expression "*(undefined1 *)(param_1 + 8)" * (cast_expression "(undefined1 *)(param_1 + 8)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 8)" ( (binary_expression "param_1 + 8" identifier + number_literal) )))) )))) ;) (if_statement "if (iVar1 == 0) {\n      *(undefined1 *)(param_1 + 0x1a) = 0;\n      return 0;\n    }" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (compound_statement "{\n      *(undefined1 *)(param_1 + 0x1a) = 0;\n      return 0;\n    }" { (expression_statement "*(undefined1 *)(param_1 + 0x1a) = 0;" (assignment_expression "*(undefined1 *)(param_1 + 0x1a) = 0" (pointer_expression "*(undefined1 *)(param_1 + 0x1a)" * (cast_expression "(undefined1 *)(param_1 + 0x1a)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x1a)" ( (binary_expression "param_1 + 0x1a" identifier + number_literal) )))) = number_literal) ;) (return_statement "return 0;" return number_literal ;) })) })) (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\nlibusb_error uhd_iface_attach(uhd_iface *iface)\n\n{\n  libusb_error lVar1;\n  \n  lVar1 = LIBUSB_SUCCESS;\n  if (iface->detached != false) {\n    lVar1 = libusb_attach_kernel_driver(iface->dev->handle,iface->number);\n    if (lVar1 == LIBUSB_SUCCESS) {\n      iface->detached = false;\n      return LIBUSB_SUCCESS;\n    }\n  }\n  return lVar1;\n}\n\n" comment comment (function_definition "libusb_error uhd_iface_attach(uhd_iface *iface)\n\n{\n  libusb_error lVar1;\n  \n  lVar1 = LIBUSB_SUCCESS;\n  if (iface->detached != false) {\n    lVar1 = libusb_attach_kernel_driver(iface->dev->handle,iface->number);\n    if (lVar1 == LIBUSB_SUCCESS) {\n      iface->detached = false;\n      return LIBUSB_SUCCESS;\n    }\n  }\n  return lVar1;\n}" type_identifier (function_declarator "uhd_iface_attach(uhd_iface *iface)" identifier (parameter_list "(uhd_iface *iface)" ( (parameter_declaration "uhd_iface *iface" type_identifier (pointer_declarator "*iface" * identifier)) ))) (compound_statement "{\n  libusb_error lVar1;\n  \n  lVar1 = LIBUSB_SUCCESS;\n  if (iface->detached != false) {\n    lVar1 = libusb_attach_kernel_driver(iface->dev->handle,iface->number);\n    if (lVar1 == LIBUSB_SUCCESS) {\n      iface->detached = false;\n      return LIBUSB_SUCCESS;\n    }\n  }\n  return lVar1;\n}" { (declaration "libusb_error lVar1;" type_identifier identifier ;) (expression_statement "lVar1 = LIBUSB_SUCCESS;" (assignment_expression "lVar1 = LIBUSB_SUCCESS" identifier = identifier) ;) (if_statement "if (iface->detached != false) {\n    lVar1 = libusb_attach_kernel_driver(iface->dev->handle,iface->number);\n    if (lVar1 == LIBUSB_SUCCESS) {\n      iface->detached = false;\n      return LIBUSB_SUCCESS;\n    }\n  }" if (parenthesized_expression "(iface->detached != false)" ( (binary_expression "iface->detached != false" (field_expression "iface->detached" identifier -> field_identifier) != false) )) (compound_statement "{\n    lVar1 = libusb_attach_kernel_driver(iface->dev->handle,iface->number);\n    if (lVar1 == LIBUSB_SUCCESS) {\n      iface->detached = false;\n      return LIBUSB_SUCCESS;\n    }\n  }" { (expression_statement "lVar1 = libusb_attach_kernel_driver(iface->dev->handle,iface->number);" (assignment_expression "lVar1 = libusb_attach_kernel_driver(iface->dev->handle,iface->number)" identifier = (call_expression "libusb_attach_kernel_driver(iface->dev->handle,iface->number)" identifier (argument_list "(iface->dev->handle,iface->number)" ( (field_expression "iface->dev->handle" (field_expression "iface->dev" identifier -> field_identifier) -> field_identifier) , (field_expression "iface->number" identifier -> field_identifier) )))) ;) (if_statement "if (lVar1 == LIBUSB_SUCCESS) {\n      iface->detached = false;\n      return LIBUSB_SUCCESS;\n    }" if (parenthesized_expression "(lVar1 == LIBUSB_SUCCESS)" ( (binary_expression "lVar1 == LIBUSB_SUCCESS" identifier == identifier) )) (compound_statement "{\n      iface->detached = false;\n      return LIBUSB_SUCCESS;\n    }" { (expression_statement "iface->detached = false;" (assignment_expression "iface->detached = false" (field_expression "iface->detached" identifier -> field_identifier) = false) ;) (return_statement "return LIBUSB_SUCCESS;" return identifier ;) })) })) (return_statement "return lVar1;" return identifier ;) })))
(translation_unit "int FUN_00013680(int param_1)\n\n{\n  int iVar1;\n  \n  iVar1 = 0;\n  if (*(char *)(param_1 + 0x1a) != '\0') {\n    iVar1 = libusb_attach_kernel_driver\n                      (*(undefined4 *)(*(int *)(param_1 + 4) + 4),*(undefined1 *)(param_1 + 8));\n    if (iVar1 == 0) {\n      *(undefined1 *)(param_1 + 0x1a) = 0;\n      return 0;\n    }\n  }\n  return iVar1;\n}\n\n" (function_definition "int FUN_00013680(int param_1)\n\n{\n  int iVar1;\n  \n  iVar1 = 0;\n  if (*(char *)(param_1 + 0x1a) != '\0') {\n    iVar1 = libusb_attach_kernel_driver\n                      (*(undefined4 *)(*(int *)(param_1 + 4) + 4),*(undefined1 *)(param_1 + 8));\n    if (iVar1 == 0) {\n      *(undefined1 *)(param_1 + 0x1a) = 0;\n      return 0;\n    }\n  }\n  return iVar1;\n}" primitive_type (function_declarator "FUN_00013680(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 = 0;\n  if (*(char *)(param_1 + 0x1a) != '\0') {\n    iVar1 = libusb_attach_kernel_driver\n                      (*(undefined4 *)(*(int *)(param_1 + 4) + 4),*(undefined1 *)(param_1 + 8));\n    if (iVar1 == 0) {\n      *(undefined1 *)(param_1 + 0x1a) = 0;\n      return 0;\n    }\n  }\n  return iVar1;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (expression_statement "iVar1 = 0;" (assignment_expression "iVar1 = 0" identifier = number_literal) ;) (if_statement "if (*(char *)(param_1 + 0x1a) != '\0') {\n    iVar1 = libusb_attach_kernel_driver\n                      (*(undefined4 *)(*(int *)(param_1 + 4) + 4),*(undefined1 *)(param_1 + 8));\n    if (iVar1 == 0) {\n      *(undefined1 *)(param_1 + 0x1a) = 0;\n      return 0;\n    }\n  }" if (parenthesized_expression "(*(char *)(param_1 + 0x1a) != '\0')" ( (binary_expression "*(char *)(param_1 + 0x1a) != '\0'" (pointer_expression "*(char *)(param_1 + 0x1a)" * (cast_expression "(char *)(param_1 + 0x1a)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x1a)" ( (binary_expression "param_1 + 0x1a" identifier + number_literal) )))) != (char_literal "'\0'" ' escape_sequence ')) )) (compound_statement "{\n    iVar1 = libusb_attach_kernel_driver\n                      (*(undefined4 *)(*(int *)(param_1 + 4) + 4),*(undefined1 *)(param_1 + 8));\n    if (iVar1 == 0) {\n      *(undefined1 *)(param_1 + 0x1a) = 0;\n      return 0;\n    }\n  }" { (expression_statement "iVar1 = libusb_attach_kernel_driver\n                      (*(undefined4 *)(*(int *)(param_1 + 4) + 4),*(undefined1 *)(param_1 + 8));" (assignment_expression "iVar1 = libusb_attach_kernel_driver\n                      (*(undefined4 *)(*(int *)(param_1 + 4) + 4),*(undefined1 *)(param_1 + 8))" identifier = (call_expression "libusb_attach_kernel_driver\n                      (*(undefined4 *)(*(int *)(param_1 + 4) + 4),*(undefined1 *)(param_1 + 8))" identifier (argument_list "(*(undefined4 *)(*(int *)(param_1 + 4) + 4),*(undefined1 *)(param_1 + 8))" ( (pointer_expression "*(undefined4 *)(*(int *)(param_1 + 4) + 4)" * (cast_expression "(undefined4 *)(*(int *)(param_1 + 4) + 4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*(int *)(param_1 + 4) + 4)" ( (binary_expression "*(int *)(param_1 + 4) + 4" (pointer_expression "*(int *)(param_1 + 4)" * (cast_expression "(int *)(param_1 + 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 4)" ( (binary_expression "param_1 + 4" identifier + number_literal) )))) + number_literal) )))) , (pointer_expression "*(undefined1 *)(param_1 + 8)" * (cast_expression "(undefined1 *)(param_1 + 8)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 8)" ( (binary_expression "param_1 + 8" identifier + number_literal) )))) )))) ;) (if_statement "if (iVar1 == 0) {\n      *(undefined1 *)(param_1 + 0x1a) = 0;\n      return 0;\n    }" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (compound_statement "{\n      *(undefined1 *)(param_1 + 0x1a) = 0;\n      return 0;\n    }" { (expression_statement "*(undefined1 *)(param_1 + 0x1a) = 0;" (assignment_expression "*(undefined1 *)(param_1 + 0x1a) = 0" (pointer_expression "*(undefined1 *)(param_1 + 0x1a)" * (cast_expression "(undefined1 *)(param_1 + 0x1a)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x1a)" ( (binary_expression "param_1 + 0x1a" identifier + number_literal) )))) = number_literal) ;) (return_statement "return 0;" return number_literal ;) })) })) (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 = LIT) ;) (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) != (char_literal ' escape_sequence ')) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) + LIT) )))) , (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = LIT) ;) (return_statement return LIT ;) })) })) (return_statement return IDENT ;) })))
(function_definition "int FUN_00013680(int param_1)\n\n{\n  int iVar1;\n  \n  iVar1 = 0;\n  if (*(char *)(param_1 + 0x1a) != '\0') {\n    iVar1 = libusb_attach_kernel_driver\n                      (*(undefined4 *)(*(int *)(param_1 + 4) + 4),*(undefined1 *)(param_1 + 8));\n    if (iVar1 == 0) {\n      *(undefined1 *)(param_1 + 0x1a) = 0;\n      return 0;\n    }\n  }\n  return iVar1;\n}" (primitive_type "int") (function_declarator "FUN_00013680(int param_1)" (identifier "FUN_00013680") (parameter_list "(int param_1)" (( "(") (parameter_declaration "int param_1" (primitive_type "int") (identifier "param_1")) () ")"))) (compound_statement "{\n  int iVar1;\n  \n  iVar1 = 0;\n  if (*(char *)(param_1 + 0x1a) != '\0') {\n    iVar1 = libusb_attach_kernel_driver\n                      (*(undefined4 *)(*(int *)(param_1 + 4) + 4),*(undefined1 *)(param_1 + 8));\n    if (iVar1 == 0) {\n      *(undefined1 *)(param_1 + 0x1a) = 0;\n      return 0;\n    }\n  }\n  return iVar1;\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (expression_statement "iVar1 = 0;" (assignment_expression "iVar1 = 0" (identifier "iVar1") (= "=") (number_literal "0")) (; ";")) (if_statement "if (*(char *)(param_1 + 0x1a) != '\0') {\n    iVar1 = libusb_attach_kernel_driver\n                      (*(undefined4 *)(*(int *)(param_1 + 4) + 4),*(undefined1 *)(param_1 + 8));\n    if (iVar1 == 0) {\n      *(undefined1 *)(param_1 + 0x1a) = 0;\n      return 0;\n    }\n  }" (if "if") (parenthesized_expression "(*(char *)(param_1 + 0x1a) != '\0')" (( "(") (binary_expression "*(char *)(param_1 + 0x1a) != '\0'" (pointer_expression "*(char *)(param_1 + 0x1a)" (* "*") (cast_expression "(char *)(param_1 + 0x1a)" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x1a)" (( "(") (binary_expression "param_1 + 0x1a" (identifier "param_1") (+ "+") (number_literal "0x1a")) () ")")))) (!= "!=") (char_literal "'\0'" (' "'") (escape_sequence "\0") (' "'"))) () ")")) (compound_statement "{\n    iVar1 = libusb_attach_kernel_driver\n                      (*(undefined4 *)(*(int *)(param_1 + 4) + 4),*(undefined1 *)(param_1 + 8));\n    if (iVar1 == 0) {\n      *(undefined1 *)(param_1 + 0x1a) = 0;\n      return 0;\n    }\n  }" ({ "{") (expression_statement "iVar1 = libusb_attach_kernel_driver\n                      (*(undefined4 *)(*(int *)(param_1 + 4) + 4),*(undefined1 *)(param_1 + 8));" (assignment_expression "iVar1 = libusb_attach_kernel_driver\n                      (*(undefined4 *)(*(int *)(param_1 + 4) + 4),*(undefined1 *)(param_1 + 8))" (identifier "iVar1") (= "=") (call_expression "libusb_attach_kernel_driver\n                      (*(undefined4 *)(*(int *)(param_1 + 4) + 4),*(undefined1 *)(param_1 + 8))" (identifier "libusb_attach_kernel_driver") (argument_list "(*(undefined4 *)(*(int *)(param_1 + 4) + 4),*(undefined1 *)(param_1 + 8))" (( "(") (pointer_expression "*(undefined4 *)(*(int *)(param_1 + 4) + 4)" (* "*") (cast_expression "(undefined4 *)(*(int *)(param_1 + 4) + 4)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(*(int *)(param_1 + 4) + 4)" (( "(") (binary_expression "*(int *)(param_1 + 4) + 4" (pointer_expression "*(int *)(param_1 + 4)" (* "*") (cast_expression "(int *)(param_1 + 4)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 4)" (( "(") (binary_expression "param_1 + 4" (identifier "param_1") (+ "+") (number_literal "4")) () ")")))) (+ "+") (number_literal "4")) () ")")))) (, ",") (pointer_expression "*(undefined1 *)(param_1 + 8)" (* "*") (cast_expression "(undefined1 *)(param_1 + 8)" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 8)" (( "(") (binary_expression "param_1 + 8" (identifier "param_1") (+ "+") (number_literal "8")) () ")")))) () ")")))) (; ";")) (if_statement "if (iVar1 == 0) {\n      *(undefined1 *)(param_1 + 0x1a) = 0;\n      return 0;\n    }" (if "if") (parenthesized_expression "(iVar1 == 0)" (( "(") (binary_expression "iVar1 == 0" (identifier "iVar1") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n      *(undefined1 *)(param_1 + 0x1a) = 0;\n      return 0;\n    }" ({ "{") (expression_statement "*(undefined1 *)(param_1 + 0x1a) = 0;" (assignment_expression "*(undefined1 *)(param_1 + 0x1a) = 0" (pointer_expression "*(undefined1 *)(param_1 + 0x1a)" (* "*") (cast_expression "(undefined1 *)(param_1 + 0x1a)" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x1a)" (( "(") (binary_expression "param_1 + 0x1a" (identifier "param_1") (+ "+") (number_literal "0x1a")) () ")")))) (= "=") (number_literal "0")) (; ";")) (return_statement "return 0;" (return "return") (number_literal "0") (; ";")) (} "}"))) (} "}"))) (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 */

type_1 function_1(type_2 *iface)

{
  type_1 var_2;
  
  var_2 = var_3;
  if (iface->detached != false) {
    var_2 = var_1(iface->dev->handle,iface->number);
    if (var_2 == var_3) {
      iface->detached = false;
      return var_3;
    }
  }
  return var_2;
}


(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: (number_literal))) (if_statement condition: (parenthesized_expression (binary_expression left: (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))))) right: (char_literal (escape_sequence)))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (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))))) right: (number_literal))))) (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))) right: (number_literal))) (return_statement (number_literal)))))) (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 = 0;
  if (*(char *)(param_1 + 0x1a) != '\0') {
    iVar1 = libusb_attach_kernel_driver
                      (*(undefined4 *)(*(int *)(param_1 + 4) + 4),*(undefined1 *)(param_1 + 8));
    if (iVar1 == 0) {
      *(undefined1 *)(param_1 + 0x1a) = 0;
      return 0;
    }
  }
  return iVar1;
}

