	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_wiiproto_req_leds              ## -- Begin function wiiproto_req_leds
	.p2align	4, 0x90
_wiiproto_req_leds:                     ## @wiiproto_req_leds
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -24
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -16(%rbp)
	movq	_WIIPROTO_FLAGS_LEDS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	%eax, %esi
	movl	(%rdi), %ecx
	movl	%ecx, %edx
	andl	%eax, %edx
	cmpl	%esi, %edx
	je	LBB0_8
## %bb.1:
	movq	%rdi, %rbx
	notl	%eax
	andl	%eax, %ecx
	orl	%esi, %ecx
	movl	%ecx, (%rdi)
	movq	_WIIPROTO_REQ_LED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -24(%rbp)
	movq	_WIIPROTO_FLAG_LED1@GOTPCREL(%rip), %rax
	xorl	%ecx, %ecx
	movl	(%rax), %eax
	andl	%esi, %eax
	setne	%cl
	shll	$4, %ecx
	movl	%ecx, -20(%rbp)
	movq	_WIIPROTO_FLAG_LED2@GOTPCREL(%rip), %rax
	testl	%esi, (%rax)
	je	LBB0_3
## %bb.2:
	orl	$32, %ecx
	movl	%ecx, -20(%rbp)
LBB0_3:
	movq	_WIIPROTO_FLAG_LED3@GOTPCREL(%rip), %rax
	testl	%esi, (%rax)
	je	LBB0_5
## %bb.4:
	orl	$64, %ecx
	movl	%ecx, -20(%rbp)
LBB0_5:
	leaq	-20(%rbp), %rax
	movq	_WIIPROTO_FLAG_LED4@GOTPCREL(%rip), %rdx
	testl	%esi, (%rdx)
	je	LBB0_7
## %bb.6:
	orl	$128, %ecx
	movl	%ecx, -20(%rbp)
LBB0_7:
	movq	%rbx, %rdi
	movq	%rax, %rsi
	callq	_wiiproto_keep_rumble
	leaq	-24(%rbp), %rsi
	movq	%rbx, %rdi
	movl	$8, %edx
	callq	_wiimote_queue
LBB0_8:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-16(%rbp), %rax
	jne	LBB0_10
## %bb.9:
	addq	$24, %rsp
	popq	%rbx
	popq	%rbp
	retq
LBB0_10:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_WIIPROTO_FLAGS_LEDS,4,2        ## @WIIPROTO_FLAGS_LEDS
	.comm	_WIIPROTO_REQ_LED,4,2           ## @WIIPROTO_REQ_LED
	.comm	_WIIPROTO_FLAG_LED1,4,2         ## @WIIPROTO_FLAG_LED1
	.comm	_WIIPROTO_FLAG_LED2,4,2         ## @WIIPROTO_FLAG_LED2
	.comm	_WIIPROTO_FLAG_LED3,4,2         ## @WIIPROTO_FLAG_LED3
	.comm	_WIIPROTO_FLAG_LED4,4,2         ## @WIIPROTO_FLAG_LED4
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_wiiproto_req_leds              ; -- Begin function wiiproto_req_leds
	.p2align	2
_wiiproto_req_leds:                     ; @wiiproto_req_leds
	.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
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
Lloh3:
	adrp	x9, _WIIPROTO_FLAGS_LEDS@GOTPAGE
Lloh4:
	ldr	x9, [x9, _WIIPROTO_FLAGS_LEDS@GOTPAGEOFF]
	str	x8, [sp, #8]
Lloh5:
	ldr	w9, [x9]
	and	w8, w9, w1
	ldr	w10, [x0]
	and	w11, w10, w9
	cmp	w11, w8
	b.eq	LBB0_8
; %bb.1:
	mov	x19, x0
	bic	w9, w10, w9
	orr	w9, w9, w8
	str	w9, [x0]
Lloh6:
	adrp	x9, _WIIPROTO_REQ_LED@GOTPAGE
Lloh7:
	ldr	x9, [x9, _WIIPROTO_REQ_LED@GOTPAGEOFF]
Lloh8:
	ldr	w11, [x9]
	mov	x10, sp
Lloh9:
	adrp	x9, _WIIPROTO_FLAG_LED1@GOTPAGE
Lloh10:
	ldr	x9, [x9, _WIIPROTO_FLAG_LED1@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	tst	w9, w8
	cset	w9, ne
	lsl	w9, w9, #4
	stp	w11, w9, [sp]
Lloh12:
	adrp	x11, _WIIPROTO_FLAG_LED2@GOTPAGE
Lloh13:
	ldr	x11, [x11, _WIIPROTO_FLAG_LED2@GOTPAGEOFF]
Lloh14:
	ldr	w11, [x11]
	tst	w11, w8
	b.eq	LBB0_3
; %bb.2:
	orr	w9, w9, #0x20
	str	w9, [sp, #4]
LBB0_3:
	add	x1, x10, #4
Lloh15:
	adrp	x10, _WIIPROTO_FLAG_LED3@GOTPAGE
Lloh16:
	ldr	x10, [x10, _WIIPROTO_FLAG_LED3@GOTPAGEOFF]
Lloh17:
	ldr	w10, [x10]
	tst	w10, w8
	b.eq	LBB0_5
; %bb.4:
	orr	w9, w9, #0x40
	str	w9, [sp, #4]
LBB0_5:
Lloh18:
	adrp	x10, _WIIPROTO_FLAG_LED4@GOTPAGE
Lloh19:
	ldr	x10, [x10, _WIIPROTO_FLAG_LED4@GOTPAGEOFF]
Lloh20:
	ldr	w10, [x10]
	tst	w10, w8
	b.eq	LBB0_7
; %bb.6:
	orr	w8, w9, #0x80
	str	w8, [sp, #4]
LBB0_7:
	mov	x0, x19
	bl	_wiiproto_keep_rumble
	mov	x1, sp
	mov	x0, x19
	mov	w2, #8
	bl	_wiimote_queue
LBB0_8:
	ldr	x8, [sp, #8]
Lloh21:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh22:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh23:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_10
; %bb.9:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
LBB0_10:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_WIIPROTO_FLAGS_LEDS,4,2        ; @WIIPROTO_FLAGS_LEDS
	.comm	_WIIPROTO_REQ_LED,4,2           ; @WIIPROTO_REQ_LED
	.comm	_WIIPROTO_FLAG_LED1,4,2         ; @WIIPROTO_FLAG_LED1
	.comm	_WIIPROTO_FLAG_LED2,4,2         ; @WIIPROTO_FLAG_LED2
	.comm	_WIIPROTO_FLAG_LED3,4,2         ; @WIIPROTO_FLAG_LED3
	.comm	_WIIPROTO_FLAG_LED4,4,2         ; @WIIPROTO_FLAG_LED4
.subsections_via_symbols
