	.file	"extr_h264_refs.c_add_sorted.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	add_sorted, @function
add_sorted:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	test	r8d, r8d
	lea	eax, -1[rdx]
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	mov	r13d, DWORD PTR INT_MAX[rip]
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	cmovne	r13d, DWORD PTR INT_MIN[rip]
	xor	r12d, r12d
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	mov	ebp, edx
	mov	r14d, r12d
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	mov	rbx, rsi
	lea	rsi, 8[rsi+rax*8]
	test	ebp, ebp
	jle	.L1
	.p2align 4,,10
	.p2align 3
.L9:
	mov	rax, rbx
	mov	edx, r13d
	.p2align 4,,10
	.p2align 3
.L4:
	mov	r10, QWORD PTR [rax]
	xor	r11d, r11d
	mov	r9d, DWORD PTR [r10]
	cmp	ecx, r9d
	setl	r11b
	cmp	r11d, r8d
	je	.L3
	xor	r11d, r11d
	cmp	r9d, edx
	setl	r11b
	cmp	r11d, r8d
	je	.L3
	mov	QWORD PTR [rdi+r12*8], r10
	mov	edx, r9d
.L3:
	add	rax, 8
	cmp	rsi, rax
	jne	.L4
	cmp	edx, r13d
	je	.L1
	mov	rax, QWORD PTR [rdi+r12*8]
	add	r12, 1
	mov	r14d, r12d
	mov	ecx, DWORD PTR [rax]
	sub	ecx, r8d
	test	ebp, ebp
	jg	.L9
.L1:
	pop	rbx
	.cfi_def_cfa_offset 40
	mov	eax, r14d
	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
	.cfi_endproc
.LFE0:
	.size	add_sorted, .-add_sorted
	.comm	INT_MIN,4,4
	.comm	INT_MAX,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_h264_refs.c_add_sorted.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	add_sorted, %function
add_sorted:
	@ args = 4, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	mov	r8, r0
	ldr	ip, .L10
	ldr	r5, [sp, #32]
	ldr	lr, .L10+4
	ldr	ip, [ip]
	cmp	r5, #0
	ldr	r9, [lr]
	sub	r10, r1, #4
	movne	r9, ip
	cmp	r2, #0
	mov	r0, #0
	sub	r8, r8, #4
	add	r7, r10, r2, lsl #2
	pople	{r4, r5, r6, r7, r8, r9, r10, pc}
.L9:
	mov	r1, r10
	mov	r6, r9
.L4:
	ldr	lr, [r1, #4]!
	ldr	ip, [lr]
	cmp	r3, ip
	movge	r4, #0
	movlt	r4, #1
	cmp	r4, r5
	beq	.L3
	cmp	ip, r6
	movge	r4, #0
	movlt	r4, #1
	cmp	r4, r5
	movne	r6, ip
	strne	lr, [r8, #4]
.L3:
	cmp	r1, r7
	bne	.L4
	cmp	r6, r9
	popeq	{r4, r5, r6, r7, r8, r9, r10, pc}
	ldr	r3, [r8, #4]!
	cmp	r2, #0
	ldr	r3, [r3]
	add	r0, r0, #1
	sub	r3, r3, r5
	bgt	.L9
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L11:
	.align	2
.L10:
	.word	INT_MIN
	.word	INT_MAX
	.size	add_sorted, .-add_sorted
	.comm	INT_MIN,4,4
	.comm	INT_MAX,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
