// File: 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 %rbx
subq $0xb80, %rsp            # imm = 0xB80
movl 0xb98(%rsp), %eax
movl 0xb90(%rsp), %eax
movq %rdi, 0xb78(%rsp)
movl %esi, 0xb74(%rsp)
movl %edx, 0xb70(%rsp)
movl %ecx, 0xb6c(%rsp)
movq %r8, 0xb60(%rsp)
movss %xmm0, 0xb5c(%rsp)
movss %xmm1, 0xb58(%rsp)
movq %r9, 0xb50(%rsp)
movl 0xb74(%rsp), %esi
leaq 0x148(%rsp), %rdi
callq 0x1f550
movl 0xb70(%rsp), %eax
incl %eax
cltq
movq %rax, 0xd8(%rsp)
movq $0x0, 0x128(%rsp)
leaq 0x127(%rsp), %rdi
movq %rdi, 0xe0(%rsp)
callq 0xef70
movq 0xd8(%rsp), %rsi
movq 0xe0(%rsp), %rcx
leaq 0x130(%rsp), %rdi
leaq 0x128(%rsp), %rdx
callq 0xef80
jmp 0x6fc4
leaq 0x127(%rsp), %rdi
callq 0xf000
movss 0xb58(%rsp), %xmm1
movss 0x2b05e(%rip), %xmm0    # 0x32040
divss %xmm1, %xmm0
callq 0xed80
movss %xmm0, 0xd4(%rsp)
jmp 0x6ff6
movss 0xd4(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0xc0(%rsp)
movl 0xb74(%rsp), %edi
incl %edi
callq 0xeda0
movsd %xmm0, 0xc8(%rsp)
jmp 0x7025
movsd 0xc8(%rsp), %xmm1
movsd 0xc0(%rsp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0xb0(%rsp)
movl 0xb70(%rsp), %edi
incl %edi
callq 0xeda0
movsd %xmm0, 0xb8(%rsp)
jmp 0x705d
movsd 0xb8(%rsp), %xmm1
movsd 0xb0(%rsp), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, 0xa0(%rsp)
movl 0xb74(%rsp), %edi
movl 0xb70(%rsp), %eax
subl %eax, %edi
incl %edi
callq 0xeda0
movsd %xmm0, 0xa8(%rsp)
jmp 0x709e
movsd 0xa8(%rsp), %xmm1
movsd 0xa0(%rsp), %xmm0
subsd %xmm1, %xmm0
movl 0xb74(%rsp), %edi
cvtsi2sd %edi, %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, 0x88(%rsp)
cvtsi2sdl 0xb70(%rsp), %xmm0
movsd %xmm0, 0x90(%rsp)
callq 0xede0
movsd %xmm0, 0x98(%rsp)
jmp 0x70ee
movsd 0x98(%rsp), %xmm0
movsd 0x2af19(%rip), %xmm1    # 0x32018
mulsd %xmm1, %xmm0
movss 0xb58(%rsp), %xmm1
cvtss2sd %xmm1, %xmm1
divsd %xmm1, %xmm0
callq 0x4340
movsd 0x90(%rsp), %xmm1
movaps %xmm0, %xmm2
movsd 0x88(%rsp), %xmm0
mulsd %xmm2, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x108(%rsp)
movss 0xb5c(%rsp), %xmm0
addss %xmm0, %xmm0
movss 0x2aef4(%rip), %xmm1    # 0x32048
divss %xmm1, %xmm0
movss 0x2aee4(%rip), %xmm1    # 0x32044
addss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0x80(%rsp)
movsd 0x108(%rsp), %xmm0
callq 0x46c0
movsd 0x2ae89(%rip), %xmm1    # 0x32010
mulsd %xmm1, %xmm0
movss 0xb58(%rsp), %xmm1
cvtss2sd %xmm1, %xmm1
divsd %xmm1, %xmm0
callq 0x4340
movaps %xmm0, %xmm1
movsd 0x80(%rsp), %xmm0
mulsd %xmm1, %xmm0
movss 0xb5c(%rsp), %xmm1
mulss %xmm1, %xmm1
cvtss2sd %xmm1, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x100(%rsp)
cvttsd2si 0x100(%rsp), %rax
movq %rax, 0xf8(%rsp)
movl $0x1, 0xf4(%rsp)
movq 0xb78(%rsp), %rdi
movl 0xb6c(%rsp), %edx
movq 0xf8(%rsp), %rcx
movl 0xb98(%rsp), %eax
testl %eax, %eax
setne %al
movq 0xb50(%rsp), %r9
movl 0xb90(%rsp), %r8d
movq %rsp, %rsi
movl %r8d, (%rsi)
movzbl %al, %r8d
leaq 0x148(%rsp), %rsi
callq 0x4a00
jmp 0x7238
movss 0xb5c(%rsp), %xmm0
addss %xmm0, %xmm0
movss 0x2adfb(%rip), %xmm1    # 0x32048
divss %xmm1, %xmm0
movss 0x2adeb(%rip), %xmm1    # 0x32044
addss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0x70(%rsp)
movl 0xb74(%rsp), %edi
incl %edi
callq 0xeda0
movsd %xmm0, 0x78(%rsp)
jmp 0x727d
movl 0xb70(%rsp), %edi
incl %edi
callq 0xeda0
movsd %xmm0, 0x68(%rsp)
jmp 0x7293
movsd 0x68(%rsp), %xmm1
movsd 0x78(%rsp), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, 0x58(%rsp)
movl 0xb74(%rsp), %edi
movl 0xb70(%rsp), %eax
subl %eax, %edi
incl %edi
callq 0xeda0
movsd %xmm0, 0x60(%rsp)
jmp 0x72c8
movsd 0x60(%rsp), %xmm1
movsd 0x58(%rsp), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, 0x48(%rsp)
movss 0xb58(%rsp), %xmm1
movss 0x2ad51(%rip), %xmm0    # 0x32040
divss %xmm1, %xmm0
callq 0xed80
movss %xmm0, 0x54(%rsp)
jmp 0x7300
movsd 0x70(%rsp), %xmm0
movsd 0x48(%rsp), %xmm1
movss 0x54(%rsp), %xmm2
cvtss2sd %xmm2, %xmm2
addsd %xmm2, %xmm1
mulsd %xmm1, %xmm0
cvtsi2sdl 0xb74(%rsp), %xmm1
mulsd %xmm1, %xmm0
movss 0xb5c(%rsp), %xmm1
mulss 0xb5c(%rsp), %xmm1
cvtsi2ssl 0xb70(%rsp), %xmm2
mulss %xmm2, %xmm1
cvtss2sd %xmm1, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0xe8(%rsp)
cvtsi2sdq 0xf8(%rsp), %xmm1
movsd 0xe8(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x74e3
movq 0xb60(%rsp), %rdi
callq 0xf010
leaq 0x148(%rsp), %rdi
callq 0x1fa00
movl %eax, 0x44(%rsp)
jmp 0x7398
movl 0x44(%rsp), %eax
cltq
movq %rax, 0xf8(%rsp)
movq 0xb60(%rsp), %rsi
movl 0xb74(%rsp), %edx
movl 0xb70(%rsp), %ecx
leaq 0x148(%rsp), %rdi
leaq 0x130(%rsp), %r8
callq 0x4db0
jmp 0x73d3
movq 0xb78(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0xb60(%rsp), %rax
movq %rax, 0x30(%rsp)
movl 0xb6c(%rsp), %eax
movl %eax, 0x3c(%rsp)
movslq 0xb70(%rsp), %rsi
leaq 0x130(%rsp), %rdi
callq 0xeb00
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
movl 0x3c(%rsp), %ecx
movq %rax, %r8
movss 0xb5c(%rsp), %xmm0
movss 0xb58(%rsp), %xmm1
movl 0xb98(%rsp), %r9d
movq 0xf8(%rsp), %rdi
movl 0xf4(%rsp), %r10d
movq 0xb50(%rsp), %r11
movl 0xb90(%rsp), %ebx
movq %rsp, %rax
movl %ebx, 0x18(%rax)
movq %r11, 0x10(%rax)
movl %r10d, 0x8(%rax)
movq %rdi, (%rax)
leaq 0x148(%rsp), %rdi
callq 0x5860
movb %al, 0x43(%rsp)
jmp 0x747b
movb 0x43(%rsp), %al
testb $0x1, %al
jne 0x7485
jmp 0x74cd
jmp 0x74e3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x118(%rsp)
movl %eax, 0x114(%rsp)
leaq 0x127(%rsp), %rdi
callq 0xf000
jmp 0x7506
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x118(%rsp)
movl %eax, 0x114(%rsp)
leaq 0x130(%rsp), %rdi
callq 0xf030
jmp 0x7506
movl 0xf4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xf4(%rsp)
jmp 0x735b
leaq 0x130(%rsp), %rdi
callq 0xf030
leaq 0x148(%rsp), %rdi
callq 0xf090
addq $0xb80, %rsp            # imm = 0xB80
popq %rbx
retq
leaq 0x148(%rsp), %rdi
callq 0xf090
movq 0x118(%rsp), %rdi
callq 0x4690