	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function exclusive_create_existing_semaphore
_exclusive_create_existing_semaphore:   ## @exclusive_create_existing_semaphore
	.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	_TEST_PATH@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movq	_O_CREAT@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edx
	leaq	-20(%rbp), %rdi
	movl	$511, %ecx                      ## imm = 0x1FF
	movl	$1, %r8d
	callq	_ksem_open
	testq	%rax, %rax
	js	LBB0_1
## %bb.2:
	movl	-20(%rbp), %edi
	callq	_ksem_close
	movl	(%r14), %edi
	movq	_O_EXCL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	orl	(%rbx), %esi
	movq	_EEXIST@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movl	$511, %edx                      ## imm = 0x1FF
	movl	$1, %ecx
	callq	_ksem_open_should_fail
	movl	(%r14), %edi
	callq	_ksem_unlink
	jmp	LBB0_3
LBB0_1:
	leaq	L_.str(%rip), %rdi
	callq	_fail_errno
LBB0_3:
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_TEST_PATH,4,2                  ## @TEST_PATH
	.comm	_O_CREAT,4,2                    ## @O_CREAT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ksem_open(O_CREAT)"

	.comm	_O_EXCL,4,2                     ## @O_EXCL
	.comm	_EEXIST,4,2                     ## @EEXIST
	.no_dead_strip	_exclusive_create_existing_semaphore
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function exclusive_create_existing_semaphore
_exclusive_create_existing_semaphore:   ; @exclusive_create_existing_semaphore
	.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	x19, _TEST_PATH@GOTPAGE
Lloh1:
	ldr	x19, [x19, _TEST_PATH@GOTPAGEOFF]
	ldr	w1, [x19]
Lloh2:
	adrp	x20, _O_CREAT@GOTPAGE
Lloh3:
	ldr	x20, [x20, _O_CREAT@GOTPAGEOFF]
	ldr	w2, [x20]
	add	x0, sp, #12
	mov	w3, #511
	mov	w4, #1
	bl	_ksem_open
	tbnz	x0, #63, LBB0_2
; %bb.1:
	ldr	w0, [sp, #12]
	bl	_ksem_close
	ldr	w0, [x19]
Lloh4:
	adrp	x8, _O_EXCL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _O_EXCL@GOTPAGEOFF]
	ldr	w9, [x20]
Lloh6:
	ldr	w8, [x8]
	orr	w1, w8, w9
Lloh7:
	adrp	x8, _EEXIST@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EEXIST@GOTPAGEOFF]
Lloh9:
	ldr	w4, [x8]
	mov	w2, #511
	mov	w3, #1
	bl	_ksem_open_should_fail
	ldr	w0, [x19]
	bl	_ksem_unlink
	b	LBB0_3
LBB0_2:
Lloh10:
	adrp	x0, l_.str@PAGE
Lloh11:
	add	x0, x0, l_.str@PAGEOFF
	bl	_fail_errno
LBB0_3:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_TEST_PATH,4,2                  ; @TEST_PATH
	.comm	_O_CREAT,4,2                    ; @O_CREAT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ksem_open(O_CREAT)"

	.comm	_O_EXCL,4,2                     ; @O_EXCL
	.comm	_EEXIST,4,2                     ; @EEXIST
	.no_dead_strip	_exclusive_create_existing_semaphore
.subsections_via_symbols
