	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wiimote_modules_load
_wiimote_modules_load:                  ## @wiimote_modules_load
	.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
	movq	%rdi, %r12
	movq	_wiimote_devtype_mods@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	movl	%esi, %ecx
	movq	(%rax,%rcx,8), %r14
	movq	_WIIMOD_NULL@GOTPCREL(%rip), %r15
	movq	(%r15), %r8
	movq	(%r14), %rax
	movq	%r14, %rbx
	cmpq	%r8, %rax
	je	LBB0_12
## %bb.1:
	movq	_wiimod_table@GOTPCREL(%rip), %r13
	movq	(%r13), %rdx
	movq	_WIIMOD_FLAG_INPUT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	leaq	8(%r14), %rdi
	movq	%rax, %rcx
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%rdx,%rcx,8), %rcx
	testl	%esi, (%rcx)
	jne	LBB0_4
## %bb.2:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	(%rdi), %rcx
	addq	$8, %rdi
	cmpq	%r8, %rcx
	jne	LBB0_3
	jmp	LBB0_6
LBB0_4:
	xorl	%eax, %eax
	callq	_input_allocate_device
	movq	%rax, (%r12)
	testq	%rax, %rax
	je	LBB0_21
## %bb.5:
	movq	%rax, %rdi
	movq	%r12, %rsi
	callq	_input_set_drvdata
	movq	(%r12), %rax
	movq	16(%r12), %rcx
	leaq	16(%rcx), %rdx
	movq	%rdx, 24(%rax)
	movups	(%rcx), %xmm0
	movups	%xmm0, 4(%rax)
	movq	_WIIMOTE_NAME@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, (%rax)
	movq	(%r14), %rax
	movq	(%r15), %r8
LBB0_6:
	movq	%r14, %rbx
	cmpq	%r8, %rax
	jne	LBB0_7
LBB0_12:
	movq	(%r12), %rdi
	testq	%rdi, %rdi
	je	LBB0_22
## %bb.13:
	callq	_input_register_device
	testl	%eax, %eax
	je	LBB0_22
LBB0_14:
	cmpq	%r14, %rbx
	je	LBB0_19
## %bb.15:
	movq	_wiimod_table@GOTPCREL(%rip), %r15
	jmp	LBB0_16
	.p2align	4, 0x90
LBB0_18:                                ##   in Loop: Header=BB0_16 Depth=1
	cmpq	%r14, %rbx
	je	LBB0_19
LBB0_16:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r15), %rax
	movq	-8(%rbx), %rcx
	addq	$-8, %rbx
	movq	(%rax,%rcx,8), %rdi
	movq	16(%rdi), %rax
	testq	%rax, %rax
	je	LBB0_18
## %bb.17:                              ##   in Loop: Header=BB0_16 Depth=1
	movq	%r12, %rsi
	callq	*%rax
	jmp	LBB0_18
LBB0_22:
	leaq	12(%r12), %r15
	movq	%r15, %rdi
	callq	_spin_lock_irq
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, 8(%r12)
	movq	%r15, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_spin_unlock_irq                ## TAILCALL
LBB0_19:
	movq	(%r12), %rdi
	testq	%rdi, %rdi
	je	LBB0_21
## %bb.20:
	callq	_input_free_device
	movq	$0, (%r12)
LBB0_21:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	%r14, %rbx
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_8 Depth=1
	movq	8(%rbx), %rax
	addq	$8, %rbx
	cmpq	%r8, %rax
	je	LBB0_12
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r13), %rcx
	movq	(%rcx,%rax,8), %rdi
	movq	8(%rdi), %rax
	testq	%rax, %rax
	je	LBB0_11
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	movq	%r12, %rsi
	callq	*%rax
	testl	%eax, %eax
	jne	LBB0_14
## %bb.10:                              ##   in Loop: Header=BB0_8 Depth=1
	movq	(%r15), %r8
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_wiimote_devtype_mods,8,3       ## @wiimote_devtype_mods
	.comm	_WIIMOD_NULL,8,3                ## @WIIMOD_NULL
	.comm	_wiimod_table,8,3               ## @wiimod_table
	.comm	_WIIMOD_FLAG_INPUT,4,2          ## @WIIMOD_FLAG_INPUT
	.comm	_WIIMOTE_NAME,4,2               ## @WIIMOTE_NAME
	.no_dead_strip	_wiimote_modules_load
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wiimote_modules_load
_wiimote_modules_load:                  ; @wiimote_modules_load
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _wiimote_devtype_mods@GOTPAGE
Lloh1:
	ldr	x8, [x8, _wiimote_devtype_mods@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	ldr	x21, [x8, w1, uxtw #3]
Lloh3:
	adrp	x22, _WIIMOD_NULL@GOTPAGE
Lloh4:
	ldr	x22, [x22, _WIIMOD_NULL@GOTPAGEOFF]
	ldr	x8, [x22]
	ldr	x9, [x21]
	cmp	x9, x8
	b.ne	LBB0_5
; %bb.1:
	mov	x24, x21
LBB0_2:
	ldr	x0, [x19]
	cbz	x0, LBB0_4
; %bb.3:
	bl	_input_register_device
	cbnz	w0, LBB0_16
LBB0_4:
	add	x21, x19, #12
	mov	x0, x21
	bl	_spin_lock_irq
	str	w20, [x19, #8]
	mov	x0, x21
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_spin_unlock_irq
LBB0_5:
Lloh5:
	adrp	x23, _wiimod_table@GOTPAGE
Lloh6:
	ldr	x23, [x23, _wiimod_table@GOTPAGEOFF]
	ldr	x10, [x23]
Lloh7:
	adrp	x11, _WIIMOD_FLAG_INPUT@GOTPAGE
Lloh8:
	ldr	x11, [x11, _WIIMOD_FLAG_INPUT@GOTPAGEOFF]
Lloh9:
	ldr	w11, [x11]
	mov	w12, #8
	mov	x13, x9
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x13, [x10, x13, lsl #3]
	ldr	w13, [x13]
	tst	w11, w13
	b.ne	LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	x13, [x21, x12]
	add	x12, x12, #8
	cmp	x13, x8
	b.ne	LBB0_6
	b	LBB0_10
LBB0_8:
	bl	_input_allocate_device
	str	x0, [x19]
	cbz	x0, LBB0_23
; %bb.9:
	mov	x1, x19
	bl	_input_set_drvdata
	ldr	x8, [x19, #16]
	ldr	x9, [x19]
	ldr	q0, [x8], #16
	str	x8, [x9, #24]
	stur	q0, [x9, #4]
Lloh10:
	adrp	x8, _WIIMOTE_NAME@GOTPAGE
Lloh11:
	ldr	x8, [x8, _WIIMOTE_NAME@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	str	w8, [x9]
	ldr	x9, [x21]
	ldr	x8, [x22]
LBB0_10:
	mov	x24, x21
	b	LBB0_13
LBB0_11:                                ;   in Loop: Header=BB0_13 Depth=1
	ldr	x8, [x22]
LBB0_12:                                ;   in Loop: Header=BB0_13 Depth=1
	ldr	x9, [x24, #8]!
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	cmp	x9, x8
	b.eq	LBB0_2
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=1
	ldr	x10, [x23]
	ldr	x0, [x10, x9, lsl #3]
	ldr	x9, [x0, #8]
	cbz	x9, LBB0_12
; %bb.15:                               ;   in Loop: Header=BB0_13 Depth=1
	mov	x1, x19
	blr	x9
	cbz	w0, LBB0_11
LBB0_16:
	cmp	x24, x21
	b.eq	LBB0_21
; %bb.17:
Lloh13:
	adrp	x20, _wiimod_table@GOTPAGE
Lloh14:
	ldr	x20, [x20, _wiimod_table@GOTPAGEOFF]
	b	LBB0_19
LBB0_18:                                ;   in Loop: Header=BB0_19 Depth=1
	cmp	x24, x21
	b.eq	LBB0_21
LBB0_19:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x24, #-8]!
	ldr	x9, [x20]
	ldr	x0, [x9, x8, lsl #3]
	ldr	x8, [x0, #16]
	cbz	x8, LBB0_18
; %bb.20:                               ;   in Loop: Header=BB0_19 Depth=1
	mov	x1, x19
	blr	x8
	b	LBB0_18
LBB0_21:
	ldr	x0, [x19]
	cbz	x0, LBB0_23
; %bb.22:
	bl	_input_free_device
	str	xzr, [x19]
LBB0_23:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_wiimote_devtype_mods,8,3       ; @wiimote_devtype_mods
	.comm	_WIIMOD_NULL,8,3                ; @WIIMOD_NULL
	.comm	_wiimod_table,8,3               ; @wiimod_table
	.comm	_WIIMOD_FLAG_INPUT,4,2          ; @WIIMOD_FLAG_INPUT
	.comm	_WIIMOTE_NAME,4,2               ; @WIIMOTE_NAME
	.no_dead_strip	_wiimote_modules_load
.subsections_via_symbols
