	.file	"extr_lightning.c_l4_cooked_read.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	l4_cooked_read, @function
l4_cooked_read:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	mov	r14, rdx
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13, rsi
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 8
	.cfi_def_cfa_offset 64
	mov	rbx, QWORD PTR [rdi]
	mov	esi, DWORD PTR L4_PORT[rip]
	mov	edi, DWORD PTR L4_SELECT_ANALOG[rip]
	call	outb@PLT
	mov	edi, DWORD PTR [rbx]
	mov	esi, DWORD PTR L4_PORT[rip]
	sar	edi, 2
	add	edi, DWORD PTR L4_SELECT_DIGITAL[rip]
	call	outb@PLT
	mov	edi, DWORD PTR L4_PORT[rip]
	call	inb@PLT
	test	DWORD PTR L4_BUSY[rip], eax
	jne	.L4
	mov	edi, DWORD PTR [rbx]
	mov	esi, DWORD PTR L4_PORT[rip]
	and	edi, 3
	call	outb@PLT
	xor	eax, eax
	call	l4_wait_ready@PLT
	test	rax, rax
	jne	.L4
	mov	edi, DWORD PTR L4_PORT[rip]
	xor	ebx, ebx
	mov	r15d, -1
	call	inb@PLT
	mov	ebp, eax
	movzx	r12d, al
.L9:
	bt	r12d, ebx
	jc	.L16
.L6:
	add	rbx, 1
	cmp	rbx, 4
	jne	.L9
	and	ebp, 16
	mov	r12d, ebp
	jne	.L17
.L3:
	mov	esi, DWORD PTR L4_PORT[rip]
	mov	edi, DWORD PTR L4_SELECT_ANALOG[rip]
	call	outb@PLT
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r12d
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L16:
	.cfi_restore_state
	xor	eax, eax
	call	l4_wait_ready@PLT
	test	rax, rax
	jne	.L4
	mov	edi, DWORD PTR L4_PORT[rip]
	call	inb@PLT
	cmp	eax, 252
	cmovg	eax, r15d
	mov	DWORD PTR 0[r13+rbx*4], eax
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L17:
	xor	eax, eax
	call	l4_wait_ready@PLT
	test	rax, rax
	jne	.L4
	mov	edi, DWORD PTR L4_PORT[rip]
	xor	r12d, r12d
	call	inb@PLT
	and	eax, 15
	mov	DWORD PTR [r14], eax
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L4:
	mov	r12d, -1
	jmp	.L3
	.cfi_endproc
.LFE0:
	.size	l4_cooked_read, .-l4_cooked_read
	.comm	L4_SELECT_DIGITAL,4,4
	.comm	L4_SELECT_ANALOG,4,4
	.comm	L4_PORT,4,4
	.comm	L4_BUSY,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_lightning.c_l4_cooked_read.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	l4_cooked_read, %function
l4_cooked_read:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r3, r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r3, r0
	ldr	r6, .L18
	ldr	r10, .L18+4
	mov	r8, r1
	ldr	r0, [r10]
	ldr	r1, [r6]
	mov	r9, r2
	ldr	r4, [r3]
	bl	outb
	ldr	r3, .L18+8
	ldr	r0, [r4]
	ldr	r3, [r3]
	ldr	r1, [r6]
	add	r0, r3, r0, asr #2
	bl	outb
	ldr	r0, [r6]
	bl	inb
	ldr	r3, .L18+12
	ldr	r3, [r3]
	tst	r0, r3
	bne	.L4
	ldr	r0, [r4]
	ldr	r1, [r6]
	and	r0, r0, #3
	bl	outb
	bl	l4_wait_ready
	subs	r4, r0, #0
	bne	.L4
	ldr	r0, [r6]
	bl	inb
	mvn	fp, #0
	mov	r5, r0
	and	r7, r0, #255
.L9:
	asr	r3, r7, r4
	tst	r3, #1
	bne	.L16
.L6:
	add	r4, r4, #1
	cmp	r4, #4
	bne	.L9
	ands	r5, r5, #16
	bne	.L17
.L3:
	ldr	r1, [r6]
	ldr	r0, [r10]
	bl	outb
	mov	r0, r5
	pop	{r3, r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L16:
	bl	l4_wait_ready
	cmp	r0, #0
	bne	.L4
	ldr	r0, [r6]
	bl	inb
	cmp	r0, #252
	strle	r0, [r8, r4, lsl #2]
	strgt	fp, [r8, r4, lsl #2]
	b	.L6
.L17:
	bl	l4_wait_ready
	subs	r5, r0, #0
	bne	.L4
	ldr	r0, [r6]
	bl	inb
	and	r0, r0, #15
	str	r0, [r9]
	b	.L3
.L4:
	mvn	r5, #0
	b	.L3
.L19:
	.align	2
.L18:
	.word	L4_PORT
	.word	L4_SELECT_ANALOG
	.word	L4_SELECT_DIGITAL
	.word	L4_BUSY
	.size	l4_cooked_read, .-l4_cooked_read
	.comm	L4_SELECT_DIGITAL,4,4
	.comm	L4_SELECT_ANALOG,4,4
	.comm	L4_PORT,4,4
	.comm	L4_BUSY,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
