	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ## -- Begin function heap_push_user_ad_ext
LCPI0_0:
	.quad	0x3ff0000000000000              ## double 1
LCPI0_1:
	.quad	0x3fe62e42fefa39ef              ## double 0.69314718055994529
LCPI0_2:
	.quad	0x3fa5555555555555              ## double 0.041666666666666664
LCPI0_3:
	.quad	0x3fc5555555555555              ## double 0.16666666666666666
LCPI0_4:
	.quad	0x3fe0000000000000              ## double 0.5
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_heap_push_user_ad_ext
	.p2align	4, 0x90
_heap_push_user_ad_ext:                 ## @heap_push_user_ad_ext
	.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	%r12
	pushq	%rbx
	subq	$32, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rax
	movl	(%rdi), %edi
	movq	___exclude_ad_id@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %edi
	je	LBB0_26
## %bb.1:
	movslq	4(%rax), %r14
	callq	_get_ad
	movq	%rax, %rbx
	movq	___xor_mask@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	xorl	(%rbx), %eax
	movq	___and_mask@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_2
LBB0_26:
	movl	$1, %eax
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movq	___use_views_limit@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_4
## %bb.3:
	movq	8(%rbx), %rax
	cmpq	16(%rbx), %rax
	jge	LBB0_26
LBB0_4:
	movq	72(%rbx), %rsi
	testq	%rsi, %rsi
	je	LBB0_6
## %bb.5:
	movq	___user@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	callq	_is_user_in_group
	testq	%rax, %rax
	jne	LBB0_26
LBB0_6:
	movl	24(%rbx), %esi
	xorl	%eax, %eax
	cmpl	$64, %esi
	cmovll	%esi, %eax
	movq	___cat_mask@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	btq	%rax, %rcx
	jae	LBB0_26
## %bb.7:
	cmpq	$0, 32(%rbx)
	jle	LBB0_8
## %bb.11:
	leaq	1(%r14), %rax
	movq	_MAX_AD_VIEWS@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	leaq	-1(%rcx), %r15
	cmpq	%rax, %rcx
	cmovgq	%rax, %r15
	testl	%esi, %esi
	je	LBB0_12
## %bb.13:
	movq	___user@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%rax), %edi
	callq	_targ_weights_at
	cvtsi2sd	%rax, %xmm3
	jmp	LBB0_14
LBB0_8:
	movq	_ADF_LIMIT_VIEWS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rbx)
	je	LBB0_10
## %bb.9:
	cmpl	$99, %r14d
	jg	LBB0_26
LBB0_10:
	movsd	40(%rbx), %xmm0                 ## xmm0 = mem[0],zero
	jmp	LBB0_25
LBB0_12:
	xorpd	%xmm3, %xmm3
LBB0_14:
	movl	48(%rbx), %esi
	testl	%esi, %esi
	je	LBB0_16
## %bb.15:
	movq	___user@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%rax), %edi
	movsd	%xmm3, -40(%rbp)                ## 8-byte Spill
	callq	_targ_weights_at
	movsd	-40(%rbp), %xmm3                ## 8-byte Reload
                                        ## xmm3 = mem[0],zero
	cvtsi2sd	%rax, %xmm0
	addsd	%xmm0, %xmm3
LBB0_16:
	xorpd	%xmm0, %xmm0
	ucomisd	%xmm0, %xmm3
	jne	LBB0_18
	jnp	LBB0_17
LBB0_18:
	mulsd	LCPI0_1(%rip), %xmm3
	movsd	LCPI0_2(%rip), %xmm2            ## xmm2 = mem[0],zero
	mulsd	%xmm3, %xmm2
	addsd	LCPI0_3(%rip), %xmm2
	mulsd	%xmm3, %xmm2
	addsd	LCPI0_4(%rip), %xmm2
	mulsd	%xmm3, %xmm2
	movsd	LCPI0_0(%rip), %xmm1            ## xmm1 = mem[0],zero
	addsd	%xmm1, %xmm2
	mulsd	%xmm3, %xmm2
	addsd	%xmm1, %xmm2
	movsd	%xmm2, -40(%rbp)                ## 8-byte Spill
	jmp	LBB0_19
LBB0_17:
	movsd	LCPI0_0(%rip), %xmm1            ## xmm1 = mem[0],zero
	movsd	%xmm1, -40(%rbp)                ## 8-byte Spill
LBB0_19:
	movq	_AdStats@GOTPCREL(%rip), %r12
	movq	(%r12), %rax
	movq	%r15, %rcx
	shlq	$4, %rcx
	cmpeqsd	(%rax,%rcx), %xmm0
	movq	%xmm0, %rdi
	andl	$1, %edi
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_22
## %bb.20:
	movq	(%r12), %rax
	xorpd	%xmm0, %xmm0
	cmpeqsd	(%rax), %xmm0
	movq	%xmm0, %rdi
	andl	$1, %edi
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_21
## %bb.27:
	movsd	-40(%rbp), %xmm0                ## 8-byte Reload
                                        ## xmm0 = mem[0],zero
	mulsd	40(%rbx), %xmm0
	jmp	LBB0_25
LBB0_21:
	xorl	%r15d, %r15d
LBB0_22:
	movq	(%r12), %rax
	shlq	$4, %r15
	xorps	%xmm2, %xmm2
	cvtsi2sdq	8(%rax,%r15), %xmm2
	divsd	(%rax,%r15), %xmm2
	movsd	56(%rbx), %xmm3                 ## xmm3 = mem[0],zero
	mulsd	%xmm2, %xmm3
	mulsd	64(%rbx), %xmm2
	movq	_HN@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	___gsort_limit@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_24
## %bb.23:
	movapd	%xmm2, %xmm0
	addsd	%xmm2, %xmm0
	addsd	%xmm3, %xmm0
	mulsd	-40(%rbp), %xmm0                ## 8-byte Folded Reload
	movq	_H@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movsd	8(%rax), %xmm1                  ## xmm1 = mem[0],zero
	ucomisd	%xmm0, %xmm1
	jae	LBB0_26
LBB0_24:
	xorl	%eax, %eax
	movsd	%xmm2, -56(%rbp)                ## 8-byte Spill
	movsd	%xmm3, -64(%rbp)                ## 8-byte Spill
	callq	_drand48
	movsd	%xmm0, -48(%rbp)                ## 8-byte Spill
	xorl	%eax, %eax
	callq	_drand48
	addsd	-48(%rbp), %xmm0                ## 8-byte Folded Reload
	movsd	%xmm0, -48(%rbp)                ## 8-byte Spill
	xorl	%eax, %eax
	callq	_drand48
	movsd	-48(%rbp), %xmm1                ## 8-byte Reload
                                        ## xmm1 = mem[0],zero
	subsd	%xmm0, %xmm1
	movsd	%xmm1, -48(%rbp)                ## 8-byte Spill
	xorl	%eax, %eax
	callq	_drand48
	movsd	-48(%rbp), %xmm1                ## 8-byte Reload
                                        ## xmm1 = mem[0],zero
	subsd	%xmm0, %xmm1
	movsd	-56(%rbp), %xmm0                ## 8-byte Reload
                                        ## xmm0 = mem[0],zero
	mulsd	%xmm1, %xmm0
	addsd	-64(%rbp), %xmm0                ## 8-byte Folded Reload
	movapd	%xmm0, %xmm1
	movsd	-40(%rbp), %xmm0                ## 8-byte Reload
                                        ## xmm0 = mem[0],zero
	mulsd	%xmm1, %xmm0
LBB0_25:
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	_heap_insert
	jmp	LBB0_26
	.cfi_endproc
                                        ## -- End function
	.comm	___exclude_ad_id,4,2            ## @__exclude_ad_id
	.comm	___xor_mask,4,2                 ## @__xor_mask
	.comm	___and_mask,4,2                 ## @__and_mask
	.comm	___use_views_limit,8,3          ## @__use_views_limit
	.comm	___user,8,3                     ## @__user
	.comm	___cat_mask,8,3                 ## @__cat_mask
	.comm	_ADF_LIMIT_VIEWS,4,2            ## @ADF_LIMIT_VIEWS
	.comm	_MAX_AD_VIEWS,8,3               ## @MAX_AD_VIEWS
	.comm	_AdStats,8,3                    ## @AdStats
	.comm	_HN,8,3                         ## @HN
	.comm	___gsort_limit,8,3              ## @__gsort_limit
	.comm	_H,8,3                          ## @H
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_heap_push_user_ad_ext          ; -- Begin function heap_push_user_ad_ext
	.p2align	2
_heap_push_user_ad_ext:                 ; @heap_push_user_ad_ext
	.cfi_startproc
; %bb.0:
	stp	d11, d10, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	d9, d8, [sp, #16]               ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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 b8, -56
	.cfi_offset b9, -64
	.cfi_offset b10, -72
	.cfi_offset b11, -80
	mov	x8, x0
	ldr	w0, [x0]
Lloh0:
	adrp	x9, ___exclude_ad_id@GOTPAGE
Lloh1:
	ldr	x9, [x9, ___exclude_ad_id@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	cmp	w0, w9
	b.eq	LBB0_2
; %bb.1:
	ldrsw	x19, [x8, #4]
	bl	_get_ad
	ldr	w8, [x0]
Lloh3:
	adrp	x9, ___xor_mask@GOTPAGE
Lloh4:
	ldr	x9, [x9, ___xor_mask@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	eor	w8, w9, w8
Lloh6:
	adrp	x9, ___and_mask@GOTPAGE
Lloh7:
	ldr	x9, [x9, ___and_mask@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	tst	w8, w9
	b.eq	LBB0_3
LBB0_2:
	mov	w0, #1
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	d9, d8, [sp, #16]               ; 16-byte Folded Reload
	ldp	d11, d10, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_3:
	mov	x20, x0
Lloh9:
	adrp	x8, ___use_views_limit@GOTPAGE
Lloh10:
	ldr	x8, [x8, ___use_views_limit@GOTPAGEOFF]
Lloh11:
	ldr	x8, [x8]
	cbz	x8, LBB0_5
; %bb.4:
	ldp	x8, x9, [x20, #8]
	cmp	x8, x9
	b.ge	LBB0_2
LBB0_5:
	ldr	x1, [x20, #72]
	cbz	x1, LBB0_7
; %bb.6:
Lloh12:
	adrp	x8, ___user@GOTPAGE
Lloh13:
	ldr	x8, [x8, ___user@GOTPAGEOFF]
Lloh14:
	ldr	x0, [x8]
	bl	_is_user_in_group
	cbnz	x0, LBB0_2
LBB0_7:
	ldr	w1, [x20, #24]
	cmp	w1, #63
	csel	w8, wzr, w1, gt
Lloh15:
	adrp	x9, ___cat_mask@GOTPAGE
Lloh16:
	ldr	x9, [x9, ___cat_mask@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	lsr	x8, x9, x8
	tbz	w8, #0, LBB0_2
; %bb.8:
	ldr	x8, [x20, #32]
	cmp	x8, #0
	b.le	LBB0_11
; %bb.9:
	add	x8, x19, #1
Lloh18:
	adrp	x9, _MAX_AD_VIEWS@GOTPAGE
Lloh19:
	ldr	x9, [x9, _MAX_AD_VIEWS@GOTPAGEOFF]
Lloh20:
	ldr	x9, [x9]
	sub	x10, x9, #1
	cmp	x9, x8
	csinc	x21, x10, x19, le
	cbz	w1, LBB0_14
; %bb.10:
Lloh21:
	adrp	x8, ___user@GOTPAGE
Lloh22:
	ldr	x8, [x8, ___user@GOTPAGEOFF]
Lloh23:
	ldr	x8, [x8]
	ldr	w0, [x8]
	bl	_targ_weights_at
	scvtf	d8, x0
	b	LBB0_15
LBB0_11:
	ldr	w8, [x20]
Lloh24:
	adrp	x9, _ADF_LIMIT_VIEWS@GOTPAGE
Lloh25:
	ldr	x9, [x9, _ADF_LIMIT_VIEWS@GOTPAGEOFF]
Lloh26:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_13
; %bb.12:
	cmp	w19, #99
	b.gt	LBB0_2
LBB0_13:
	ldr	d0, [x20, #40]
	b	LBB0_28
LBB0_14:
	movi	d8, #0000000000000000
LBB0_15:
	ldr	w1, [x20, #48]
	cbz	w1, LBB0_17
; %bb.16:
Lloh27:
	adrp	x8, ___user@GOTPAGE
Lloh28:
	ldr	x8, [x8, ___user@GOTPAGEOFF]
Lloh29:
	ldr	x8, [x8]
	ldr	w0, [x8]
	bl	_targ_weights_at
	scvtf	d0, x0
	fadd	d8, d8, d0
LBB0_17:
	fcmp	d8, #0.0
	b.eq	LBB0_19
; %bb.18:
	mov	x8, #14831
	movk	x8, #65274, lsl #16
	movk	x8, #11842, lsl #32
	movk	x8, #16358, lsl #48
	fmov	d0, x8
	fmul	d0, d8, d0
	mov	x8, #6148914691236517205
	movk	x8, #16325, lsl #48
	fmov	d1, x8
	mov	x8, #6148914691236517205
	movk	x8, #16293, lsl #48
	fmov	d2, x8
	fmadd	d1, d0, d2, d1
	fmov	d2, #0.50000000
	fmadd	d1, d1, d0, d2
	fmov	d2, #1.00000000
	fmadd	d1, d1, d0, d2
	fmadd	d9, d1, d0, d2
	b	LBB0_20
LBB0_19:
	fmov	d9, #1.00000000
LBB0_20:
Lloh30:
	adrp	x22, _AdStats@GOTPAGE
Lloh31:
	ldr	x22, [x22, _AdStats@GOTPAGEOFF]
	ldr	x8, [x22]
	lsl	x9, x21, #4
	ldr	d0, [x8, x9]
	fcmp	d0, #0.0
	cset	w0, eq
	bl	_unlikely
	cbz	x0, LBB0_24
; %bb.21:
	ldr	x8, [x22]
	ldr	d0, [x8]
	fcmp	d0, #0.0
	cset	w0, eq
	bl	_unlikely
	cbz	x0, LBB0_23
; %bb.22:
	ldr	d0, [x20, #40]
	b	LBB0_27
LBB0_23:
	mov	x21, #0
LBB0_24:
	ldr	x8, [x22]
	add	x8, x8, x21, lsl #4
	ldp	d1, d0, [x8]
	scvtf	d0, d0
	fdiv	d0, d0, d1
	ldp	d1, d2, [x20, #56]
	fmul	d10, d1, d0
Lloh32:
	adrp	x8, _HN@GOTPAGE
Lloh33:
	ldr	x8, [x8, _HN@GOTPAGEOFF]
	fmul	d11, d0, d2
Lloh34:
	ldr	x8, [x8]
Lloh35:
	adrp	x9, ___gsort_limit@GOTPAGE
Lloh36:
	ldr	x9, [x9, ___gsort_limit@GOTPAGEOFF]
Lloh37:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_26
; %bb.25:
	fmov	d0, #2.00000000
	fmadd	d0, d11, d0, d10
	fmul	d0, d9, d0
Lloh38:
	adrp	x8, _H@GOTPAGE
Lloh39:
	ldr	x8, [x8, _H@GOTPAGEOFF]
Lloh40:
	ldr	x8, [x8]
	ldr	d1, [x8, #8]
	fcmp	d0, d1
	b.ls	LBB0_2
LBB0_26:
	bl	_drand48
	fmov	d8, d0
	bl	_drand48
	fadd	d8, d8, d0
	bl	_drand48
	fsub	d8, d8, d0
	bl	_drand48
	fsub	d0, d8, d0
	fmadd	d0, d11, d0, d10
LBB0_27:
	fmul	d0, d9, d0
LBB0_28:
	mov	x0, x20
	mov	x1, x19
	bl	_heap_insert
	b	LBB0_2
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.cfi_endproc
                                        ; -- End function
	.comm	___exclude_ad_id,4,2            ; @__exclude_ad_id
	.comm	___xor_mask,4,2                 ; @__xor_mask
	.comm	___and_mask,4,2                 ; @__and_mask
	.comm	___use_views_limit,8,3          ; @__use_views_limit
	.comm	___user,8,3                     ; @__user
	.comm	___cat_mask,8,3                 ; @__cat_mask
	.comm	_ADF_LIMIT_VIEWS,4,2            ; @ADF_LIMIT_VIEWS
	.comm	_MAX_AD_VIEWS,8,3               ; @MAX_AD_VIEWS
	.comm	_AdStats,8,3                    ; @AdStats
	.comm	_HN,8,3                         ; @HN
	.comm	___gsort_limit,8,3              ; @__gsort_limit
	.comm	_H,8,3                          ; @H
.subsections_via_symbols
