	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_test_named2                    ## -- Begin function test_named2
	.p2align	4, 0x90
_test_named2:                           ## @test_named2
	.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
	leaq	L_str(%rip), %rdi
	callq	_puts
	movq	_SEM_NAME@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	callq	_sem_unlink
	movl	(%r12), %edi
	movq	_O_CREAT@GOTPCREL(%rip), %r13
	movq	_O_EXCL@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	orl	(%r13), %esi
	movl	$511, %edx                      ## imm = 0x1FF
	xorl	%ecx, %ecx
	xorl	%eax, %eax
	callq	_sem_open
	movq	%rax, %r14
	movq	_SEM_FAILED@GOTPCREL(%rip), %r15
	cmpq	(%r15), %rax
	jne	LBB0_2
## %bb.1:
	leaq	L_.str.1(%rip), %rsi
	movl	$1, %edi
	callq	_err
LBB0_2:
	movl	(%r12), %edi
	movl	(%rbx), %esi
	orl	(%r13), %esi
	movl	$511, %edx                      ## imm = 0x1FF
	xorl	%ecx, %ecx
	xorl	%eax, %eax
	callq	_sem_open
	cmpq	(%r15), %rax
	je	LBB0_4
## %bb.3:
	leaq	L_.str.2(%rip), %rsi
	movl	$2, %edi
	callq	_errx
LBB0_4:
	movq	_errno@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_EEXIST@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_6
## %bb.5:
	leaq	L_.str.3(%rip), %rsi
	movl	$3, %edi
	callq	_err
LBB0_6:
	movl	(%r12), %edi
	xorl	%esi, %esi
	xorl	%eax, %eax
	callq	_sem_open
	movq	%rax, %rbx
	cmpq	(%r15), %rax
	je	LBB0_7
## %bb.8:
	cmpq	%rbx, %r14
	je	LBB0_10
LBB0_9:
	leaq	L_.str.5(%rip), %rsi
	movl	$5, %edi
	callq	_errx
LBB0_10:
	movq	%rbx, %rdi
	callq	_sem_close
	testq	%rax, %rax
	je	LBB0_12
## %bb.11:
	leaq	L_.str.6(%rip), %rsi
	movl	$6, %edi
	callq	_err
LBB0_12:
	movq	%r14, %rdi
	callq	_sem_close
	testq	%rax, %rax
	je	LBB0_14
## %bb.13:
	leaq	L_.str.6(%rip), %rsi
	movl	$7, %edi
	callq	_err
LBB0_14:
	leaq	L_str.8(%rip), %rdi
	callq	_puts
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	leaq	L_.str.4(%rip), %rsi
	movl	$4, %edi
	callq	_err
	cmpq	%rbx, %r14
	jne	LBB0_9
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_SEM_NAME,4,2                   ## @SEM_NAME
	.comm	_O_CREAT,4,2                    ## @O_CREAT
	.comm	_O_EXCL,4,2                     ## @O_EXCL
	.comm	_SEM_FAILED,8,3                 ## @SEM_FAILED
	.section	__TEXT,__cstring,cstring_literals
L_.str.1:                               ## @.str.1
	.asciz	"sem_open failed"

L_.str.2:                               ## @.str.2
	.asciz	"second sem_open call wrongly succeeded"

	.comm	_errno,8,3                      ## @errno
	.comm	_EEXIST,8,3                     ## @EEXIST
L_.str.3:                               ## @.str.3
	.asciz	"second sem_open call failed with wrong errno"

L_.str.4:                               ## @.str.4
	.asciz	"third sem_open call failed"

L_.str.5:                               ## @.str.5
	.asciz	"two sem_open calls for same semaphore do not return same address"

L_.str.6:                               ## @.str.6
	.asciz	"sem_close failed"

L_str:                                  ## @str
	.asciz	"testing named process-shared semaphore, O_EXCL cases"

L_str.8:                                ## @str.8
	.asciz	"OK."

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_test_named2                    ; -- Begin function test_named2
	.p2align	2
_test_named2:                           ; @test_named2
	.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
Lloh0:
	adrp	x0, l_str@PAGE
Lloh1:
	add	x0, x0, l_str@PAGEOFF
	bl	_puts
Lloh2:
	adrp	x20, _SEM_NAME@GOTPAGE
Lloh3:
	ldr	x20, [x20, _SEM_NAME@GOTPAGEOFF]
	ldr	w0, [x20]
	bl	_sem_unlink
Lloh4:
	adrp	x22, _O_CREAT@GOTPAGE
Lloh5:
	ldr	x22, [x22, _O_CREAT@GOTPAGEOFF]
	ldr	w0, [x20]
	ldr	w8, [x22]
Lloh6:
	adrp	x23, _O_EXCL@GOTPAGE
Lloh7:
	ldr	x23, [x23, _O_EXCL@GOTPAGEOFF]
	ldr	w9, [x23]
	orr	w1, w9, w8
	mov	w8, #511
	stp	x8, xzr, [sp]
	bl	_sem_open
	mov	x19, x0
Lloh8:
	adrp	x21, _SEM_FAILED@GOTPAGE
Lloh9:
	ldr	x21, [x21, _SEM_FAILED@GOTPAGEOFF]
	ldr	x8, [x21]
	cmp	x0, x8
	b.ne	LBB0_2
; %bb.1:
Lloh10:
	adrp	x1, l_.str.1@PAGE
Lloh11:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w0, #1
	bl	_err
LBB0_2:
	ldr	w0, [x20]
	ldr	w8, [x22]
	ldr	w9, [x23]
	orr	w1, w9, w8
	mov	w8, #511
	stp	x8, xzr, [sp]
	bl	_sem_open
	ldr	x8, [x21]
	cmp	x0, x8
	b.eq	LBB0_4
; %bb.3:
Lloh12:
	adrp	x1, l_.str.2@PAGE
Lloh13:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	w0, #2
	bl	_errx
LBB0_4:
Lloh14:
	adrp	x8, _errno@GOTPAGE
Lloh15:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh16:
	ldr	x8, [x8]
Lloh17:
	adrp	x9, _EEXIST@GOTPAGE
Lloh18:
	ldr	x9, [x9, _EEXIST@GOTPAGEOFF]
Lloh19:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_6
; %bb.5:
Lloh20:
	adrp	x1, l_.str.3@PAGE
Lloh21:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	w0, #3
	bl	_err
LBB0_6:
	ldr	w0, [x20]
	mov	w1, #0
	bl	_sem_open
	mov	x20, x0
	ldr	x8, [x21]
	cmp	x0, x8
	b.eq	LBB0_14
; %bb.7:
	cmp	x19, x20
	b.eq	LBB0_9
LBB0_8:
Lloh22:
	adrp	x1, l_.str.5@PAGE
Lloh23:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	w0, #5
	bl	_errx
LBB0_9:
	mov	x0, x20
	bl	_sem_close
	cbz	x0, LBB0_11
; %bb.10:
Lloh24:
	adrp	x1, l_.str.6@PAGE
Lloh25:
	add	x1, x1, l_.str.6@PAGEOFF
	mov	w0, #6
	bl	_err
LBB0_11:
	mov	x0, x19
	bl	_sem_close
	cbz	x0, LBB0_13
; %bb.12:
Lloh26:
	adrp	x1, l_.str.6@PAGE
Lloh27:
	add	x1, x1, l_.str.6@PAGEOFF
	mov	w0, #7
	bl	_err
LBB0_13:
Lloh28:
	adrp	x0, l_str.8@PAGE
Lloh29:
	add	x0, x0, l_str.8@PAGEOFF
	bl	_puts
	mov	w0, #0
	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_14:
Lloh30:
	adrp	x1, l_.str.4@PAGE
Lloh31:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	w0, #4
	bl	_err
	cmp	x19, x20
	b.ne	LBB0_8
	b	LBB0_9
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpAdd	Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.comm	_SEM_NAME,4,2                   ; @SEM_NAME
	.comm	_O_CREAT,4,2                    ; @O_CREAT
	.comm	_O_EXCL,4,2                     ; @O_EXCL
	.comm	_SEM_FAILED,8,3                 ; @SEM_FAILED
	.section	__TEXT,__cstring,cstring_literals
l_.str.1:                               ; @.str.1
	.asciz	"sem_open failed"

l_.str.2:                               ; @.str.2
	.asciz	"second sem_open call wrongly succeeded"

	.comm	_errno,8,3                      ; @errno
	.comm	_EEXIST,8,3                     ; @EEXIST
l_.str.3:                               ; @.str.3
	.asciz	"second sem_open call failed with wrong errno"

l_.str.4:                               ; @.str.4
	.asciz	"third sem_open call failed"

l_.str.5:                               ; @.str.5
	.asciz	"two sem_open calls for same semaphore do not return same address"

l_.str.6:                               ; @.str.6
	.asciz	"sem_close failed"

l_str:                                  ; @str
	.asciz	"testing named process-shared semaphore, O_EXCL cases"

l_str.8:                                ; @str.8
	.asciz	"OK."

.subsections_via_symbols
