	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wiimod_led_set
_wiimod_led_set:                        ## @wiimod_led_set
	.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, %r14d
	movq	%rdi, %rbx
	movq	(%rdi), %rax
	movq	(%rax), %rdi
	callq	_dev_to_wii
	movq	%rax, %r15
	movq	8(%rax), %rax
	cmpq	%rbx, (%rax)
	je	LBB0_1
## %bb.3:
	cmpq	%rbx, 8(%rax)
	je	LBB0_4
## %bb.5:
	cmpq	%rbx, 16(%rax)
	je	LBB0_6
## %bb.7:
	cmpq	%rbx, 24(%rax)
	je	LBB0_8
## %bb.9:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movl	$1, %edi
	jmp	LBB0_2
LBB0_4:
	movl	$2, %edi
	jmp	LBB0_2
LBB0_6:
	movl	$3, %edi
	jmp	LBB0_2
LBB0_8:
	movl	$4, %edi
LBB0_2:
	callq	_WIIPROTO_FLAG_LED
	movl	%eax, %ebx
	movq	%r15, %r12
	addq	$4, %r12
	movq	%r12, %rdi
	callq	_spin_lock_irqsave
	movl	(%r15), %eax
	movq	_LED_OFF@GOTPCREL(%rip), %rcx
	movl	%eax, %edx
	orl	%ebx, %edx
	notl	%ebx
	andl	%eax, %ebx
	cmpl	%r14d, (%rcx)
	cmovnel	%edx, %ebx
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_wiiproto_req_leds
	movq	%r12, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_spin_unlock_irqrestore         ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_LED_OFF,4,2                    ## @LED_OFF
	.no_dead_strip	_wiimod_led_set
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wiimod_led_set
_wiimod_led_set:                        ; @wiimod_led_set
	.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
	mov	x21, x0
	ldr	x8, [x0]
	ldr	x0, [x8]
	bl	_dev_to_wii
	mov	x20, x0
	ldr	x8, [x0, #8]
	ldr	x9, [x8]
	cmp	x9, x21
	b.eq	LBB0_5
; %bb.1:
	ldr	x9, [x8, #8]
	cmp	x9, x21
	b.eq	LBB0_6
; %bb.2:
	ldr	x9, [x8, #16]
	cmp	x9, x21
	b.eq	LBB0_7
; %bb.3:
	ldr	x8, [x8, #24]
	cmp	x8, x21
	b.eq	LBB0_8
; %bb.4:
	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_5:
	mov	w0, #1
	b	LBB0_9
LBB0_6:
	mov	w0, #2
	b	LBB0_9
LBB0_7:
	mov	w0, #3
	b	LBB0_9
LBB0_8:
	mov	w0, #4
LBB0_9:
	bl	_WIIPROTO_FLAG_LED
	mov	x21, x0
	add	x22, x20, #4
	mov	x0, x22
	bl	_spin_lock_irqsave
Lloh0:
	adrp	x8, _LED_OFF@GOTPAGE
Lloh1:
	ldr	x8, [x8, _LED_OFF@GOTPAGEOFF]
	ldr	w9, [x20]
Lloh2:
	ldr	w8, [x8]
	orr	w10, w9, w21
	bic	w9, w9, w21
	cmp	w8, w19
	csel	w1, w9, w10, eq
	mov	x0, x20
	bl	_wiiproto_req_leds
	mov	x0, x22
	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
	b	_spin_unlock_irqrestore
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_LED_OFF,4,2                    ; @LED_OFF
	.no_dead_strip	_wiimod_led_set
.subsections_via_symbols
