	.file	"extr_dvb_ringbuffer.c_dvb_ringbuffer_pkt_read.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	dvb_ringbuffer_pkt_read
	.type	dvb_ringbuffer_pkt_read, @function
dvb_ringbuffer_pkt_read:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	mov	r9d, edx
	lea	rax, 1[rsi]
	xor	edx, edx
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	mov	rbx, rdi
	mov	rdi, rcx
	sub	rsp, 16
	.cfi_def_cfa_offset 64
	mov	rbp, QWORD PTR 8[rbx]
	mov	rcx, QWORD PTR [rbx]
	mov	r12, QWORD PTR EINVAL[rip]
	div	rbp
	mov	r10d, DWORD PTR [rcx+rsi*4]
	sal	r10d, 8
	movsx	rax, r9d
	neg	r12
	or	r10d, DWORD PTR [rcx+rdx*4]
	movsx	rdx, r10d
	cmp	rax, rdx
	ja	.L1
	lea	r9, [rax+r8]
	mov	r12, rdx
	sub	r12, rax
	cmp	r9, rdx
	cmovbe	r12, r8
	add	rax, rsi
	xor	edx, edx
	add	rax, QWORD PTR DVB_RINGBUFFER_PKTHDRSIZE[rip]
	div	rbp
	lea	rax, [r12+rdx]
	mov	r13, rdx
	lea	rsi, [rcx+rdx*4]
	mov	rdx, r12
	cmp	rbp, rax
	jb	.L12
.L5:
	call	memcpy@PLT
.L1:
	add	rsp, 16
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	mov	rax, r12
	pop	rbx
	.cfi_def_cfa_offset 40
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L12:
	.cfi_restore_state
	mov	r14, rbp
	sub	r14, r13
	je	.L5
	mov	rdx, r14
	mov	QWORD PTR 8[rsp], rdi
	call	memcpy@PLT
	mov	rdi, QWORD PTR 8[rsp]
	mov	rax, r13
	mov	rsi, QWORD PTR [rbx]
	sub	rax, rbp
	lea	rdi, [rdi+r14*4]
	lea	rdx, [rax+r12]
	jmp	.L5
	.cfi_endproc
.LFE0:
	.size	dvb_ringbuffer_pkt_read, .-dvb_ringbuffer_pkt_read
	.comm	EINVAL,8,8
	.comm	DVB_RINGBUFFER_PKTHDRSIZE,8,8
	.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_dvb_ringbuffer.c_dvb_ringbuffer_pkt_read.c"
	.text
	.global	__aeabi_uidivmod
	.align	2
	.global	dvb_ringbuffer_pkt_read
	.syntax unified
	.arm
	.fpu softvfp
	.type	dvb_ringbuffer_pkt_read, %function
dvb_ringbuffer_pkt_read:
	@ args = 4, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	mov	r6, r1
	ldr	r10, [r0]
	ldr	r9, [r0, #4]
	ldr	ip, [r10, r1, lsl #2]
	mov	r7, r0
	mov	r1, r9
	add	r0, r6, #1
	lsl	r4, ip, #8
	mov	r5, r2
	mov	r8, r3
	bl	__aeabi_uidivmod
	ldr	ip, [r10, r1, lsl #2]
	orr	ip, r4, ip
	cmp	r5, ip
	bhi	.L11
	ldr	r3, [sp, #32]
	mov	r1, r9
	add	r3, r5, r3
	cmp	r3, ip
	ldr	r3, .L13
	subhi	r4, ip, r5
	ldr	r0, [r3]
	add	r5, r5, r6
	add	r0, r5, r0
	ldrls	r4, [sp, #32]
	bl	__aeabi_uidivmod
	add	r3, r4, r1
	cmp	r9, r3
	mov	r5, r1
	add	r1, r10, r1, lsl #2
	bcc	.L12
.L8:
	mov	r2, r4
.L5:
	mov	r0, r8
	bl	memcpy
	mov	r0, r4
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L12:
	subs	r6, r9, r5
	beq	.L8
	mov	r2, r6
	mov	r0, r8
	sub	r9, r5, r9
	bl	memcpy
	add	r8, r8, r6, lsl #2
	ldr	r1, [r7]
	add	r2, r9, r4
	b	.L5
.L11:
	ldr	r3, .L13+4
	ldr	ip, [r3]
	rsb	r4, ip, #0
	mov	r0, r4
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L14:
	.align	2
.L13:
	.word	DVB_RINGBUFFER_PKTHDRSIZE
	.word	EINVAL
	.size	dvb_ringbuffer_pkt_read, .-dvb_ringbuffer_pkt_read
	.comm	EINVAL,4,4
	.comm	DVB_RINGBUFFER_PKTHDRSIZE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
