	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_wiiuse_motion_plus_check       ## -- Begin function wiiuse_motion_plus_check
	.p2align	4, 0x90
_wiiuse_motion_plus_check:              ## @wiiuse_motion_plus_check
	.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, %r14
	testq	%rsi, %rsi
	je	LBB0_3
## %bb.1:
	movq	%rsi, %rbx
	movq	_WIIMOTE_STATE_EXP@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	%r14, %rdi
	callq	_WIIMOTE_DISABLE_STATE
	movq	_WIIMOTE_STATE_EXP_FAILED@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_WIIMOTE_DISABLE_STATE
	movq	_WIIMOTE_STATE_EXP_HANDSHAKE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_WIIMOTE_DISABLE_STATE
	movl	8(%rbx), %eax
	movl	12(%rbx), %ecx
	shll	$16, %ecx
	shll	$24, %eax
	orl	%ecx, %eax
	movl	16(%rbx), %ecx
	shll	$8, %ecx
	orl	%eax, %ecx
	orl	20(%rbx), %ecx
	movq	_EXP_ID_CODE_MOTION_PLUS@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ecx
	jne	LBB0_2
## %bb.4:
	movq	_WIIUSE_MOTION_PLUS_ACTIVATED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 4(%r14)
	movq	_EXP_MOTION_PLUS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r14)
	movl	(%r15), %esi
	movq	%r14, %rdi
	callq	_WIIMOTE_ENABLE_STATE
	movq	%r14, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_wiiuse_set_ir_mode             ## TAILCALL
LBB0_3:
	movl	8(%r14), %esi
	movq	_WM_EXP_ID@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	_wiiuse_motion_plus_check(%rip), %r8
	movq	%r14, %rdi
	movl	$6, %ecx
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_wiiuse_read_data               ## TAILCALL
LBB0_2:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_WM_EXP_ID,4,2                  ## @WM_EXP_ID
	.comm	_WIIMOTE_STATE_EXP,4,2          ## @WIIMOTE_STATE_EXP
	.comm	_WIIMOTE_STATE_EXP_FAILED,4,2   ## @WIIMOTE_STATE_EXP_FAILED
	.comm	_WIIMOTE_STATE_EXP_HANDSHAKE,4,2 ## @WIIMOTE_STATE_EXP_HANDSHAKE
	.comm	_EXP_ID_CODE_MOTION_PLUS,4,2    ## @EXP_ID_CODE_MOTION_PLUS
	.comm	_WIIUSE_MOTION_PLUS_ACTIVATED,4,2 ## @WIIUSE_MOTION_PLUS_ACTIVATED
	.comm	_EXP_MOTION_PLUS,4,2            ## @EXP_MOTION_PLUS
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_wiiuse_motion_plus_check       ; -- Begin function wiiuse_motion_plus_check
	.p2align	2
_wiiuse_motion_plus_check:              ; @wiiuse_motion_plus_check
	.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
	cbz	x1, LBB0_3
; %bb.1:
	mov	x20, x1
Lloh0:
	adrp	x21, _WIIMOTE_STATE_EXP@GOTPAGE
Lloh1:
	ldr	x21, [x21, _WIIMOTE_STATE_EXP@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	x0, x19
	bl	_WIIMOTE_DISABLE_STATE
Lloh2:
	adrp	x8, _WIIMOTE_STATE_EXP_FAILED@GOTPAGE
Lloh3:
	ldr	x8, [x8, _WIIMOTE_STATE_EXP_FAILED@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_WIIMOTE_DISABLE_STATE
Lloh5:
	adrp	x8, _WIIMOTE_STATE_EXP_HANDSHAKE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _WIIMOTE_STATE_EXP_HANDSHAKE@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_WIIMOTE_DISABLE_STATE
	ldp	w9, w8, [x20, #8]
	lsl	w9, w9, #24
	orr	w8, w9, w8, lsl #16
	ldp	w9, w10, [x20, #16]
	orr	w8, w8, w9, lsl #8
	orr	w8, w8, w10
Lloh8:
	adrp	x9, _EXP_ID_CODE_MOTION_PLUS@GOTPAGE
Lloh9:
	ldr	x9, [x9, _EXP_ID_CODE_MOTION_PLUS@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_4
; %bb.2:
Lloh11:
	adrp	x8, _WIIUSE_MOTION_PLUS_ACTIVATED@GOTPAGE
Lloh12:
	ldr	x8, [x8, _WIIUSE_MOTION_PLUS_ACTIVATED@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
Lloh14:
	adrp	x9, _EXP_MOTION_PLUS@GOTPAGE
Lloh15:
	ldr	x9, [x9, _EXP_MOTION_PLUS@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	stp	w9, w8, [x19]
	ldr	w1, [x21]
	mov	x0, x19
	bl	_WIIMOTE_ENABLE_STATE
	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_set_ir_mode
LBB0_3:
	ldr	w1, [x19, #8]
Lloh17:
	adrp	x8, _WM_EXP_ID@GOTPAGE
Lloh18:
	ldr	x8, [x8, _WM_EXP_ID@GOTPAGEOFF]
Lloh19:
	adrp	x4, _wiiuse_motion_plus_check@PAGE
Lloh20:
	add	x4, x4, _wiiuse_motion_plus_check@PAGEOFF
Lloh21:
	ldr	w2, [x8]
	mov	x0, x19
	mov	w3, #6
	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_read_data
LBB0_4:
	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
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_WM_EXP_ID,4,2                  ; @WM_EXP_ID
	.comm	_WIIMOTE_STATE_EXP,4,2          ; @WIIMOTE_STATE_EXP
	.comm	_WIIMOTE_STATE_EXP_FAILED,4,2   ; @WIIMOTE_STATE_EXP_FAILED
	.comm	_WIIMOTE_STATE_EXP_HANDSHAKE,4,2 ; @WIIMOTE_STATE_EXP_HANDSHAKE
	.comm	_EXP_ID_CODE_MOTION_PLUS,4,2    ; @EXP_ID_CODE_MOTION_PLUS
	.comm	_WIIUSE_MOTION_PLUS_ACTIVATED,4,2 ; @WIIUSE_MOTION_PLUS_ACTIVATED
	.comm	_EXP_MOTION_PLUS,4,2            ; @EXP_MOTION_PLUS
.subsections_via_symbols
