	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_PGSharedMemoryCreate           ## -- Begin function PGSharedMemoryCreate
	.p2align	4, 0x90
_PGSharedMemoryCreate:                  ## @PGSharedMemoryCreate
	.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
	subq	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r13
	movl	%edi, %r12d
	movq	_PAGE_READWRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	_PROTECTIVE_REGION_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_MEM_RESERVE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_PAGE_NOACCESS@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	xorl	%edi, %edi
	callq	_VirtualAlloc
	movq	_ShmemProtectiveRegion@GOTPCREL(%rip), %rcx
	movq	%rax, (%rcx)
	testq	%rax, %rax
	jne	LBB0_2
## %bb.1:
	movq	_FATAL@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	xorl	%eax, %eax
	callq	_GetLastError
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %edi
	movl	%eax, %edx
	callq	_elog
LBB0_2:
	movl	$24, %edi
	callq	_MAXALIGN
	xorl	%edi, %edi
	cmpl	%r12d, %eax
	setl	%dil
	callq	_Assert
	xorl	%eax, %eax
	callq	_GetSharedMemName
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	_UsedShmemSegAddr@GOTPCREL(%rip), %rax
	movq	$0, (%rax)
	movq	_huge_pages@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_HUGE_PAGES_ON@GOTPCREL(%rip), %r14
	movq	_HUGE_PAGES_TRY@GOTPCREL(%rip), %rcx
	cmpq	(%r14), %rax
	movq	%r13, -72(%rbp)                 ## 8-byte Spill
	movl	%r12d, -60(%rbp)                ## 4-byte Spill
	je	LBB0_5
## %bb.3:
	cmpq	(%rcx), %rax
	jne	LBB0_4
LBB0_5:
	xorl	%eax, %eax
	callq	_GetLargePageMinimum
	movl	%eax, %r15d
	movq	_huge_pages@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	(%r14), %rax
	jne	LBB0_6
## %bb.7:
	movq	_FATAL@GOTPCREL(%rip), %rax
	jmp	LBB0_8
LBB0_6:
	movq	_DEBUG1@GOTPCREL(%rip), %rax
LBB0_8:
	movl	(%rax), %r14d
	testl	%r15d, %r15d
	je	LBB0_9
## %bb.10:
	movl	%r14d, %edi
	callq	_EnableLockPagesPrivilege
	testl	%eax, %eax
	je	LBB0_11
## %bb.12:
	movq	_SEC_COMMIT@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_PAGE_READWRITE@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	movq	_SEC_LARGE_PAGES@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	movl	%r12d, %eax
	cltd
	idivl	%r15d
	testl	%edx, %edx
	je	LBB0_13
## %bb.14:
	addl	%r12d, %r15d
	subl	%edx, %r15d
	jmp	LBB0_15
LBB0_9:
	movq	_ERRCODE_FEATURE_NOT_SUPPORTED@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_errcode
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_errmsg
	movl	%r14d, %edi
	movl	%eax, %esi
	callq	_ereport
LBB0_11:
	movq	_DEBUG1@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_errmsg
	movl	%r14d, %edi
	movl	%eax, %esi
	callq	_ereport
LBB0_4:
	movl	%r12d, %r15d
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
LBB0_15:
	movq	_INVALID_HANDLE_VALUE@GOTPCREL(%rip), %r13
LBB0_16:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_17 Depth 2
	movl	$10, %r12d
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	jmp	LBB0_17
	.p2align	4, 0x90
LBB0_24:                                ##   in Loop: Header=BB0_17 Depth=2
	movq	_FATAL@GOTPCREL(%rip), %rax
	movq	%r13, %rbx
	movl	(%rax), %r13d
	xorl	%eax, %eax
	callq	_GetLastError
	leaq	L_.str.4(%rip), %rdi
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_errmsg
	leaq	L_.str.5(%rip), %rdi
	movl	%r15d, %esi
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	xorl	%eax, %eax
	callq	_errdetail
	movl	%r13d, %edi
	movq	%rbx, %r13
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	movl	%eax, %esi
	callq	_ereport
	xorl	%eax, %eax
	callq	_GetLastError
	movq	_ERROR_ALREADY_EXISTS@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_26
LBB0_25:                                ##   in Loop: Header=BB0_17 Depth=2
	movq	%r14, %rdi
	callq	_CloseHandle
	movl	$1000, %edi                     ## imm = 0x3E8
	callq	_Sleep
	decl	%r12d
	je	LBB0_26
LBB0_17:                                ##   Parent Loop BB0_16 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	xorl	%edi, %edi
	callq	_SetLastError
	movl	(%r13), %edi
	xorl	%esi, %esi
	movl	%ebx, %edx
	xorl	%ecx, %ecx
	movl	%r15d, %r8d
	movq	-56(%rbp), %r9                  ## 8-byte Reload
	callq	_CreateFileMapping
	movq	%rax, %r14
	xorl	%eax, %eax
	callq	_GetLastError
	testq	%r14, %r14
	je	LBB0_18
## %bb.22:                              ##   in Loop: Header=BB0_17 Depth=2
	movq	_ERROR_ALREADY_EXISTS@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	je	LBB0_25
	jmp	LBB0_23
	.p2align	4, 0x90
LBB0_18:                                ##   in Loop: Header=BB0_17 Depth=2
	movq	_ERROR_NO_SYSTEM_RESOURCES@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_24
## %bb.19:                              ##   in Loop: Header=BB0_17 Depth=2
	movq	_huge_pages@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_HUGE_PAGES_TRY@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_24
## %bb.20:                              ##   in Loop: Header=BB0_17 Depth=2
	movq	_SEC_LARGE_PAGES@GOTPCREL(%rip), %rax
	testl	%ebx, (%rax)
	je	LBB0_24
## %bb.21:                              ##   in Loop: Header=BB0_16 Depth=1
	movq	_DEBUG1@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.3(%rip), %rsi
	movl	%r15d, %edx
	callq	_elog
	movq	_PAGE_READWRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	-60(%rbp), %r15d                ## 4-byte Reload
	jmp	LBB0_16
LBB0_26:
	movl	%r15d, %r13d
	movq	_FATAL@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	leaq	L_.str.6(%rip), %rdi
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_errmsg
	leaq	L_.str.7(%rip), %rdi
	callq	_errhint
	movl	%r15d, %edi
	movl	%eax, %esi
	callq	_ereport
	jmp	LBB0_27
LBB0_23:
	movl	%r15d, %r13d
LBB0_27:
	movq	-72(%rbp), %r15                 ## 8-byte Reload
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_free
	xorl	%eax, %eax
	callq	_GetCurrentProcess
	movl	%eax, %ebx
	xorl	%eax, %eax
	callq	_GetCurrentProcess
	movq	_TRUE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r9d
	movq	_DUPLICATE_SAME_ACCESS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, (%rsp)
	leaq	-80(%rbp), %rcx
	movl	%ebx, %edi
	movq	%r14, %rsi
	movl	%eax, %edx
	xorl	%r8d, %r8d
	callq	_DuplicateHandle
	testl	%eax, %eax
	movq	_UsedShmemSegAddr@GOTPCREL(%rip), %r12
	jne	LBB0_29
## %bb.28:
	movq	_FATAL@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	xorl	%eax, %eax
	callq	_GetLastError
	leaq	L_.str.4(%rip), %rdi
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_errmsg
	leaq	L_.str.8(%rip), %rdi
	xorl	%eax, %eax
	callq	_errdetail
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_ereport
LBB0_29:
	movq	%r14, %rdi
	callq	_CloseHandle
	testl	%eax, %eax
	jne	LBB0_31
## %bb.30:
	movq	_LOG@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	xorl	%eax, %eax
	callq	_GetLastError
	leaq	L_.str.9(%rip), %rsi
	movl	%ebx, %edi
	movl	%eax, %edx
	callq	_elog
LBB0_31:
	movq	-80(%rbp), %rdi
	movq	_FILE_MAP_WRITE@GOTPCREL(%rip), %rax
	movq	_FILE_MAP_READ@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	_MapViewOfFileEx
	movq	%rax, %rbx
	testq	%rax, %rax
	jne	LBB0_33
## %bb.32:
	movq	_FATAL@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	xorl	%eax, %eax
	callq	_GetLastError
	leaq	L_.str.4(%rip), %rdi
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_errmsg
	leaq	L_.str.10(%rip), %rdi
	xorl	%eax, %eax
	callq	_errdetail
	movl	%r14d, %edi
	movl	%eax, %esi
	callq	_ereport
LBB0_33:
	xorl	%eax, %eax
	callq	_getpid
	movl	%eax, 20(%rbx)
	movq	_PGShmemMagic@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%rbx)
	movl	%r13d, (%rbx)
	movl	$24, %edi
	callq	_MAXALIGN
	movl	%eax, 4(%rbx)
	movq	$0, 8(%rbx)
	movq	%rbx, (%r12)
	movq	_UsedShmemSegSize@GOTPCREL(%rip), %rax
	movl	%r13d, (%rax)
	movq	-80(%rbp), %rdi
	movq	_UsedShmemSegID@GOTPCREL(%rip), %rax
	movq	%rdi, (%rax)
	movq	_pgwin32_SharedMemoryDelete@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	callq	_PointerGetDatum
	movl	%r14d, %edi
	movl	%eax, %esi
	callq	_on_shmem_exit
	movq	%rbx, (%r15)
	movq	%rbx, %rax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	movl	%r12d, %r15d
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.comm	_PAGE_READWRITE,4,2             ## @PAGE_READWRITE
	.comm	_PROTECTIVE_REGION_SIZE,4,2     ## @PROTECTIVE_REGION_SIZE
	.comm	_MEM_RESERVE,4,2                ## @MEM_RESERVE
	.comm	_PAGE_NOACCESS,4,2              ## @PAGE_NOACCESS
	.comm	_ShmemProtectiveRegion,8,3      ## @ShmemProtectiveRegion
	.comm	_FATAL,4,2                      ## @FATAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"could not reserve memory region: error code %lu"

	.comm	_UsedShmemSegAddr,8,3           ## @UsedShmemSegAddr
	.comm	_huge_pages,8,3                 ## @huge_pages
	.comm	_HUGE_PAGES_ON,8,3              ## @HUGE_PAGES_ON
	.comm	_HUGE_PAGES_TRY,8,3             ## @HUGE_PAGES_TRY
	.comm	_DEBUG1,4,2                     ## @DEBUG1
	.comm	_ERRCODE_FEATURE_NOT_SUPPORTED,4,2 ## @ERRCODE_FEATURE_NOT_SUPPORTED
L_.str.1:                               ## @.str.1
	.asciz	"the processor does not support large pages"

L_.str.2:                               ## @.str.2
	.asciz	"disabling huge pages"

	.comm	_SEC_COMMIT,4,2                 ## @SEC_COMMIT
	.comm	_SEC_LARGE_PAGES,4,2            ## @SEC_LARGE_PAGES
	.comm	_INVALID_HANDLE_VALUE,4,2       ## @INVALID_HANDLE_VALUE
	.comm	_ERROR_NO_SYSTEM_RESOURCES,4,2  ## @ERROR_NO_SYSTEM_RESOURCES
L_.str.3:                               ## @.str.3
	.asciz	"CreateFileMapping(%zu) with SEC_LARGE_PAGES failed, huge pages disabled"

L_.str.4:                               ## @.str.4
	.asciz	"could not create shared memory segment: error code %lu"

L_.str.5:                               ## @.str.5
	.asciz	"Failed system call was CreateFileMapping(size=%zu, name=%s)."

	.comm	_ERROR_ALREADY_EXISTS,4,2       ## @ERROR_ALREADY_EXISTS
L_.str.6:                               ## @.str.6
	.asciz	"pre-existing shared memory block is still in use"

L_.str.7:                               ## @.str.7
	.asciz	"Check if there are any old server processes still running, and terminate them."

	.comm	_TRUE,4,2                       ## @TRUE
	.comm	_DUPLICATE_SAME_ACCESS,4,2      ## @DUPLICATE_SAME_ACCESS
L_.str.8:                               ## @.str.8
	.asciz	"Failed system call was DuplicateHandle."

	.comm	_LOG,4,2                        ## @LOG
L_.str.9:                               ## @.str.9
	.asciz	"could not close handle to shared memory: error code %lu"

	.comm	_FILE_MAP_WRITE,4,2             ## @FILE_MAP_WRITE
	.comm	_FILE_MAP_READ,4,2              ## @FILE_MAP_READ
L_.str.10:                              ## @.str.10
	.asciz	"Failed system call was MapViewOfFileEx."

	.comm	_PGShmemMagic,4,2               ## @PGShmemMagic
	.comm	_UsedShmemSegSize,4,2           ## @UsedShmemSegSize
	.comm	_UsedShmemSegID,8,3             ## @UsedShmemSegID
	.comm	_pgwin32_SharedMemoryDelete,4,2 ## @pgwin32_SharedMemoryDelete
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_PGSharedMemoryCreate           ; -- Begin function PGSharedMemoryCreate
	.p2align	2
_PGSharedMemoryCreate:                  ; @PGSharedMemoryCreate
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x21, x1
	mov	x25, x0
Lloh0:
	adrp	x26, _PAGE_READWRITE@GOTPAGE
Lloh1:
	ldr	x26, [x26, _PAGE_READWRITE@GOTPAGEOFF]
	ldr	w22, [x26]
Lloh2:
	adrp	x8, _PROTECTIVE_REGION_SIZE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _PROTECTIVE_REGION_SIZE@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
Lloh5:
	adrp	x8, _MEM_RESERVE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _MEM_RESERVE@GOTPAGEOFF]
Lloh7:
	ldr	w2, [x8]
Lloh8:
	adrp	x8, _PAGE_NOACCESS@GOTPAGE
Lloh9:
	ldr	x8, [x8, _PAGE_NOACCESS@GOTPAGEOFF]
Lloh10:
	ldr	w3, [x8]
	mov	x0, #0
	bl	_VirtualAlloc
Lloh11:
	adrp	x8, _ShmemProtectiveRegion@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ShmemProtectiveRegion@GOTPAGEOFF]
Lloh13:
	str	x0, [x8]
	cbnz	x0, LBB0_2
; %bb.1:
Lloh14:
	adrp	x8, _FATAL@GOTPAGE
Lloh15:
	ldr	x8, [x8, _FATAL@GOTPAGEOFF]
Lloh16:
	ldr	w20, [x8]
	bl	_GetLastError
	mov	x2, x0
Lloh17:
	adrp	x1, l_.str@PAGE
Lloh18:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_elog
LBB0_2:
	mov	w0, #24
	bl	_MAXALIGN
	cmp	w0, w25
	cset	w0, lt
	bl	_Assert
	bl	_GetSharedMemName
	mov	x23, x0
Lloh19:
	adrp	x8, _UsedShmemSegAddr@GOTPAGE
Lloh20:
	ldr	x8, [x8, _UsedShmemSegAddr@GOTPAGEOFF]
Lloh21:
	str	xzr, [x8]
Lloh22:
	adrp	x24, _huge_pages@GOTPAGE
Lloh23:
	ldr	x24, [x24, _huge_pages@GOTPAGEOFF]
	ldr	x8, [x24]
Lloh24:
	adrp	x19, _HUGE_PAGES_ON@GOTPAGE
Lloh25:
	ldr	x19, [x19, _HUGE_PAGES_ON@GOTPAGEOFF]
	ldr	x9, [x19]
Lloh26:
	adrp	x10, _HUGE_PAGES_TRY@GOTPAGE
Lloh27:
	ldr	x10, [x10, _HUGE_PAGES_TRY@GOTPAGEOFF]
Lloh28:
	ldr	x10, [x10]
	cmp	x8, x9
	ccmp	x8, x10, #4, ne
Lloh29:
	adrp	x27, _DEBUG1@GOTPAGE
Lloh30:
	ldr	x27, [x27, _DEBUG1@GOTPAGEOFF]
	str	x21, [sp, #32]                  ; 8-byte Folded Spill
	str	w25, [sp, #28]                  ; 4-byte Folded Spill
	b.ne	LBB0_8
; %bb.3:
	bl	_GetLargePageMinimum
	ldr	x8, [x24]
	ldr	x9, [x19]
	cmp	x8, x9
Lloh31:
	adrp	x8, _FATAL@GOTPAGE
Lloh32:
	ldr	x8, [x8, _FATAL@GOTPAGEOFF]
	csel	x8, x8, x27, eq
	ldr	w24, [x8]
	cbz	w0, LBB0_6
; %bb.4:
	mov	x20, x0
	mov	x0, x24
	bl	_EnableLockPagesPrivilege
	cbz	w0, LBB0_7
; %bb.5:
	ldr	w8, [x26]
Lloh33:
	adrp	x9, _SEC_COMMIT@GOTPAGE
Lloh34:
	ldr	x9, [x9, _SEC_COMMIT@GOTPAGEOFF]
Lloh35:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh36:
	adrp	x9, _SEC_LARGE_PAGES@GOTPAGE
Lloh37:
	ldr	x9, [x9, _SEC_LARGE_PAGES@GOTPAGEOFF]
Lloh38:
	ldr	w9, [x9]
	orr	w22, w8, w9
	sdiv	w8, w25, w20
	msub	w8, w8, w20, w25
	add	w9, w20, w25
	sub	w9, w9, w8
	cmp	w8, #0
	csel	w20, w25, w9, eq
	b	LBB0_9
LBB0_6:
Lloh39:
	adrp	x8, _ERRCODE_FEATURE_NOT_SUPPORTED@GOTPAGE
Lloh40:
	ldr	x8, [x8, _ERRCODE_FEATURE_NOT_SUPPORTED@GOTPAGEOFF]
Lloh41:
	ldr	w0, [x8]
	bl	_errcode
Lloh42:
	adrp	x0, l_.str.1@PAGE
Lloh43:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_errmsg
	mov	x1, x0
	mov	x0, x24
	bl	_ereport
LBB0_7:
	ldr	w20, [x27]
Lloh44:
	adrp	x0, l_.str.2@PAGE
Lloh45:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_errmsg
	mov	x1, x0
	mov	x0, x20
	bl	_ereport
LBB0_8:
	mov	x20, x25
LBB0_9:
Lloh46:
	adrp	x19, _INVALID_HANDLE_VALUE@GOTPAGE
Lloh47:
	ldr	x19, [x19, _INVALID_HANDLE_VALUE@GOTPAGEOFF]
Lloh48:
	adrp	x26, l_.str.4@PAGE
Lloh49:
	add	x26, x26, l_.str.4@PAGEOFF
Lloh50:
	adrp	x21, _ERROR_ALREADY_EXISTS@GOTPAGE
Lloh51:
	ldr	x21, [x21, _ERROR_ALREADY_EXISTS@GOTPAGEOFF]
Lloh52:
	adrp	x27, l_.str.5@PAGE
Lloh53:
	add	x27, x27, l_.str.5@PAGEOFF
LBB0_10:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_13 Depth 2
	mov	w25, #10
	b	LBB0_13
LBB0_11:                                ;   in Loop: Header=BB0_13 Depth=2
Lloh54:
	adrp	x8, _FATAL@GOTPAGE
Lloh55:
	ldr	x8, [x8, _FATAL@GOTPAGEOFF]
Lloh56:
	ldr	w28, [x8]
	bl	_GetLastError
                                        ; kill: def $w0 killed $w0 def $x0
	str	x0, [sp]
	mov	x0, x26
	bl	_errmsg
	stp	x20, x23, [sp]
	mov	x0, x27
	bl	_errdetail
	mov	x1, x0
	mov	x0, x28
	bl	_ereport
	bl	_GetLastError
	ldr	w8, [x21]
	cmp	w0, w8
	b.ne	LBB0_19
LBB0_12:                                ;   in Loop: Header=BB0_13 Depth=2
	mov	x0, x24
	bl	_CloseHandle
	mov	w0, #1000
	bl	_Sleep
	subs	w25, w25, #1
	b.eq	LBB0_19
LBB0_13:                                ;   Parent Loop BB0_10 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	w0, #0
	bl	_SetLastError
	ldr	w0, [x19]
	mov	x1, #0
	mov	x2, x22
	mov	w3, #0
	mov	x4, x20
	mov	x5, x23
	bl	_CreateFileMapping
	mov	x24, x0
	bl	_GetLastError
	cbz	x24, LBB0_15
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=2
	ldr	w8, [x21]
	cmp	w0, w8
	b.eq	LBB0_12
	b	LBB0_20
LBB0_15:                                ;   in Loop: Header=BB0_13 Depth=2
Lloh57:
	adrp	x8, _ERROR_NO_SYSTEM_RESOURCES@GOTPAGE
Lloh58:
	ldr	x8, [x8, _ERROR_NO_SYSTEM_RESOURCES@GOTPAGEOFF]
Lloh59:
	ldr	w8, [x8]
	cmp	w0, w8
	b.ne	LBB0_11
; %bb.16:                               ;   in Loop: Header=BB0_13 Depth=2
Lloh60:
	adrp	x8, _huge_pages@GOTPAGE
Lloh61:
	ldr	x8, [x8, _huge_pages@GOTPAGEOFF]
Lloh62:
	ldr	x8, [x8]
Lloh63:
	adrp	x9, _HUGE_PAGES_TRY@GOTPAGE
Lloh64:
	ldr	x9, [x9, _HUGE_PAGES_TRY@GOTPAGEOFF]
Lloh65:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_11
; %bb.17:                               ;   in Loop: Header=BB0_13 Depth=2
Lloh66:
	adrp	x8, _SEC_LARGE_PAGES@GOTPAGE
Lloh67:
	ldr	x8, [x8, _SEC_LARGE_PAGES@GOTPAGEOFF]
Lloh68:
	ldr	w8, [x8]
	tst	w8, w22
	b.eq	LBB0_11
; %bb.18:                               ;   in Loop: Header=BB0_10 Depth=1
Lloh69:
	adrp	x8, _DEBUG1@GOTPAGE
Lloh70:
	ldr	x8, [x8, _DEBUG1@GOTPAGEOFF]
Lloh71:
	ldr	w0, [x8]
Lloh72:
	adrp	x1, l_.str.3@PAGE
Lloh73:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x2, x20
	bl	_elog
Lloh74:
	adrp	x8, _PAGE_READWRITE@GOTPAGE
Lloh75:
	ldr	x8, [x8, _PAGE_READWRITE@GOTPAGEOFF]
Lloh76:
	ldr	w22, [x8]
	ldr	w20, [sp, #28]                  ; 4-byte Folded Reload
	b	LBB0_10
LBB0_19:
Lloh77:
	adrp	x8, _FATAL@GOTPAGE
Lloh78:
	ldr	x8, [x8, _FATAL@GOTPAGEOFF]
Lloh79:
	ldr	w21, [x8]
Lloh80:
	adrp	x0, l_.str.6@PAGE
Lloh81:
	add	x0, x0, l_.str.6@PAGEOFF
	bl	_errmsg
Lloh82:
	adrp	x0, l_.str.7@PAGE
Lloh83:
	add	x0, x0, l_.str.7@PAGEOFF
	bl	_errhint
	mov	x1, x0
	mov	x0, x21
	bl	_ereport
	mov	x24, #0
LBB0_20:
	mov	x0, x23
	bl	_free
	bl	_GetCurrentProcess
	mov	x21, x0
	bl	_GetCurrentProcess
	mov	x2, x0
Lloh84:
	adrp	x8, _TRUE@GOTPAGE
Lloh85:
	ldr	x8, [x8, _TRUE@GOTPAGEOFF]
Lloh86:
	ldr	w5, [x8]
Lloh87:
	adrp	x8, _DUPLICATE_SAME_ACCESS@GOTPAGE
Lloh88:
	ldr	x8, [x8, _DUPLICATE_SAME_ACCESS@GOTPAGEOFF]
Lloh89:
	ldr	w6, [x8]
	add	x3, sp, #40
	mov	x0, x21
	mov	x1, x24
	mov	w4, #0
	bl	_DuplicateHandle
Lloh90:
	adrp	x19, _UsedShmemSegAddr@GOTPAGE
Lloh91:
	ldr	x19, [x19, _UsedShmemSegAddr@GOTPAGEOFF]
	cbnz	w0, LBB0_22
; %bb.21:
Lloh92:
	adrp	x8, _FATAL@GOTPAGE
Lloh93:
	ldr	x8, [x8, _FATAL@GOTPAGEOFF]
Lloh94:
	ldr	w21, [x8]
	bl	_GetLastError
                                        ; kill: def $w0 killed $w0 def $x0
	str	x0, [sp]
Lloh95:
	adrp	x0, l_.str.4@PAGE
Lloh96:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_errmsg
Lloh97:
	adrp	x0, l_.str.8@PAGE
Lloh98:
	add	x0, x0, l_.str.8@PAGEOFF
	bl	_errdetail
	mov	x1, x0
	mov	x0, x21
	bl	_ereport
LBB0_22:
	mov	x0, x24
	bl	_CloseHandle
	cbnz	w0, LBB0_24
; %bb.23:
Lloh99:
	adrp	x8, _LOG@GOTPAGE
Lloh100:
	ldr	x8, [x8, _LOG@GOTPAGEOFF]
Lloh101:
	ldr	w21, [x8]
	bl	_GetLastError
	mov	x2, x0
Lloh102:
	adrp	x1, l_.str.9@PAGE
Lloh103:
	add	x1, x1, l_.str.9@PAGEOFF
	mov	x0, x21
	bl	_elog
LBB0_24:
Lloh104:
	adrp	x8, _FILE_MAP_WRITE@GOTPAGE
Lloh105:
	ldr	x8, [x8, _FILE_MAP_WRITE@GOTPAGEOFF]
	ldr	x0, [sp, #40]
Lloh106:
	ldr	w8, [x8]
Lloh107:
	adrp	x9, _FILE_MAP_READ@GOTPAGE
Lloh108:
	ldr	x9, [x9, _FILE_MAP_READ@GOTPAGEOFF]
Lloh109:
	ldr	w9, [x9]
	orr	w1, w9, w8
	mov	w2, #0
	mov	w3, #0
	mov	w4, #0
	mov	x5, #0
	bl	_MapViewOfFileEx
	mov	x21, x0
	cbnz	x0, LBB0_26
; %bb.25:
Lloh110:
	adrp	x8, _FATAL@GOTPAGE
Lloh111:
	ldr	x8, [x8, _FATAL@GOTPAGEOFF]
Lloh112:
	ldr	w22, [x8]
	bl	_GetLastError
                                        ; kill: def $w0 killed $w0 def $x0
	str	x0, [sp]
Lloh113:
	adrp	x0, l_.str.4@PAGE
Lloh114:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_errmsg
Lloh115:
	adrp	x0, l_.str.10@PAGE
Lloh116:
	add	x0, x0, l_.str.10@PAGEOFF
	bl	_errdetail
	mov	x1, x0
	mov	x0, x22
	bl	_ereport
LBB0_26:
	bl	_getpid
Lloh117:
	adrp	x8, _PGShmemMagic@GOTPAGE
Lloh118:
	ldr	x8, [x8, _PGShmemMagic@GOTPAGEOFF]
Lloh119:
	ldr	w8, [x8]
	stp	w8, w0, [x21, #16]
	str	w20, [x21]
	mov	w0, #24
	bl	_MAXALIGN
	str	w0, [x21, #4]
	str	xzr, [x21, #8]
	str	x21, [x19]
Lloh120:
	adrp	x8, _UsedShmemSegSize@GOTPAGE
Lloh121:
	ldr	x8, [x8, _UsedShmemSegSize@GOTPAGEOFF]
Lloh122:
	str	w20, [x8]
	ldr	x0, [sp, #40]
Lloh123:
	adrp	x8, _UsedShmemSegID@GOTPAGE
Lloh124:
	ldr	x8, [x8, _UsedShmemSegID@GOTPAGEOFF]
Lloh125:
	str	x0, [x8]
Lloh126:
	adrp	x8, _pgwin32_SharedMemoryDelete@GOTPAGE
Lloh127:
	ldr	x8, [x8, _pgwin32_SharedMemoryDelete@GOTPAGEOFF]
Lloh128:
	ldr	w20, [x8]
	bl	_PointerGetDatum
	mov	x1, x0
	mov	x0, x20
	bl	_on_shmem_exit
	ldr	x8, [sp, #32]                   ; 8-byte Folded Reload
	str	x21, [x8]
	mov	x0, x21
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
	.loh AdrpLdrGotStr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGotStr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpAdd	Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpAdd	Lloh44, Lloh45
	.loh AdrpAdd	Lloh52, Lloh53
	.loh AdrpLdrGot	Lloh50, Lloh51
	.loh AdrpAdd	Lloh48, Lloh49
	.loh AdrpLdrGot	Lloh46, Lloh47
	.loh AdrpLdrGotLdr	Lloh54, Lloh55, Lloh56
	.loh AdrpLdrGotLdr	Lloh57, Lloh58, Lloh59
	.loh AdrpLdrGotLdr	Lloh63, Lloh64, Lloh65
	.loh AdrpLdrGotLdr	Lloh60, Lloh61, Lloh62
	.loh AdrpLdrGotLdr	Lloh66, Lloh67, Lloh68
	.loh AdrpLdrGotLdr	Lloh74, Lloh75, Lloh76
	.loh AdrpAdd	Lloh72, Lloh73
	.loh AdrpLdrGotLdr	Lloh69, Lloh70, Lloh71
	.loh AdrpAdd	Lloh82, Lloh83
	.loh AdrpAdd	Lloh80, Lloh81
	.loh AdrpLdrGotLdr	Lloh77, Lloh78, Lloh79
	.loh AdrpLdrGot	Lloh90, Lloh91
	.loh AdrpLdrGotLdr	Lloh87, Lloh88, Lloh89
	.loh AdrpLdrGotLdr	Lloh84, Lloh85, Lloh86
	.loh AdrpAdd	Lloh97, Lloh98
	.loh AdrpAdd	Lloh95, Lloh96
	.loh AdrpLdrGotLdr	Lloh92, Lloh93, Lloh94
	.loh AdrpAdd	Lloh102, Lloh103
	.loh AdrpLdrGotLdr	Lloh99, Lloh100, Lloh101
	.loh AdrpLdrGotLdr	Lloh107, Lloh108, Lloh109
	.loh AdrpLdrGotLdr	Lloh104, Lloh105, Lloh106
	.loh AdrpAdd	Lloh115, Lloh116
	.loh AdrpAdd	Lloh113, Lloh114
	.loh AdrpLdrGotLdr	Lloh110, Lloh111, Lloh112
	.loh AdrpLdrGotLdr	Lloh126, Lloh127, Lloh128
	.loh AdrpLdrGotStr	Lloh123, Lloh124, Lloh125
	.loh AdrpLdrGotStr	Lloh120, Lloh121, Lloh122
	.loh AdrpLdrGotLdr	Lloh117, Lloh118, Lloh119
	.cfi_endproc
                                        ; -- End function
	.comm	_PAGE_READWRITE,4,2             ; @PAGE_READWRITE
	.comm	_PROTECTIVE_REGION_SIZE,4,2     ; @PROTECTIVE_REGION_SIZE
	.comm	_MEM_RESERVE,4,2                ; @MEM_RESERVE
	.comm	_PAGE_NOACCESS,4,2              ; @PAGE_NOACCESS
	.comm	_ShmemProtectiveRegion,8,3      ; @ShmemProtectiveRegion
	.comm	_FATAL,4,2                      ; @FATAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"could not reserve memory region: error code %lu"

	.comm	_UsedShmemSegAddr,8,3           ; @UsedShmemSegAddr
	.comm	_huge_pages,8,3                 ; @huge_pages
	.comm	_HUGE_PAGES_ON,8,3              ; @HUGE_PAGES_ON
	.comm	_HUGE_PAGES_TRY,8,3             ; @HUGE_PAGES_TRY
	.comm	_DEBUG1,4,2                     ; @DEBUG1
	.comm	_ERRCODE_FEATURE_NOT_SUPPORTED,4,2 ; @ERRCODE_FEATURE_NOT_SUPPORTED
l_.str.1:                               ; @.str.1
	.asciz	"the processor does not support large pages"

l_.str.2:                               ; @.str.2
	.asciz	"disabling huge pages"

	.comm	_SEC_COMMIT,4,2                 ; @SEC_COMMIT
	.comm	_SEC_LARGE_PAGES,4,2            ; @SEC_LARGE_PAGES
	.comm	_INVALID_HANDLE_VALUE,4,2       ; @INVALID_HANDLE_VALUE
	.comm	_ERROR_NO_SYSTEM_RESOURCES,4,2  ; @ERROR_NO_SYSTEM_RESOURCES
l_.str.3:                               ; @.str.3
	.asciz	"CreateFileMapping(%zu) with SEC_LARGE_PAGES failed, huge pages disabled"

l_.str.4:                               ; @.str.4
	.asciz	"could not create shared memory segment: error code %lu"

l_.str.5:                               ; @.str.5
	.asciz	"Failed system call was CreateFileMapping(size=%zu, name=%s)."

	.comm	_ERROR_ALREADY_EXISTS,4,2       ; @ERROR_ALREADY_EXISTS
l_.str.6:                               ; @.str.6
	.asciz	"pre-existing shared memory block is still in use"

l_.str.7:                               ; @.str.7
	.asciz	"Check if there are any old server processes still running, and terminate them."

	.comm	_TRUE,4,2                       ; @TRUE
	.comm	_DUPLICATE_SAME_ACCESS,4,2      ; @DUPLICATE_SAME_ACCESS
l_.str.8:                               ; @.str.8
	.asciz	"Failed system call was DuplicateHandle."

	.comm	_LOG,4,2                        ; @LOG
l_.str.9:                               ; @.str.9
	.asciz	"could not close handle to shared memory: error code %lu"

	.comm	_FILE_MAP_WRITE,4,2             ; @FILE_MAP_WRITE
	.comm	_FILE_MAP_READ,4,2              ; @FILE_MAP_READ
l_.str.10:                              ; @.str.10
	.asciz	"Failed system call was MapViewOfFileEx."

	.comm	_PGShmemMagic,4,2               ; @PGShmemMagic
	.comm	_UsedShmemSegSize,4,2           ; @UsedShmemSegSize
	.comm	_UsedShmemSegID,8,3             ; @UsedShmemSegID
	.comm	_pgwin32_SharedMemoryDelete,4,2 ; @pgwin32_SharedMemoryDelete
.subsections_via_symbols
