	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wiimote_cmd_read_ext
_wiimote_cmd_read_ext:                  ## @wiimote_cmd_read_ext
	.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, %r14
	movq	%rdi, %rbx
	movl	$10748154, %esi                 ## imm = 0xA400FA
	movq	%r14, %rdx
	movl	$6, %ecx
	callq	_wiimote_cmd_read
	movq	_WIIMOTE_EXT_NONE@GOTPCREL(%rip), %r15
	cmpl	$6, %eax
	jne	LBB0_28
## %bb.1:
	movl	(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdx
	callq	_hid_dbg
	movl	(%r14), %eax
	cmpl	$255, %eax
	jne	LBB0_7
## %bb.2:
	cmpl	$255, 4(%r14)
	jne	LBB0_7
## %bb.3:
	cmpl	$255, 8(%r14)
	jne	LBB0_7
## %bb.4:
	cmpl	$255, 12(%r14)
	jne	LBB0_7
## %bb.5:
	cmpl	$255, 16(%r14)
	jne	LBB0_7
## %bb.6:
	cmpl	$255, 20(%r14)
	je	LBB0_28
LBB0_7:
	movl	16(%r14), %edx
	movb	$1, %cl
	cmpl	$4, %edx
	je	LBB0_21
## %bb.8:
	cmpl	$1, %edx
	je	LBB0_12
## %bb.9:
	testl	%edx, %edx
	jne	LBB0_16
## %bb.10:
	cmpl	$0, 20(%r14)
	jne	LBB0_16
## %bb.11:
	movq	_WIIMOTE_EXT_NUNCHUK@GOTPCREL(%rip), %r15
	jmp	LBB0_28
LBB0_21:
	cmpl	$2, 20(%r14)
	jne	LBB0_16
## %bb.22:
	movq	_WIIMOTE_EXT_BALANCE_BOARD@GOTPCREL(%rip), %r15
	jmp	LBB0_28
LBB0_12:
	movl	20(%r14), %ecx
	cmpl	$1, %ecx
	je	LBB0_13
## %bb.14:
	cmpl	$32, %ecx
	jne	LBB0_15
## %bb.27:
	movq	_WIIMOTE_EXT_PRO_CONTROLLER@GOTPCREL(%rip), %r15
	jmp	LBB0_28
LBB0_13:
	movq	_WIIMOTE_EXT_CLASSIC_CONTROLLER@GOTPCREL(%rip), %r15
	jmp	LBB0_28
LBB0_15:
	xorl	%ecx, %ecx
LBB0_16:
	testl	%eax, %eax
	je	LBB0_23
## %bb.17:
	cmpl	$1, %eax
	jne	LBB0_26
## %bb.18:
	cmpl	$0, 4(%r14)
	setne	%al
	orb	%al, %cl
	jne	LBB0_26
## %bb.19:
	cmpl	$3, 20(%r14)
	jne	LBB0_26
## %bb.20:
	movq	_WIIMOTE_EXT_DRUMS@GOTPCREL(%rip), %r15
	jmp	LBB0_28
LBB0_23:
	cmpl	$0, 4(%r14)
	setne	%al
	orb	%al, %cl
	jne	LBB0_26
## %bb.24:
	cmpl	$3, 20(%r14)
	jne	LBB0_26
## %bb.25:
	movq	_WIIMOTE_EXT_GUITAR@GOTPCREL(%rip), %r15
	jmp	LBB0_28
LBB0_26:
	movq	_WIIMOTE_EXT_UNKNOWN@GOTPCREL(%rip), %r15
LBB0_28:
	movl	(%r15), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_WIIMOTE_EXT_NONE,4,2           ## @WIIMOTE_EXT_NONE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"extension ID: %6phC\n"

	.comm	_WIIMOTE_EXT_NUNCHUK,4,2        ## @WIIMOTE_EXT_NUNCHUK
	.comm	_WIIMOTE_EXT_CLASSIC_CONTROLLER,4,2 ## @WIIMOTE_EXT_CLASSIC_CONTROLLER
	.comm	_WIIMOTE_EXT_BALANCE_BOARD,4,2  ## @WIIMOTE_EXT_BALANCE_BOARD
	.comm	_WIIMOTE_EXT_PRO_CONTROLLER,4,2 ## @WIIMOTE_EXT_PRO_CONTROLLER
	.comm	_WIIMOTE_EXT_DRUMS,4,2          ## @WIIMOTE_EXT_DRUMS
	.comm	_WIIMOTE_EXT_GUITAR,4,2         ## @WIIMOTE_EXT_GUITAR
	.comm	_WIIMOTE_EXT_UNKNOWN,4,2        ## @WIIMOTE_EXT_UNKNOWN
	.no_dead_strip	_wiimote_cmd_read_ext
.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_ext
_wiimote_cmd_read_ext:                  ; @wiimote_cmd_read_ext
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x1
	mov	x20, x0
	mov	w1, #250
	movk	w1, #164, lsl #16
	mov	x2, x19
	mov	w3, #6
	bl	_wiimote_cmd_read
	cmp	w0, #6
	b.ne	LBB0_7
; %bb.1:
	ldr	w0, [x20]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x19
	bl	_hid_dbg
	ldr	w8, [x19]
	cmp	w8, #255
	b.ne	LBB0_8
; %bb.2:
	ldr	w9, [x19, #4]
	cmp	w9, #255
	b.ne	LBB0_8
; %bb.3:
	ldr	w9, [x19, #8]
	cmp	w9, #255
	b.ne	LBB0_8
; %bb.4:
	ldr	w9, [x19, #12]
	cmp	w9, #255
	b.ne	LBB0_8
; %bb.5:
	ldr	w9, [x19, #16]
	cmp	w9, #255
	b.ne	LBB0_8
; %bb.6:
	ldr	w9, [x19, #20]
	cmp	w9, #255
	b.ne	LBB0_8
LBB0_7:
Lloh2:
	adrp	x8, _WIIMOTE_EXT_NONE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _WIIMOTE_EXT_NONE@GOTPAGEOFF]
	b	LBB0_29
LBB0_8:
	ldr	w9, [x19, #16]
	cmp	w9, #4
	b.eq	LBB0_16
; %bb.9:
	cmp	w9, #1
	b.eq	LBB0_13
; %bb.10:
	cbnz	w9, LBB0_18
; %bb.11:
	ldr	w9, [x19, #20]
	cbnz	w9, LBB0_18
; %bb.12:
Lloh4:
	adrp	x8, _WIIMOTE_EXT_NUNCHUK@GOTPAGE
Lloh5:
	ldr	x8, [x8, _WIIMOTE_EXT_NUNCHUK@GOTPAGEOFF]
	b	LBB0_29
LBB0_13:
	ldr	w9, [x19, #20]
	cmp	w9, #1
	b.eq	LBB0_23
; %bb.14:
	cmp	w9, #32
	b.ne	LBB0_24
; %bb.15:
Lloh6:
	adrp	x8, _WIIMOTE_EXT_PRO_CONTROLLER@GOTPAGE
Lloh7:
	ldr	x8, [x8, _WIIMOTE_EXT_PRO_CONTROLLER@GOTPAGEOFF]
	b	LBB0_29
LBB0_16:
	ldr	w9, [x19, #20]
	cmp	w9, #2
	b.ne	LBB0_18
; %bb.17:
Lloh8:
	adrp	x8, _WIIMOTE_EXT_BALANCE_BOARD@GOTPAGE
Lloh9:
	ldr	x8, [x8, _WIIMOTE_EXT_BALANCE_BOARD@GOTPAGEOFF]
	b	LBB0_29
LBB0_18:
	mov	w9, #1
	cbz	w8, LBB0_25
LBB0_19:
	cmp	w8, #1
	b.ne	LBB0_28
; %bb.20:
	ldr	w8, [x19, #4]
	cmp	w8, #0
	cset	w8, ne
	orr	w8, w9, w8
	tbnz	w8, #0, LBB0_28
; %bb.21:
	ldr	w8, [x19, #20]
	cmp	w8, #3
	b.ne	LBB0_28
; %bb.22:
Lloh10:
	adrp	x8, _WIIMOTE_EXT_DRUMS@GOTPAGE
Lloh11:
	ldr	x8, [x8, _WIIMOTE_EXT_DRUMS@GOTPAGEOFF]
	b	LBB0_29
LBB0_23:
Lloh12:
	adrp	x8, _WIIMOTE_EXT_CLASSIC_CONTROLLER@GOTPAGE
Lloh13:
	ldr	x8, [x8, _WIIMOTE_EXT_CLASSIC_CONTROLLER@GOTPAGEOFF]
	b	LBB0_29
LBB0_24:
	mov	w9, #0
	cbnz	w8, LBB0_19
LBB0_25:
	ldr	w8, [x19, #4]
	cmp	w8, #0
	cset	w8, ne
	orr	w8, w9, w8
	tbnz	w8, #0, LBB0_28
; %bb.26:
	ldr	w8, [x19, #20]
	cmp	w8, #3
	b.ne	LBB0_28
; %bb.27:
Lloh14:
	adrp	x8, _WIIMOTE_EXT_GUITAR@GOTPAGE
Lloh15:
	ldr	x8, [x8, _WIIMOTE_EXT_GUITAR@GOTPAGEOFF]
	b	LBB0_29
LBB0_28:
Lloh16:
	adrp	x8, _WIIMOTE_EXT_UNKNOWN@GOTPAGE
Lloh17:
	ldr	x8, [x8, _WIIMOTE_EXT_UNKNOWN@GOTPAGEOFF]
LBB0_29:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_WIIMOTE_EXT_NONE,4,2           ; @WIIMOTE_EXT_NONE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"extension ID: %6phC\n"

	.comm	_WIIMOTE_EXT_NUNCHUK,4,2        ; @WIIMOTE_EXT_NUNCHUK
	.comm	_WIIMOTE_EXT_CLASSIC_CONTROLLER,4,2 ; @WIIMOTE_EXT_CLASSIC_CONTROLLER
	.comm	_WIIMOTE_EXT_BALANCE_BOARD,4,2  ; @WIIMOTE_EXT_BALANCE_BOARD
	.comm	_WIIMOTE_EXT_PRO_CONTROLLER,4,2 ; @WIIMOTE_EXT_PRO_CONTROLLER
	.comm	_WIIMOTE_EXT_DRUMS,4,2          ; @WIIMOTE_EXT_DRUMS
	.comm	_WIIMOTE_EXT_GUITAR,4,2         ; @WIIMOTE_EXT_GUITAR
	.comm	_WIIMOTE_EXT_UNKNOWN,4,2        ; @WIIMOTE_EXT_UNKNOWN
	.no_dead_strip	_wiimote_cmd_read_ext
.subsections_via_symbols
