	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_PGSharedMemoryDetach           ## -- Begin function PGSharedMemoryDetach
	.p2align	4, 0x90
_PGSharedMemoryDetach:                  ## @PGSharedMemoryDetach
	.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	_ShmemProtectiveRegion@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_4
## %bb.1:
	movq	_MEM_RELEASE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%esi, %esi
	callq	_VirtualFree
	testq	%rax, %rax
	jne	LBB0_3
## %bb.2:
	movq	_LOG@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movl	(%rbx), %r14d
	xorl	%eax, %eax
	callq	_GetLastError
	leaq	L_.str(%rip), %rsi
	movl	%r15d, %edi
	movl	%r14d, %edx
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	_elog
LBB0_3:
	movq	$0, (%rbx)
LBB0_4:
	movq	_UsedShmemSegAddr@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_8
## %bb.5:
	callq	_UnmapViewOfFile
	testl	%eax, %eax
	jne	LBB0_7
## %bb.6:
	movq	_LOG@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	xorl	%eax, %eax
	callq	_GetLastError
	leaq	L_.str.1(%rip), %rsi
	movl	%r14d, %edi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_elog
LBB0_7:
	movq	$0, (%rbx)
LBB0_8:
	movq	_UsedShmemSegID@GOTPCREL(%rip), %r15
	movq	(%r15), %rdi
	movq	_INVALID_HANDLE_VALUE@GOTPCREL(%rip), %rbx
	cmpq	(%rbx), %rdi
	je	LBB0_12
## %bb.9:
	callq	_CloseHandle
	testl	%eax, %eax
	jne	LBB0_11
## %bb.10:
	movq	_LOG@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	xorl	%eax, %eax
	callq	_GetLastError
	leaq	L_.str.2(%rip), %rsi
	movl	%r14d, %edi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_elog
LBB0_11:
	movq	(%rbx), %rax
	movq	%rax, (%r15)
LBB0_12:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ShmemProtectiveRegion,8,3      ## @ShmemProtectiveRegion
	.comm	_MEM_RELEASE,4,2                ## @MEM_RELEASE
	.comm	_LOG,4,2                        ## @LOG
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to release reserved memory region (addr=%p): error code %lu"

	.comm	_UsedShmemSegAddr,8,3           ## @UsedShmemSegAddr
L_.str.1:                               ## @.str.1
	.asciz	"could not unmap view of shared memory: error code %lu"

	.comm	_UsedShmemSegID,8,3             ## @UsedShmemSegID
	.comm	_INVALID_HANDLE_VALUE,8,3       ## @INVALID_HANDLE_VALUE
L_.str.2:                               ## @.str.2
	.asciz	"could not close handle to shared memory: error code %lu"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_PGSharedMemoryDetach           ; -- Begin function PGSharedMemoryDetach
	.p2align	2
_PGSharedMemoryDetach:                  ; @PGSharedMemoryDetach
	.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
Lloh0:
	adrp	x21, _ShmemProtectiveRegion@GOTPAGE
Lloh1:
	ldr	x21, [x21, _ShmemProtectiveRegion@GOTPAGEOFF]
	ldr	x0, [x21]
	cbz	x0, LBB0_4
; %bb.1:
Lloh2:
	adrp	x8, _MEM_RELEASE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _MEM_RELEASE@GOTPAGEOFF]
Lloh4:
	ldr	w2, [x8]
	mov	w1, #0
	bl	_VirtualFree
	cbnz	x0, LBB0_3
; %bb.2:
Lloh5:
	adrp	x8, _LOG@GOTPAGE
Lloh6:
	ldr	x8, [x8, _LOG@GOTPAGEOFF]
Lloh7:
	ldr	w19, [x8]
	ldr	w20, [x21]
	bl	_GetLastError
                                        ; kill: def $w0 killed $w0 def $x0
	str	x0, [sp]
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	mov	x2, x20
	bl	_elog
LBB0_3:
	str	xzr, [x21]
LBB0_4:
Lloh10:
	adrp	x20, _UsedShmemSegAddr@GOTPAGE
Lloh11:
	ldr	x20, [x20, _UsedShmemSegAddr@GOTPAGEOFF]
	ldr	x0, [x20]
	cbz	x0, LBB0_8
; %bb.5:
	bl	_UnmapViewOfFile
	cbnz	w0, LBB0_7
; %bb.6:
Lloh12:
	adrp	x8, _LOG@GOTPAGE
Lloh13:
	ldr	x8, [x8, _LOG@GOTPAGEOFF]
Lloh14:
	ldr	w19, [x8]
	bl	_GetLastError
	mov	x2, x0
Lloh15:
	adrp	x1, l_.str.1@PAGE
Lloh16:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_elog
LBB0_7:
	str	xzr, [x20]
LBB0_8:
Lloh17:
	adrp	x20, _UsedShmemSegID@GOTPAGE
Lloh18:
	ldr	x20, [x20, _UsedShmemSegID@GOTPAGEOFF]
	ldr	x0, [x20]
Lloh19:
	adrp	x21, _INVALID_HANDLE_VALUE@GOTPAGE
Lloh20:
	ldr	x21, [x21, _INVALID_HANDLE_VALUE@GOTPAGEOFF]
	ldr	x8, [x21]
	cmp	x0, x8
	b.eq	LBB0_12
; %bb.9:
	bl	_CloseHandle
	cbnz	w0, LBB0_11
; %bb.10:
Lloh21:
	adrp	x8, _LOG@GOTPAGE
Lloh22:
	ldr	x8, [x8, _LOG@GOTPAGEOFF]
Lloh23:
	ldr	w19, [x8]
	bl	_GetLastError
	mov	x2, x0
Lloh24:
	adrp	x1, l_.str.2@PAGE
Lloh25:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_elog
LBB0_11:
	ldr	x8, [x21]
	str	x8, [x20]
LBB0_12:
	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	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_ShmemProtectiveRegion,8,3      ; @ShmemProtectiveRegion
	.comm	_MEM_RELEASE,4,2                ; @MEM_RELEASE
	.comm	_LOG,4,2                        ; @LOG
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to release reserved memory region (addr=%p): error code %lu"

	.comm	_UsedShmemSegAddr,8,3           ; @UsedShmemSegAddr
l_.str.1:                               ; @.str.1
	.asciz	"could not unmap view of shared memory: error code %lu"

	.comm	_UsedShmemSegID,8,3             ; @UsedShmemSegID
	.comm	_INVALID_HANDLE_VALUE,8,3       ; @INVALID_HANDLE_VALUE
l_.str.2:                               ; @.str.2
	.asciz	"could not close handle to shared memory: error code %lu"

.subsections_via_symbols
