	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_wiiuse_set_report_type         ## -- Begin function wiiuse_set_report_type
	.p2align	4, 0x90
_wiiuse_set_report_type:                ## @wiiuse_set_report_type
	.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
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -40(%rbp)
	xorl	%ebx, %ebx
	testq	%rdi, %rdi
	je	LBB0_20
## %bb.1:
	movl	%esi, %r14d
	movq	%rdi, %r12
	callq	_WIIMOTE_IS_CONNECTED
	testl	%eax, %eax
	je	LBB0_20
## %bb.2:
	movq	_WIIUSE_CONTINUOUS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_WIIMOTE_IS_FLAG_SET
	xorl	%ecx, %ecx
	testq	%rax, %rax
	setne	%cl
	shll	$2, %ecx
	movl	%ecx, -48(%rbp)
	movq	_WIIMOTE_STATE_ACC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_WIIMOTE_IS_SET
	movb	$1, %bl
	testl	%eax, %eax
	jne	LBB0_4
## %bb.3:
	movq	_WIIMOTE_STATE_IR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_WIIMOTE_IS_SET
	testl	%eax, %eax
	setne	%bl
LBB0_4:
	movq	_WIIMOTE_STATE_EXP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_WIIMOTE_IS_SET
	movl	%eax, %r15d
	movq	_WIIMOTE_STATE_IR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_WIIMOTE_IS_SET
	testl	%eax, %eax
	setne	%dl
	andb	%bl, %dl
	cmpb	$1, %dl
	jne	LBB0_7
## %bb.5:
	testl	%r15d, %r15d
	je	LBB0_7
## %bb.6:
	movq	_WM_RPT_BTN_ACC_IR_EXP@GOTPCREL(%rip), %rcx
	jmp	LBB0_19
LBB0_7:
	testl	%r15d, %r15d
	setne	%cl
	andb	%bl, %cl
	orb	%cl, %dl
	testb	%cl, %cl
	je	LBB0_8
## %bb.9:
	movq	_WM_RPT_BTN_ACC_EXP@GOTPCREL(%rip), %rcx
	testb	%dl, %dl
	je	LBB0_11
	jmp	LBB0_19
LBB0_8:
	movq	_WM_RPT_BTN_ACC_IR@GOTPCREL(%rip), %rcx
	testb	%dl, %dl
	jne	LBB0_19
LBB0_11:
	movq	_WM_RPT_BTN_ACC_IR@GOTPCREL(%rip), %rcx
	movq	%rcx, %rdx
	testl	%r15d, %r15d
	je	LBB0_13
## %bb.12:
	movq	_WM_RPT_BTN_IR_EXP@GOTPCREL(%rip), %rdx
LBB0_13:
	testl	%eax, %eax
	cmovneq	%rdx, %rcx
	jne	LBB0_19
## %bb.14:
	testb	%bl, %bl
	je	LBB0_15
## %bb.16:
	movq	_WM_RPT_BTN_ACC@GOTPCREL(%rip), %rcx
	jmp	LBB0_17
LBB0_15:
	movq	_WM_RPT_BTN@GOTPCREL(%rip), %rcx
LBB0_17:
	testl	%r15d, %r15d
	je	LBB0_19
## %bb.18:
	movq	_WM_RPT_BTN_EXP@GOTPCREL(%rip), %rcx
LBB0_19:
	movl	(%rcx), %eax
	movl	%eax, -44(%rbp)
	movq	_WM_CMD_REPORT_TYPE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-48(%rbp), %rdx
	movq	%r12, %rdi
	movl	$2, %ecx
	movl	%r14d, %r8d
	callq	_wiiuse_sendcmd
	movl	-44(%rbp), %ebx
LBB0_20:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-40(%rbp), %rax
	jne	LBB0_22
## %bb.21:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_22:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_WIIUSE_CONTINUOUS,4,2          ## @WIIUSE_CONTINUOUS
	.comm	_WIIMOTE_STATE_ACC,4,2          ## @WIIMOTE_STATE_ACC
	.comm	_WIIMOTE_STATE_IR,4,2           ## @WIIMOTE_STATE_IR
	.comm	_WIIMOTE_STATE_EXP,4,2          ## @WIIMOTE_STATE_EXP
	.comm	_WM_RPT_BTN_ACC_IR_EXP,4,2      ## @WM_RPT_BTN_ACC_IR_EXP
	.comm	_WM_RPT_BTN_ACC_EXP,4,2         ## @WM_RPT_BTN_ACC_EXP
	.comm	_WM_RPT_BTN_ACC_IR,4,2          ## @WM_RPT_BTN_ACC_IR
	.comm	_WM_RPT_BTN_IR_EXP,4,2          ## @WM_RPT_BTN_IR_EXP
	.comm	_WM_RPT_BTN_EXP,4,2             ## @WM_RPT_BTN_EXP
	.comm	_WM_RPT_BTN_ACC,4,2             ## @WM_RPT_BTN_ACC
	.comm	_WM_RPT_BTN,4,2                 ## @WM_RPT_BTN
	.comm	_WM_CMD_REPORT_TYPE,4,2         ## @WM_CMD_REPORT_TYPE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_wiiuse_set_report_type         ; -- Begin function wiiuse_set_report_type
	.p2align	2
_wiiuse_set_report_type:                ; @wiiuse_set_report_type
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #8]
	cbz	x0, LBB0_10
; %bb.1:
	mov	x19, x1
	mov	x20, x0
	bl	_WIIMOTE_IS_CONNECTED
	cbz	w0, LBB0_10
; %bb.2:
Lloh3:
	adrp	x8, _WIIUSE_CONTINUOUS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _WIIUSE_CONTINUOUS@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_WIIMOTE_IS_FLAG_SET
	cmp	x0, #0
	cset	w8, ne
	lsl	w8, w8, #2
	str	w8, [sp]
Lloh6:
	adrp	x8, _WIIMOTE_STATE_ACC@GOTPAGE
Lloh7:
	ldr	x8, [x8, _WIIMOTE_STATE_ACC@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_WIIMOTE_IS_SET
Lloh9:
	adrp	x23, _WIIMOTE_STATE_IR@GOTPAGE
Lloh10:
	ldr	x23, [x23, _WIIMOTE_STATE_IR@GOTPAGEOFF]
	cbz	w0, LBB0_4
; %bb.3:
	mov	w22, #1
	b	LBB0_5
LBB0_4:
	ldr	w1, [x23]
	mov	x0, x20
	bl	_WIIMOTE_IS_SET
	cmp	w0, #0
	cset	w22, ne
LBB0_5:
Lloh11:
	adrp	x8, _WIIMOTE_STATE_EXP@GOTPAGE
Lloh12:
	ldr	x8, [x8, _WIIMOTE_STATE_EXP@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_WIIMOTE_IS_SET
	mov	x21, x0
	ldr	w1, [x23]
	mov	x0, x20
	bl	_WIIMOTE_IS_SET
	cmp	w0, #0
	cset	w8, ne
	and	w8, w22, w8
	cmp	w8, #1
	ccmp	w21, #0, #4, eq
	b.ne	LBB0_8
; %bb.6:
	cmp	w21, #0
	cset	w9, ne
	ands	w9, w22, w9
	orr	w10, w9, w8
Lloh14:
	adrp	x9, _WM_RPT_BTN_ACC_IR@GOTPAGE
Lloh15:
	ldr	x9, [x9, _WM_RPT_BTN_ACC_IR@GOTPAGEOFF]
Lloh16:
	adrp	x8, _WM_RPT_BTN_ACC_EXP@GOTPAGE
Lloh17:
	ldr	x8, [x8, _WM_RPT_BTN_ACC_EXP@GOTPAGEOFF]
	csel	x8, x8, x9, ne
	tbnz	w10, #0, LBB0_9
; %bb.7:
	cmp	w21, #0
	ccmp	w0, #0, #4, ne
Lloh18:
	adrp	x8, _WM_RPT_BTN_IR_EXP@GOTPAGE
Lloh19:
	ldr	x8, [x8, _WM_RPT_BTN_IR_EXP@GOTPAGEOFF]
	csel	x8, x8, x9, ne
Lloh20:
	adrp	x9, _WM_RPT_BTN@GOTPAGE
Lloh21:
	ldr	x9, [x9, _WM_RPT_BTN@GOTPAGEOFF]
Lloh22:
	adrp	x10, _WM_RPT_BTN_ACC@GOTPAGE
Lloh23:
	ldr	x10, [x10, _WM_RPT_BTN_ACC@GOTPAGEOFF]
	cmp	w22, #0
	csel	x9, x10, x9, ne
Lloh24:
	adrp	x10, _WM_RPT_BTN_EXP@GOTPAGE
Lloh25:
	ldr	x10, [x10, _WM_RPT_BTN_EXP@GOTPAGEOFF]
	cmp	w21, #0
	csel	x9, x10, x9, ne
	cmp	w0, #0
	csel	x8, x8, x9, ne
	b	LBB0_9
LBB0_8:
Lloh26:
	adrp	x8, _WM_RPT_BTN_ACC_IR_EXP@GOTPAGE
Lloh27:
	ldr	x8, [x8, _WM_RPT_BTN_ACC_IR_EXP@GOTPAGEOFF]
LBB0_9:
	ldr	w8, [x8]
	str	w8, [sp, #4]
Lloh28:
	adrp	x8, _WM_CMD_REPORT_TYPE@GOTPAGE
Lloh29:
	ldr	x8, [x8, _WM_CMD_REPORT_TYPE@GOTPAGEOFF]
Lloh30:
	ldr	w1, [x8]
	mov	x2, sp
	mov	x0, x20
	mov	w3, #2
	mov	x4, x19
	bl	_wiiuse_sendcmd
	ldr	w0, [sp, #4]
LBB0_10:
	ldr	x8, [sp, #8]
Lloh31:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh32:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh33:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_12
; %bb.11:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_12:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.cfi_endproc
                                        ; -- End function
	.comm	_WIIUSE_CONTINUOUS,4,2          ; @WIIUSE_CONTINUOUS
	.comm	_WIIMOTE_STATE_ACC,4,2          ; @WIIMOTE_STATE_ACC
	.comm	_WIIMOTE_STATE_IR,4,2           ; @WIIMOTE_STATE_IR
	.comm	_WIIMOTE_STATE_EXP,4,2          ; @WIIMOTE_STATE_EXP
	.comm	_WM_RPT_BTN_ACC_IR_EXP,4,2      ; @WM_RPT_BTN_ACC_IR_EXP
	.comm	_WM_RPT_BTN_ACC_EXP,4,2         ; @WM_RPT_BTN_ACC_EXP
	.comm	_WM_RPT_BTN_ACC_IR,4,2          ; @WM_RPT_BTN_ACC_IR
	.comm	_WM_RPT_BTN_IR_EXP,4,2          ; @WM_RPT_BTN_IR_EXP
	.comm	_WM_RPT_BTN_EXP,4,2             ; @WM_RPT_BTN_EXP
	.comm	_WM_RPT_BTN_ACC,4,2             ; @WM_RPT_BTN_ACC
	.comm	_WM_RPT_BTN,4,2                 ; @WM_RPT_BTN
	.comm	_WM_CMD_REPORT_TYPE,4,2         ; @WM_CMD_REPORT_TYPE
.subsections_via_symbols
