	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wait_twoproc_test
_wait_twoproc_test:                     ## @wait_twoproc_test
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	_TEST_PATH@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	_O_CREAT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-12(%rbp), %rdi
	movl	$511, %ecx                      ## imm = 0x1FF
	xorl	%r8d, %r8d
	callq	_ksem_open
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	callq	_fail_errno
	jmp	LBB0_13
LBB0_2:
	movl	-12(%rbp), %edi
	movl	$500, %esi                      ## imm = 0x1F4
	callq	_schedule_post
	testq	%rax, %rax
	js	LBB0_12
## %bb.3:
	movq	_wait_twoproc_child@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	-16(%rbp), %rdx
	xorl	%esi, %esi
	callq	_child_worker
	testq	%rax, %rax
	js	LBB0_11
## %bb.4:
	movl	-16(%rbp), %edi
	callq	_CSTAT_ERROR
	movq	_errno@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	movl	-16(%rbp), %edi
	callq	_CSTAT_CLASS
	cmpl	$3, %eax
	ja	LBB0_10
## %bb.5:
	movl	%eax, %eax
	leaq	LJTI0_0(%rip), %rcx
	movslq	(%rcx,%rax,4), %rax
	addq	%rcx, %rax
	jmpq	*%rax
LBB0_6:
	xorl	%eax, %eax
	callq	_pass
	jmp	LBB0_11
LBB0_7:
	leaq	L_.str.1(%rip), %rdi
	callq	_fail_errno
	jmp	LBB0_11
LBB0_8:
	leaq	L_.str.2(%rip), %rdi
	callq	_fail_errno
	jmp	LBB0_11
LBB0_9:
	leaq	L_.str.3(%rip), %rdi
	callq	_fail_errno
	jmp	LBB0_11
LBB0_10:
	movl	-16(%rbp), %esi
	leaq	L_.str.4(%rip), %rdi
	callq	_fail_err
LBB0_11:
	movl	$1, %edi
	callq	_check_alarm
LBB0_12:
	movl	-12(%rbp), %edi
	callq	_ksem_close
	movl	(%rbx), %edi
	callq	_ksem_unlink
LBB0_13:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_6, LBB0_6-LJTI0_0
.set L0_0_set_7, LBB0_7-LJTI0_0
.set L0_0_set_8, LBB0_8-LJTI0_0
.set L0_0_set_9, LBB0_9-LJTI0_0
LJTI0_0:
	.long	L0_0_set_6
	.long	L0_0_set_7
	.long	L0_0_set_8
	.long	L0_0_set_9
	.end_data_region
                                        ## -- 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"

	.comm	_wait_twoproc_child,4,2         ## @wait_twoproc_child
	.comm	_errno,4,2                      ## @errno
L_.str.1:                               ## @.str.1
	.asciz	"child ksem_open()"

L_.str.2:                               ## @.str.2
	.asciz	"child ksem_wait()"

L_.str.3:                               ## @.str.3
	.asciz	"child ksem_close()"

L_.str.4:                               ## @.str.4
	.asciz	"bad child state %#x"

	.no_dead_strip	_wait_twoproc_test
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wait_twoproc_test
_wait_twoproc_test:                     ; @wait_twoproc_test
	.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	x8, _O_CREAT@GOTPAGE
Lloh3:
	ldr	x8, [x8, _O_CREAT@GOTPAGEOFF]
Lloh4:
	ldr	w2, [x8]
	add	x0, sp, #12
	mov	w3, #511
	mov	w4, #0
	bl	_ksem_open
	cbz	x0, LBB0_2
; %bb.1:
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	bl	_fail_errno
	b	LBB0_13
LBB0_2:
	ldr	w0, [sp, #12]
	mov	w1, #500
	bl	_schedule_post
	tbnz	x0, #63, LBB0_12
; %bb.3:
Lloh7:
	adrp	x8, _wait_twoproc_child@GOTPAGE
Lloh8:
	ldr	x8, [x8, _wait_twoproc_child@GOTPAGEOFF]
Lloh9:
	ldr	w0, [x8]
	add	x2, sp, #8
	mov	x1, #0
	bl	_child_worker
	tbnz	x0, #63, LBB0_11
; %bb.4:
	ldr	w0, [sp, #8]
	bl	_CSTAT_ERROR
Lloh10:
	adrp	x8, _errno@GOTPAGE
Lloh11:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh12:
	str	w0, [x8]
	ldr	w0, [sp, #8]
	bl	_CSTAT_CLASS
	cmp	w0, #3
	b.hi	LBB0_10
; %bb.5:
	mov	w8, w0
Lloh13:
	adrp	x9, lJTI0_0@PAGE
Lloh14:
	add	x9, x9, lJTI0_0@PAGEOFF
	adr	x10, LBB0_6
	ldrb	w11, [x9, x8]
	add	x10, x10, x11, lsl #2
	br	x10
LBB0_6:
	bl	_pass
	b	LBB0_11
LBB0_7:
Lloh15:
	adrp	x0, l_.str.1@PAGE
Lloh16:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_fail_errno
	b	LBB0_11
LBB0_8:
Lloh17:
	adrp	x0, l_.str.2@PAGE
Lloh18:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_fail_errno
	b	LBB0_11
LBB0_9:
Lloh19:
	adrp	x0, l_.str.3@PAGE
Lloh20:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_fail_errno
	b	LBB0_11
LBB0_10:
	ldr	w1, [sp, #8]
Lloh21:
	adrp	x0, l_.str.4@PAGE
Lloh22:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_fail_err
LBB0_11:
	mov	w0, #1
	bl	_check_alarm
LBB0_12:
	ldr	w0, [sp, #12]
	bl	_ksem_close
	ldr	w0, [x19]
	bl	_ksem_unlink
LBB0_13:
	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	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotStr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_6-LBB0_6)>>2
	.byte	(LBB0_7-LBB0_6)>>2
	.byte	(LBB0_8-LBB0_6)>>2
	.byte	(LBB0_9-LBB0_6)>>2
                                        ; -- 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"

	.comm	_wait_twoproc_child,4,2         ; @wait_twoproc_child
	.comm	_errno,4,2                      ; @errno
l_.str.1:                               ; @.str.1
	.asciz	"child ksem_open()"

l_.str.2:                               ; @.str.2
	.asciz	"child ksem_wait()"

l_.str.3:                               ; @.str.3
	.asciz	"child ksem_close()"

l_.str.4:                               ; @.str.4
	.asciz	"bad child state %#x"

	.no_dead_strip	_wait_twoproc_test
.subsections_via_symbols
