	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ReplicationSlotAcquire         ## -- Begin function ReplicationSlotAcquire
	.p2align	4, 0x90
_ReplicationSlotAcquire:                ## @ReplicationSlotAcquire
	.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
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	movq	%rdi, %r13
	movq	_ReplicationSlotControlLock@GOTPCREL(%rip), %r14
	jmp	LBB0_1
	.p2align	4, 0x90
LBB0_17:                                ##   in Loop: Header=BB0_1 Depth=1
	addq	$4, %rbx
	movq	_WAIT_EVENT_REPLICATION_SLOT_DROP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_ConditionVariableSleep
	xorl	%eax, %eax
	callq	_ConditionVariableCancelSleep
LBB0_1:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_3 Depth 2
	movq	_max_replication_slots@GOTPCREL(%rip), %r12
	xorl	%edi, %edi
	movq	_MyReplicationSlot@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	sete	%dil
	callq	_Assert
	movl	(%r14), %edi
	movq	_LW_SHARED@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_LWLockAcquire
	movl	(%r12), %eax
	testl	%eax, %eax
	jle	LBB0_7
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	xorl	%r15d, %r15d
	xorl	%ebx, %ebx
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_3 Depth=2
	incq	%rbx
	movslq	%eax, %rcx
	addq	$24, %r15
	cmpq	%rcx, %rbx
	jge	LBB0_7
LBB0_3:                                 ##   Parent Loop BB0_1 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	_ReplicationSlotCtl@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	(%rcx), %r14
	cmpq	$0, 16(%r14,%r15)
	je	LBB0_6
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=2
	movl	12(%r14,%r15), %edi
	callq	_NameStr
	movq	%r13, %rdi
	movl	%eax, %esi
	callq	_strcmp
	testq	%rax, %rax
	je	LBB0_8
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=2
	movl	(%r12), %eax
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_1 Depth=1
	movq	_ReplicationSlotControlLock@GOTPCREL(%rip), %r14
	movl	(%r14), %edi
	callq	_LWLockRelease
	movq	_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movq	_ERRCODE_UNDEFINED_OBJECT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_errcode
	xorl	%ebx, %ebx
	leaq	L_.str(%rip), %rdi
	movq	%r13, %rsi
	xorl	%eax, %eax
	callq	_errmsg
	movl	%r15d, %edi
	movl	%eax, %esi
	callq	_ereport
	xorl	%r12d, %r12d
	jmp	LBB0_14
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_1 Depth=1
	leaq	(%r14,%r15), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	_IsUnderPostmaster@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_12
## %bb.9:                               ##   in Loop: Header=BB0_1 Depth=1
	leaq	(%r14,%r15), %rdi
	addq	$4, %rdi
	callq	_ConditionVariablePrepareToSleep
	leaq	(%r14,%r15), %rbx
	addq	$8, %rbx
	movq	%rbx, %rdi
	callq	_SpinLockAcquire
	movl	(%r14,%r15), %r12d
	testl	%r12d, %r12d
	jne	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_1 Depth=1
	movq	_MyProcPid@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movl	%r12d, (%r14,%r15)
LBB0_11:                                ##   in Loop: Header=BB0_1 Depth=1
	movq	%rbx, %rdi
	callq	_SpinLockRelease
	jmp	LBB0_13
LBB0_12:                                ##   in Loop: Header=BB0_1 Depth=1
	movq	_MyProcPid@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
LBB0_13:                                ##   in Loop: Header=BB0_1 Depth=1
	movq	_ReplicationSlotControlLock@GOTPCREL(%rip), %r14
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movl	(%r14), %edi
	callq	_LWLockRelease
LBB0_14:                                ##   in Loop: Header=BB0_1 Depth=1
	movq	_MyProcPid@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r12d
	je	LBB0_18
## %bb.15:                              ##   in Loop: Header=BB0_1 Depth=1
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_17
## %bb.16:                              ##   in Loop: Header=BB0_1 Depth=1
	movq	_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movq	_ERRCODE_OBJECT_IN_USE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_errcode
	leaq	L_.str.1(%rip), %rdi
	movq	%r13, %rsi
	movl	%r12d, %edx
	xorl	%eax, %eax
	callq	_errmsg
	movl	%r15d, %edi
	movl	%eax, %esi
	callq	_ereport
	jmp	LBB0_17
LBB0_18:
	xorl	%eax, %eax
	callq	_ConditionVariableCancelSleep
	leaq	4(%rbx), %rdi
	callq	_ConditionVariableBroadcast
	movq	_MyReplicationSlot@GOTPCREL(%rip), %rax
	movq	%rbx, (%rax)
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MyReplicationSlot,8,3          ## @MyReplicationSlot
	.comm	_ReplicationSlotControlLock,4,2 ## @ReplicationSlotControlLock
	.comm	_LW_SHARED,4,2                  ## @LW_SHARED
	.comm	_max_replication_slots,4,2      ## @max_replication_slots
	.comm	_ReplicationSlotCtl,8,3         ## @ReplicationSlotCtl
	.comm	_IsUnderPostmaster,8,3          ## @IsUnderPostmaster
	.comm	_MyProcPid,4,2                  ## @MyProcPid
	.comm	_ERROR,4,2                      ## @ERROR
	.comm	_ERRCODE_UNDEFINED_OBJECT,4,2   ## @ERRCODE_UNDEFINED_OBJECT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"replication slot \"%s\" does not exist"

	.comm	_ERRCODE_OBJECT_IN_USE,4,2      ## @ERRCODE_OBJECT_IN_USE
L_.str.1:                               ## @.str.1
	.asciz	"replication slot \"%s\" is active for PID %d"

	.comm	_WAIT_EVENT_REPLICATION_SLOT_DROP,4,2 ## @WAIT_EVENT_REPLICATION_SLOT_DROP
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ReplicationSlotAcquire         ; -- Begin function ReplicationSlotAcquire
	.p2align	2
_ReplicationSlotAcquire:                ; @ReplicationSlotAcquire
	.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, x1
	mov	x20, x0
Lloh0:
	adrp	x25, _ReplicationSlotControlLock@GOTPAGE
Lloh1:
	ldr	x25, [x25, _ReplicationSlotControlLock@GOTPAGEOFF]
Lloh2:
	adrp	x27, _max_replication_slots@GOTPAGE
Lloh3:
	ldr	x27, [x27, _max_replication_slots@GOTPAGEOFF]
Lloh4:
	adrp	x28, _ReplicationSlotCtl@GOTPAGE
Lloh5:
	ldr	x28, [x28, _ReplicationSlotCtl@GOTPAGEOFF]
	b	LBB0_2
LBB0_1:                                 ;   in Loop: Header=BB0_2 Depth=1
	add	x0, x26, #4
Lloh6:
	adrp	x8, _WAIT_EVENT_REPLICATION_SLOT_DROP@GOTPAGE
Lloh7:
	ldr	x8, [x8, _WAIT_EVENT_REPLICATION_SLOT_DROP@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	bl	_ConditionVariableSleep
	bl	_ConditionVariableCancelSleep
LBB0_2:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_5 Depth 2
Lloh9:
	adrp	x8, _MyReplicationSlot@GOTPAGE
Lloh10:
	ldr	x8, [x8, _MyReplicationSlot@GOTPAGEOFF]
Lloh11:
	ldr	x8, [x8]
	cmp	x8, #0
	cset	w0, eq
	bl	_Assert
	ldr	w0, [x25]
Lloh12:
	adrp	x8, _LW_SHARED@GOTPAGE
Lloh13:
	ldr	x8, [x8, _LW_SHARED@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	bl	_LWLockAcquire
	ldr	w8, [x27]
	cmp	w8, #1
	b.lt	LBB0_8
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x24, #0
	mov	x22, #0
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=2
	add	x22, x22, #1
	add	x24, x24, #24
	cmp	x22, w8, sxtw
	b.ge	LBB0_8
LBB0_5:                                 ;   Parent Loop BB0_2 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x9, [x28]
	ldr	x21, [x9]
	add	x9, x21, x24
	ldr	x10, [x9, #16]
	cbz	x10, LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=2
	ldr	w0, [x9, #12]
	bl	_NameStr
	mov	x1, x0
	mov	x0, x20
	bl	_strcmp
	cbz	x0, LBB0_9
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=2
	ldr	w8, [x27]
	b	LBB0_4
LBB0_8:                                 ;   in Loop: Header=BB0_2 Depth=1
	ldr	w0, [x25]
	bl	_LWLockRelease
Lloh15:
	adrp	x8, _ERROR@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ERROR@GOTPAGEOFF]
Lloh17:
	ldr	w23, [x8]
Lloh18:
	adrp	x8, _ERRCODE_UNDEFINED_OBJECT@GOTPAGE
Lloh19:
	ldr	x8, [x8, _ERRCODE_UNDEFINED_OBJECT@GOTPAGEOFF]
Lloh20:
	ldr	w0, [x8]
	bl	_errcode
Lloh21:
	adrp	x0, l_.str@PAGE
Lloh22:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x20
	bl	_errmsg
	mov	x1, x0
	mov	x0, x23
	bl	_ereport
	mov	x26, #0
	mov	w22, #0
	b	LBB0_15
LBB0_9:                                 ;   in Loop: Header=BB0_2 Depth=1
	add	x26, x21, x24
Lloh23:
	adrp	x8, _IsUnderPostmaster@GOTPAGE
Lloh24:
	ldr	x8, [x8, _IsUnderPostmaster@GOTPAGEOFF]
Lloh25:
	ldr	x8, [x8]
	cbz	x8, LBB0_13
; %bb.10:                               ;   in Loop: Header=BB0_2 Depth=1
	add	x0, x26, #4
	bl	_ConditionVariablePrepareToSleep
	add	x23, x26, #8
	mov	x0, x23
	bl	_SpinLockAcquire
	ldr	w22, [x26]
	cbnz	w22, LBB0_12
; %bb.11:                               ;   in Loop: Header=BB0_2 Depth=1
Lloh26:
	adrp	x8, _MyProcPid@GOTPAGE
Lloh27:
	ldr	x8, [x8, _MyProcPid@GOTPAGEOFF]
Lloh28:
	ldr	w22, [x8]
	str	w22, [x21, x24]
LBB0_12:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x0, x23
	bl	_SpinLockRelease
	b	LBB0_14
LBB0_13:                                ;   in Loop: Header=BB0_2 Depth=1
Lloh29:
	adrp	x8, _MyProcPid@GOTPAGE
Lloh30:
	ldr	x8, [x8, _MyProcPid@GOTPAGEOFF]
Lloh31:
	ldr	w22, [x8]
LBB0_14:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	w0, [x25]
	bl	_LWLockRelease
LBB0_15:                                ;   in Loop: Header=BB0_2 Depth=1
Lloh32:
	adrp	x8, _MyProcPid@GOTPAGE
Lloh33:
	ldr	x8, [x8, _MyProcPid@GOTPAGEOFF]
Lloh34:
	ldr	w8, [x8]
	cmp	w22, w8
	b.eq	LBB0_18
; %bb.16:                               ;   in Loop: Header=BB0_2 Depth=1
	cbz	w19, LBB0_1
; %bb.17:                               ;   in Loop: Header=BB0_2 Depth=1
Lloh35:
	adrp	x8, _ERROR@GOTPAGE
Lloh36:
	ldr	x8, [x8, _ERROR@GOTPAGEOFF]
Lloh37:
	ldr	w23, [x8]
Lloh38:
	adrp	x8, _ERRCODE_OBJECT_IN_USE@GOTPAGE
Lloh39:
	ldr	x8, [x8, _ERRCODE_OBJECT_IN_USE@GOTPAGEOFF]
Lloh40:
	ldr	w0, [x8]
	bl	_errcode
	str	x22, [sp]
Lloh41:
	adrp	x0, l_.str.1@PAGE
Lloh42:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x20
	bl	_errmsg
	mov	x1, x0
	mov	x0, x23
	bl	_ereport
	b	LBB0_1
LBB0_18:
	bl	_ConditionVariableCancelSleep
	add	x0, x26, #4
	bl	_ConditionVariableBroadcast
Lloh43:
	adrp	x8, _MyReplicationSlot@GOTPAGE
Lloh44:
	ldr	x8, [x8, _MyReplicationSlot@GOTPAGEOFF]
Lloh45:
	str	x26, [x8]
	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 AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpAdd	Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotStr	Lloh43, Lloh44, Lloh45
	.cfi_endproc
                                        ; -- End function
	.comm	_MyReplicationSlot,8,3          ; @MyReplicationSlot
	.comm	_ReplicationSlotControlLock,4,2 ; @ReplicationSlotControlLock
	.comm	_LW_SHARED,4,2                  ; @LW_SHARED
	.comm	_max_replication_slots,4,2      ; @max_replication_slots
	.comm	_ReplicationSlotCtl,8,3         ; @ReplicationSlotCtl
	.comm	_IsUnderPostmaster,8,3          ; @IsUnderPostmaster
	.comm	_MyProcPid,4,2                  ; @MyProcPid
	.comm	_ERROR,4,2                      ; @ERROR
	.comm	_ERRCODE_UNDEFINED_OBJECT,4,2   ; @ERRCODE_UNDEFINED_OBJECT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"replication slot \"%s\" does not exist"

	.comm	_ERRCODE_OBJECT_IN_USE,4,2      ; @ERRCODE_OBJECT_IN_USE
l_.str.1:                               ; @.str.1
	.asciz	"replication slot \"%s\" is active for PID %d"

	.comm	_WAIT_EVENT_REPLICATION_SLOT_DROP,4,2 ; @WAIT_EVENT_REPLICATION_SLOT_DROP
.subsections_via_symbols
