	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pgwin32_ReserveSharedMemoryRegion ## -- Begin function pgwin32_ReserveSharedMemoryRegion
	.p2align	4, 0x90
_pgwin32_ReserveSharedMemoryRegion:     ## @pgwin32_ReserveSharedMemoryRegion
	.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	%edi, %r12d
	movq	_ShmemProtectiveRegion@GOTPCREL(%rip), %rbx
	xorl	%edi, %edi
	cmpq	$0, (%rbx)
	setne	%dil
	callq	_Assert
	movq	_UsedShmemSegAddr@GOTPCREL(%rip), %r15
	xorl	%edi, %edi
	cmpq	$0, (%r15)
	setne	%dil
	callq	_Assert
	movq	_UsedShmemSegSize@GOTPCREL(%rip), %r14
	xorl	%edi, %edi
	cmpq	$0, (%r14)
	setne	%dil
	callq	_Assert
	movq	(%rbx), %rsi
	movq	_PROTECTIVE_REGION_SIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	movq	_MEM_RESERVE@GOTPCREL(%rip), %r13
	movl	(%r13), %ecx
	movq	_PAGE_NOACCESS@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movl	%r12d, %edi
	callq	_VirtualAllocEx
	testq	%rax, %rax
	je	LBB0_1
## %bb.3:
	movq	(%rbx), %rcx
	cmpq	%rcx, %rax
	je	LBB0_4
LBB0_8:
	movq	_LOG@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edi
	leaq	L_.str.1(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%rax, %rdx
	xorl	%eax, %eax
	callq	_elog
	jmp	LBB0_9
LBB0_1:
	movq	_LOG@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	(%rbx), %r15
LBB0_2:
	movslq	%r12d, %r12
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_GetLastError
	leaq	L_.str(%rip), %rsi
	movl	%r14d, %edi
	movq	%r15, %rdx
	movq	%r12, %rcx
	movl	%eax, %r8d
	xorl	%eax, %eax
	callq	_elog
LBB0_9:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movq	(%r15), %rsi
	movq	(%r14), %rdx
	movl	(%r13), %ecx
	movq	_PAGE_READWRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movl	%r12d, %edi
	callq	_VirtualAllocEx
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:
	movq	(%r15), %rcx
	cmpq	%rcx, %rax
	jne	LBB0_8
## %bb.7:
	movl	$1, %ebx
	jmp	LBB0_9
LBB0_5:
	movq	_LOG@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	(%r15), %r15
	jmp	LBB0_2
	.cfi_endproc
                                        ## -- End function
	.comm	_ShmemProtectiveRegion,8,3      ## @ShmemProtectiveRegion
	.comm	_UsedShmemSegAddr,8,3           ## @UsedShmemSegAddr
	.comm	_UsedShmemSegSize,8,3           ## @UsedShmemSegSize
	.comm	_PROTECTIVE_REGION_SIZE,8,3     ## @PROTECTIVE_REGION_SIZE
	.comm	_MEM_RESERVE,4,2                ## @MEM_RESERVE
	.comm	_PAGE_NOACCESS,4,2              ## @PAGE_NOACCESS
	.comm	_LOG,4,2                        ## @LOG
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"could not reserve shared memory region (addr=%p) for child %p: error code %lu"

L_.str.1:                               ## @.str.1
	.asciz	"reserved shared memory region got incorrect address %p, expected %p"

	.comm	_PAGE_READWRITE,4,2             ## @PAGE_READWRITE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pgwin32_ReserveSharedMemoryRegion ; -- Begin function pgwin32_ReserveSharedMemoryRegion
	.p2align	2
_pgwin32_ReserveSharedMemoryRegion:     ; @pgwin32_ReserveSharedMemoryRegion
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x0
Lloh0:
	adrp	x22, _ShmemProtectiveRegion@GOTPAGE
Lloh1:
	ldr	x22, [x22, _ShmemProtectiveRegion@GOTPAGEOFF]
	ldr	x8, [x22]
	cmp	x8, #0
	cset	w0, ne
	bl	_Assert
Lloh2:
	adrp	x21, _UsedShmemSegAddr@GOTPAGE
Lloh3:
	ldr	x21, [x21, _UsedShmemSegAddr@GOTPAGEOFF]
	ldr	x8, [x21]
	cmp	x8, #0
	cset	w0, ne
	bl	_Assert
Lloh4:
	adrp	x20, _UsedShmemSegSize@GOTPAGE
Lloh5:
	ldr	x20, [x20, _UsedShmemSegSize@GOTPAGEOFF]
	ldr	x8, [x20]
	cmp	x8, #0
	cset	w0, ne
	bl	_Assert
	ldr	x1, [x22]
Lloh6:
	adrp	x8, _PROTECTIVE_REGION_SIZE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _PROTECTIVE_REGION_SIZE@GOTPAGEOFF]
Lloh8:
	ldr	x2, [x8]
Lloh9:
	adrp	x23, _MEM_RESERVE@GOTPAGE
Lloh10:
	ldr	x23, [x23, _MEM_RESERVE@GOTPAGEOFF]
	ldr	w3, [x23]
Lloh11:
	adrp	x8, _PAGE_NOACCESS@GOTPAGE
Lloh12:
	ldr	x8, [x8, _PAGE_NOACCESS@GOTPAGEOFF]
Lloh13:
	ldr	w4, [x8]
	mov	x0, x19
	bl	_VirtualAllocEx
	cbz	x0, LBB0_3
; %bb.1:
	mov	x2, x0
	ldr	x3, [x22]
	cmp	x0, x3
	b.eq	LBB0_7
LBB0_2:
Lloh14:
	adrp	x8, _LOG@GOTPAGE
Lloh15:
	ldr	x8, [x8, _LOG@GOTPAGEOFF]
Lloh16:
	ldr	w0, [x8]
Lloh17:
	adrp	x1, l_.str.1@PAGE
Lloh18:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_5
LBB0_3:
Lloh19:
	adrp	x8, _LOG@GOTPAGE
Lloh20:
	ldr	x8, [x8, _LOG@GOTPAGEOFF]
Lloh21:
	ldr	w20, [x8]
	ldr	x21, [x22]
LBB0_4:
	sxtw	x19, w19
	bl	_GetLastError
                                        ; kill: def $w0 killed $w0 def $x0
	str	x0, [sp]
Lloh22:
	adrp	x1, l_.str@PAGE
Lloh23:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	mov	x2, x21
	mov	x3, x19
LBB0_5:
	bl	_elog
	mov	w0, #0
LBB0_6:
	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
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_7:
	ldr	x1, [x21]
	ldr	x2, [x20]
	ldr	w3, [x23]
Lloh24:
	adrp	x8, _PAGE_READWRITE@GOTPAGE
Lloh25:
	ldr	x8, [x8, _PAGE_READWRITE@GOTPAGEOFF]
Lloh26:
	ldr	w4, [x8]
	mov	x0, x19
	bl	_VirtualAllocEx
	cbz	x0, LBB0_10
; %bb.8:
	mov	x2, x0
	ldr	x3, [x21]
	cmp	x0, x3
	b.ne	LBB0_2
; %bb.9:
	mov	w0, #1
	b	LBB0_6
LBB0_10:
Lloh27:
	adrp	x8, _LOG@GOTPAGE
Lloh28:
	ldr	x8, [x8, _LOG@GOTPAGEOFF]
Lloh29:
	ldr	w20, [x8]
	ldr	x21, [x21]
                                        ; kill: def $w19 killed $w19 killed $x19 def $x19
	b	LBB0_4
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.comm	_ShmemProtectiveRegion,8,3      ; @ShmemProtectiveRegion
	.comm	_UsedShmemSegAddr,8,3           ; @UsedShmemSegAddr
	.comm	_UsedShmemSegSize,8,3           ; @UsedShmemSegSize
	.comm	_PROTECTIVE_REGION_SIZE,8,3     ; @PROTECTIVE_REGION_SIZE
	.comm	_MEM_RESERVE,4,2                ; @MEM_RESERVE
	.comm	_PAGE_NOACCESS,4,2              ; @PAGE_NOACCESS
	.comm	_LOG,4,2                        ; @LOG
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"could not reserve shared memory region (addr=%p) for child %p: error code %lu"

l_.str.1:                               ; @.str.1
	.asciz	"reserved shared memory region got incorrect address %p, expected %p"

	.comm	_PAGE_READWRITE,4,2             ; @PAGE_READWRITE
.subsections_via_symbols
