	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_usbhid_wait_io                 ## -- Begin function usbhid_wait_io
	.p2align	4, 0x90
_usbhid_wait_io:                        ## @usbhid_wait_io
	.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
	movq	(%rdi), %rbx
	movl	4(%rbx), %r14d
	movq	_HID_CTRL_RUNNING@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%rbx, %rsi
	callq	_test_bit
	xorl	%r15d, %r15d
	movl	$0, %esi
	testl	%eax, %eax
	jne	LBB0_2
## %bb.1:
	movq	_HID_OUT_RUNNING@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%rbx, %rsi
	callq	_test_bit
	xorl	%esi, %esi
	testl	%eax, %eax
	sete	%sil
LBB0_2:
	movq	_HZ@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%eax, %eax
	leal	(%rax,%rax,4), %edx
	movl	%r14d, %edi
	callq	_wait_event_timeout
	testl	%eax, %eax
	jne	LBB0_4
## %bb.3:
	leaq	L_.str(%rip), %rdi
	callq	_dbg_hid
	movl	$-1, %r15d
LBB0_4:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_HID_CTRL_RUNNING,4,2           ## @HID_CTRL_RUNNING
	.comm	_HID_OUT_RUNNING,4,2            ## @HID_OUT_RUNNING
	.comm	_HZ,4,2                         ## @HZ
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"timeout waiting for ctrl or out queue to clear\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_usbhid_wait_io                 ; -- Begin function usbhid_wait_io
	.p2align	2
_usbhid_wait_io:                        ; @usbhid_wait_io
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	ldr	x20, [x0]
	ldr	w19, [x20, #4]
Lloh0:
	adrp	x8, _HID_CTRL_RUNNING@GOTPAGE
Lloh1:
	ldr	x8, [x8, _HID_CTRL_RUNNING@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	mov	x1, x20
	bl	_test_bit
	cbz	w0, LBB0_2
; %bb.1:
	mov	w1, #0
	b	LBB0_3
LBB0_2:
Lloh3:
	adrp	x8, _HID_OUT_RUNNING@GOTPAGE
Lloh4:
	ldr	x8, [x8, _HID_OUT_RUNNING@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	mov	x1, x20
	bl	_test_bit
	cmp	w0, #0
	cset	w1, eq
LBB0_3:
Lloh6:
	adrp	x8, _HZ@GOTPAGE
Lloh7:
	ldr	x8, [x8, _HZ@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	add	w8, w8, w8, lsl #2
	lsl	w2, w8, #1
	mov	x0, x19
	bl	_wait_event_timeout
	cbz	w0, LBB0_5
; %bb.4:
	mov	w0, #0
	b	LBB0_6
LBB0_5:
Lloh9:
	adrp	x0, l_.str@PAGE
Lloh10:
	add	x0, x0, l_.str@PAGEOFF
	bl	_dbg_hid
	mov	w0, #-1
LBB0_6:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_HID_CTRL_RUNNING,4,2           ; @HID_CTRL_RUNNING
	.comm	_HID_OUT_RUNNING,4,2            ; @HID_OUT_RUNNING
	.comm	_HZ,4,2                         ; @HZ
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"timeout waiting for ctrl or out queue to clear\n"

.subsections_via_symbols
