	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ub_wait                        ## -- Begin function ub_wait
	.p2align	4, 0x90
_ub_wait:                               ## @ub_wait
	.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
	subq	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	leaq	8(%rdi), %r14
	movq	%r14, %rdi
	callq	_lock_basic_lock
	leaq	16(%rbx), %r15
	movq	%r15, %rdi
	callq	_lock_basic_lock
	cmpq	$0, (%rbx)
	je	LBB0_10
## %bb.1:
	leaq	-56(%rbp), %r12
	leaq	-44(%rbp), %r13
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	%r14, %rdi
	callq	_lock_basic_unlock
LBB0_9:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	%r14, %rdi
	callq	_lock_basic_lock
	movq	%r15, %rdi
	callq	_lock_basic_lock
	cmpq	$0, (%rbx)
	je	LBB0_10
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	callq	_lock_basic_unlock
	movl	12(%rbx), %edi
	callq	_tube_wait
	testl	%eax, %eax
	je	LBB0_8
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	12(%rbx), %edi
	movq	%r12, %rsi
	movq	%r13, %rdx
	movl	$1, %ecx
	callq	_tube_read_msg
	cmpl	$-1, %eax
	je	LBB0_8
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	testl	%eax, %eax
	je	LBB0_12
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%r12, %r13
	movq	-56(%rbp), %rsi
	movl	-44(%rbp), %edx
	leaq	-64(%rbp), %rax
	movq	%rax, (%rsp)
	movq	%rbx, %rdi
	leaq	-80(%rbp), %rcx
	leaq	-72(%rbp), %r8
	leaq	-48(%rbp), %r9
	callq	_process_answer_detail
	movl	%eax, %r12d
	movq	%r14, %rdi
	callq	_lock_basic_unlock
	movq	-56(%rbp), %rdi
	callq	_free
	cmpl	$2, %r12d
	je	LBB0_11
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	testl	%r12d, %r12d
	movq	%r13, %r12
	leaq	-44(%rbp), %r13
	jne	LBB0_9
	jmp	LBB0_7
LBB0_11:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	-72(%rbp), %rdi
	movl	-48(%rbp), %esi
	movq	-64(%rbp), %rdx
	callq	*-80(%rbp)
	movq	%r13, %r12
	leaq	-44(%rbp), %r13
	jmp	LBB0_9
LBB0_10:
	movq	%r15, %rdi
	callq	_lock_basic_unlock
	movq	_UB_NOERROR@GOTPCREL(%rip), %rbx
LBB0_13:
	movq	%r14, %rdi
	callq	_lock_basic_unlock
LBB0_14:
	movl	(%rbx), %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	movq	_UB_PIPE@GOTPCREL(%rip), %rbx
	jmp	LBB0_13
LBB0_7:
	movq	_UB_PIPE@GOTPCREL(%rip), %rbx
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.comm	_UB_PIPE,4,2                    ## @UB_PIPE
	.comm	_UB_NOERROR,4,2                 ## @UB_NOERROR
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ub_wait                        ; -- Begin function ub_wait
	.p2align	2
_ub_wait:                               ; @ub_wait
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	mov	x20, x0
	add	x19, x0, #8
	mov	x0, x19
	bl	_lock_basic_lock
	add	x21, x20, #16
	b	LBB0_3
LBB0_1:                                 ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x19
	bl	_lock_basic_unlock
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x19
	bl	_lock_basic_lock
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x21
	bl	_lock_basic_lock
	ldr	x8, [x20]
	cbz	x8, LBB0_10
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x21
	bl	_lock_basic_unlock
	ldr	w0, [x20, #12]
	bl	_tube_wait
	cbz	w0, LBB0_1
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w0, [x20, #12]
	add	x1, sp, #8
	add	x2, sp, #4
	mov	w3, #1
	bl	_tube_read_msg
	cmn	w0, #1
	b.eq	LBB0_1
; %bb.6:                                ;   in Loop: Header=BB0_3 Depth=1
	cbz	w0, LBB0_13
; %bb.7:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x1, [sp, #8]
	ldr	w2, [sp, #4]
	add	x3, sp, #32
	add	x4, sp, #24
	sub	x5, x29, #36
	add	x6, sp, #16
	mov	x0, x20
	bl	_process_answer_detail
	mov	x22, x0
	mov	x0, x19
	bl	_lock_basic_unlock
	ldr	x0, [sp, #8]
	bl	_free
	cmp	w22, #2
	b.eq	LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_3 Depth=1
	cbnz	w22, LBB0_2
	b	LBB0_14
LBB0_9:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldp	x0, x8, [sp, #24]
	ldur	w1, [x29, #-36]
	ldr	x2, [sp, #16]
	blr	x8
	b	LBB0_2
LBB0_10:
	mov	x0, x21
	bl	_lock_basic_unlock
Lloh0:
	adrp	x20, _UB_NOERROR@GOTPAGE
Lloh1:
	ldr	x20, [x20, _UB_NOERROR@GOTPAGEOFF]
LBB0_11:
	mov	x0, x19
	bl	_lock_basic_unlock
LBB0_12:
	ldr	w0, [x20]
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_13:
Lloh2:
	adrp	x20, _UB_PIPE@GOTPAGE
Lloh3:
	ldr	x20, [x20, _UB_PIPE@GOTPAGEOFF]
	b	LBB0_11
LBB0_14:
Lloh4:
	adrp	x20, _UB_PIPE@GOTPAGE
Lloh5:
	ldr	x20, [x20, _UB_PIPE@GOTPAGEOFF]
	b	LBB0_12
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_UB_PIPE,4,2                    ; @UB_PIPE
	.comm	_UB_NOERROR,4,2                 ; @UB_NOERROR
.subsections_via_symbols
