	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_WPAD_Init                      ## -- Begin function WPAD_Init
	.p2align	4, 0x90
_WPAD_Init:                             ## @WPAD_Init
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	callq	__CPU_ISR_Disable
	movq	___wpads_inited@GOTPCREL(%rip), %r14
	movq	(%r14), %rax
	movq	_WPAD_STATE_DISABLED@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_13
## %bb.1:
	movq	___wpads_ponded@GOTPCREL(%rip), %rax
	movq	$0, (%rax)
	movq	___wpads_active@GOTPCREL(%rip), %rax
	movq	$0, (%rax)
	movq	___wpdcb@GOTPCREL(%rip), %r15
	movq	(%r15), %rdi
	movq	_WPAD_MAX_WIIMOTES@GOTPCREL(%rip), %r12
	movl	(%r12), %edx
	shll	$2, %edx
	xorl	%esi, %esi
	callq	_memset
	movq	___wpad_devs@GOTPCREL(%rip), %rdi
	xorl	%esi, %esi
	movl	$4, %edx
	callq	_memset
	movq	___wpad_keys@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movl	(%r12), %edx
	shll	$2, %edx
	xorl	%esi, %esi
	callq	_memset
	cmpl	$0, (%r12)
	jle	LBB0_4
## %bb.2:
	movq	(%r15), %rax
	addq	$28, %rax
	xorl	%ecx, %ecx
	movq	_WPAD_THRESH_DEFAULT_BUTTONS@GOTPCREL(%rip), %r8
	movq	_WPAD_THRESH_DEFAULT_IR@GOTPCREL(%rip), %r9
	movq	_WPAD_THRESH_DEFAULT_ACCEL@GOTPCREL(%rip), %rdi
	movq	_WPAD_THRESH_DEFAULT_JOYSTICK@GOTPCREL(%rip), %rbx
	movq	_WPAD_THRESH_DEFAULT_MOTION_PLUS@GOTPCREL(%rip), %rdx
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r8), %esi
	movl	%esi, (%rax)
	movl	(%r9), %esi
	movl	%esi, -4(%rax)
	movl	(%rdi), %esi
	movl	%esi, -8(%rax)
	movl	(%rbx), %esi
	movl	%esi, -12(%rax)
	movl	(%rdx), %esi
	movl	%esi, -16(%rax)
	incq	%rcx
	movslq	(%r12), %rsi
	addq	$32, %rax
	cmpq	%rsi, %rcx
	jl	LBB0_3
LBB0_4:
	movq	___wpad_devs@GOTPCREL(%rip), %r15
	movq	%r15, %rdi
	callq	_CONF_GetPadDevices
	testq	%rax, %rax
	js	LBB0_5
## %bb.6:
	movq	(%r15), %rax
	testq	%rax, %rax
	je	LBB0_7
## %bb.8:
	movq	_CONF_PAD_MAX_REGISTERED@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jle	LBB0_9
LBB0_5:
	xorl	%eax, %eax
	callq	_WPAD_Shutdown
	callq	__CPU_ISR_Restore
	movq	_WPAD_ERR_BADCONF@GOTPCREL(%rip), %rax
	jmp	LBB0_14
LBB0_7:
	xorl	%eax, %eax
	callq	_WPAD_Shutdown
	callq	__CPU_ISR_Restore
	movq	_WPAD_ERR_NONEREGISTERED@GOTPCREL(%rip), %rax
	jmp	LBB0_14
LBB0_9:
	movl	(%r12), %edi
	movq	___wpad_eventCB@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_wiiuse_init
	movq	___wpads@GOTPCREL(%rip), %rcx
	movq	%rax, (%rcx)
	testq	%rax, %rax
	je	LBB0_10
## %bb.11:
	movl	$1, %edi
	callq	___wiiuse_sensorbar_enable
	xorl	%eax, %eax
	callq	_BTE_Init
	movq	___wpad_disconnectCB@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_BTE_SetDisconnectCallback
	movq	___initcore_finished@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_BTE_InitCore
	movq	___wpad_timer@GOTPCREL(%rip), %rbx
	movq	%rbx, %rdi
	callq	_SYS_CreateAlarm
	testq	%rax, %rax
	js	LBB0_10
## %bb.12:
	movq	___wpad_resetinfo@GOTPCREL(%rip), %rdi
	callq	_SYS_RegisterResetFunc
	movl	$1, -48(%rbp)
	movq	$0, -40(%rbp)
	movl	(%rbx), %edi
	movq	___wpad_timeouthandler@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	-48(%rbp), %rdx
	movq	%rdx, %rsi
	xorl	%r8d, %r8d
	callq	_SYS_SetPeriodicAlarm
	movq	_WPAD_STATE_ENABLING@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%r14)
LBB0_13:
	callq	__CPU_ISR_Restore
	movq	_WPAD_ERR_NONE@GOTPCREL(%rip), %rax
LBB0_14:
	movl	(%rax), %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	xorl	%eax, %eax
	callq	_WPAD_Shutdown
	callq	__CPU_ISR_Restore
	movq	_WPAD_ERR_UNKNOWN@GOTPCREL(%rip), %rax
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.comm	___wpads_inited,8,3             ## @__wpads_inited
	.comm	_WPAD_STATE_DISABLED,8,3        ## @WPAD_STATE_DISABLED
	.comm	___wpads_ponded,8,3             ## @__wpads_ponded
	.comm	___wpads_active,8,3             ## @__wpads_active
	.comm	___wpdcb,8,3                    ## @__wpdcb
	.comm	_WPAD_MAX_WIIMOTES,4,2          ## @WPAD_MAX_WIIMOTES
	.comm	___wpad_devs,32,3               ## @__wpad_devs
	.comm	___wpad_keys,8,3                ## @__wpad_keys
	.comm	_WPAD_THRESH_DEFAULT_BUTTONS,4,2 ## @WPAD_THRESH_DEFAULT_BUTTONS
	.comm	_WPAD_THRESH_DEFAULT_IR,4,2     ## @WPAD_THRESH_DEFAULT_IR
	.comm	_WPAD_THRESH_DEFAULT_ACCEL,4,2  ## @WPAD_THRESH_DEFAULT_ACCEL
	.comm	_WPAD_THRESH_DEFAULT_JOYSTICK,4,2 ## @WPAD_THRESH_DEFAULT_JOYSTICK
	.comm	_WPAD_THRESH_DEFAULT_MOTION_PLUS,4,2 ## @WPAD_THRESH_DEFAULT_MOTION_PLUS
	.comm	_WPAD_ERR_BADCONF,4,2           ## @WPAD_ERR_BADCONF
	.comm	_WPAD_ERR_NONEREGISTERED,4,2    ## @WPAD_ERR_NONEREGISTERED
	.comm	_CONF_PAD_MAX_REGISTERED,8,3    ## @CONF_PAD_MAX_REGISTERED
	.comm	___wpad_eventCB,4,2             ## @__wpad_eventCB
	.comm	___wpads,8,3                    ## @__wpads
	.comm	_WPAD_ERR_UNKNOWN,4,2           ## @WPAD_ERR_UNKNOWN
	.comm	___wpad_disconnectCB,4,2        ## @__wpad_disconnectCB
	.comm	___initcore_finished,4,2        ## @__initcore_finished
	.comm	___wpad_timer,4,2               ## @__wpad_timer
	.comm	___wpad_resetinfo,4,2           ## @__wpad_resetinfo
	.comm	___wpad_timeouthandler,4,2      ## @__wpad_timeouthandler
	.comm	_WPAD_STATE_ENABLING,8,3        ## @WPAD_STATE_ENABLING
	.comm	_WPAD_ERR_NONE,4,2              ## @WPAD_ERR_NONE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_WPAD_Init                      ; -- Begin function WPAD_Init
	.p2align	2
_WPAD_Init:                             ; @WPAD_Init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	bl	__CPU_ISR_Disable
Lloh0:
	adrp	x20, ___wpads_inited@GOTPAGE
Lloh1:
	ldr	x20, [x20, ___wpads_inited@GOTPAGEOFF]
	ldr	x8, [x20]
Lloh2:
	adrp	x9, _WPAD_STATE_DISABLED@GOTPAGE
Lloh3:
	ldr	x9, [x9, _WPAD_STATE_DISABLED@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_12
; %bb.1:
Lloh5:
	adrp	x8, ___wpads_ponded@GOTPAGE
Lloh6:
	ldr	x8, [x8, ___wpads_ponded@GOTPAGEOFF]
Lloh7:
	str	xzr, [x8]
Lloh8:
	adrp	x8, ___wpads_active@GOTPAGE
Lloh9:
	ldr	x8, [x8, ___wpads_active@GOTPAGEOFF]
Lloh10:
	adrp	x19, ___wpdcb@GOTPAGE
Lloh11:
	ldr	x19, [x19, ___wpdcb@GOTPAGEOFF]
Lloh12:
	str	xzr, [x8]
	ldr	x0, [x19]
Lloh13:
	adrp	x21, _WPAD_MAX_WIIMOTES@GOTPAGE
Lloh14:
	ldr	x21, [x21, _WPAD_MAX_WIIMOTES@GOTPAGEOFF]
	ldr	w8, [x21]
	lsl	w2, w8, #2
	mov	w1, #0
	bl	_memset
Lloh15:
	adrp	x0, ___wpad_devs@GOTPAGE
Lloh16:
	ldr	x0, [x0, ___wpad_devs@GOTPAGEOFF]
	mov	w1, #0
	mov	w2, #4
	bl	_memset
Lloh17:
	adrp	x8, ___wpad_keys@GOTPAGE
Lloh18:
	ldr	x8, [x8, ___wpad_keys@GOTPAGEOFF]
Lloh19:
	ldr	x0, [x8]
	ldr	w8, [x21]
	lsl	w2, w8, #2
	mov	w1, #0
	bl	_memset
	ldr	w8, [x21]
	cmp	w8, #1
	b.lt	LBB0_4
; %bb.2:
	mov	x8, #0
	ldr	x9, [x19]
	add	x9, x9, #28
Lloh20:
	adrp	x10, _WPAD_THRESH_DEFAULT_BUTTONS@GOTPAGE
Lloh21:
	ldr	x10, [x10, _WPAD_THRESH_DEFAULT_BUTTONS@GOTPAGEOFF]
Lloh22:
	adrp	x11, _WPAD_THRESH_DEFAULT_IR@GOTPAGE
Lloh23:
	ldr	x11, [x11, _WPAD_THRESH_DEFAULT_IR@GOTPAGEOFF]
Lloh24:
	adrp	x12, _WPAD_THRESH_DEFAULT_ACCEL@GOTPAGE
Lloh25:
	ldr	x12, [x12, _WPAD_THRESH_DEFAULT_ACCEL@GOTPAGEOFF]
Lloh26:
	adrp	x13, _WPAD_THRESH_DEFAULT_JOYSTICK@GOTPAGE
Lloh27:
	ldr	x13, [x13, _WPAD_THRESH_DEFAULT_JOYSTICK@GOTPAGEOFF]
Lloh28:
	adrp	x14, _WPAD_THRESH_DEFAULT_MOTION_PLUS@GOTPAGE
Lloh29:
	ldr	x14, [x14, _WPAD_THRESH_DEFAULT_MOTION_PLUS@GOTPAGEOFF]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w15, [x10]
	str	w15, [x9]
	ldr	w15, [x11]
	stur	w15, [x9, #-4]
	ldr	w15, [x12]
	stur	w15, [x9, #-8]
	ldr	w15, [x13]
	stur	w15, [x9, #-12]
	ldr	w15, [x14]
	stur	w15, [x9, #-16]
	add	x8, x8, #1
	ldrsw	x15, [x21]
	add	x9, x9, #32
	cmp	x8, x15
	b.lt	LBB0_3
LBB0_4:
Lloh30:
	adrp	x19, ___wpad_devs@GOTPAGE
Lloh31:
	ldr	x19, [x19, ___wpad_devs@GOTPAGEOFF]
	mov	x0, x19
	bl	_CONF_GetPadDevices
	tbnz	x0, #63, LBB0_7
; %bb.5:
	ldr	x8, [x19]
	cbz	x8, LBB0_8
; %bb.6:
Lloh32:
	adrp	x9, _CONF_PAD_MAX_REGISTERED@GOTPAGE
Lloh33:
	ldr	x9, [x9, _CONF_PAD_MAX_REGISTERED@GOTPAGEOFF]
Lloh34:
	ldr	x9, [x9]
	cmp	x8, x9
	b.le	LBB0_9
LBB0_7:
	bl	_WPAD_Shutdown
	bl	__CPU_ISR_Restore
Lloh35:
	adrp	x8, _WPAD_ERR_BADCONF@GOTPAGE
Lloh36:
	ldr	x8, [x8, _WPAD_ERR_BADCONF@GOTPAGEOFF]
	b	LBB0_13
LBB0_8:
	bl	_WPAD_Shutdown
	bl	__CPU_ISR_Restore
Lloh37:
	adrp	x8, _WPAD_ERR_NONEREGISTERED@GOTPAGE
Lloh38:
	ldr	x8, [x8, _WPAD_ERR_NONEREGISTERED@GOTPAGEOFF]
	b	LBB0_13
LBB0_9:
	ldr	w0, [x21]
Lloh39:
	adrp	x8, ___wpad_eventCB@GOTPAGE
Lloh40:
	ldr	x8, [x8, ___wpad_eventCB@GOTPAGEOFF]
Lloh41:
	ldr	w1, [x8]
	bl	_wiiuse_init
Lloh42:
	adrp	x8, ___wpads@GOTPAGE
Lloh43:
	ldr	x8, [x8, ___wpads@GOTPAGEOFF]
Lloh44:
	str	x0, [x8]
	cbz	x0, LBB0_14
; %bb.10:
	mov	w21, #1
	mov	w0, #1
	bl	___wiiuse_sensorbar_enable
	bl	_BTE_Init
Lloh45:
	adrp	x8, ___wpad_disconnectCB@GOTPAGE
Lloh46:
	ldr	x8, [x8, ___wpad_disconnectCB@GOTPAGEOFF]
Lloh47:
	ldr	w0, [x8]
	bl	_BTE_SetDisconnectCallback
Lloh48:
	adrp	x8, ___initcore_finished@GOTPAGE
Lloh49:
	ldr	x8, [x8, ___initcore_finished@GOTPAGEOFF]
Lloh50:
	ldr	w0, [x8]
	bl	_BTE_InitCore
Lloh51:
	adrp	x19, ___wpad_timer@GOTPAGE
Lloh52:
	ldr	x19, [x19, ___wpad_timer@GOTPAGEOFF]
	mov	x0, x19
	bl	_SYS_CreateAlarm
	tbnz	x0, #63, LBB0_14
; %bb.11:
Lloh53:
	adrp	x0, ___wpad_resetinfo@GOTPAGE
Lloh54:
	ldr	x0, [x0, ___wpad_resetinfo@GOTPAGEOFF]
	bl	_SYS_RegisterResetFunc
	str	w21, [sp]
	str	xzr, [sp, #8]
	ldr	w0, [x19]
Lloh55:
	adrp	x8, ___wpad_timeouthandler@GOTPAGE
Lloh56:
	ldr	x8, [x8, ___wpad_timeouthandler@GOTPAGEOFF]
Lloh57:
	ldr	w3, [x8]
	mov	x1, sp
	mov	x2, sp
	mov	x4, #0
	bl	_SYS_SetPeriodicAlarm
Lloh58:
	adrp	x8, _WPAD_STATE_ENABLING@GOTPAGE
Lloh59:
	ldr	x8, [x8, _WPAD_STATE_ENABLING@GOTPAGEOFF]
Lloh60:
	ldr	x8, [x8]
	str	x8, [x20]
LBB0_12:
	bl	__CPU_ISR_Restore
Lloh61:
	adrp	x8, _WPAD_ERR_NONE@GOTPAGE
Lloh62:
	ldr	x8, [x8, _WPAD_ERR_NONE@GOTPAGEOFF]
LBB0_13:
	ldr	w0, [x8]
	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
	add	sp, sp, #64
	ret
LBB0_14:
	bl	_WPAD_Shutdown
	bl	__CPU_ISR_Restore
Lloh63:
	adrp	x8, _WPAD_ERR_UNKNOWN@GOTPAGE
Lloh64:
	ldr	x8, [x8, _WPAD_ERR_UNKNOWN@GOTPAGEOFF]
	b	LBB0_13
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotStr	Lloh8, Lloh9, Lloh12
	.loh AdrpLdrGotStr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGot	Lloh35, Lloh36
	.loh AdrpLdrGot	Lloh37, Lloh38
	.loh AdrpLdrGotStr	Lloh42, Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGot	Lloh51, Lloh52
	.loh AdrpLdrGotLdr	Lloh48, Lloh49, Lloh50
	.loh AdrpLdrGotLdr	Lloh45, Lloh46, Lloh47
	.loh AdrpLdrGotLdr	Lloh58, Lloh59, Lloh60
	.loh AdrpLdrGotLdr	Lloh55, Lloh56, Lloh57
	.loh AdrpLdrGot	Lloh53, Lloh54
	.loh AdrpLdrGot	Lloh61, Lloh62
	.loh AdrpLdrGot	Lloh63, Lloh64
	.cfi_endproc
                                        ; -- End function
	.comm	___wpads_inited,8,3             ; @__wpads_inited
	.comm	_WPAD_STATE_DISABLED,8,3        ; @WPAD_STATE_DISABLED
	.comm	___wpads_ponded,8,3             ; @__wpads_ponded
	.comm	___wpads_active,8,3             ; @__wpads_active
	.comm	___wpdcb,8,3                    ; @__wpdcb
	.comm	_WPAD_MAX_WIIMOTES,4,2          ; @WPAD_MAX_WIIMOTES
	.comm	___wpad_devs,32,3               ; @__wpad_devs
	.comm	___wpad_keys,8,3                ; @__wpad_keys
	.comm	_WPAD_THRESH_DEFAULT_BUTTONS,4,2 ; @WPAD_THRESH_DEFAULT_BUTTONS
	.comm	_WPAD_THRESH_DEFAULT_IR,4,2     ; @WPAD_THRESH_DEFAULT_IR
	.comm	_WPAD_THRESH_DEFAULT_ACCEL,4,2  ; @WPAD_THRESH_DEFAULT_ACCEL
	.comm	_WPAD_THRESH_DEFAULT_JOYSTICK,4,2 ; @WPAD_THRESH_DEFAULT_JOYSTICK
	.comm	_WPAD_THRESH_DEFAULT_MOTION_PLUS,4,2 ; @WPAD_THRESH_DEFAULT_MOTION_PLUS
	.comm	_WPAD_ERR_BADCONF,4,2           ; @WPAD_ERR_BADCONF
	.comm	_WPAD_ERR_NONEREGISTERED,4,2    ; @WPAD_ERR_NONEREGISTERED
	.comm	_CONF_PAD_MAX_REGISTERED,8,3    ; @CONF_PAD_MAX_REGISTERED
	.comm	___wpad_eventCB,4,2             ; @__wpad_eventCB
	.comm	___wpads,8,3                    ; @__wpads
	.comm	_WPAD_ERR_UNKNOWN,4,2           ; @WPAD_ERR_UNKNOWN
	.comm	___wpad_disconnectCB,4,2        ; @__wpad_disconnectCB
	.comm	___initcore_finished,4,2        ; @__initcore_finished
	.comm	___wpad_timer,4,2               ; @__wpad_timer
	.comm	___wpad_resetinfo,4,2           ; @__wpad_resetinfo
	.comm	___wpad_timeouthandler,4,2      ; @__wpad_timeouthandler
	.comm	_WPAD_STATE_ENABLING,8,3        ; @WPAD_STATE_ENABLING
	.comm	_WPAD_ERR_NONE,4,2              ; @WPAD_ERR_NONE
.subsections_via_symbols
