// File: /workspace/github_cpp_makefile_star2_O3/dtsaras[P]GCW/GCW.cpp
// Function: calculateInfluence_SSA(Graph&, HyperGraph&, std::vector<int, std::allocator<int>>&, int, double, double, float, float, int, long long, long long&, sampler<int>&, int)
bool calculateInfluence_SSA(Graph & g, HyperGraph & hg, vector<int> & seeds, int t, double expected, double epsilon_1, float epsilon_2, float delta, int m, long long int maxSamples, long long int & checkSam, sampler<int> &samp, int p){
	long long  counter = 0;
	int n = g.getSize();
	unsigned int k = seeds.size();
	double f = log2(n*(log(2/delta)+lgamma(n+1)-lgamma(k+1)-lgamma(n-k+1))/(k*log(2/delta)));
	double upperBound = 1+(2+2*epsilon_2/3)*(1 + epsilon_2)*(log(3/delta)+log(f))/(epsilon_2*epsilon_2);
	vector<unsigned int> link(n+1,k);
	int degree=0;
	vector<float> benefits(n,0);
	for (unsigned int i = 0; i < k;++i){
		link[seeds[i]] = i;
	}
	vector<bool> maxSeed(t, false);
	omp_set_num_threads(t);
	#pragma omp parallel
	{
		vector<bool> visit(n+1,false);
		vector<int> visit_mark(n,0);
		int id = omp_get_thread_num();
		if (m == 0){
		    while (counter <= maxSamples && degree < upperBound){
	            maxSeed[id]=hg.pollingLT(g,link,k,visit,visit_mark, samp, p);
				#pragma omp critical
				{
                	counter++;
					if (maxSeed[id]){
						degree++;
					}
				}
        	}
		} 
		else {
			while (counter <= maxSamples && degree < upperBound){
                maxSeed[id]=hg.pollingIC(g,link,k,visit,visit_mark, samp, p);
                #pragma omp critical
                {
                    counter++;
                    if (maxSeed[id]){
                        degree++;
                    }
                }
            }
		}
	}
	checkSam += counter;

	if (expected <= (1 + epsilon_1)*((double)degree*n/(double)counter)){
		return true;
	}
	return false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf8, %rsp
movq %r9, 0x18(%rsp)
movl %r8d, 0x20(%rsp)
movss %xmm3, 0x10(%rsp)
movss %xmm2, 0x24(%rsp)
movsd %xmm1, 0x90(%rsp)
movsd %xmm0, 0x98(%rsp)
movl %ecx, 0x28(%rsp)
movq %rdx, %rbx
movq %rsi, 0x48(%rsp)
movq %rdi, 0x40(%rsp)
callq 0xdfbe
movl %eax, %ebp
movq 0x8(%rbx), %r14
movq %rbx, %r15
subq (%rbx), %r14
shrq $0x2, %r14
leaq 0xc(%rsp), %rax
xorps %xmm0, %xmm0
cvtsi2sd %ebp, %xmm0
movsd %xmm0, 0x38(%rsp)
movl %r14d, (%rax)
movss 0x1289e(%rip), %xmm0    # 0x170c4
divss 0x10(%rsp), %xmm0
movss %xmm0, 0x30(%rsp)
callq 0x3640
cvtss2sd %xmm0, %xmm0
movsd %xmm0, (%rsp)
leal 0x1(%rbp), %ebx
xorps %xmm0, %xmm0
cvtsi2sd %ebx, %xmm0
callq 0x32a0
addsd (%rsp), %xmm0
movsd %xmm0, (%rsp)
leal 0x1(%r14), %eax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
callq 0x32a0
movsd (%rsp), %xmm1
subsd %xmm0, %xmm1
movsd %xmm1, (%rsp)
movl %ebx, %eax
subl %r14d, %eax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
callq 0x32a0
movsd (%rsp), %xmm1
subsd %xmm0, %xmm1
mulsd 0x38(%rsp), %xmm1
movsd %xmm1, (%rsp)
movl %r14d, %eax
xorps %xmm0, %xmm0
cvtsi2ss %rax, %xmm0
movss %xmm0, 0x2c(%rsp)
movss 0x30(%rsp), %xmm0
callq 0x3640
mulss 0x2c(%rsp), %xmm0
xorps %xmm1, %xmm1
cvtss2sd %xmm0, %xmm1
movsd (%rsp), %xmm0
divsd %xmm1, %xmm0
callq 0x35d0
movsd %xmm0, (%rsp)
movss 0x127de(%rip), %xmm0    # 0x170c0
divss 0x10(%rsp), %xmm0
callq 0x3640
movss %xmm0, 0x10(%rsp)
movsd (%rsp), %xmm0
callq 0x32d0
movsd %xmm0, (%rsp)
movslq %ebx, %r13
leaq 0xa0(%rsp), %rdi
leaq 0x50(%rsp), %r12
movq %r13, %rsi
leaq 0xc(%rsp), %rdx
movq %r12, %rcx
callq 0xa6c0
movslq %ebp, %rbp
movl $0x0, (%r12)
leaq 0xe0(%rsp), %rdi
leaq 0x50(%rsp), %rdx
leaq 0xb8(%rsp), %rcx
movq %rbp, %rsi
callq 0xa83c
cmpl $0x0, 0xc(%rsp)
je 0x4971
movq (%r15), %rax
movq 0xa0(%rsp), %rcx
xorl %edx, %edx
movslq (%rax,%rdx,4), %rsi
movl %edx, (%rcx,%rsi,4)
incq %rdx
movl 0xc(%rsp), %esi
cmpq %rsi, %rdx
jb 0x495e
movslq 0x28(%rsp), %rsi
leaq 0xb8(%rsp), %rdx
movb $0x0, (%rdx)
leaq 0x50(%rsp), %rdi
leaq 0x78(%rsp), %rcx
callq 0xa390
leaq 0x78(%rsp), %rdx
movb $0x0, (%rdx)
leaq 0xb8(%rsp), %rdi
leaq 0x34(%rsp), %rcx
movq %r13, %rsi
callq 0xa390
leaq 0x34(%rsp), %rdx
movl $0x0, (%rdx)
leaq 0x78(%rsp), %rdi
leaq 0x17(%rsp), %rcx
movq %rbp, %rsi
callq 0xa214
movss 0x24(%rsp), %xmm3
movaps %xmm3, %xmm0
addss %xmm3, %xmm0
divss 0x126e1(%rip), %xmm0    # 0x170c0
addss 0x126dd(%rip), %xmm0    # 0x170c4
movss 0x126cd(%rip), %xmm1    # 0x170bc
addss %xmm3, %xmm1
mulss %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtss2sd 0x10(%rsp), %xmm0
cvtss2sd %xmm1, %xmm1
movsd (%rsp), %xmm2
addsd %xmm0, %xmm2
mulsd %xmm1, %xmm2
mulss %xmm3, %xmm3
xorps %xmm0, %xmm0
cvtss2sd %xmm3, %xmm0
divsd %xmm0, %xmm2
addsd 0x12648(%rip), %xmm2    # 0x17070
cmpq $0x0, 0x18(%rsp)
setns %cl
xorpd %xmm0, %xmm0
movsd %xmm2, (%rsp)
ucomisd %xmm0, %xmm2
seta %al
andb %cl, %al
cmpl $0x0, 0x20(%rsp)
je 0x4ae1
testb %al, %al
je 0x4b6d
xorl %r14d, %r14d
leaq 0xa0(%rsp), %r12
leaq 0xb8(%rsp), %r13
leaq 0x78(%rsp), %rbp
xorl %ebx, %ebx
movl 0xc(%rsp), %ecx
movq 0x48(%rsp), %rdi
movq 0x40(%rsp), %rsi
movq %r12, %rdx
movq %r13, %r8
movq %rbp, %r9
movl 0x140(%rsp), %eax
pushq %rax
pushq 0x140(%rsp)
callq 0x100ba
addq $0x10, %rsp
movq 0x50(%rsp), %rcx
movq (%rcx), %rdx
andq $-0x2, %rdx
movzbl %al, %eax
addq %rax, %rdx
movq %rdx, (%rcx)
leaq 0x1(%rbx), %r15
addl %eax, %r14d
cmpq 0x18(%rsp), %rbx
jge 0x4b73
xorps %xmm0, %xmm0
cvtsi2sd %r14d, %xmm0
movsd (%rsp), %xmm1
ucomisd %xmm0, %xmm1
movq %r15, %rbx
ja 0x4a70
jmp 0x4b73
testb %al, %al
je 0x4b6d
xorl %r14d, %r14d
leaq 0xa0(%rsp), %r12
leaq 0xb8(%rsp), %r13
leaq 0x78(%rsp), %rbp
xorl %ebx, %ebx
movl 0xc(%rsp), %ecx
movq 0x48(%rsp), %rdi
movq 0x40(%rsp), %rsi
movq %r12, %rdx
movq %r13, %r8
movq %rbp, %r9
movl 0x140(%rsp), %eax
pushq %rax
pushq 0x140(%rsp)
callq 0xf2e4
addq $0x10, %rsp
movq 0x50(%rsp), %rcx
movq (%rcx), %rdx
andq $-0x2, %rdx
movzbl %al, %eax
addq %rax, %rdx
movq %rdx, (%rcx)
leaq 0x1(%rbx), %r15
addl %eax, %r14d
cmpq 0x18(%rsp), %rbx
jge 0x4b73
xorps %xmm0, %xmm0
cvtsi2sd %r14d, %xmm0
movsd (%rsp), %xmm1
ucomisd %xmm0, %xmm1
movq %r15, %rbx
ja 0x4b03
jmp 0x4b73
xorl %r15d, %r15d
xorl %r14d, %r14d
movq 0x78(%rsp), %rdi
testq %rdi, %rdi
je 0x4b82
callq 0x3340
movq 0x130(%rsp), %rbx
movq 0xb8(%rsp), %rdi
testq %rdi, %rdi
je 0x4b9c
callq 0x3340
addq %r15, (%rbx)
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x4bbf
callq 0x3340
movq $0x0, 0x50(%rsp)
movl $0x0, 0x58(%rsp)
movq 0xe0(%rsp), %rdi
testq %rdi, %rdi
je 0x4bd1
callq 0x3340
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0x4be3
callq 0x3340
movsd 0x90(%rsp), %xmm1
addsd 0x1247c(%rip), %xmm1    # 0x17070
xorps %xmm0, %xmm0
cvtsi2sd %r14d, %xmm0
movsd 0x38(%rsp), %xmm2
mulsd %xmm0, %xmm2
xorps %xmm0, %xmm0
cvtsi2sd %r15, %xmm0
divsd %xmm0, %xmm2
mulsd %xmm1, %xmm2
ucomisd 0x98(%rsp), %xmm2
setae %al
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x4c5c
movq %rax, %rbx
jmp 0x4c6e
movq %rax, %rbx
jmp 0x4c91
movq %rax, %rbx
jmp 0x4ca3
jmp 0x4c4a
movq %rax, %rbx
movq 0x78(%rsp), %rdi
testq %rdi, %rdi
je 0x4c5c
callq 0x3340
movq 0xb8(%rsp), %rdi
testq %rdi, %rdi
je 0x4c6e
callq 0x3340
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x4c91
callq 0x3340
xorl %eax, %eax
movq %rax, 0x50(%rsp)
movl %eax, 0x58(%rsp)
movq %rax, 0x60(%rsp)
movl %eax, 0x68(%rsp)
movq 0xe0(%rsp), %rdi
testq %rdi, %rdi
je 0x4ca3
callq 0x3340
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0x4cb5
callq 0x3340
movq %rbx, %rdi
callq 0x35c0