	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function test_ipc
_test_ipc:                              ## @test_ipc
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -24
	leaq	-12(%rbp), %rsi
	callq	_heim_ipc_init_context
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rsi
	movl	$1, %edi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_errx
LBB0_2:
	xorps	%xmm0, %xmm0
	movaps	%xmm0, -32(%rbp)
	movl	-12(%rbp), %edi
	leaq	-32(%rbp), %rsi
	leaq	-48(%rbp), %rdx
	xorl	%ecx, %ecx
	callq	_heim_ipc_call
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	leaq	L_.str.1(%rip), %rsi
	movl	$1, %edi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_errx
LBB0_4:
	xorl	%edi, %edi
	callq	_heim_ipc_semaphore_create
	movq	%rax, %rbx
	testq	%rax, %rax
	jne	LBB0_6
## %bb.5:
	leaq	L_.str.2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	callq	_errx
LBB0_6:
	movl	-12(%rbp), %edi
	movq	_reply@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	-32(%rbp), %rsi
	movq	%rbx, %rdx
	callq	_heim_ipc_async
	testl	%eax, %eax
	je	LBB0_8
## %bb.7:
	leaq	L_.str.3(%rip), %rsi
	movl	$1, %edi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_errx
LBB0_8:
	movq	_HEIM_IPC_WAIT_FOREVER@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_heim_ipc_semaphore_wait
	movl	-12(%rbp), %edi
	callq	_heim_ipc_free_context
	addq	$40, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"heim_ipc_init_context: %d"

L_.str.1:                               ## @.str.1
	.asciz	"heim_ipc_call: %d"

L_.str.2:                               ## @.str.2
	.asciz	"heim_ipc_semaphore_create"

	.comm	_reply,4,2                      ## @reply
L_.str.3:                               ## @.str.3
	.asciz	"heim_ipc_async: %d"

	.comm	_HEIM_IPC_WAIT_FOREVER,4,2      ## @HEIM_IPC_WAIT_FOREVER
	.no_dead_strip	_test_ipc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function test_ipc
_test_ipc:                              ; @test_ipc
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	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
	add	x1, sp, #12
	bl	_heim_ipc_init_context
                                        ; kill: def $w0 killed $w0 def $x0
	cbz	w0, LBB0_2
; %bb.1:
	str	x0, [sp]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #1
	bl	_errx
LBB0_2:
	stp	xzr, xzr, [sp, #32]
	ldr	w0, [sp, #12]
	add	x1, sp, #32
	add	x2, sp, #16
	mov	x3, #0
	bl	_heim_ipc_call
                                        ; kill: def $w0 killed $w0 def $x0
	cbz	w0, LBB0_4
; %bb.3:
	str	x0, [sp]
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w0, #1
	bl	_errx
LBB0_4:
	mov	w0, #0
	bl	_heim_ipc_semaphore_create
	mov	x19, x0
	cbnz	x0, LBB0_6
; %bb.5:
Lloh4:
	adrp	x1, l_.str.2@PAGE
Lloh5:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	w0, #1
	bl	_errx
LBB0_6:
	ldr	w0, [sp, #12]
Lloh6:
	adrp	x8, _reply@GOTPAGE
Lloh7:
	ldr	x8, [x8, _reply@GOTPAGEOFF]
Lloh8:
	ldr	w3, [x8]
	add	x1, sp, #32
	mov	x2, x19
	bl	_heim_ipc_async
                                        ; kill: def $w0 killed $w0 def $x0
	cbz	w0, LBB0_8
; %bb.7:
	str	x0, [sp]
Lloh9:
	adrp	x1, l_.str.3@PAGE
Lloh10:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	w0, #1
	bl	_errx
LBB0_8:
Lloh11:
	adrp	x8, _HEIM_IPC_WAIT_FOREVER@GOTPAGE
Lloh12:
	ldr	x8, [x8, _HEIM_IPC_WAIT_FOREVER@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_heim_ipc_semaphore_wait
	ldr	w0, [sp, #12]
	bl	_heim_ipc_free_context
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"heim_ipc_init_context: %d"

l_.str.1:                               ; @.str.1
	.asciz	"heim_ipc_call: %d"

l_.str.2:                               ; @.str.2
	.asciz	"heim_ipc_semaphore_create"

	.comm	_reply,4,2                      ; @reply
l_.str.3:                               ; @.str.3
	.asciz	"heim_ipc_async: %d"

	.comm	_HEIM_IPC_WAIT_FOREVER,4,2      ; @HEIM_IPC_WAIT_FOREVER
	.no_dead_strip	_test_ipc
.subsections_via_symbols
