	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_logicalrep_worker_attach       ## -- Begin function logicalrep_worker_attach
	.p2align	4, 0x90
_logicalrep_worker_attach:              ## @logicalrep_worker_attach
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edi, %ebx
	movq	_LogicalRepWorkerLock@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	movq	_LW_EXCLUSIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_LWLockAcquire
	testl	%ebx, %ebx
	setns	%al
	movq	_max_logical_replication_workers@GOTPCREL(%rip), %rcx
	cmpl	%ebx, (%rcx)
	setg	%cl
	andb	%al, %cl
	movzbl	%cl, %edi
	callq	_Assert
	movq	_LogicalRepCtx@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%rax), %rcx
	movslq	%ebx, %rdx
	shlq	$4, %rdx
	leaq	(%rcx,%rdx), %rax
	movq	_MyLogicalRepWorker@GOTPCREL(%rip), %r12
	movq	%rax, (%r12)
	cmpl	$0, 8(%rcx,%rdx)
	je	LBB0_1
## %bb.2:
	cmpq	$0, (%rax)
	je	LBB0_4
LBB0_3:
	movl	(%r15), %edi
	callq	_LWLockRelease
	movq	_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	_ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_errcode
	leaq	L_.str.1(%rip), %rdi
	movl	%ebx, %esi
	callq	_errmsg
	movl	%r14d, %edi
	movl	%eax, %esi
	callq	_ereport
	movq	(%r12), %rax
LBB0_4:
	movq	_MyProc@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	%rcx, (%rax)
	movq	_logicalrep_worker_onexit@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	xorl	%esi, %esi
	callq	_before_shmem_exit
	movl	(%r15), %edi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_LWLockRelease                  ## TAILCALL
LBB0_1:
	movl	(%r15), %edi
	callq	_LWLockRelease
	movq	_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	_ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_errcode
	leaq	L_.str(%rip), %rdi
	movl	%ebx, %esi
	callq	_errmsg
	movl	%r14d, %edi
	movl	%eax, %esi
	callq	_ereport
	movq	(%r12), %rax
	cmpq	$0, (%rax)
	jne	LBB0_3
	jmp	LBB0_4
	.cfi_endproc
                                        ## -- End function
	.comm	_LogicalRepWorkerLock,4,2       ## @LogicalRepWorkerLock
	.comm	_LW_EXCLUSIVE,4,2               ## @LW_EXCLUSIVE
	.comm	_max_logical_replication_workers,4,2 ## @max_logical_replication_workers
	.comm	_LogicalRepCtx,8,3              ## @LogicalRepCtx
	.comm	_MyLogicalRepWorker,8,3         ## @MyLogicalRepWorker
	.comm	_ERROR,4,2                      ## @ERROR
	.comm	_ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE,4,2 ## @ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"logical replication worker slot %d is empty, cannot attach"

L_.str.1:                               ## @.str.1
	.asciz	"logical replication worker slot %d is already used by another worker, cannot attach"

	.comm	_MyProc,8,3                     ## @MyProc
	.comm	_logicalrep_worker_onexit,4,2   ## @logicalrep_worker_onexit
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_logicalrep_worker_attach       ; -- Begin function logicalrep_worker_attach
	.p2align	2
_logicalrep_worker_attach:              ; @logicalrep_worker_attach
	.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
	mov	x19, x0
Lloh0:
	adrp	x21, _LogicalRepWorkerLock@GOTPAGE
Lloh1:
	ldr	x21, [x21, _LogicalRepWorkerLock@GOTPAGEOFF]
	ldr	w0, [x21]
Lloh2:
	adrp	x8, _LW_EXCLUSIVE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _LW_EXCLUSIVE@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	bl	_LWLockAcquire
	cmp	w19, #0
Lloh5:
	adrp	x8, _max_logical_replication_workers@GOTPAGE
Lloh6:
	ldr	x8, [x8, _max_logical_replication_workers@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	ccmp	w8, w19, #4, ge
	cset	w0, gt
	bl	_Assert
Lloh8:
	adrp	x8, _LogicalRepCtx@GOTPAGE
Lloh9:
	ldr	x8, [x8, _LogicalRepCtx@GOTPAGEOFF]
Lloh10:
	ldr	x8, [x8]
	ldr	x8, [x8]
	add	x8, x8, w19, sxtw #4
Lloh11:
	adrp	x22, _MyLogicalRepWorker@GOTPAGE
Lloh12:
	ldr	x22, [x22, _MyLogicalRepWorker@GOTPAGEOFF]
	str	x8, [x22]
	ldr	w9, [x8, #8]
Lloh13:
	adrp	x23, _ERROR@GOTPAGE
Lloh14:
	ldr	x23, [x23, _ERROR@GOTPAGEOFF]
Lloh15:
	adrp	x24, _ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE@GOTPAGE
Lloh16:
	ldr	x24, [x24, _ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE@GOTPAGEOFF]
	cbz	w9, LBB0_4
; %bb.1:
	ldr	x9, [x8]
	cbz	x9, LBB0_3
LBB0_2:
	ldr	w0, [x21]
	bl	_LWLockRelease
	ldr	w20, [x23]
	ldr	w0, [x24]
	bl	_errcode
Lloh17:
	adrp	x0, l_.str.1@PAGE
Lloh18:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x19
	bl	_errmsg
	mov	x1, x0
	mov	x0, x20
	bl	_ereport
	ldr	x8, [x22]
LBB0_3:
Lloh19:
	adrp	x9, _MyProc@GOTPAGE
Lloh20:
	ldr	x9, [x9, _MyProc@GOTPAGEOFF]
Lloh21:
	ldr	x9, [x9]
	str	x9, [x8]
Lloh22:
	adrp	x8, _logicalrep_worker_onexit@GOTPAGE
Lloh23:
	ldr	x8, [x8, _logicalrep_worker_onexit@GOTPAGEOFF]
Lloh24:
	ldr	w0, [x8]
	mov	w1, #0
	bl	_before_shmem_exit
	ldr	w0, [x21]
	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	_LWLockRelease
LBB0_4:
	ldr	w0, [x21]
	bl	_LWLockRelease
	ldr	w20, [x23]
	ldr	w0, [x24]
	bl	_errcode
Lloh25:
	adrp	x0, l_.str@PAGE
Lloh26:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x19
	bl	_errmsg
	mov	x1, x0
	mov	x0, x20
	bl	_ereport
	ldr	x8, [x22]
	ldr	x9, [x8]
	cbnz	x9, LBB0_2
	b	LBB0_3
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_LogicalRepWorkerLock,4,2       ; @LogicalRepWorkerLock
	.comm	_LW_EXCLUSIVE,4,2               ; @LW_EXCLUSIVE
	.comm	_max_logical_replication_workers,4,2 ; @max_logical_replication_workers
	.comm	_LogicalRepCtx,8,3              ; @LogicalRepCtx
	.comm	_MyLogicalRepWorker,8,3         ; @MyLogicalRepWorker
	.comm	_ERROR,4,2                      ; @ERROR
	.comm	_ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE,4,2 ; @ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"logical replication worker slot %d is empty, cannot attach"

l_.str.1:                               ; @.str.1
	.asciz	"logical replication worker slot %d is already used by another worker, cannot attach"

	.comm	_MyProc,8,3                     ; @MyProc
	.comm	_logicalrep_worker_onexit,4,2   ; @logicalrep_worker_onexit
.subsections_via_symbols
