	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ffio_realloc_buf               ## -- Begin function ffio_realloc_buf
	.p2align	4, 0x90
_ffio_realloc_buf:                      ## @ffio_realloc_buf
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movq	%rdi, %rbx
	movl	(%rdi), %eax
	testl	%eax, %eax
	je	LBB0_10
## %bb.1:
	cmpl	%r14d, %eax
	jge	LBB0_9
## %bb.2:
	movl	%r14d, %edi
	callq	_av_malloc
	testq	%rax, %rax
	je	LBB0_11
## %bb.3:
	movq	%rax, %r15
	movq	24(%rbx), %rax
	leaq	8(%rbx), %rcx
	leaq	32(%rbx), %rdx
	xorl	%esi, %esi
	testq	%rax, %rax
	setne	%sil
	cmoveq	%rdx, %rcx
	movq	(%rcx), %r12
	subq	8(%rbx,%rsi,8), %r12
	shrq	$2, %r12
	testl	%r12d, %r12d
	jle	LBB0_5
## %bb.4:
	xorl	%ecx, %ecx
	testq	%rax, %rax
	setne	%cl
	movq	8(%rbx,%rcx,8), %rsi
	movq	%r15, %rdi
	movl	%r12d, %edx
	callq	_memcpy
LBB0_5:
	movq	16(%rbx), %rdi
	callq	_av_free
	movq	%r15, 16(%rbx)
	movl	%r14d, 4(%rbx)
	movl	%r14d, (%rbx)
	cmpq	$0, 24(%rbx)
	movslq	%r12d, %rax
	je	LBB0_6
## %bb.7:
	leaq	(%r15,%rax,4), %rcx
	movq	%rcx, 40(%rbx)
	movslq	%r14d, %rax
	jmp	LBB0_8
LBB0_10:
	movq	%rbx, %rdi
	movl	%r14d, %esi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ffio_set_buf_size              ## TAILCALL
LBB0_11:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_AVERROR                        ## TAILCALL
LBB0_6:
	movq	%r15, %rcx
LBB0_8:
	movq	%rcx, 8(%rbx)
	leaq	(%r15,%rax,4), %rax
	movq	%rax, 32(%rbx)
LBB0_9:
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ffio_realloc_buf               ; -- Begin function ffio_realloc_buf
	.p2align	2
_ffio_realloc_buf:                      ; @ffio_realloc_buf
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x20, x1
	mov	x19, x0
	ldr	w8, [x0]
	cbz	w8, LBB0_7
; %bb.1:
	cmp	w8, w20
	b.ge	LBB0_11
; %bb.2:
	mov	x0, x20
	bl	_av_malloc
	cbz	x0, LBB0_8
; %bb.3:
	mov	x21, x0
	ldr	x8, [x19, #24]
	mov	w9, #16
	mov	w10, #8
	cmp	x8, #0
	csel	x9, x10, x9, eq
	mov	w11, #32
	csel	x10, x11, x10, eq
	ldr	x10, [x19, x10]
	ldr	x9, [x19, x9]
	sub	x22, x10, x9
	lsr	x2, x22, #2
	cmp	w2, #1
	b.lt	LBB0_5
; %bb.4:
	mov	w9, #16
	mov	w10, #8
	cmp	x8, #0
	csel	x8, x10, x9, eq
	ldr	x1, [x19, x8]
	mov	x0, x21
                                        ; kill: def $w2 killed $w2 killed $x2
	bl	_memcpy
LBB0_5:
	ldr	x0, [x19, #16]
	bl	_av_free
	str	x21, [x19, #16]
	stp	w20, w20, [x19]
	sbfx	x8, x22, #2, #32
	ldr	x9, [x19, #24]
	cbz	x9, LBB0_9
; %bb.6:
	add	x9, x21, x8, lsl #2
	str	x9, [x19, #40]
	sxtw	x8, w20
	b	LBB0_10
LBB0_7:
	mov	x0, x19
	mov	x1, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_ffio_set_buf_size
LBB0_8:
Lloh0:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_AVERROR
LBB0_9:
	mov	x9, x21
LBB0_10:
	str	x9, [x19, #8]
	add	x8, x21, x8, lsl #2
	str	x8, [x19, #32]
LBB0_11:
	mov	w0, #0
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
.subsections_via_symbols
