	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function __wpad_read_wiimote
___wpad_read_wiimote:                   ## @__wpad_read_wiimote
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r12
	movq	%rdx, %r14
	movq	%rsi, %r15
	movq	%rdi, %rbx
	movq	_WPAD_ERR_TRANSFER@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 4(%rsi)
	movq	$0, 8(%rsi)
	movl	64(%rdi), %eax
	movl	%eax, 40(%rsi)
	movl	60(%rdi), %eax
	movl	%eax, 36(%rsi)
	movq	_WIIMOTE_STATE_CONNECTED@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_WIIMOTE_IS_SET
	testq	%rax, %rax
	je	LBB0_16
## %bb.1:
	movq	_WIIMOTE_STATE_HANDSHAKE_COMPLETE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_WIIMOTE_IS_SET
	testq	%rax, %rax
	je	LBB0_14
## %bb.2:
	movq	(%rbx), %rax
	movl	(%rax), %eax
	leal	-128(%rax), %ecx
	cmpl	$6, %ecx
	ja	LBB0_4
## %bb.3:
	movl	8(%rbx), %esi
	movzwl	%si, %eax
	movl	%eax, (%r15)
	movq	_WPAD_DATA_BUTTONS@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	orq	%rax, 8(%r15)
	movl	8(%r12), %edi
	movl	36(%rbx), %edx
	callq	_STATE_CHECK_SIMPLE
	movq	(%rbx), %rax
	movl	(%rax), %eax
LBB0_4:
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	leal	-130(%rax), %ecx
	cmpl	$3, %ecx
	ja	LBB0_6
## %bb.5:
	movl	56(%rbx), %eax
	movl	%eax, 32(%r15)
	movq	48(%rbx), %rax
	movq	%rax, 24(%r15)
	movq	_WPAD_DATA_ACCEL@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	orq	%rax, 8(%r15)
	movl	4(%r12), %edi
	movl	32(%rbx), %edx
	movl	56(%rbx), %esi
	callq	_STATE_CHECK
	movl	4(%r12), %edi
	movl	28(%rbx), %edx
	movl	52(%rbx), %esi
	callq	_STATE_CHECK
	movl	4(%r12), %edi
	movl	24(%rbx), %edx
	movl	48(%rbx), %esi
	callq	_STATE_CHECK
	movq	(%rbx), %rax
	movl	(%rax), %eax
LBB0_6:
	movq	%r15, -48(%rbp)                 ## 8-byte Spill
	andl	$-2, %eax
	cmpl	$130, %eax
	jne	LBB0_10
## %bb.7:
	movq	40(%rbx), %rax
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movq	%rax, 16(%rcx)
	movq	_WPAD_DATA_IR@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	orq	%rax, 8(%rcx)
	movq	_WPAD_MAX_IR_DOTS@GOTPCREL(%rip), %r15
	cmpl	$0, (%r15)
	jle	LBB0_10
## %bb.8:
	xorl	%r14d, %r14d
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r12), %edi
	movq	16(%rbx), %rax
	movq	40(%rbx), %rcx
	movl	(%rcx,%r14), %esi
	movl	8(%rax,%r14), %edx
	callq	_STATE_CHECK_SIMPLE
	movl	(%r12), %edi
	movq	16(%rbx), %rax
	movq	40(%rbx), %rcx
	movl	8(%rcx,%r14), %esi
	movl	4(%rax,%r14), %edx
	callq	_STATE_CHECK
	movl	(%r12), %edi
	movq	16(%rbx), %rax
	movq	40(%rbx), %rcx
	movl	4(%rcx,%r14), %esi
	movl	(%rax,%r14), %edx
	callq	_STATE_CHECK
	incq	%r13
	movslq	(%r15), %rax
	addq	$12, %r14
	cmpq	%rax, %r13
	jl	LBB0_9
LBB0_10:
	movq	(%rbx), %rax
	movl	(%rax), %eax
	addl	$-128, %eax
	cmpl	$4, %eax
	ja	LBB0_17
## %bb.11:
	cmpl	$3, %eax
	je	LBB0_17
## %bb.12:
	movq	%rbx, %rdi
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rsi
	movq	%r12, %rdx
	callq	___wpad_read_expansion
	movq	_WPAD_DATA_EXPANSION@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	orq	%rcx, 8(%r14)
	movq	_WPAD_ERR_NONE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 4(%r14)
	testl	%eax, %eax
	je	LBB0_18
## %bb.13:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	$0, (%rax)
	movq	%rbx, %rdi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	___save_state                   ## TAILCALL
LBB0_16:
	movq	_WPAD_ERR_NO_CONTROLLER@GOTPCREL(%rip), %rax
	jmp	LBB0_15
LBB0_14:
	movq	_WPAD_ERR_NOT_READY@GOTPCREL(%rip), %rax
LBB0_15:
	movl	(%rax), %eax
	movl	%eax, 4(%r15)
LBB0_18:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_17:
	movq	_WPAD_ERR_NONE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movl	%eax, 4(%rcx)
	jmp	LBB0_18
	.cfi_endproc
                                        ## -- End function
	.comm	_WPAD_ERR_TRANSFER,4,2          ## @WPAD_ERR_TRANSFER
	.comm	_WIIMOTE_STATE_CONNECTED,4,2    ## @WIIMOTE_STATE_CONNECTED
	.comm	_WIIMOTE_STATE_HANDSHAKE_COMPLETE,4,2 ## @WIIMOTE_STATE_HANDSHAKE_COMPLETE
	.comm	_WPAD_DATA_BUTTONS,8,3          ## @WPAD_DATA_BUTTONS
	.comm	_WPAD_DATA_ACCEL,8,3            ## @WPAD_DATA_ACCEL
	.comm	_WPAD_DATA_IR,8,3               ## @WPAD_DATA_IR
	.comm	_WPAD_MAX_IR_DOTS,4,2           ## @WPAD_MAX_IR_DOTS
	.comm	_WPAD_DATA_EXPANSION,8,3        ## @WPAD_DATA_EXPANSION
	.comm	_WPAD_ERR_NONE,4,2              ## @WPAD_ERR_NONE
	.comm	_WPAD_ERR_NOT_READY,4,2         ## @WPAD_ERR_NOT_READY
	.comm	_WPAD_ERR_NO_CONTROLLER,4,2     ## @WPAD_ERR_NO_CONTROLLER
	.no_dead_strip	___wpad_read_wiimote
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function __wpad_read_wiimote
___wpad_read_wiimote:                   ; @__wpad_read_wiimote
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x22, x3
	mov	x20, x2
	mov	x19, x1
	mov	x21, x0
Lloh0:
	adrp	x8, _WPAD_ERR_TRANSFER@GOTPAGE
Lloh1:
	ldr	x8, [x8, _WPAD_ERR_TRANSFER@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [x1, #4]
	str	xzr, [x1, #8]
	ldur	d0, [x0, #60]
	stur	d0, [x1, #36]
Lloh3:
	adrp	x8, _WIIMOTE_STATE_CONNECTED@GOTPAGE
Lloh4:
	ldr	x8, [x8, _WIIMOTE_STATE_CONNECTED@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	bl	_WIIMOTE_IS_SET
	cbz	x0, LBB0_13
; %bb.1:
Lloh6:
	adrp	x8, _WIIMOTE_STATE_HANDSHAKE_COMPLETE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _WIIMOTE_STATE_HANDSHAKE_COMPLETE@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_WIIMOTE_IS_SET
	cbz	x0, LBB0_14
; %bb.2:
	ldr	x8, [x21]
	ldr	w8, [x8]
	sub	w9, w8, #128
	cmp	w9, #6
	b.hi	LBB0_4
; %bb.3:
	ldr	w1, [x21, #8]
	and	w8, w1, #0xffff
	str	w8, [x19]
Lloh9:
	adrp	x8, _WPAD_DATA_BUTTONS@GOTPAGE
Lloh10:
	ldr	x8, [x8, _WPAD_DATA_BUTTONS@GOTPAGEOFF]
Lloh11:
	ldr	x8, [x8]
	ldr	x9, [x19, #8]
	orr	x8, x9, x8
	str	x8, [x19, #8]
	ldr	w0, [x22, #8]
	ldr	w2, [x21, #36]
	bl	_STATE_CHECK_SIMPLE
	ldr	x8, [x21]
	ldr	w8, [x8]
LBB0_4:
	sub	w9, w8, #130
	cmp	w9, #3
	b.hi	LBB0_6
; %bb.5:
	ldr	x8, [x21, #48]
	ldr	w9, [x21, #56]
	str	w9, [x19, #32]
	str	x8, [x19, #24]
Lloh12:
	adrp	x8, _WPAD_DATA_ACCEL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _WPAD_DATA_ACCEL@GOTPAGEOFF]
Lloh14:
	ldr	x8, [x8]
	ldr	x9, [x19, #8]
	orr	x8, x9, x8
	str	x8, [x19, #8]
	ldr	w0, [x22, #4]
	ldr	w1, [x21, #56]
	ldr	w2, [x21, #32]
	bl	_STATE_CHECK
	ldr	w0, [x22, #4]
	ldr	w1, [x21, #52]
	ldr	w2, [x21, #28]
	bl	_STATE_CHECK
	ldr	w0, [x22, #4]
	ldr	w1, [x21, #48]
	ldr	w2, [x21, #24]
	bl	_STATE_CHECK
	ldr	x8, [x21]
	ldr	w8, [x8]
LBB0_6:
	and	w8, w8, #0xfffffffe
	cmp	w8, #130
	b.ne	LBB0_10
; %bb.7:
	ldr	x8, [x21, #40]
Lloh15:
	adrp	x9, _WPAD_DATA_IR@GOTPAGE
Lloh16:
	ldr	x9, [x9, _WPAD_DATA_IR@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	ldr	x10, [x19, #8]
	orr	x9, x10, x9
	stp	x9, x8, [x19, #8]
Lloh18:
	adrp	x23, _WPAD_MAX_IR_DOTS@GOTPAGE
Lloh19:
	ldr	x23, [x23, _WPAD_MAX_IR_DOTS@GOTPAGEOFF]
	ldr	w8, [x23]
	cmp	w8, #1
	b.lt	LBB0_10
; %bb.8:
	mov	x24, #0
	mov	x25, #0
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x22]
	ldr	x8, [x21, #40]
	ldr	w1, [x8, x24]
	ldr	x8, [x21, #16]
	add	x8, x8, x24
	ldr	w2, [x8, #8]
	bl	_STATE_CHECK_SIMPLE
	ldr	w0, [x22]
	ldr	x8, [x21, #40]
	add	x8, x8, x24
	ldr	w1, [x8, #8]
	ldr	x8, [x21, #16]
	add	x8, x8, x24
	ldr	w2, [x8, #4]
	bl	_STATE_CHECK
	ldr	w0, [x22]
	ldr	x8, [x21, #40]
	add	x8, x8, x24
	ldr	w1, [x8, #4]
	ldr	x8, [x21, #16]
	ldr	w2, [x8, x24]
	bl	_STATE_CHECK
	add	x25, x25, #1
	ldrsw	x8, [x23]
	add	x24, x24, #12
	cmp	x25, x8
	b.lt	LBB0_9
LBB0_10:
	ldr	x8, [x21]
	ldr	w8, [x8]
	sub	w8, w8, #128
	cmp	w8, #4
	ccmp	w8, #3, #4, ls
	b.eq	LBB0_15
; %bb.11:
	mov	x0, x21
	mov	x1, x19
	mov	x2, x22
	bl	___wpad_read_expansion
Lloh20:
	adrp	x8, _WPAD_DATA_EXPANSION@GOTPAGE
Lloh21:
	ldr	x8, [x8, _WPAD_DATA_EXPANSION@GOTPAGEOFF]
Lloh22:
	ldr	x8, [x8]
	ldr	x9, [x19, #8]
	orr	x8, x9, x8
	str	x8, [x19, #8]
Lloh23:
	adrp	x8, _WPAD_ERR_NONE@GOTPAGE
Lloh24:
	ldr	x8, [x8, _WPAD_ERR_NONE@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
	str	w8, [x19, #4]
	cbz	w0, LBB0_17
; %bb.12:
	str	xzr, [x20]
	mov	x0, x21
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	___save_state
LBB0_13:
Lloh26:
	adrp	x8, _WPAD_ERR_NO_CONTROLLER@GOTPAGE
Lloh27:
	ldr	x8, [x8, _WPAD_ERR_NO_CONTROLLER@GOTPAGEOFF]
	b	LBB0_16
LBB0_14:
Lloh28:
	adrp	x8, _WPAD_ERR_NOT_READY@GOTPAGE
Lloh29:
	ldr	x8, [x8, _WPAD_ERR_NOT_READY@GOTPAGEOFF]
	b	LBB0_16
LBB0_15:
Lloh30:
	adrp	x8, _WPAD_ERR_NONE@GOTPAGE
Lloh31:
	ldr	x8, [x8, _WPAD_ERR_NONE@GOTPAGEOFF]
LBB0_16:
	ldr	w8, [x8]
	str	w8, [x19, #4]
LBB0_17:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.comm	_WPAD_ERR_TRANSFER,4,2          ; @WPAD_ERR_TRANSFER
	.comm	_WIIMOTE_STATE_CONNECTED,4,2    ; @WIIMOTE_STATE_CONNECTED
	.comm	_WIIMOTE_STATE_HANDSHAKE_COMPLETE,4,2 ; @WIIMOTE_STATE_HANDSHAKE_COMPLETE
	.comm	_WPAD_DATA_BUTTONS,8,3          ; @WPAD_DATA_BUTTONS
	.comm	_WPAD_DATA_ACCEL,8,3            ; @WPAD_DATA_ACCEL
	.comm	_WPAD_DATA_IR,8,3               ; @WPAD_DATA_IR
	.comm	_WPAD_MAX_IR_DOTS,4,2           ; @WPAD_MAX_IR_DOTS
	.comm	_WPAD_DATA_EXPANSION,8,3        ; @WPAD_DATA_EXPANSION
	.comm	_WPAD_ERR_NONE,4,2              ; @WPAD_ERR_NONE
	.comm	_WPAD_ERR_NOT_READY,4,2         ; @WPAD_ERR_NOT_READY
	.comm	_WPAD_ERR_NO_CONTROLLER,4,2     ; @WPAD_ERR_NO_CONTROLLER
	.no_dead_strip	___wpad_read_wiimote
.subsections_via_symbols
