	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_PGSemaphoreCreate              ## -- Begin function PGSemaphoreCreate
	.p2align	4, 0x90
_PGSemaphoreCreate:                     ## @PGSemaphoreCreate
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	_IsUnderPostmaster@GOTPCREL(%rip), %rax
	xorl	%edi, %edi
	cmpl	$0, (%rax)
	sete	%dil
	callq	_Assert
	movq	_numSems@GOTPCREL(%rip), %r14
	movq	(%r14), %rax
	movq	_maxSems@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jl	LBB0_2
## %bb.1:
	movq	_PANIC@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_elog
LBB0_2:
	leaq	-32(%rbp), %rbx
	movq	%rbx, %rdi
	movl	$16, %esi
	callq	_ZeroMemory
	movl	$16, -32(%rbp)
	movq	$0, -24(%rbp)
	movq	_TRUE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -28(%rbp)
	movq	%rbx, %rdi
	movl	$1, %esi
	movl	$32767, %edx                    ## imm = 0x7FFF
	xorl	%ecx, %ecx
	callq	_CreateSemaphore
	movq	%rax, %rbx
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	_mySemSet@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%r14), %rcx
	leaq	1(%rcx), %rdx
	movq	%rdx, (%r14)
	movq	%rbx, (%rax,%rcx,8)
	jmp	LBB0_5
LBB0_4:
	movq	_PANIC@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	xorl	%eax, %eax
	callq	_GetLastError
	leaq	L_.str.1(%rip), %rdi
	movl	%eax, %esi
	callq	_errmsg
	movl	%r14d, %edi
	movl	%eax, %esi
	callq	_ereport
LBB0_5:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IsUnderPostmaster,4,2          ## @IsUnderPostmaster
	.comm	_numSems,8,3                    ## @numSems
	.comm	_maxSems,8,3                    ## @maxSems
	.comm	_PANIC,4,2                      ## @PANIC
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"too many semaphores created"

	.comm	_TRUE,4,2                       ## @TRUE
	.comm	_mySemSet,8,3                   ## @mySemSet
L_.str.1:                               ## @.str.1
	.asciz	"could not create semaphore: error code %lu"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_PGSemaphoreCreate              ; -- Begin function PGSemaphoreCreate
	.p2align	2
_PGSemaphoreCreate:                     ; @PGSemaphoreCreate
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
Lloh0:
	adrp	x8, _IsUnderPostmaster@GOTPAGE
Lloh1:
	ldr	x8, [x8, _IsUnderPostmaster@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, #0
	cset	w0, eq
	bl	_Assert
Lloh3:
	adrp	x20, _numSems@GOTPAGE
Lloh4:
	ldr	x20, [x20, _numSems@GOTPAGEOFF]
	ldr	x8, [x20]
Lloh5:
	adrp	x9, _maxSems@GOTPAGE
Lloh6:
	ldr	x9, [x9, _maxSems@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	cmp	x8, x9
	b.lt	LBB0_2
; %bb.1:
Lloh8:
	adrp	x8, _PANIC@GOTPAGE
Lloh9:
	ldr	x8, [x8, _PANIC@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
Lloh11:
	adrp	x1, l_.str@PAGE
Lloh12:
	add	x1, x1, l_.str@PAGEOFF
	bl	_elog
LBB0_2:
	mov	w19, #16
	mov	x0, sp
	mov	w1, #16
	bl	_ZeroMemory
	str	xzr, [sp, #8]
Lloh13:
	adrp	x8, _TRUE@GOTPAGE
Lloh14:
	ldr	x8, [x8, _TRUE@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	stp	w19, w8, [sp]
	mov	x0, sp
	mov	w1, #1
	mov	w2, #32767
	mov	x3, #0
	bl	_CreateSemaphore
	mov	x19, x0
	cbz	x0, LBB0_4
; %bb.3:
Lloh16:
	adrp	x8, _mySemSet@GOTPAGE
Lloh17:
	ldr	x8, [x8, _mySemSet@GOTPAGEOFF]
Lloh18:
	ldr	x8, [x8]
	ldr	x9, [x20]
	add	x10, x9, #1
	str	x10, [x20]
	str	x19, [x8, x9, lsl #3]
	b	LBB0_5
LBB0_4:
Lloh19:
	adrp	x8, _PANIC@GOTPAGE
Lloh20:
	ldr	x8, [x8, _PANIC@GOTPAGEOFF]
Lloh21:
	ldr	w20, [x8]
	bl	_GetLastError
	mov	x1, x0
Lloh22:
	adrp	x0, l_.str.1@PAGE
Lloh23:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_errmsg
	mov	x1, x0
	mov	x0, x20
	bl	_ereport
LBB0_5:
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_IsUnderPostmaster,4,2          ; @IsUnderPostmaster
	.comm	_numSems,8,3                    ; @numSems
	.comm	_maxSems,8,3                    ; @maxSems
	.comm	_PANIC,4,2                      ; @PANIC
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"too many semaphores created"

	.comm	_TRUE,4,2                       ; @TRUE
	.comm	_mySemSet,8,3                   ; @mySemSet
l_.str.1:                               ; @.str.1
	.asciz	"could not create semaphore: error code %lu"

.subsections_via_symbols
