	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function PGSharedMemoryAttach
_PGSharedMemoryAttach:                  ## @PGSharedMemoryAttach
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r15
	movq	%rsi, %r14
	movl	%edi, %ebx
	movq	$0, (%rdx)
	movq	_IPC_STAT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-32(%rbp), %rdx
	callq	_shmctl
	testq	%rax, %rax
	js	LBB0_1
## %bb.5:
	movq	_DataDir@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	-48(%rbp), %rsi
	callq	_stat
	testq	%rax, %rax
	js	LBB0_14
## %bb.6:
	movq	_PG_SHMAT_FLAGS@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%ebx, %edi
	movq	%r14, %rsi
	callq	_shmat
	cmpq	$-1, %rax
	je	LBB0_1
## %bb.7:
	movq	%rax, (%r15)
	movq	(%rax), %rcx
	movq	_PGShmemMagic@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_4
## %bb.8:
	movq	8(%rax), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_4
## %bb.9:
	movq	16(%rax), %rax
	cmpq	-40(%rbp), %rax
	jne	LBB0_4
## %bb.10:
	cmpq	$0, -32(%rbp)
	jne	LBB0_11
## %bb.12:
	movq	_SHMSTATE_UNATTACHED@GOTPCREL(%rip), %rax
	jmp	LBB0_13
LBB0_1:
	movq	_errno@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_3
## %bb.2:
	movq	_SHMSTATE_ENOENT@GOTPCREL(%rip), %rax
	jmp	LBB0_13
LBB0_3:
	movq	_EACCES@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_14
LBB0_4:
	movq	_SHMSTATE_FOREIGN@GOTPCREL(%rip), %rax
	jmp	LBB0_13
LBB0_14:
	movq	_SHMSTATE_ANALYSIS_FAILURE@GOTPCREL(%rip), %rax
LBB0_13:
	movl	(%rax), %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	movq	_SHMSTATE_ATTACHED@GOTPCREL(%rip), %rax
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.comm	_IPC_STAT,4,2                   ## @IPC_STAT
	.comm	_errno,8,3                      ## @errno
	.comm	_EINVAL,8,3                     ## @EINVAL
	.comm	_SHMSTATE_ENOENT,4,2            ## @SHMSTATE_ENOENT
	.comm	_EACCES,8,3                     ## @EACCES
	.comm	_SHMSTATE_FOREIGN,4,2           ## @SHMSTATE_FOREIGN
	.comm	_SHMSTATE_ANALYSIS_FAILURE,4,2  ## @SHMSTATE_ANALYSIS_FAILURE
	.comm	_DataDir,4,2                    ## @DataDir
	.comm	_PG_SHMAT_FLAGS,4,2             ## @PG_SHMAT_FLAGS
	.comm	_PGShmemMagic,8,3               ## @PGShmemMagic
	.comm	_SHMSTATE_UNATTACHED,4,2        ## @SHMSTATE_UNATTACHED
	.comm	_SHMSTATE_ATTACHED,4,2          ## @SHMSTATE_ATTACHED
	.comm	_EIDRM,8,3                      ## @EIDRM
	.no_dead_strip	_PGSharedMemoryAttach
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function PGSharedMemoryAttach
_PGSharedMemoryAttach:                  ; @PGSharedMemoryAttach
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	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
	mov	x19, x2
	mov	x20, x1
	mov	x21, x0
	str	xzr, [x2]
Lloh0:
	adrp	x8, _IPC_STAT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _IPC_STAT@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	add	x2, sp, #24
	bl	_shmctl
	tbnz	x0, #63, LBB0_7
; %bb.1:
Lloh3:
	adrp	x8, _DataDir@GOTPAGE
Lloh4:
	ldr	x8, [x8, _DataDir@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	add	x1, sp, #8
	bl	_stat
	tbnz	x0, #63, LBB0_11
; %bb.2:
Lloh6:
	adrp	x8, _PG_SHMAT_FLAGS@GOTPAGE
Lloh7:
	ldr	x8, [x8, _PG_SHMAT_FLAGS@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
	mov	x0, x21
	mov	x1, x20
	bl	_shmat
	cmn	x0, #1
	b.eq	LBB0_7
; %bb.3:
	str	x0, [x19]
	ldr	x8, [x0]
Lloh9:
	adrp	x9, _PGShmemMagic@GOTPAGE
Lloh10:
	ldr	x9, [x9, _PGShmemMagic@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_10
; %bb.4:
	ldr	x8, [x0, #8]
	ldr	x9, [sp, #8]
	cmp	x8, x9
	b.ne	LBB0_10
; %bb.5:
	ldr	x8, [x0, #16]
	ldr	x9, [sp, #16]
	cmp	x8, x9
	b.ne	LBB0_10
; %bb.6:
Lloh12:
	adrp	x8, _SHMSTATE_UNATTACHED@GOTPAGE
Lloh13:
	ldr	x8, [x8, _SHMSTATE_UNATTACHED@GOTPAGEOFF]
	ldr	x9, [sp, #24]
Lloh14:
	adrp	x10, _SHMSTATE_ATTACHED@GOTPAGE
Lloh15:
	ldr	x10, [x10, _SHMSTATE_ATTACHED@GOTPAGEOFF]
	cmp	x9, #0
	csel	x8, x8, x10, eq
	b	LBB0_12
LBB0_7:
Lloh16:
	adrp	x8, _errno@GOTPAGE
Lloh17:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh18:
	ldr	x8, [x8]
Lloh19:
	adrp	x9, _EINVAL@GOTPAGE
Lloh20:
	ldr	x9, [x9, _EINVAL@GOTPAGEOFF]
Lloh21:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_9
; %bb.8:
Lloh22:
	adrp	x8, _SHMSTATE_ENOENT@GOTPAGE
Lloh23:
	ldr	x8, [x8, _SHMSTATE_ENOENT@GOTPAGEOFF]
	b	LBB0_12
LBB0_9:
Lloh24:
	adrp	x9, _EACCES@GOTPAGE
Lloh25:
	ldr	x9, [x9, _EACCES@GOTPAGEOFF]
Lloh26:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_11
LBB0_10:
Lloh27:
	adrp	x8, _SHMSTATE_FOREIGN@GOTPAGE
Lloh28:
	ldr	x8, [x8, _SHMSTATE_FOREIGN@GOTPAGEOFF]
	b	LBB0_12
LBB0_11:
Lloh29:
	adrp	x8, _SHMSTATE_ANALYSIS_FAILURE@GOTPAGE
Lloh30:
	ldr	x8, [x8, _SHMSTATE_ANALYSIS_FAILURE@GOTPAGEOFF]
LBB0_12:
	ldr	w0, [x8]
	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
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_IPC_STAT,4,2                   ; @IPC_STAT
	.comm	_errno,8,3                      ; @errno
	.comm	_EINVAL,8,3                     ; @EINVAL
	.comm	_SHMSTATE_ENOENT,4,2            ; @SHMSTATE_ENOENT
	.comm	_EACCES,8,3                     ; @EACCES
	.comm	_SHMSTATE_FOREIGN,4,2           ; @SHMSTATE_FOREIGN
	.comm	_SHMSTATE_ANALYSIS_FAILURE,4,2  ; @SHMSTATE_ANALYSIS_FAILURE
	.comm	_DataDir,4,2                    ; @DataDir
	.comm	_PG_SHMAT_FLAGS,4,2             ; @PG_SHMAT_FLAGS
	.comm	_PGShmemMagic,8,3               ; @PGShmemMagic
	.comm	_SHMSTATE_UNATTACHED,4,2        ; @SHMSTATE_UNATTACHED
	.comm	_SHMSTATE_ATTACHED,4,2          ; @SHMSTATE_ATTACHED
	.comm	_EIDRM,8,3                      ; @EIDRM
	.no_dead_strip	_PGSharedMemoryAttach
.subsections_via_symbols
