	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_dsm_create                     ## -- Begin function dsm_create
	.p2align	4, 0x90
_dsm_create:                            ## @dsm_create
	.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
	movl	%edi, %r13d
	movq	_IsUnderPostmaster@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_Assert
	movq	_dsm_init_done@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jne	LBB0_2
## %bb.1:
	xorl	%eax, %eax
	callq	_dsm_backend_startup
LBB0_2:
	xorl	%eax, %eax
	callq	_dsm_create_descriptor
	movq	%rax, %r15
	leaq	40(%rax), %rbx
	leaq	48(%rax), %r12
	movq	_DSM_HANDLE_INVALID@GOTPCREL(%rip), %r14
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	$0, (%rbx)
	je	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	xorl	%eax, %eax
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_3 Depth=1
	cmpq	$0, (%r15)
	sete	%al
LBB0_6:                                 ##   in Loop: Header=BB0_3 Depth=1
	movzbl	%al, %edi
	callq	_Assert
	xorl	%eax, %eax
	callq	_random
	movq	%rax, 8(%r15)
	cmpq	(%r14), %rax
	je	LBB0_3
## %bb.7:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	_DSM_OP_CREATE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	movq	_ERROR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, (%rsp)
	movq	%rax, %rsi
	movl	%r13d, %edx
	movq	%r12, %rcx
	movq	%rbx, %r8
	movq	%r15, %r9
	callq	_dsm_impl_op
	testq	%rax, %rax
	je	LBB0_3
## %bb.8:
	movq	_DynamicSharedMemoryControlLock@GOTPCREL(%rip), %r14
	movl	(%r14), %edi
	movq	_LW_EXCLUSIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_LWLockAcquire
	movq	_dsm_control@GOTPCREL(%rip), %rdi
	movq	(%rdi), %rax
	movq	(%rax), %r13
	testq	%r13, %r13
	je	LBB0_13
## %bb.9:
	movq	16(%rax), %rdx
	xorl	%ecx, %ecx
	xorl	%esi, %esi
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	cmpl	$0, (%rdx,%rcx)
	je	LBB0_11
## %bb.12:                              ##   in Loop: Header=BB0_10 Depth=1
	incq	%rsi
	addq	$32, %rcx
	cmpq	%rsi, %r13
	jne	LBB0_10
LBB0_13:
	cmpq	8(%rax), %r13
	jb	LBB0_19
## %bb.14:
	movq	_DSM_CREATE_NULL_IF_MAXSEGMENTS@GOTPCREL(%rip), %rax
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	testl	%ecx, (%rax)
	je	LBB0_18
## %bb.15:
	movl	(%r14), %edi
	callq	_LWLockRelease
	movq	_DSM_OP_DESTROY@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	8(%r15), %rsi
	movq	_WARNING@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rsp)
	xorl	%edx, %edx
	movq	%r12, %rcx
	movq	%rbx, %r8
	movq	%r15, %r9
	callq	_dsm_impl_op
	movq	32(%r15), %rdi
	testq	%rdi, %rdi
	je	LBB0_17
## %bb.16:
	movq	%r15, %rsi
	callq	_ResourceOwnerForgetDSM
LBB0_17:
	movq	%r15, %rdi
	addq	$24, %rdi
	callq	_dlist_delete
	movq	%r15, %rdi
	callq	_pfree
	xorl	%r15d, %r15d
	jmp	LBB0_21
LBB0_11:
	movq	8(%r15), %rax
	movq	%rax, 8(%rdx,%rcx)
	movl	$2, (%rdx,%rcx)
	movq	$0, 24(%rdx,%rcx)
	movq	(%rdi), %rax
	movq	16(%rax), %rax
	movl	$0, 16(%rax,%rcx)
	movq	%rsi, 16(%r15)
	jmp	LBB0_20
LBB0_18:
	movq	_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_ERRCODE_INSUFFICIENT_RESOURCES@GOTPCREL(%rip), %rax
	movq	%rdi, %r12
	movl	(%rax), %edi
	callq	_errcode
	leaq	L_.str(%rip), %rdi
	callq	_errmsg
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_ereport
	movq	%r12, %rdi
	movq	(%r12), %rax
LBB0_19:
	movq	8(%r15), %rcx
	movq	16(%rax), %rax
	movq	%r13, %rdx
	shlq	$5, %rdx
	movq	%rcx, 8(%rax,%rdx)
	movl	$2, (%rax,%rdx)
	movq	$0, 24(%rax,%rdx)
	movq	(%rdi), %rax
	movq	16(%rax), %rcx
	movl	$0, 16(%rcx,%rdx)
	movq	%r13, 16(%r15)
	incq	(%rax)
LBB0_20:
	movl	(%r14), %edi
	callq	_LWLockRelease
LBB0_21:
	movq	%r15, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IsUnderPostmaster,4,2          ## @IsUnderPostmaster
	.comm	_dsm_init_done,4,2              ## @dsm_init_done
	.comm	_DSM_HANDLE_INVALID,8,3         ## @DSM_HANDLE_INVALID
	.comm	_DSM_OP_CREATE,4,2              ## @DSM_OP_CREATE
	.comm	_ERROR,4,2                      ## @ERROR
	.comm	_DynamicSharedMemoryControlLock,4,2 ## @DynamicSharedMemoryControlLock
	.comm	_LW_EXCLUSIVE,4,2               ## @LW_EXCLUSIVE
	.comm	_dsm_control,8,3                ## @dsm_control
	.comm	_DSM_CREATE_NULL_IF_MAXSEGMENTS,4,2 ## @DSM_CREATE_NULL_IF_MAXSEGMENTS
	.comm	_DSM_OP_DESTROY,4,2             ## @DSM_OP_DESTROY
	.comm	_WARNING,4,2                    ## @WARNING
	.comm	_ERRCODE_INSUFFICIENT_RESOURCES,4,2 ## @ERRCODE_INSUFFICIENT_RESOURCES
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"too many dynamic shared memory segments"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_dsm_create                     ; -- Begin function dsm_create
	.p2align	2
_dsm_create:                            ; @dsm_create
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x20, x1
	mov	x23, x0
Lloh0:
	adrp	x8, _IsUnderPostmaster@GOTPAGE
Lloh1:
	ldr	x8, [x8, _IsUnderPostmaster@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_Assert
Lloh3:
	adrp	x8, _dsm_init_done@GOTPAGE
Lloh4:
	ldr	x8, [x8, _dsm_init_done@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cbnz	w8, LBB0_2
; %bb.1:
	bl	_dsm_backend_startup
LBB0_2:
	bl	_dsm_create_descriptor
	mov	x19, x0
	add	x21, x0, #40
	add	x22, x0, #48
Lloh6:
	adrp	x25, _DSM_HANDLE_INVALID@GOTPAGE
Lloh7:
	ldr	x25, [x25, _DSM_HANDLE_INVALID@GOTPAGEOFF]
Lloh8:
	adrp	x26, _DSM_OP_CREATE@GOTPAGE
Lloh9:
	ldr	x26, [x26, _DSM_OP_CREATE@GOTPAGEOFF]
Lloh10:
	adrp	x24, _ERROR@GOTPAGE
Lloh11:
	ldr	x24, [x24, _ERROR@GOTPAGEOFF]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x21]
	cbz	x8, LBB0_5
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	w0, #0
	b	LBB0_6
LBB0_5:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x19]
	cmp	x8, #0
	cset	w0, eq
LBB0_6:                                 ;   in Loop: Header=BB0_3 Depth=1
	bl	_Assert
	bl	_random
	str	x0, [x19, #8]
	ldr	x8, [x25]
	cmp	x0, x8
	b.eq	LBB0_3
; %bb.7:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x1, x0
	ldr	w0, [x26]
	ldr	w6, [x24]
	mov	x2, x23
	mov	x3, x22
	mov	x4, x21
	mov	x5, x19
	bl	_dsm_impl_op
	cbz	x0, LBB0_3
; %bb.8:
Lloh12:
	adrp	x23, _DynamicSharedMemoryControlLock@GOTPAGE
Lloh13:
	ldr	x23, [x23, _DynamicSharedMemoryControlLock@GOTPAGEOFF]
	ldr	w0, [x23]
Lloh14:
	adrp	x8, _LW_EXCLUSIVE@GOTPAGE
Lloh15:
	ldr	x8, [x8, _LW_EXCLUSIVE@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	bl	_LWLockAcquire
Lloh17:
	adrp	x25, _dsm_control@GOTPAGE
Lloh18:
	ldr	x25, [x25, _dsm_control@GOTPAGEOFF]
	ldr	x8, [x25]
	ldr	x26, [x8]
	cbz	x26, LBB0_12
; %bb.9:
	mov	x10, #0
	mov	x9, #0
	ldr	x11, [x8, #16]
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	w12, [x11, x10]
	cbz	w12, LBB0_17
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	add	x9, x9, #1
	add	x10, x10, #32
	cmp	x26, x9
	b.ne	LBB0_10
LBB0_12:
	ldr	x9, [x8, #8]
	cmp	x26, x9
	b.lo	LBB0_19
; %bb.13:
Lloh19:
	adrp	x8, _DSM_CREATE_NULL_IF_MAXSEGMENTS@GOTPAGE
Lloh20:
	ldr	x8, [x8, _DSM_CREATE_NULL_IF_MAXSEGMENTS@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	tst	w8, w20
	b.eq	LBB0_18
; %bb.14:
	ldr	w0, [x23]
	bl	_LWLockRelease
Lloh22:
	adrp	x8, _DSM_OP_DESTROY@GOTPAGE
Lloh23:
	ldr	x8, [x8, _DSM_OP_DESTROY@GOTPAGEOFF]
Lloh24:
	ldr	w0, [x8]
	ldr	x1, [x19, #8]
Lloh25:
	adrp	x8, _WARNING@GOTPAGE
Lloh26:
	ldr	x8, [x8, _WARNING@GOTPAGEOFF]
Lloh27:
	ldr	w6, [x8]
	mov	w2, #0
	mov	x3, x22
	mov	x4, x21
	mov	x5, x19
	bl	_dsm_impl_op
	ldr	x0, [x19, #32]
	cbz	x0, LBB0_16
; %bb.15:
	mov	x1, x19
	bl	_ResourceOwnerForgetDSM
LBB0_16:
	add	x0, x19, #24
	bl	_dlist_delete
	mov	x0, x19
	bl	_pfree
	mov	x19, #0
	b	LBB0_21
LBB0_17:
	ldr	x8, [x19, #8]
	add	x11, x11, x10
	str	x8, [x11, #8]
	mov	w8, #2
	str	w8, [x11]
	str	xzr, [x11, #24]
	ldr	x8, [x25]
	ldr	x8, [x8, #16]
	add	x8, x8, x10
	str	wzr, [x8, #16]
	str	x9, [x19, #16]
	b	LBB0_20
LBB0_18:
	ldr	w20, [x24]
Lloh28:
	adrp	x8, _ERRCODE_INSUFFICIENT_RESOURCES@GOTPAGE
Lloh29:
	ldr	x8, [x8, _ERRCODE_INSUFFICIENT_RESOURCES@GOTPAGEOFF]
Lloh30:
	ldr	w0, [x8]
	bl	_errcode
Lloh31:
	adrp	x0, l_.str@PAGE
Lloh32:
	add	x0, x0, l_.str@PAGEOFF
	bl	_errmsg
	mov	x1, x0
	mov	x0, x20
	bl	_ereport
	ldr	x8, [x25]
LBB0_19:
	ldr	x9, [x19, #8]
	ldr	x8, [x8, #16]
	lsl	x10, x26, #5
	add	x8, x8, x10
	str	x9, [x8, #8]
	mov	w9, #2
	str	w9, [x8]
	str	xzr, [x8, #24]
	ldr	x8, [x25]
	ldr	x9, [x8, #16]
	add	x9, x9, x10
	str	wzr, [x9, #16]
	str	x26, [x19, #16]
	ldr	x9, [x8]
	add	x9, x9, #1
	str	x9, [x8]
LBB0_20:
	ldr	w0, [x23]
	bl	_LWLockRelease
LBB0_21:
	mov	x0, x19
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_IsUnderPostmaster,4,2          ; @IsUnderPostmaster
	.comm	_dsm_init_done,4,2              ; @dsm_init_done
	.comm	_DSM_HANDLE_INVALID,8,3         ; @DSM_HANDLE_INVALID
	.comm	_DSM_OP_CREATE,4,2              ; @DSM_OP_CREATE
	.comm	_ERROR,4,2                      ; @ERROR
	.comm	_DynamicSharedMemoryControlLock,4,2 ; @DynamicSharedMemoryControlLock
	.comm	_LW_EXCLUSIVE,4,2               ; @LW_EXCLUSIVE
	.comm	_dsm_control,8,3                ; @dsm_control
	.comm	_DSM_CREATE_NULL_IF_MAXSEGMENTS,4,2 ; @DSM_CREATE_NULL_IF_MAXSEGMENTS
	.comm	_DSM_OP_DESTROY,4,2             ; @DSM_OP_DESTROY
	.comm	_WARNING,4,2                    ; @WARNING
	.comm	_ERRCODE_INSUFFICIENT_RESOURCES,4,2 ; @ERRCODE_INSUFFICIENT_RESOURCES
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"too many dynamic shared memory segments"

.subsections_via_symbols
