	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ReserveXLogSwitch
_ReserveXLogSwitch:                     ## @ReserveXLogSwitch
	.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
	movq	%rdx, -80(%rbp)                 ## 8-byte Spill
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	movq	%rdi, %rbx
	movq	_XLogCtl@GOTPCREL(%rip), %rax
	movq	(%rax), %r13
	movq	_SizeOfXLogRecord@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_MAXALIGN
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	leaq	16(%r13), %r12
	movq	%r12, %rdi
	callq	_SpinLockAcquire
	movq	(%r13), %r14
	movq	%r14, %rdi
	callq	_XLogBytePosToEndRecPtr
	movl	%eax, %r15d
	movq	_wal_segment_size@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movl	%r15d, %edi
	callq	_XLogSegmentOffset
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	addq	%r14, %r12
	movq	8(%r13), %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movq	%r14, %rdi
	callq	_XLogBytePosToRecPtr
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movl	%eax, (%rbx)
	movq	%r12, %rdi
	callq	_XLogBytePosToEndRecPtr
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movl	%eax, (%rcx)
	movq	_wal_segment_size@GOTPCREL(%rip), %r15
	movq	(%r15), %rbx
	movl	%eax, %edi
	movq	%rbx, %rsi
	callq	_XLogSegmentOffset
	subq	%rax, %rbx
	cmpq	(%r15), %rbx
	je	LBB0_4
## %bb.3:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	addl	(%rax), %ebx
	movl	%ebx, (%rax)
	movl	%ebx, %edi
	callq	_XLogRecPtrToBytePos
	movq	%rax, %r12
LBB0_4:
	movq	%r12, (%r13)
	movq	%r14, 8(%r13)
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_SpinLockRelease
	movq	-72(%rbp), %r13                 ## 8-byte Reload
	movq	%r13, %rdi
	callq	_XLogBytePosToRecPtr
	movq	-80(%rbp), %r15                 ## 8-byte Reload
	movl	%eax, (%r15)
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movl	(%rbx), %edi
	movq	_wal_segment_size@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	callq	_XLogSegmentOffset
	xorl	%edi, %edi
	testq	%rax, %rax
	sete	%dil
	callq	_Assert
	movl	(%rbx), %edi
	callq	_XLogRecPtrToBytePos
	xorl	%edi, %edi
	cmpq	%r12, %rax
	sete	%dil
	callq	_Assert
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	callq	_XLogRecPtrToBytePos
	xorl	%edi, %edi
	cmpq	%r14, %rax
	sete	%dil
	callq	_Assert
	movl	(%r15), %edi
	callq	_XLogRecPtrToBytePos
	xorl	%edi, %edi
	cmpq	%r13, %rax
	sete	%dil
	callq	_Assert
	movl	$1, %eax
	jmp	LBB0_5
LBB0_1:
	movq	%r12, %rdi
	callq	_SpinLockRelease
	movl	%r15d, (%rbx)
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	%r15d, (%rax)
	xorl	%eax, %eax
LBB0_5:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_XLogCtl,8,3                    ## @XLogCtl
	.comm	_SizeOfXLogRecord,4,2           ## @SizeOfXLogRecord
	.comm	_wal_segment_size,8,3           ## @wal_segment_size
	.no_dead_strip	_ReserveXLogSwitch
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ReserveXLogSwitch
_ReserveXLogSwitch:                     ; @ReserveXLogSwitch
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x2
	mov	x21, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _XLogCtl@GOTPAGE
Lloh1:
	ldr	x8, [x8, _XLogCtl@GOTPAGEOFF]
Lloh2:
	ldr	x27, [x8]
Lloh3:
	adrp	x8, _SizeOfXLogRecord@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SizeOfXLogRecord@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	bl	_MAXALIGN
	mov	x23, x0
	add	x24, x27, #16
	mov	x0, x24
	bl	_SpinLockAcquire
	ldr	x22, [x27]
	mov	x0, x22
	bl	_XLogBytePosToEndRecPtr
	mov	x25, x0
Lloh6:
	adrp	x28, _wal_segment_size@GOTPAGE
Lloh7:
	ldr	x28, [x28, _wal_segment_size@GOTPAGEOFF]
	ldr	x1, [x28]
	bl	_XLogSegmentOffset
	cbz	x0, LBB0_4
; %bb.1:
	add	x25, x22, x23
	ldr	x23, [x27, #8]
	mov	x0, x22
	bl	_XLogBytePosToRecPtr
	str	w0, [x20]
	mov	x0, x25
	bl	_XLogBytePosToEndRecPtr
	str	w0, [x21]
	ldr	x26, [x28]
	mov	x1, x26
	bl	_XLogSegmentOffset
	ldr	x9, [x28]
	sub	x8, x26, x0
	cmp	x8, x9
	b.eq	LBB0_3
; %bb.2:
	ldr	w9, [x21]
	add	w0, w9, w8
	str	w0, [x21]
	bl	_XLogRecPtrToBytePos
	mov	x25, x0
LBB0_3:
	stp	x25, x22, [x27]
	mov	x0, x24
	bl	_SpinLockRelease
	mov	x0, x23
	bl	_XLogBytePosToRecPtr
	str	w0, [x19]
	ldr	w0, [x21]
	ldr	x1, [x28]
	bl	_XLogSegmentOffset
	cmp	x0, #0
	cset	w0, eq
	bl	_Assert
	ldr	w0, [x21]
	bl	_XLogRecPtrToBytePos
	cmp	x0, x25
	cset	w0, eq
	bl	_Assert
	ldr	w0, [x20]
	bl	_XLogRecPtrToBytePos
	cmp	x0, x22
	cset	w0, eq
	bl	_Assert
	ldr	w0, [x19]
	bl	_XLogRecPtrToBytePos
	cmp	x0, x23
	cset	w0, eq
	bl	_Assert
	mov	w0, #1
	b	LBB0_5
LBB0_4:
	mov	x0, x24
	bl	_SpinLockRelease
	mov	w0, #0
	str	w25, [x20]
	str	w25, [x21]
LBB0_5:
	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
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_XLogCtl,8,3                    ; @XLogCtl
	.comm	_SizeOfXLogRecord,4,2           ; @SizeOfXLogRecord
	.comm	_wal_segment_size,8,3           ; @wal_segment_size
	.no_dead_strip	_ReserveXLogSwitch
.subsections_via_symbols
