	.file	"extr_buffer.c_av_buffer_realloc.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	av_buffer_realloc
	.type	av_buffer_realloc, @function
av_buffer_realloc:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	mov	r13, rdi
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	mov	ebp, esi
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	sub	rsp, 24
	.cfi_def_cfa_offset 64
	mov	rbx, QWORD PTR [rdi]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 8[rsp], rax
	xor	eax, eax
	test	rbx, rbx
	je	.L24
	xor	r12d, r12d
	cmp	DWORD PTR [rbx], esi
	je	.L1
	mov	rax, QWORD PTR 8[rbx]
	mov	eax, DWORD PTR [rax]
	test	DWORD PTR BUFFER_FLAG_REALLOCATABLE[rip], eax
	jne	.L7
.L10:
	mov	r12, rsp
	mov	esi, ebp
	mov	QWORD PTR [rsp], 0
	mov	rdi, r12
	call	av_buffer_realloc
	cmp	QWORD PTR [rsp], 0
	je	.L22
	mov	esi, DWORD PTR [rbx]
	mov	edi, ebp
	call	FFMIN@PLT
	mov	rsi, QWORD PTR 16[rbx]
	mov	edx, eax
	mov	rax, QWORD PTR [rsp]
	mov	rdi, QWORD PTR 16[rax]
	call	memcpy@PLT
	mov	rsi, r12
	mov	rdi, r13
	xor	r12d, r12d
	call	buffer_replace@PLT
.L1:
	mov	rax, QWORD PTR 8[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L25
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, r12d
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L7:
	.cfi_restore_state
	mov	rdi, rbx
	call	av_buffer_is_writable@PLT
	test	eax, eax
	je	.L10
	mov	rax, QWORD PTR 8[rbx]
	mov	rdi, QWORD PTR 8[rax]
	cmp	QWORD PTR 16[rbx], rdi
	jne	.L10
	mov	esi, ebp
	call	av_realloc@PLT
	test	rax, rax
	je	.L22
	mov	rdx, QWORD PTR 8[rbx]
	mov	QWORD PTR 16[rbx], rax
	mov	QWORD PTR 8[rdx], rax
	mov	DWORD PTR [rbx], ebp
	mov	DWORD PTR 4[rdx], ebp
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L26:
	mov	rdi, rsp
	call	av_freep@PLT
	.p2align 4,,10
	.p2align 3
.L22:
	mov	edi, DWORD PTR ENOMEM[rip]
	call	AVERROR@PLT
	mov	r12d, eax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L24:
	xor	edi, edi
	call	av_realloc@PLT
	mov	QWORD PTR [rsp], rax
	mov	rdi, rax
	test	rax, rax
	je	.L22
	mov	edx, DWORD PTR av_buffer_default_free[rip]
	xor	r8d, r8d
	xor	ecx, ecx
	mov	esi, ebp
	call	av_buffer_create@PLT
	test	rax, rax
	je	.L26
	mov	rdx, QWORD PTR 8[rax]
	mov	ecx, DWORD PTR BUFFER_FLAG_REALLOCATABLE[rip]
	xor	r12d, r12d
	or	DWORD PTR [rdx], ecx
	mov	QWORD PTR 0[r13], rax
	jmp	.L1
.L25:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	av_buffer_realloc, .-av_buffer_realloc
	.comm	av_buffer_default_free,4,4
	.comm	ENOMEM,4,4
	.comm	BUFFER_FLAG_REALLOCATABLE,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_buffer.c_av_buffer_realloc.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	av_buffer_realloc
	.syntax unified
	.arm
	.fpu softvfp
	.type	av_buffer_realloc, %function
av_buffer_realloc:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	ldr	r4, [r0]
	ldr	r3, .L27
	sub	sp, sp, #16
	cmp	r4, #0
	mov	r7, r0
	ldr	r3, [r3]
	str	r3, [sp, #12]
	mov	r3,#0
	mov	r5, r1
	beq	.L24
	ldr	r3, [r4]
	cmp	r3, r1
	moveq	r0, #0
	beq	.L1
	ldr	r2, [r4, #4]
	ldr	r3, .L27+4
	ldr	r2, [r2]
	ldr	r3, [r3]
	tst	r2, r3
	bne	.L7
.L10:
	mov	r6, #0
	mov	r1, r5
	add	r0, sp, #8
	str	r6, [sp, #8]
	bl	av_buffer_realloc
	ldr	r3, [sp, #8]
	cmp	r3, r6
	beq	.L22
	mov	r0, r5
	ldr	r1, [r4]
	ldr	r8, [r3, #8]
	ldr	r5, [r4, #8]
	bl	FFMIN
	mov	r1, r5
	mov	r2, r0
	mov	r0, r8
	bl	memcpy
	mov	r0, r7
	add	r1, sp, #8
	bl	buffer_replace
	mov	r0, r6
.L1:
	ldr	r3, .L27
	ldr	r2, [r3]
	ldr	r3, [sp, #12]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L25
	add	sp, sp, #16
	@ sp needed
	pop	{r4, r5, r6, r7, r8, pc}
.L7:
	mov	r0, r4
	bl	av_buffer_is_writable
	cmp	r0, #0
	beq	.L10
	ldr	r3, [r4, #4]
	ldr	r0, [r4, #8]
	ldr	r3, [r3, #8]
	cmp	r0, r3
	bne	.L10
	mov	r1, r5
	bl	av_realloc
	subs	r3, r0, #0
	beq	.L22
	ldr	r2, [r4, #4]
	str	r3, [r4, #8]
	mov	r0, #0
	str	r3, [r2, #8]
	str	r5, [r4]
	str	r5, [r2, #4]
	b	.L1
.L22:
	ldr	r3, .L27+8
	ldr	r0, [r3]
	bl	AVERROR
	b	.L1
.L24:
	mov	r0, r4
	bl	av_realloc
	cmp	r0, #0
	str	r0, [sp, #8]
	beq	.L22
	ldr	r3, .L27+12
	str	r4, [sp]
	ldr	r2, [r3]
	mov	r1, r5
	mov	r3, r4
	bl	av_buffer_create
	subs	r3, r0, #0
	beq	.L26
	ldr	r1, [r3, #4]
	ldr	r0, .L27+4
	ldr	r2, [r1]
	ldr	ip, [r0]
	mov	r0, r4
	orr	r2, r2, ip
	str	r2, [r1]
	str	r3, [r7]
	b	.L1
.L26:
	add	r0, sp, #8
	bl	av_freep
	ldr	r3, .L27+8
	ldr	r0, [r3]
	bl	AVERROR
	b	.L1
.L25:
	bl	__stack_chk_fail
.L28:
	.align	2
.L27:
	.word	.LC0
	.word	BUFFER_FLAG_REALLOCATABLE
	.word	ENOMEM
	.word	av_buffer_default_free
	.size	av_buffer_realloc, .-av_buffer_realloc
	.comm	av_buffer_default_free,4,4
	.comm	ENOMEM,4,4
	.comm	BUFFER_FLAG_REALLOCATABLE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
