	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ub_cancel                      ## -- Begin function ub_cancel
	.p2align	4, 0x90
_ub_cancel:                             ## @ub_cancel
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movl	%esi, -32(%rbp)
	movl	$0, -28(%rbp)
	callq	_lock_basic_lock
	leaq	16(%r14), %r15
	leaq	-32(%rbp), %rsi
	movq	%r15, %rdi
	callq	_rbtree_search
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	%rax, %rbx
	movl	8(%rax), %edi
	testl	%edi, %edi
	je	LBB0_2
## %bb.3:
	callq	_log_assert
	movl	$1, (%rbx)
	cmpl	$0, 20(%r14)
	je	LBB0_4
## %bb.8:
	movq	%r14, %rdi
	callq	_lock_basic_unlock
LBB0_9:
	movq	_UB_NOERROR@GOTPCREL(%rip), %rax
	jmp	LBB0_10
LBB0_2:
	movq	%r14, %rdi
	callq	_lock_basic_unlock
	movq	_UB_NOID@GOTPCREL(%rip), %rax
LBB0_10:
	movl	(%rax), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movl	4(%rbx), %esi
	movq	%r15, %rdi
	callq	_rbtree_delete
	decl	12(%r14)
	leaq	-28(%rbp), %rsi
	movq	%rbx, %rdi
	callq	_context_serialize_cancel
	movq	%rax, %r15
	movq	%rbx, %rdi
	callq	_context_query_delete
	movq	%r14, %rdi
	callq	_lock_basic_unlock
	testq	%r15, %r15
	je	LBB0_5
## %bb.6:
	leaq	4(%r14), %rbx
	movq	%rbx, %rdi
	callq	_lock_basic_lock
	movl	8(%r14), %edi
	movl	-28(%rbp), %edx
	movq	%r15, %rsi
	xorl	%ecx, %ecx
	callq	_tube_write_msg
	movl	%eax, %r14d
	movq	%rbx, %rdi
	callq	_lock_basic_unlock
	movq	%r15, %rdi
	callq	_free
	testl	%r14d, %r14d
	jne	LBB0_9
## %bb.7:
	movq	_UB_PIPE@GOTPCREL(%rip), %rax
	jmp	LBB0_10
LBB0_5:
	movq	_UB_NOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_UB_NOID,4,2                    ## @UB_NOID
	.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_cancel                      ; -- Begin function ub_cancel
	.p2align	2
_ub_cancel:                             ; @ub_cancel
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x19, x0
	stp	wzr, w1, [sp, #8]
	bl	_lock_basic_lock
	add	x21, x19, #16
	add	x1, sp, #12
	mov	x0, x21
	bl	_rbtree_search
	cbz	x0, LBB0_4
; %bb.1:
	mov	x20, x0
	ldr	w0, [x0, #8]
	cbz	w0, LBB0_4
; %bb.2:
	bl	_log_assert
	mov	w8, #1
	str	w8, [x20]
	ldr	w8, [x19, #20]
	cbz	w8, LBB0_6
; %bb.3:
	mov	x0, x19
	bl	_lock_basic_unlock
Lloh0:
	adrp	x8, _UB_NOERROR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _UB_NOERROR@GOTPAGEOFF]
	b	LBB0_5
LBB0_4:
	mov	x0, x19
	bl	_lock_basic_unlock
Lloh2:
	adrp	x8, _UB_NOID@GOTPAGE
Lloh3:
	ldr	x8, [x8, _UB_NOID@GOTPAGEOFF]
LBB0_5:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_6:
	ldr	w1, [x20, #4]
	mov	x0, x21
	bl	_rbtree_delete
	ldr	w8, [x19, #12]
	sub	w8, w8, #1
	str	w8, [x19, #12]
	add	x1, sp, #8
	mov	x0, x20
	bl	_context_serialize_cancel
	mov	x21, x0
	mov	x0, x20
	bl	_context_query_delete
	mov	x0, x19
	bl	_lock_basic_unlock
	cbz	x21, LBB0_8
; %bb.7:
	add	x20, x19, #4
	mov	x0, x20
	bl	_lock_basic_lock
	ldr	w0, [x19, #8]
	ldr	w2, [sp, #8]
	mov	x1, x21
	mov	w3, #0
	bl	_tube_write_msg
	mov	x19, x0
	mov	x0, x20
	bl	_lock_basic_unlock
	mov	x0, x21
	bl	_free
Lloh4:
	adrp	x8, _UB_NOERROR@GOTPAGE
Lloh5:
	ldr	x8, [x8, _UB_NOERROR@GOTPAGEOFF]
Lloh6:
	adrp	x9, _UB_PIPE@GOTPAGE
Lloh7:
	ldr	x9, [x9, _UB_PIPE@GOTPAGEOFF]
	cmp	w19, #0
	csel	x8, x9, x8, eq
	b	LBB0_5
LBB0_8:
Lloh8:
	adrp	x8, _UB_NOMEM@GOTPAGE
Lloh9:
	ldr	x8, [x8, _UB_NOMEM@GOTPAGEOFF]
	b	LBB0_5
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_UB_NOID,4,2                    ; @UB_NOID
	.comm	_UB_NOMEM,4,2                   ; @UB_NOMEM
	.comm	_UB_PIPE,4,2                    ; @UB_PIPE
	.comm	_UB_NOERROR,4,2                 ; @UB_NOERROR
.subsections_via_symbols
