	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_CreateSharedMemoryAndSemaphores ## -- Begin function CreateSharedMemoryAndSemaphores
	.p2align	4, 0x90
_CreateSharedMemoryAndSemaphores:       ## @CreateSharedMemoryAndSemaphores
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	$0, -32(%rbp)
	movq	_IsUnderPostmaster@GOTPCREL(%rip), %r15
	cmpl	$0, (%r15)
	je	LBB0_1
## %bb.2:
	movq	_PANIC@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	xorl	%eax, %eax
	callq	_elog
	cmpl	$0, (%r15)
	jne	LBB0_5
LBB0_4:
	xorl	%eax, %eax
	callq	_InitShmemAllocation
LBB0_5:
	xorl	%eax, %eax
	callq	_CreateLWLocks
	xorl	%eax, %eax
	callq	_InitShmemIndex
	xorl	%eax, %eax
	callq	_XLOGShmemInit
	xorl	%eax, %eax
	callq	_CLOGShmemInit
	xorl	%eax, %eax
	callq	_CommitTsShmemInit
	xorl	%eax, %eax
	callq	_SUBTRANSShmemInit
	xorl	%eax, %eax
	callq	_MultiXactShmemInit
	xorl	%eax, %eax
	callq	_InitBufferPool
	xorl	%eax, %eax
	callq	_InitLocks
	xorl	%eax, %eax
	callq	_InitPredicateLocks
	cmpl	$0, (%r15)
	jne	LBB0_7
## %bb.6:
	xorl	%eax, %eax
	callq	_InitProcGlobal
LBB0_7:
	xorl	%eax, %eax
	callq	_CreateSharedProcArray
	xorl	%eax, %eax
	callq	_CreateSharedBackendStatus
	xorl	%eax, %eax
	callq	_TwoPhaseShmemInit
	xorl	%eax, %eax
	callq	_BackgroundWorkerShmemInit
	xorl	%eax, %eax
	callq	_CreateSharedInvalidationState
	xorl	%eax, %eax
	callq	_PMSignalShmemInit
	xorl	%eax, %eax
	callq	_ProcSignalShmemInit
	xorl	%eax, %eax
	callq	_CheckpointerShmemInit
	xorl	%eax, %eax
	callq	_AutoVacuumShmemInit
	xorl	%eax, %eax
	callq	_ReplicationSlotsShmemInit
	xorl	%eax, %eax
	callq	_ReplicationOriginShmemInit
	xorl	%eax, %eax
	callq	_WalSndShmemInit
	xorl	%eax, %eax
	callq	_WalRcvShmemInit
	xorl	%eax, %eax
	callq	_ApplyLauncherShmemInit
	xorl	%eax, %eax
	callq	_SnapMgrInit
	xorl	%eax, %eax
	callq	_BTreeShmemInit
	xorl	%eax, %eax
	callq	_SyncScanShmemInit
	xorl	%eax, %eax
	callq	_AsyncShmemInit
	cmpl	$0, (%r15)
	jne	LBB0_9
## %bb.8:
	movq	-32(%rbp), %rdi
	callq	_dsm_postmaster_startup
LBB0_9:
	xorl	%eax, %eax
	callq	_shmem_startup_hook
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	xorl	%eax, %eax
	callq	_ProcGlobalSemas
	movl	%eax, %r14d
	xorl	%eax, %eax
	callq	_SpinlockSemas
	addl	%eax, %r14d
	movl	%r14d, %edi
	callq	_PGSemaphoreShmemSize
	movl	$100000, %edi                   ## imm = 0x186A0
	movl	%eax, %esi
	callq	_add_size
	movl	%eax, %ebx
	xorl	%eax, %eax
	callq	_SpinlockSemaSize
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_add_size
	movl	%eax, %ebx
	movq	_SHMEM_INDEX_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$4, %esi
	callq	_hash_estimate_size
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_add_size
	movl	%eax, %ebx
	xorl	%eax, %eax
	callq	_BufferShmemSize
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_add_size
	movl	%eax, %ebx
	xorl	%eax, %eax
	callq	_LockShmemSize
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_add_size
	movl	%eax, %ebx
	xorl	%eax, %eax
	callq	_PredicateLockShmemSize
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_add_size
	movl	%eax, %ebx
	xorl	%eax, %eax
	callq	_ProcGlobalShmemSize
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_add_size
	movl	%eax, %ebx
	xorl	%eax, %eax
	callq	_XLOGShmemSize
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_add_size
	movl	%eax, %ebx
	xorl	%eax, %eax
	callq	_CLOGShmemSize
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_add_size
	movl	%eax, %ebx
	xorl	%eax, %eax
	callq	_CommitTsShmemSize
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_add_size
	movl	%eax, %ebx
	xorl	%eax, %eax
	callq	_SUBTRANSShmemSize
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_add_size
	movl	%eax, %ebx
	xorl	%eax, %eax
	callq	_TwoPhaseShmemSize
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_add_size
	movl	%eax, %ebx
	xorl	%eax, %eax
	callq	_BackgroundWorkerShmemSize
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_add_size
	movl	%eax, %ebx
	xorl	%eax, %eax
	callq	_MultiXactShmemSize
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_add_size
	movl	%eax, %ebx
	xorl	%eax, %eax
	callq	_LWLockShmemSize
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_add_size
	movl	%eax, %ebx
	xorl	%eax, %eax
	callq	_ProcArrayShmemSize
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_add_size
	movl	%eax, %ebx
	xorl	%eax, %eax
	callq	_BackendStatusShmemSize
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_add_size
	movl	%eax, %ebx
	xorl	%eax, %eax
	callq	_SInvalShmemSize
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_add_size
	movl	%eax, %ebx
	xorl	%eax, %eax
	callq	_PMSignalShmemSize
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_add_size
	movl	%eax, %ebx
	xorl	%eax, %eax
	callq	_ProcSignalShmemSize
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_add_size
	movl	%eax, %ebx
	xorl	%eax, %eax
	callq	_CheckpointerShmemSize
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_add_size
	movl	%eax, %ebx
	xorl	%eax, %eax
	callq	_AutoVacuumShmemSize
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_add_size
	movl	%eax, %ebx
	xorl	%eax, %eax
	callq	_ReplicationSlotsShmemSize
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_add_size
	movl	%eax, %ebx
	xorl	%eax, %eax
	callq	_ReplicationOriginShmemSize
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_add_size
	movl	%eax, %ebx
	xorl	%eax, %eax
	callq	_WalSndShmemSize
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_add_size
	movl	%eax, %ebx
	xorl	%eax, %eax
	callq	_WalRcvShmemSize
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_add_size
	movl	%eax, %ebx
	xorl	%eax, %eax
	callq	_ApplyLauncherShmemSize
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_add_size
	movl	%eax, %ebx
	xorl	%eax, %eax
	callq	_SnapMgrShmemSize
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_add_size
	movl	%eax, %ebx
	xorl	%eax, %eax
	callq	_BTreeShmemSize
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_add_size
	movl	%eax, %ebx
	xorl	%eax, %eax
	callq	_SyncScanShmemSize
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_add_size
	movl	%eax, %ebx
	xorl	%eax, %eax
	callq	_AsyncShmemSize
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_add_size
	movq	_addin_request_allowed@GOTPCREL(%rip), %rcx
	movl	$0, (%rcx)
	movq	_total_addin_request@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	%eax, %edi
	callq	_add_size
                                        ## kill: def $eax killed $eax def $rax
	leal	8191(%rax), %esi
	testl	%eax, %eax
	cmovnsl	%eax, %esi
	andl	$-8192, %esi                    ## imm = 0xE000
	subl	%eax, %esi
	addl	$8192, %esi                     ## imm = 0x2000
	movl	%eax, %edi
	callq	_add_size
	movl	%eax, %ebx
	movq	_DEBUG3@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_elog
	leaq	-32(%rbp), %rsi
	movl	%ebx, %edi
	callq	_PGSharedMemoryCreate
	movq	%rax, %rdi
	callq	_InitShmemAccess
	movl	%r14d, %edi
	callq	_PGReserveSemaphores
	xorl	%eax, %eax
	callq	_SpinlockSemaInit
	cmpl	$0, (%r15)
	jne	LBB0_5
	jmp	LBB0_4
	.cfi_endproc
                                        ## -- End function
	.comm	_IsUnderPostmaster,4,2          ## @IsUnderPostmaster
	.comm	_SHMEM_INDEX_SIZE,4,2           ## @SHMEM_INDEX_SIZE
	.comm	_addin_request_allowed,4,2      ## @addin_request_allowed
	.comm	_total_addin_request,4,2        ## @total_addin_request
	.comm	_DEBUG3,4,2                     ## @DEBUG3
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"invoking IpcMemoryCreate(size=%zu)"

	.comm	_PANIC,4,2                      ## @PANIC
L_.str.1:                               ## @.str.1
	.asciz	"should be attached to shared memory already"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_CreateSharedMemoryAndSemaphores ; -- Begin function CreateSharedMemoryAndSemaphores
	.p2align	2
_CreateSharedMemoryAndSemaphores:       ; @CreateSharedMemoryAndSemaphores
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	str	xzr, [sp, #8]
Lloh0:
	adrp	x21, _IsUnderPostmaster@GOTPAGE
Lloh1:
	ldr	x21, [x21, _IsUnderPostmaster@GOTPAGEOFF]
	ldr	w8, [x21]
	cbz	w8, LBB0_8
; %bb.1:
Lloh2:
	adrp	x8, _PANIC@GOTPAGE
Lloh3:
	ldr	x8, [x8, _PANIC@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_elog
	ldr	w8, [x21]
	cbnz	w8, LBB0_3
LBB0_2:
	bl	_InitShmemAllocation
LBB0_3:
	bl	_CreateLWLocks
	bl	_InitShmemIndex
	bl	_XLOGShmemInit
	bl	_CLOGShmemInit
	bl	_CommitTsShmemInit
	bl	_SUBTRANSShmemInit
	bl	_MultiXactShmemInit
	bl	_InitBufferPool
	bl	_InitLocks
	bl	_InitPredicateLocks
	ldr	w8, [x21]
	cbnz	w8, LBB0_5
; %bb.4:
	bl	_InitProcGlobal
LBB0_5:
	bl	_CreateSharedProcArray
	bl	_CreateSharedBackendStatus
	bl	_TwoPhaseShmemInit
	bl	_BackgroundWorkerShmemInit
	bl	_CreateSharedInvalidationState
	bl	_PMSignalShmemInit
	bl	_ProcSignalShmemInit
	bl	_CheckpointerShmemInit
	bl	_AutoVacuumShmemInit
	bl	_ReplicationSlotsShmemInit
	bl	_ReplicationOriginShmemInit
	bl	_WalSndShmemInit
	bl	_WalRcvShmemInit
	bl	_ApplyLauncherShmemInit
	bl	_SnapMgrInit
	bl	_BTreeShmemInit
	bl	_SyncScanShmemInit
	bl	_AsyncShmemInit
	ldr	w8, [x21]
	cbnz	w8, LBB0_7
; %bb.6:
	ldr	x0, [sp, #8]
	bl	_dsm_postmaster_startup
LBB0_7:
	bl	_shmem_startup_hook
	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
	add	sp, sp, #64
	ret
LBB0_8:
	bl	_ProcGlobalSemas
	mov	x19, x0
	bl	_SpinlockSemas
	add	w19, w19, w0
	mov	x0, x19
	bl	_PGSemaphoreShmemSize
	mov	x1, x0
	mov	w0, #34464
	movk	w0, #1, lsl #16
	bl	_add_size
	mov	x20, x0
	bl	_SpinlockSemaSize
	mov	x1, x0
	mov	x0, x20
	bl	_add_size
	mov	x20, x0
Lloh7:
	adrp	x8, _SHMEM_INDEX_SIZE@GOTPAGE
Lloh8:
	ldr	x8, [x8, _SHMEM_INDEX_SIZE@GOTPAGEOFF]
Lloh9:
	ldr	w0, [x8]
	mov	w1, #4
	bl	_hash_estimate_size
	mov	x1, x0
	mov	x0, x20
	bl	_add_size
	mov	x20, x0
	bl	_BufferShmemSize
	mov	x1, x0
	mov	x0, x20
	bl	_add_size
	mov	x20, x0
	bl	_LockShmemSize
	mov	x1, x0
	mov	x0, x20
	bl	_add_size
	mov	x20, x0
	bl	_PredicateLockShmemSize
	mov	x1, x0
	mov	x0, x20
	bl	_add_size
	mov	x20, x0
	bl	_ProcGlobalShmemSize
	mov	x1, x0
	mov	x0, x20
	bl	_add_size
	mov	x20, x0
	bl	_XLOGShmemSize
	mov	x1, x0
	mov	x0, x20
	bl	_add_size
	mov	x20, x0
	bl	_CLOGShmemSize
	mov	x1, x0
	mov	x0, x20
	bl	_add_size
	mov	x20, x0
	bl	_CommitTsShmemSize
	mov	x1, x0
	mov	x0, x20
	bl	_add_size
	mov	x20, x0
	bl	_SUBTRANSShmemSize
	mov	x1, x0
	mov	x0, x20
	bl	_add_size
	mov	x20, x0
	bl	_TwoPhaseShmemSize
	mov	x1, x0
	mov	x0, x20
	bl	_add_size
	mov	x20, x0
	bl	_BackgroundWorkerShmemSize
	mov	x1, x0
	mov	x0, x20
	bl	_add_size
	mov	x20, x0
	bl	_MultiXactShmemSize
	mov	x1, x0
	mov	x0, x20
	bl	_add_size
	mov	x20, x0
	bl	_LWLockShmemSize
	mov	x1, x0
	mov	x0, x20
	bl	_add_size
	mov	x20, x0
	bl	_ProcArrayShmemSize
	mov	x1, x0
	mov	x0, x20
	bl	_add_size
	mov	x20, x0
	bl	_BackendStatusShmemSize
	mov	x1, x0
	mov	x0, x20
	bl	_add_size
	mov	x20, x0
	bl	_SInvalShmemSize
	mov	x1, x0
	mov	x0, x20
	bl	_add_size
	mov	x20, x0
	bl	_PMSignalShmemSize
	mov	x1, x0
	mov	x0, x20
	bl	_add_size
	mov	x20, x0
	bl	_ProcSignalShmemSize
	mov	x1, x0
	mov	x0, x20
	bl	_add_size
	mov	x20, x0
	bl	_CheckpointerShmemSize
	mov	x1, x0
	mov	x0, x20
	bl	_add_size
	mov	x20, x0
	bl	_AutoVacuumShmemSize
	mov	x1, x0
	mov	x0, x20
	bl	_add_size
	mov	x20, x0
	bl	_ReplicationSlotsShmemSize
	mov	x1, x0
	mov	x0, x20
	bl	_add_size
	mov	x20, x0
	bl	_ReplicationOriginShmemSize
	mov	x1, x0
	mov	x0, x20
	bl	_add_size
	mov	x20, x0
	bl	_WalSndShmemSize
	mov	x1, x0
	mov	x0, x20
	bl	_add_size
	mov	x20, x0
	bl	_WalRcvShmemSize
	mov	x1, x0
	mov	x0, x20
	bl	_add_size
	mov	x20, x0
	bl	_ApplyLauncherShmemSize
	mov	x1, x0
	mov	x0, x20
	bl	_add_size
	mov	x20, x0
	bl	_SnapMgrShmemSize
	mov	x1, x0
	mov	x0, x20
	bl	_add_size
	mov	x20, x0
	bl	_BTreeShmemSize
	mov	x1, x0
	mov	x0, x20
	bl	_add_size
	mov	x20, x0
	bl	_SyncScanShmemSize
	mov	x1, x0
	mov	x0, x20
	bl	_add_size
	mov	x20, x0
	bl	_AsyncShmemSize
	mov	x1, x0
	mov	x0, x20
	bl	_add_size
Lloh10:
	adrp	x8, _addin_request_allowed@GOTPAGE
Lloh11:
	ldr	x8, [x8, _addin_request_allowed@GOTPAGEOFF]
Lloh12:
	str	wzr, [x8]
Lloh13:
	adrp	x8, _total_addin_request@GOTPAGE
Lloh14:
	ldr	x8, [x8, _total_addin_request@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	bl	_add_size
	and	w8, w0, #0x1fff
	negs	w9, w0
	and	w9, w9, #0x1fff
	csneg	w8, w8, w9, mi
	mov	w9, #8192
	sub	w1, w9, w8
	bl	_add_size
	mov	x20, x0
Lloh16:
	adrp	x8, _DEBUG3@GOTPAGE
Lloh17:
	ldr	x8, [x8, _DEBUG3@GOTPAGEOFF]
Lloh18:
	ldr	w0, [x8]
	str	x20, [sp]
Lloh19:
	adrp	x1, l_.str@PAGE
Lloh20:
	add	x1, x1, l_.str@PAGEOFF
	bl	_elog
	add	x1, sp, #8
	mov	x0, x20
	bl	_PGSharedMemoryCreate
	bl	_InitShmemAccess
	mov	x0, x19
	bl	_PGReserveSemaphores
	bl	_SpinlockSemaInit
	ldr	w8, [x21]
	cbnz	w8, LBB0_3
	b	LBB0_2
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotStr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_IsUnderPostmaster,4,2          ; @IsUnderPostmaster
	.comm	_SHMEM_INDEX_SIZE,4,2           ; @SHMEM_INDEX_SIZE
	.comm	_addin_request_allowed,4,2      ; @addin_request_allowed
	.comm	_total_addin_request,4,2        ; @total_addin_request
	.comm	_DEBUG3,4,2                     ; @DEBUG3
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"invoking IpcMemoryCreate(size=%zu)"

	.comm	_PANIC,4,2                      ; @PANIC
l_.str.1:                               ; @.str.1
	.asciz	"should be attached to shared memory already"

.subsections_via_symbols
