	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wiiusb_hid_poll_thread
_wiiusb_hid_poll_thread:                ## @wiiusb_hid_poll_thread
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testq	%rdi, %rdi
	je	LBB0_13
## %bb.1:
	movq	%rdi, %r14
	cmpl	$0, 16(%rdi)
	je	LBB0_2
LBB0_13:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movq	_wiiusb_hid_read_cb@GOTPCREL(%rip), %r15
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_3 Depth=1
	movl	$10000, %edi                    ## imm = 0x2710
	callq	_usleep
	cmpl	$0, 16(%r14)
	jne	LBB0_13
LBB0_3:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_6 Depth 2
	cmpl	$0, (%r14)
	je	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	$0, (%r14)
	movq	%r14, %rdi
	callq	_wiiusb_hid_scan_for_devices
LBB0_5:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	8(%r14), %rbx
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_6 Depth=2
	movl	16(%rbx), %edi
	movl	12(%rbx), %esi
	movl	4(%rbx), %ecx
	movl	8(%rbx), %edx
	movl	(%r15), %r8d
	movq	%rbx, %r9
	callq	_USB_ReadIntrMsgAsync
LBB0_11:                                ##   in Loop: Header=BB0_6 Depth=2
	movq	32(%rbx), %rbx
LBB0_6:                                 ##   Parent Loop BB0_3 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	testq	%rbx, %rbx
	je	LBB0_12
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=2
	cmpl	$0, (%rbx)
	jne	LBB0_11
## %bb.8:                               ##   in Loop: Header=BB0_6 Depth=2
	movl	$1, (%rbx)
	cmpq	$0, 24(%rbx)
	je	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_6 Depth=2
	movq	%rbx, %rdi
	callq	_wiiusb_hid_process_control_message
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_wiiusb_hid_read_cb,4,2         ## @wiiusb_hid_read_cb
	.no_dead_strip	_wiiusb_hid_poll_thread
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wiiusb_hid_poll_thread
_wiiusb_hid_poll_thread:                ; @wiiusb_hid_poll_thread
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	cbz	x0, LBB0_2
; %bb.1:
	mov	x19, x0
	ldr	w8, [x0, #16]
	cbz	w8, LBB0_3
LBB0_2:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_3:
	mov	w21, #1
Lloh0:
	adrp	x22, _wiiusb_hid_read_cb@GOTPAGE
Lloh1:
	ldr	x22, [x22, _wiiusb_hid_read_cb@GOTPAGEOFF]
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	w0, #10000
	bl	_usleep
	ldr	w8, [x19, #16]
	cbnz	w8, LBB0_2
LBB0_5:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_10 Depth 2
	ldr	w8, [x19]
	cbz	w8, LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	str	wzr, [x19]
	mov	x0, x19
	bl	_wiiusb_hid_scan_for_devices
LBB0_7:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	x20, [x19, #8]
	cbnz	x20, LBB0_10
	b	LBB0_4
LBB0_8:                                 ;   in Loop: Header=BB0_10 Depth=2
	ldp	w1, w0, [x20, #12]
	ldp	w3, w2, [x20, #4]
	ldr	w4, [x22]
	mov	x5, x20
	bl	_USB_ReadIntrMsgAsync
LBB0_9:                                 ;   in Loop: Header=BB0_10 Depth=2
	ldr	x20, [x20, #32]
	cbz	x20, LBB0_4
LBB0_10:                                ;   Parent Loop BB0_5 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w8, [x20]
	cbnz	w8, LBB0_9
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=2
	str	w21, [x20]
	ldr	x8, [x20, #24]
	cbz	x8, LBB0_8
; %bb.12:                               ;   in Loop: Header=BB0_10 Depth=2
	mov	x0, x20
	bl	_wiiusb_hid_process_control_message
	b	LBB0_8
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_wiiusb_hid_read_cb,4,2         ; @wiiusb_hid_read_cb
	.no_dead_strip	_wiiusb_hid_poll_thread
.subsections_via_symbols
