	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_do_set_ad_ctr                  ## -- Begin function do_set_ad_ctr
	.p2align	4, 0x90
_do_set_ad_ctr:                         ## @do_set_ad_ctr
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movq	%rsi, %r15
	movl	%edi, %r12d
	xorl	%r13d, %r13d
	xorl	%esi, %esi
	callq	_get_ad_f
	testq	%rax, %rax
	je	LBB0_8
## %bb.1:
	movq	%rax, %rbx
	movq	_ADF_ANCIENT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rbx)
	je	LBB0_2
LBB0_8:
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movq	%rbx, %rdi
	callq	_ad_became_ancient
	testq	%r14, %r14
	jle	LBB0_8
## %bb.3:
	testq	%r15, %r15
	js	LBB0_8
## %bb.4:
	testq	%rax, %rax
	jne	LBB0_8
## %bb.5:
	movq	_MAX_G_CLICKS@GOTPCREL(%rip), %rax
	cmpq	%r15, (%rax)
	jle	LBB0_8
## %bb.6:
	cmpq	$0, 8(%rbx)
	jle	LBB0_7
## %bb.9:
	movq	%rbx, %rdi
	movq	%r15, %rsi
	movq	%r14, %rdx
	callq	_compute_estimated_gain_clicks
	movq	_ESTIMATED_GAIN_EPS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	$1, %r13d
	movl	$1, %edx
	subl	%eax, %edx
	movl	16(%rbx), %ecx
	imull	%ecx, %edx
	cvtsi2sd	%edx, %xmm1
	ucomisd	%xmm1, %xmm0
	jb	LBB0_11
## %bb.10:
	incl	%eax
	imull	%ecx, %eax
	xorps	%xmm1, %xmm1
	cvtsi2sd	%eax, %xmm1
	ucomisd	%xmm0, %xmm1
	jae	LBB0_8
LBB0_11:
	cmpq	$255, %r15
	jg	LBB0_14
## %bb.12:
	cmpq	$2147483647, %r14               ## imm = 0x7FFFFFFF
	jg	LBB0_14
## %bb.13:
	movq	_LEV_TARG_AD_SETCTR_PACK@GOTPCREL(%rip), %rax
	addq	(%rax), %r15
	movq	%r15, %rdi
	movl	$12, %esi
	movl	%r12d, %edx
	callq	_alloc_log_event
	movq	%rax, %rdi
	jmp	LBB0_15
LBB0_7:
	movl	$1, %r13d
	jmp	LBB0_8
LBB0_14:
	movq	_LEV_TARG_AD_SETCTR@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movl	$20, %esi
	movl	%r12d, %edx
	callq	_alloc_log_event
	movq	%rax, %rdi
	movq	%r15, (%rax)
	addq	$8, %rax
LBB0_15:
	movq	%r14, (%rax)
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_set_ad_ctr                     ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_ADF_ANCIENT,4,2                ## @ADF_ANCIENT
	.comm	_MAX_G_CLICKS,8,3               ## @MAX_G_CLICKS
	.comm	_ESTIMATED_GAIN_EPS,4,2         ## @ESTIMATED_GAIN_EPS
	.comm	_LEV_TARG_AD_SETCTR_PACK,8,3    ## @LEV_TARG_AD_SETCTR_PACK
	.comm	_LEV_TARG_AD_SETCTR,8,3         ## @LEV_TARG_AD_SETCTR
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_do_set_ad_ctr                  ; -- Begin function do_set_ad_ctr
	.p2align	2
_do_set_ad_ctr:                         ; @do_set_ad_ctr
	.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
	mov	x19, x2
	mov	x20, x1
	mov	x21, x0
	mov	w1, #0
	bl	_get_ad_f
	cbz	x0, LBB0_3
; %bb.1:
	mov	x22, x0
	ldr	w8, [x0]
Lloh0:
	adrp	x9, _ADF_ANCIENT@GOTPAGE
Lloh1:
	ldr	x9, [x9, _ADF_ANCIENT@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_4
; %bb.2:
	mov	w0, #0
LBB0_3:
	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_4:
	mov	x0, x22
	bl	_ad_became_ancient
	mov	x8, x0
	mov	w0, #0
	cmp	x19, #1
	b.lt	LBB0_3
; %bb.5:
	tbnz	x20, #63, LBB0_3
; %bb.6:
	cbnz	x8, LBB0_3
; %bb.7:
Lloh3:
	adrp	x8, _MAX_G_CLICKS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MAX_G_CLICKS@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	cmp	x8, x20
	b.le	LBB0_3
; %bb.8:
	ldr	x8, [x22, #8]
	cmp	x8, #1
	b.lt	LBB0_13
; %bb.9:
	mov	x0, x22
	mov	x1, x20
	mov	x2, x19
	bl	_compute_estimated_gain_clicks
Lloh6:
	adrp	x8, _ESTIMATED_GAIN_EPS@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ESTIMATED_GAIN_EPS@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	ldr	w9, [x22, #16]
	msub	w10, w9, w8, w9
	scvtf	d1, w10
	fcmp	d0, d1
	madd	w8, w9, w8, w9
	scvtf	d1, w8
	fccmp	d0, d1, #2, ge
	b.ls	LBB0_13
; %bb.10:
	cmp	x20, #255
	b.gt	LBB0_14
; %bb.11:
	mov	w8, #2147483647
	cmp	x19, x8
	b.gt	LBB0_14
; %bb.12:
Lloh9:
	adrp	x8, _LEV_TARG_AD_SETCTR_PACK@GOTPAGE
Lloh10:
	ldr	x8, [x8, _LEV_TARG_AD_SETCTR_PACK@GOTPAGEOFF]
Lloh11:
	ldr	x8, [x8]
	add	x0, x8, x20
	mov	w1, #12
	mov	x2, x21
	bl	_alloc_log_event
	mov	x8, x0
	b	LBB0_15
LBB0_13:
	mov	w0, #1
	b	LBB0_3
LBB0_14:
Lloh12:
	adrp	x8, _LEV_TARG_AD_SETCTR@GOTPAGE
Lloh13:
	ldr	x8, [x8, _LEV_TARG_AD_SETCTR@GOTPAGEOFF]
Lloh14:
	ldr	x0, [x8]
	mov	w1, #20
	mov	x2, x21
	bl	_alloc_log_event
	mov	x8, x0
	str	x20, [x0], #8
LBB0_15:
	str	x19, [x0]
	mov	x0, 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
	b	_set_ad_ctr
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_ADF_ANCIENT,4,2                ; @ADF_ANCIENT
	.comm	_MAX_G_CLICKS,8,3               ; @MAX_G_CLICKS
	.comm	_ESTIMATED_GAIN_EPS,4,2         ; @ESTIMATED_GAIN_EPS
	.comm	_LEV_TARG_AD_SETCTR_PACK,8,3    ; @LEV_TARG_AD_SETCTR_PACK
	.comm	_LEV_TARG_AD_SETCTR,8,3         ; @LEV_TARG_AD_SETCTR
.subsections_via_symbols
