	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function WalRcvWaitForStartPosition
_WalRcvWaitForStartPosition:            ## @WalRcvWaitForStartPosition
	.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	$88, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, -120(%rbp)                ## 8-byte Spill
	movq	%rdi, -128(%rbp)                ## 8-byte Spill
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_WalRcv@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	leaq	12(%rbx), %r12
	movq	%r12, %rdi
	callq	_SpinLockAcquire
	movl	(%rbx), %r14d
	movq	_WALRCV_STREAMING@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r14d
	je	LBB0_4
## %bb.1:
	movq	%r12, %rdi
	callq	_SpinLockRelease
	movq	_WALRCV_STOPPING@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r14d
	jne	LBB0_3
## %bb.2:
	xorl	%edi, %edi
	callq	_proc_exit
	jmp	LBB0_4
LBB0_3:
	movq	_FATAL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_elog
LBB0_4:
	movq	_WALRCV_WAITING@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rbx)
	movq	_InvalidXLogRecPtr@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 4(%rbx)
	movq	$0, 16(%rbx)
	movq	%r12, %rdi
	callq	_SpinLockRelease
	movq	_update_process_title@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_6
## %bb.5:
	leaq	L_.str.1(%rip), %rdi
	xorl	%esi, %esi
	callq	_set_ps_display
LBB0_6:
	xorl	%eax, %eax
	callq	_WakeupRecovery
	movq	_WALRCV_RESTARTING@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movl	8(%rbx), %edi
	callq	_ResetLatch
	xorl	%eax, %eax
	callq	_ProcessWalRcvInterrupts
	movq	%r12, %rdi
	callq	_SpinLockAcquire
	movl	(%rbx), %ecx
	movb	$1, %al
	cmpl	(%r13), %ecx
	je	LBB0_10
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	movq	_WALRCV_WAITING@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %ecx
	je	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_7 Depth=1
	movq	_WALRCV_STOPPING@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ecx
	sete	%al
LBB0_10:                                ##   in Loop: Header=BB0_7 Depth=1
	movzbl	%al, %edi
	callq	_Assert
	movl	(%rbx), %r14d
	cmpl	(%r13), %r14d
	je	LBB0_11
## %bb.15:                              ##   in Loop: Header=BB0_7 Depth=1
	movq	_WALRCV_STOPPING@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movq	%r12, %rdi
	callq	_SpinLockRelease
	cmpl	%r15d, %r14d
	je	LBB0_18
## %bb.16:                              ##   in Loop: Header=BB0_7 Depth=1
	movl	8(%rbx), %edi
	movq	_WL_EXIT_ON_PM_DEATH@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_WL_LATCH_SET@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
	movq	_WAIT_EVENT_WAL_RECEIVER_WAIT_START@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	xorl	%edx, %edx
	callq	_WaitLatch
	jmp	LBB0_7
LBB0_11:
	movl	4(%rbx), %eax
	movq	-128(%rbp), %r14                ## 8-byte Reload
	movl	%eax, (%r14)
	movq	16(%rbx), %rax
	movq	-120(%rbp), %rcx                ## 8-byte Reload
	movq	%rax, (%rcx)
	movq	_WALRCV_STREAMING@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rbx)
	movq	%r12, %rdi
	callq	_SpinLockRelease
	movq	_update_process_title@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_13
## %bb.12:
	movl	(%r14), %r8d
	leaq	L_.str.2(%rip), %rdx
	leaq	-112(%rbp), %rbx
	movq	%rbx, %rdi
	movl	$50, %esi
	callq	_snprintf
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_set_ps_display
LBB0_13:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_14
## %bb.17:
	addq	$88, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_18:
	movl	$1, %edi
	callq	_exit
LBB0_14:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_WalRcv,8,3                     ## @WalRcv
	.comm	_WALRCV_STREAMING,4,2           ## @WALRCV_STREAMING
	.comm	_WALRCV_STOPPING,4,2            ## @WALRCV_STOPPING
	.comm	_FATAL,4,2                      ## @FATAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"unexpected walreceiver state"

	.comm	_WALRCV_WAITING,4,2             ## @WALRCV_WAITING
	.comm	_InvalidXLogRecPtr,4,2          ## @InvalidXLogRecPtr
	.comm	_update_process_title,8,3       ## @update_process_title
L_.str.1:                               ## @.str.1
	.asciz	"idle"

	.comm	_WALRCV_RESTARTING,4,2          ## @WALRCV_RESTARTING
	.comm	_WL_LATCH_SET,4,2               ## @WL_LATCH_SET
	.comm	_WL_EXIT_ON_PM_DEATH,4,2        ## @WL_EXIT_ON_PM_DEATH
	.comm	_WAIT_EVENT_WAL_RECEIVER_WAIT_START,4,2 ## @WAIT_EVENT_WAL_RECEIVER_WAIT_START
L_.str.2:                               ## @.str.2
	.asciz	"restarting at %X/%X"

	.no_dead_strip	_WalRcvWaitForStartPosition
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function WalRcvWaitForStartPosition
_WalRcvWaitForStartPosition:            ; @WalRcvWaitForStartPosition
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #176
	.cfi_def_cfa_offset 176
	stp	x28, x27, [sp, #80]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #96]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #112]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #128]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #144]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #160]            ; 16-byte Folded Spill
	add	x29, sp, #160
	.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	x1, x0, [sp]                    ; 16-byte Folded Spill
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #72]
Lloh3:
	adrp	x8, _WalRcv@GOTPAGE
Lloh4:
	ldr	x8, [x8, _WalRcv@GOTPAGEOFF]
Lloh5:
	ldr	x22, [x8]
	add	x21, x22, #12
	mov	x0, x21
	bl	_SpinLockAcquire
	ldr	w20, [x22]
Lloh6:
	adrp	x8, _WALRCV_STREAMING@GOTPAGE
Lloh7:
	ldr	x8, [x8, _WALRCV_STREAMING@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
Lloh9:
	adrp	x24, _WALRCV_STOPPING@GOTPAGE
Lloh10:
	ldr	x24, [x24, _WALRCV_STOPPING@GOTPAGEOFF]
	cmp	w20, w8
	b.eq	LBB0_4
; %bb.1:
	mov	x0, x21
	bl	_SpinLockRelease
	ldr	w8, [x24]
	cmp	w20, w8
	b.ne	LBB0_3
; %bb.2:
	mov	w0, #0
	bl	_proc_exit
	b	LBB0_4
LBB0_3:
Lloh11:
	adrp	x8, _FATAL@GOTPAGE
Lloh12:
	ldr	x8, [x8, _FATAL@GOTPAGEOFF]
Lloh13:
	ldr	w0, [x8]
Lloh14:
	adrp	x1, l_.str@PAGE
Lloh15:
	add	x1, x1, l_.str@PAGEOFF
	bl	_elog
LBB0_4:
Lloh16:
	adrp	x25, _WALRCV_WAITING@GOTPAGE
Lloh17:
	ldr	x25, [x25, _WALRCV_WAITING@GOTPAGEOFF]
	ldr	w8, [x25]
	str	w8, [x22]
Lloh18:
	adrp	x8, _InvalidXLogRecPtr@GOTPAGE
Lloh19:
	ldr	x8, [x8, _InvalidXLogRecPtr@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	str	w8, [x22, #4]
	str	xzr, [x22, #16]
	mov	x0, x21
	bl	_SpinLockRelease
Lloh21:
	adrp	x8, _update_process_title@GOTPAGE
Lloh22:
	ldr	x8, [x8, _update_process_title@GOTPAGEOFF]
Lloh23:
	ldr	x8, [x8]
	cbz	x8, LBB0_6
; %bb.5:
Lloh24:
	adrp	x0, l_.str.1@PAGE
Lloh25:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	w1, #0
	bl	_set_ps_display
LBB0_6:
	bl	_WakeupRecovery
Lloh26:
	adrp	x27, _WALRCV_RESTARTING@GOTPAGE
Lloh27:
	ldr	x27, [x27, _WALRCV_RESTARTING@GOTPAGEOFF]
Lloh28:
	adrp	x28, _WL_LATCH_SET@GOTPAGE
Lloh29:
	ldr	x28, [x28, _WL_LATCH_SET@GOTPAGEOFF]
Lloh30:
	adrp	x23, _WL_EXIT_ON_PM_DEATH@GOTPAGE
Lloh31:
	ldr	x23, [x23, _WL_EXIT_ON_PM_DEATH@GOTPAGEOFF]
Lloh32:
	adrp	x20, _WAIT_EVENT_WAL_RECEIVER_WAIT_START@GOTPAGE
Lloh33:
	ldr	x20, [x20, _WAIT_EVENT_WAL_RECEIVER_WAIT_START@GOTPAGEOFF]
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x22, #8]
	bl	_ResetLatch
	bl	_ProcessWalRcvInterrupts
	mov	x0, x21
	bl	_SpinLockAcquire
	ldr	w8, [x22]
	ldr	w9, [x27]
	ldr	w10, [x25]
	cmp	w8, w9
	ccmp	w8, w10, #4, ne
	b.ne	LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	mov	w0, #1
	b	LBB0_10
LBB0_9:                                 ;   in Loop: Header=BB0_7 Depth=1
	ldr	w9, [x24]
	cmp	w8, w9
	cset	w0, eq
LBB0_10:                                ;   in Loop: Header=BB0_7 Depth=1
	bl	_Assert
	ldr	w26, [x22]
	ldr	w8, [x27]
	cmp	w26, w8
	b.eq	LBB0_13
; %bb.11:                               ;   in Loop: Header=BB0_7 Depth=1
	ldr	w19, [x24]
	mov	x0, x21
	bl	_SpinLockRelease
	cmp	w26, w19
	b.eq	LBB0_17
; %bb.12:                               ;   in Loop: Header=BB0_7 Depth=1
	ldr	w0, [x22, #8]
	ldr	w8, [x28]
	ldr	w9, [x23]
	orr	w1, w9, w8
	ldr	w3, [x20]
	mov	w2, #0
	bl	_WaitLatch
	b	LBB0_7
LBB0_13:
	ldr	w8, [x22, #4]
	ldp	x9, x19, [sp]                   ; 16-byte Folded Reload
	str	w8, [x19]
	ldr	x8, [x22, #16]
	str	x8, [x9]
Lloh34:
	adrp	x8, _WALRCV_STREAMING@GOTPAGE
Lloh35:
	ldr	x8, [x8, _WALRCV_STREAMING@GOTPAGEOFF]
Lloh36:
	ldr	w8, [x8]
	str	w8, [x22]
	mov	x0, x21
	bl	_SpinLockRelease
Lloh37:
	adrp	x8, _update_process_title@GOTPAGE
Lloh38:
	ldr	x8, [x8, _update_process_title@GOTPAGEOFF]
Lloh39:
	ldr	x8, [x8]
	cbz	x8, LBB0_15
; %bb.14:
	ldr	w4, [x19]
Lloh40:
	adrp	x2, l_.str.2@PAGE
Lloh41:
	add	x2, x2, l_.str.2@PAGEOFF
	add	x0, sp, #22
	mov	w1, #50
	bl	_snprintf
	add	x0, sp, #22
	mov	w1, #0
	bl	_set_ps_display
LBB0_15:
	ldr	x8, [sp, #72]
Lloh42:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh43:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh44:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_18
; %bb.16:
	ldp	x29, x30, [sp, #160]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #144]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #128]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #112]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #96]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #80]             ; 16-byte Folded Reload
	add	sp, sp, #176
	ret
LBB0_17:
	mov	w0, #1
	bl	_exit
LBB0_18:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh32, Lloh33
	.loh AdrpLdrGot	Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpAdd	Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.cfi_endproc
                                        ; -- End function
	.comm	_WalRcv,8,3                     ; @WalRcv
	.comm	_WALRCV_STREAMING,4,2           ; @WALRCV_STREAMING
	.comm	_WALRCV_STOPPING,4,2            ; @WALRCV_STOPPING
	.comm	_FATAL,4,2                      ; @FATAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"unexpected walreceiver state"

	.comm	_WALRCV_WAITING,4,2             ; @WALRCV_WAITING
	.comm	_InvalidXLogRecPtr,4,2          ; @InvalidXLogRecPtr
	.comm	_update_process_title,8,3       ; @update_process_title
l_.str.1:                               ; @.str.1
	.asciz	"idle"

	.comm	_WALRCV_RESTARTING,4,2          ; @WALRCV_RESTARTING
	.comm	_WL_LATCH_SET,4,2               ; @WL_LATCH_SET
	.comm	_WL_EXIT_ON_PM_DEATH,4,2        ; @WL_EXIT_ON_PM_DEATH
	.comm	_WAIT_EVENT_WAL_RECEIVER_WAIT_START,4,2 ; @WAIT_EVENT_WAL_RECEIVER_WAIT_START
l_.str.2:                               ; @.str.2
	.asciz	"restarting at %X/%X"

	.no_dead_strip	_WalRcvWaitForStartPosition
.subsections_via_symbols
