	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ub_ctx_set_event               ## -- Begin function ub_ctx_set_event
	.p2align	4, 0x90
_ub_ctx_set_event:                      ## @ub_ctx_set_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testq	%rdi, %rdi
	je	LBB0_7
## %bb.1:
	movq	%rsi, %r14
	testq	%rsi, %rsi
	je	LBB0_7
## %bb.2:
	movq	%rdi, %rbx
	movq	16(%rdi), %rdi
	testq	%rdi, %rdi
	je	LBB0_7
## %bb.3:
	callq	_ub_libevent_get_event_base
	cmpq	%r14, %rax
	je	LBB0_10
## %bb.4:
	leaq	4(%rbx), %r15
	movq	%r15, %rdi
	callq	_lock_basic_lock
	movq	24(%rbx), %rdi
	callq	_libworker_delete_event
	movq	$0, 24(%rbx)
	movq	%r14, %rdi
	callq	_ub_libevent_event_base
	movq	%rax, %r14
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	movq	%r14, 16(%rbx)
LBB0_6:
	movq	$0, 8(%rbx)
	movl	$1, (%rbx)
	movq	%r15, %rdi
	callq	_lock_basic_unlock
	testq	%r14, %r14
	jne	LBB0_10
LBB0_7:
	movq	_UB_INITFAIL@GOTPCREL(%rip), %rax
	jmp	LBB0_8
LBB0_10:
	movq	_UB_NOERROR@GOTPCREL(%rip), %rax
LBB0_8:
	movl	(%rax), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_UB_INITFAIL,4,2                ## @UB_INITFAIL
	.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_ctx_set_event               ; -- Begin function ub_ctx_set_event
	.p2align	2
_ub_ctx_set_event:                      ; @ub_ctx_set_event
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	cbz	x0, LBB0_7
; %bb.1:
	mov	x20, x1
	cbz	x1, LBB0_7
; %bb.2:
	mov	x19, x0
	ldr	x0, [x0, #16]
	cbz	x0, LBB0_7
; %bb.3:
	bl	_ub_libevent_get_event_base
	cmp	x0, x20
	b.eq	LBB0_9
; %bb.4:
	add	x21, x19, #4
	mov	x0, x21
	bl	_lock_basic_lock
	ldr	x0, [x19, #24]
	bl	_libworker_delete_event
	str	xzr, [x19, #24]
	mov	x0, x20
	bl	_ub_libevent_event_base
	mov	x20, x0
	cbz	x0, LBB0_6
; %bb.5:
	str	x20, [x19, #16]
LBB0_6:
	str	xzr, [x19, #8]
	mov	w8, #1
	str	w8, [x19]
	mov	x0, x21
	bl	_lock_basic_unlock
Lloh0:
	adrp	x8, _UB_NOERROR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _UB_NOERROR@GOTPAGEOFF]
Lloh2:
	adrp	x9, _UB_INITFAIL@GOTPAGE
Lloh3:
	ldr	x9, [x9, _UB_INITFAIL@GOTPAGEOFF]
	cmp	x20, #0
	csel	x8, x9, x8, eq
	b	LBB0_8
LBB0_7:
Lloh4:
	adrp	x8, _UB_INITFAIL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _UB_INITFAIL@GOTPAGEOFF]
LBB0_8:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_9:
Lloh6:
	adrp	x8, _UB_NOERROR@GOTPAGE
Lloh7:
	ldr	x8, [x8, _UB_NOERROR@GOTPAGEOFF]
	b	LBB0_8
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_UB_INITFAIL,4,2                ; @UB_INITFAIL
	.comm	_UB_NOERROR,4,2                 ; @UB_NOERROR
.subsections_via_symbols
