	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_WPAD_SetDataFormat             ## -- Begin function WPAD_SetDataFormat
	.p2align	4, 0x90
_WPAD_SetDataFormat:                    ## @WPAD_SetDataFormat
	.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
	movl	%esi, %r15d
	movq	_WPAD_CHAN_ALL@GOTPCREL(%rip), %rax
	movq	_WPAD_CHAN_0@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
	cmpl	%edi, (%rax)
	jne	LBB0_6
## %bb.1:
	movq	_WPAD_MAX_WIIMOTES@GOTPCREL(%rip), %r14
	cmpl	(%r14), %ebx
	jge	LBB0_15
## %bb.2:
	movq	_WPAD_ERR_NONE@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movl	%ebx, %edi
	movl	%r15d, %esi
	callq	_WPAD_SetDataFormat
	movl	%eax, %ecx
	movl	(%r12), %eax
	cmpl	%eax, %ecx
	jl	LBB0_5
## %bb.3:                               ##   in Loop: Header=BB0_4 Depth=1
	incl	%ebx
	cmpl	(%r14), %ebx
	jl	LBB0_4
	jmp	LBB0_17
LBB0_6:
	movl	%edi, %r14d
	cmpl	%edi, %ebx
	jg	LBB0_8
## %bb.7:
	movq	_WPAD_MAX_WIIMOTES@GOTPCREL(%rip), %rax
	cmpl	%r14d, (%rax)
	jle	LBB0_8
## %bb.9:
	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_11
## %bb.10:
	callq	__CPU_ISR_Restore
	movq	_WPAD_ERR_NOT_READY@GOTPCREL(%rip), %rax
	jmp	LBB0_16
LBB0_8:
	movq	_WPAD_ERR_BAD_CHANNEL@GOTPCREL(%rip), %rax
	jmp	LBB0_16
LBB0_5:
	movl	%ecx, %eax
	jmp	LBB0_17
LBB0_11:
	movq	___wpads@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	movslq	%r14d, %rax
	cmpq	$0, (%rcx,%rax,8)
	je	LBB0_14
## %bb.12:
	leal	-128(%r15), %ecx
	cmpl	$2, %ecx
	ja	LBB0_18
## %bb.13:
	movq	___wpdcb@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	%r15d, (%rcx,%rax,4)
	movl	%r14d, %edi
	callq	___wpad_setfmt
LBB0_14:
	callq	__CPU_ISR_Restore
LBB0_15:
	movq	_WPAD_ERR_NONE@GOTPCREL(%rip), %rax
LBB0_16:
	movl	(%rax), %eax
LBB0_17:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_18:
	callq	__CPU_ISR_Restore
	movq	_WPAD_ERR_BADVALUE@GOTPCREL(%rip), %rax
	jmp	LBB0_16
	.cfi_endproc
                                        ## -- End function
	.comm	_WPAD_CHAN_ALL,4,2              ## @WPAD_CHAN_ALL
	.comm	_WPAD_CHAN_0,4,2                ## @WPAD_CHAN_0
	.comm	_WPAD_MAX_WIIMOTES,4,2          ## @WPAD_MAX_WIIMOTES
	.comm	_WPAD_ERR_NONE,4,2              ## @WPAD_ERR_NONE
	.comm	_WPAD_ERR_BAD_CHANNEL,4,2       ## @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,4,2         ## @WPAD_ERR_NOT_READY
	.comm	___wpads,8,3                    ## @__wpads
	.comm	___wpdcb,8,3                    ## @__wpdcb
	.comm	_WPAD_ERR_BADVALUE,4,2          ## @WPAD_ERR_BADVALUE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_WPAD_SetDataFormat             ; -- Begin function WPAD_SetDataFormat
	.p2align	2
_WPAD_SetDataFormat:                    ; @WPAD_SetDataFormat
	.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, x1
Lloh0:
	adrp	x8, _WPAD_CHAN_ALL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _WPAD_CHAN_ALL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _WPAD_CHAN_0@GOTPAGE
Lloh4:
	ldr	x9, [x9, _WPAD_CHAN_0@GOTPAGEOFF]
Lloh5:
	ldr	w21, [x9]
	cmp	w8, w0
	b.ne	LBB0_5
; %bb.1:
Lloh6:
	adrp	x20, _WPAD_MAX_WIIMOTES@GOTPAGE
Lloh7:
	ldr	x20, [x20, _WPAD_MAX_WIIMOTES@GOTPAGEOFF]
	ldr	w8, [x20]
	cmp	w21, w8
	b.ge	LBB0_14
; %bb.2:
Lloh8:
	adrp	x22, _WPAD_ERR_NONE@GOTPAGE
Lloh9:
	ldr	x22, [x22, _WPAD_ERR_NONE@GOTPAGEOFF]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x21
	mov	x1, x19
	bl	_WPAD_SetDataFormat
	mov	x8, x0
	ldr	w0, [x22]
	cmp	w8, w0
	b.lt	LBB0_9
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	add	w21, w21, #1
	ldr	w8, [x20]
	cmp	w21, w8
	b.lt	LBB0_3
	b	LBB0_16
LBB0_5:
	mov	x20, x0
Lloh10:
	adrp	x8, _WPAD_MAX_WIIMOTES@GOTPAGE
Lloh11:
	ldr	x8, [x8, _WPAD_MAX_WIIMOTES@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	cmp	w21, w0
	ccmp	w8, w0, #4, le
	b.gt	LBB0_7
; %bb.6:
Lloh13:
	adrp	x8, _WPAD_ERR_BAD_CHANNEL@GOTPAGE
Lloh14:
	ldr	x8, [x8, _WPAD_ERR_BAD_CHANNEL@GOTPAGEOFF]
	b	LBB0_15
LBB0_7:
	bl	__CPU_ISR_Disable
Lloh15:
	adrp	x8, ___wpads_inited@GOTPAGE
Lloh16:
	ldr	x8, [x8, ___wpads_inited@GOTPAGEOFF]
Lloh17:
	ldr	x8, [x8]
Lloh18:
	adrp	x9, _WPAD_STATE_DISABLED@GOTPAGE
Lloh19:
	ldr	x9, [x9, _WPAD_STATE_DISABLED@GOTPAGEOFF]
Lloh20:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_10
; %bb.8:
	bl	__CPU_ISR_Restore
Lloh21:
	adrp	x8, _WPAD_ERR_NOT_READY@GOTPAGE
Lloh22:
	ldr	x8, [x8, _WPAD_ERR_NOT_READY@GOTPAGEOFF]
	b	LBB0_15
LBB0_9:
	mov	x0, x8
	b	LBB0_16
LBB0_10:
Lloh23:
	adrp	x8, ___wpads@GOTPAGE
Lloh24:
	ldr	x8, [x8, ___wpads@GOTPAGEOFF]
Lloh25:
	ldr	x8, [x8]
	ldr	x8, [x8, w20, sxtw #3]
	cbz	x8, LBB0_13
; %bb.11:
	sub	w8, w19, #128
	cmp	w8, #2
	b.hi	LBB0_17
; %bb.12:
	sxtw	x8, w20
Lloh26:
	adrp	x9, ___wpdcb@GOTPAGE
Lloh27:
	ldr	x9, [x9, ___wpdcb@GOTPAGEOFF]
Lloh28:
	ldr	x9, [x9]
	str	w19, [x9, x8, lsl #2]
	mov	x0, x20
	bl	___wpad_setfmt
LBB0_13:
	bl	__CPU_ISR_Restore
LBB0_14:
Lloh29:
	adrp	x8, _WPAD_ERR_NONE@GOTPAGE
Lloh30:
	ldr	x8, [x8, _WPAD_ERR_NONE@GOTPAGEOFF]
LBB0_15:
	ldr	w0, [x8]
LBB0_16:
	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
LBB0_17:
	bl	__CPU_ISR_Restore
Lloh31:
	adrp	x8, _WPAD_ERR_BADVALUE@GOTPAGE
Lloh32:
	ldr	x8, [x8, _WPAD_ERR_BADVALUE@GOTPAGEOFF]
	b	LBB0_15
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpLdrGot	Lloh31, Lloh32
	.cfi_endproc
                                        ; -- End function
	.comm	_WPAD_CHAN_ALL,4,2              ; @WPAD_CHAN_ALL
	.comm	_WPAD_CHAN_0,4,2                ; @WPAD_CHAN_0
	.comm	_WPAD_MAX_WIIMOTES,4,2          ; @WPAD_MAX_WIIMOTES
	.comm	_WPAD_ERR_NONE,4,2              ; @WPAD_ERR_NONE
	.comm	_WPAD_ERR_BAD_CHANNEL,4,2       ; @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,4,2         ; @WPAD_ERR_NOT_READY
	.comm	___wpads,8,3                    ; @__wpads
	.comm	___wpdcb,8,3                    ; @__wpdcb
	.comm	_WPAD_ERR_BADVALUE,4,2          ; @WPAD_ERR_BADVALUE
.subsections_via_symbols
