	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function CopyXLogRecordToWAL
_CopyXLogRecordToWAL:                   ## @CopyXLogRecordToWAL
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r8d, -48(%rbp)                 ## 4-byte Spill
	movl	%ecx, %r14d
	movq	%rdx, %r12
	movl	%esi, -68(%rbp)                 ## 4-byte Spill
	movl	%edi, -52(%rbp)                 ## 4-byte Spill
	movl	%ecx, %edi
	callq	_GetXLogBuffer
	movq	%rax, %rbx
	movl	%r14d, %edi
	callq	_INSERT_FREESPACE
	xorl	%edi, %edi
	movl	%eax, %r15d
	cmpl	$4, %eax
	setae	%dil
	callq	_Assert
	xorl	%eax, %eax
	testq	%r12, %r12
	je	LBB0_7
## %bb.1:
	movl	%r14d, %r13d
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_3:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	%r13d, %r14d
	movl	%ecx, %r15d
	movq	_XLOG_BLCKSZ@GOTPCREL(%rip), %rcx
	movq	_SizeOfXLogShortPHD@GOTPCREL(%rip), %rsi
LBB0_6:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	%r14d, %eax
	cltd
	idivl	(%rcx)
	cmpl	(%rsi), %edx
	setge	%al
	testl	%r15d, %r15d
	sete	%cl
	orb	%al, %cl
	movzbl	%cl, %edi
	callq	_Assert
	movq	%rbx, %rdi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	movl	%r15d, %edx
	callq	_memcpy
	movslq	%r15d, %rax
	addq	%rax, %rbx
	addl	%eax, %r14d
	subl	%eax, %r12d
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	addl	%eax, %ecx
	movl	%r12d, %r15d
	movq	-80(%rbp), %r12                 ## 8-byte Reload
	movq	16(%r12), %r12
	movl	%r14d, %r13d
	testq	%r12, %r12
	movl	%ecx, %eax
	je	LBB0_7
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_5 Depth 2
	movq	(%r12), %rdx
	movq	%r12, -80(%rbp)                 ## 8-byte Spill
	movl	8(%r12), %ecx
	cmpl	%r15d, %ecx
	movl	%r15d, %r12d
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	%rdx, -64(%rbp)                 ## 8-byte Spill
	jle	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	%ecx, %r15d
	movq	_XLOG_BLCKSZ@GOTPCREL(%rip), %rcx
	movq	_SizeOfXLogShortPHD@GOTPCREL(%rip), %rsi
	.p2align	4, 0x90
LBB0_5:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	%r13d, %eax
	cltd
	idivl	(%rcx)
	cmpl	(%rsi), %edx
	setge	%al
	testl	%r12d, %r12d
	sete	%cl
	orb	%al, %cl
	movzbl	%cl, %edi
	callq	_Assert
	movq	%rbx, %rdi
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rsi
	movl	%r12d, %edx
	callq	_memcpy
	movslq	%r12d, %rax
	addq	%rax, %rbx
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	movl	%r15d, %r12d
	subl	%eax, %r12d
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	addl	%eax, %ebx
	addl	%eax, %r13d
	movl	%r13d, %edi
	callq	_GetXLogBuffer
	movq	%rax, %r15
	movl	-52(%rbp), %eax                 ## 4-byte Reload
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	subl	%ebx, %eax
	movl	%eax, (%r15)
	movq	_XLP_FIRST_IS_CONTRECORD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 4(%r15)
	movq	_wal_segment_size@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r13d, %edi
	callq	_XLogSegmentOffset
	testq	%rax, %rax
	movq	_SizeOfXLogLongPHD@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_SizeOfXLogShortPHD@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %r14
	movq	%r14, %rbx
	cmoveq	%rax, %rbx
	cmovel	%eax, %r14d
	addl	%r13d, %r14d
	addq	%r15, %rbx
	movl	%r14d, %edi
	callq	_INSERT_FREESPACE
	movq	_SizeOfXLogShortPHD@GOTPCREL(%rip), %rsi
	movq	_XLOG_BLCKSZ@GOTPCREL(%rip), %rcx
	movl	%r14d, %r13d
	movl	%r12d, %r15d
	cmpl	%eax, %r12d
	movl	%eax, %r12d
	jg	LBB0_5
	jmp	LBB0_6
LBB0_7:
	movl	%r15d, %r12d
	xorl	%edi, %edi
	movl	-52(%rbp), %ebx                 ## 4-byte Reload
	cmpl	%ebx, %eax
	sete	%dil
	callq	_Assert
	cmpl	$0, -68(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_12
## %bb.8:
	movq	_wal_segment_size@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movl	%r14d, %edi
	callq	_XLogSegmentOffset
	testq	%rax, %rax
	je	LBB0_12
## %bb.9:
	movq	_SizeOfXLogRecord@GOTPCREL(%rip), %rax
	xorl	%edi, %edi
	cmpl	%ebx, (%rax)
	sete	%dil
	callq	_Assert
	movl	(%r15), %esi
	movl	-48(%rbp), %ebx                 ## 4-byte Reload
	movl	%ebx, %edi
	callq	_XLogSegmentOffset
	xorl	%edi, %edi
	testq	%rax, %rax
	sete	%dil
	callq	_Assert
	addl	%r12d, %r14d
	cmpl	%ebx, %r14d
	jge	LBB0_13
## %bb.10:
	movq	_SizeOfXLogShortPHD@GOTPCREL(%rip), %r15
	movq	_XLOG_BLCKSZ@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movl	%r14d, %edi
	callq	_GetXLogBuffer
	movl	(%r15), %edx
	movq	%rax, %rdi
	xorl	%esi, %esi
	callq	_MemSet
	addl	(%r12), %r14d
	cmpl	%ebx, %r14d
	jl	LBB0_11
LBB0_13:
	cmpl	%ebx, %r14d
	jne	LBB0_15
LBB0_14:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	movl	%r14d, %edi
	callq	_MAXALIGN64
	movl	%eax, %r14d
	movl	-48(%rbp), %ebx                 ## 4-byte Reload
	cmpl	%ebx, %r14d
	je	LBB0_14
LBB0_15:
	movq	_PANIC@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_elog                           ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_XLOG_BLCKSZ,4,2                ## @XLOG_BLCKSZ
	.comm	_SizeOfXLogShortPHD,4,2         ## @SizeOfXLogShortPHD
	.comm	_XLP_FIRST_IS_CONTRECORD,4,2    ## @XLP_FIRST_IS_CONTRECORD
	.comm	_wal_segment_size,4,2           ## @wal_segment_size
	.comm	_SizeOfXLogLongPHD,8,3          ## @SizeOfXLogLongPHD
	.comm	_SizeOfXLogRecord,4,2           ## @SizeOfXLogRecord
	.comm	_PANIC,4,2                      ## @PANIC
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"space reserved for WAL record does not match what was written"

	.no_dead_strip	_CopyXLogRecordToWAL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function CopyXLogRecordToWAL
_CopyXLogRecordToWAL:                   ; @CopyXLogRecordToWAL
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	stp	w1, w4, [sp, #12]               ; 8-byte Folded Spill
	mov	x21, x3
	mov	x24, x2
	str	w0, [sp, #20]                   ; 4-byte Folded Spill
	mov	x0, x3
	bl	_GetXLogBuffer
	mov	x25, x0
	mov	x0, x21
	bl	_INSERT_FREESPACE
	mov	x23, x0
	cmp	w0, #3
	cset	w0, hi
	bl	_Assert
	mov	w22, #0
	cbz	x24, LBB0_7
; %bb.1:
Lloh0:
	adrp	x28, _SizeOfXLogShortPHD@GOTPAGE
Lloh1:
	ldr	x28, [x28, _SizeOfXLogShortPHD@GOTPAGEOFF]
Lloh2:
	adrp	x19, _XLP_FIRST_IS_CONTRECORD@GOTPAGE
Lloh3:
	ldr	x19, [x19, _XLP_FIRST_IS_CONTRECORD@GOTPAGEOFF]
Lloh4:
	adrp	x20, _SizeOfXLogLongPHD@GOTPAGE
Lloh5:
	ldr	x20, [x20, _SizeOfXLogLongPHD@GOTPAGEOFF]
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
Lloh6:
	adrp	x8, _XLOG_BLCKSZ@GOTPAGE
Lloh7:
	ldr	x8, [x8, _XLOG_BLCKSZ@GOTPAGEOFF]
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x8]
	sdiv	w9, w21, w8
	msub	w8, w9, w8, w21
	ldr	w9, [x28]
	cmp	w8, w9
	ccmp	w26, #0, #4, lt
	cset	w0, eq
	bl	_Assert
	mov	x0, x25
	mov	x1, x27
	mov	x2, x26
	bl	_memcpy
	add	w21, w26, w21
	sub	w23, w23, w26
	add	w22, w26, w22
	ldr	x24, [sp, #24]                  ; 8-byte Folded Reload
	ldr	x24, [x24, #16]
	add	x25, x25, w26, sxtw
	cbz	x24, LBB0_7
LBB0_4:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_6 Depth 2
	ldr	x27, [x24]
	ldr	w26, [x24, #8]
	cmp	w26, w23
	str	x24, [sp, #24]                  ; 8-byte Folded Spill
	b.le	LBB0_2
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w24, [sp, #20]                  ; 4-byte Folded Reload
LBB0_6:                                 ;   Parent Loop BB0_4 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
Lloh8:
	adrp	x8, _XLOG_BLCKSZ@GOTPAGE
Lloh9:
	ldr	x8, [x8, _XLOG_BLCKSZ@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	sdiv	w9, w21, w8
	msub	w8, w9, w8, w21
	ldr	w9, [x28]
	cmp	w8, w9
	ccmp	w23, #0, #4, lt
	cset	w0, eq
	bl	_Assert
	mov	x0, x25
	mov	x1, x27
	mov	x2, x23
	bl	_memcpy
	sub	w26, w26, w23
	add	w22, w22, w23
	add	w21, w21, w23
	add	x27, x27, w23, sxtw
	mov	x0, x21
	bl	_GetXLogBuffer
	mov	x23, x0
	sub	w8, w24, w22
	str	w8, [x0]
	ldr	w8, [x19]
	ldr	w9, [x0, #4]
	orr	w8, w9, w8
	str	w8, [x0, #4]
Lloh11:
	adrp	x8, _wal_segment_size@GOTPAGE
Lloh12:
	ldr	x8, [x8, _wal_segment_size@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_XLogSegmentOffset
	ldr	x8, [x20]
	ldrsw	x9, [x28]
	cmp	x0, #0
	csel	x10, x8, x9, eq
	csel	w8, w8, w9, eq
	add	w21, w8, w21
	add	x25, x23, x10
	mov	x0, x21
	bl	_INSERT_FREESPACE
Lloh14:
	adrp	x8, _XLOG_BLCKSZ@GOTPAGE
Lloh15:
	ldr	x8, [x8, _XLOG_BLCKSZ@GOTPAGEOFF]
	mov	x23, x0
	cmp	w26, w0
	b.gt	LBB0_6
	b	LBB0_3
LBB0_7:
	ldr	w20, [sp, #20]                  ; 4-byte Folded Reload
	cmp	w22, w20
	cset	w0, eq
	bl	_Assert
Lloh16:
	adrp	x19, _wal_segment_size@GOTPAGE
Lloh17:
	ldr	x19, [x19, _wal_segment_size@GOTPAGEOFF]
	ldr	w8, [sp, #12]                   ; 4-byte Folded Reload
	cbz	w8, LBB0_14
; %bb.8:
	ldr	w1, [x19]
	mov	x0, x21
	bl	_XLogSegmentOffset
	cbz	x0, LBB0_14
; %bb.9:
Lloh18:
	adrp	x8, _SizeOfXLogRecord@GOTPAGE
Lloh19:
	ldr	x8, [x8, _SizeOfXLogRecord@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	cmp	w8, w20
	cset	w0, eq
	bl	_Assert
	ldr	w1, [x19]
	ldr	w22, [sp, #16]                  ; 4-byte Folded Reload
	mov	x0, x22
	bl	_XLogSegmentOffset
	cmp	x0, #0
	cset	w0, eq
	bl	_Assert
	add	w20, w21, w23
	cmp	w20, w22
	b.ge	LBB0_12
; %bb.10:
Lloh21:
	adrp	x19, _SizeOfXLogShortPHD@GOTPAGE
Lloh22:
	ldr	x19, [x19, _SizeOfXLogShortPHD@GOTPAGEOFF]
Lloh23:
	adrp	x21, _XLOG_BLCKSZ@GOTPAGE
Lloh24:
	ldr	x21, [x21, _XLOG_BLCKSZ@GOTPAGEOFF]
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	bl	_GetXLogBuffer
	ldr	w2, [x19]
	mov	w1, #0
	bl	_MemSet
	ldr	w8, [x21]
	add	w20, w8, w20
	cmp	w20, w22
	b.lt	LBB0_11
LBB0_12:
	cmp	w20, w22
	b.ne	LBB0_15
LBB0_13:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_14:
	mov	x0, x21
	bl	_MAXALIGN64
	mov	x20, x0
	ldr	w22, [sp, #16]                  ; 4-byte Folded Reload
	cmp	w20, w22
	b.eq	LBB0_13
LBB0_15:
Lloh25:
	adrp	x8, _PANIC@GOTPAGE
Lloh26:
	ldr	x8, [x8, _PANIC@GOTPAGEOFF]
Lloh27:
	ldr	w0, [x8]
Lloh28:
	adrp	x1, l_.str@PAGE
Lloh29:
	add	x1, x1, l_.str@PAGEOFF
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	b	_elog
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_XLOG_BLCKSZ,4,2                ; @XLOG_BLCKSZ
	.comm	_SizeOfXLogShortPHD,4,2         ; @SizeOfXLogShortPHD
	.comm	_XLP_FIRST_IS_CONTRECORD,4,2    ; @XLP_FIRST_IS_CONTRECORD
	.comm	_wal_segment_size,4,2           ; @wal_segment_size
	.comm	_SizeOfXLogLongPHD,8,3          ; @SizeOfXLogLongPHD
	.comm	_SizeOfXLogRecord,4,2           ; @SizeOfXLogRecord
	.comm	_PANIC,4,2                      ; @PANIC
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"space reserved for WAL record does not match what was written"

	.no_dead_strip	_CopyXLogRecordToWAL
.subsections_via_symbols
