	.file	"extr_adbhid.c_real_leds.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	real_leds, @function
real_leds:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	ebp, esi
	xor	esi, esi
	push	rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	mov	ebx, edi
	lea	rdi, leds_lock[rip]
	sub	rsp, 8
	.cfi_def_cfa_offset 32
	call	spin_lock_irqsave@PLT
	mov	eax, DWORD PTR leds_req_pending[rip]
	test	eax, eax
	je	.L10
	mov	rdx, QWORD PTR leds_pending[rip]
	movsx	rax, ebp
	lea	rdx, [rdx+rax*4]
	test	DWORD PTR [rdx], 256
	jne	.L4
	mov	rax, QWORD PTR pending_led_end[rip]
	mov	rcx, QWORD PTR pending_devs[rip]
	mov	DWORD PTR [rcx+rax*4], ebp
	add	rax, 1
	mov	ecx, 0
	cmp	rax, 16
	cmovnb	rax, rcx
	mov	QWORD PTR pending_led_end[rip], rax
.L4:
	movzx	ebx, bl
	xor	esi, esi
	lea	rdi, leds_lock[rip]
	or	bh, 1
	mov	DWORD PTR [rdx], ebx
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_def_cfa_offset 8
	jmp	spin_unlock_irqrestore@PLT
	.p2align 4,,10
	.p2align 3
.L10:
	.cfi_restore_state
	xor	esi, esi
	lea	rdi, leds_lock[rip]
	not	ebx
	mov	DWORD PTR leds_req_pending[rip], 1
	call	spin_unlock_irqrestore@PLT
	mov	esi, DWORD PTR KEYB_LEDREG[rip]
	mov	edi, ebp
	movzx	ebx, bl
	call	ADB_WRITEREG@PLT
	sub	rsp, 8
	.cfi_def_cfa_offset 40
	mov	ecx, 3
	xor	edx, edx
	push	rbx
	.cfi_def_cfa_offset 48
	mov	esi, DWORD PTR leds_done[rip]
	mov	r8d, eax
	mov	r9d, 255
	lea	rdi, led_request[rip]
	call	adb_request@PLT
	add	rsp, 24
	.cfi_def_cfa_offset 24
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	real_leds, .-real_leds
	.comm	pending_led_end,8,8
	.comm	pending_devs,8,8
	.comm	leds_req_pending,4,4
	.comm	leds_pending,8,8
	.comm	leds_lock,4,4
	.comm	leds_done,4,4
	.comm	led_request,4,4
	.comm	KEYB_LEDREG,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_adbhid.c_real_leds.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	real_leds, %function
real_leds:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, lr}
	mov	r6, r0
	mov	r4, r1
	ldr	r0, .L11
	mov	r1, #0
	sub	sp, sp, #16
	bl	spin_lock_irqsave
	ldr	r3, .L11+4
	ldr	r5, [r3]
	cmp	r5, #0
	beq	.L10
	ldr	r3, .L11+8
	ldr	r3, [r3]
	ldr	r2, [r3, r4, lsl #2]
	tst	r2, #256
	bne	.L4
	ldr	r1, .L11+12
	ldr	r2, .L11+16
	ldr	r0, [r1]
	ldr	ip, [r2]
	add	r2, r0, #1
	cmp	r2, #16
	movcs	r2, #0
	str	r4, [ip, r0, lsl #2]
	str	r2, [r1]
.L4:
	mov	r1, #0
	orr	r0, r6, #256
	str	r0, [r3, r4, lsl #2]
	ldr	r0, .L11
	add	sp, sp, #16
	@ sp needed
	pop	{r4, r5, r6, lr}
	b	spin_unlock_irqrestore
.L10:
	mov	r2, #1
	mov	r1, #0
	ldr	r0, .L11
	str	r2, [r3]
	bl	spin_unlock_irqrestore
	ldr	r2, .L11+20
	ldr	r3, .L11+24
	ldr	r1, [r2]
	mov	r0, r4
	ldr	r4, [r3]
	bl	ADB_WRITEREG
	mov	ip, #255
	mvn	r3, r6
	and	r3, r3, ip
	str	r3, [sp, #8]
	str	r0, [sp]
	mov	r1, r4
	mov	r2, r5
	mov	r3, #3
	str	ip, [sp, #4]
	ldr	r0, .L11+28
	bl	adb_request
	add	sp, sp, #16
	@ sp needed
	pop	{r4, r5, r6, pc}
.L12:
	.align	2
.L11:
	.word	leds_lock
	.word	leds_req_pending
	.word	leds_pending
	.word	pending_led_end
	.word	pending_devs
	.word	KEYB_LEDREG
	.word	leds_done
	.word	led_request
	.size	real_leds, .-real_leds
	.comm	pending_led_end,4,4
	.comm	pending_devs,4,4
	.comm	leds_req_pending,4,4
	.comm	leds_pending,4,4
	.comm	leds_lock,4,4
	.comm	leds_done,4,4
	.comm	led_request,4,4
	.comm	KEYB_LEDREG,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
