	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wiimod_ir_change
_wiimod_ir_change:                      ## @wiimod_ir_change
	.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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r15d
	movq	%rdi, %r12
	movl	$0, -44(%rbp)
	leaq	4(%rdi), %r14
	movq	%r14, %rdi
	callq	_spin_lock_irqsave
	movl	(%r12), %eax
	movq	_WIIPROTO_FLAGS_IR@GOTPCREL(%rip), %r13
	movl	(%r13), %ecx
	movl	%ecx, %edx
	andl	%eax, %edx
	cmpl	%r15d, %edx
	jne	LBB0_2
## %bb.1:
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
	xorl	%ebx, %ebx
	jmp	LBB0_23
LBB0_2:
	testl	%r15d, %r15d
	je	LBB0_3
## %bb.4:
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
	movq	%r12, %rdi
	callq	_wiimote_cmd_acquire
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_23
## %bb.5:
	movq	%r14, %rdi
	callq	_spin_lock_irqsave
	movq	_WIIPROTO_REQ_IR1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	xorl	%edx, %edx
	callq	_wiimote_cmd_set
	movq	%r12, %rdi
	movl	$6, %esi
	callq	_wiiproto_req_ir1
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
	movq	%r12, %rdi
	callq	_wiimote_cmd_wait
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_22
## %bb.6:
	cmpq	$0, 8(%r12)
	je	LBB0_8
LBB0_7:
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_22
LBB0_3:
	notl	%ecx
	andl	%ecx, %eax
	movl	%eax, (%r12)
	xorl	%ebx, %ebx
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_wiiproto_req_ir1
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_wiiproto_req_ir2
	movq	_WIIPROTO_REQ_NULL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_wiiproto_req_drm
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
	jmp	LBB0_23
LBB0_8:
	movq	%r14, %rdi
	callq	_spin_lock_irqsave
	movq	_WIIPROTO_REQ_IR2@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	xorl	%edx, %edx
	callq	_wiimote_cmd_set
	movq	%r12, %rdi
	movl	$6, %esi
	callq	_wiiproto_req_ir2
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
	movq	%r12, %rdi
	callq	_wiimote_cmd_wait
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_9
LBB0_22:
	movq	%r12, %rdi
	callq	_wiimote_cmd_release
LBB0_23:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	cmpq	$0, 8(%r12)
	jne	LBB0_7
## %bb.10:
	leaq	_wiimod_ir_change.data_enable(%rip), %rdx
	movq	%r12, %rdi
	movl	$11534384, %esi                 ## imm = 0xB00030
	movl	$4, %ecx
	callq	_wiimote_cmd_write
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_22
## %bb.11:
	leaq	_wiimod_ir_change.data_sens1(%rip), %rdx
	movq	%r12, %rdi
	movl	$11534336, %esi                 ## imm = 0xB00000
	movl	$36, %ecx
	callq	_wiimote_cmd_write
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_22
## %bb.12:
	leaq	_wiimod_ir_change.data_sens2(%rip), %rdx
	movq	%r12, %rdi
	movl	$11534362, %esi                 ## imm = 0xB0001A
	movl	$8, %ecx
	callq	_wiimote_cmd_write
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_22
## %bb.13:
	cmpl	$130, %r15d
	je	LBB0_18
## %bb.14:
	cmpl	$129, %r15d
	je	LBB0_17
## %bb.15:
	cmpl	$128, %r15d
	jne	LBB0_19
## %bb.16:
	movl	$5, -44(%rbp)
	jmp	LBB0_19
LBB0_18:
	movl	$1, -44(%rbp)
	jmp	LBB0_19
LBB0_17:
	movl	$3, -44(%rbp)
LBB0_19:
	leaq	-44(%rbp), %rdx
	movq	%r12, %rdi
	movl	$11534387, %esi                 ## imm = 0xB00033
	movl	$4, %ecx
	callq	_wiimote_cmd_write
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_22
## %bb.20:
	leaq	_wiimod_ir_change.data_fin(%rip), %rdx
	movq	%r12, %rdi
	movl	$11534384, %esi                 ## imm = 0xB00030
	movl	$4, %ecx
	callq	_wiimote_cmd_write
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_22
## %bb.21:
	movq	%r14, %rdi
	callq	_spin_lock_irqsave
	movl	(%r13), %eax
	notl	%eax
	andl	(%r12), %eax
	movl	%eax, (%r12)
	andl	(%r13), %r15d
	orl	%eax, %r15d
	movl	%r15d, (%r12)
	movq	_WIIPROTO_REQ_NULL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_wiiproto_req_drm
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
	xorl	%ebx, %ebx
	jmp	LBB0_22
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__const
	.p2align	2                               ## @wiimod_ir_change.data_enable
_wiimod_ir_change.data_enable:
	.long	1                               ## 0x1

	.p2align	4                               ## @wiimod_ir_change.data_sens1
_wiimod_ir_change.data_sens1:
	.long	2                               ## 0x2
	.long	0                               ## 0x0
	.long	0                               ## 0x0
	.long	113                             ## 0x71
	.long	1                               ## 0x1
	.long	0                               ## 0x0
	.long	170                             ## 0xaa
	.long	0                               ## 0x0
	.long	100                             ## 0x64

	.p2align	2                               ## @wiimod_ir_change.data_sens2
_wiimod_ir_change.data_sens2:
	.long	99                              ## 0x63
	.long	3                               ## 0x3

	.p2align	2                               ## @wiimod_ir_change.data_fin
_wiimod_ir_change.data_fin:
	.long	8                               ## 0x8

	.comm	_WIIPROTO_FLAGS_IR,4,2          ## @WIIPROTO_FLAGS_IR
	.comm	_WIIPROTO_REQ_NULL,4,2          ## @WIIPROTO_REQ_NULL
	.comm	_WIIPROTO_REQ_IR1,4,2           ## @WIIPROTO_REQ_IR1
	.comm	_EIO,4,2                        ## @EIO
	.comm	_WIIPROTO_REQ_IR2,4,2           ## @WIIPROTO_REQ_IR2
	.no_dead_strip	_wiimod_ir_change
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wiimod_ir_change
_wiimod_ir_change:                      ; @wiimod_ir_change
	.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
	mov	x21, x1
	mov	x19, x0
	str	wzr, [sp, #12]
	add	x20, x0, #4
	mov	x0, x20
	bl	_spin_lock_irqsave
	ldr	w8, [x19]
Lloh0:
	adrp	x23, _WIIPROTO_FLAGS_IR@GOTPAGE
Lloh1:
	ldr	x23, [x23, _WIIPROTO_FLAGS_IR@GOTPAGEOFF]
	ldr	w9, [x23]
	and	w10, w9, w8
	cmp	w10, w21
	b.eq	LBB0_7
; %bb.1:
	cbz	w21, LBB0_6
; %bb.2:
	mov	x0, x20
	bl	_spin_unlock_irqrestore
	mov	x0, x19
	bl	_wiimote_cmd_acquire
	mov	x22, x0
	cbnz	w0, LBB0_8
; %bb.3:
	mov	x0, x20
	bl	_spin_lock_irqsave
Lloh2:
	adrp	x8, _WIIPROTO_REQ_IR1@GOTPAGE
Lloh3:
	ldr	x8, [x8, _WIIPROTO_REQ_IR1@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_wiimote_cmd_set
	mov	x0, x19
	mov	w1, #6
	bl	_wiiproto_req_ir1
	mov	x0, x20
	bl	_spin_unlock_irqrestore
	mov	x0, x19
	bl	_wiimote_cmd_wait
	mov	x22, x0
	cbnz	w0, LBB0_10
; %bb.4:
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_9
LBB0_5:
Lloh5:
	adrp	x8, _EIO@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_10
LBB0_6:
	bic	w8, w8, w9
	str	w8, [x19]
	mov	x0, x19
	mov	w1, #0
	bl	_wiiproto_req_ir1
	mov	x0, x19
	mov	w1, #0
	bl	_wiiproto_req_ir2
Lloh8:
	adrp	x8, _WIIPROTO_REQ_NULL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _WIIPROTO_REQ_NULL@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_wiiproto_req_drm
LBB0_7:
	mov	x0, x20
	bl	_spin_unlock_irqrestore
	mov	w22, #0
LBB0_8:
	mov	x0, x22
	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_9:
	mov	x0, x20
	bl	_spin_lock_irqsave
Lloh11:
	adrp	x8, _WIIPROTO_REQ_IR2@GOTPAGE
Lloh12:
	ldr	x8, [x8, _WIIPROTO_REQ_IR2@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_wiimote_cmd_set
	mov	x0, x19
	mov	w1, #6
	bl	_wiiproto_req_ir2
	mov	x0, x20
	bl	_spin_unlock_irqrestore
	mov	x0, x19
	bl	_wiimote_cmd_wait
	mov	x22, x0
	cbz	w0, LBB0_11
LBB0_10:
	mov	x0, x19
	bl	_wiimote_cmd_release
	b	LBB0_8
LBB0_11:
	ldr	x8, [x19, #8]
	cbnz	x8, LBB0_5
; %bb.12:
	mov	w24, #48
	movk	w24, #176, lsl #16
Lloh14:
	adrp	x2, _wiimod_ir_change.data_enable@PAGE
Lloh15:
	add	x2, x2, _wiimod_ir_change.data_enable@PAGEOFF
	mov	x0, x19
	mov	w1, #48
	movk	w1, #176, lsl #16
	mov	w3, #4
	bl	_wiimote_cmd_write
	mov	x22, x0
	cbnz	w0, LBB0_10
; %bb.13:
Lloh16:
	adrp	x2, _wiimod_ir_change.data_sens1@PAGE
Lloh17:
	add	x2, x2, _wiimod_ir_change.data_sens1@PAGEOFF
	mov	x0, x19
	mov	w1, #11534336
	mov	w3, #36
	bl	_wiimote_cmd_write
	mov	x22, x0
	cbnz	w0, LBB0_10
; %bb.14:
	sub	w1, w24, #22
Lloh18:
	adrp	x2, _wiimod_ir_change.data_sens2@PAGE
Lloh19:
	add	x2, x2, _wiimod_ir_change.data_sens2@PAGEOFF
	mov	x0, x19
	mov	w3, #8
	bl	_wiimote_cmd_write
	mov	x22, x0
	cbnz	w0, LBB0_10
; %bb.15:
	cmp	w21, #130
	b.eq	LBB0_19
; %bb.16:
	cmp	w21, #129
	b.eq	LBB0_20
; %bb.17:
	cmp	w21, #128
	b.ne	LBB0_22
; %bb.18:
	mov	w8, #5
	b	LBB0_21
LBB0_19:
	mov	w8, #1
	b	LBB0_21
LBB0_20:
	mov	w8, #3
LBB0_21:
	str	w8, [sp, #12]
LBB0_22:
	add	w1, w24, #3
	add	x2, sp, #12
	mov	x0, x19
	mov	w3, #4
	bl	_wiimote_cmd_write
	mov	x22, x0
	cbnz	w0, LBB0_10
; %bb.23:
Lloh20:
	adrp	x2, _wiimod_ir_change.data_fin@PAGE
Lloh21:
	add	x2, x2, _wiimod_ir_change.data_fin@PAGEOFF
	mov	x0, x19
	mov	w1, #48
	movk	w1, #176, lsl #16
	mov	w3, #4
	bl	_wiimote_cmd_write
	mov	x22, x0
	cbnz	w0, LBB0_10
; %bb.24:
	mov	x0, x20
	bl	_spin_lock_irqsave
	ldr	w8, [x23]
	ldr	w9, [x19]
	bic	w8, w9, w8
	str	w8, [x19]
	ldr	w9, [x23]
	and	w9, w9, w21
	orr	w8, w9, w8
	str	w8, [x19]
Lloh22:
	adrp	x8, _WIIPROTO_REQ_NULL@GOTPAGE
Lloh23:
	ldr	x8, [x8, _WIIPROTO_REQ_NULL@GOTPAGEOFF]
Lloh24:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_wiiproto_req_drm
	mov	x0, x20
	bl	_spin_unlock_irqrestore
	b	LBB0_10
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__const
	.p2align	2                               ; @wiimod_ir_change.data_enable
_wiimod_ir_change.data_enable:
	.long	1                               ; 0x1

	.p2align	2                               ; @wiimod_ir_change.data_sens1
_wiimod_ir_change.data_sens1:
	.long	2                               ; 0x2
	.long	0                               ; 0x0
	.long	0                               ; 0x0
	.long	113                             ; 0x71
	.long	1                               ; 0x1
	.long	0                               ; 0x0
	.long	170                             ; 0xaa
	.long	0                               ; 0x0
	.long	100                             ; 0x64

	.p2align	2                               ; @wiimod_ir_change.data_sens2
_wiimod_ir_change.data_sens2:
	.long	99                              ; 0x63
	.long	3                               ; 0x3

	.p2align	2                               ; @wiimod_ir_change.data_fin
_wiimod_ir_change.data_fin:
	.long	8                               ; 0x8

	.comm	_WIIPROTO_FLAGS_IR,4,2          ; @WIIPROTO_FLAGS_IR
	.comm	_WIIPROTO_REQ_NULL,4,2          ; @WIIPROTO_REQ_NULL
	.comm	_WIIPROTO_REQ_IR1,4,2           ; @WIIPROTO_REQ_IR1
	.comm	_EIO,4,2                        ; @EIO
	.comm	_WIIPROTO_REQ_IR2,4,2           ; @WIIPROTO_REQ_IR2
	.no_dead_strip	_wiimod_ir_change
.subsections_via_symbols
