	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_WPAD_Disconnect                ## -- Begin function WPAD_Disconnect
	.p2align	4, 0x90
_WPAD_Disconnect:                       ## @WPAD_Disconnect
	.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	_WPAD_CHAN_0@GOTPCREL(%rip), %rax
	movq	_WPAD_ERR_BAD_CHANNEL@GOTPCREL(%rip), %r14
	cmpq	%rdi, (%rax)
	ja	LBB0_7
## %bb.1:
	movq	%rdi, %r15
	movq	_WPAD_MAX_WIIMOTES@GOTPCREL(%rip), %rax
	cmpq	%rdi, (%rax)
	jbe	LBB0_7
## %bb.2:
	callq	__CPU_ISR_Disable
	movq	___wpads_inited@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_WPAD_STATE_DISABLED@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_4
## %bb.3:
	callq	__CPU_ISR_Restore
	movq	_WPAD_ERR_NOT_READY@GOTPCREL(%rip), %r14
	jmp	LBB0_7
LBB0_4:
	movq	___wpdcb@GOTPCREL(%rip), %rax
	leaq	(,%r15,4), %rdi
	addq	(%rax), %rdi
	callq	___wpad_disconnect
	callq	__CPU_ISR_Restore
	movl	$1, %r12d
	movl	%r15d, %ecx
	shll	%cl, %r12d
	movl	$3001, %ebx                     ## imm = 0xBB9
	movq	___wpads_active@GOTPCREL(%rip), %r15
	movq	_WPAD_ERR_NONE@GOTPCREL(%rip), %r14
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	testl	%r12d, (%r15)
	je	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	$50, %edi
	callq	_usleep
	decl	%ebx
	jne	LBB0_5
LBB0_7:
	movq	(%r14), %rax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_WPAD_CHAN_0,8,3                ## @WPAD_CHAN_0
	.comm	_WPAD_MAX_WIIMOTES,8,3          ## @WPAD_MAX_WIIMOTES
	.comm	_WPAD_ERR_BAD_CHANNEL,8,3       ## @WPAD_ERR_BAD_CHANNEL
	.comm	___wpads_inited,8,3             ## @__wpads_inited
	.comm	_WPAD_STATE_DISABLED,8,3        ## @WPAD_STATE_DISABLED
	.comm	_WPAD_ERR_NOT_READY,8,3         ## @WPAD_ERR_NOT_READY
	.comm	___wpdcb,8,3                    ## @__wpdcb
	.comm	___wpads_active,4,2             ## @__wpads_active
	.comm	_WPAD_ERR_NONE,8,3              ## @WPAD_ERR_NONE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_WPAD_Disconnect                ; -- Begin function WPAD_Disconnect
	.p2align	2
_WPAD_Disconnect:                       ; @WPAD_Disconnect
	.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
Lloh0:
	adrp	x8, _WPAD_CHAN_0@GOTPAGE
Lloh1:
	ldr	x8, [x8, _WPAD_CHAN_0@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
Lloh3:
	adrp	x9, _WPAD_MAX_WIIMOTES@GOTPAGE
Lloh4:
	ldr	x9, [x9, _WPAD_MAX_WIIMOTES@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x0
	ccmp	x9, x0, #0, ls
	b.hi	LBB0_2
; %bb.1:
Lloh6:
	adrp	x19, _WPAD_ERR_BAD_CHANNEL@GOTPAGE
Lloh7:
	ldr	x19, [x19, _WPAD_ERR_BAD_CHANNEL@GOTPAGEOFF]
	b	LBB0_7
LBB0_2:
	mov	x19, x0
	bl	__CPU_ISR_Disable
Lloh8:
	adrp	x8, ___wpads_inited@GOTPAGE
Lloh9:
	ldr	x8, [x8, ___wpads_inited@GOTPAGEOFF]
Lloh10:
	ldr	x8, [x8]
Lloh11:
	adrp	x9, _WPAD_STATE_DISABLED@GOTPAGE
Lloh12:
	ldr	x9, [x9, _WPAD_STATE_DISABLED@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_4
; %bb.3:
	bl	__CPU_ISR_Restore
Lloh14:
	adrp	x19, _WPAD_ERR_NOT_READY@GOTPAGE
Lloh15:
	ldr	x19, [x19, _WPAD_ERR_NOT_READY@GOTPAGEOFF]
	b	LBB0_7
LBB0_4:
Lloh16:
	adrp	x8, ___wpdcb@GOTPAGE
Lloh17:
	ldr	x8, [x8, ___wpdcb@GOTPAGEOFF]
Lloh18:
	ldr	x8, [x8]
	add	x0, x8, x19, lsl #2
	bl	___wpad_disconnect
	bl	__CPU_ISR_Restore
	mov	w8, #1
	lsl	w20, w8, w19
	mov	w21, #3001
Lloh19:
	adrp	x22, ___wpads_active@GOTPAGE
Lloh20:
	ldr	x22, [x22, ___wpads_active@GOTPAGEOFF]
Lloh21:
	adrp	x19, _WPAD_ERR_NONE@GOTPAGE
Lloh22:
	ldr	x19, [x19, _WPAD_ERR_NONE@GOTPAGEOFF]
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x22]
	tst	w8, w20
	b.eq	LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	w0, #50
	bl	_usleep
	subs	w21, w21, #1
	b.ne	LBB0_5
LBB0_7:
	ldr	x0, [x19]
	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	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_WPAD_CHAN_0,8,3                ; @WPAD_CHAN_0
	.comm	_WPAD_MAX_WIIMOTES,8,3          ; @WPAD_MAX_WIIMOTES
	.comm	_WPAD_ERR_BAD_CHANNEL,8,3       ; @WPAD_ERR_BAD_CHANNEL
	.comm	___wpads_inited,8,3             ; @__wpads_inited
	.comm	_WPAD_STATE_DISABLED,8,3        ; @WPAD_STATE_DISABLED
	.comm	_WPAD_ERR_NOT_READY,8,3         ; @WPAD_ERR_NOT_READY
	.comm	___wpdcb,8,3                    ; @__wpdcb
	.comm	___wpads_active,4,2             ; @__wpads_active
	.comm	_WPAD_ERR_NONE,8,3              ; @WPAD_ERR_NONE
.subsections_via_symbols
