	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wv_write_packet
_wv_write_packet:                       ## @wv_write_packet
	.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
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	(%rsi), %rax
	movq	_WV_HEADER_SIZE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jl	LBB0_2
## %bb.1:
	movq	%rsi, %rbx
	movq	8(%r14), %r15
	movl	8(%rsi), %esi
	leaq	-32(%rbp), %rdi
	callq	_ff_wv_parse_header
	testl	%eax, %eax
	js	LBB0_2
## %bb.3:
	movl	-32(%rbp), %eax
	addl	%eax, (%r15)
	movl	(%r14), %edi
	movl	8(%rbx), %esi
	movq	(%rbx), %rdx
	callq	_avio_write
	xorl	%eax, %eax
	jmp	LBB0_4
LBB0_2:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	%r14, %rdi
	callq	_av_log
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_AVERROR
LBB0_4:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_WV_HEADER_SIZE,8,3             ## @WV_HEADER_SIZE
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Invalid WavPack packet.\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_wv_write_packet
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wv_write_packet
_wv_write_packet:                       ; @wv_write_packet
	.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	x8, [x1]
Lloh0:
	adrp	x9, _WV_HEADER_SIZE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _WV_HEADER_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.lt	LBB0_3
; %bb.1:
	mov	x20, x1
	ldr	x21, [x19, #8]
	ldr	w1, [x1, #8]
	add	x0, sp, #8
	bl	_ff_wv_parse_header
	tbnz	w0, #31, LBB0_3
; %bb.2:
	ldr	w8, [sp, #8]
	ldr	w9, [x21]
	add	w8, w9, w8
	str	w8, [x21]
	ldr	w0, [x19]
	ldr	w1, [x20, #8]
	ldr	x2, [x20]
	bl	_avio_write
	mov	w0, #0
	b	LBB0_4
LBB0_3:
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, x19
	bl	_av_log
Lloh8:
	adrp	x8, _EINVAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
	bl	_AVERROR
LBB0_4:
	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 AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_WV_HEADER_SIZE,8,3             ; @WV_HEADER_SIZE
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Invalid WavPack packet.\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_wv_write_packet
.subsections_via_symbols
