	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function attach_internal
_attach_internal:                       ## @attach_internal
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %ebx
	movq	%rsi, %r15
	movq	%rdi, %r14
	xorl	%edi, %edi
	cmpl	%edx, (%r14)
	sete	%dil
	callq	_Assert
	movq	8(%r14), %rax
	xorl	%edi, %edi
	cmpl	%ebx, (%rax)
	sete	%dil
	callq	_Assert
	movq	_DSA_SEGMENT_HEADER_MAGIC@GOTPCREL(%rip), %rax
	xorl	(%rax), %ebx
	xorl	%edi, %edi
	cmpl	%ebx, 28(%r14)
	sete	%dil
	callq	_Assert
	movl	$40, %edi
	callq	_palloc
	movq	%rax, %r12
	movq	%r14, 8(%rax)
	movl	$0, (%rax)
	movq	24(%rax), %rdi
	movq	_DSA_MAX_SEGMENTS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	shll	$3, %eax
	leal	(%rax,%rax,4), %edx
	xorl	%esi, %esi
	callq	_memset
	movq	$0, 32(%r12)
	movq	24(%r12), %rbx
	movq	%r15, 32(%rbx)
	movq	%r14, (%rbx)
	movq	%r14, 24(%rbx)
	movl	$32, %edi
	callq	_MAXALIGN
	cltq
	addq	%r14, %rax
	movq	%rax, 16(%rbx)
	movq	(%rbx), %r15
	movl	$32, %edi
	callq	_MAXALIGN
	movslq	%eax, %r13
	addq	%r15, %r13
	movl	$4, %edi
	callq	_MAXALIGN
	cltq
	addq	%r13, %rax
	movq	%rax, 8(%rbx)
	movq	%r12, %rdi
	callq	_DSA_AREA_LOCK
	movq	_LW_EXCLUSIVE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	%eax, %edi
	callq	_LWLockAcquire
	movq	16(%r14), %rax
	testq	%rax, %rax
	jne	LBB0_2
## %bb.1:
	movq	_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movq	_ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_errcode
	leaq	L_.str(%rip), %rdi
	callq	_errmsg
	movl	%r15d, %edi
	movl	%eax, %esi
	callq	_ereport
	movq	16(%r14), %rax
LBB0_2:
	incq	%rax
	movq	%rax, 16(%r14)
	movq	8(%r12), %rax
	movl	24(%rax), %eax
	movl	%eax, 16(%r12)
	movq	%r12, %rdi
	callq	_DSA_AREA_LOCK
	movl	%eax, %edi
	callq	_LWLockRelease
	movq	%r12, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DSA_SEGMENT_HEADER_MAGIC,4,2   ## @DSA_SEGMENT_HEADER_MAGIC
	.comm	_DSA_MAX_SEGMENTS,4,2           ## @DSA_MAX_SEGMENTS
	.comm	_LW_EXCLUSIVE,4,2               ## @LW_EXCLUSIVE
	.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	"could not attach to dynamic shared area"

	.no_dead_strip	_attach_internal
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function attach_internal
_attach_internal:                       ; @attach_internal
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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	x20, x2
	mov	x21, x1
	mov	x19, x0
	ldr	w8, [x0]
	cmp	w8, w2
	cset	w0, eq
	bl	_Assert
	ldr	x8, [x19, #8]
	ldr	w8, [x8]
	cmp	w8, w20
	cset	w0, eq
	bl	_Assert
	ldr	w8, [x19, #28]
Lloh0:
	adrp	x9, _DSA_SEGMENT_HEADER_MAGIC@GOTPAGE
Lloh1:
	ldr	x9, [x9, _DSA_SEGMENT_HEADER_MAGIC@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	eor	w9, w9, w20
	cmp	w8, w9
	cset	w0, eq
	bl	_Assert
	mov	w0, #40
	bl	_palloc
	mov	x20, x0
	str	x19, [x0, #8]
	str	wzr, [x0]
	ldr	x0, [x0, #24]
Lloh3:
	adrp	x8, _DSA_MAX_SEGMENTS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _DSA_MAX_SEGMENTS@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	add	w8, w8, w8, lsl #2
	lsl	w2, w8, #3
	mov	w1, #0
	bl	_memset
	str	xzr, [x20, #32]
	ldr	x22, [x20, #24]
	str	x19, [x22]
	stp	x19, x21, [x22, #24]
	mov	w0, #32
	bl	_MAXALIGN
	add	x8, x19, w0, sxtw
	str	x8, [x22, #16]
	ldr	x21, [x22]
	mov	w0, #32
	bl	_MAXALIGN
	add	x21, x21, w0, sxtw
	mov	w0, #4
	bl	_MAXALIGN
	add	x8, x21, w0, sxtw
	str	x8, [x22, #8]
	mov	x0, x20
	bl	_DSA_AREA_LOCK
Lloh6:
	adrp	x8, _LW_EXCLUSIVE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _LW_EXCLUSIVE@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	bl	_LWLockAcquire
	ldr	x8, [x19, #16]
	cbnz	x8, LBB0_2
; %bb.1:
Lloh9:
	adrp	x8, _ERROR@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ERROR@GOTPAGEOFF]
Lloh11:
	ldr	w21, [x8]
Lloh12:
	adrp	x8, _ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
	bl	_errcode
Lloh15:
	adrp	x0, l_.str@PAGE
Lloh16:
	add	x0, x0, l_.str@PAGEOFF
	bl	_errmsg
	mov	x1, x0
	mov	x0, x21
	bl	_ereport
	ldr	x8, [x19, #16]
LBB0_2:
	add	x8, x8, #1
	str	x8, [x19, #16]
	ldr	x8, [x20, #8]
	ldr	w8, [x8, #24]
	str	w8, [x20, #16]
	mov	x0, x20
	bl	_DSA_AREA_LOCK
	bl	_LWLockRelease
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_DSA_SEGMENT_HEADER_MAGIC,4,2   ; @DSA_SEGMENT_HEADER_MAGIC
	.comm	_DSA_MAX_SEGMENTS,4,2           ; @DSA_MAX_SEGMENTS
	.comm	_LW_EXCLUSIVE,4,2               ; @LW_EXCLUSIVE
	.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	"could not attach to dynamic shared area"

	.no_dead_strip	_attach_internal
.subsections_via_symbols
