	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_wiiuse_set_ir_mode             ## -- Begin function wiiuse_set_ir_mode
	.p2align	4, 0x90
_wiiuse_set_ir_mode:                    ## @wiiuse_set_ir_mode
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	testq	%rdi, %rdi
	je	LBB0_6
## %bb.1:
	movq	%rdi, %rbx
	movq	_WIIMOTE_STATE_IR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_WIIMOTE_IS_SET
	testq	%rax, %rax
	je	LBB0_6
## %bb.2:
	movq	_WIIMOTE_STATE_EXP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_WIIMOTE_IS_SET
	testq	%rax, %rax
	jne	LBB0_3
## %bb.4:
	movq	_WM_IR_TYPE_EXTENDED@GOTPCREL(%rip), %rax
	jmp	LBB0_5
LBB0_3:
	movq	_WM_IR_TYPE_BASIC@GOTPCREL(%rip), %rax
LBB0_5:
	movl	(%rax), %eax
	movl	%eax, -12(%rbp)
	movq	_WM_REG_IR_MODENUM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-12(%rbp), %rdx
	movq	%rbx, %rdi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	callq	_wiiuse_write_data
LBB0_6:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_WIIMOTE_STATE_IR,4,2           ## @WIIMOTE_STATE_IR
	.comm	_WIIMOTE_STATE_EXP,4,2          ## @WIIMOTE_STATE_EXP
	.comm	_WM_IR_TYPE_BASIC,4,2           ## @WM_IR_TYPE_BASIC
	.comm	_WM_IR_TYPE_EXTENDED,4,2        ## @WM_IR_TYPE_EXTENDED
	.comm	_WM_REG_IR_MODENUM,4,2          ## @WM_REG_IR_MODENUM
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_wiiuse_set_ir_mode             ; -- Begin function wiiuse_set_ir_mode
	.p2align	2
_wiiuse_set_ir_mode:                    ; @wiiuse_set_ir_mode
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	cbz	x0, LBB0_3
; %bb.1:
	mov	x19, x0
Lloh0:
	adrp	x8, _WIIMOTE_STATE_IR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _WIIMOTE_STATE_IR@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_WIIMOTE_IS_SET
	cbz	x0, LBB0_3
; %bb.2:
Lloh3:
	adrp	x8, _WIIMOTE_STATE_EXP@GOTPAGE
Lloh4:
	ldr	x8, [x8, _WIIMOTE_STATE_EXP@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_WIIMOTE_IS_SET
Lloh6:
	adrp	x8, _WM_IR_TYPE_EXTENDED@GOTPAGE
Lloh7:
	ldr	x8, [x8, _WM_IR_TYPE_EXTENDED@GOTPAGEOFF]
Lloh8:
	adrp	x9, _WM_IR_TYPE_BASIC@GOTPAGE
Lloh9:
	ldr	x9, [x9, _WM_IR_TYPE_BASIC@GOTPAGEOFF]
	cmp	x0, #0
	csel	x8, x8, x9, eq
	ldr	w8, [x8]
	str	w8, [sp, #12]
Lloh10:
	adrp	x8, _WM_REG_IR_MODENUM@GOTPAGE
Lloh11:
	ldr	x8, [x8, _WM_REG_IR_MODENUM@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	add	x2, sp, #12
	mov	x0, x19
	mov	w3, #1
	mov	x4, #0
	bl	_wiiuse_write_data
LBB0_3:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_WIIMOTE_STATE_IR,4,2           ; @WIIMOTE_STATE_IR
	.comm	_WIIMOTE_STATE_EXP,4,2          ; @WIIMOTE_STATE_EXP
	.comm	_WM_IR_TYPE_BASIC,4,2           ; @WM_IR_TYPE_BASIC
	.comm	_WM_IR_TYPE_EXTENDED,4,2        ; @WM_IR_TYPE_EXTENDED
	.comm	_WM_REG_IR_MODENUM,4,2          ; @WM_REG_IR_MODENUM
.subsections_via_symbols
