	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_BufFileAppend                  ## -- Begin function BufFileAppend
	.p2align	4, 0x90
_BufFileAppend:                         ## @BufFileAppend
	.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	%rsi, %r13
	movq	%rdi, %r15
	movq	(%rdi), %rcx
	movq	_BUFFILE_SEG_SIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %r14
	movq	(%rsi), %rbx
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	addq	%rcx, %rbx
	xorl	%edi, %edi
	cmpq	$0, 32(%r15)
	setne	%dil
	callq	_Assert
	movl	8(%r13), %edi
	callq	_Assert
	xorl	%edi, %edi
	cmpl	$0, 40(%r13)
	sete	%dil
	callq	_Assert
	xorl	%edi, %edi
	cmpq	$0, 32(%r13)
	setne	%dil
	callq	_Assert
	movq	16(%r15), %rax
	cmpq	16(%r13), %rax
	je	LBB0_2
## %bb.1:
	movq	_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_elog
LBB0_2:
	movq	24(%r15), %rdi
	movq	%rbx, %r12
	shlq	$32, %r12
	leal	(,%rbx,4), %esi
	callq	_repalloc
	movq	%rax, 24(%r15)
	movq	(%r15), %r11
	cmpl	%ebx, %r11d
	jge	LBB0_19
## %bb.3:
	movq	24(%r13), %r10
	movslq	%r11d, %rcx
	movq	%r12, %rdx
	sarq	$32, %rdx
	movq	%rdx, %r13
	subq	%rcx, %r13
	cmpq	$8, %r13
	jb	LBB0_13
## %bb.4:
	movq	%r11, %rsi
	shlq	$32, %rsi
	sarq	$30, %rsi
	leaq	(%rax,%rsi), %r8
	addq	%r10, %rsi
	leaq	(,%r11,4), %rdi
	subq	%rsi, %rdi
	addq	%r8, %rdi
	cmpq	$32, %rdi
	jb	LBB0_13
## %bb.5:
	movq	%r10, -48(%rbp)                 ## 8-byte Spill
	movq	%r13, %rdi
	andq	$-8, %rdi
	leaq	-8(%rdi), %rsi
	movq	%rsi, %r10
	shrq	$3, %r10
	incq	%r10
	testq	%rsi, %rsi
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	je	LBB0_6
## %bb.7:
	movq	%r10, %rdi
	andq	$-2, %rdi
	leaq	12(%rcx), %r8
	leaq	(%rax,%rcx,4), %r9
	addq	$48, %r9
	subq	%r11, %r8
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	leaq	(%rsi,%r8,4), %r8
	xorl	%esi, %esi
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movups	-48(%r8,%rsi,4), %xmm0
	movups	-32(%r8,%rsi,4), %xmm1
	movups	%xmm0, -48(%r9,%rsi,4)
	movups	%xmm1, -32(%r9,%rsi,4)
	movups	-16(%r8,%rsi,4), %xmm0
	movups	(%r8,%rsi,4), %xmm1
	movups	%xmm0, -16(%r9,%rsi,4)
	movups	%xmm1, (%r9,%rsi,4)
	addq	$16, %rsi
	addq	$-2, %rdi
	jne	LBB0_8
	jmp	LBB0_9
LBB0_6:
	xorl	%esi, %esi
LBB0_9:
	testb	$1, %r10b
	movq	-48(%rbp), %r10                 ## 8-byte Reload
	je	LBB0_11
## %bb.10:
	addq	%rcx, %rsi
	movq	%rsi, %rdi
	subq	%r11, %rdi
	movups	(%r10,%rdi,4), %xmm0
	movups	16(%r10,%rdi,4), %xmm1
	movups	%xmm0, (%rax,%rsi,4)
	movups	%xmm1, 16(%rax,%rsi,4)
LBB0_11:
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	cmpq	%rsi, %r13
	je	LBB0_19
## %bb.12:
	addq	%rsi, %rcx
LBB0_13:
	subl	%ecx, %ebx
	movq	%rcx, %r9
	notq	%r9
	addq	%rdx, %r9
	andq	$3, %rbx
	je	LBB0_16
## %bb.14:
	leaq	(,%r11,4), %r8
	movq	%r10, %rdi
	subq	%r8, %rdi
	.p2align	4, 0x90
LBB0_15:                                ## =>This Inner Loop Header: Depth=1
	movl	(%rdi,%rcx,4), %esi
	movl	%esi, (%rax,%rcx,4)
	incq	%rcx
	decq	%rbx
	jne	LBB0_15
LBB0_16:
	cmpq	$3, %r9
	jb	LBB0_19
## %bb.17:
	movl	$3, %esi
	subq	%r11, %rsi
	leaq	(%r10,%rsi,4), %rsi
	.p2align	4, 0x90
LBB0_18:                                ## =>This Inner Loop Header: Depth=1
	movl	-12(%rsi,%rcx,4), %edi
	movl	%edi, (%rax,%rcx,4)
	movl	-8(%rsi,%rcx,4), %edi
	movl	%edi, 4(%rax,%rcx,4)
	movl	-4(%rsi,%rcx,4), %edi
	movl	%edi, 8(%rax,%rcx,4)
	movl	(%rsi,%rcx,4), %edi
	movl	%edi, 12(%rax,%rcx,4)
	addq	$4, %rcx
	cmpq	%rcx, %rdx
	jne	LBB0_18
LBB0_19:
	sarq	$32, %r12
	imulq	-64(%rbp), %r14                 ## 8-byte Folded Reload
	movq	%r12, (%r15)
	movq	%r14, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BUFFILE_SEG_SIZE,8,3           ## @BUFFILE_SEG_SIZE
	.comm	_ERROR,4,2                      ## @ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"could not append BufFile with non-matching resource owner"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_BufFileAppend                  ; -- Begin function BufFileAppend
	.p2align	2
_BufFileAppend:                         ; @BufFileAppend
	.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, x1
	mov	x19, x0
	ldr	x21, [x0]
Lloh0:
	adrp	x8, _BUFFILE_SEG_SIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BUFFILE_SEG_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	x22, [x8]
	ldr	x8, [x1]
	add	x23, x8, x21
	ldr	x8, [x0, #32]
	cmp	x8, #0
	cset	w0, ne
	bl	_Assert
	ldr	w0, [x20, #8]
	bl	_Assert
	ldr	w8, [x20, #40]
	cmp	w8, #0
	cset	w0, eq
	bl	_Assert
	ldr	x8, [x20, #32]
	cmp	x8, #0
	cset	w0, ne
	bl	_Assert
	ldr	x8, [x19, #16]
	ldr	x9, [x20, #16]
	cmp	x8, x9
	b.eq	LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _ERROR@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ERROR@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	bl	_elog
LBB0_2:
	ldr	x0, [x19, #24]
	lsl	x24, x23, #32
	lsl	w1, w23, #2
	bl	_repalloc
	str	x0, [x19, #24]
	ldr	x9, [x19]
	asr	x8, x24, #32
	cmp	w9, w23
	b.ge	LBB0_10
; %bb.3:
	ldr	x10, [x20, #24]
	sxtw	x14, w9
	sub	x11, x8, x14
	cmp	x11, #16
	b.lo	LBB0_8
; %bb.4:
	lsl	x12, x9, #32
	asr	x12, x12, #30
	lsl	x13, x9, #2
	add	x15, x12, x10
	sub	x13, x13, x15
	add	x12, x0, x12
	add	x12, x12, x13
	cmp	x12, #64
	b.lo	LBB0_8
; %bb.5:
	and	x12, x11, #0xfffffffffffffff0
	add	x13, x14, x12
	add	x15, x14, #8
	add	x14, x0, x15, lsl #2
	sub	x15, x15, x9
	add	x15, x10, x15, lsl #2
	mov	x16, x12
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldp	q0, q1, [x15, #-32]
	ldp	q2, q3, [x15], #64
	stp	q0, q1, [x14, #-32]
	stp	q2, q3, [x14], #64
	subs	x16, x16, #16
	b.ne	LBB0_6
; %bb.7:
	mov	x14, x13
	cmp	x11, x12
	b.eq	LBB0_10
LBB0_8:
	sub	x9, x14, x9
	add	x9, x10, x9, lsl #2
	add	x10, x0, x14, lsl #2
	sub	x11, x8, x14
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w12, [x9], #4
	str	w12, [x10], #4
	subs	x11, x11, #1
	b.ne	LBB0_9
LBB0_10:
	mul	x0, x22, x21
	str	x8, [x19]
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_BUFFILE_SEG_SIZE,8,3           ; @BUFFILE_SEG_SIZE
	.comm	_ERROR,4,2                      ; @ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"could not append BufFile with non-matching resource owner"

.subsections_via_symbols
