	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function CheckRecoveryConsistency
_CheckRecoveryConsistency:              ## @CheckRecoveryConsistency
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_minRecoveryPoint@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	callq	_XLogRecPtrIsInvalid
	testq	%rax, %rax
	je	LBB0_1
LBB0_15:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	_InArchiveRecovery@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_Assert
	movq	_XLogCtl@GOTPCREL(%rip), %r15
	movq	(%r15), %rax
	movl	(%rax), %r12d
	movq	_ControlFile@GOTPCREL(%rip), %r14
	movq	(%r14), %rax
	movl	(%rax), %edi
	callq	_XLogRecPtrIsInvalid
	testq	%rax, %rax
	jne	LBB0_6
## %bb.2:
	movq	(%r14), %rax
	cmpl	%r12d, (%rax)
	jg	LBB0_6
## %bb.3:
	movq	_DEBUG1@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_elog
	movq	_ControlFileLock@GOTPCREL(%rip), %r13
	movl	(%r13), %edi
	movq	_LW_EXCLUSIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_LWLockAcquire
	movq	(%r14), %rax
	cmpl	%r12d, 4(%rax)
	jge	LBB0_5
## %bb.4:
	movl	%r12d, 4(%rax)
LBB0_5:
	movq	_InvalidXLogRecPtr@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 8(%rax)
	movl	%ecx, (%rax)
	movl	$0, 12(%rax)
	xorl	%eax, %eax
	callq	_UpdateControlFile
	movl	(%r13), %edi
	callq	_LWLockRelease
LBB0_6:
	movq	_reachedConsistency@GOTPCREL(%rip), %r13
	cmpl	$0, (%r13)
	je	LBB0_7
LBB0_11:
	movq	_standbyState@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_STANDBY_SNAPSHOT_READY@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_15
## %bb.12:
	movq	_LocalHotStandbyActive@GOTPCREL(%rip), %rbx
	cmpl	$0, (%rbx)
	jne	LBB0_15
## %bb.13:
	cmpl	$0, (%r13)
	je	LBB0_15
## %bb.14:
	movq	_IsUnderPostmaster@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_15
## %bb.16:
	movq	(%r15), %rdi
	addq	$8, %rdi
	callq	_SpinLockAcquire
	movq	(%r15), %rdi
	movl	$1, 4(%rdi)
	addq	$8, %rdi
	callq	_SpinLockRelease
	movl	$1, (%rbx)
	movq	_PMSIGNAL_BEGIN_HOT_STANDBY@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_SendPostmasterSignal           ## TAILCALL
LBB0_7:
	movq	(%r14), %rax
	cmpl	$0, 12(%rax)
	jne	LBB0_11
## %bb.8:
	cmpl	%r12d, (%rbx)
	jg	LBB0_11
## %bb.9:
	movl	8(%rax), %edi
	callq	_XLogRecPtrIsInvalid
	testq	%rax, %rax
	je	LBB0_11
## %bb.10:
	xorl	%eax, %eax
	callq	_XLogCheckInvalidPages
	movl	$1, (%r13)
	movq	_LOG@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	leaq	L_.str.1(%rip), %rdi
	movl	%r12d, %edx
	callq	_errmsg
	movl	%r14d, %edi
	movl	%eax, %esi
	callq	_ereport
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_minRecoveryPoint,4,2           ## @minRecoveryPoint
	.comm	_InArchiveRecovery,4,2          ## @InArchiveRecovery
	.comm	_XLogCtl,8,3                    ## @XLogCtl
	.comm	_ControlFile,8,3                ## @ControlFile
	.comm	_DEBUG1,4,2                     ## @DEBUG1
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"end of backup reached"

	.comm	_ControlFileLock,4,2            ## @ControlFileLock
	.comm	_LW_EXCLUSIVE,4,2               ## @LW_EXCLUSIVE
	.comm	_InvalidXLogRecPtr,8,3          ## @InvalidXLogRecPtr
	.comm	_reachedConsistency,4,2         ## @reachedConsistency
	.comm	_LOG,4,2                        ## @LOG
L_.str.1:                               ## @.str.1
	.asciz	"consistent recovery state reached at %X/%X"

	.comm	_standbyState,8,3               ## @standbyState
	.comm	_STANDBY_SNAPSHOT_READY,8,3     ## @STANDBY_SNAPSHOT_READY
	.comm	_LocalHotStandbyActive,4,2      ## @LocalHotStandbyActive
	.comm	_IsUnderPostmaster,8,3          ## @IsUnderPostmaster
	.comm	_PMSIGNAL_BEGIN_HOT_STANDBY,4,2 ## @PMSIGNAL_BEGIN_HOT_STANDBY
	.no_dead_strip	_CheckRecoveryConsistency
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function CheckRecoveryConsistency
_CheckRecoveryConsistency:              ; @CheckRecoveryConsistency
	.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
Lloh0:
	adrp	x20, _minRecoveryPoint@GOTPAGE
Lloh1:
	ldr	x20, [x20, _minRecoveryPoint@GOTPAGEOFF]
	ldr	w0, [x20]
	bl	_XLogRecPtrIsInvalid
	cbz	x0, LBB0_2
LBB0_1:
	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
LBB0_2:
Lloh2:
	adrp	x8, _InArchiveRecovery@GOTPAGE
Lloh3:
	ldr	x8, [x8, _InArchiveRecovery@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
	bl	_Assert
Lloh5:
	adrp	x21, _XLogCtl@GOTPAGE
Lloh6:
	ldr	x21, [x21, _XLogCtl@GOTPAGEOFF]
	ldr	x8, [x21]
	ldr	w19, [x8]
Lloh7:
	adrp	x22, _ControlFile@GOTPAGE
Lloh8:
	ldr	x22, [x22, _ControlFile@GOTPAGEOFF]
	ldr	x8, [x22]
	ldr	w0, [x8]
	bl	_XLogRecPtrIsInvalid
	cbnz	x0, LBB0_7
; %bb.3:
	ldr	x8, [x22]
	ldr	w8, [x8]
	cmp	w8, w19
	b.gt	LBB0_7
; %bb.4:
Lloh9:
	adrp	x8, _DEBUG1@GOTPAGE
Lloh10:
	ldr	x8, [x8, _DEBUG1@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
	bl	_elog
Lloh14:
	adrp	x23, _ControlFileLock@GOTPAGE
Lloh15:
	ldr	x23, [x23, _ControlFileLock@GOTPAGEOFF]
	ldr	w0, [x23]
Lloh16:
	adrp	x8, _LW_EXCLUSIVE@GOTPAGE
Lloh17:
	ldr	x8, [x8, _LW_EXCLUSIVE@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
	bl	_LWLockAcquire
	ldr	x8, [x22]
	ldr	w9, [x8, #4]
	cmp	w9, w19
	b.ge	LBB0_6
; %bb.5:
	str	w19, [x8, #4]
LBB0_6:
Lloh19:
	adrp	x9, _InvalidXLogRecPtr@GOTPAGE
Lloh20:
	ldr	x9, [x9, _InvalidXLogRecPtr@GOTPAGEOFF]
Lloh21:
	ldr	w9, [x9]
	str	w9, [x8]
	stp	w9, wzr, [x8, #8]
	bl	_UpdateControlFile
	ldr	w0, [x23]
	bl	_LWLockRelease
LBB0_7:
Lloh22:
	adrp	x23, _reachedConsistency@GOTPAGE
Lloh23:
	ldr	x23, [x23, _reachedConsistency@GOTPAGEOFF]
	ldr	w8, [x23]
	cbnz	w8, LBB0_11
; %bb.8:
	ldr	x8, [x22]
	ldr	w9, [x8, #12]
	ldr	w10, [x20]
	cmp	w9, #0
	ccmp	w10, w19, #0, eq
	b.gt	LBB0_11
; %bb.9:
	ldr	w0, [x8, #8]
	bl	_XLogRecPtrIsInvalid
	cbz	x0, LBB0_11
; %bb.10:
	bl	_XLogCheckInvalidPages
	mov	w8, #1
	str	w8, [x23]
Lloh24:
	adrp	x8, _LOG@GOTPAGE
Lloh25:
	ldr	x8, [x8, _LOG@GOTPAGEOFF]
Lloh26:
	ldr	w20, [x8]
Lloh27:
	adrp	x0, l_.str.1@PAGE
Lloh28:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x2, x19
	bl	_errmsg
	mov	x1, x0
	mov	x0, x20
	bl	_ereport
LBB0_11:
Lloh29:
	adrp	x8, _standbyState@GOTPAGE
Lloh30:
	ldr	x8, [x8, _standbyState@GOTPAGEOFF]
Lloh31:
	ldr	x8, [x8]
Lloh32:
	adrp	x9, _STANDBY_SNAPSHOT_READY@GOTPAGE
Lloh33:
	ldr	x9, [x9, _STANDBY_SNAPSHOT_READY@GOTPAGEOFF]
Lloh34:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_1
; %bb.12:
Lloh35:
	adrp	x19, _LocalHotStandbyActive@GOTPAGE
Lloh36:
	ldr	x19, [x19, _LocalHotStandbyActive@GOTPAGEOFF]
	ldr	w8, [x19]
	cbnz	w8, LBB0_1
; %bb.13:
	ldr	w8, [x23]
	cbz	w8, LBB0_1
; %bb.14:
Lloh37:
	adrp	x8, _IsUnderPostmaster@GOTPAGE
Lloh38:
	ldr	x8, [x8, _IsUnderPostmaster@GOTPAGEOFF]
Lloh39:
	ldr	x8, [x8]
	cbz	x8, LBB0_1
; %bb.15:
	ldr	x8, [x21]
	add	x0, x8, #8
	bl	_SpinLockAcquire
	ldr	x8, [x21]
	mov	w20, #1
	str	w20, [x8, #4]
	add	x0, x8, #8
	bl	_SpinLockRelease
	str	w20, [x19]
Lloh40:
	adrp	x8, _PMSIGNAL_BEGIN_HOT_STANDBY@GOTPAGE
Lloh41:
	ldr	x8, [x8, _PMSIGNAL_BEGIN_HOT_STANDBY@GOTPAGEOFF]
Lloh42:
	ldr	w0, [x8]
	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
	b	_SendPostmasterSignal
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.cfi_endproc
                                        ; -- End function
	.comm	_minRecoveryPoint,4,2           ; @minRecoveryPoint
	.comm	_InArchiveRecovery,4,2          ; @InArchiveRecovery
	.comm	_XLogCtl,8,3                    ; @XLogCtl
	.comm	_ControlFile,8,3                ; @ControlFile
	.comm	_DEBUG1,4,2                     ; @DEBUG1
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"end of backup reached"

	.comm	_ControlFileLock,4,2            ; @ControlFileLock
	.comm	_LW_EXCLUSIVE,4,2               ; @LW_EXCLUSIVE
	.comm	_InvalidXLogRecPtr,8,3          ; @InvalidXLogRecPtr
	.comm	_reachedConsistency,4,2         ; @reachedConsistency
	.comm	_LOG,4,2                        ; @LOG
l_.str.1:                               ; @.str.1
	.asciz	"consistent recovery state reached at %X/%X"

	.comm	_standbyState,8,3               ; @standbyState
	.comm	_STANDBY_SNAPSHOT_READY,8,3     ; @STANDBY_SNAPSHOT_READY
	.comm	_LocalHotStandbyActive,4,2      ; @LocalHotStandbyActive
	.comm	_IsUnderPostmaster,8,3          ; @IsUnderPostmaster
	.comm	_PMSIGNAL_BEGIN_HOT_STANDBY,4,2 ; @PMSIGNAL_BEGIN_HOT_STANDBY
	.no_dead_strip	_CheckRecoveryConsistency
.subsections_via_symbols
