	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function caf_write_packet
_caf_write_packet:                      ## @caf_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %rbx
	movq	16(%rdi), %r12
	movl	8(%rdi), %edi
	movl	(%rsi), %edx
	movl	4(%rsi), %esi
	callq	_avio_write
	movq	(%rbx), %rax
	movq	(%rax), %rax
	movq	(%rax), %rax
	cmpl	$0, (%rax)
	je	LBB0_1
LBB0_14:
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	(%r12), %r14
	movl	8(%r12), %edx
	cmpl	$-6, %edx
	jg	LBB0_4
## %bb.2:
	movq	$0, (%r12)
	jmp	LBB0_3
LBB0_4:
	addl	$5, %edx
	leaq	16(%r12), %rsi
	movq	%r14, %rdi
	callq	_av_fast_realloc
	movq	%rax, (%r12)
	testq	%rax, %rax
	je	LBB0_3
## %bb.5:
	movl	(%r15), %ecx
	cmpl	$268435456, %ecx                ## imm = 0x10000000
	jae	LBB0_6
## %bb.7:
	cmpl	$2097152, %ecx                  ## imm = 0x200000
	jae	LBB0_8
LBB0_9:
	cmpl	$16384, %ecx                    ## imm = 0x4000
	jae	LBB0_10
LBB0_11:
	cmpl	$128, %ecx
	jb	LBB0_13
LBB0_12:
	sarl	$7, %ecx
	orl	$128, %ecx
	movslq	8(%r12), %rdx
	leal	1(%rdx), %esi
	movl	%esi, 8(%r12)
	movl	%ecx, (%rax,%rdx,4)
	movl	(%r15), %ecx
LBB0_13:
	andl	$127, %ecx
	movslq	8(%r12), %rdx
	leal	1(%rdx), %esi
	movl	%esi, 8(%r12)
	movl	%ecx, (%rax,%rdx,4)
	incl	12(%r12)
	jmp	LBB0_14
LBB0_3:
	movq	%r14, %rdi
	callq	_av_free
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_AVERROR                        ## TAILCALL
LBB0_6:
	sarl	$28, %ecx
	orl	$128, %ecx
	movslq	8(%r12), %rdx
	leal	1(%rdx), %esi
	movl	%esi, 8(%r12)
	movl	%ecx, (%rax,%rdx,4)
	movl	(%r15), %ecx
	cmpl	$2097152, %ecx                  ## imm = 0x200000
	jb	LBB0_9
LBB0_8:
	sarl	$21, %ecx
	orl	$128, %ecx
	movslq	8(%r12), %rdx
	leal	1(%rdx), %esi
	movl	%esi, 8(%r12)
	movl	%ecx, (%rax,%rdx,4)
	movl	(%r15), %ecx
	cmpl	$16384, %ecx                    ## imm = 0x4000
	jb	LBB0_11
LBB0_10:
	sarl	$14, %ecx
	orl	$128, %ecx
	movslq	8(%r12), %rdx
	leal	1(%rdx), %esi
	movl	%esi, 8(%r12)
	movl	%ecx, (%rax,%rdx,4)
	movl	(%r15), %ecx
	cmpl	$128, %ecx
	jae	LBB0_12
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_caf_write_packet
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function caf_write_packet
_caf_write_packet:                      ; @caf_write_packet
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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, x1
	mov	x20, x0
	ldr	x21, [x0, #16]
	ldr	w0, [x0, #8]
	ldr	w1, [x1, #4]
	ldr	w2, [x19]
	bl	_avio_write
	ldr	x8, [x20]
	ldr	x8, [x8]
	ldr	x8, [x8]
	ldr	w8, [x8]
	cbz	w8, LBB0_2
LBB0_1:
	mov	w0, #0
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_2:
	ldr	x20, [x21]
	ldr	w8, [x21, #8]
	cmn	w8, #6
	b.gt	LBB0_4
; %bb.3:
	str	xzr, [x21]
	b	LBB0_11
LBB0_4:
	add	w2, w8, #5
	add	x1, x21, #16
	mov	x0, x20
	bl	_av_fast_realloc
	str	x0, [x21]
	cbz	x0, LBB0_11
; %bb.5:
	ldr	w8, [x19]
	lsr	w9, w8, #28
	cbnz	w9, LBB0_12
; %bb.6:
	cmp	w8, #512, lsl #12               ; =2097152
	b.hs	LBB0_13
LBB0_7:
	cmp	w8, #4, lsl #12                 ; =16384
	b.hs	LBB0_14
LBB0_8:
	cmp	w8, #128
	b.lo	LBB0_10
LBB0_9:
	asr	w8, w8, #7
	orr	w8, w8, #0x80
	ldrsw	x9, [x21, #8]
	add	w10, w9, #1
	str	w10, [x21, #8]
	str	w8, [x0, x9, lsl #2]
	ldr	w8, [x19]
LBB0_10:
	and	w8, w8, #0x7f
	ldrsw	x9, [x21, #8]
	add	w10, w9, #1
	str	w10, [x21, #8]
	str	w8, [x0, x9, lsl #2]
	ldr	w8, [x21, #12]
	add	w8, w8, #1
	str	w8, [x21, #12]
	b	LBB0_1
LBB0_11:
	mov	x0, x20
	bl	_av_free
Lloh0:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_AVERROR
LBB0_12:
	asr	w8, w8, #28
	orr	w8, w8, #0x80
	ldrsw	x9, [x21, #8]
	add	w10, w9, #1
	str	w10, [x21, #8]
	str	w8, [x0, x9, lsl #2]
	ldr	w8, [x19]
	cmp	w8, #512, lsl #12               ; =2097152
	b.lo	LBB0_7
LBB0_13:
	asr	w8, w8, #21
	orr	w8, w8, #0x80
	ldrsw	x9, [x21, #8]
	add	w10, w9, #1
	str	w10, [x21, #8]
	str	w8, [x0, x9, lsl #2]
	ldr	w8, [x19]
	cmp	w8, #4, lsl #12                 ; =16384
	b.lo	LBB0_8
LBB0_14:
	asr	w8, w8, #14
	orr	w8, w8, #0x80
	ldrsw	x9, [x21, #8]
	add	w10, w9, #1
	str	w10, [x21, #8]
	str	w8, [x0, x9, lsl #2]
	ldr	w8, [x19]
	cmp	w8, #128
	b.hs	LBB0_9
	b	LBB0_10
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_caf_write_packet
.subsections_via_symbols
