{"name": "ehci_reset", "code": "unsigned __int64 __fastcall ehci_reset ( __int64 @@a1@@ ) { int i ; int j ; __int64 @@v4@@ [ Number ] ; unsigned __int64 @@v5@@ ; @@v5@@ = __readfsqword ( Number ) ; trace_usb_ehci_reset ( ) ; for ( i = Number ; i <= Number ; ++ i ) { @@v4@@ [ i ] = * ( _QWORD * ) ( @@a1@@ + Number L * i + Number ) ; if ( @@v4@@ [ i ] && * ( _DWORD * ) ( @@v4@@ [ i ] + Number ) ) usb_detach ( Number L * i + Number + @@a1@@ ) ; } memset ( ( void * ) ( @@a1@@ + Number ) , Number , Number ) ; memset ( ( void * ) ( @@a1@@ + Number ) , Number , Number ) ; * ( _DWORD * ) ( @@a1@@ + Number ) = Number ; * ( _DWORD * ) ( @@a1@@ + Number ) = Number ; * ( _DWORD * ) ( @@a1@@ + Number ) = Number ; * ( _DWORD * ) ( @@a1@@ + Number ) = Number ; * ( _DWORD * ) ( @@a1@@ + Number ) = Number ; * ( _DWORD * ) ( @@a1@@ + Number ) = Number ; for ( j = Number ; j <= Number ; ++ j ) { if ( * ( _QWORD * ) ( @@a1@@ + Number * ( j + Number L ) ) ) * ( _DWORD * ) ( @@a1@@ + Number * ( j + Number L ) + Number ) = Number ; else * ( _DWORD * ) ( @@a1@@ + Number * ( j + Number L ) + Number ) = Number ; if ( @@v4@@ [ j ] && * ( _DWORD * ) ( @@v4@@ [ j ] + Number ) ) { usb_attach ( Number L * j + Number + @@a1@@ ) ; usb_device_reset ( @@v4@@ [ j ] ) ; } } ehci_queues_rip_all ( @@a1@@ , Number ) ; ehci_queues_rip_all ( @@a1@@ , Number ) ; timer_del ( * ( _QWORD * ) ( @@a1@@ + Number ) ) ; qemu_bh_cancel ( * ( _QWORD * ) ( @@a1@@ + Number ) ) ; return __readfsqword ( Number ) ^ @@v5@@ ; }", "source": [{"n": "a1", "t": {"T": 1, "n": "__int64", "s": 8}, "location": "r56"}, {"n": "v4", "t": {"T": 2, "n": 7, "s": 8, "t": "__int64"}, "location": "s64"}, {"n": "v5", "t": {"T": 1, "n": "unsigned __int64", "s": 8}, "location": "s8"}]}
{"name": "ehci_reset_queue", "code": "__int64 __fastcall ehci_reset_queue ( __int64 @@a1@@ ) { __int64 @@result@@ ; trace_usb_ehci_queue_action ( @@a1@@ , String ) ; LODWORD ( @@result@@ ) = ehci_cancel_queue ( @@a1@@ ) ; * ( _QWORD * ) ( @@a1@@ + Number ) = Number L ; * ( _DWORD * ) ( @@a1@@ + Number ) = Number ; * ( _DWORD * ) ( @@a1@@ + Number ) = Number ; return ( unsigned int ) @@result@@ ; }", "source": [{"n": "a1", "t": {"T": 1, "n": "__int64", "s": 8}, "location": "r56"}, {"n": "result", "t": {"T": 1, "n": "__int64", "s": 8}, "location": "r8"}]} {"name": "ehci_queues_rip_all", "code": "unsigned __int64 __fastcall ehci_queues_rip_all ( __int64 @@a1@@ , int @@a2@@ ) { __int64 * v2 ; const char * v3 ; __int64 @@i@@ ; __int64 * @@v6@@ ; const char * @@v7@@ ; __int64 @@v8@@ ; unsigned __int64 @@v9@@ ; @@v9@@ = __readfsqword ( Number ) ; if ( @@a2@@ ) v2 = ( __int64 * ) ( @@a1@@ + Number ) ; else v2 = ( __int64 * ) ( @@a1@@ + Number ) ; @@v6@@ = v2 ; if ( @@a2@@ ) v3 = String ; else v3 = Number L ; @@v7@@ = v3 ; for ( @@i@@ = * @@v6@@ ; @@i@@ ; @@i@@ = @@v8@@ ) { @@v8@@ = * ( _QWORD * ) ( @@i@@ + Number ) ; ehci_free_queue ( @@i@@ , @@v7@@ ) ; } return __readfsqword ( Number ) ^ @@v9@@ ; }", "source": [{"n": "a1", "t": {"T": 1, "n": "__int64", "s": 8}, "location": "r56"}, {"n": "a2", "t": {"T": 1, "n": "int", "s": 4}, "location": "r64"}, {"n": "v8", "t": {"T": 1, "n": "__int64", "s": 8}, "location": "s16"}, {"n": "v7", "t": {"T": 3, "t": "const char"}, "location": "s24"}, {"n": "v6", "t": {"T": 3, "t": "__int64"}, "location": "s32"}, {"n": "i", "t": {"T": 1, "n": "__int64", "s": 8}, "location": "s40"}, {"n": "v9", "t": {"T": 1, "n": "unsigned __int64", "s": 8}, "location": "s8"}]} {"name": "ehci_opreg_write", "code": "unsigned __int64 __fastcall ehci_opreg_write ( __int64 @@a1@@ , unsigned __int64 @@a2@@ , unsigned int @@a3@@ ) { const char * v4 ; unsigned int @@v5@@ ; const char * v6 ; __int64 @@v8@@ ; int @@i@@ ; unsigned int @@v10@@ ; unsigned int * @@v11@@ ; unsigned __int64 @@v12@@ ; LODWORD ( @@v8@@ ) = @@a3@@ ; @@v12@@ = __readfsqword ( Number ) ; @@v11@@ = ( unsigned int * ) ( @@a1@@ + Number + Number * ( @@a2@@ >> Number ) ) ; @@v10@@ = * @@v11@@ ; v4 = addr2str ( @@a2@@ ) ; trace_usb_ehci_opreg_write ( ( unsigned int ) @@a2@@ + * ( unsigned __int16 * ) ( @@a1@@ + Number ) , v4 , @@a3@@ ) ; if ( @@a2@@ > Number ) { if ( @@a2@@ == Number ) { @@v8@@ &= Number ; if ( @@v8@@ ) { for ( @@i@@ = Number ; @@i@@ <= Number ; ++ @@i@@ ) handle_port_owner_write ( @@a1@@ , @@i@@ , Number ) ; } } } else { switch ( @@a2@@ ) { case Number : if ( ( @@v8@@ & Number ) != Number ) { ehci_reset ( @@a1@@ ) ; LODWORD ( @@v8@@ ) = * ( _DWORD * ) ( @@a1@@ + Number ) ; } else { if ( ( @@v8@@ & Number ) != Number && ( * ( _DWORD * ) ( @@a1@@ + Number ) & Number ) == Number ) { fprintf ( stderr , String , @@v8@@ & Number ) ; LODWORD ( @@v8@@ ) = @@v8@@ & Number ; } if ( ( @@v8@@ & Number ) != Number ) { * ( _DWORD * ) ( @@a1@@ + Number ) = Number ; qemu_bh_schedule ( * ( _QWORD * ) ( @@a1@@ + Number ) ) ; trace_usb_ehci_doorbell_ring ( ) ; } if ( ( ( ( unsigned __int8 ) @@v8@@ ^ ( unsigned __int8 ) * ( _DWORD * ) ( @@a1@@ + Number ) ) & Number ) != Number ) { if ( * ( _DWORD * ) ( @@a1@@ + Number ) == Number ) * ( _QWORD * ) ( @@a1@@ + Number ) = qemu_clock_get_ns ( Number L ) ; * ( _DWORD * ) ( @@a1@@ + Number ) = @@v8@@ ; ehci_update_halt ( ( _DWORD * ) @@a1@@ ) ; * ( _DWORD * ) ( @@a1@@ + Number ) = Number ; qemu_bh_schedule ( * ( _QWORD * ) ( @@a1@@ + Number ) ) ; } } break ; case Number : ehci_clear_usbsts ( @@a1@@ , @@v8@@ & Number ) ; LODWORD ( @@v8@@ ) = * ( _DWORD * ) ( @@a1@@ + Number ) ; ehci_update_irq ( @@a1@@ ) ; break ; case Number : LODWORD ( @@v8@@ ) = @@v8@@ & Number ; if ( ehci_enabled ( @@a1@@ ) && ( @@v8@@ & Number ) != Number ) qemu_bh_schedule ( * ( _QWORD * ) ( @@a1@@ + Number ) ) ; break ; case Number : LODWORD ( @@v8@@ ) = @@v8@@ & Number ; * ( _DWORD * ) ( @@a1@@ + Number ) = @@v8@@ ; break ; case Number : if ( ehci_periodic_enabled ( @@a1@@ ) ) fwrite ( String , Number , Number , stderr ) ; break ; case Number : if ( ehci_async_enabled ( @@a1@@ ) ) fwrite ( String , Number , Number , stderr ) ; break ; default : break ; } } * @@v11@@ = @@v8@@ ; @@v5@@ = * @@v11@@ ; v6 = addr2str ( @@a2@@ ) ; trace_usb_ehci_opreg_change ( * ( unsigned __int16 * ) ( @@a1@@ + Number ) + ( unsigned int ) @@a2@@ , v6 , @@v5@@ , @@v10@@ ) ; return __readfsqword ( Number ) ^ @@v12@@ ; }", "source": [{"n": "a3", "t": {"T": 1, "n": "unsigned int", "s": 4}, "location": "r16"}, {"n": "v5", "t": {"T": 1, "n": "unsigned int", "s": 4}, "location": "r32"}, {"n": "a1", "t": {"T": 1, "n": "__int64", "s": 8}, "location": "r56"}, {"n": "a2", "t": {"T": 1, "n": "unsigned __int64", "s": 8}, "location": "r64"}, {"n": "v12", "t": {"T": 1, "n": "unsigned __int64", "s": 8}, "location": "s24"}, {"n": "v11", "t": {"T": 3, "t": "unsigned int"}, "location": "s32"}, {"n": "v10", "t": {"T": 1, "n": "unsigned int", "s": 4}, "location": "s44"}, {"n": "i", "t": {"T": 1, "n": "int", "s": 4}, "location": "s48"}, {"n": "v8", "t": {"T": 1, "n": "__int64", "s": 8}, "location": "s72"}]} {"name": "ehci_state_fetchqh", "code": "__int64 __fastcall ehci_state_fetchqh ( _DWORD * @@a1@@ , int @@a2@@ ) { __int64 v2 ; __int64 v3 ; __int64 v4 ; int @@v6@@ ; __int64 @@v7@@ ; __int64 @@v8@@ [ Number ] ; @@v8@@ [ Number ] = __readfsqword ( Number ) ; @@v6@@ = ehci_get_fetch_addr ( ( __int64 ) @@a1@@ , @@a2@@ ) ; @@v7@@ = ehci_find_queue_by_qh ( ( __int64 ) @@a1@@ , @@v6@@ , @@a2@@ ) ; if ( ! @@v7@@ ) @@v7@@ = ehci_alloc_queue ( ( __int64 ) @@a1@@ , @@v6@@ , @@a2@@ ) ; if ( ++ * ( _DWORD * ) ( @@v7@@ + Number ) <= Number ) { if ( ( int ) get_dwords ( ( __int64 ) @@a1@@ , * ( _DWORD * ) ( @@v7@@ + Number ) & Number , ( unsigned int * ) @@v8@@ , Number ) >= Number ) { ehci_trace_qh ( @@v7@@ , * ( _DWORD * ) ( @@v7@@ + Number ) & Number , ( unsigned int * ) @@v8@@ ) ; if ( ! ehci_verify_qh ( @@v7@@ , @@v8@@ ) && ( int ) ehci_reset_queue ( @@v7@@ ) > Number ) ehci_trace_guest_bug ( ( __int64 ) @@a1@@ , String ) ; v2 = @@v8@@ [ Number ] ; * ( _QWORD * ) ( @@v7@@ + Number ) = @@v8@@ [ Number ] ; * ( _QWORD * ) ( @@v7@@ + Number ) = v2 ; v3 = @@v8@@ [ Number ] ; * ( _QWORD * ) ( @@v7@@ + Number ) = @@v8@@ [ Number ] ; * ( _QWORD * ) ( @@v7@@ + Number ) = v3 ; v4 = @@v8@@ [ Number ] ; * ( _QWORD * ) ( @@v7@@ + Number ) = @@v8@@ [ Number ] ; * ( _QWORD * ) ( @@v7@@ + Number ) = v4 ; * ( _DWORD * ) ( @@v7@@ + Number ) = * ( _DWORD * ) ( @@v7@@ + Number ) >> Number ; if ( ! * ( _DWORD * ) ( @@v7@@ + Number ) ) * ( _DWORD * ) ( @@v7@@ + Number ) = Number ; if ( ! * ( _QWORD * ) ( @@v7@@ + Number ) ) * ( _QWORD * ) ( @@v7@@ + Number ) = ehci_find_device ( * ( _QWORD * ) @@v7@@ , * ( _BYTE * ) ( @@v7@@ + Number ) & Number ) ; if ( @@a2@@ && ( * ( _DWORD * ) ( @@v7@@ + Number ) & Number ) != Number ) { if ( ( @@a1@@ [ Number ] & Number ) == Number ) { ehci_set_state ( @@a1@@ , @@a2@@ , Number ) ; return Number L ; } ehci_clear_usbsts ( ( __int64 ) @@a1@@ , Number ) ; } if ( ( * ( _DWORD * ) ( @@v7@@ + Number ) & Number ) != Number ) { ehci_set_state ( @@a1@@ , @@a2@@ , Number ) ; } else if ( ( * ( _DWORD * ) ( @@v7@@ + Number ) & Number ) == Number || ( * ( _DWORD * ) ( @@v7@@ + Number ) & Number ) != Number ) { ehci_set_state ( @@a1@@ , @@a2@@ , Number ) ; } else { * ( _DWORD * ) ( @@v7@@ + Number ) = * ( _DWORD * ) ( @@v7@@ + Number ) ; ehci_set_state ( @@a1@@ , @@a2@@ , Number ) ; } } else { @@v7@@ = Number L ; } } else { ehci_set_state ( @@a1@@ , @@a2@@ , Number ) ; @@v7@@ = Number L ; } return @@v7@@ ; }", "source": [{"n": "a1", "t": {"T": 3, "t": "_DWORD"}, "location": "r56"}, {"n": "a2", "t": {"T": 1, "n": "int", "s": 4}, "location": "r64"}, {"n": "v8", "t": {"T": 2, "n": 10, "s": 8, "t": "__int64"}, "location": "s80"}, {"n": "v7", "t": {"T": 1, "n": "__int64", "s": 8}, "location": "s88"}, {"n": "v6", "t": {"T": 1, "n": "int", "s": 4}, "location": "s92"}]} {"name": "ehci_advance_state", "code": "unsigned __int64 __fastcall ehci_advance_state ( _DWORD * @@a1@@ , int @@a2@@ ) { int @@v3@@ ; __int64 @@v4@@ ; unsigned __int64 @@v5@@ ; @@v5@@ = __readfsqword ( Number ) ; @@v4@@ = Number L ; do { switch ( ( unsigned int ) ehci_get_state ( ( __int64 ) @@a1@@ , @@a2@@ ) ) { case Number : if ( ! @@v4@@ ) _assert_fail ( String , String , Number , String ) ; if ( @@a2@@ ) @@a1@@ [ Number ] = Number ; @@v3@@ = ehci_state_executing ( ( _DWORD * * ) @@v4@@ ) ; break ; case Number : @@v3@@ = ehci_state_waitlisthead ( @@a1@@ , @@a2@@ ) ; break ; case Number : @@v3@@ = ehci_state_fetchentry ( @@a1@@ , @@a2@@ ) ; break ; case Number : @@v4@@ = ehci_state_fetchqh ( @@a1@@ , @@a2@@ ) ; if ( @@v4@@ ) { if ( @@a2@@ != * ( _DWORD * ) ( @@v4@@ + Number ) ) _assert_fail ( String , String , Number , String ) ; @@v3@@ = Number ; } else { @@v3@@ = Number ; } break ; case Number : @@v3@@ = ehci_state_fetchitd ( @@a1@@ , @@a2@@ ) ; break ; case Number : @@v3@@ = ehci_state_fetchsitd ( @@a1@@ , @@a2@@ ) ; break ; case Number : if ( ! @@v4@@ ) _assert_fail ( String , String , Number , String ) ; @@v3@@ = ehci_state_advqueue ( @@v4@@ ) ; break ; case Number : if ( ! @@v4@@ ) _assert_fail ( String , String , Number , String ) ; @@v3@@ = ehci_state_fetchqtd ( ( _DWORD * * ) @@v4@@ ) ; break ; case Number : if ( ! @@v4@@ ) _assert_fail ( String , String , Number , String ) ; @@v3@@ = ehci_state_execute ( ( _DWORD * * ) @@v4@@ ) ; if ( @@a2@@ ) @@a1@@ [ Number ] = Number ; break ; case Number : if ( ! @@v4@@ ) _assert_fail ( String , String , Number , String ) ; @@v3@@ = ehci_state_writeback ( ( _DWORD * * ) @@v4@@ ) ; if ( ! @@a2@@ ) @@a1@@ [ Number ] = Number ; break ; case Number : if ( ! @@v4@@ ) _assert_fail ( String , String , Number , String ) ; @@v3@@ = ehci_state_horizqh ( ( _DWORD * * ) @@v4@@ ) ; break ; default : fwrite ( String , Number , Number , stderr ) ; @@v3@@ = Number ; g_assertion_message_expr ( Number L , String , Number L , String , Number L ) ; break ; } if ( @@v3@@ < Number ) { fwrite ( String , Number , Number , stderr ) ; ehci_reset ( ( __int64 ) @@a1@@ ) ; @@v3@@ = Number ; } } while ( @@v3@@ ) ; return __readfsqword ( Number ) ^ @@v5@@ ; }", "source": [{"n": "a1", "t": {"T": 3, "t": "_DWORD"}, "location": "r56"}, {"n": "a2", "t": {"T": 1, "n": "int", "s": 4}, "location": "r64"}, {"n": "v4", "t": {"T": 1, "n": "__int64", "s": 8}, "location": "s16"}, {"n": "v3", "t": {"T": 1, "n": "int", "s": 4}, "location": "s20"}, {"n": "v5", "t": {"T": 1, "n": "unsigned __int64", "s": 8}, "location": "s8"}]} {"name": "usb_ehci_realize", "code": "unsigned __int64 __fastcall usb_ehci_realize ( __int64 @@a1@@ , __int64 @@a2@@ , __int64 @@a3@@ ) { int @@i@@ ; unsigned __int64 @@v5@@ ; @@v5@@ = __readfsqword ( Number ) ; if ( * ( _WORD * ) ( @@a1@@ + Number ) <= Number ) { usb_bus_new ( @@a1@@ , Number L , ehci_bus_ops , @@a2@@ ) ; for ( @@i@@ = Number ; @@i@@ < * ( unsigned __int16 * ) ( @@a1@@ + Number ) ; ++ @@i@@ ) { usb_register_port ( @@a1@@ , Number L * @@i@@ + Number + @@a1@@ , @@a1@@ , ( unsigned int ) @@i@@ , ehci_port_ops , Number L ) ; * ( _QWORD * ) ( @@a1@@ + Number L * @@i@@ + Number ) = Number L ; } * ( _QWORD * ) ( @@a1@@ + Number ) = timer_new_ns ( Number , ( __int64 ) ehci_frame_timer , @@a1@@ ) ; * ( _QWORD * ) ( @@a1@@ + Number ) = qemu_bh_new ( ehci_frame_timer , @@a1@@ ) ; * ( _QWORD * ) ( @@a1@@ + Number ) = @@a2@@ ; qemu_register_reset ( ehci_reset , @@a1@@ ) ; qemu_add_vm_change_state_handler ( usb_ehci_vm_state_change , @@a1@@ ) ; } else { error_set ( @@a3@@ , Number L , String , Number L ) ; } return __readfsqword ( Number ) ^ @@v5@@ ; }", "source": [{"n": "a3", "t": {"T": 1, "n": "__int64", "s": 8}, "location": "r16"}, {"n": "a1", "t": {"T": 1, "n": "__int64", "s": 8}, "location": "r56"}, {"n": "a2", "t": {"T": 1, "n": "__int64", "s": 8}, "location": "r64"}, {"n": "i", "t": {"T": 1, "n": "int", "s": 4}, "location": "s12"}, {"n": "v5", "t": {"T": 1, "n": "unsigned __int64", "s": 8}, "location": "s8"}]}