	.file	"extr_vicodec-core.c_get_next_header.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	get_next_header, @function
get_next_header:
.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
	lea	r14, 16[rdi]
	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
	mov	rbx, rdi
	sub	rsp, 24
	.cfi_def_cfa_offset 80
	movsx	rax, DWORD PTR [rdi]
	mov	r12, QWORD PTR [rsi]
	test	eax, eax
	jne	.L2
	movsx	rdx, edx
	mov	eax, DWORD PTR VB2_BUF_STATE_ERROR[rip]
	lea	rbp, 0[0+rdx*4]
	lea	rdx, [r12+rbp]
	mov	DWORD PTR 12[rsp], eax
	mov	rax, QWORD PTR 8[rdi]
	cmp	r12, rdx
	jnb	.L3
	lea	rcx, magic.1949[rip]
	mov	esi, DWORD PTR [rcx+rax*4]
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L4:
	mov	rax, QWORD PTR 0[r13]
	mov	rsi, QWORD PTR 8[rbx]
	mov	edx, 32
	add	rax, rbp
	sub	edx, esi
	sub	rax, r15
	movsx	r12, edx
	sar	rax, 2
	cmp	rax, r12
	jge	.L6
	movsx	r12, eax
	mov	rdx, r12
.L6:
	lea	rdi, [r14+rsi*4]
	mov	rsi, r15
	call	memcpy@PLT
	mov	rdx, QWORD PTR 8[rbx]
	lea	rsi, magic.1949[rip]
	mov	rdi, r14
	add	rdx, r12
	mov	QWORD PTR 8[rbx], rdx
	call	memcmp@PLT
	test	eax, eax
	je	.L18
	mov	rdx, QWORD PTR 0[r13]
	lea	r12, 4[r15]
	mov	esi, 79
	mov	QWORD PTR 8[rbx], 0
	add	rdx, rbp
	cmp	rdx, r12
	jbe	.L11
.L8:
	sub	rdx, r12
	mov	rdi, r12
	sar	rdx, 2
	call	memchr@PLT
	mov	r15, rax
	test	rax, rax
	jne	.L4
	mov	QWORD PTR 8[rbx], 0
	add	rbp, QWORD PTR 0[r13]
	mov	r12, rbp
.L11:
	mov	QWORD PTR 0[r13], r12
	mov	eax, DWORD PTR 12[rsp]
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
.L2:
	.cfi_restore_state
	mov	ecx, DWORD PTR VB2_BUF_STATE_DONE[rip]
	mov	DWORD PTR 12[rsp], ecx
	cmp	eax, 3
	ja	.L11
	mov	ebp, 4
	movsx	rdx, edx
	lea	rdi, [r14+rax*4]
	mov	rsi, r12
	sub	ebp, eax
	mov	ecx, ebp
	cmp	rdx, rcx
	cmovl	ebp, edx
	mov	edx, ebp
	call	memcpy@PLT
	movsx	rax, ebp
	add	DWORD PTR [rbx], ebp
	lea	r12, [r12+rax*4]
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L18:
	mov	eax, DWORD PTR VB2_BUF_STATE_DONE[rip]
	lea	r12, [r15+r12*4]
	mov	DWORD PTR 12[rsp], eax
	mov	rax, QWORD PTR 8[rbx]
.L3:
	cmp	rax, 31
	jbe	.L11
	mov	DWORD PTR [rbx], 32
	jmp	.L11
	.cfi_endproc
.LFE0:
	.size	get_next_header, .-get_next_header
	.section	.rodata
	.align 32
	.type	magic.1949, @object
	.size	magic.1949, 32
magic.1949:
	.long	79
	.long	79
	.long	79
	.long	79
	.long	255
	.long	255
	.long	255
	.long	255
	.comm	VB2_BUF_STATE_ERROR,4,4
	.comm	VB2_BUF_STATE_DONE,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_vicodec-core.c_get_next_header.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	get_next_header, %function
get_next_header:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r8, r0
	mov	r7, r0
	ldr	r0, [r8], #8
	mov	r10, r1
	cmp	r0, #0
	ldr	r9, [r1]
	sub	sp, sp, #20
	bne	.L2
	ldr	r1, .L16
	add	r5, r9, r2, lsl #2
	ldr	r3, [r1]
	cmp	r9, r5
	str	r3, [sp, #12]
	lsl	r3, r2, #2
	ldr	r4, [r7, #4]
	str	r3, [sp, #4]
	bcs	.L3
	ldr	r2, .L16+4
	str	r0, [sp, #8]
	mov	fp, r2
	ldr	r1, [r2, r4, lsl #2]
	b	.L7
.L4:
	cmp	r2, r1
	movge	r5, r1
	movlt	r5, r2
	mov	r1, r6
	mov	r2, r5
	bl	memcpy
	ldr	r4, [r7, #4]
	mov	r1, fp
	add	r4, r5, r4
	mov	r2, r4
	mov	r0, r8
	str	r4, [r7, #4]
	bl	memcmp
	cmp	r0, #0
	beq	.L15
	ldr	r3, [sp, #8]
	ldr	r5, [r10]
	str	r3, [r7, #4]
	ldr	r3, [sp, #4]
	mov	r4, #0
	add	r5, r5, r3
	cmp	r5, r9
	mov	r1, #79
	bls	.L10
.L7:
	sub	r2, r5, r9
	mov	r0, r9
	asr	r2, r2, #2
	bl	memchr
	mov	r6, r0
	cmp	r6, #0
	sub	r2, r5, r6
	rsb	r1, r4, #32
	add	r0, r8, r4, lsl #2
	asr	r2, r2, #2
	add	r9, r6, #4
	bne	.L4
	mov	r9, r5
	str	r6, [r7, #4]
.L10:
	ldr	r0, [sp, #12]
	str	r9, [r10]
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L2:
	ldr	r1, .L16+8
	cmp	r0, #3
	ldr	r3, [r1]
	str	r3, [sp, #12]
	bhi	.L10
	lsl	r4, r2, #2
	asr	r4, r4, #2
	rsb	r2, r0, #4
	cmp	r4, r2
	movge	r4, r2
	mov	r1, r9
	mov	r2, r4
	add	r0, r8, r0, lsl #2
	bl	memcpy
	ldr	r2, [r7]
	ldr	r0, [sp, #12]
	add	r9, r9, r4, lsl #2
	add	r2, r2, r4
	str	r2, [r7]
	str	r9, [r10]
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L15:
	ldr	r2, .L16+8
	add	r9, r6, r5, lsl #2
	ldr	r3, [r2]
	str	r3, [sp, #12]
.L3:
	cmp	r4, #31
	movhi	r2, #32
	ldr	r0, [sp, #12]
	strhi	r2, [r7]
	str	r9, [r10]
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L17:
	.align	2
.L16:
	.word	VB2_BUF_STATE_ERROR
	.word	.LANCHOR0
	.word	VB2_BUF_STATE_DONE
	.size	get_next_header, .-get_next_header
	.comm	VB2_BUF_STATE_ERROR,4,4
	.comm	VB2_BUF_STATE_DONE,4,4
	.section	.rodata
	.align	2
	.set	.LANCHOR0,. + 0
	.type	magic.4233, %object
	.size	magic.4233, 32
magic.4233:
	.word	79
	.word	79
	.word	79
	.word	79
	.word	255
	.word	255
	.word	255
	.word	255
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
