	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function encode_audio
_encode_audio:                          ## @encode_audio
	.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	%edx, %r15d
	movq	%rsi, %r14
	movq	%rdi, %r12
	movl	$0, -44(%rbp)
	movq	%rsi, %rdi
	callq	_av_init_packet
	movl	56(%r12), %eax
	movl	%eax, 32(%r14)
	movq	48(%r12), %rax
	movq	%rax, 24(%r14)
	xorl	%r13d, %r13d
	xorl	%eax, %eax
	callq	_av_frame_alloc
	movq	%rax, -56(%rbp)
	testq	%rax, %rax
	je	LBB0_16
## %bb.1:
	movq	%rax, %rbx
	movl	40(%r12), %eax
	movl	%eax, 12(%rbx)
	movq	8(%r12), %rax
	movl	4(%rax), %ecx
	movl	%ecx, 8(%rbx)
	movl	12(%rax), %eax
	movl	%eax, 4(%rbx)
	movl	44(%r12), %eax
	movl	%eax, (%rbx)
	movq	%r12, %rdi
	callq	_planarize_audio
	movq	8(%r12), %rax
	movl	4(%rax), %ecx
	movl	8(%rax), %esi
	movl	40(%r12), %edx
	xorl	%edi, %edi
	xorl	%r8d, %r8d
	callq	_av_samples_get_buffer_size
	movq	8(%r12), %rcx
	movl	4(%rcx), %edx
	movl	8(%rcx), %esi
	cmpq	$0, 32(%r12)
	je	LBB0_3
## %bb.2:
	movq	24(%r12), %rcx
	jmp	LBB0_4
LBB0_3:
	movq	16(%r12), %rcx
LBB0_4:
	xorl	%r13d, %r13d
	movq	%rbx, %rdi
	movl	%eax, %r8d
	xorl	%r9d, %r9d
	callq	_avcodec_fill_audio_frame
	movq	8(%r12), %rdi
	testl	%r15d, %r15d
	jne	LBB0_6
## %bb.5:
	movq	-56(%rbp), %r13
LBB0_6:
	leaq	-44(%rbp), %rcx
	movq	%r14, %rsi
	movq	%r13, %rdx
	callq	_avcodec_encode_audio2
	testq	%rax, %rax
	js	LBB0_7
## %bb.8:
	cmpl	$0, -44(%rbp)
	je	LBB0_9
## %bb.10:
	movq	(%r14), %rdi
	movq	_AV_NOPTS_VALUE@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rax
	cmpq	%rax, %rdi
	je	LBB0_12
## %bb.11:
	movq	(%r12), %rax
	movq	8(%r12), %rcx
	movl	(%rcx), %esi
	movl	4(%rax), %edx
	callq	_av_rescale_q
	movq	%rax, (%r14)
	movq	(%rbx), %rax
LBB0_12:
	movq	8(%r14), %rdi
	cmpq	%rax, %rdi
	je	LBB0_14
## %bb.13:
	movq	(%r12), %rax
	movq	8(%r12), %rcx
	movl	(%rcx), %esi
	movl	4(%rax), %edx
	callq	_av_rescale_q
	movq	%rax, 8(%r14)
LBB0_14:
	leaq	-56(%rbp), %rdi
	callq	_av_frame_free
	movq	(%r12), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%r14)
	jmp	LBB0_15
LBB0_7:
	leaq	-56(%rbp), %rdi
	callq	_av_frame_free
	xorl	%r13d, %r13d
	jmp	LBB0_16
LBB0_9:
	movq	$0, 24(%r14)
	movq	_AV_NOPTS_VALUE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%r14)
	movq	%rax, 8(%r14)
	leaq	-56(%rbp), %rdi
	callq	_av_frame_free
LBB0_15:
	movl	$1, %r13d
LBB0_16:
	movl	%r13d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AV_NOPTS_VALUE,8,3             ## @AV_NOPTS_VALUE
	.no_dead_strip	_encode_audio
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function encode_audio
_encode_audio:                          ; @encode_audio
	.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	x21, x2
	mov	x19, x1
	mov	x20, x0
	str	wzr, [sp, #4]
	mov	x0, x1
	bl	_av_init_packet
	ldr	w8, [x20, #56]
	str	w8, [x19, #32]
	ldr	x8, [x20, #48]
	str	x8, [x19, #24]
	bl	_av_frame_alloc
	str	x0, [sp, #8]
	cbz	x0, LBB0_14
; %bb.1:
	mov	x22, x0
	ldr	x8, [x20, #8]
	ldr	w9, [x8, #4]
	ldp	w10, w11, [x20, #40]
	stp	w9, w10, [x0, #8]
	ldr	w8, [x8, #12]
	stp	w11, w8, [x0]
	mov	x0, x20
	bl	_planarize_audio
	ldr	x8, [x20, #8]
	ldr	w2, [x20, #40]
	ldp	w3, w1, [x8, #4]
	mov	x0, #0
	mov	w4, #0
	bl	_av_samples_get_buffer_size
	mov	x4, x0
	ldr	x8, [x20, #8]
	ldp	w2, w1, [x8, #4]
	ldr	x8, [x20, #32]
	cbz	x8, LBB0_3
; %bb.2:
	ldr	x3, [x20, #24]
	b	LBB0_4
LBB0_3:
	ldr	x3, [x20, #16]
LBB0_4:
	mov	x0, x22
	mov	w5, #0
	bl	_avcodec_fill_audio_frame
	ldr	x0, [x20, #8]
	ldr	x8, [sp, #8]
	cmp	w21, #0
	csel	x2, x8, xzr, eq
	add	x3, sp, #4
	mov	x1, x19
	bl	_avcodec_encode_audio2
	tbnz	x0, #63, LBB0_11
; %bb.5:
	ldr	w8, [sp, #4]
	cbz	w8, LBB0_12
; %bb.6:
	ldr	x0, [x19]
Lloh0:
	adrp	x21, _AV_NOPTS_VALUE@GOTPAGE
Lloh1:
	ldr	x21, [x21, _AV_NOPTS_VALUE@GOTPAGEOFF]
	ldr	x8, [x21]
	cmp	x0, x8
	b.eq	LBB0_8
; %bb.7:
	ldp	x9, x8, [x20]
	ldr	w1, [x8]
	ldr	w2, [x9, #4]
	bl	_av_rescale_q
	str	x0, [x19]
	ldr	x8, [x21]
LBB0_8:
	ldr	x0, [x19, #8]
	cmp	x0, x8
	b.eq	LBB0_10
; %bb.9:
	ldp	x9, x8, [x20]
	ldr	w1, [x8]
	ldr	w2, [x9, #4]
	bl	_av_rescale_q
	str	x0, [x19, #8]
LBB0_10:
	add	x0, sp, #8
	bl	_av_frame_free
	ldr	x8, [x20]
	ldr	w8, [x8]
	str	w8, [x19, #16]
	b	LBB0_13
LBB0_11:
	add	x0, sp, #8
	bl	_av_frame_free
	mov	w0, #0
	b	LBB0_14
LBB0_12:
	str	xzr, [x19, #24]
Lloh2:
	adrp	x8, _AV_NOPTS_VALUE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _AV_NOPTS_VALUE@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	stp	x8, x8, [x19]
	add	x0, sp, #8
	bl	_av_frame_free
LBB0_13:
	mov	w0, #1
LBB0_14:
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_AV_NOPTS_VALUE,8,3             ; @AV_NOPTS_VALUE
	.no_dead_strip	_encode_audio
.subsections_via_symbols
