	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function perform_targeting
_perform_targeting:                     ## @perform_targeting
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	movq	(%rdi), %rax
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	24(%rbx), %rcx
	xorl	%edi, %edi
	cmpl	$0, (%rcx,%rax,4)
	sete	%dil
	jmp	LBB0_3
LBB0_1:
	xorl	%edi, %edi
LBB0_3:
	callq	_assert
	movq	(%rbx), %rax
	movq	_MAX_QUERY_STRING_LEN@GOTPCREL(%rip), %rcx
	xorl	%edi, %edi
	cmpq	(%rcx), %rax
	setbe	%dil
	callq	_assert
	movq	8(%rbx), %rdx
	testq	%rdx, %rdx
	jle	LBB0_5
## %bb.4:
	movq	_targeting_disabled@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	jne	LBB0_5
## %bb.7:
	xorl	%edi, %edi
	cmpl	$0, 16(%rbx)
	setne	%dil
	callq	_assert
	movq	8(%rbx), %rdi
	movl	$1, %esi
	callq	_get_ad_f
	testq	%rax, %rax
	je	LBB0_8
## %bb.9:
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	_load_ancient_ad
	testl	%eax, %eax
	js	LBB0_24
## %bb.10:
	movslq	16(%rbx), %rax
	testq	%rax, %rax
	je	LBB0_13
## %bb.11:
	cmpq	%rax, (%r14)
	je	LBB0_13
## %bb.12:
	movq	%rax, (%r14)
LBB0_13:
	movq	16(%r14), %rdi
	testq	%rdi, %rdi
	je	LBB0_15
## %bb.14:
	movq	24(%rbx), %rsi
	callq	_strcmp
	testq	%rax, %rax
	je	LBB0_19
LBB0_15:
	movq	%r14, %rdi
	callq	_remove_queue_ad
	movq	%r14, %rdi
	callq	_adjust_ctr_counters
	cmpq	$0, 16(%r14)
	jne	LBB0_17
## %bb.16:
	xorl	%edi, %edi
	callq	_exact_strfree
LBB0_17:
	movq	24(%rbx), %rdi
	movl	(%rbx), %esi
	callq	_exact_strdup
	movq	%rax, 16(%r14)
	cmpq	$0, (%r14)
	je	LBB0_22
## %bb.18:
	movq	%r14, %rdi
	callq	_change_ad_target
	jmp	LBB0_22
LBB0_5:
	movq	_verbosity@GOTPCREL(%rip), %rax
	cmpl	$2, (%rax)
	jl	LBB0_23
## %bb.6:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	16(%rbx), %ecx
	leaq	L_.str(%rip), %rsi
	callq	_fprintf
	jmp	LBB0_23
LBB0_8:
	movl	$-1, %eax
	jmp	LBB0_24
LBB0_19:
	movq	_ADF_ON@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 8(%r14)
	jne	LBB0_22
## %bb.20:
	movq	(%r14), %rsi
	testq	%rsi, %rsi
	je	LBB0_22
## %bb.21:
	movq	%r14, %rdi
	callq	_ad_enable
LBB0_22:
	movq	%r14, %rdi
	callq	_compute_estimated_gain
LBB0_23:
	movl	(%rbx), %eax
	addl	$15, %eax
LBB0_24:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX_QUERY_STRING_LEN,8,3       ## @MAX_QUERY_STRING_LEN
	.comm	_targeting_disabled,8,3         ## @targeting_disabled
	.comm	_verbosity,4,2                  ## @verbosity
	.comm	_stderr,4,2                     ## @stderr
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"store_targeting(): ad_id=%d, ad_price=%d\n"

	.comm	_ADF_ON,4,2                     ## @ADF_ON
	.no_dead_strip	_perform_targeting
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function perform_targeting
_perform_targeting:                     ; @perform_targeting
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	ldr	x8, [x0]
	cbz	x8, LBB0_2
; %bb.1:
	ldr	x9, [x19, #24]
	ldr	w8, [x9, x8, lsl #2]
	cmp	w8, #0
	cset	w0, eq
	b	LBB0_3
LBB0_2:
	mov	w0, #0
LBB0_3:
	bl	_assert
	ldr	x8, [x19]
Lloh0:
	adrp	x9, _MAX_QUERY_STRING_LEN@GOTPAGE
Lloh1:
	ldr	x9, [x9, _MAX_QUERY_STRING_LEN@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	cset	w0, ls
	bl	_assert
	ldr	x2, [x19, #8]
Lloh3:
	adrp	x8, _targeting_disabled@GOTPAGE
Lloh4:
	ldr	x8, [x8, _targeting_disabled@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	cmp	x2, #1
	ccmp	x8, #0, #0, ge
	b.eq	LBB0_6
; %bb.4:
Lloh6:
	adrp	x8, _verbosity@GOTPAGE
Lloh7:
	ldr	x8, [x8, _verbosity@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	cmp	w8, #2
	b.lt	LBB0_22
; %bb.5:
Lloh9:
	adrp	x8, _stderr@GOTPAGE
Lloh10:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
	ldr	w3, [x19, #16]
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
	bl	_fprintf
	b	LBB0_22
LBB0_6:
	ldr	w8, [x19, #16]
	cmp	w8, #0
	cset	w0, ne
	bl	_assert
	ldr	x0, [x19, #8]
	mov	w1, #1
	bl	_get_ad_f
	cbz	x0, LBB0_17
; %bb.7:
	mov	x20, x0
	bl	_load_ancient_ad
	tbnz	w0, #31, LBB0_23
; %bb.8:
	ldrsw	x8, [x19, #16]
	cbz	w8, LBB0_11
; %bb.9:
	ldr	x9, [x20]
	cmp	x9, x8
	b.eq	LBB0_11
; %bb.10:
	str	x8, [x20]
LBB0_11:
	ldr	x0, [x20, #16]
	cbz	x0, LBB0_13
; %bb.12:
	ldr	x1, [x19, #24]
	bl	_strcmp
	cbz	x0, LBB0_18
LBB0_13:
	mov	x0, x20
	bl	_remove_queue_ad
	mov	x0, x20
	bl	_adjust_ctr_counters
	ldr	x8, [x20, #16]
	cbnz	x8, LBB0_15
; %bb.14:
	mov	x0, #0
	bl	_exact_strfree
LBB0_15:
	ldr	x0, [x19, #24]
	ldr	w1, [x19]
	bl	_exact_strdup
	str	x0, [x20, #16]
	ldr	x8, [x20]
	cbz	x8, LBB0_21
; %bb.16:
	mov	x0, x20
	bl	_change_ad_target
	b	LBB0_21
LBB0_17:
	mov	w0, #-1
	b	LBB0_23
LBB0_18:
	ldr	w8, [x20, #8]
Lloh14:
	adrp	x9, _ADF_ON@GOTPAGE
Lloh15:
	ldr	x9, [x9, _ADF_ON@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_21
; %bb.19:
	ldr	x1, [x20]
	cbz	x1, LBB0_21
; %bb.20:
	mov	x0, x20
	bl	_ad_enable
LBB0_21:
	mov	x0, x20
	bl	_compute_estimated_gain
LBB0_22:
	ldr	w8, [x19]
	add	w0, w8, #15
LBB0_23:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX_QUERY_STRING_LEN,8,3       ; @MAX_QUERY_STRING_LEN
	.comm	_targeting_disabled,8,3         ; @targeting_disabled
	.comm	_verbosity,4,2                  ; @verbosity
	.comm	_stderr,4,2                     ; @stderr
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"store_targeting(): ad_id=%d, ad_price=%d\n"

	.comm	_ADF_ON,4,2                     ; @ADF_ON
	.no_dead_strip	_perform_targeting
.subsections_via_symbols
