	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function set_ad_ctr
_set_ad_ctr:                            ## @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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_targeting_disabled@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	cmpq	$0, (%rcx)
	jne	LBB0_7
## %bb.1:
	movq	%rdi, %r15
	movl	4(%rdi), %edi
	xorl	%ebx, %ebx
	xorl	%esi, %esi
	callq	_get_ad_f
	movq	%rax, %r14
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	xorl	%ebx, %ebx
	cmpq	$0, (%r14)
	setg	%bl
LBB0_3:
	movl	%ebx, %edi
	callq	_assert
	movl	(%r15), %eax
	movq	_LEV_TARG_AD_SETCTR@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_5
## %bb.4:
	movq	(%r15), %rbx
	addq	$8, %r15
	jmp	LBB0_6
LBB0_5:
	andl	$-256, %eax
	movq	_LEV_TARG_AD_SETCTR_PACK@GOTPCREL(%rip), %rcx
	xorl	%edi, %edi
	cmpl	(%rcx), %eax
	sete	%dil
	callq	_assert
	movzbl	(%r15), %ebx
LBB0_6:
	movq	(%r15), %r15
	testq	%rbx, %rbx
	setns	%al
	testq	%r15, %r15
	setg	%cl
	andb	%al, %cl
	movq	_MAX_G_CLICKS@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rbx
	setl	%al
	andb	%cl, %al
	movzbl	%al, %edi
	callq	_assert
	movq	16(%r14), %rax
	movq	32(%r14), %rcx
	addq	%rax, %rax
	leaq	(%rax,%rax,4), %rax
	subq	%rax, %rbx
	movq	%rbx, 8(%r14)
	addq	%rcx, %rcx
	leaq	(%rcx,%rcx,4), %rax
	subq	%rax, %r15
	movq	%r15, 24(%r14)
	movq	%r14, %rdi
	callq	_compute_estimated_gain
	movl	$1, %eax
LBB0_7:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_targeting_disabled,8,3         ## @targeting_disabled
	.comm	_LEV_TARG_AD_SETCTR,4,2         ## @LEV_TARG_AD_SETCTR
	.comm	_LEV_TARG_AD_SETCTR_PACK,4,2    ## @LEV_TARG_AD_SETCTR_PACK
	.comm	_MAX_G_CLICKS,8,3               ## @MAX_G_CLICKS
	.no_dead_strip	_set_ad_ctr
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function set_ad_ctr
_set_ad_ctr:                            ; @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
Lloh0:
	adrp	x8, _targeting_disabled@GOTPAGE
Lloh1:
	ldr	x8, [x8, _targeting_disabled@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cbz	x8, LBB0_2
; %bb.1:
	mov	w0, #0
	b	LBB0_8
LBB0_2:
	mov	x20, x0
	ldr	w0, [x0, #4]
	mov	w1, #0
	bl	_get_ad_f
	mov	x19, x0
	cbz	x0, LBB0_4
; %bb.3:
	ldr	x8, [x19]
	cmp	x8, #0
	cset	w0, gt
LBB0_4:
	bl	_assert
	ldr	w8, [x20]
Lloh3:
	adrp	x9, _LEV_TARG_AD_SETCTR@GOTPAGE
Lloh4:
	ldr	x9, [x9, _LEV_TARG_AD_SETCTR@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_6
; %bb.5:
	ldr	x21, [x20], #8
	b	LBB0_7
LBB0_6:
	and	w8, w8, #0xffffff00
Lloh6:
	adrp	x9, _LEV_TARG_AD_SETCTR_PACK@GOTPAGE
Lloh7:
	ldr	x9, [x9, _LEV_TARG_AD_SETCTR_PACK@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	cmp	w8, w9
	cset	w0, eq
	bl	_assert
	ldrb	w21, [x20]
LBB0_7:
	ldr	x20, [x20]
	cmp	x21, #0
	ccmp	x20, #0, #4, ge
Lloh9:
	adrp	x8, _MAX_G_CLICKS@GOTPAGE
Lloh10:
	ldr	x8, [x8, _MAX_G_CLICKS@GOTPAGEOFF]
Lloh11:
	ldr	x8, [x8]
	ccmp	x21, x8, #0, gt
	cset	w0, lt
	bl	_assert
	ldr	x8, [x19, #16]
	mov	x9, #-10
	madd	x8, x8, x9, x21
	str	x8, [x19, #8]
	ldr	x8, [x19, #32]
	madd	x8, x8, x9, x20
	str	x8, [x19, #24]
	mov	x0, x19
	bl	_compute_estimated_gain
	mov	w0, #1
LBB0_8:
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_targeting_disabled,8,3         ; @targeting_disabled
	.comm	_LEV_TARG_AD_SETCTR,4,2         ; @LEV_TARG_AD_SETCTR
	.comm	_LEV_TARG_AD_SETCTR_PACK,4,2    ; @LEV_TARG_AD_SETCTR_PACK
	.comm	_MAX_G_CLICKS,8,3               ; @MAX_G_CLICKS
	.no_dead_strip	_set_ad_ctr
.subsections_via_symbols
