	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function wiimote_cmd_read_mp_mapped
LCPI0_0:
	.long	255                             ## 0xff
	.long	255                             ## 0xff
	.long	255                             ## 0xff
	.long	255                             ## 0xff
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_wiimote_cmd_read_mp_mapped:            ## @wiimote_cmd_read_mp_mapped
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	subq	$32, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -24(%rbp)
	leaq	-48(%rbp), %rdx
	movl	$10748154, %esi                 ## imm = 0xA400FA
	movl	$6, %ecx
	callq	_wiimote_cmd_read
	movq	_WIIMOTE_MP_NONE@GOTPCREL(%rip), %r14
	cmpl	$6, %eax
	jne	LBB0_13
## %bb.1:
	movl	(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	leaq	-48(%rbp), %rdx
	callq	_hid_dbg
	movdqa	-48(%rbp), %xmm0
	psubd	LCPI0_0(%rip), %xmm0
	ptest	%xmm0, %xmm0
	movl	-32(%rbp), %eax
	movl	-28(%rbp), %ecx
	jne	LBB0_4
## %bb.2:
	cmpl	$255, %eax
	jne	LBB0_4
## %bb.3:
	cmpl	$255, %ecx
	je	LBB0_13
LBB0_4:
	cmpl	$4, %eax
	jne	LBB0_7
## %bb.5:
	cmpl	$5, %ecx
	jne	LBB0_7
## %bb.6:
	movq	_WIIMOTE_MP_SINGLE@GOTPCREL(%rip), %r14
	jmp	LBB0_13
LBB0_7:
	cmpl	$5, %eax
	jne	LBB0_10
## %bb.8:
	cmpl	$5, %ecx
	jne	LBB0_10
## %bb.9:
	movq	_WIIMOTE_MP_PASSTHROUGH_NUNCHUK@GOTPCREL(%rip), %r14
	jmp	LBB0_13
LBB0_10:
	xorl	$5, %ecx
	xorl	$7, %eax
	orl	%ecx, %eax
	jne	LBB0_11
## %bb.12:
	movq	_WIIMOTE_MP_PASSTHROUGH_CLASSIC@GOTPCREL(%rip), %r14
	jmp	LBB0_13
LBB0_11:
	movq	_WIIMOTE_MP_UNKNOWN@GOTPCREL(%rip), %r14
LBB0_13:
	movl	(%r14), %eax
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-24(%rbp), %rcx
	jne	LBB0_15
## %bb.14:
	addq	$32, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_15:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_WIIMOTE_MP_NONE,4,2            ## @WIIMOTE_MP_NONE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"mapped motion plus ID: %6phC\n"

	.comm	_WIIMOTE_MP_SINGLE,4,2          ## @WIIMOTE_MP_SINGLE
	.comm	_WIIMOTE_MP_PASSTHROUGH_NUNCHUK,4,2 ## @WIIMOTE_MP_PASSTHROUGH_NUNCHUK
	.comm	_WIIMOTE_MP_PASSTHROUGH_CLASSIC,4,2 ## @WIIMOTE_MP_PASSTHROUGH_CLASSIC
	.comm	_WIIMOTE_MP_UNKNOWN,4,2         ## @WIIMOTE_MP_UNKNOWN
	.no_dead_strip	_wiimote_cmd_read_mp_mapped
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wiimote_cmd_read_mp_mapped
_wiimote_cmd_read_mp_mapped:            ; @wiimote_cmd_read_mp_mapped
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	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
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-24]
	add	x2, sp, #16
	mov	w1, #250
	movk	w1, #164, lsl #16
	mov	w3, #6
	bl	_wiimote_cmd_read
	cmp	w0, #6
	b.ne	LBB0_4
; %bb.1:
	ldr	w0, [x19]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	add	x2, sp, #16
	bl	_hid_dbg
	ldr	q0, [sp, #16]
	movi.2d	v1, #0x0000ff000000ff
	cmeq.4s	v0, v0, v1
	mvn.16b	v0, v0
	xtn.4h	v0, v0
	umov.h	w10, v0[0]
	umov.h	w8, v0[1]
	and	w8, w8, #0x1
	bfi	w10, w8, #1, #1
	umov.h	w8, v0[2]
	and	w8, w8, #0x1
	bfi	w10, w8, #2, #1
	umov.h	w8, v0[3]
	bfi	w10, w8, #3, #29
	ldp	w8, w9, [sp, #32]
	tst	w10, #0xf
	b.ne	LBB0_7
; %bb.2:
	cmp	w8, #255
	b.ne	LBB0_7
; %bb.3:
	cmp	w9, #255
	b.ne	LBB0_7
LBB0_4:
Lloh5:
	adrp	x8, _WIIMOTE_MP_NONE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _WIIMOTE_MP_NONE@GOTPAGEOFF]
LBB0_5:
	ldr	w0, [x8]
	ldur	x8, [x29, #-24]
Lloh7:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh8:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh9:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_14
; %bb.6:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_7:
	cmp	w8, #4
	b.ne	LBB0_10
; %bb.8:
	cmp	w9, #5
	b.ne	LBB0_10
; %bb.9:
Lloh10:
	adrp	x8, _WIIMOTE_MP_SINGLE@GOTPAGE
Lloh11:
	ldr	x8, [x8, _WIIMOTE_MP_SINGLE@GOTPAGEOFF]
	b	LBB0_5
LBB0_10:
	cmp	w8, #5
	b.ne	LBB0_13
; %bb.11:
	cmp	w9, #5
	b.ne	LBB0_13
; %bb.12:
Lloh12:
	adrp	x8, _WIIMOTE_MP_PASSTHROUGH_NUNCHUK@GOTPAGE
Lloh13:
	ldr	x8, [x8, _WIIMOTE_MP_PASSTHROUGH_NUNCHUK@GOTPAGEOFF]
	b	LBB0_5
LBB0_13:
	cmp	w9, #5
	ccmp	w8, #7, #0, eq
Lloh14:
	adrp	x8, _WIIMOTE_MP_UNKNOWN@GOTPAGE
Lloh15:
	ldr	x8, [x8, _WIIMOTE_MP_UNKNOWN@GOTPAGEOFF]
Lloh16:
	adrp	x9, _WIIMOTE_MP_PASSTHROUGH_CLASSIC@GOTPAGE
Lloh17:
	ldr	x9, [x9, _WIIMOTE_MP_PASSTHROUGH_CLASSIC@GOTPAGEOFF]
	csel	x8, x9, x8, eq
	b	LBB0_5
LBB0_14:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_WIIMOTE_MP_NONE,4,2            ; @WIIMOTE_MP_NONE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"mapped motion plus ID: %6phC\n"

	.comm	_WIIMOTE_MP_SINGLE,4,2          ; @WIIMOTE_MP_SINGLE
	.comm	_WIIMOTE_MP_PASSTHROUGH_NUNCHUK,4,2 ; @WIIMOTE_MP_PASSTHROUGH_NUNCHUK
	.comm	_WIIMOTE_MP_PASSTHROUGH_CLASSIC,4,2 ; @WIIMOTE_MP_PASSTHROUGH_CLASSIC
	.comm	_WIIMOTE_MP_UNKNOWN,4,2         ; @WIIMOTE_MP_UNKNOWN
	.no_dead_strip	_wiimote_cmd_read_mp_mapped
.subsections_via_symbols
