	.file	"extr_wavelan_cs.c_read_ringbuf.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	read_ringbuf, @function
read_ringbuf:
.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	r14d, esi
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	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	r15d, DWORD PTR [rdi]
	test	ecx, ecx
	jle	.L5
	mov	r13, rdx
	mov	ebp, ecx
	mov	r12d, esi
	.p2align 4,,10
	.p2align 3
.L4:
	mov	edi, r15d
	call	PIORL@PLT
	movzx	edi, r12b
	mov	esi, eax
	call	outb@PLT
	mov	edi, r15d
	call	PIORH@PLT
	mov	edi, r12d
	mov	esi, eax
	sar	edi, 8
	and	edi, DWORD PTR PIORH_MASK[rip]
	call	outb@PLT
	mov	ebx, DWORD PTR RX_SIZE[rip]
	lea	eax, [r14+rbp]
	add	ebx, DWORD PTR RX_BASE[rip]
	cmp	eax, ebx
	jge	.L9
	mov	edi, r15d
	call	PIOP@PLT
	mov	edx, ebp
	mov	rsi, r13
	mov	edi, eax
	call	insb@PLT
	mov	ecx, DWORD PTR RX_BASE[rip]
	sub	r12d, ecx
	lea	eax, [r12+rbp]
	cdq
	idiv	DWORD PTR RX_SIZE[rip]
	lea	r12d, [rcx+rdx]
.L1:
	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
.L9:
	.cfi_restore_state
	mov	edi, r15d
	sub	ebx, r14d
	call	PIOP@PLT
	mov	edx, ebx
	mov	rsi, r13
	sub	ebp, ebx
	mov	edi, eax
	call	insb@PLT
	mov	ecx, DWORD PTR RX_BASE[rip]
	movsx	rax, ebx
	add	r13, rax
	sub	r12d, ecx
	lea	eax, [r12+rbx]
	cdq
	idiv	DWORD PTR RX_SIZE[rip]
	lea	r12d, [rcx+rdx]
	test	ebp, ebp
	jg	.L4
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L5:
	mov	r12d, esi
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	read_ringbuf, .-read_ringbuf
	.comm	RX_SIZE,4,4
	.comm	RX_BASE,4,4
	.comm	PIORH_MASK,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_wavelan_cs.c_read_ringbuf.c"
	.text
	.global	__aeabi_idivmod
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	read_ringbuf, %function
read_ringbuf:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	subs	r5, r3, #0
	mov	r8, r1
	ldr	r7, [r0]
	sub	sp, sp, #12
	ble	.L5
	mov	r6, r2
	mov	r4, r1
	ldr	r10, .L10
	ldr	r9, .L10+4
.L4:
	mov	r0, r7
	bl	PIORL
	mov	r1, r0
	and	r0, r4, #255
	bl	outb
	ldr	r3, .L10+8
	mov	r0, r7
	ldr	r3, [r3]
	and	fp, r3, r4, asr #8
	bl	PIORH
	mov	r1, r0
	mov	r0, fp
	bl	outb
	ldr	r3, [r10]
	ldr	r2, [r9]
	add	r1, r8, r5
	add	r3, r3, r2
	cmp	r1, r3
	mov	r0, r7
	sub	fp, r3, r8
	bge	.L9
	bl	PIOP
	mov	r1, r6
	mov	r2, r5
	bl	insb
	ldr	r6, [r10]
	ldr	r1, [r9]
	sub	r0, r4, r6
	add	r0, r0, r5
	bl	__aeabi_idivmod
	add	r4, r6, r1
.L1:
	mov	r0, r4
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L9:
	bl	PIOP
	mov	r1, r6
	mov	r2, fp
	bl	insb
	ldr	r3, [r10]
	ldr	r1, [r9]
	sub	r0, r4, r3
	add	r0, r0, fp
	str	r3, [sp, #4]
	bl	__aeabi_idivmod
	sub	r5, r5, fp
	ldr	r3, [sp, #4]
	cmp	r5, #0
	add	r6, r6, fp
	add	r4, r3, r1
	bgt	.L4
	b	.L1
.L5:
	mov	r4, r1
	mov	r0, r4
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L11:
	.align	2
.L10:
	.word	RX_BASE
	.word	RX_SIZE
	.word	PIORH_MASK
	.size	read_ringbuf, .-read_ringbuf
	.comm	RX_SIZE,4,4
	.comm	RX_BASE,4,4
	.comm	PIORH_MASK,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
