	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_AttachSession                  ## -- Begin function AttachSession
	.p2align	4, 0x90
_AttachSession:                         ## @AttachSession
	.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	_TopMemoryContext@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_MemoryContextSwitchTo
	movl	%eax, %r14d
	movl	%ebx, %edi
	callq	_dsm_attach
	movq	%rax, %rbx
	testq	%rax, %rax
	jne	LBB0_2
## %bb.1:
	movq	_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_elog
LBB0_2:
	movq	_SESSION_MAGIC@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movq	%rbx, %rdi
	callq	_dsm_segment_address
	movl	%r15d, %edi
	movl	%eax, %esi
	callq	_shm_toc_attach
	movq	%rax, %r15
	movq	_SESSION_KEY_DSA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	xorl	%edx, %edx
	callq	_shm_toc_lookup
	movq	%rax, %rdi
	movq	%rbx, %rsi
	callq	_dsa_attach_in_place
	movq	%rax, %r12
	movq	_CurrentSession@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rbx, 8(%rax)
	movq	%r12, (%rax)
	movq	_SESSION_KEY_RECORD_TYPMOD_REGISTRY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	xorl	%edx, %edx
	callq	_shm_toc_lookup
	movq	%rax, %rdi
	callq	_SharedRecordTypmodRegistryAttach
	movq	%rbx, %rdi
	callq	_dsm_pin_mapping
	movq	%r12, %rdi
	callq	_dsa_pin_mapping
	movl	%r14d, %edi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_MemoryContextSwitchTo          ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_TopMemoryContext,4,2           ## @TopMemoryContext
	.comm	_ERROR,4,2                      ## @ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"could not attach to per-session DSM segment"

	.comm	_SESSION_MAGIC,4,2              ## @SESSION_MAGIC
	.comm	_SESSION_KEY_DSA,4,2            ## @SESSION_KEY_DSA
	.comm	_CurrentSession,8,3             ## @CurrentSession
	.comm	_SESSION_KEY_RECORD_TYPMOD_REGISTRY,4,2 ## @SESSION_KEY_RECORD_TYPMOD_REGISTRY
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_AttachSession                  ; -- Begin function AttachSession
	.p2align	2
_AttachSession:                         ; @AttachSession
	.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, x0
Lloh0:
	adrp	x8, _TopMemoryContext@GOTPAGE
Lloh1:
	ldr	x8, [x8, _TopMemoryContext@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_MemoryContextSwitchTo
	mov	x19, x0
	mov	x0, x20
	bl	_dsm_attach
	mov	x20, x0
	cbnz	x0, LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _ERROR@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ERROR@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	bl	_elog
LBB0_2:
Lloh8:
	adrp	x8, _SESSION_MAGIC@GOTPAGE
Lloh9:
	ldr	x8, [x8, _SESSION_MAGIC@GOTPAGEOFF]
Lloh10:
	ldr	w21, [x8]
	mov	x0, x20
	bl	_dsm_segment_address
	mov	x1, x0
	mov	x0, x21
	bl	_shm_toc_attach
	mov	x21, x0
Lloh11:
	adrp	x8, _SESSION_KEY_DSA@GOTPAGE
Lloh12:
	ldr	x8, [x8, _SESSION_KEY_DSA@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	mov	w2, #0
	bl	_shm_toc_lookup
	mov	x1, x20
	bl	_dsa_attach_in_place
	mov	x22, x0
Lloh14:
	adrp	x8, _CurrentSession@GOTPAGE
Lloh15:
	ldr	x8, [x8, _CurrentSession@GOTPAGEOFF]
Lloh16:
	ldr	x8, [x8]
	stp	x0, x20, [x8]
Lloh17:
	adrp	x8, _SESSION_KEY_RECORD_TYPMOD_REGISTRY@GOTPAGE
Lloh18:
	ldr	x8, [x8, _SESSION_KEY_RECORD_TYPMOD_REGISTRY@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	mov	x0, x21
	mov	w2, #0
	bl	_shm_toc_lookup
	bl	_SharedRecordTypmodRegistryAttach
	mov	x0, x20
	bl	_dsm_pin_mapping
	mov	x0, x22
	bl	_dsa_pin_mapping
	mov	x0, x19
	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
	b	_MemoryContextSwitchTo
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_TopMemoryContext,4,2           ; @TopMemoryContext
	.comm	_ERROR,4,2                      ; @ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"could not attach to per-session DSM segment"

	.comm	_SESSION_MAGIC,4,2              ; @SESSION_MAGIC
	.comm	_SESSION_KEY_DSA,4,2            ; @SESSION_KEY_DSA
	.comm	_CurrentSession,8,3             ; @CurrentSession
	.comm	_SESSION_KEY_RECORD_TYPMOD_REGISTRY,4,2 ; @SESSION_KEY_RECORD_TYPMOD_REGISTRY
.subsections_via_symbols
