	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function libshine_encode_frame
_libshine_encode_frame:                 ## @libshine_encode_frame
	.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
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	movq	%rdx, %r13
	movq	%rsi, %r15
	movq	%rdi, %r12
	movq	8(%rdi), %r14
	movl	20(%r14), %edi
	testq	%rdx, %rdx
	je	LBB0_2
## %bb.1:
	movq	(%r13), %rsi
	leaq	-44(%rbp), %rdx
	callq	_shine_encode_buffer
	jmp	LBB0_3
LBB0_2:
	leaq	-44(%rbp), %rsi
	callq	_shine_flush
LBB0_3:
	movl	-44(%rbp), %edx
	movl	$-1, %ebx
	testl	%edx, %edx
	js	LBB0_18
## %bb.4:
	je	LBB0_8
## %bb.5:
	movslq	(%r14), %rdi
	leal	(%rdi,%rdx), %ecx
	movq	_BUFFER_SIZE@GOTPCREL(%rip), %rsi
	cmpl	(%rsi), %ecx
	jle	LBB0_7
## %bb.6:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	%r12, %rdi
	callq	_av_log
	movq	_AVERROR_BUG@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_18
LBB0_7:
	addq	8(%r14), %rdi
	movq	%rax, %rsi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_memcpy
	movl	-44(%rbp), %eax
	addl	%eax, (%r14)
LBB0_8:
	testq	%r13, %r13
	je	LBB0_11
## %bb.9:
	leaq	16(%r14), %rdi
	movq	%r13, %rsi
	callq	_ff_af_queue_add
	testl	%eax, %eax
	js	LBB0_10
LBB0_11:
	xorl	%ebx, %ebx
	cmpl	$4, (%r14)
	jl	LBB0_18
## %bb.12:
	cmpl	$0, 16(%r14)
	je	LBB0_18
## %bb.13:
	movq	8(%r14), %rdi
	callq	_AV_RB32
	leaq	-48(%rbp), %rdi
	movl	%eax, %esi
	callq	_avpriv_mpegaudio_decode_header
	testq	%rax, %rax
	je	LBB0_15
## %bb.14:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdx
	movq	%r12, %rdi
	callq	_av_log
	movl	$-1, %ebx
	jmp	LBB0_18
LBB0_10:
	movl	%eax, %ebx
LBB0_18:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_15:
	movl	-48(%rbp), %r13d
	cmpl	(%r14), %r13d
	jg	LBB0_18
## %bb.16:
	movq	%r12, %rdi
	movq	%r15, %rsi
	movl	%r13d, %edx
	xorl	%ecx, %ecx
	callq	_ff_alloc_packet2
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_18
## %bb.17:
	leaq	16(%r14), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movslq	%r13d, %rbx
	movq	(%r15), %rdi
	movq	8(%r14), %rsi
	movl	%r13d, %edx
	callq	_memcpy
	movl	(%r14), %edx
	subl	%r13d, %edx
	movl	%edx, (%r14)
	movq	8(%r14), %rdi
	addq	%rdi, %rbx
	movq	%rbx, %rsi
	callq	_memmove
	movl	(%r12), %esi
	leaq	16(%r15), %rdx
	leaq	12(%r15), %rcx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_ff_af_queue_remove
	movl	%r13d, 8(%r15)
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movl	$1, (%rax)
	xorl	%ebx, %ebx
	jmp	LBB0_18
	.cfi_endproc
                                        ## -- End function
	.comm	_BUFFER_SIZE,4,2                ## @BUFFER_SIZE
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"internal buffer too small\n"

	.comm	_AVERROR_BUG,4,2                ## @AVERROR_BUG
L_.str.1:                               ## @.str.1
	.asciz	"free format output not supported\n"

	.no_dead_strip	_libshine_encode_frame
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function libshine_encode_frame
_libshine_encode_frame:                 ; @libshine_encode_frame
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x3
	mov	x22, x2
	mov	x20, x1
	mov	x21, x0
	ldr	x24, [x0, #8]
	ldr	w0, [x24, #20]
	cbz	x2, LBB0_2
; %bb.1:
	ldr	x1, [x22]
	add	x2, sp, #4
	bl	_shine_encode_buffer
	b	LBB0_3
LBB0_2:
	add	x1, sp, #4
	bl	_shine_flush
LBB0_3:
	mov	x1, x0
	ldr	w2, [sp, #4]
	tbnz	w2, #31, LBB0_7
; %bb.4:
	cbz	w2, LBB0_9
; %bb.5:
	ldrsw	x8, [x24]
Lloh0:
	adrp	x9, _BUFFER_SIZE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _BUFFER_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	add	w10, w8, w2
	cmp	w10, w9
	b.le	LBB0_8
; %bb.6:
Lloh3:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh4:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
Lloh6:
	adrp	x2, l_.str@PAGE
Lloh7:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x21
	bl	_av_log
Lloh8:
	adrp	x8, _AVERROR_BUG@GOTPAGE
Lloh9:
	ldr	x8, [x8, _AVERROR_BUG@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
	b	LBB0_17
LBB0_7:
	mov	w0, #-1
	b	LBB0_17
LBB0_8:
	ldr	x9, [x24, #8]
	add	x0, x9, x8
	bl	_memcpy
	ldr	w8, [sp, #4]
	ldr	w9, [x24]
	add	w8, w9, w8
	str	w8, [x24]
LBB0_9:
	cbz	x22, LBB0_11
; %bb.10:
	add	x0, x24, #16
	mov	x1, x22
	bl	_ff_af_queue_add
	tbnz	w0, #31, LBB0_17
LBB0_11:
	ldr	w8, [x24]
	cmp	w8, #4
	b.lt	LBB0_16
; %bb.12:
	mov	x22, x24
	ldr	w8, [x22, #16]!
	cbz	w8, LBB0_16
; %bb.13:
	ldr	x0, [x24, #8]
	bl	_AV_RB32
	mov	x1, x0
	add	x0, sp, #8
	bl	_avpriv_mpegaudio_decode_header
	cbz	x0, LBB0_15
; %bb.14:
Lloh11:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh12:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
Lloh14:
	adrp	x2, l_.str.1@PAGE
Lloh15:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x21
	bl	_av_log
	mov	w0, #-1
	b	LBB0_17
LBB0_15:
	ldr	w23, [sp, #8]
	ldr	w8, [x24]
	cmp	w23, w8
	b.le	LBB0_18
LBB0_16:
	mov	w0, #0
LBB0_17:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_18:
	mov	x0, x21
	mov	x1, x20
	mov	x2, x23
	mov	w3, #0
	bl	_ff_alloc_packet2
	cbnz	w0, LBB0_17
; %bb.19:
	sxtw	x25, w23
	ldr	x0, [x20]
	ldr	x1, [x24, #8]
	mov	x2, x23
	bl	_memcpy
	ldr	w8, [x24]
	sub	w2, w8, w23
	str	w2, [x24]
	ldr	x0, [x24, #8]
	add	x1, x0, x25
	bl	_memmove
	ldr	w1, [x21]
	add	x2, x20, #16
	add	x3, x20, #12
	mov	x0, x22
	bl	_ff_af_queue_remove
	mov	w0, #0
	str	w23, [x20, #8]
	mov	w8, #1
	str	w8, [x19]
	b	LBB0_17
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_BUFFER_SIZE,4,2                ; @BUFFER_SIZE
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"internal buffer too small\n"

	.comm	_AVERROR_BUG,4,2                ; @AVERROR_BUG
l_.str.1:                               ; @.str.1
	.asciz	"free format output not supported\n"

	.no_dead_strip	_libshine_encode_frame
.subsections_via_symbols
