	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function GetSafeSnapshot
_GetSafeSnapshot:                       ## @GetSafeSnapshot
	.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	_XactReadOnly@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	setne	%al
	movq	_XactDeferrable@GOTPCREL(%rip), %rcx
	cmpq	$0, (%rcx)
	movl	%edi, %ebx
	setne	%cl
	andb	%al, %cl
	movzbl	%cl, %edi
	callq	_Assert
	movq	_InvalidPid@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%ebx, -48(%rbp)                 ## 4-byte Spill
	movl	%ebx, %edi
	xorl	%esi, %esi
	callq	_GetSerializableTransactionSnapshotInt
	movq	_MySerializableXact@GOTPCREL(%rip), %r14
	movq	(%r14), %rdx
	movq	_InvalidSerializableXact@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rdx
	je	LBB0_9
## %bb.1:
	movq	_SerializableXactHashLock@GOTPCREL(%rip), %rbx
	movq	_LW_EXCLUSIVE@GOTPCREL(%rip), %r13
	movq	_SXACT_FLAG_DEFERRABLE_WAITING@GOTPCREL(%rip), %r12
	movq	_WAIT_EVENT_SAFE_SNAPSHOT@GOTPCREL(%rip), %r15
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_3 Depth 2
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	(%rbx), %edi
	movl	(%r13), %esi
	callq	_LWLockAcquire
	movl	(%r12), %eax
	movq	(%r14), %rdi
	orl	%eax, (%rdi)
	.p2align	4, 0x90
LBB0_3:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	addq	$4, %rdi
	callq	_SHMQueueEmpty
	testq	%rax, %rax
	jne	LBB0_6
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=2
	movq	(%r14), %rdi
	callq	_SxactIsROUnsafe
	testq	%rax, %rax
	jne	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=2
	movl	(%rbx), %edi
	callq	_LWLockRelease
	movl	(%r15), %edi
	callq	_ProcWaitForSignal
	movl	(%rbx), %edi
	movl	(%r13), %esi
	callq	_LWLockAcquire
	movq	(%r14), %rdi
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	%r12, %r15
	movl	(%r12), %eax
	notl	%eax
	movq	(%r14), %rdi
	andl	%eax, (%rdi)
	callq	_SxactIsROUnsafe
	movq	%rax, %r12
	movl	(%rbx), %edi
	callq	_LWLockRelease
	testq	%r12, %r12
	je	LBB0_7
## %bb.8:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	_DEBUG2@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_ERRCODE_T_R_SERIALIZATION_FAILURE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_errcode
	leaq	L_.str(%rip), %rdi
	callq	_errmsg
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_ereport
	xorl	%edi, %edi
	xorl	%esi, %esi
	callq	_ReleasePredicateLocks
	movq	_InvalidPid@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	-48(%rbp), %edi                 ## 4-byte Reload
	xorl	%esi, %esi
	callq	_GetSerializableTransactionSnapshotInt
	movq	(%r14), %rdx
	movq	_InvalidSerializableXact@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rdx
	movq	%r15, %r12
	movq	_WAIT_EVENT_SAFE_SNAPSHOT@GOTPCREL(%rip), %r15
	movq	_SerializableXactHashLock@GOTPCREL(%rip), %rbx
	jne	LBB0_2
	jmp	LBB0_9
LBB0_7:
	movq	(%r14), %rdi
	callq	_SxactIsROSafe
	movl	%eax, %edi
	callq	_Assert
	xorl	%edi, %edi
	movl	$1, %esi
	callq	_ReleasePredicateLocks
	movl	-44(%rbp), %eax                 ## 4-byte Reload
LBB0_9:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_XactReadOnly,8,3               ## @XactReadOnly
	.comm	_XactDeferrable,8,3             ## @XactDeferrable
	.comm	_InvalidPid,4,2                 ## @InvalidPid
	.comm	_MySerializableXact,8,3         ## @MySerializableXact
	.comm	_InvalidSerializableXact,8,3    ## @InvalidSerializableXact
	.comm	_SerializableXactHashLock,4,2   ## @SerializableXactHashLock
	.comm	_LW_EXCLUSIVE,4,2               ## @LW_EXCLUSIVE
	.comm	_SXACT_FLAG_DEFERRABLE_WAITING,4,2 ## @SXACT_FLAG_DEFERRABLE_WAITING
	.comm	_WAIT_EVENT_SAFE_SNAPSHOT,4,2   ## @WAIT_EVENT_SAFE_SNAPSHOT
	.comm	_DEBUG2,4,2                     ## @DEBUG2
	.comm	_ERRCODE_T_R_SERIALIZATION_FAILURE,4,2 ## @ERRCODE_T_R_SERIALIZATION_FAILURE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"deferrable snapshot was unsafe; trying a new one"

	.no_dead_strip	_GetSafeSnapshot
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function GetSafeSnapshot
_GetSafeSnapshot:                       ; @GetSafeSnapshot
	.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, x0
Lloh0:
	adrp	x8, _XactReadOnly@GOTPAGE
Lloh1:
	ldr	x8, [x8, _XactReadOnly@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x8, #0
Lloh3:
	adrp	x8, _XactDeferrable@GOTPAGE
Lloh4:
	ldr	x8, [x8, _XactDeferrable@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	ccmp	x8, #0, #4, ne
	cset	w0, ne
	bl	_Assert
Lloh6:
	adrp	x8, _InvalidPid@GOTPAGE
Lloh7:
	ldr	x8, [x8, _InvalidPid@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x1, #0
	bl	_GetSerializableTransactionSnapshotInt
	mov	x20, x0
Lloh9:
	adrp	x24, _MySerializableXact@GOTPAGE
Lloh10:
	ldr	x24, [x24, _MySerializableXact@GOTPAGEOFF]
	ldr	x8, [x24]
Lloh11:
	adrp	x25, _InvalidSerializableXact@GOTPAGE
Lloh12:
	ldr	x25, [x25, _InvalidSerializableXact@GOTPAGEOFF]
	ldr	x9, [x25]
	cmp	x8, x9
	b.eq	LBB0_8
; %bb.1:
Lloh13:
	adrp	x26, _SerializableXactHashLock@GOTPAGE
Lloh14:
	ldr	x26, [x26, _SerializableXactHashLock@GOTPAGEOFF]
Lloh15:
	adrp	x27, _LW_EXCLUSIVE@GOTPAGE
Lloh16:
	ldr	x27, [x27, _LW_EXCLUSIVE@GOTPAGEOFF]
Lloh17:
	adrp	x28, _SXACT_FLAG_DEFERRABLE_WAITING@GOTPAGE
Lloh18:
	ldr	x28, [x28, _SXACT_FLAG_DEFERRABLE_WAITING@GOTPAGEOFF]
Lloh19:
	adrp	x23, _WAIT_EVENT_SAFE_SNAPSHOT@GOTPAGE
Lloh20:
	ldr	x23, [x23, _WAIT_EVENT_SAFE_SNAPSHOT@GOTPAGEOFF]
Lloh21:
	adrp	x21, l_.str@PAGE
Lloh22:
	add	x21, x21, l_.str@PAGEOFF
LBB0_2:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_3 Depth 2
	ldr	w0, [x26]
	ldr	w1, [x27]
	bl	_LWLockAcquire
	ldr	w8, [x28]
	ldr	x0, [x24]
	ldr	w9, [x0]
	orr	w8, w9, w8
	str	w8, [x0], #4
	bl	_SHMQueueEmpty
	cbnz	x0, LBB0_5
LBB0_3:                                 ;   Parent Loop BB0_2 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x0, [x24]
	bl	_SxactIsROUnsafe
	cbnz	x0, LBB0_5
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=2
	ldr	w0, [x26]
	bl	_LWLockRelease
	ldr	w0, [x23]
	bl	_ProcWaitForSignal
	ldr	w0, [x26]
	ldr	w1, [x27]
	bl	_LWLockAcquire
	ldr	x8, [x24]
	add	x0, x8, #4
	bl	_SHMQueueEmpty
	cbz	x0, LBB0_3
LBB0_5:                                 ;   in Loop: Header=BB0_2 Depth=1
	ldr	w8, [x28]
	ldr	x0, [x24]
	ldr	w9, [x0]
	bic	w8, w9, w8
	str	w8, [x0]
	bl	_SxactIsROUnsafe
	mov	x22, x0
	ldr	w0, [x26]
	bl	_LWLockRelease
	cbz	x22, LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_2 Depth=1
Lloh23:
	adrp	x8, _DEBUG2@GOTPAGE
Lloh24:
	ldr	x8, [x8, _DEBUG2@GOTPAGEOFF]
Lloh25:
	ldr	w20, [x8]
Lloh26:
	adrp	x8, _ERRCODE_T_R_SERIALIZATION_FAILURE@GOTPAGE
Lloh27:
	ldr	x8, [x8, _ERRCODE_T_R_SERIALIZATION_FAILURE@GOTPAGEOFF]
Lloh28:
	ldr	w0, [x8]
	bl	_errcode
	mov	x0, x21
	bl	_errmsg
	mov	x1, x0
	mov	x0, x20
	bl	_ereport
	mov	w0, #0
	mov	w1, #0
	bl	_ReleasePredicateLocks
Lloh29:
	adrp	x8, _InvalidPid@GOTPAGE
Lloh30:
	ldr	x8, [x8, _InvalidPid@GOTPAGEOFF]
Lloh31:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x1, #0
	bl	_GetSerializableTransactionSnapshotInt
	mov	x20, x0
	ldr	x8, [x24]
	ldr	x9, [x25]
	cmp	x8, x9
	b.ne	LBB0_2
	b	LBB0_8
LBB0_7:
	ldr	x0, [x24]
	bl	_SxactIsROSafe
	bl	_Assert
	mov	w0, #0
	mov	w1, #1
	bl	_ReleasePredicateLocks
LBB0_8:
	mov	x0, x20
	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	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_XactReadOnly,8,3               ; @XactReadOnly
	.comm	_XactDeferrable,8,3             ; @XactDeferrable
	.comm	_InvalidPid,4,2                 ; @InvalidPid
	.comm	_MySerializableXact,8,3         ; @MySerializableXact
	.comm	_InvalidSerializableXact,8,3    ; @InvalidSerializableXact
	.comm	_SerializableXactHashLock,4,2   ; @SerializableXactHashLock
	.comm	_LW_EXCLUSIVE,4,2               ; @LW_EXCLUSIVE
	.comm	_SXACT_FLAG_DEFERRABLE_WAITING,4,2 ; @SXACT_FLAG_DEFERRABLE_WAITING
	.comm	_WAIT_EVENT_SAFE_SNAPSHOT,4,2   ; @WAIT_EVENT_SAFE_SNAPSHOT
	.comm	_DEBUG2,4,2                     ; @DEBUG2
	.comm	_ERRCODE_T_R_SERIALIZATION_FAILURE,4,2 ; @ERRCODE_T_R_SERIALIZATION_FAILURE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"deferrable snapshot was unsafe; trying a new one"

	.no_dead_strip	_GetSafeSnapshot
.subsections_via_symbols
