	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_perform_ad_pricing             ## -- Begin function perform_ad_pricing
	.p2align	4, 0x90
_perform_ad_pricing:                    ## @perform_ad_pricing
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_R_cnt@GOTPCREL(%rip), %rbx
	movl	$0, (%rbx)
	movl	$-1, %eax
	testl	%edi, %edi
	jle	LBB0_26
## %bb.1:
	movl	%esi, %r14d
	leal	-101(%r14), %esi
	cmpl	$-100, %esi
	jb	LBB0_26
## %bb.2:
	movl	%r9d, %r12d
	leal	-1001(%r12), %esi
	cmpl	$-1000, %esi                    ## imm = 0xFC18
	jb	LBB0_26
## %bb.3:
	movl	%edi, %r13d
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	movl	%ecx, -48(%rbp)                 ## 4-byte Spill
	movl	%r8d, -52(%rbp)                 ## 4-byte Spill
	xorl	%esi, %esi
	callq	_get_ad_f
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	movq	%rax, %r15
	cmpq	$0, 8(%rax)
	movl	$-1, %eax
	je	LBB0_26
## %bb.6:
	movq	_Q_limit@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	testl	%edx, %edx
	jle	LBB0_7
## %bb.8:
	movl	$10000, %eax                    ## imm = 0x2710
	cmpl	$10001, %edx                    ## imm = 0x2711
	jae	LBB0_9
	jmp	LBB0_10
LBB0_4:
	movl	$-1, %eax
	jmp	LBB0_26
LBB0_7:
	movl	$1000, %eax                     ## imm = 0x3E8
LBB0_9:
	movq	_Q_limit@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	movl	%eax, %edx
LBB0_10:
	movq	_R@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	shll	$2, %edx
	xorl	%esi, %esi
	callq	_memset
	testb	$8, -44(%rbp)                   ## 1-byte Folded Reload
	jne	LBB0_11
## %bb.12:
	movq	_heap_push_user_ad_std@GOTPCREL(%rip), %rax
	jmp	LBB0_13
LBB0_11:
	movq	_heap_push_user_ad_ext@GOTPCREL(%rip), %rax
LBB0_13:
	movl	-52(%rbp), %edx                 ## 4-byte Reload
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	movl	(%rax), %eax
	movq	_heap_push_user_ad@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	movq	___use_factor@GOTPCREL(%rip), %rax
	movl	$1, (%rax)
	movq	___use_views_limit@GOTPCREL(%rip), %rax
	movq	$0, (%rax)
	movq	___exclude_ad_id@GOTPCREL(%rip), %rax
	movl	%r13d, (%rax)
	movzbl	%sil, %eax
	movq	_ADF_SITES_MASK_SHIFT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	shll	%cl, %eax
	movzbl	%dl, %edx
	shll	%cl, %edx
	movq	___and_mask@GOTPCREL(%rip), %rsi
	movl	%eax, (%rsi)
	movq	___xor_mask@GOTPCREL(%rip), %rax
	movl	%edx, (%rax)
	movq	___cat_mask@GOTPCREL(%rip), %rax
	movq	$-1, (%rax)
	movq	(%r15), %r13
	movl	%r12d, %eax
	cmpq	%rax, %r13
	movl	%r13d, %eax
	cmovgel	%r12d, %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	testq	%r13, %r13
	jle	LBB0_22
## %bb.14:
	movslq	-44(%rbp), %r12                 ## 4-byte Folded Reload
	xorl	%ebx, %ebx
	jmp	LBB0_15
	.p2align	4, 0x90
LBB0_20:                                ##   in Loop: Header=BB0_15 Depth=1
	decq	%r13
	incq	%rbx
	cmpq	(%r15), %rbx
	jge	LBB0_21
LBB0_15:                                ## =>This Inner Loop Header: Depth=1
	xorl	%eax, %eax
	callq	_lrand48
	movq	%rax, %rcx
	orq	%r13, %rcx
	shrq	$32, %rcx
	je	LBB0_16
## %bb.17:                              ##   in Loop: Header=BB0_15 Depth=1
	cqto
	idivq	%r13
	cmpq	%r12, %rdx
	jge	LBB0_20
	jmp	LBB0_19
	.p2align	4, 0x90
LBB0_16:                                ##   in Loop: Header=BB0_15 Depth=1
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%r13d
                                        ## kill: def $edx killed $edx def $rdx
	cmpq	%r12, %rdx
	jge	LBB0_20
LBB0_19:                                ##   in Loop: Header=BB0_15 Depth=1
	decq	%r12
	movq	8(%r15), %rax
	movl	(%rax,%rbx,4), %edi
	movl	%r14d, %esi
	callq	_user_ad_price
	movq	_Q_limit@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	leal	-1(%rcx), %edx
	testl	%eax, %eax
	movl	$0, %esi
	cmovgl	%eax, %esi
	cmpl	%ecx, %eax
	cmovgel	%edx, %esi
	movq	_R@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movslq	%esi, %rcx
	incl	(%rax,%rcx,4)
	jmp	LBB0_20
LBB0_21:
	movq	_ADF_SITES_MASK_SHIFT@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_R_cnt@GOTPCREL(%rip), %rbx
LBB0_22:
	movq	___use_factor@GOTPCREL(%rip), %rax
	movl	$0, (%rax)
	movq	___use_views_limit@GOTPCREL(%rip), %rax
	movq	$0, (%rax)
	movq	___exclude_ad_id@GOTPCREL(%rip), %rax
	movl	$0, (%rax)
	movl	$254, %eax
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %eax
	movq	___and_mask@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	movq	___xor_mask@GOTPCREL(%rip), %rax
	movl	$0, (%rax)
	movq	_Q_limit@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	movq	_R@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	.p2align	4, 0x90
LBB0_23:                                ## =>This Inner Loop Header: Depth=1
	movl	%eax, (%rbx)
	subq	$1, %rax
	jb	LBB0_25
## %bb.24:                              ##   in Loop: Header=BB0_23 Depth=1
	cmpl	$0, (%rcx,%rax,4)
	je	LBB0_23
LBB0_25:
	movl	-44(%rbp), %eax                 ## 4-byte Reload
LBB0_26:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_R_cnt,4,2                      ## @R_cnt
	.comm	_Q_limit,4,2                    ## @Q_limit
	.comm	_R,8,3                          ## @R
	.comm	_heap_push_user_ad_ext,4,2      ## @heap_push_user_ad_ext
	.comm	_heap_push_user_ad_std,4,2      ## @heap_push_user_ad_std
	.comm	_heap_push_user_ad,4,2          ## @heap_push_user_ad
	.comm	___use_factor,4,2               ## @__use_factor
	.comm	___use_views_limit,8,3          ## @__use_views_limit
	.comm	___exclude_ad_id,4,2            ## @__exclude_ad_id
	.comm	_ADF_SITES_MASK_SHIFT,4,2       ## @ADF_SITES_MASK_SHIFT
	.comm	___and_mask,4,2                 ## @__and_mask
	.comm	___xor_mask,4,2                 ## @__xor_mask
	.comm	___cat_mask,8,3                 ## @__cat_mask
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_perform_ad_pricing             ; -- Begin function perform_ad_pricing
	.p2align	2
_perform_ad_pricing:                    ; @perform_ad_pricing
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
Lloh0:
	adrp	x27, _R_cnt@GOTPAGE
Lloh1:
	ldr	x27, [x27, _R_cnt@GOTPAGEOFF]
	str	wzr, [x27]
	mov	w21, #-1
	cmp	w0, #1
	b.lt	LBB0_20
; %bb.1:
	mov	x19, x1
	sub	w8, w1, #101
	cmn	w8, #100
	b.lo	LBB0_20
; %bb.2:
	mov	x22, x5
	sub	w8, w5, #1001
	cmn	w8, #1000
	b.lo	LBB0_20
; %bb.3:
	mov	x23, x4
	mov	x24, x3
	mov	x26, x2
	mov	x25, x0
	mov	w1, #0
	bl	_get_ad_f
	cbz	x0, LBB0_8
; %bb.4:
	mov	x20, x0
	ldr	x8, [x0, #8]
	cbz	x8, LBB0_8
; %bb.5:
Lloh2:
	adrp	x8, _Q_limit@GOTPAGE
Lloh3:
	ldr	x8, [x8, _Q_limit@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	cmp	w8, #1
	b.lt	LBB0_9
; %bb.6:
	mov	w9, #10001
	cmp	w8, w9
	b.lo	LBB0_11
; %bb.7:
	mov	w8, #10000
	b	LBB0_10
LBB0_8:
	mov	w21, #-1
	b	LBB0_20
LBB0_9:
	mov	w8, #1000
LBB0_10:
Lloh5:
	adrp	x9, _Q_limit@GOTPAGE
Lloh6:
	ldr	x9, [x9, _Q_limit@GOTPAGEOFF]
Lloh7:
	str	w8, [x9]
LBB0_11:
Lloh8:
	adrp	x28, _R@GOTPAGE
Lloh9:
	ldr	x28, [x28, _R@GOTPAGEOFF]
	ldr	x0, [x28]
	lsl	w2, w8, #2
	mov	w1, #0
	bl	_memset
Lloh10:
	adrp	x8, _heap_push_user_ad_ext@GOTPAGE
Lloh11:
	ldr	x8, [x8, _heap_push_user_ad_ext@GOTPAGEOFF]
Lloh12:
	adrp	x9, _heap_push_user_ad_std@GOTPAGE
Lloh13:
	ldr	x9, [x9, _heap_push_user_ad_std@GOTPAGEOFF]
	tst	w26, #0x8
	csel	x8, x9, x8, eq
	ldr	w8, [x8]
Lloh14:
	adrp	x9, _heap_push_user_ad@GOTPAGE
Lloh15:
	ldr	x9, [x9, _heap_push_user_ad@GOTPAGEOFF]
Lloh16:
	adrp	x11, ___use_factor@GOTPAGE
Lloh17:
	ldr	x11, [x11, ___use_factor@GOTPAGEOFF]
Lloh18:
	str	w8, [x9]
	mov	w8, #1
	str	w8, [x11]
Lloh19:
	adrp	x12, ___use_views_limit@GOTPAGE
Lloh20:
	ldr	x12, [x12, ___use_views_limit@GOTPAGEOFF]
	str	xzr, [x12]
Lloh21:
	adrp	x13, ___exclude_ad_id@GOTPAGE
Lloh22:
	ldr	x13, [x13, ___exclude_ad_id@GOTPAGEOFF]
	str	w25, [x13]
	and	w9, w24, #0xff
Lloh23:
	adrp	x8, _ADF_SITES_MASK_SHIFT@GOTPAGE
Lloh24:
	ldr	x8, [x8, _ADF_SITES_MASK_SHIFT@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
	lsl	w9, w9, w8
Lloh26:
	adrp	x24, ___and_mask@GOTPAGE
Lloh27:
	ldr	x24, [x24, ___and_mask@GOTPAGEOFF]
	str	w9, [x24]
	and	w9, w23, #0xff
	lsl	w9, w9, w8
Lloh28:
	adrp	x23, ___xor_mask@GOTPAGE
Lloh29:
	ldr	x23, [x23, ___xor_mask@GOTPAGEOFF]
	str	w9, [x23]
Lloh30:
	adrp	x9, ___cat_mask@GOTPAGE
Lloh31:
	ldr	x9, [x9, ___cat_mask@GOTPAGEOFF]
	mov	x10, #-1
Lloh32:
	str	x10, [x9]
	ldr	x25, [x20]
	cmp	x25, w22, uxtw
	csel	w21, w25, w22, lt
	cmp	x25, #1
	b.lt	LBB0_17
; %bb.12:
	mov	x22, #0
	sxtw	x26, w21
	b	LBB0_14
LBB0_13:                                ;   in Loop: Header=BB0_14 Depth=1
	sub	x25, x25, #1
	add	x22, x22, #1
	ldr	x8, [x20]
	cmp	x22, x8
	b.ge	LBB0_16
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
	bl	_lrand48
	sdiv	x8, x0, x25
	msub	x8, x8, x25, x0
	cmp	x8, x26
	b.ge	LBB0_13
; %bb.15:                               ;   in Loop: Header=BB0_14 Depth=1
	sub	x26, x26, #1
	ldr	x8, [x20, #8]
	ldr	w0, [x8, x22, lsl #2]
	mov	x1, x19
	bl	_user_ad_price
Lloh33:
	adrp	x8, _Q_limit@GOTPAGE
Lloh34:
	ldr	x8, [x8, _Q_limit@GOTPAGEOFF]
Lloh35:
	ldr	w8, [x8]
	sub	w9, w8, #1
	cmp	w0, #0
	csel	w10, w0, wzr, gt
	cmp	w0, w8
	csel	w8, w10, w9, lt
	ldr	x9, [x28]
	sbfiz	x8, x8, #2, #32
	ldr	w10, [x9, x8]
	add	w10, w10, #1
	str	w10, [x9, x8]
	b	LBB0_13
LBB0_16:
Lloh36:
	adrp	x8, _ADF_SITES_MASK_SHIFT@GOTPAGE
Lloh37:
	ldr	x8, [x8, _ADF_SITES_MASK_SHIFT@GOTPAGEOFF]
Lloh38:
	ldr	w8, [x8]
Lloh39:
	adrp	x11, ___use_factor@GOTPAGE
Lloh40:
	ldr	x11, [x11, ___use_factor@GOTPAGEOFF]
Lloh41:
	adrp	x12, ___use_views_limit@GOTPAGE
Lloh42:
	ldr	x12, [x12, ___use_views_limit@GOTPAGEOFF]
Lloh43:
	adrp	x13, ___exclude_ad_id@GOTPAGE
Lloh44:
	ldr	x13, [x13, ___exclude_ad_id@GOTPAGEOFF]
LBB0_17:
	str	wzr, [x11]
	str	xzr, [x12]
	str	wzr, [x13]
	mov	w9, #254
	lsl	w8, w9, w8
	str	w8, [x24]
	str	wzr, [x23]
Lloh45:
	adrp	x8, _Q_limit@GOTPAGE
Lloh46:
	ldr	x8, [x8, _Q_limit@GOTPAGEOFF]
Lloh47:
	ldrsw	x8, [x8]
	ldr	x9, [x28]
	sub	x9, x9, #4
LBB0_18:                                ; =>This Inner Loop Header: Depth=1
	str	w8, [x27]
	cbz	x8, LBB0_20
; %bb.19:                               ;   in Loop: Header=BB0_18 Depth=1
	ldr	w10, [x9, x8, lsl #2]
	sub	x8, x8, #1
	cbz	w10, LBB0_18
LBB0_20:
	mov	x0, x21
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotStr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotStr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotStr	Lloh14, Lloh15, Lloh18
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGot	Lloh43, Lloh44
	.loh AdrpLdrGot	Lloh41, Lloh42
	.loh AdrpLdrGot	Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh45, Lloh46, Lloh47
	.cfi_endproc
                                        ; -- End function
	.comm	_R_cnt,4,2                      ; @R_cnt
	.comm	_Q_limit,4,2                    ; @Q_limit
	.comm	_R,8,3                          ; @R
	.comm	_heap_push_user_ad_ext,4,2      ; @heap_push_user_ad_ext
	.comm	_heap_push_user_ad_std,4,2      ; @heap_push_user_ad_std
	.comm	_heap_push_user_ad,4,2          ; @heap_push_user_ad
	.comm	___use_factor,4,2               ; @__use_factor
	.comm	___use_views_limit,8,3          ; @__use_views_limit
	.comm	___exclude_ad_id,4,2            ; @__exclude_ad_id
	.comm	_ADF_SITES_MASK_SHIFT,4,2       ; @ADF_SITES_MASK_SHIFT
	.comm	___and_mask,4,2                 ; @__and_mask
	.comm	___xor_mask,4,2                 ; @__xor_mask
	.comm	___cat_mask,8,3                 ; @__cat_mask
.subsections_via_symbols
