	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function event_ack
_event_ack:                             ## @event_ack
	.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	%rsi, %rbx
	movq	%rdi, %r14
	movq	8(%rdi), %r15
	callq	_wiiuse_pressed_buttons
	testq	%r15, %r15
	je	LBB0_9
## %bb.1:
	movq	(%r15), %rax
	movq	_CMD_SENT@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_9
## %bb.2:
	movq	8(%r15), %rax
	movq	(%rax), %rax
	movq	_WM_CMD_READ_DATA@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_9
## %bb.3:
	movq	_WM_CMD_CTRL_STATUS@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_9
## %bb.4:
	cmpq	16(%rbx), %rax
	jne	LBB0_9
## %bb.5:
	cmpq	$0, 24(%rbx)
	je	LBB0_6
LBB0_9:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movq	32(%r15), %rax
	movq	%rax, 8(%r14)
	movq	_WIIUSE_ACK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 4(%r14)
	movq	_CMD_DONE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%r15)
	movq	24(%r15), %rax
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	movq	%r14, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	*%rax
LBB0_8:
	addq	$16, %r15
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	___lwp_queue_append
	movq	%r14, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_wiiuse_send_next_command       ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_CMD_SENT,8,3                   ## @CMD_SENT
	.comm	_WM_CMD_READ_DATA,8,3           ## @WM_CMD_READ_DATA
	.comm	_WM_CMD_CTRL_STATUS,8,3         ## @WM_CMD_CTRL_STATUS
	.comm	_WIIUSE_ACK,4,2                 ## @WIIUSE_ACK
	.comm	_CMD_DONE,8,3                   ## @CMD_DONE
	.no_dead_strip	_event_ack
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function event_ack
_event_ack:                             ; @event_ack
	.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	x20, x1
	mov	x19, x0
	ldr	x21, [x0, #8]
	bl	_wiiuse_pressed_buttons
	cbz	x21, LBB0_5
; %bb.1:
	ldr	x8, [x21]
Lloh0:
	adrp	x9, _CMD_SENT@GOTPAGE
Lloh1:
	ldr	x9, [x9, _CMD_SENT@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_5
; %bb.2:
	ldr	x8, [x21, #8]
	ldr	x8, [x8]
Lloh3:
	adrp	x9, _WM_CMD_READ_DATA@GOTPAGE
Lloh4:
	ldr	x9, [x9, _WM_CMD_READ_DATA@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
Lloh6:
	adrp	x10, _WM_CMD_CTRL_STATUS@GOTPAGE
Lloh7:
	ldr	x10, [x10, _WM_CMD_CTRL_STATUS@GOTPAGEOFF]
Lloh8:
	ldr	x10, [x10]
	cmp	x8, x9
	ccmp	x8, x10, #4, ne
	b.eq	LBB0_5
; %bb.3:
	ldr	x9, [x20, #16]
	cmp	x8, x9
	b.ne	LBB0_5
; %bb.4:
	ldr	x8, [x20, #24]
	cbz	x8, LBB0_6
LBB0_5:
	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_6:
	ldp	x8, x9, [x21, #24]
	str	x9, [x19, #8]
Lloh9:
	adrp	x9, _WIIUSE_ACK@GOTPAGE
Lloh10:
	ldr	x9, [x9, _WIIUSE_ACK@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	str	w9, [x19, #4]
Lloh12:
	adrp	x9, _CMD_DONE@GOTPAGE
Lloh13:
	ldr	x9, [x9, _CMD_DONE@GOTPAGEOFF]
Lloh14:
	ldr	x9, [x9]
	str	x9, [x21]
	cbz	x8, LBB0_8
; %bb.7:
	mov	x0, x19
	mov	x1, #0
	mov	w2, #0
	blr	x8
LBB0_8:
	add	x1, x21, #16
	mov	x0, x19
	bl	___lwp_queue_append
	mov	x0, x19
	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	_wiiuse_send_next_command
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_CMD_SENT,8,3                   ; @CMD_SENT
	.comm	_WM_CMD_READ_DATA,8,3           ; @WM_CMD_READ_DATA
	.comm	_WM_CMD_CTRL_STATUS,8,3         ; @WM_CMD_CTRL_STATUS
	.comm	_WIIUSE_ACK,4,2                 ; @WIIUSE_ACK
	.comm	_CMD_DONE,8,3                   ; @CMD_DONE
	.no_dead_strip	_event_ack
.subsections_via_symbols
