// File: yogesh1q2w[P]Dynamic-Graph-Algorithms/main.cpp
// Function: test(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void test(int func,string file) {
	if(func == 1) {
		ifstream ifs(file, ifstream::in);
		ofstream ofs("timefile.txt", ofstream::out | ios::app);
		int V,E;
		ifs >> V >> E;
		connectivity g = connectivity();
		long update = 0,query = 0;
		double querytime = 0, updatetime = 0;
		for(int i = 0; i < V; i++)
			g.add_vertex(i);

		//cout << V <<", " << E << endl;
		for(int i = 0; i < E; i++) {
			int u, v;
			ifs >> u >> v;
			//cout << u << "==="<<v << endl;
			g.add_edge(u, v);

		}
		
		for(int i = 0; i < ITER; i++) {
			int qtype = rand() % 3;
			//cout << qtype << endl;
			if(qtype == 0) {
				int u = rand() % V;
				int v = rand() % V;
				auto t1 = chrono::high_resolution_clock::now();
				g.add_edge(u, v);
				auto t2 = chrono::high_resolution_clock::now();
				updatetime +=chrono::duration_cast<chrono::nanoseconds>(t2-t1).count();
				update++;
			}
			else if(qtype == 1) {
				int u = rand() % V;
				int v = rand() % V;
				auto t1 = chrono::high_resolution_clock::now();
				g.delete_edge(u, v);
				auto t2 = chrono::high_resolution_clock::now();
				updatetime +=chrono::duration_cast<chrono::nanoseconds>(t2-t1).count();
				update++;
			}
			else if(qtype == 2) {
				int u = rand() % V;
				int v = rand() % V;
				auto t1 = chrono::high_resolution_clock::now();
				bool res = g.is_connected(u, v);
				auto t2 = chrono::high_resolution_clock::now();
				querytime +=chrono::duration_cast<chrono::nanoseconds>(t2-t1).count();
				query++;
			}
		}
		ofs << updatetime/(update * 1.0) << " " << querytime/(query * 1.0) << endl;
	}
	else if(func == 2) {
		ifstream ifs(file, ifstream::in);
		ofstream ofs("timefile.txt", ofstream::out | ios::app);
		int V,E;
		ifs >> V >> E;
		MST g = MST();
		long update = 0,query = 0;
		double querytime = 0, updatetime = 0;
		for(int i = 0; i < V; i++)
			g.add_vertex(i);

		//cout << V <<", " << E << endl;
		for(int i = 0; i < E; i++) {
			int u, v, wt;
			ifs >> u >> v >> wt;
			//cout << u << "==="<<v << endl;
			g.add_edge(u, v, wt);

		}
		g.build_static_MST();
		
		for(int i = 0; i < ITER; i++) {
			int qtype = rand() % 2;
			//cout << qtype << endl;
			if(qtype == 0) {
				int u = rand() % V;
				int v = rand() % V;
				auto t1 = chrono::high_resolution_clock::now();
				g.delete_edge(u, v);
				auto t2 = chrono::high_resolution_clock::now();
				updatetime +=chrono::duration_cast<chrono::nanoseconds>(t2-t1).count();
				update++;
			}
			else if(qtype == 1) {
				auto t1 = chrono::high_resolution_clock::now();
				set <pair<pair<int,int>,int>> res = g.find_MST();
				auto t2 = chrono::high_resolution_clock::now();
				querytime +=chrono::duration_cast<chrono::nanoseconds>(t2-t1).count();
				query++;
			}
		}
		ofs << updatetime/(update * 1.0) << " " << querytime/(query * 1.0) << endl;
	}
	else if(func == 3) {
		ifstream ifs(file, ifstream::in);
		ofstream ofs("timefile.txt", ofstream::out | ios::app);
		int V,E;
		ifs >> V >> E;
		SPT g = SPT();
		long update = 0,query = 0;
		double querytime = 0, updatetime = 0;
		for(int i = 0; i < V; i++)
			g.add_vertex(i);

		// cout << V <<", " << E << endl;
		for(int i = 0; i < E; i++) {
			int u, v, wt;	int c = 0;
			ifs >> u >> v >> wt;
			//cout << u << "===" << v << endl;
			g.add_edge(u, v, wt);

		}

		g.source = rand() % V;
		g.build_static_SPT();
		
		for(int i = 0; i < ITER; i++) {
			int qtype = rand() % 2;
			//cout << qtype << endl;
			if(qtype == 0) {
				int u = rand() % V;
				int v = rand() % V;
				int wt = rand() % CHNGWT;
				auto t1 = chrono::high_resolution_clock::now();
				g.change_weight(u, v, wt);
				auto t2 = chrono::high_resolution_clock::now();
				updatetime +=chrono::duration_cast<chrono::nanoseconds>(t2-t1).count();
				update++;
			}
			else if(qtype == 1) {
				auto t1 = chrono::high_resolution_clock::now();
				vector<pair<int,int>> res =  g.find_SPT();
				auto t2 = chrono::high_resolution_clock::now();
				querytime +=chrono::duration_cast<chrono::nanoseconds>(t2-t1).count();
				query++;
			}
		}
		// cout << querytime << " " << query << endl;
		ofs << updatetime/(update * 1.0) << " " << querytime/(query * 1.0) << endl;
	}
	else {
		cout << "Wrong choice.. Enter 1,2 or 3" << endl;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x12a0, %rsp           # imm = 0x12A0
movq %rsi, -0x1150(%rbp)
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
cmpl $0x1, -0x4(%rbp)
jne 0x25081
movq -0x1150(%rbp), %rsi
leaq -0x218(%rbp), %rdi
movl $0x8, %edx
callq 0x2220
movl $0x10, %edi
movl $0x1, %esi
callq 0x25c40
movl %eax, -0x1154(%rbp)
jmp 0x24ad2
movl -0x1154(%rbp), %edx
leaq 0x35a8(%rip), %rsi      # 0x28087
leaq -0x418(%rbp), %rdi
callq 0x21a0
jmp 0x24aed
leaq -0x218(%rbp), %rdi
leaq -0x428(%rbp), %rsi
callq 0x20f0
movq %rax, -0x1160(%rbp)
jmp 0x24b09
movq -0x1160(%rbp), %rdi
leaq -0x42c(%rbp), %rsi
callq 0x20f0
jmp 0x24b1e
leaq -0x4e0(%rbp), %rdi
xorl %esi, %esi
movl $0xb0, %edx
callq 0x20c0
leaq -0x4e0(%rbp), %rdi
callq 0x25c60
movq $0x0, -0x4e8(%rbp)
movq $0x0, -0x4f0(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x4f8(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x500(%rbp)
movl $0x0, -0x504(%rbp)
movl -0x504(%rbp), %eax
cmpl -0x428(%rbp), %eax
jge 0x24bf9
movl -0x504(%rbp), %esi
leaq -0x4e0(%rbp), %rdi
callq 0x9bf0
jmp 0x24b95
jmp 0x24b97
movl -0x504(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x504(%rbp)
jmp 0x24b73
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x420(%rbp)
movl %eax, -0x424(%rbp)
jmp 0x25070
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x420(%rbp)
movl %eax, -0x424(%rbp)
jmp 0x25064
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x420(%rbp)
movl %eax, -0x424(%rbp)
leaq -0x4e0(%rbp), %rdi
callq 0x25d60
jmp 0x25064
movl $0x0, -0x508(%rbp)
movl -0x508(%rbp), %eax
cmpl -0x42c(%rbp), %eax
jge 0x24c6f
leaq -0x218(%rbp), %rdi
leaq -0x50c(%rbp), %rsi
callq 0x20f0
movq %rax, -0x1168(%rbp)
jmp 0x24c2d
movq -0x1168(%rbp), %rdi
leaq -0x510(%rbp), %rsi
callq 0x20f0
jmp 0x24c42
movl -0x50c(%rbp), %esi
movl -0x510(%rbp), %edx
leaq -0x4e0(%rbp), %rdi
callq 0xa2b0
jmp 0x24c5c
jmp 0x24c5e
movl -0x508(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x508(%rbp)
jmp 0x24c03
movl $0x0, -0x514(%rbp)
cmpl $0x5, -0x514(%rbp)
jge 0x24fb6
callq 0x2060
movl $0x3, %ecx
cltd
idivl %ecx
movl %edx, -0x518(%rbp)
cmpl $0x0, -0x518(%rbp)
jne 0x24d95
callq 0x2060
movl -0x428(%rbp), %ecx
cltd
idivl %ecx
movl %edx, -0x51c(%rbp)
callq 0x2060
movl -0x428(%rbp), %ecx
cltd
idivl %ecx
movl %edx, -0x520(%rbp)
callq 0x2030
movq %rax, -0x528(%rbp)
movl -0x51c(%rbp), %esi
movl -0x520(%rbp), %edx
leaq -0x4e0(%rbp), %rdi
callq 0xa2b0
jmp 0x24cf4
callq 0x2030
movq %rax, -0x530(%rbp)
leaq -0x530(%rbp), %rdi
leaq -0x528(%rbp), %rsi
callq 0x25cf0
movq %rax, -0x1170(%rbp)
jmp 0x24d1c
movq -0x1170(%rbp), %rax
movq %rax, -0x540(%rbp)
leaq -0x540(%rbp), %rdi
callq 0x25cc0
movq %rax, -0x1178(%rbp)
jmp 0x24d3f
movq -0x1178(%rbp), %rax
movq %rax, -0x538(%rbp)
leaq -0x538(%rbp), %rdi
callq 0x25d40
movq %rax, -0x1180(%rbp)
jmp 0x24d62
movq -0x1180(%rbp), %rax
cvtsi2sd %rax, %xmm0
addsd -0x500(%rbp), %xmm0
movsd %xmm0, -0x500(%rbp)
movq -0x4e8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x4e8(%rbp)
jmp 0x24fa0
cmpl $0x1, -0x518(%rbp)
jne 0x24e91
callq 0x2060
movl -0x428(%rbp), %ecx
cltd
idivl %ecx
movl %edx, -0x544(%rbp)
callq 0x2060
movl -0x428(%rbp), %ecx
cltd
idivl %ecx
movl %edx, -0x548(%rbp)
callq 0x2030
movq %rax, -0x550(%rbp)
movl -0x544(%rbp), %esi
movl -0x548(%rbp), %edx
leaq -0x4e0(%rbp), %rdi
callq 0xa380
jmp 0x24df0
callq 0x2030
movq %rax, -0x558(%rbp)
leaq -0x558(%rbp), %rdi
leaq -0x550(%rbp), %rsi
callq 0x25cf0
movq %rax, -0x1188(%rbp)
jmp 0x24e18
movq -0x1188(%rbp), %rax
movq %rax, -0x568(%rbp)
leaq -0x568(%rbp), %rdi
callq 0x25cc0
movq %rax, -0x1190(%rbp)
jmp 0x24e3b
movq -0x1190(%rbp), %rax
movq %rax, -0x560(%rbp)
leaq -0x560(%rbp), %rdi
callq 0x25d40
movq %rax, -0x1198(%rbp)
jmp 0x24e5e
movq -0x1198(%rbp), %rax
cvtsi2sd %rax, %xmm0
addsd -0x500(%rbp), %xmm0
movsd %xmm0, -0x500(%rbp)
movq -0x4e8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x4e8(%rbp)
jmp 0x24f9e
cmpl $0x2, -0x518(%rbp)
jne 0x24f9c
callq 0x2060
movl -0x428(%rbp), %ecx
cltd
idivl %ecx
movl %edx, -0x56c(%rbp)
callq 0x2060
movl -0x428(%rbp), %ecx
cltd
idivl %ecx
movl %edx, -0x570(%rbp)
callq 0x2030
movq %rax, -0x578(%rbp)
movl -0x56c(%rbp), %esi
movl -0x570(%rbp), %edx
leaq -0x4e0(%rbp), %rdi
callq 0xa740
movb %al, -0x1199(%rbp)
jmp 0x24ef2
movb -0x1199(%rbp), %al
andb $0x1, %al
movb %al, -0x579(%rbp)
callq 0x2030
movq %rax, -0x588(%rbp)
leaq -0x588(%rbp), %rdi
leaq -0x578(%rbp), %rsi
callq 0x25cf0
movq %rax, -0x11a8(%rbp)
jmp 0x24f28
movq -0x11a8(%rbp), %rax
movq %rax, -0x598(%rbp)
leaq -0x598(%rbp), %rdi
callq 0x25cc0
movq %rax, -0x11b0(%rbp)
jmp 0x24f4b
movq -0x11b0(%rbp), %rax
movq %rax, -0x590(%rbp)
leaq -0x590(%rbp), %rdi
callq 0x25d40
movq %rax, -0x11b8(%rbp)
jmp 0x24f6e
movq -0x11b8(%rbp), %rax
cvtsi2sd %rax, %xmm0
addsd -0x4f8(%rbp), %xmm0
movsd %xmm0, -0x4f8(%rbp)
movq -0x4f0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x4f0(%rbp)
jmp 0x24f9e
jmp 0x24fa0
jmp 0x24fa2
movl -0x514(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x514(%rbp)
jmp 0x24c79
movsd -0x500(%rbp), %xmm0
cvtsi2sdq -0x4e8(%rbp), %xmm1
divsd %xmm1, %xmm0
leaq -0x418(%rbp), %rdi
callq 0x2260
movq %rax, -0x11c0(%rbp)
jmp 0x24fe0
movq -0x11c0(%rbp), %rdi
leaq 0x30a6(%rip), %rsi      # 0x28094
callq 0x2160
movq %rax, -0x11c8(%rbp)
jmp 0x24ffc
movq -0x11c8(%rbp), %rdi
movsd -0x4f8(%rbp), %xmm0
cvtsi2sdq -0x4f0(%rbp), %xmm1
divsd %xmm1, %xmm0
callq 0x2260
movq %rax, -0x11d0(%rbp)
jmp 0x25026
movq -0x11d0(%rbp), %rdi
movq 0x18f8c(%rip), %rsi     # 0x3dfc0
callq 0x2190
jmp 0x2503b
leaq -0x4e0(%rbp), %rdi
callq 0x25d60
leaq -0x418(%rbp), %rdi
callq 0x2200
leaq -0x218(%rbp), %rdi
callq 0x2050
jmp 0x25b0e
leaq -0x418(%rbp), %rdi
callq 0x2200
leaq -0x218(%rbp), %rdi
callq 0x2050
jmp 0x25b17
cmpl $0x2, -0x4(%rbp)
jne 0x25592
movq -0x1150(%rbp), %rsi
leaq -0x7a0(%rbp), %rdi
movl $0x8, %edx
callq 0x2220
movl $0x10, %edi
movl $0x1, %esi
callq 0x25c40
movl %eax, -0x11d4(%rbp)
jmp 0x250ba
movl -0x11d4(%rbp), %edx
leaq 0x2fc0(%rip), %rsi      # 0x28087
leaq -0x9a0(%rbp), %rdi
callq 0x21a0
jmp 0x250d5
leaq -0x7a0(%rbp), %rdi
leaq -0x9a4(%rbp), %rsi
callq 0x20f0
movq %rax, -0x11e0(%rbp)
jmp 0x250f1
movq -0x11e0(%rbp), %rdi
leaq -0x9a8(%rbp), %rsi
callq 0x20f0
jmp 0x25106
leaq -0xac8(%rbp), %rdi
xorl %esi, %esi
movl $0x120, %edx            # imm = 0x120
callq 0x20c0
leaq -0xac8(%rbp), %rdi
callq 0x25dc0
movq $0x0, -0xad0(%rbp)
movq $0x0, -0xad8(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0xae0(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0xae8(%rbp)
movl $0x0, -0xaec(%rbp)
movl -0xaec(%rbp), %eax
cmpl -0x9a4(%rbp), %eax
jge 0x251d5
movl -0xaec(%rbp), %esi
leaq -0xac8(%rbp), %rdi
callq 0x13240
jmp 0x2517d
jmp 0x2517f
movl -0xaec(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xaec(%rbp)
jmp 0x2515b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x420(%rbp)
movl %eax, -0x424(%rbp)
jmp 0x25581
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x420(%rbp)
movl %eax, -0x424(%rbp)
jmp 0x25575
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x420(%rbp)
movl %eax, -0x424(%rbp)
jmp 0x25569
movl $0x0, -0xaf0(%rbp)
movl -0xaf0(%rbp), %eax
cmpl -0x9a8(%rbp), %eax
jge 0x25274
leaq -0x7a0(%rbp), %rdi
leaq -0xaf4(%rbp), %rsi
callq 0x20f0
movq %rax, -0x11e8(%rbp)
jmp 0x2520d
movq -0x11e8(%rbp), %rdi
leaq -0xaf8(%rbp), %rsi
callq 0x20f0
movq %rax, -0x11f0(%rbp)
jmp 0x25229
movq -0x11f0(%rbp), %rdi
leaq -0xafc(%rbp), %rsi
callq 0x20f0
jmp 0x2523e
movl -0xaf4(%rbp), %esi
movl -0xaf8(%rbp), %edx
movl -0xafc(%rbp), %ecx
leaq -0xac8(%rbp), %rdi
callq 0x13b90
jmp 0x2525e
jmp 0x25260
movl -0xaf0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xaf0(%rbp)
jmp 0x251df
leaq -0xac8(%rbp), %rdi
callq 0x142a0
jmp 0x25282
movl $0x0, -0xb00(%rbp)
cmpl $0x5, -0xb00(%rbp)
jge 0x254bb
callq 0x2060
movl $0x2, %ecx
cltd
idivl %ecx
movl %edx, -0xb04(%rbp)
cmpl $0x0, -0xb04(%rbp)
jne 0x253a8
callq 0x2060
movl -0x9a4(%rbp), %ecx
cltd
idivl %ecx
movl %edx, -0xb08(%rbp)
callq 0x2060
movl -0x9a4(%rbp), %ecx
cltd
idivl %ecx
movl %edx, -0xb0c(%rbp)
callq 0x2030
movq %rax, -0xb18(%rbp)
movl -0xb08(%rbp), %esi
movl -0xb0c(%rbp), %edx
leaq -0xac8(%rbp), %rdi
callq 0x13cb0
jmp 0x25307
callq 0x2030
movq %rax, -0xb20(%rbp)
leaq -0xb20(%rbp), %rdi
leaq -0xb18(%rbp), %rsi
callq 0x25cf0
movq %rax, -0x11f8(%rbp)
jmp 0x2532f
movq -0x11f8(%rbp), %rax
movq %rax, -0xb30(%rbp)
leaq -0xb30(%rbp), %rdi
callq 0x25cc0
movq %rax, -0x1200(%rbp)
jmp 0x25352
movq -0x1200(%rbp), %rax
movq %rax, -0xb28(%rbp)
leaq -0xb28(%rbp), %rdi
callq 0x25d40
movq %rax, -0x1208(%rbp)
jmp 0x25375
movq -0x1208(%rbp), %rax
cvtsi2sd %rax, %xmm0
addsd -0xae8(%rbp), %xmm0
movsd %xmm0, -0xae8(%rbp)
movq -0xad0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xad0(%rbp)
jmp 0x254a5
cmpl $0x1, -0xb04(%rbp)
jne 0x254a3
callq 0x2030
movq %rax, -0xb38(%rbp)
leaq -0xb68(%rbp), %rdi
leaq -0xac8(%rbp), %rsi
callq 0x14080
jmp 0x253d6
callq 0x2030
movq %rax, -0xb70(%rbp)
leaq -0xb70(%rbp), %rdi
leaq -0xb38(%rbp), %rsi
callq 0x25cf0
movq %rax, -0x1210(%rbp)
jmp 0x253fe
movq -0x1210(%rbp), %rax
movq %rax, -0xb80(%rbp)
leaq -0xb80(%rbp), %rdi
callq 0x25cc0
movq %rax, -0x1218(%rbp)
jmp 0x25421
movq -0x1218(%rbp), %rax
movq %rax, -0xb78(%rbp)
leaq -0xb78(%rbp), %rdi
callq 0x25d40
movq %rax, -0x1220(%rbp)
jmp 0x25444
movq -0x1220(%rbp), %rax
cvtsi2sd %rax, %xmm0
addsd -0xae0(%rbp), %xmm0
movsd %xmm0, -0xae0(%rbp)
movq -0xad8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xad8(%rbp)
leaq -0xb68(%rbp), %rdi
callq 0x14eb0
jmp 0x254a3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x420(%rbp)
movl %eax, -0x424(%rbp)
leaq -0xb68(%rbp), %rdi
callq 0x14eb0
jmp 0x25569
jmp 0x254a5
jmp 0x254a7
movl -0xb00(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xb00(%rbp)
jmp 0x2528c
movsd -0xae8(%rbp), %xmm0
cvtsi2sdq -0xad0(%rbp), %xmm1
divsd %xmm1, %xmm0
leaq -0x9a0(%rbp), %rdi
callq 0x2260
movq %rax, -0x1228(%rbp)
jmp 0x254e5
movq -0x1228(%rbp), %rdi
leaq 0x2ba1(%rip), %rsi      # 0x28094
callq 0x2160
movq %rax, -0x1230(%rbp)
jmp 0x25501
movq -0x1230(%rbp), %rdi
movsd -0xae0(%rbp), %xmm0
cvtsi2sdq -0xad8(%rbp), %xmm1
divsd %xmm1, %xmm0
callq 0x2260
movq %rax, -0x1238(%rbp)
jmp 0x2552b
movq -0x1238(%rbp), %rdi
movq 0x18a87(%rip), %rsi     # 0x3dfc0
callq 0x2190
jmp 0x25540
leaq -0xac8(%rbp), %rdi
callq 0x25e40
leaq -0x9a0(%rbp), %rdi
callq 0x2200
leaq -0x7a0(%rbp), %rdi
callq 0x2050
jmp 0x25b0c
leaq -0xac8(%rbp), %rdi
callq 0x25e40
leaq -0x9a0(%rbp), %rdi
callq 0x2200
leaq -0x7a0(%rbp), %rdi
callq 0x2050
jmp 0x25b17
cmpl $0x3, -0x4(%rbp)
jne 0x25ae8
movq -0x1150(%rbp), %rsi
leaq -0xd88(%rbp), %rdi
movl $0x8, %edx
callq 0x2220
movl $0x10, %edi
movl $0x1, %esi
callq 0x25c40
movl %eax, -0x123c(%rbp)
jmp 0x255cb
movl -0x123c(%rbp), %edx
leaq 0x2aaf(%rip), %rsi      # 0x28087
leaq -0xf88(%rbp), %rdi
callq 0x21a0
jmp 0x255e6
leaq -0xd88(%rbp), %rdi
leaq -0xf8c(%rbp), %rsi
callq 0x20f0
movq %rax, -0x1248(%rbp)
jmp 0x25602
movq -0x1248(%rbp), %rdi
leaq -0xf90(%rbp), %rsi
callq 0x20f0
jmp 0x25617
leaq -0x10a0(%rbp), %rdi
xorl %esi, %esi
movl $0x110, %edx            # imm = 0x110
callq 0x20c0
leaq -0x10a0(%rbp), %rdi
callq 0x25ec0
movq $0x0, -0x10a8(%rbp)
movq $0x0, -0x10b0(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x10b8(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x10c0(%rbp)
movl $0x0, -0x10c4(%rbp)
movl -0x10c4(%rbp), %eax
cmpl -0xf8c(%rbp), %eax
jge 0x256e6
movl -0x10c4(%rbp), %esi
leaq -0x10a0(%rbp), %rdi
callq 0x1d600
jmp 0x2568e
jmp 0x25690
movl -0x10c4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10c4(%rbp)
jmp 0x2566c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x420(%rbp)
movl %eax, -0x424(%rbp)
jmp 0x25ada
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x420(%rbp)
movl %eax, -0x424(%rbp)
jmp 0x25ace
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x420(%rbp)
movl %eax, -0x424(%rbp)
jmp 0x25ac2
movl $0x0, -0x10c8(%rbp)
movl -0x10c8(%rbp), %eax
cmpl -0xf90(%rbp), %eax
jge 0x2578f
movl $0x0, -0x10d8(%rbp)
leaq -0xd88(%rbp), %rdi
leaq -0x10cc(%rbp), %rsi
callq 0x20f0
movq %rax, -0x1250(%rbp)
jmp 0x25728
movq -0x1250(%rbp), %rdi
leaq -0x10d0(%rbp), %rsi
callq 0x20f0
movq %rax, -0x1258(%rbp)
jmp 0x25744
movq -0x1258(%rbp), %rdi
leaq -0x10d4(%rbp), %rsi
callq 0x20f0
jmp 0x25759
movl -0x10cc(%rbp), %esi
movl -0x10d0(%rbp), %edx
movl -0x10d4(%rbp), %ecx
leaq -0x10a0(%rbp), %rdi
callq 0x1d720
jmp 0x25779
jmp 0x2577b
movl -0x10c8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10c8(%rbp)
jmp 0x256f0
callq 0x2060
movl -0xf8c(%rbp), %ecx
cltd
idivl %ecx
movl %edx, -0x10a0(%rbp)
leaq -0x10a0(%rbp), %rdi
callq 0x1d7f0
jmp 0x257b1
movl $0x0, -0x10dc(%rbp)
cmpl $0x5, -0x10dc(%rbp)
jge 0x25a17
callq 0x2060
movl $0x2, %ecx
cltd
idivl %ecx
movl %edx, -0x10e0(%rbp)
cmpl $0x0, -0x10e0(%rbp)
jne 0x25904
callq 0x2060
movl -0xf8c(%rbp), %ecx
cltd
idivl %ecx
movl %edx, -0x10e4(%rbp)
callq 0x2060
movl -0xf8c(%rbp), %ecx
cltd
idivl %ecx
movl %edx, -0x10e8(%rbp)
callq 0x2060
movslq %eax, %rcx
imulq $0x51eb851f, %rcx, %rcx # imm = 0x51EB851F
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x25, %rcx
addl %edx, %ecx
imull $0x64, %ecx, %ecx
subl %ecx, %eax
movl %eax, -0x10ec(%rbp)
callq 0x2030
movq %rax, -0x10f8(%rbp)
movl -0x10e4(%rbp), %esi
movl -0x10e8(%rbp), %edx
movl -0x10ec(%rbp), %ecx
leaq -0x10a0(%rbp), %rdi
callq 0x1dca0
jmp 0x25863
callq 0x2030
movq %rax, -0x1100(%rbp)
leaq -0x1100(%rbp), %rdi
leaq -0x10f8(%rbp), %rsi
callq 0x25cf0
movq %rax, -0x1260(%rbp)
jmp 0x2588b
movq -0x1260(%rbp), %rax
movq %rax, -0x1110(%rbp)
leaq -0x1110(%rbp), %rdi
callq 0x25cc0
movq %rax, -0x1268(%rbp)
jmp 0x258ae
movq -0x1268(%rbp), %rax
movq %rax, -0x1108(%rbp)
leaq -0x1108(%rbp), %rdi
callq 0x25d40
movq %rax, -0x1270(%rbp)
jmp 0x258d1
movq -0x1270(%rbp), %rax
cvtsi2sd %rax, %xmm0
addsd -0x10c0(%rbp), %xmm0
movsd %xmm0, -0x10c0(%rbp)
movq -0x10a8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10a8(%rbp)
jmp 0x25a01
cmpl $0x1, -0x10e0(%rbp)
jne 0x259ff
callq 0x2030
movq %rax, -0x1118(%rbp)
leaq -0x1130(%rbp), %rdi
leaq -0x10a0(%rbp), %rsi
callq 0x1fdf0
jmp 0x25932
callq 0x2030
movq %rax, -0x1138(%rbp)
leaq -0x1138(%rbp), %rdi
leaq -0x1118(%rbp), %rsi
callq 0x25cf0
movq %rax, -0x1278(%rbp)
jmp 0x2595a
movq -0x1278(%rbp), %rax
movq %rax, -0x1148(%rbp)
leaq -0x1148(%rbp), %rdi
callq 0x25cc0
movq %rax, -0x1280(%rbp)
jmp 0x2597d
movq -0x1280(%rbp), %rax
movq %rax, -0x1140(%rbp)
leaq -0x1140(%rbp), %rdi
callq 0x25d40
movq %rax, -0x1288(%rbp)
jmp 0x259a0
movq -0x1288(%rbp), %rax
cvtsi2sd %rax, %xmm0
addsd -0x10b8(%rbp), %xmm0
movsd %xmm0, -0x10b8(%rbp)
movq -0x10b0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10b0(%rbp)
leaq -0x1130(%rbp), %rdi
callq 0x16330
jmp 0x259ff
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x420(%rbp)
movl %eax, -0x424(%rbp)
leaq -0x1130(%rbp), %rdi
callq 0x16330
jmp 0x25ac2
jmp 0x25a01
jmp 0x25a03
movl -0x10dc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10dc(%rbp)
jmp 0x257bb
movsd -0x10c0(%rbp), %xmm0
cvtsi2sdq -0x10a8(%rbp), %xmm1
divsd %xmm1, %xmm0
leaq -0xf88(%rbp), %rdi
callq 0x2260
movq %rax, -0x1290(%rbp)
jmp 0x25a41
movq -0x1290(%rbp), %rdi
leaq 0x2645(%rip), %rsi      # 0x28094
callq 0x2160
movq %rax, -0x1298(%rbp)
jmp 0x25a5d
movq -0x1298(%rbp), %rdi
movsd -0x10b8(%rbp), %xmm0
cvtsi2sdq -0x10b0(%rbp), %xmm1
divsd %xmm1, %xmm0
callq 0x2260
movq %rax, -0x12a0(%rbp)
jmp 0x25a87
movq -0x12a0(%rbp), %rdi
movq 0x1852b(%rip), %rsi     # 0x3dfc0
callq 0x2190
jmp 0x25a9c
leaq -0x10a0(%rbp), %rdi
callq 0x25f30
leaq -0xf88(%rbp), %rdi
callq 0x2200
leaq -0xd88(%rbp), %rdi
callq 0x2050
jmp 0x25b0a
leaq -0x10a0(%rbp), %rdi
callq 0x25f30
leaq -0xf88(%rbp), %rdi
callq 0x2200
leaq -0xd88(%rbp), %rdi
callq 0x2050
jmp 0x25b17
movq 0x184e1(%rip), %rdi     # 0x3dfd0
leaq 0x25a0(%rip), %rsi      # 0x28096
callq 0x2160
movq %rax, %rdi
movq 0x184bb(%rip), %rsi     # 0x3dfc0
callq 0x2190
jmp 0x25b0c
jmp 0x25b0e
addq $0x12a0, %rsp           # imm = 0x12A0
popq %rbp
retq
movq -0x420(%rbp), %rdi
callq 0x2250
nopw %cs:(%rax,%rax)