	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wavpack_encode_frame
_wavpack_encode_frame:                  ## @wavpack_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r14
	movq	%rsi, %r12
	movq	%rdi, %r15
	movq	8(%rdi), %rbx
	movq	$0, 8(%rbx)
	movq	%rsi, 24(%rbx)
	movl	8(%rsi), %eax
	movl	%eax, 20(%rbx)
	testq	%rdx, %rdx
	je	LBB0_7
## %bb.1:
	movq	%rdx, %r13
	movq	%rbx, %rdi
	movq	%rdx, %rsi
	callq	_ff_af_queue_add
	testl	%eax, %eax
	js	LBB0_12
## %bb.2:
	movl	16(%rbx), %edi
	movq	(%r13), %rdx
	movq	8(%r13), %rax
	movq	(%rax), %rsi
	callq	_WavpackPackSamples
	testl	%eax, %eax
	je	LBB0_3
## %bb.5:
	cmpq	$0, 8(%rbx)
	jne	LBB0_10
## %bb.6:
	movq	(%r13), %rcx
	xorl	%eax, %eax
	cmpq	(%r15), %rcx
	jge	LBB0_12
LBB0_7:
	movl	16(%rbx), %edi
	callq	_WavpackFlushSamples
	testl	%eax, %eax
	je	LBB0_8
## %bb.9:
	cmpq	$0, 8(%rbx)
	je	LBB0_11
LBB0_10:
	movq	(%r15), %rsi
	leaq	4(%r12), %rdx
	movq	%rbx, %rdi
	movq	%r12, %rcx
	callq	_ff_af_queue_remove
	movl	$1, (%r14)
LBB0_11:
	xorl	%eax, %eax
	jmp	LBB0_12
LBB0_8:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movl	16(%rbx), %edi
	callq	_WavpackGetErrorMessage
	leaq	L_.str.1(%rip), %rdx
	jmp	LBB0_4
LBB0_3:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movl	16(%rbx), %edi
	callq	_WavpackGetErrorMessage
	leaq	L_.str(%rip), %rdx
LBB0_4:
	movq	%r15, %rdi
	movl	%r14d, %esi
	movl	%eax, %ecx
	callq	_av_log
	movq	_AVERROR_UNKNOWN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_12:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	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	"Error encoding a frame: %s\n"

	.comm	_AVERROR_UNKNOWN,4,2            ## @AVERROR_UNKNOWN
L_.str.1:                               ## @.str.1
	.asciz	"Error flushing the encoder: %s\n"

	.no_dead_strip	_wavpack_encode_frame
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wavpack_encode_frame
_wavpack_encode_frame:                  ; @wavpack_encode_frame
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x20, x3
	mov	x22, x1
	mov	x19, x0
	ldr	x21, [x0, #8]
	str	xzr, [x21, #8]
	str	x1, [x21, #24]
	ldr	w8, [x1, #8]
	str	w8, [x21, #20]
	cbz	x2, LBB0_5
; %bb.1:
	mov	x23, x2
	mov	x0, x21
	mov	x1, x2
	bl	_ff_af_queue_add
	tbnz	w0, #31, LBB0_12
; %bb.2:
	ldr	w0, [x21, #16]
	ldp	x2, x8, [x23]
	ldr	x1, [x8]
	bl	_WavpackPackSamples
	cbz	w0, LBB0_9
; %bb.3:
	ldr	x8, [x21, #8]
	cbnz	x8, LBB0_7
; %bb.4:
	ldr	x8, [x23]
	ldr	x9, [x19]
	cmp	x8, x9
	b.ge	LBB0_11
LBB0_5:
	ldr	w0, [x21, #16]
	bl	_WavpackFlushSamples
	cbz	w0, LBB0_8
; %bb.6:
	ldr	x8, [x21, #8]
	cbz	x8, LBB0_11
LBB0_7:
	ldr	x1, [x19]
	add	x2, x22, #4
	mov	x0, x21
	mov	x3, x22
	bl	_ff_af_queue_remove
	mov	w0, #0
	mov	w8, #1
	str	w8, [x20]
	b	LBB0_12
LBB0_8:
Lloh0:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh2:
	ldr	w20, [x8]
	ldr	w0, [x21, #16]
	bl	_WavpackGetErrorMessage
	mov	x3, x0
Lloh3:
	adrp	x2, l_.str.1@PAGE
Lloh4:
	add	x2, x2, l_.str.1@PAGEOFF
	b	LBB0_10
LBB0_9:
Lloh5:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh6:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh7:
	ldr	w20, [x8]
	ldr	w0, [x21, #16]
	bl	_WavpackGetErrorMessage
	mov	x3, x0
Lloh8:
	adrp	x2, l_.str@PAGE
Lloh9:
	add	x2, x2, l_.str@PAGEOFF
LBB0_10:
	mov	x0, x19
	mov	x1, x20
	bl	_av_log
Lloh10:
	adrp	x8, _AVERROR_UNKNOWN@GOTPAGE
Lloh11:
	ldr	x8, [x8, _AVERROR_UNKNOWN@GOTPAGEOFF]
Lloh12:
	ldr	w0, [x8]
	b	LBB0_12
LBB0_11:
	mov	w0, #0
LBB0_12:
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Error encoding a frame: %s\n"

	.comm	_AVERROR_UNKNOWN,4,2            ; @AVERROR_UNKNOWN
l_.str.1:                               ; @.str.1
	.asciz	"Error flushing the encoder: %s\n"

	.no_dead_strip	_wavpack_encode_frame
.subsections_via_symbols
