	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ub_resolve_async               ## -- Begin function ub_resolve_async
	.p2align	4, 0x90
_ub_resolve_async:                      ## @ub_resolve_async
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, -56(%rbp)                 ## 4-byte Spill
	movq	%r8, %r12
	movl	%ecx, -52(%rbp)                 ## 4-byte Spill
	movl	%edx, -48(%rbp)                 ## 4-byte Spill
	movq	%rsi, %r15
	movq	%rdi, %rbx
	movq	16(%rbp), %rax
	movl	$0, -44(%rbp)
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movl	$0, (%rax)
LBB0_2:
	leaq	12(%rbx), %r14
	movq	%r14, %rdi
	callq	_lock_basic_lock
	cmpl	$0, 24(%rbx)
	je	LBB0_3
LBB0_6:
	cmpl	$0, (%rbx)
	je	LBB0_7
## %bb.9:
	movq	%r14, %rdi
	callq	_lock_basic_unlock
LBB0_10:
	movq	%r12, (%rsp)
	movq	%rbx, %rdi
	movq	%r15, %rsi
	movl	-48(%rbp), %edx                 ## 4-byte Reload
	movl	-52(%rbp), %ecx                 ## 4-byte Reload
	movl	-56(%rbp), %r8d                 ## 4-byte Reload
	xorl	%r9d, %r9d
	callq	_context_new
	testq	%rax, %rax
	je	LBB0_11
## %bb.12:
	movq	%rax, %r12
	movq	%r14, %rdi
	callq	_lock_basic_lock
	leaq	-44(%rbp), %rsi
	movq	%r12, %rdi
	callq	_context_serialize_new_query
	testq	%rax, %rax
	je	LBB0_13
## %bb.14:
	movq	%rax, %r15
	movq	16(%rbp), %rcx
	testq	%rcx, %rcx
	je	LBB0_16
## %bb.15:
	movl	(%r12), %eax
	movl	%eax, (%rcx)
LBB0_16:
	movq	%r14, %rdi
	callq	_lock_basic_unlock
	leaq	4(%rbx), %r14
	movq	%r14, %rdi
	callq	_lock_basic_lock
	movl	8(%rbx), %edi
	movl	-44(%rbp), %edx
	movq	%r15, %rsi
	xorl	%ecx, %ecx
	callq	_tube_write_msg
	movl	%eax, %ebx
	movq	%r14, %rdi
	callq	_lock_basic_unlock
	movq	%r15, %rdi
	callq	_free
	testl	%ebx, %ebx
	je	LBB0_17
## %bb.18:
	movq	_UB_NOERROR@GOTPCREL(%rip), %rax
	jmp	LBB0_19
LBB0_3:
	movq	%rbx, %rdi
	callq	_context_finalize
	testl	%eax, %eax
	je	LBB0_6
## %bb.4:
	movl	%eax, %r13d
	jmp	LBB0_5
LBB0_7:
	movl	$1, (%rbx)
	movq	%r14, %rdi
	callq	_lock_basic_unlock
	movq	%rbx, %rdi
	callq	_libworker_bg
	testl	%eax, %eax
	je	LBB0_10
## %bb.8:
	movl	%eax, %r13d
	movq	%r14, %rdi
	callq	_lock_basic_lock
	movl	$0, (%rbx)
LBB0_5:
	movq	%r14, %rdi
	callq	_lock_basic_unlock
	jmp	LBB0_20
LBB0_11:
	movq	_UB_NOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_19
LBB0_13:
	leaq	20(%rbx), %rdi
	movl	4(%r12), %esi
	callq	_rbtree_delete
	decl	16(%rbx)
	movq	%r12, %rdi
	callq	_context_query_delete
	movq	%r14, %rdi
	callq	_lock_basic_unlock
	movq	_UB_NOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_19
LBB0_17:
	movq	_UB_PIPE@GOTPCREL(%rip), %rax
LBB0_19:
	movl	(%rax), %r13d
LBB0_20:
	movl	%r13d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_UB_NOMEM,4,2                   ## @UB_NOMEM
	.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_resolve_async               ; -- Begin function ub_resolve_async
	.p2align	2
_ub_resolve_async:                      ; @ub_resolve_async
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x21, x6
	mov	x23, x5
	mov	x22, x4
	mov	x24, x3
	mov	x25, x2
	mov	x26, x1
	mov	x19, x0
	str	wzr, [sp, #12]
	cbz	x6, LBB0_2
; %bb.1:
	str	wzr, [x21]
LBB0_2:
	add	x20, x19, #12
	mov	x0, x20
	bl	_lock_basic_lock
	ldr	w8, [x19, #24]
	cbz	w8, LBB0_11
LBB0_3:
	ldr	w8, [x19]
	cbz	w8, LBB0_13
; %bb.4:
	mov	x0, x20
	bl	_lock_basic_unlock
LBB0_5:
	mov	x0, x19
	mov	x1, x26
	mov	x2, x25
	mov	x3, x24
	mov	x4, x23
	mov	x5, #0
	mov	x6, x22
	bl	_context_new
	cbz	x0, LBB0_17
; %bb.6:
	mov	x23, x0
	mov	x0, x20
	bl	_lock_basic_lock
	add	x1, sp, #12
	mov	x0, x23
	bl	_context_serialize_new_query
	cbz	x0, LBB0_16
; %bb.7:
	mov	x22, x0
	cbz	x21, LBB0_9
; %bb.8:
	ldr	w8, [x23]
	str	w8, [x21]
LBB0_9:
	mov	x0, x20
	bl	_lock_basic_unlock
	add	x20, x19, #4
	mov	x0, x20
	bl	_lock_basic_lock
	ldr	w0, [x19, #8]
	ldr	w2, [sp, #12]
	mov	x1, x22
	mov	w3, #0
	bl	_tube_write_msg
	mov	x19, x0
	mov	x0, x20
	bl	_lock_basic_unlock
	mov	x0, x22
	bl	_free
	cbz	w19, LBB0_20
; %bb.10:
Lloh0:
	adrp	x8, _UB_NOERROR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _UB_NOERROR@GOTPAGEOFF]
	b	LBB0_18
LBB0_11:
	mov	x0, x19
	bl	_context_finalize
	cbz	w0, LBB0_3
; %bb.12:
	mov	x27, x0
	b	LBB0_15
LBB0_13:
	mov	w8, #1
	str	w8, [x19]
	mov	x0, x20
	bl	_lock_basic_unlock
	mov	x0, x19
	bl	_libworker_bg
	cbz	w0, LBB0_5
; %bb.14:
	mov	x27, x0
	mov	x0, x20
	bl	_lock_basic_lock
	str	wzr, [x19]
LBB0_15:
	mov	x0, x20
	bl	_lock_basic_unlock
	b	LBB0_19
LBB0_16:
	add	x0, x19, #20
	ldr	w1, [x23, #4]
	bl	_rbtree_delete
	ldr	w8, [x19, #16]
	sub	w8, w8, #1
	str	w8, [x19, #16]
	mov	x0, x23
	bl	_context_query_delete
	mov	x0, x20
	bl	_lock_basic_unlock
LBB0_17:
Lloh2:
	adrp	x8, _UB_NOMEM@GOTPAGE
Lloh3:
	ldr	x8, [x8, _UB_NOMEM@GOTPAGEOFF]
LBB0_18:
	ldr	w27, [x8]
LBB0_19:
	mov	x0, x27
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_20:
Lloh4:
	adrp	x8, _UB_PIPE@GOTPAGE
Lloh5:
	ldr	x8, [x8, _UB_PIPE@GOTPAGEOFF]
	b	LBB0_18
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_UB_NOMEM,4,2                   ; @UB_NOMEM
	.comm	_UB_PIPE,4,2                    ; @UB_PIPE
	.comm	_UB_NOERROR,4,2                 ; @UB_NOERROR
.subsections_via_symbols
