	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function oggpack_writecopy_helper
_oggpack_writecopy_helper:              ## @oggpack_writecopy_helper
	.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	%r8d, %ebx
	movq	%rcx, %r8
	movq	%rdx, %r13
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r15
	leaq	7(%rdx), %r12
	testq	%rdx, %rdx
	cmovnsq	%rdx, %r12
	movq	(%rdi), %rcx
	movq	16(%rdi), %rax
	movq	%rcx, %rdx
	addq	%r13, %rdx
	leaq	7(%rcx,%r13), %rsi
	cmovnsq	%rdx, %rsi
	sarq	$3, %rsi
	addq	8(%rdi), %rsi
	cmpq	%rax, %rsi
	jge	LBB0_1
LBB0_5:
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	movq	%r12, %r14
	sarq	$3, %r14
	andq	$-8, %r12
	movq	%r13, %rax
	subq	%r12, %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	testq	%rcx, %rcx
	je	LBB0_9
## %bb.6:
	cmpq	$8, %r13
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	jl	LBB0_10
## %bb.7:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movzbl	(%r13,%rbx), %esi
	movq	%r15, %rdi
	movl	$8, %edx
	movq	%r8, %r12
	callq	*%r8
	movq	%r12, %r8
	incq	%rbx
	cmpq	%rbx, %r14
	jne	LBB0_8
	jmp	LBB0_10
LBB0_1:
	cmpq	$0, 24(%r15)
	je	LBB0_15
## %bb.2:
	movq	_BUFFER_INCREMENT@GOTPCREL(%rip), %rcx
	addq	(%rcx), %rsi
	cmpq	%rsi, %rax
	jg	LBB0_15
## %bb.3:
	movq	%rsi, 16(%r15)
	movq	32(%r15), %rdi
	movq	%r8, %r14
	callq	__ogg_realloc
	testq	%rax, %rax
	je	LBB0_15
## %bb.4:
	movq	%r14, %r8
	movq	%rax, 32(%r15)
	movq	(%r15), %rcx
	movq	8(%r15), %rdx
	leaq	(%rax,%rdx,8), %rax
	movq	%rax, 24(%r15)
	jmp	LBB0_5
LBB0_15:
	movq	%r15, %rdi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_oggpack_writeclear             ## TAILCALL
LBB0_9:
	movq	24(%r15), %rdi
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	movq	%r13, %rsi
	movq	%r14, %rdx
	movq	%r8, %rbx
	callq	_memmove
	movq	%rbx, %r8
	movq	24(%r15), %rax
	leaq	(%rax,%r14,8), %rcx
	movq	%rcx, 24(%r15)
	addq	%r14, 8(%r15)
	movq	$0, (%rax,%r14,8)
LBB0_10:
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	testq	%rdx, %rdx
	je	LBB0_16
## %bb.11:
	movzbl	(%r13,%r14), %esi
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_13
## %bb.12:
	movb	$8, %cl
	subb	%dl, %cl
	shrq	%cl, %rsi
	jmp	LBB0_14
LBB0_16:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	movl	%esi, %esi
LBB0_14:
	movq	%r15, %rdi
                                        ## kill: def $edx killed $edx killed $rdx
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmpq	*%r8                            ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_BUFFER_INCREMENT,8,3           ## @BUFFER_INCREMENT
	.no_dead_strip	_oggpack_writecopy_helper
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function oggpack_writecopy_helper
_oggpack_writecopy_helper:              ; @oggpack_writecopy_helper
	.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	x20, x4
	mov	x23, x2
	mov	x21, x1
	mov	x19, x0
	add	x8, x2, #7
	cmp	x2, #0
	csel	x22, x8, x2, lt
	ldp	x8, x9, [x0]
	add	x10, x8, x2
	add	x11, x10, #7
	cmp	x10, #0
	csel	x10, x11, x10, lt
	add	x10, x9, x10, asr #3
	ldr	x9, [x0, #16]
	cmp	x10, x9
	b.ge	LBB0_9
LBB0_1:
	asr	x24, x22, #3
	and	x9, x22, #0xfffffffffffffff8
	sub	x22, x23, x9
	cbz	x8, LBB0_14
; %bb.2:
	cmp	x23, #8
	b.lt	LBB0_5
; %bb.3:
	mov	x23, x24
	mov	x25, x21
	str	x3, [sp, #8]                    ; 8-byte Folded Spill
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldrb	w1, [x25], #1
	mov	x0, x19
	mov	w2, #8
	ldr	x3, [sp, #8]                    ; 8-byte Folded Reload
	blr	x3
	ldr	x3, [sp, #8]                    ; 8-byte Folded Reload
	subs	x23, x23, #1
	b.ne	LBB0_4
LBB0_5:
	cbz	x22, LBB0_15
LBB0_6:
	ldrb	w1, [x21, x24]
	cbz	w20, LBB0_8
; %bb.7:
	mov	w8, #8
	sub	w8, w8, w22
	lsr	x1, x1, x8
LBB0_8:
	mov	x0, x19
	mov	x2, x22
	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
	br	x3
LBB0_9:
	ldr	x8, [x19, #24]
	cbz	x8, LBB0_13
; %bb.10:
Lloh0:
	adrp	x8, _BUFFER_INCREMENT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BUFFER_INCREMENT@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	add	x1, x8, x10
	cmp	x9, x1
	b.gt	LBB0_13
; %bb.11:
	str	x1, [x19, #16]
	ldr	x0, [x19, #32]
	str	x3, [sp, #8]                    ; 8-byte Folded Spill
	bl	__ogg_realloc
	ldr	x3, [sp, #8]                    ; 8-byte Folded Reload
	cbz	x0, LBB0_13
; %bb.12:
	ldp	x8, x9, [x19]
	add	x9, x0, x9, lsl #3
	stp	x9, x0, [x19, #24]
	b	LBB0_1
LBB0_13:
	mov	x0, x19
	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
	b	_oggpack_writeclear
LBB0_14:
	ldr	x0, [x19, #24]
	mov	x1, x21
	mov	x2, x24
	str	x3, [sp, #8]                    ; 8-byte Folded Spill
	bl	_memmove
	ldr	x3, [sp, #8]                    ; 8-byte Folded Reload
	ldr	x8, [x19, #24]
	lsl	x9, x24, #3
	add	x10, x8, x9
	str	x10, [x19, #24]
	ldr	x10, [x19, #8]
	add	x10, x10, x24
	str	x10, [x19, #8]
	str	xzr, [x8, x9]
	cbnz	x22, LBB0_6
LBB0_15:
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_BUFFER_INCREMENT,8,3           ; @BUFFER_INCREMENT
	.no_dead_strip	_oggpack_writecopy_helper
.subsections_via_symbols
