	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_WPAD_Shutdown                  ## -- Begin function WPAD_Shutdown
	.p2align	4, 0x90
_WPAD_Shutdown:                         ## @WPAD_Shutdown
	.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
	callq	__CPU_ISR_Disable
	movq	_WPAD_STATE_DISABLED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	___wpads_inited@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	movq	___wpad_timer@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_SYS_RemoveAlarm
	movq	_WPAD_MAX_WIIMOTES@GOTPCREL(%rip), %r14
	cmpq	$0, (%r14)
	je	LBB0_3
## %bb.1:
	xorl	%r12d, %r12d
	movq	___wpdcb@GOTPCREL(%rip), %r15
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r15), %rdi
	addq	%r12, %rdi
	callq	___wpad_disconnect
	incq	%rbx
	addq	$4, %r12
	cmpq	(%r14), %rbx
	jb	LBB0_2
LBB0_3:
	xorl	%ebx, %ebx
	xorl	%edi, %edi
	callq	___wiiuse_sensorbar_enable
	callq	__CPU_ISR_Restore
	movq	___wpads_active@GOTPCREL(%rip), %r14
	cmpq	$0, (%r14)
	je	LBB0_7
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movl	$50, %edi
	callq	_usleep
	cmpl	$2999, %ebx                     ## imm = 0xBB7
	ja	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	incl	%ebx
	cmpq	$0, (%r14)
	jne	LBB0_5
LBB0_7:
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_BTE_Shutdown                   ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_WPAD_STATE_DISABLED,4,2        ## @WPAD_STATE_DISABLED
	.comm	___wpads_inited,4,2             ## @__wpads_inited
	.comm	___wpad_timer,4,2               ## @__wpad_timer
	.comm	_WPAD_MAX_WIIMOTES,8,3          ## @WPAD_MAX_WIIMOTES
	.comm	___wpdcb,8,3                    ## @__wpdcb
	.comm	___wpads_active,8,3             ## @__wpads_active
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_WPAD_Shutdown                  ; -- Begin function WPAD_Shutdown
	.p2align	2
_WPAD_Shutdown:                         ; @WPAD_Shutdown
	.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
	bl	__CPU_ISR_Disable
Lloh0:
	adrp	x8, _WPAD_STATE_DISABLED@GOTPAGE
Lloh1:
	ldr	x8, [x8, _WPAD_STATE_DISABLED@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, ___wpads_inited@GOTPAGE
Lloh4:
	ldr	x9, [x9, ___wpads_inited@GOTPAGEOFF]
Lloh5:
	str	w8, [x9]
Lloh6:
	adrp	x8, ___wpad_timer@GOTPAGE
Lloh7:
	ldr	x8, [x8, ___wpad_timer@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
	bl	_SYS_RemoveAlarm
Lloh9:
	adrp	x19, _WPAD_MAX_WIIMOTES@GOTPAGE
Lloh10:
	ldr	x19, [x19, _WPAD_MAX_WIIMOTES@GOTPAGEOFF]
	ldr	x8, [x19]
	cbz	x8, LBB0_3
; %bb.1:
	mov	x20, #0
	mov	x21, #0
Lloh11:
	adrp	x22, ___wpdcb@GOTPAGE
Lloh12:
	ldr	x22, [x22, ___wpdcb@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x22]
	add	x0, x8, x20
	bl	___wpad_disconnect
	add	x21, x21, #1
	ldr	x8, [x19]
	add	x20, x20, #4
	cmp	x21, x8
	b.lo	LBB0_2
LBB0_3:
	mov	w0, #0
	bl	___wiiuse_sensorbar_enable
	bl	__CPU_ISR_Restore
Lloh13:
	adrp	x19, ___wpads_active@GOTPAGE
Lloh14:
	ldr	x19, [x19, ___wpads_active@GOTPAGEOFF]
	ldr	x8, [x19]
	cbz	x8, LBB0_7
; %bb.4:
	mov	w20, #0
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	mov	w0, #50
	bl	_usleep
	cmp	w20, #2999
	b.hi	LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	add	w20, w20, #1
	ldr	x8, [x19]
	cbnz	x8, LBB0_5
LBB0_7:
	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
	b	_BTE_Shutdown
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotStr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_WPAD_STATE_DISABLED,4,2        ; @WPAD_STATE_DISABLED
	.comm	___wpads_inited,4,2             ; @__wpads_inited
	.comm	___wpad_timer,4,2               ; @__wpad_timer
	.comm	_WPAD_MAX_WIIMOTES,8,3          ; @WPAD_MAX_WIIMOTES
	.comm	___wpdcb,8,3                    ; @__wpdcb
	.comm	___wpads_active,8,3             ; @__wpads_active
.subsections_via_symbols
