	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_av_buffer_realloc              ## -- Begin function av_buffer_realloc
	.p2align	4, 0x90
_av_buffer_realloc:                     ## @av_buffer_realloc
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r12d
	movq	%rdi, %r15
	movq	(%rdi), %rbx
	testq	%rbx, %rbx
	je	LBB0_1
## %bb.6:
	xorl	%r14d, %r14d
	cmpl	%r12d, (%rbx)
	je	LBB0_14
## %bb.7:
	movq	8(%rbx), %rax
	movq	_BUFFER_FLAG_REALLOCATABLE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%rax)
	je	LBB0_10
## %bb.8:
	movq	%rbx, %rdi
	callq	_av_buffer_is_writable
	testl	%eax, %eax
	je	LBB0_10
## %bb.9:
	movq	8(%rbx), %rax
	movq	16(%rbx), %rdi
	cmpq	8(%rax), %rdi
	je	LBB0_12
LBB0_10:
	movq	$0, -48(%rbp)
	leaq	-48(%rbp), %rdi
	movl	%r12d, %esi
	callq	_av_buffer_realloc
	movq	-48(%rbp), %rax
	testq	%rax, %rax
	je	LBB0_2
## %bb.11:
	movq	16(%rax), %r13
	movq	16(%rbx), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movl	(%rbx), %esi
	movl	%r12d, %edi
	callq	_FFMIN
	movq	%r13, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movl	%eax, %edx
	callq	_memcpy
	leaq	-48(%rbp), %rsi
	movq	%r15, %rdi
	callq	_buffer_replace
	jmp	LBB0_14
LBB0_1:
	xorl	%edi, %edi
	movl	%r12d, %esi
	callq	_av_realloc
	movq	%rax, -48(%rbp)
	testq	%rax, %rax
	je	LBB0_2
## %bb.3:
	movq	_av_buffer_default_free@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	xorl	%r14d, %r14d
	movq	%rax, %rdi
	movl	%r12d, %esi
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_av_buffer_create
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	movq	_BUFFER_FLAG_REALLOCATABLE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	8(%rax), %rdx
	orl	%ecx, (%rdx)
	movq	%rax, (%r15)
	jmp	LBB0_14
LBB0_4:
	leaq	-48(%rbp), %rdi
	callq	_av_freep
LBB0_2:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_AVERROR
	movl	%eax, %r14d
LBB0_14:
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	movl	%r12d, %esi
	callq	_av_realloc
	testq	%rax, %rax
	je	LBB0_15
## %bb.13:
	movq	%rax, 16(%rbx)
	movq	8(%rbx), %rcx
	movq	%rax, 8(%rcx)
	movl	%r12d, (%rbx)
	movl	%r12d, 4(%rcx)
	jmp	LBB0_14
LBB0_15:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_AVERROR                        ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_av_buffer_default_free,4,2     ## @av_buffer_default_free
	.comm	_BUFFER_FLAG_REALLOCATABLE,4,2  ## @BUFFER_FLAG_REALLOCATABLE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_av_buffer_realloc              ; -- Begin function av_buffer_realloc
	.p2align	2
_av_buffer_realloc:                     ; @av_buffer_realloc
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x20, x1
	mov	x19, x0
	ldr	x21, [x0]
	cbz	x21, LBB0_3
; %bb.1:
	ldr	w8, [x21]
	cmp	w8, w20
	b.ne	LBB0_6
; %bb.2:
	mov	w0, #0
	b	LBB0_13
LBB0_3:
	mov	x0, #0
	mov	x1, x20
	bl	_av_realloc
	str	x0, [sp, #8]
	cbz	x0, LBB0_12
; %bb.4:
Lloh0:
	adrp	x8, _av_buffer_default_free@GOTPAGE
Lloh1:
	ldr	x8, [x8, _av_buffer_default_free@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	mov	x1, x20
	mov	x3, #0
	mov	w4, #0
	bl	_av_buffer_create
	cbz	x0, LBB0_11
; %bb.5:
	mov	x8, x0
	mov	w0, #0
Lloh3:
	adrp	x9, _BUFFER_FLAG_REALLOCATABLE@GOTPAGE
Lloh4:
	ldr	x9, [x9, _BUFFER_FLAG_REALLOCATABLE@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	ldr	x10, [x8, #8]
	ldr	w11, [x10]
	orr	w9, w11, w9
	str	w9, [x10]
	str	x8, [x19]
	b	LBB0_13
LBB0_6:
	ldr	x8, [x21, #8]
	ldr	w8, [x8]
Lloh6:
	adrp	x9, _BUFFER_FLAG_REALLOCATABLE@GOTPAGE
Lloh7:
	ldr	x9, [x9, _BUFFER_FLAG_REALLOCATABLE@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_9
; %bb.7:
	mov	x0, x21
	bl	_av_buffer_is_writable
	cbz	w0, LBB0_9
; %bb.8:
	ldp	x8, x0, [x21, #8]
	ldr	x8, [x8, #8]
	cmp	x0, x8
	b.eq	LBB0_14
LBB0_9:
	str	xzr, [sp, #8]
	add	x0, sp, #8
	mov	x1, x20
	bl	_av_buffer_realloc
	ldr	x8, [sp, #8]
	cbz	x8, LBB0_12
; %bb.10:
	ldr	x22, [x8, #16]
	ldr	x23, [x21, #16]
	ldr	w1, [x21]
	mov	x0, x20
	bl	_FFMIN
	mov	x2, x0
	mov	x0, x22
	mov	x1, x23
	bl	_memcpy
	add	x1, sp, #8
	mov	x0, x19
	bl	_buffer_replace
	mov	w0, #0
	b	LBB0_13
LBB0_11:
	add	x0, sp, #8
	bl	_av_freep
LBB0_12:
Lloh9:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
	bl	_AVERROR
LBB0_13:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_14:
	mov	x1, x20
	bl	_av_realloc
	cbz	x0, LBB0_16
; %bb.15:
	mov	x8, x0
	mov	w0, #0
	str	x8, [x21, #16]
	ldr	x9, [x21, #8]
	str	x8, [x9, #8]
	str	w20, [x21]
	str	w20, [x9, #4]
	b	LBB0_13
LBB0_16:
Lloh12:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	b	_AVERROR
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_av_buffer_default_free,4,2     ; @av_buffer_default_free
	.comm	_BUFFER_FLAG_REALLOCATABLE,4,2  ; @BUFFER_FLAG_REALLOCATABLE
.subsections_via_symbols
