	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_dsm_pin_segment                ## -- Begin function dsm_pin_segment
	.p2align	4, 0x90
_dsm_pin_segment:                       ## @dsm_pin_segment
	.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	%rdi, %rbx
	movq	_DynamicSharedMemoryControlLock@GOTPCREL(%rip), %r14
	movl	(%r14), %edi
	movq	_LW_EXCLUSIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_LWLockAcquire
	movq	_dsm_control@GOTPCREL(%rip), %r15
	movq	(%r15), %rax
	movq	(%rax), %rax
	movq	(%rbx), %rcx
	leaq	(%rcx,%rcx,2), %rcx
	cmpl	$0, (%rax,%rcx,8)
	je	LBB0_2
## %bb.1:
	movq	_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_elog
LBB0_2:
	movl	8(%rbx), %esi
	movl	12(%rbx), %edi
	leaq	-32(%rbp), %rdx
	callq	_dsm_impl_pin_segment
	movq	(%r15), %rax
	movq	(%rax), %rax
	movq	(%rbx), %rcx
	leaq	(%rcx,%rcx,2), %rcx
	movl	$1, (%rax,%rcx,8)
	incl	16(%rax,%rcx,8)
	movq	-32(%rbp), %rdx
	movq	%rdx, 8(%rax,%rcx,8)
	movl	(%r14), %edi
	callq	_LWLockRelease
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DynamicSharedMemoryControlLock,4,2 ## @DynamicSharedMemoryControlLock
	.comm	_LW_EXCLUSIVE,4,2               ## @LW_EXCLUSIVE
	.comm	_dsm_control,8,3                ## @dsm_control
	.comm	_ERROR,4,2                      ## @ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"cannot pin a segment that is already pinned"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_dsm_pin_segment                ; -- Begin function dsm_pin_segment
	.p2align	2
_dsm_pin_segment:                       ; @dsm_pin_segment
	.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
	mov	x19, x0
Lloh0:
	adrp	x20, _DynamicSharedMemoryControlLock@GOTPAGE
Lloh1:
	ldr	x20, [x20, _DynamicSharedMemoryControlLock@GOTPAGEOFF]
	ldr	w0, [x20]
Lloh2:
	adrp	x8, _LW_EXCLUSIVE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _LW_EXCLUSIVE@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	bl	_LWLockAcquire
Lloh5:
	adrp	x21, _dsm_control@GOTPAGE
Lloh6:
	ldr	x21, [x21, _dsm_control@GOTPAGEOFF]
	ldr	x8, [x21]
	ldr	x8, [x8]
	ldr	x9, [x19]
	mov	w10, #24
	mul	x9, x9, x10
	ldr	w8, [x8, x9]
	cbz	w8, LBB0_2
; %bb.1:
Lloh7:
	adrp	x8, _ERROR@GOTPAGE
Lloh8:
	ldr	x8, [x8, _ERROR@GOTPAGEOFF]
Lloh9:
	ldr	w0, [x8]
Lloh10:
	adrp	x1, l_.str@PAGE
Lloh11:
	add	x1, x1, l_.str@PAGEOFF
	bl	_elog
LBB0_2:
	ldp	w1, w0, [x19, #8]
	add	x2, sp, #8
	bl	_dsm_impl_pin_segment
	ldr	x8, [x21]
	ldr	x8, [x8]
	ldr	x9, [x19]
	mov	w10, #24
	madd	x8, x9, x10, x8
	mov	w9, #1
	str	w9, [x8]
	ldr	w9, [x8, #16]
	add	w9, w9, #1
	str	w9, [x8, #16]
	ldr	x9, [sp, #8]
	str	x9, [x8, #8]
	ldr	w0, [x20]
	bl	_LWLockRelease
	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
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_DynamicSharedMemoryControlLock,4,2 ; @DynamicSharedMemoryControlLock
	.comm	_LW_EXCLUSIVE,4,2               ; @LW_EXCLUSIVE
	.comm	_dsm_control,8,3                ; @dsm_control
	.comm	_ERROR,4,2                      ; @ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"cannot pin a segment that is already pinned"

.subsections_via_symbols
