	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function load_encode_and_write
_load_encode_and_write:                 ## @load_encode_and_write
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r12
	movq	%rsi, %r14
	movq	%rdi, %r15
	callq	_av_audio_fifo_size
	movl	(%r12), %esi
	movl	%eax, %edi
	callq	_FFMIN
	movl	%eax, %ebx
	leaq	-40(%rbp), %rdi
	movq	%r12, %rsi
	movl	%eax, %edx
	callq	_init_output_frame
	testq	%rax, %rax
	jne	LBB0_4
## %bb.1:
	movq	-40(%rbp), %rax
	movq	(%rax), %rsi
	movq	%r15, %rdi
	movl	%ebx, %edx
	callq	_av_audio_fifo_read
	cmpl	%ebx, %eax
	jge	LBB0_3
## %bb.2:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_fprintf
	leaq	-40(%rbp), %rdi
	callq	_av_frame_free
	jmp	LBB0_4
LBB0_3:
	movq	-40(%rbp), %rdi
	leaq	-44(%rbp), %rcx
	movq	%r14, %rsi
	movq	%r12, %rdx
	callq	_encode_audio_frame
	movq	%rax, %rbx
	leaq	-40(%rbp), %rdi
	callq	_av_frame_free
	xorl	%eax, %eax
	testq	%rbx, %rbx
	je	LBB0_5
LBB0_4:
	movq	_AVERROR_EXIT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_5:
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AVERROR_EXIT,4,2               ## @AVERROR_EXIT
	.comm	_stderr,4,2                     ## @stderr
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Could not read data from FIFO\n"

	.no_dead_strip	_load_encode_and_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function load_encode_and_write
_load_encode_and_write:                 ; @load_encode_and_write
	.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, x2
	mov	x20, x1
	mov	x21, x0
	bl	_av_audio_fifo_size
	ldr	w1, [x19]
	bl	_FFMIN
	mov	x22, x0
	add	x0, sp, #8
	mov	x1, x19
	mov	x2, x22
	bl	_init_output_frame
	cbnz	x0, LBB0_3
; %bb.1:
	ldr	x8, [sp, #8]
	ldr	x1, [x8]
	mov	x0, x21
	mov	x2, x22
	bl	_av_audio_fifo_read
	cmp	w0, w22
	b.ge	LBB0_4
; %bb.2:
Lloh0:
	adrp	x8, _stderr@GOTPAGE
Lloh1:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	bl	_fprintf
	add	x0, sp, #8
	bl	_av_frame_free
LBB0_3:
Lloh5:
	adrp	x8, _AVERROR_EXIT@GOTPAGE
Lloh6:
	ldr	x8, [x8, _AVERROR_EXIT@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	b	LBB0_5
LBB0_4:
	ldr	x0, [sp, #8]
	add	x3, sp, #4
	mov	x1, x20
	mov	x2, x19
	bl	_encode_audio_frame
	mov	x19, x0
	add	x0, sp, #8
	bl	_av_frame_free
Lloh8:
	adrp	x8, _AVERROR_EXIT@GOTPAGE
Lloh9:
	ldr	x8, [x8, _AVERROR_EXIT@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	cmp	x19, #0
	csel	w0, wzr, w8, eq
LBB0_5:
	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 AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_AVERROR_EXIT,4,2               ; @AVERROR_EXIT
	.comm	_stderr,4,2                     ; @stderr
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Could not read data from FIFO\n"

	.no_dead_strip	_load_encode_and_write
.subsections_via_symbols
