	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ub_resolve_event               ## -- Begin function ub_resolve_event
	.p2align	4, 0x90
_ub_resolve_event:                      ## @ub_resolve_event
	.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, -52(%rbp)                 ## 4-byte Spill
	movq	%r8, %r15
	movl	%ecx, -48(%rbp)                 ## 4-byte Spill
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movq	16(%rbp), %rax
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movl	$0, (%rax)
LBB0_2:
	leaq	12(%rbx), %r13
	movq	%r13, %rdi
	callq	_lock_basic_lock
	cmpl	$0, 16(%rbx)
	je	LBB0_3
LBB0_5:
	movq	%r13, %rdi
	callq	_lock_basic_unlock
	movq	(%rbx), %rax
	testq	%rax, %rax
	jne	LBB0_8
## %bb.6:
	movl	8(%rbx), %esi
	movq	%rbx, %rdi
	callq	_libworker_create_event
	movq	%rax, (%rbx)
	testq	%rax, %rax
	je	LBB0_7
LBB0_8:
	movl	(%rax), %edi
	callq	_ub_comm_base_now
	movq	%r15, (%rsp)
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	movl	-48(%rbp), %ecx                 ## 4-byte Reload
	xorl	%r8d, %r8d
	movl	-52(%rbp), %r9d                 ## 4-byte Reload
	callq	_context_new
	testq	%rax, %rax
	je	LBB0_9
## %bb.10:
	movq	%rbx, %rdi
	movq	%rax, %rsi
	movq	16(%rbp), %rdx
	callq	_libworker_attach_mesh
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_13
## %bb.11:
	movq	_UB_NOERROR@GOTPCREL(%rip), %rax
	jmp	LBB0_12
LBB0_3:
	movq	%rbx, %rdi
	callq	_context_finalize
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:
	movl	%eax, %r12d
	movq	%r13, %rdi
	callq	_lock_basic_unlock
	jmp	LBB0_13
LBB0_9:
	movq	_UB_NOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_12
LBB0_7:
	movq	_UB_INITFAIL@GOTPCREL(%rip), %rax
LBB0_12:
	movl	(%rax), %r12d
LBB0_13:
	movl	%r12d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_UB_INITFAIL,4,2                ## @UB_INITFAIL
	.comm	_UB_NOMEM,4,2                   ## @UB_NOMEM
	.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_event               ; -- Begin function ub_resolve_event
	.p2align	2
_ub_resolve_event:                      ; @ub_resolve_event
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	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
	.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	x19, x6
	mov	x22, x5
	mov	x21, x4
	mov	x23, x3
	mov	x24, x2
	mov	x25, x1
	mov	x20, x0
	cbz	x6, LBB0_2
; %bb.1:
	str	wzr, [x19]
LBB0_2:
	add	x27, x20, #12
	mov	x0, x27
	bl	_lock_basic_lock
	ldr	w8, [x20, #16]
	cbz	w8, LBB0_7
LBB0_3:
	mov	x0, x27
	bl	_lock_basic_unlock
	ldr	x0, [x20]
	cbnz	x0, LBB0_5
; %bb.4:
	ldr	w1, [x20, #8]
	mov	x0, x20
	bl	_libworker_create_event
	str	x0, [x20]
	cbz	x0, LBB0_10
LBB0_5:
	ldr	w0, [x0]
	bl	_ub_comm_base_now
	mov	x0, x20
	mov	x1, x25
	mov	x2, x24
	mov	x3, x23
	mov	x4, #0
	mov	x5, x22
	mov	x6, x21
	bl	_context_new
	cbz	x0, LBB0_9
; %bb.6:
	mov	x1, x0
	mov	x0, x20
	mov	x2, x19
	bl	_libworker_attach_mesh
Lloh0:
	adrp	x8, _UB_NOERROR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _UB_NOERROR@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w0, #0
	csel	w26, w8, w0, eq
	b	LBB0_12
LBB0_7:
	mov	x0, x20
	bl	_context_finalize
	cbz	w0, LBB0_3
; %bb.8:
	mov	x26, x0
	mov	x0, x27
	bl	_lock_basic_unlock
	b	LBB0_12
LBB0_9:
Lloh3:
	adrp	x8, _UB_NOMEM@GOTPAGE
Lloh4:
	ldr	x8, [x8, _UB_NOMEM@GOTPAGEOFF]
	b	LBB0_11
LBB0_10:
Lloh5:
	adrp	x8, _UB_INITFAIL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _UB_INITFAIL@GOTPAGEOFF]
LBB0_11:
	ldr	w26, [x8]
LBB0_12:
	mov	x0, x26
	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
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_UB_INITFAIL,4,2                ; @UB_INITFAIL
	.comm	_UB_NOMEM,4,2                   ; @UB_NOMEM
	.comm	_UB_NOERROR,4,2                 ; @UB_NOERROR
.subsections_via_symbols
