	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wiimote_modules_unload
_wiimote_modules_unload:                ## @wiimote_modules_unload
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	_wiimote_devtype_mods@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	8(%rdi), %rcx
	movq	(%rax,%rcx,8), %r12
	leaq	16(%rdi), %r14
	movq	%r14, %rdi
	callq	_spin_lock_irqsave
	movq	_WIIMOTE_DEV_UNKNOWN@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 8(%r15)
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
	movq	_WIIMOD_NULL@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	$-8, %rbx
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rcx
	addq	$8, %rbx
	cmpq	%rax, 8(%r12,%rcx)
	jne	LBB0_1
## %bb.2:
	movq	(%r15), %rdi
	testq	%rdi, %rdi
	je	LBB0_4
## %bb.3:
	callq	_input_get_device
	movq	(%r15), %rdi
	callq	_input_unregister_device
LBB0_4:
	testq	%rbx, %rbx
	je	LBB0_9
## %bb.5:
	movq	_wiimod_table@GOTPCREL(%rip), %r14
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_6 Depth=1
	addq	$-8, %rbx
	je	LBB0_9
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r14), %rax
	movq	-8(%r12,%rbx), %rcx
	movq	(%rax,%rcx,8), %rdi
	movq	(%rdi), %rax
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	movq	%r15, %rsi
	callq	*%rax
	jmp	LBB0_8
LBB0_9:
	movq	(%r15), %rdi
	testq	%rdi, %rdi
	je	LBB0_11
## %bb.10:
	callq	_input_put_device
	movq	$0, (%r15)
LBB0_11:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_wiimote_devtype_mods,8,3       ## @wiimote_devtype_mods
	.comm	_WIIMOTE_DEV_UNKNOWN,8,3        ## @WIIMOTE_DEV_UNKNOWN
	.comm	_WIIMOD_NULL,8,3                ## @WIIMOD_NULL
	.comm	_wiimod_table,8,3               ## @wiimod_table
	.no_dead_strip	_wiimote_modules_unload
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wiimote_modules_unload
_wiimote_modules_unload:                ; @wiimote_modules_unload
	.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
Lloh0:
	adrp	x8, _wiimote_devtype_mods@GOTPAGE
Lloh1:
	ldr	x8, [x8, _wiimote_devtype_mods@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	ldr	x9, [x0, #8]
	ldr	x21, [x8, x9, lsl #3]
	add	x20, x0, #16
	mov	x0, x20
	bl	_spin_lock_irqsave
Lloh3:
	adrp	x8, _WIIMOTE_DEV_UNKNOWN@GOTPAGE
Lloh4:
	ldr	x8, [x8, _WIIMOTE_DEV_UNKNOWN@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	str	x8, [x19, #8]
	mov	x0, x20
	bl	_spin_unlock_irqrestore
	mov	x20, #0
Lloh6:
	adrp	x8, _WIIMOD_NULL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _WIIMOD_NULL@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x21, x20]
	add	x20, x20, #8
	cmp	x9, x8
	b.ne	LBB0_1
; %bb.2:
	ldr	x0, [x19]
	cbz	x0, LBB0_4
; %bb.3:
	bl	_input_get_device
	ldr	x0, [x19]
	bl	_input_unregister_device
LBB0_4:
	cmp	x20, #8
	b.eq	LBB0_9
; %bb.5:
	sub	x21, x21, #16
Lloh9:
	adrp	x22, _wiimod_table@GOTPAGE
Lloh10:
	ldr	x22, [x22, _wiimod_table@GOTPAGEOFF]
	b	LBB0_7
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	sub	x20, x20, #8
	cmp	x20, #8
	b.eq	LBB0_9
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x22]
	ldr	x9, [x21, x20]
	ldr	x0, [x8, x9, lsl #3]
	ldr	x8, [x0]
	cbz	x8, LBB0_6
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	mov	x1, x19
	blr	x8
	b	LBB0_6
LBB0_9:
	ldr	x0, [x19]
	cbz	x0, LBB0_11
; %bb.10:
	bl	_input_put_device
	str	xzr, [x19]
LBB0_11:
	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	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_wiimote_devtype_mods,8,3       ; @wiimote_devtype_mods
	.comm	_WIIMOTE_DEV_UNKNOWN,8,3        ; @WIIMOTE_DEV_UNKNOWN
	.comm	_WIIMOD_NULL,8,3                ; @WIIMOD_NULL
	.comm	_wiimod_table,8,3               ; @wiimod_table
	.no_dead_strip	_wiimote_modules_unload
.subsections_via_symbols
