	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function handler_ext
_handler_ext:                           ## @handler_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	%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
	cmpq	$21, %rdx
	movl	$21, %ebx
	cmovbq	%rdx, %rbx
	cmpq	$6, %rbx
	jb	LBB0_29
## %bb.1:
	movq	%rsi, %r15
	movq	%rdi, %r14
	leaq	_handler_ext.invalid(%rip), %rsi
	movq	%r15, %rdi
	movq	%rbx, %rdx
	callq	_memcmp
	testl	%eax, %eax
	je	LBB0_29
## %bb.2:
	movl	(%r14), %eax
	movq	_WIIPROTO_FLAG_MP_ACTIVE@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_3
## %bb.4:
	testb	$1, 20(%r15)
	jne	LBB0_29
## %bb.5:
	testb	$1, 16(%r15)
	movq	_WIIPROTO_FLAG_MP_PLUGGED@GOTPCREL(%rip), %r12
	movl	(%r12), %ecx
	jne	LBB0_6
## %bb.8:
	testl	%eax, %ecx
	je	LBB0_11
## %bb.9:
	movl	24(%r14), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_hid_dbg
	movl	(%r12), %ecx
	notl	%ecx
	andl	(%r14), %ecx
	movl	%ecx, (%r14)
	movq	_WIIPROTO_FLAG_EXT_ACTIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	%ecx, %eax
	jmp	LBB0_10
LBB0_3:
	xorl	%r13d, %r13d
	jmp	LBB0_12
LBB0_6:
	testl	%eax, %ecx
	jne	LBB0_11
## %bb.7:
	movl	24(%r14), %edi
	leaq	L_.str(%rip), %rsi
	callq	_hid_dbg
	movl	(%r14), %eax
	orl	(%r12), %eax
LBB0_10:
	movl	%eax, (%r14)
	movq	%r14, %rdi
	callq	___wiimote_schedule
LBB0_11:
	movb	20(%r15), %r13b
	andb	$2, %r13b
	shrb	%r13b
	movl	(%r14), %eax
LBB0_12:
	movq	_WIIPROTO_FLAG_EXT_ACTIVE@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	jne	LBB0_14
## %bb.13:
	testb	%r13b, %r13b
	jne	LBB0_14
LBB0_29:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_14:
	movq	_wiimod_ext_table@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	8(%r14), %rcx
	movq	(%rax,%rcx,8), %r12
	testb	%r13b, %r13b
	je	LBB0_17
## %bb.15:
	movq	8(%r12), %rax
	testq	%rax, %rax
	jne	LBB0_16
## %bb.19:
	movq	_wiimod_mp@GOTPCREL(%rip), %rax
	movq	8(%rax), %rax
	testq	%rax, %rax
	jne	LBB0_16
	jmp	LBB0_21
LBB0_17:
	movq	%r12, %rdi
	movq	%rbx, %rsi
	callq	_valid_ext_handler
	testq	%rax, %rax
	jne	LBB0_18
## %bb.20:
	movq	_wiimod_mp@GOTPCREL(%rip), %r12
	movq	%r12, %rdi
	movq	%rbx, %rsi
	callq	_valid_ext_handler
	testq	%rax, %rax
	je	LBB0_21
LBB0_18:
	movq	(%r12), %rax
LBB0_16:
	movq	%r14, %rdi
	movq	%r15, %rsi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmpq	*%rax                           ## TAILCALL
LBB0_21:
	movq	_wiimote_devtype_mods@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	16(%r14), %rcx
	movq	(%rax,%rcx,8), %r12
	movl	(%r12), %ecx
	movq	_WIIMOD_NULL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	%eax, %ecx
	je	LBB0_29
## %bb.22:
	addq	$4, %r12
	movq	_wiimod_table@GOTPCREL(%rip), %rsi
	jmp	LBB0_23
LBB0_24:                                ##   in Loop: Header=BB0_23 Depth=1
	movq	8(%rdi), %rcx
	testq	%rcx, %rcx
	jne	LBB0_25
LBB0_28:                                ##   in Loop: Header=BB0_23 Depth=1
	movl	(%r12), %ecx
	addq	$4, %r12
	cmpl	%eax, %ecx
	je	LBB0_29
LBB0_23:                                ## =>This Inner Loop Header: Depth=1
	movq	(%rsi), %rdx
	movslq	%ecx, %rcx
	movq	(%rdx,%rcx,8), %rdi
	testb	%r13b, %r13b
	jne	LBB0_24
## %bb.26:                              ##   in Loop: Header=BB0_23 Depth=1
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rsi
	callq	_valid_ext_handler
	testq	%rax, %rax
	jne	LBB0_30
## %bb.27:                              ##   in Loop: Header=BB0_23 Depth=1
	movq	_WIIMOD_NULL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_wiimod_table@GOTPCREL(%rip), %rsi
	jmp	LBB0_28
LBB0_25:
	movq	%r14, %rdi
	movq	%r15, %rsi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmpq	*%rcx                           ## TAILCALL
LBB0_30:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	jmp	LBB0_16
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__const
	.p2align	4                               ## @handler_ext.invalid
_handler_ext.invalid:
	.long	255                             ## 0xff
	.long	255                             ## 0xff
	.long	255                             ## 0xff
	.long	255                             ## 0xff
	.long	255                             ## 0xff
	.long	255                             ## 0xff
	.long	255                             ## 0xff
	.long	255                             ## 0xff
	.long	255                             ## 0xff
	.long	255                             ## 0xff
	.long	255                             ## 0xff
	.long	255                             ## 0xff
	.long	255                             ## 0xff
	.long	255                             ## 0xff
	.long	255                             ## 0xff
	.long	255                             ## 0xff
	.long	255                             ## 0xff
	.long	255                             ## 0xff
	.long	255                             ## 0xff
	.long	255                             ## 0xff
	.long	255                             ## 0xff

	.comm	_WIIPROTO_FLAG_MP_ACTIVE,4,2    ## @WIIPROTO_FLAG_MP_ACTIVE
	.comm	_WIIPROTO_FLAG_MP_PLUGGED,4,2   ## @WIIPROTO_FLAG_MP_PLUGGED
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"MP hotplug: 1\n"

L_.str.1:                               ## @.str.1
	.asciz	"MP hotplug: 0\n"

	.comm	_WIIPROTO_FLAG_EXT_ACTIVE,4,2   ## @WIIPROTO_FLAG_EXT_ACTIVE
	.comm	_wiimod_ext_table,8,3           ## @wiimod_ext_table
	.comm	_wiimod_mp,16,3                 ## @wiimod_mp
	.comm	_wiimote_devtype_mods,8,3       ## @wiimote_devtype_mods
	.comm	_WIIMOD_NULL,4,2                ## @WIIMOD_NULL
	.comm	_wiimod_table,8,3               ## @wiimod_table
	.no_dead_strip	_handler_ext
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function handler_ext
_handler_ext:                           ; @handler_ext
	.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	w8, #21
	cmp	x2, #21
	csel	x21, x2, x8, lo
	cmp	x21, #6
	b.lo	LBB0_21
; %bb.1:
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x1, _handler_ext.invalid@PAGE
Lloh1:
	add	x1, x1, _handler_ext.invalid@PAGEOFF
	mov	x0, x19
	mov	x2, x21
	bl	_memcmp
	cbz	w0, LBB0_21
; %bb.2:
	ldr	w8, [x20]
Lloh2:
	adrp	x9, _WIIPROTO_FLAG_MP_ACTIVE@GOTPAGE
Lloh3:
	ldr	x9, [x9, _WIIPROTO_FLAG_MP_ACTIVE@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_7
; %bb.3:
	ldrb	w9, [x19, #20]
	tbnz	w9, #0, LBB0_21
; %bb.4:
Lloh5:
	adrp	x22, _WIIPROTO_FLAG_MP_PLUGGED@GOTPAGE
Lloh6:
	ldr	x22, [x22, _WIIPROTO_FLAG_MP_PLUGGED@GOTPAGEOFF]
	ldr	w9, [x22]
	and	w8, w9, w8
	ldrb	w9, [x19, #16]
	tbnz	w9, #0, LBB0_8
; %bb.5:
	cbz	w8, LBB0_11
; %bb.6:
	ldr	w0, [x20, #24]
Lloh7:
	adrp	x1, l_.str.1@PAGE
Lloh8:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_hid_dbg
	ldr	w8, [x22]
	ldr	w9, [x20]
	bic	w8, w9, w8
	str	w8, [x20]
Lloh9:
	adrp	x9, _WIIPROTO_FLAG_EXT_ACTIVE@GOTPAGE
Lloh10:
	ldr	x9, [x9, _WIIPROTO_FLAG_EXT_ACTIVE@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	bic	w8, w8, w9
	b	LBB0_10
LBB0_7:
	mov	w23, #0
	b	LBB0_12
LBB0_8:
	cbnz	w8, LBB0_11
; %bb.9:
	ldr	w0, [x20, #24]
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
	bl	_hid_dbg
	ldr	w8, [x22]
	ldr	w9, [x20]
	orr	w8, w9, w8
LBB0_10:
	str	w8, [x20]
	mov	x0, x20
	bl	___wiimote_schedule
LBB0_11:
	ldrb	w8, [x19, #20]
	ubfx	w23, w8, #1, #1
	ldr	w8, [x20]
LBB0_12:
Lloh14:
	adrp	x9, _WIIPROTO_FLAG_EXT_ACTIVE@GOTPAGE
Lloh15:
	ldr	x9, [x9, _WIIPROTO_FLAG_EXT_ACTIVE@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	and	w8, w9, w8
	cmp	w8, #0
	ccmp	w23, #0, #0, eq
	b.eq	LBB0_21
; %bb.13:
Lloh17:
	adrp	x8, _wiimod_ext_table@GOTPAGE
Lloh18:
	ldr	x8, [x8, _wiimod_ext_table@GOTPAGEOFF]
Lloh19:
	ldr	x8, [x8]
	ldr	x9, [x20, #8]
	ldr	x22, [x8, x9, lsl #3]
	cbz	w23, LBB0_16
; %bb.14:
	ldr	x2, [x22, #8]
	cbnz	x2, LBB0_19
; %bb.15:
Lloh20:
	adrp	x8, _wiimod_mp@GOTPAGE
Lloh21:
	ldr	x8, [x8, _wiimod_mp@GOTPAGEOFF]
Lloh22:
	ldr	x2, [x8, #8]
	cbnz	x2, LBB0_19
	b	LBB0_20
LBB0_16:
	mov	x0, x22
	mov	x1, x21
	bl	_valid_ext_handler
	cbnz	x0, LBB0_18
; %bb.17:
Lloh23:
	adrp	x22, _wiimod_mp@GOTPAGE
Lloh24:
	ldr	x22, [x22, _wiimod_mp@GOTPAGEOFF]
	mov	x0, x22
	mov	x1, x21
	bl	_valid_ext_handler
	cbz	x0, LBB0_20
LBB0_18:
	ldr	x2, [x22]
LBB0_19:
	mov	x0, x20
	mov	x1, x19
	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
	br	x2
LBB0_20:
Lloh25:
	adrp	x8, _wiimote_devtype_mods@GOTPAGE
Lloh26:
	ldr	x8, [x8, _wiimote_devtype_mods@GOTPAGEOFF]
Lloh27:
	ldr	x8, [x8]
	ldr	x9, [x20, #16]
	ldr	x10, [x8, x9, lsl #3]
	ldr	w9, [x10]
Lloh28:
	adrp	x24, _WIIMOD_NULL@GOTPAGE
Lloh29:
	ldr	x24, [x24, _WIIMOD_NULL@GOTPAGEOFF]
	ldr	w8, [x24]
	cmp	w9, w8
	b.ne	LBB0_22
LBB0_21:
	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
LBB0_22:
	add	x25, x10, #4
Lloh30:
	adrp	x26, _wiimod_table@GOTPAGE
Lloh31:
	ldr	x26, [x26, _wiimod_table@GOTPAGEOFF]
	b	LBB0_25
LBB0_23:                                ;   in Loop: Header=BB0_25 Depth=1
	ldr	x2, [x22, #8]
	cbnz	x2, LBB0_19
LBB0_24:                                ;   in Loop: Header=BB0_25 Depth=1
	ldr	w9, [x25], #4
	cmp	w9, w8
	b.eq	LBB0_21
LBB0_25:                                ; =>This Inner Loop Header: Depth=1
	ldr	x10, [x26]
	ldr	x22, [x10, w9, sxtw #3]
	cbnz	w23, LBB0_23
; %bb.26:                               ;   in Loop: Header=BB0_25 Depth=1
	mov	x0, x22
	mov	x1, x21
	bl	_valid_ext_handler
	cbnz	x0, LBB0_18
; %bb.27:                               ;   in Loop: Header=BB0_25 Depth=1
	ldr	w8, [x24]
	b	LBB0_24
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__const
	.p2align	2                               ; @handler_ext.invalid
_handler_ext.invalid:
	.long	255                             ; 0xff
	.long	255                             ; 0xff
	.long	255                             ; 0xff
	.long	255                             ; 0xff
	.long	255                             ; 0xff
	.long	255                             ; 0xff
	.long	255                             ; 0xff
	.long	255                             ; 0xff
	.long	255                             ; 0xff
	.long	255                             ; 0xff
	.long	255                             ; 0xff
	.long	255                             ; 0xff
	.long	255                             ; 0xff
	.long	255                             ; 0xff
	.long	255                             ; 0xff
	.long	255                             ; 0xff
	.long	255                             ; 0xff
	.long	255                             ; 0xff
	.long	255                             ; 0xff
	.long	255                             ; 0xff
	.long	255                             ; 0xff

	.comm	_WIIPROTO_FLAG_MP_ACTIVE,4,2    ; @WIIPROTO_FLAG_MP_ACTIVE
	.comm	_WIIPROTO_FLAG_MP_PLUGGED,4,2   ; @WIIPROTO_FLAG_MP_PLUGGED
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"MP hotplug: 1\n"

l_.str.1:                               ; @.str.1
	.asciz	"MP hotplug: 0\n"

	.comm	_WIIPROTO_FLAG_EXT_ACTIVE,4,2   ; @WIIPROTO_FLAG_EXT_ACTIVE
	.comm	_wiimod_ext_table,8,3           ; @wiimod_ext_table
	.comm	_wiimod_mp,16,3                 ; @wiimod_mp
	.comm	_wiimote_devtype_mods,8,3       ; @wiimote_devtype_mods
	.comm	_WIIMOD_NULL,4,2                ; @WIIMOD_NULL
	.comm	_wiimod_table,8,3               ; @wiimod_table
	.no_dead_strip	_handler_ext
.subsections_via_symbols
