	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_PGReserveSemaphores            ## -- Begin function PGReserveSemaphores
	.p2align	4, 0x90
_PGReserveSemaphores:                   ## @PGReserveSemaphores
	.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
	movl	%edi, %ebx
	movq	_DataDir@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	leaq	-32(%rbp), %rsi
	callq	_stat
	testq	%rax, %rax
	jns	LBB0_2
## %bb.1:
	movq	_FATAL@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	xorl	%eax, %eax
	callq	_errcode_for_file_access
	movl	(%r15), %esi
	leaq	L_.str(%rip), %rdi
	callq	_errmsg
	movl	%r14d, %edi
	movl	%eax, %esi
	callq	_ereport
LBB0_2:
	movl	%ebx, %edi
	callq	_PGSemaphoreShmemSize
	movl	%eax, %edi
	callq	_ShmemAllocUnlocked
	movq	_sharedSemas@GOTPCREL(%rip), %rcx
	movq	%rax, (%rcx)
	movq	_numSharedSemas@GOTPCREL(%rip), %rax
	movq	$0, (%rax)
	movq	_maxSharedSemas@GOTPCREL(%rip), %rax
	movl	%ebx, (%rax)
	movq	_SEMAS_PER_SET@GOTPCREL(%rip), %r14
	movl	(%r14), %ecx
	leal	(%rbx,%rcx), %eax
	decl	%eax
	cltd
	idivl	%ecx
                                        ## kill: def $eax killed $eax def $rax
	movq	_maxSemaSets@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	leal	(,%rax,4), %edi
	callq	_malloc
	movq	_mySemaSets@GOTPCREL(%rip), %rcx
	movq	%rax, (%rcx)
	testq	%rax, %rax
	jne	LBB0_4
## %bb.3:
	movq	_PANIC@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_elog
LBB0_4:
	movq	_numSemaSets@GOTPCREL(%rip), %rax
	movq	$0, (%rax)
	movl	-32(%rbp), %eax
	movq	_nextSemaKey@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	movl	(%r14), %eax
	movq	_nextSemaNumber@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	movq	_ReleaseSemaphores@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	xorl	%esi, %esi
	callq	_on_shmem_exit
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DataDir,4,2                    ## @DataDir
	.comm	_FATAL,4,2                      ## @FATAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"could not stat data directory \"%s\": %m"

	.comm	_sharedSemas,8,3                ## @sharedSemas
	.comm	_numSharedSemas,8,3             ## @numSharedSemas
	.comm	_maxSharedSemas,4,2             ## @maxSharedSemas
	.comm	_SEMAS_PER_SET,4,2              ## @SEMAS_PER_SET
	.comm	_maxSemaSets,4,2                ## @maxSemaSets
	.comm	_mySemaSets,8,3                 ## @mySemaSets
	.comm	_PANIC,4,2                      ## @PANIC
L_.str.1:                               ## @.str.1
	.asciz	"out of memory"

	.comm	_numSemaSets,8,3                ## @numSemaSets
	.comm	_nextSemaKey,4,2                ## @nextSemaKey
	.comm	_nextSemaNumber,4,2             ## @nextSemaNumber
	.comm	_ReleaseSemaphores,4,2          ## @ReleaseSemaphores
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_PGReserveSemaphores            ; -- Begin function PGReserveSemaphores
	.p2align	2
_PGReserveSemaphores:                   ; @PGReserveSemaphores
	.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
	mov	x19, x0
Lloh0:
	adrp	x21, _DataDir@GOTPAGE
Lloh1:
	ldr	x21, [x21, _DataDir@GOTPAGEOFF]
	ldr	w0, [x21]
	add	x1, sp, #8
	bl	_stat
	tbz	x0, #63, LBB0_2
; %bb.1:
Lloh2:
	adrp	x8, _FATAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _FATAL@GOTPAGEOFF]
Lloh4:
	ldr	w20, [x8]
	bl	_errcode_for_file_access
	ldr	w1, [x21]
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	bl	_errmsg
	mov	x1, x0
	mov	x0, x20
	bl	_ereport
LBB0_2:
	mov	x0, x19
	bl	_PGSemaphoreShmemSize
	bl	_ShmemAllocUnlocked
Lloh7:
	adrp	x8, _sharedSemas@GOTPAGE
Lloh8:
	ldr	x8, [x8, _sharedSemas@GOTPAGEOFF]
Lloh9:
	str	x0, [x8]
Lloh10:
	adrp	x8, _numSharedSemas@GOTPAGE
Lloh11:
	ldr	x8, [x8, _numSharedSemas@GOTPAGEOFF]
Lloh12:
	adrp	x9, _maxSharedSemas@GOTPAGE
Lloh13:
	ldr	x9, [x9, _maxSharedSemas@GOTPAGEOFF]
Lloh14:
	str	xzr, [x8]
Lloh15:
	str	w19, [x9]
Lloh16:
	adrp	x20, _SEMAS_PER_SET@GOTPAGE
Lloh17:
	ldr	x20, [x20, _SEMAS_PER_SET@GOTPAGEOFF]
	ldr	w8, [x20]
	add	w9, w19, w8
	sub	w9, w9, #1
	sdiv	w8, w9, w8
Lloh18:
	adrp	x9, _maxSemaSets@GOTPAGE
Lloh19:
	ldr	x9, [x9, _maxSemaSets@GOTPAGEOFF]
Lloh20:
	str	w8, [x9]
	lsl	w0, w8, #2
	bl	_malloc
Lloh21:
	adrp	x8, _mySemaSets@GOTPAGE
Lloh22:
	ldr	x8, [x8, _mySemaSets@GOTPAGEOFF]
Lloh23:
	str	x0, [x8]
	cbnz	x0, LBB0_4
; %bb.3:
Lloh24:
	adrp	x8, _PANIC@GOTPAGE
Lloh25:
	ldr	x8, [x8, _PANIC@GOTPAGEOFF]
Lloh26:
	ldr	w0, [x8]
Lloh27:
	adrp	x1, l_.str.1@PAGE
Lloh28:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_elog
LBB0_4:
Lloh29:
	adrp	x8, _numSemaSets@GOTPAGE
Lloh30:
	ldr	x8, [x8, _numSemaSets@GOTPAGEOFF]
Lloh31:
	str	xzr, [x8]
	ldr	w8, [sp, #8]
Lloh32:
	adrp	x9, _nextSemaKey@GOTPAGE
Lloh33:
	ldr	x9, [x9, _nextSemaKey@GOTPAGEOFF]
Lloh34:
	str	w8, [x9]
	ldr	w8, [x20]
Lloh35:
	adrp	x9, _nextSemaNumber@GOTPAGE
Lloh36:
	ldr	x9, [x9, _nextSemaNumber@GOTPAGEOFF]
Lloh37:
	str	w8, [x9]
Lloh38:
	adrp	x8, _ReleaseSemaphores@GOTPAGE
Lloh39:
	ldr	x8, [x8, _ReleaseSemaphores@GOTPAGEOFF]
Lloh40:
	ldr	w0, [x8]
	mov	w1, #0
	bl	_on_shmem_exit
	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 AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotStr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotStr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotStr	Lloh12, Lloh13, Lloh15
	.loh AdrpLdrGotStr	Lloh10, Lloh11, Lloh14
	.loh AdrpLdrGotStr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGotStr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotStr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotStr	Lloh29, Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.comm	_DataDir,4,2                    ; @DataDir
	.comm	_FATAL,4,2                      ; @FATAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"could not stat data directory \"%s\": %m"

	.comm	_sharedSemas,8,3                ; @sharedSemas
	.comm	_numSharedSemas,8,3             ; @numSharedSemas
	.comm	_maxSharedSemas,4,2             ; @maxSharedSemas
	.comm	_SEMAS_PER_SET,4,2              ; @SEMAS_PER_SET
	.comm	_maxSemaSets,4,2                ; @maxSemaSets
	.comm	_mySemaSets,8,3                 ; @mySemaSets
	.comm	_PANIC,4,2                      ; @PANIC
l_.str.1:                               ; @.str.1
	.asciz	"out of memory"

	.comm	_numSemaSets,8,3                ; @numSemaSets
	.comm	_nextSemaKey,4,2                ; @nextSemaKey
	.comm	_nextSemaNumber,4,2             ; @nextSemaNumber
	.comm	_ReleaseSemaphores,4,2          ; @ReleaseSemaphores
.subsections_via_symbols
