	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wiimote_queue
_wiimote_queue:                         ## @wiimote_queue
	.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
	movq	_HID_MAX_BUFFER_SIZE@GOTPCREL(%rip), %rax
	cmpq	%rdx, (%rax)
	jae	LBB0_2
## %bb.1:
	movl	32(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	callq	_hid_warn
	leaq	12(%rbx), %rdi
	callq	_spin_lock_irqsave
LBB0_10:
	movq	%rbx, %rdi
	callq	_wiimote_cmd_abort
	jmp	LBB0_11
LBB0_2:
	movq	%rdx, %r14
	movq	%rsi, %r15
	leaq	12(%rbx), %rdi
	callq	_spin_lock_irqsave
	movq	(%rbx), %rax
	movq	24(%rbx), %rcx
	shlq	$4, %rax
	movl	8(%rcx,%rax), %edi
	movq	%r15, %rsi
	movq	%r14, %rdx
	callq	_memcpy
	movq	(%rbx), %rcx
	movq	24(%rbx), %rax
	movq	%rcx, %rdx
	shlq	$4, %rdx
	movq	%r14, (%rax,%rdx)
	leaq	1(%rcx), %rax
	movq	_WIIMOTE_BUFSIZE@GOTPCREL(%rip), %rdx
	movslq	(%rdx), %rsi
	movq	%rax, %rdx
	orq	%rsi, %rdx
	shrq	$32, %rdx
	je	LBB0_3
## %bb.4:
	xorl	%edx, %edx
	divq	%rsi
	jmp	LBB0_5
LBB0_3:
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%esi
                                        ## kill: def $edx killed $edx def $rdx
LBB0_5:
	movslq	8(%rbx), %rax
	cmpq	%rax, %rcx
	jne	LBB0_7
## %bb.6:
	movq	%rdx, (%rbx)
	leaq	16(%rbx), %rdi
	callq	_schedule_work
	jmp	LBB0_11
LBB0_7:
	cmpq	%rax, %rdx
	je	LBB0_9
## %bb.8:
	movq	%rdx, (%rbx)
LBB0_11:
	addq	$12, %rbx
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_spin_unlock_irqrestore         ## TAILCALL
LBB0_9:
	movl	32(%rbx), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_hid_warn
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_HID_MAX_BUFFER_SIZE,8,3        ## @HID_MAX_BUFFER_SIZE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Sending too large output report\n"

	.comm	_WIIMOTE_BUFSIZE,4,2            ## @WIIMOTE_BUFSIZE
L_.str.1:                               ## @.str.1
	.asciz	"Output queue is full"

	.no_dead_strip	_wiimote_queue
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wiimote_queue
_wiimote_queue:                         ; @wiimote_queue
	.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
	mov	x19, x0
Lloh0:
	adrp	x8, _HID_MAX_BUFFER_SIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _HID_MAX_BUFFER_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x8, x2
	b.hs	LBB0_3
; %bb.1:
	ldr	w0, [x19, #32]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	bl	_hid_warn
	add	x0, x19, #12
	bl	_spin_lock_irqsave
LBB0_2:
	mov	x0, x19
	bl	_wiimote_cmd_abort
	b	LBB0_7
LBB0_3:
	mov	x20, x2
	mov	x21, x1
	add	x0, x19, #12
	bl	_spin_lock_irqsave
	ldr	x8, [x19, #24]
	ldr	x9, [x19]
	add	x8, x8, x9, lsl #4
	ldr	w0, [x8, #8]
	mov	x1, x21
	mov	x2, x20
	bl	_memcpy
	ldr	x8, [x19, #24]
	ldr	x10, [x19]
	lsl	x9, x10, #4
	str	x20, [x8, x9]
Lloh5:
	adrp	x8, _WIIMOTE_BUFSIZE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _WIIMOTE_BUFSIZE@GOTPAGEOFF]
	add	x9, x10, #1
Lloh7:
	ldrsw	x8, [x8]
	udiv	x11, x9, x8
	msub	x8, x11, x8, x9
	ldrsw	x9, [x19, #8]
	cmp	x10, x9
	b.ne	LBB0_5
; %bb.4:
	mov	x0, x19
	str	x8, [x0], #16
	bl	_schedule_work
	b	LBB0_7
LBB0_5:
	cmp	x8, x9
	b.eq	LBB0_8
; %bb.6:
	str	x8, [x19]
LBB0_7:
	add	x0, x19, #12
	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
	b	_spin_unlock_irqrestore
LBB0_8:
	ldr	w0, [x19, #32]
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_hid_warn
	b	LBB0_2
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_HID_MAX_BUFFER_SIZE,8,3        ; @HID_MAX_BUFFER_SIZE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Sending too large output report\n"

	.comm	_WIIMOTE_BUFSIZE,4,2            ; @WIIMOTE_BUFSIZE
l_.str.1:                               ; @.str.1
	.asciz	"Output queue is full"

	.no_dead_strip	_wiimote_queue
.subsections_via_symbols
