	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pg_logical_replication_slot_advance
_pg_logical_replication_slot_advance:   ## @pg_logical_replication_slot_advance
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	_CurrentResourceOwner@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	xorl	%eax, %eax
	callq	_PG_TRY
	movq	_InvalidXLogRecPtr@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movq	_NIL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_logical_read_local_xlog_page@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	$0, (%rsp)
	movl	$1, %edx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	_CreateDecodingContext
	movq	%rax, %r13
	movq	_MyReplicationSlot@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%rax), %rbx
	xorl	%eax, %eax
	callq	_InvalidateSystemCaches
	leaq	-56(%rbp), %r15
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	callq	_XLogRecPtrIsInvalid
	cmpq	%r14, %rbx
	jge	LBB0_3
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	testl	%eax, %eax
	je	LBB0_5
LBB0_3:                                 ##   in Loop: Header=BB0_1 Depth=1
	movq	(%r13), %rax
	movq	(%rax), %rdi
	callq	_XLogRecPtrIsInvalid
	testl	%eax, %eax
	jne	LBB0_11
## %bb.4:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	(%r13), %rax
	cmpq	%r14, (%rax)
	jge	LBB0_11
LBB0_5:                                 ##   in Loop: Header=BB0_1 Depth=1
	movq	$0, -56(%rbp)
	movq	(%r13), %rdi
	movq	%rbx, %rsi
	movq	%r15, %rdx
	callq	_XLogReadRecord
	movq	%rax, %r12
	movq	-56(%rbp), %rdx
	testq	%rdx, %rdx
	je	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_elog
LBB0_7:                                 ##   in Loop: Header=BB0_1 Depth=1
	movq	_InvalidXLogRecPtr@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	testq	%r12, %r12
	je	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	(%r13), %rsi
	movq	%r13, %rdi
	callq	_LogicalDecodingProcessRecord
LBB0_9:                                 ##   in Loop: Header=BB0_1 Depth=1
	movq	(%r13), %rax
	cmpq	%r14, (%rax)
	jge	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_1 Depth=1
	xorl	%eax, %eax
	callq	_CHECK_FOR_INTERRUPTS
	jmp	LBB0_1
LBB0_11:
	movq	_CurrentResourceOwner@GOTPCREL(%rip), %rax
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	movl	%ecx, (%rax)
	movq	(%r13), %rax
	movq	(%rax), %rax
	movq	_InvalidXLogRecPtr@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_13
## %bb.12:
	movq	%r14, %rdi
	callq	_LogicalConfirmReceivedLocation
	xorl	%eax, %eax
	callq	_ReplicationSlotMarkDirty
LBB0_13:
	movq	_MyReplicationSlot@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	8(%rax), %rbx
	movq	%r13, %rdi
	callq	_FreeDecodingContext
	xorl	%eax, %eax
	callq	_InvalidateSystemCaches
	xorl	%eax, %eax
	callq	_PG_CATCH
	xorl	%eax, %eax
	callq	_InvalidateSystemCaches
	xorl	%eax, %eax
	callq	_PG_RE_THROW
	xorl	%eax, %eax
	callq	_PG_END_TRY
	movq	%rbx, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CurrentResourceOwner,4,2       ## @CurrentResourceOwner
	.comm	_InvalidXLogRecPtr,8,3          ## @InvalidXLogRecPtr
	.comm	_NIL,4,2                        ## @NIL
	.comm	_logical_read_local_xlog_page,4,2 ## @logical_read_local_xlog_page
	.comm	_MyReplicationSlot,8,3          ## @MyReplicationSlot
	.comm	_ERROR,4,2                      ## @ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s"

	.no_dead_strip	_pg_logical_replication_slot_advance
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pg_logical_replication_slot_advance
_pg_logical_replication_slot_advance:   ; @pg_logical_replication_slot_advance
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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, x0
Lloh0:
	adrp	x24, _CurrentResourceOwner@GOTPAGE
Lloh1:
	ldr	x24, [x24, _CurrentResourceOwner@GOTPAGEOFF]
	ldr	w25, [x24]
	bl	_PG_TRY
Lloh2:
	adrp	x26, _InvalidXLogRecPtr@GOTPAGE
Lloh3:
	ldr	x26, [x26, _InvalidXLogRecPtr@GOTPAGEOFF]
	ldr	x0, [x26]
Lloh4:
	adrp	x8, _NIL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _NIL@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
Lloh7:
	adrp	x8, _logical_read_local_xlog_page@GOTPAGE
Lloh8:
	ldr	x8, [x8, _logical_read_local_xlog_page@GOTPAGEOFF]
Lloh9:
	ldr	w3, [x8]
	mov	w2, #1
	mov	x4, #0
	mov	x5, #0
	mov	x6, #0
	bl	_CreateDecodingContext
	mov	x20, x0
Lloh10:
	adrp	x27, _MyReplicationSlot@GOTPAGE
Lloh11:
	ldr	x27, [x27, _MyReplicationSlot@GOTPAGEOFF]
	ldr	x8, [x27]
	ldr	x22, [x8]
	bl	_InvalidateSystemCaches
Lloh12:
	adrp	x28, _ERROR@GOTPAGE
Lloh13:
	ldr	x28, [x28, _ERROR@GOTPAGEOFF]
Lloh14:
	adrp	x21, l_.str@PAGE
Lloh15:
	add	x21, x21, l_.str@PAGEOFF
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x22
	bl	_XLogRecPtrIsInvalid
	cmp	x22, x19
	b.ge	LBB0_3
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	cbz	w0, LBB0_5
LBB0_3:                                 ;   in Loop: Header=BB0_1 Depth=1
	ldr	x8, [x20]
	ldr	x0, [x8]
	bl	_XLogRecPtrIsInvalid
	cbnz	w0, LBB0_11
; %bb.4:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	x8, [x20]
	ldr	x8, [x8]
	cmp	x8, x19
	b.ge	LBB0_11
LBB0_5:                                 ;   in Loop: Header=BB0_1 Depth=1
	str	xzr, [sp, #8]
	ldr	x0, [x20]
	add	x2, sp, #8
	mov	x1, x22
	bl	_XLogReadRecord
	mov	x23, x0
	ldr	x2, [sp, #8]
	cbz	x2, LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	w0, [x28]
	mov	x1, x21
	bl	_elog
LBB0_7:                                 ;   in Loop: Header=BB0_1 Depth=1
	ldr	x22, [x26]
	cbz	x23, LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	x1, [x20]
	mov	x0, x20
	bl	_LogicalDecodingProcessRecord
LBB0_9:                                 ;   in Loop: Header=BB0_1 Depth=1
	ldr	x8, [x20]
	ldr	x8, [x8]
	cmp	x8, x19
	b.ge	LBB0_11
; %bb.10:                               ;   in Loop: Header=BB0_1 Depth=1
	bl	_CHECK_FOR_INTERRUPTS
	b	LBB0_1
LBB0_11:
	str	w25, [x24]
	ldr	x8, [x20]
	ldr	x8, [x8]
	ldr	x9, [x26]
	cmp	x8, x9
	b.eq	LBB0_13
; %bb.12:
	mov	x0, x19
	bl	_LogicalConfirmReceivedLocation
	bl	_ReplicationSlotMarkDirty
LBB0_13:
	ldr	x8, [x27]
	ldr	x19, [x8, #8]
	mov	x0, x20
	bl	_FreeDecodingContext
	bl	_InvalidateSystemCaches
	bl	_PG_CATCH
	bl	_InvalidateSystemCaches
	bl	_PG_RE_THROW
	bl	_PG_END_TRY
	mov	x0, x19
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_CurrentResourceOwner,4,2       ; @CurrentResourceOwner
	.comm	_InvalidXLogRecPtr,8,3          ; @InvalidXLogRecPtr
	.comm	_NIL,4,2                        ; @NIL
	.comm	_logical_read_local_xlog_page,4,2 ; @logical_read_local_xlog_page
	.comm	_MyReplicationSlot,8,3          ; @MyReplicationSlot
	.comm	_ERROR,4,2                      ; @ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s"

	.no_dead_strip	_pg_logical_replication_slot_advance
.subsections_via_symbols
