	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_test_unnamed                   ## -- Begin function test_unnamed
	.p2align	4, 0x90
_test_unnamed:                          ## @test_unnamed
	.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
	leaq	L_str(%rip), %rdi
	callq	_puts
	movq	_PROT_READ@GOTPCREL(%rip), %rax
	movq	_PROT_WRITE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movq	_MAP_ANON@GOTPCREL(%rip), %rax
	movq	_MAP_SHARED@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	xorl	%edi, %edi
	movl	$4, %esi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	_mmap
	movq	%rax, %r14
	movq	_MAP_FAILED@GOTPCREL(%rip), %rax
	cmpq	%r14, (%rax)
	jne	LBB0_2
## %bb.1:
	leaq	L_.str.1(%rip), %rsi
	movl	$1, %edi
	callq	_err
LBB0_2:
	movq	%r14, %rdi
	movl	$1, %esi
	xorl	%edx, %edx
	callq	_sem_init
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	leaq	L_.str.2(%rip), %rsi
	movl	$2, %edi
	callq	_err
LBB0_4:
	xorl	%eax, %eax
	callq	_fork
	testl	%eax, %eax
	je	LBB0_5
## %bb.8:
	movl	%eax, %ebx
	movl	$1, %edi
	callq	_sleep
	leaq	L_str.10(%rip), %rdi
	callq	_puts
	movq	%r14, %rdi
	callq	_sem_post
	testq	%rax, %rax
	je	LBB0_10
## %bb.9:
	leaq	L_.str.7(%rip), %rsi
	movl	$4, %edi
	callq	_err
LBB0_10:
	leaq	-20(%rbp), %rsi
	movl	%ebx, %edi
	xorl	%edx, %edx
	callq	_waitpid
	movl	-20(%rbp), %edi
	callq	_WIFEXITED
	testq	%rax, %rax
	je	LBB0_13
## %bb.11:
	movl	-20(%rbp), %edi
	callq	_WEXITSTATUS
	testq	%rax, %rax
	je	LBB0_12
LBB0_13:
	leaq	L_.str.9(%rip), %rdi
	callq	_printf
	jmp	LBB0_14
LBB0_12:
	leaq	L_str.11(%rip), %rdi
	callq	_puts
LBB0_14:
	xorl	%eax, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_5:
	leaq	L_str.12(%rip), %rdi
	callq	_puts
	movq	%r14, %rdi
	callq	_sem_wait
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	leaq	L_.str.4(%rip), %rsi
	movl	$3, %edi
	callq	_err
LBB0_7:
	leaq	L_str.13(%rip), %rdi
	callq	_puts
	xorl	%edi, %edi
	callq	_exit
	.cfi_endproc
                                        ## -- End function
	.comm	_PROT_READ,4,2                  ## @PROT_READ
	.comm	_PROT_WRITE,4,2                 ## @PROT_WRITE
	.comm	_MAP_ANON,4,2                   ## @MAP_ANON
	.comm	_MAP_SHARED,4,2                 ## @MAP_SHARED
	.comm	_MAP_FAILED,8,3                 ## @MAP_FAILED
	.section	__TEXT,__cstring,cstring_literals
L_.str.1:                               ## @.str.1
	.asciz	"mmap failed"

L_.str.2:                               ## @.str.2
	.asciz	"sem_init failed"

L_.str.4:                               ## @.str.4
	.asciz	"sem_wait failed"

L_.str.7:                               ## @.str.7
	.asciz	"sem_post failed"

L_.str.9:                               ## @.str.9
	.asciz	"Failure."

L_str:                                  ## @str
	.asciz	"testing unnamed process-shared semaphore"

L_str.10:                               ## @str.10
	.asciz	"parent: sem_post()"

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

L_str.12:                               ## @str.12
	.asciz	"child: sem_wait()"

L_str.13:                               ## @str.13
	.asciz	"child: sem_wait() returned"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_test_unnamed                   ; -- Begin function test_unnamed
	.p2align	2
_test_unnamed:                          ; @test_unnamed
	.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	x0, l_str@PAGE
Lloh1:
	add	x0, x0, l_str@PAGEOFF
	bl	_puts
Lloh2:
	adrp	x8, _PROT_READ@GOTPAGE
Lloh3:
	ldr	x8, [x8, _PROT_READ@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
Lloh5:
	adrp	x9, _PROT_WRITE@GOTPAGE
Lloh6:
	ldr	x9, [x9, _PROT_WRITE@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
Lloh8:
	adrp	x10, _MAP_ANON@GOTPAGE
Lloh9:
	ldr	x10, [x10, _MAP_ANON@GOTPAGEOFF]
	orr	w2, w9, w8
Lloh10:
	ldr	w8, [x10]
Lloh11:
	adrp	x9, _MAP_SHARED@GOTPAGE
Lloh12:
	ldr	x9, [x9, _MAP_SHARED@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	orr	w3, w9, w8
	mov	x0, #0
	mov	w1, #4
	mov	w4, #-1
	mov	w5, #0
	bl	_mmap
	mov	x19, x0
Lloh14:
	adrp	x8, _MAP_FAILED@GOTPAGE
Lloh15:
	ldr	x8, [x8, _MAP_FAILED@GOTPAGEOFF]
Lloh16:
	ldr	x8, [x8]
	cmp	x8, x0
	b.ne	LBB0_2
; %bb.1:
Lloh17:
	adrp	x1, l_.str.1@PAGE
Lloh18:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w0, #1
	bl	_err
LBB0_2:
	mov	x0, x19
	mov	w1, #1
	mov	w2, #0
	bl	_sem_init
	cbz	x0, LBB0_4
; %bb.3:
Lloh19:
	adrp	x1, l_.str.2@PAGE
Lloh20:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	w0, #2
	bl	_err
LBB0_4:
	bl	_fork
	cbz	w0, LBB0_12
; %bb.5:
	mov	x20, x0
	mov	w0, #1
	bl	_sleep
Lloh21:
	adrp	x0, l_str.10@PAGE
Lloh22:
	add	x0, x0, l_str.10@PAGEOFF
	bl	_puts
	mov	x0, x19
	bl	_sem_post
	cbz	x0, LBB0_7
; %bb.6:
Lloh23:
	adrp	x1, l_.str.7@PAGE
Lloh24:
	add	x1, x1, l_.str.7@PAGEOFF
	mov	w0, #4
	bl	_err
LBB0_7:
	add	x1, sp, #12
	mov	x0, x20
	mov	w2, #0
	bl	_waitpid
	ldr	w0, [sp, #12]
	bl	_WIFEXITED
	cbz	x0, LBB0_9
; %bb.8:
	ldr	w0, [sp, #12]
	bl	_WEXITSTATUS
	cbz	x0, LBB0_10
LBB0_9:
Lloh25:
	adrp	x0, l_.str.9@PAGE
Lloh26:
	add	x0, x0, l_.str.9@PAGEOFF
	bl	_printf
	b	LBB0_11
LBB0_10:
Lloh27:
	adrp	x0, l_str.11@PAGE
Lloh28:
	add	x0, x0, l_str.11@PAGEOFF
	bl	_puts
LBB0_11:
	mov	w0, #0
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
LBB0_12:
Lloh29:
	adrp	x0, l_str.12@PAGE
Lloh30:
	add	x0, x0, l_str.12@PAGEOFF
	bl	_puts
	mov	x0, x19
	bl	_sem_wait
	cbz	x0, LBB0_14
; %bb.13:
Lloh31:
	adrp	x1, l_.str.4@PAGE
Lloh32:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	w0, #3
	bl	_err
LBB0_14:
Lloh33:
	adrp	x0, l_str.13@PAGE
Lloh34:
	add	x0, x0, l_str.13@PAGEOFF
	bl	_puts
	mov	w0, #0
	bl	_exit
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpAdd	Lloh33, Lloh34
	.cfi_endproc
                                        ; -- End function
	.comm	_PROT_READ,4,2                  ; @PROT_READ
	.comm	_PROT_WRITE,4,2                 ; @PROT_WRITE
	.comm	_MAP_ANON,4,2                   ; @MAP_ANON
	.comm	_MAP_SHARED,4,2                 ; @MAP_SHARED
	.comm	_MAP_FAILED,8,3                 ; @MAP_FAILED
	.section	__TEXT,__cstring,cstring_literals
l_.str.1:                               ; @.str.1
	.asciz	"mmap failed"

l_.str.2:                               ; @.str.2
	.asciz	"sem_init failed"

l_.str.4:                               ; @.str.4
	.asciz	"sem_wait failed"

l_.str.7:                               ; @.str.7
	.asciz	"sem_post failed"

l_.str.9:                               ; @.str.9
	.asciz	"Failure."

l_str:                                  ; @str
	.asciz	"testing unnamed process-shared semaphore"

l_str.10:                               ; @str.10
	.asciz	"parent: sem_post()"

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

l_str.12:                               ; @str.12
	.asciz	"child: sem_wait()"

l_str.13:                               ; @str.13
	.asciz	"child: sem_wait() returned"

.subsections_via_symbols
