	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function event_data_read
_event_data_read:                       ## @event_data_read
	.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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -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_10
## %bb.1:
	movq	(%r15), %rax
	movq	_CMD_SENT@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_10
## %bb.2:
	movq	8(%r15), %r13
	movq	(%r13), %rax
	movq	_WM_CMD_READ_DATA@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_10
## %bb.3:
	movl	8(%rbx), %r12d
	testb	$15, %r12b
	je	LBB0_6
## %bb.4:
	movq	32(%r15), %rcx
	movq	%rcx, 8(%r14)
	movq	_CMD_DONE@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	%rcx, (%r15)
	movq	24(%r15), %rcx
	testq	%rcx, %rcx
	je	LBB0_9
## %bb.5:
	movq	8(%r13), %rdx
	movq	24(%r13), %rsi
	subq	%rax, %rdx
	movq	%r14, %rdi
	callq	*%rcx
LBB0_9:
	addq	$16, %r15
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	___lwp_queue_append
	movq	%r14, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_wiiuse_send_next_command       ## TAILCALL
LBB0_6:
	shrl	$4, %r12d
	andl	$15, %r12d
	incq	%r12
	movq	12(%rbx), %rdi
	callq	_BIG_ENDIAN_SHORT
	movzwl	16(%r13), %ecx
	movl	%ecx, 16(%r13)
	movq	(%r13), %rdx
	subq	%r12, %rdx
	xorl	%esi, %esi
	cmpq	8(%r13), %rdx
	cmovlq	%rdx, %rsi
	movq	%rsi, (%r13)
	subq	%rcx, %rax
	addq	24(%r13), %rax
	addq	$20, %rbx
	movq	%rax, %rdi
	movq	%rbx, %rsi
	movl	%r12d, %edx
	callq	_memcpy
	cmpq	$0, (%r13)
	je	LBB0_7
LBB0_10:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	32(%r15), %rax
	movq	%rax, 8(%r14)
	movq	_WIIUSE_READ_DATA@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_9
## %bb.8:
	movq	8(%r13), %rdx
	movq	24(%r13), %rsi
	movq	%r14, %rdi
	callq	*%rax
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.comm	_CMD_SENT,8,3                   ## @CMD_SENT
	.comm	_WM_CMD_READ_DATA,8,3           ## @WM_CMD_READ_DATA
	.comm	_CMD_DONE,8,3                   ## @CMD_DONE
	.comm	_WIIUSE_READ_DATA,4,2           ## @WIIUSE_READ_DATA
	.no_dead_strip	_event_data_read
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function event_data_read
_event_data_read:                       ; @event_data_read
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x20, x1
	mov	x19, x0
	ldr	x22, [x0, #8]
	bl	_wiiuse_pressed_buttons
	cbz	x22, LBB0_8
; %bb.1:
	ldr	x8, [x22]
Lloh0:
	adrp	x9, _CMD_SENT@GOTPAGE
Lloh1:
	ldr	x9, [x9, _CMD_SENT@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_8
; %bb.2:
	ldr	x23, [x22, #8]
	ldr	x8, [x23]
Lloh3:
	adrp	x9, _WM_CMD_READ_DATA@GOTPAGE
Lloh4:
	ldr	x9, [x9, _WM_CMD_READ_DATA@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_8
; %bb.3:
	ldr	w9, [x20, #8]
	tst	w9, #0xf
	b.eq	LBB0_7
; %bb.4:
	ldp	x9, x10, [x22, #24]
	str	x10, [x19, #8]
Lloh6:
	adrp	x10, _CMD_DONE@GOTPAGE
Lloh7:
	ldr	x10, [x10, _CMD_DONE@GOTPAGEOFF]
Lloh8:
	ldr	x10, [x10]
	str	x10, [x22]
	cbz	x9, LBB0_6
; %bb.5:
	ldr	x1, [x23, #24]
	ldr	x10, [x23, #8]
	sub	x2, x10, x8
	mov	x0, x19
	blr	x9
LBB0_6:
	add	x1, x22, #16
	mov	x0, x19
	bl	___lwp_queue_append
	mov	x0, x19
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_wiiuse_send_next_command
LBB0_7:
	ubfx	x8, x9, #4, #4
	add	x21, x8, #1
	ldur	x0, [x20, #12]
	bl	_BIG_ENDIAN_SHORT
	ldrh	w8, [x23, #16]
	str	w8, [x23, #16]
	ldp	x9, x10, [x23]
	sub	x9, x9, x21
	cmp	x9, x10
	csel	x9, x9, xzr, lt
	str	x9, [x23]
	ldr	x9, [x23, #24]
	sub	x8, x0, x8
	add	x0, x8, x9
	add	x1, x20, #20
	mov	x2, x21
	bl	_memcpy
	ldr	x8, [x23]
	cbz	x8, LBB0_9
LBB0_8:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_9:
	ldp	x8, x9, [x22, #24]
	str	x9, [x19, #8]
Lloh9:
	adrp	x9, _WIIUSE_READ_DATA@GOTPAGE
Lloh10:
	ldr	x9, [x9, _WIIUSE_READ_DATA@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, [x22]
	cbz	x8, LBB0_6
; %bb.10:
	ldr	x1, [x23, #24]
	ldr	x2, [x23, #8]
	mov	x0, x19
	blr	x8
	b	LBB0_6
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.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	_CMD_DONE,8,3                   ; @CMD_DONE
	.comm	_WIIUSE_READ_DATA,4,2           ; @WIIUSE_READ_DATA
	.no_dead_strip	_event_data_read
.subsections_via_symbols
