	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function CreateEndOfRecoveryRecord
_CreateEndOfRecoveryRecord:             ## @CreateEndOfRecoveryRecord
	.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	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	xorl	%eax, %eax
	callq	_RecoveryInProgress
	testl	%eax, %eax
	jne	LBB0_2
## %bb.1:
	movq	_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_elog
LBB0_2:
	xorl	%eax, %eax
	callq	_GetCurrentTimestamp
	movl	%eax, -32(%rbp)
	xorl	%eax, %eax
	callq	_WALInsertLockAcquireExclusive
	movq	_ThisTimeLineID@GOTPCREL(%rip), %r14
	movq	(%r14), %rax
	movq	%rax, -40(%rbp)
	movq	_XLogCtl@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%rax), %eax
	movl	%eax, -48(%rbp)
	xorl	%eax, %eax
	callq	_WALInsertLockRelease
	xorl	%eax, %eax
	callq	_LocalSetXLogInsertAllowed
	xorl	%eax, %eax
	callq	_START_CRIT_SECTION
	xorl	%eax, %eax
	callq	_XLogBeginInsert
	leaq	-48(%rbp), %rdi
	movl	$24, %esi
	callq	_XLogRegisterData
	movq	_RM_XLOG_ID@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_XLOG_END_OF_RECOVERY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_XLogInsert
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_XLogFlush
	movq	_ControlFileLock@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	movq	_LW_EXCLUSIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_LWLockAcquire
	xorl	%edi, %edi
	callq	_time
	movq	_ControlFile@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	%rax, 16(%rcx)
	movl	%ebx, 8(%rcx)
	movq	(%r14), %rax
	movq	%rax, (%rcx)
	xorl	%eax, %eax
	callq	_UpdateControlFile
	movl	(%r15), %edi
	callq	_LWLockRelease
	xorl	%eax, %eax
	callq	_END_CRIT_SECTION
	movq	_LocalXLogInsertAllowed@GOTPCREL(%rip), %rax
	movl	$-1, (%rax)
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ERROR,4,2                      ## @ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"can only be used to end recovery"

	.comm	_ThisTimeLineID,8,3             ## @ThisTimeLineID
	.comm	_XLogCtl,8,3                    ## @XLogCtl
	.comm	_RM_XLOG_ID,4,2                 ## @RM_XLOG_ID
	.comm	_XLOG_END_OF_RECOVERY,4,2       ## @XLOG_END_OF_RECOVERY
	.comm	_ControlFileLock,4,2            ## @ControlFileLock
	.comm	_LW_EXCLUSIVE,4,2               ## @LW_EXCLUSIVE
	.comm	_ControlFile,8,3                ## @ControlFile
	.comm	_LocalXLogInsertAllowed,4,2     ## @LocalXLogInsertAllowed
	.no_dead_strip	_CreateEndOfRecoveryRecord
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function CreateEndOfRecoveryRecord
_CreateEndOfRecoveryRecord:             ; @CreateEndOfRecoveryRecord
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	bl	_RecoveryInProgress
	cbnz	w0, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _ERROR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ERROR@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	bl	_elog
LBB0_2:
	bl	_GetCurrentTimestamp
	str	w0, [sp, #24]
	bl	_WALInsertLockAcquireExclusive
Lloh5:
	adrp	x20, _ThisTimeLineID@GOTPAGE
Lloh6:
	ldr	x20, [x20, _ThisTimeLineID@GOTPAGEOFF]
	ldr	x8, [x20]
	str	x8, [sp, #16]
Lloh7:
	adrp	x8, _XLogCtl@GOTPAGE
Lloh8:
	ldr	x8, [x8, _XLogCtl@GOTPAGEOFF]
Lloh9:
	ldr	x8, [x8]
	ldr	w8, [x8]
	str	w8, [sp, #8]
	bl	_WALInsertLockRelease
	bl	_LocalSetXLogInsertAllowed
	bl	_START_CRIT_SECTION
	bl	_XLogBeginInsert
	add	x0, sp, #8
	mov	w1, #24
	bl	_XLogRegisterData
Lloh10:
	adrp	x8, _RM_XLOG_ID@GOTPAGE
Lloh11:
	ldr	x8, [x8, _RM_XLOG_ID@GOTPAGEOFF]
Lloh12:
	ldr	w0, [x8]
Lloh13:
	adrp	x8, _XLOG_END_OF_RECOVERY@GOTPAGE
Lloh14:
	ldr	x8, [x8, _XLOG_END_OF_RECOVERY@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	bl	_XLogInsert
	mov	x19, x0
	bl	_XLogFlush
Lloh16:
	adrp	x21, _ControlFileLock@GOTPAGE
Lloh17:
	ldr	x21, [x21, _ControlFileLock@GOTPAGEOFF]
	ldr	w0, [x21]
Lloh18:
	adrp	x8, _LW_EXCLUSIVE@GOTPAGE
Lloh19:
	ldr	x8, [x8, _LW_EXCLUSIVE@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	bl	_LWLockAcquire
	mov	x0, #0
	bl	_time
Lloh21:
	adrp	x8, _ControlFile@GOTPAGE
Lloh22:
	ldr	x8, [x8, _ControlFile@GOTPAGEOFF]
Lloh23:
	ldr	x8, [x8]
	str	x0, [x8, #16]
	str	w19, [x8, #8]
	ldr	x9, [x20]
	str	x9, [x8]
	bl	_UpdateControlFile
	ldr	w0, [x21]
	bl	_LWLockRelease
	bl	_END_CRIT_SECTION
Lloh24:
	adrp	x8, _LocalXLogInsertAllowed@GOTPAGE
Lloh25:
	ldr	x8, [x8, _LocalXLogInsertAllowed@GOTPAGEOFF]
	mov	w9, #-1
Lloh26:
	str	w9, [x8]
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotStr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_ERROR,4,2                      ; @ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"can only be used to end recovery"

	.comm	_ThisTimeLineID,8,3             ; @ThisTimeLineID
	.comm	_XLogCtl,8,3                    ; @XLogCtl
	.comm	_RM_XLOG_ID,4,2                 ; @RM_XLOG_ID
	.comm	_XLOG_END_OF_RECOVERY,4,2       ; @XLOG_END_OF_RECOVERY
	.comm	_ControlFileLock,4,2            ; @ControlFileLock
	.comm	_LW_EXCLUSIVE,4,2               ; @LW_EXCLUSIVE
	.comm	_ControlFile,8,3                ; @ControlFile
	.comm	_LocalXLogInsertAllowed,4,2     ; @LocalXLogInsertAllowed
	.no_dead_strip	_CreateEndOfRecoveryRecord
.subsections_via_symbols
