	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function activate_one_user_ad
_activate_one_user_ad:                  ## @activate_one_user_ad
	.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
	movl	%esi, %r14d
	movq	%rdi, %rbx
	movq	_AdSpace@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	movl	8(%rbx), %esi
	leaq	-32(%rbp), %rcx
	movl	%r14d, %edx
	callq	_intree_remove
	movl	%eax, 8(%rbx)
	cmpq	$0, -32(%rbp)
	je	LBB0_1
## %bb.3:
	movq	_inactive_ad_nodes@GOTPCREL(%rip), %rax
	decl	(%rax)
LBB0_4:
	movq	_active_ad_nodes@GOTPCREL(%rip), %rax
	incl	(%rax)
	movl	(%r15), %edi
	movl	(%rbx), %esi
	movl	%r14d, %edx
	callq	_intree_lookup
	xorl	%edi, %edi
	testq	%rax, %rax
	sete	%dil
	callq	_assert
	movl	(%r15), %edi
	movl	(%rbx), %esi
	movq	-32(%rbp), %rdx
	callq	_intree_insert
	movl	%eax, (%rbx)
	jmp	LBB0_5
LBB0_1:
	movl	(%r15), %edi
	movl	4(%rbx), %esi
	movl	%r14d, %edx
	callq	_intree_lookup
	testq	%rax, %rax
	je	LBB0_2
LBB0_5:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movl	(%r15), %edi
	callq	_new_intree_node
	movq	%rax, -32(%rbp)
	movl	(%r15), %edi
	movq	%rax, %rsi
	callq	_TNODE
	movl	%r14d, (%rax)
	movq	$0, 8(%rax)
	jmp	LBB0_4
	.cfi_endproc
                                        ## -- End function
	.comm	_AdSpace,4,2                    ## @AdSpace
	.comm	_inactive_ad_nodes,4,2          ## @inactive_ad_nodes
	.comm	_active_ad_nodes,4,2            ## @active_ad_nodes
	.no_dead_strip	_activate_one_user_ad
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function activate_one_user_ad
_activate_one_user_ad:                  ; @activate_one_user_ad
	.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	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x21, _AdSpace@GOTPAGE
Lloh1:
	ldr	x21, [x21, _AdSpace@GOTPAGEOFF]
	ldr	w0, [x21]
	ldr	w1, [x19, #8]
	add	x3, sp, #8
	mov	x2, x20
	bl	_intree_remove
	str	w0, [x19, #8]
	ldr	x8, [sp, #8]
	cbz	x8, LBB0_3
; %bb.1:
Lloh2:
	adrp	x8, _inactive_ad_nodes@GOTPAGE
Lloh3:
	ldr	x8, [x8, _inactive_ad_nodes@GOTPAGEOFF]
	ldr	w9, [x8]
	sub	w9, w9, #1
	str	w9, [x8]
LBB0_2:
Lloh4:
	adrp	x8, _active_ad_nodes@GOTPAGE
Lloh5:
	ldr	x8, [x8, _active_ad_nodes@GOTPAGEOFF]
	ldr	w9, [x8]
	add	w9, w9, #1
	str	w9, [x8]
	ldr	w0, [x21]
	ldr	w1, [x19]
	mov	x2, x20
	bl	_intree_lookup
	cmp	x0, #0
	cset	w0, eq
	bl	_assert
	ldr	w0, [x21]
	ldr	w1, [x19]
	ldr	x2, [sp, #8]
	bl	_intree_insert
	str	w0, [x19]
	b	LBB0_4
LBB0_3:
	ldr	w0, [x21]
	ldr	w1, [x19, #4]
	mov	x2, x20
	bl	_intree_lookup
	cbz	x0, LBB0_5
LBB0_4:
	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_5:
	ldr	w0, [x21]
	bl	_new_intree_node
	mov	x1, x0
	str	x0, [sp, #8]
	ldr	w0, [x21]
	bl	_TNODE
	str	w20, [x0]
	str	xzr, [x0, #8]
	b	LBB0_2
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_AdSpace,4,2                    ; @AdSpace
	.comm	_inactive_ad_nodes,4,2          ; @inactive_ad_nodes
	.comm	_active_ad_nodes,4,2            ; @active_ad_nodes
	.no_dead_strip	_activate_one_user_ad
.subsections_via_symbols
