	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function load_textfile
_load_textfile:                         ## @load_textfile
	.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	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	(%rdi), %r15
	movl	8(%r15), %edi
	leaq	-40(%rbp), %rsi
	leaq	-32(%rbp), %rdx
	xorl	%ecx, %ecx
	movq	%r14, %r8
	callq	_av_file_map
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	movq	-32(%rbp), %rsi
	movq	_SIZE_MAX@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	decq	%rax
	cmpq	%rax, %rsi
	ja	LBB0_5
## %bb.3:
	movq	(%r15), %rdi
	incq	%rsi
	callq	_av_realloc
	testq	%rax, %rax
	je	LBB0_4
## %bb.6:
	movq	%rax, (%r15)
	movq	-40(%rbp), %rsi
	movq	-32(%rbp), %rdx
	movq	%rax, %rdi
	callq	_memcpy
	movq	(%r15), %rax
	movq	-32(%rbp), %rcx
	movq	$0, (%rax,%rcx,8)
	movq	-40(%rbp), %rdi
	movq	-32(%rbp), %rsi
	callq	_av_file_unmap
	xorl	%ebx, %ebx
	jmp	LBB0_7
LBB0_1:
	movl	%eax, %ebx
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	8(%r15), %ecx
	leaq	L_.str(%rip), %rdx
	movq	%r14, %rdi
	callq	_av_log
	jmp	LBB0_7
LBB0_4:
	movq	-32(%rbp), %rsi
LBB0_5:
	movq	-40(%rbp), %rdi
	callq	_av_file_unmap
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_AVERROR
	movl	%eax, %ebx
LBB0_7:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"The text file '%s' could not be read or is empty\n"

	.comm	_SIZE_MAX,4,2                   ## @SIZE_MAX
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_load_textfile
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function load_textfile
_load_textfile:                         ; @load_textfile
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x19, x0
	ldr	x21, [x0]
	ldr	w0, [x21, #8]
	add	x1, sp, #8
	mov	x2, sp
	mov	w3, #0
	mov	x4, x19
	bl	_av_file_map
	tbnz	w0, #31, LBB0_4
; %bb.1:
	ldr	x1, [sp]
Lloh0:
	adrp	x8, _SIZE_MAX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SIZE_MAX@GOTPAGEOFF]
Lloh2:
	ldrsw	x8, [x8]
	sub	x8, x8, #1
	cmp	x1, x8
	b.hi	LBB0_6
; %bb.2:
	ldr	x0, [x21]
	add	x1, x1, #1
	bl	_av_realloc
	cbz	x0, LBB0_5
; %bb.3:
	str	x0, [x21]
	ldp	x2, x1, [sp]
	bl	_memcpy
	ldr	x8, [x21]
	ldr	x9, [sp]
	str	xzr, [x8, x9, lsl #3]
	ldp	x1, x0, [sp]
	bl	_av_file_unmap
	mov	w20, #0
	b	LBB0_7
LBB0_4:
	mov	x20, x0
Lloh3:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh4:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	ldr	w3, [x21, #8]
Lloh6:
	adrp	x2, l_.str@PAGE
Lloh7:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x19
	bl	_av_log
	b	LBB0_7
LBB0_5:
	ldr	x1, [sp]
LBB0_6:
	ldr	x0, [sp, #8]
	bl	_av_file_unmap
Lloh8:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
	bl	_AVERROR
	mov	x20, x0
LBB0_7:
	mov	x0, x20
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"The text file '%s' could not be read or is empty\n"

	.comm	_SIZE_MAX,4,2                   ; @SIZE_MAX
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_load_textfile
.subsections_via_symbols
