// File: /workspace/github_cpp_makefile_star2_O2/dtsaras[P]GCW/GCW.cpp
// Function: DSSA(Graph&, int, int, int, std::vector<int, std::allocator<int>>&, float, float, sampler<int>&, int, int)
void DSSA(Graph & g, int n, int k, int t, vector<int> &seeds, float epsilon, float delta, sampler<int> &samp, int p, int m){
	// cout << "################## 1" << endl;
	HyperGraph hg(n);
	vector<double> degree(k+1,0);

	double f = (log(6/delta)+lgamma(n+1)-lgamma(k+1)-lgamma(n-k+1))*n/(k*log(6*log2(n)/delta));
	// cout << "################## 2" << endl;
	double lambda = (2+2*epsilon/3)*log(3*log2(f)/delta)/(epsilon*epsilon);

	long long int totalSamples = (long long int)lambda;

	int iter = 1;

	// cout << "################## 2" << endl;
	addHyperedge(g,hg,t,totalSamples,m, samp, p);
	double nmax = (2+2*epsilon/3)*(lgamma(n+1)-lgamma(k+1)-lgamma(n-k+1) + log(6/delta))*n/(epsilon*epsilon*k);

	// cout << "################## 3" << endl;
	while (totalSamples < nmax){
		seeds.clear();
		totalSamples = hg.getNumEdge();
		buildSeedSet(hg,seeds,n,k,degree);
		// cout << "$$$$$$$$$$$$$$ 1" << endl;
		if (calculateInfluence_DSSA(hg,g,seeds,t,degree[k],epsilon,delta,m,totalSamples,iter, samp, p)){
           	break;
        }
        // cout << "$$$$$$$$$$$$$$ 2" << endl;
		iter++;
	}
	// cout << "################## 3" << endl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa88, %rsp            # imm = 0xA88
movq %r9, %rbx
movss %xmm1, 0x18(%rsp)
movss %xmm0, 0x14(%rsp)
movq %r8, %r14
movl %ecx, 0x44(%rsp)
movl %edx, %r15d
movl %esi, %r12d
movq %rdi, %r13
leaq 0x80(%rsp), %rdi
callq 0xc7c8
leal 0x1(%r15), %ebp
movslq %ebp, %rsi
leaq 0x78(%rsp), %rdx
andq $0x0, (%rdx)
leaq 0x60(%rsp), %rdi
leaq 0x1f(%rsp), %rcx
callq 0x87c4
movss 0xe6c1(%rip), %xmm0     # 0x13088
divss 0x18(%rsp), %xmm0
movss %xmm0, 0x3c(%rsp)
callq 0x35f0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0x8(%rsp)
leal 0x1(%r12), %edi
movl %edi, 0x38(%rsp)
callq 0x8750
addsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
movl %ebp, 0x40(%rsp)
movl %ebp, %edi
callq 0x8750
movsd 0x8(%rsp), %xmm1
subsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
movl %r12d, %edi
subl %r15d, %edi
incl %edi
movl %edi, 0x34(%rsp)
callq 0x8750
cvtsi2sd %r12d, %xmm1
movsd 0x8(%rsp), %xmm2
subsd %xmm0, %xmm2
movsd %xmm1, 0x50(%rsp)
mulsd %xmm1, %xmm2
movsd %xmm2, 0x8(%rsp)
cvtsi2sd %r15d, %xmm0
movsd %xmm0, 0x20(%rsp)
movq %r12, 0x58(%rsp)
movl %r12d, %edi
callq 0x8765
mulsd 0xe5e1(%rip), %xmm0     # 0x13048
cvtss2sd 0x18(%rsp), %xmm1
movsd %xmm1, 0x28(%rsp)
divsd %xmm1, %xmm0
callq 0x32e0
mulsd 0x20(%rsp), %xmm0
movss 0x14(%rsp), %xmm1
addss %xmm1, %xmm1
divss 0xe5fc(%rip), %xmm1     # 0x13090
movsd 0x8(%rsp), %xmm2
divsd %xmm0, %xmm2
addss 0xe5ee(%rip), %xmm1     # 0x13094
cvtss2sd %xmm1, %xmm0
movsd %xmm0, 0x48(%rsp)
movapd %xmm2, %xmm0
callq 0x35a0
mulsd 0xe58f(%rip), %xmm0     # 0x13050
divsd 0x28(%rsp), %xmm0
callq 0x32e0
mulsd 0x48(%rsp), %xmm0
movss 0x14(%rsp), %xmm1
mulss %xmm1, %xmm1
movss %xmm1, 0x30(%rsp)
cvtss2sd %xmm1, %xmm1
divsd %xmm1, %xmm0
cvttsd2si %xmm0, %rbp
xorl %r8d, %r8d
cmpl $0x0, 0xac8(%rsp)
setne %r8b
subq $0x8, %rsp
leaq 0x88(%rsp), %rsi
movq %r13, 0x28(%rsp)
movq %r13, %rdi
movq %rbp, %rcx
movq %rbx, 0x30(%rsp)
movq %rbx, %r9
movl 0xac8(%rsp), %eax
pushq %rax
callq 0x382c
popq %rcx
popq %rdx
movl 0x38(%rsp), %edi
callq 0x8750
movsd %xmm0, 0x8(%rsp)
movl 0x40(%rsp), %edi
callq 0x8750
movsd 0x8(%rsp), %xmm1
subsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
movl 0x34(%rsp), %edi
callq 0x8750
movsd 0x8(%rsp), %xmm1
subsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
movss 0x3c(%rsp), %xmm0
callq 0x35f0
cvtss2sd %xmm0, %xmm1
addsd 0x8(%rsp), %xmm1
mulsd 0x48(%rsp), %xmm1
mulsd 0x50(%rsp), %xmm1
cvtsi2ss %r15d, %xmm0
movss 0x30(%rsp), %xmm2
mulss %xmm0, %xmm2
cvtss2sd %xmm2, %xmm0
divsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
movq %r15, %r13
movslq %r15d, %r15
pushq $0x1
popq %r12
leaq 0x80(%rsp), %rbx
shlq $0x3, %r15
cvtsi2sd %rbp, %xmm0
movsd 0x8(%rsp), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x4c56
movq (%r14), %rax
cmpq %rax, 0x8(%r14)
je 0x4be3
movq %rax, 0x8(%r14)
movq %rbx, %rdi
callq 0xca4e
movl %eax, %ebp
movq %rbx, %rdi
movq %r14, %rsi
movq 0x58(%rsp), %rdx
movl %r13d, %ecx
leaq 0x60(%rsp), %r8
callq 0x39d9
movslq %ebp, %rbp
movq 0x60(%rsp), %r8
addq %r15, %r8
movq %rbx, %rdi
movq 0x20(%rsp), %rsi
movq %r14, %rdx
movl 0x44(%rsp), %ecx
movss 0x14(%rsp), %xmm0
movss 0x18(%rsp), %xmm1
movl 0xac8(%rsp), %r9d
movl 0xac0(%rsp), %eax
pushq %rax
pushq 0x30(%rsp)
pushq %r12
pushq %rbp
callq 0x3ec4
addq $0x20, %rsp
incl %r12d
testb %al, %al
je 0x4bc1
leaq 0x60(%rsp), %rdi
callq 0x9976
leaq 0x80(%rsp), %rdi
callq 0x881a
addq $0xa88, %rsp            # imm = 0xA88
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4c86
movq %rax, %rbx
jmp 0x4c93
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x9976
leaq 0x80(%rsp), %rdi
callq 0x881a
movq %rbx, %rdi
callq 0x3590