// File: yukimasano[P]cpp_matrix/SRDD.cpp
// Function: main
int main()
{
	ofstream outfile;
	int i = 1;

	for (int j=16; j<=110; j+=1){
		/* format of output is
		# format    0 kappa=size , 1 SD Count, 2 SD Time, 3 CG Count, 4 CG time,
		#           5 CG_pre count 6 CG_pre time
		#           7 LU time, 8 LU delx, 9 QR time, 10 QR delx
		#						11 full QR time 12 full QR delx
		#						13 Jacobi count 14 Jacobi Time
		#						15 SOR1 "-" 16
		#						17 SOR1.5 "-" 18
		#						19 SOR0.5 "-" 20
		*/
		double sd_co =0.0;
		double sd_ti =0.0;
		double cg_co =0.0;
		double cg_ti =0.0;
		double cgp_co =0.0;
		double cgp_ti =0.0;
		double lu_ti =0.0;
		double lu_dx =0.0;
		double qr_ti =0.0;
		double qr_dx =0.0;
		double qre_ti =0.0;
		double qre_dx =0.0;
		double jac_co =0.0;
		double jac_ti =0.0;
		double sor1_co =0.0;
		double sor1_ti =0.0;
		double sor15_co =0.0;
		double sor15_ti =0.0;
		double sor05_co =0.0;
		double sor05_ti =0.0;
    i = pow(1.09,j)+8;




		// for loop to average measurements
	  for (int k=0;k<=10 ;k++){
			//VERSION ITERATIVE
			clock_t begin = clock();
			Vector x(i);
			x= randv(x);
			Matrix A(i,i);
			A = randm(A);
			for (int o=1; o<=i;  o++){
				A.set_val(o,o,o+i);
			}
			Vector b = A*x;
			Matrix AA = A;

			clock_t end = clock();
			double elapsed_secs = double(end - begin) / CLOCKS_PER_SEC;
			cout<<"dim = "<<i<<" time for prep: "<<elapsed_secs<<endl;
			// /////////////////////////////
			int count = 0;
	    //// code starts here /////////////////////////////////////
			Vector x1(i);
			begin = clock();
			count = 0;
			x1 = SD(A,b, count);
			end = clock();
			elapsed_secs = double(end - begin) / CLOCKS_PER_SEC;
      sd_ti += elapsed_secs;
			sd_co += count;
			cout<<"SD"<<flush<<endl;

			// else{
			// 	sd_ti = 0;
			// 	sd_co = 0;
			// }

			// begin = clock();
			// count = 0;
			// x1 = CG(AA,b2, count);
			// end = clock();
			// elapsed_secs = double(end - begin) / CLOCKS_PER_SEC;
			// cg_ti += elapsed_secs;
			// cg_co += count;

			// cout<<"CG"<<flush<<endl;
      //
			// begin = clock();
			// count = 0;
			// x1 = CG_pre(AA,b2, count);
			// end = clock();
			// elapsed_secs = double(end - begin) / CLOCKS_PER_SEC;
			// cgp_ti += elapsed_secs;
			// cgp_co += count;


			////////////////// non-iterative solvers

			begin = clock();
			x1 = LUsolve(A,b);
			end = clock();
			elapsed_secs = double(end - begin) / CLOCKS_PER_SEC;
			double delx = (x1 - x).norm();
			lu_ti += elapsed_secs;
			lu_dx += delx;
      //
			// if (i<150){
			// 	//cout<<"QR2"<<flush<<endl;
			// 	cout<<"QR2"<<flush<<endl;
      //
			//   begin = clock();
			// 	x1 = QRsolve2(A,b);
			// 	end = clock();
			// 	elapsed_secs = double(end - begin) / CLOCKS_PER_SEC;
			// 	delx = (x1 - x).norm();
			// 	qr_ti += elapsed_secs;
			// 	qr_dx += delx;
			// }
			// else{
			// 	qr_ti = 0;
			// 	qr_dx = 0;
			// }
      //
			// cout<<"QR"<<flush<<endl;
      // if (i<200){
			// 	begin = clock();
			// 	x1 = QRsolve(A,b);
			// 	end = clock();
			// 	elapsed_secs = double(end - begin) / CLOCKS_PER_SEC;
			// 	delx = (x1 - x).norm();
			// 	qre_ti += elapsed_secs;
			// 	qre_dx += delx;
			// }
			// else{
			// 	qre_ti = 0;
			// 	qre_dx = 0;
			// }
			cout<<"Jac"<<flush<<endl;

			count = 0;
			begin = clock();
			x1 = Jacobi(A,b,count);
			end = clock();
			elapsed_secs = double(end - begin) / CLOCKS_PER_SEC;
			jac_ti += elapsed_secs;
			jac_co += count;

			cout<<"SOR1"<<flush<<endl;

			begin = clock();
			if (i<140){
				x1 = SOR(A,b,1.0 , count);
				end = clock();
				elapsed_secs = double(end - begin) / CLOCKS_PER_SEC;
				sor1_ti += elapsed_secs;
				sor1_co += count;
				cout<<"SOR15"<<flush<<endl;

				begin = clock();
				count = 0;
				x1 = SOR(A,b,1.5 , count);
		    end = clock();
		    elapsed_secs = double(end - begin) / CLOCKS_PER_SEC;
				sor15_ti += elapsed_secs;
				sor15_co += count;
			}
			if (i<100){
				cout<<"SOR5"<<flush<<endl;
				begin = clock();
				count = 0;
				x1 = SOR(A,b,0.5 , count);
				end = clock();
				elapsed_secs = double(end - begin) / CLOCKS_PER_SEC;
				sor05_ti += elapsed_secs;
				sor05_co += count;
		  }

		}
		//cout<<"done"<<flush<<endl;
		outfile.open("SRDD.txt", fstream::app);
		outfile<<i<<",";
		outfile<< sd_co/10<<","<< sd_ti/10 << ",";
		outfile<< cg_co/10<<","<< cg_ti/10 << ",";
		outfile<< cgp_co/10<<","<< cgp_ti/10 << ",";
		outfile<< lu_ti/10<<","<< lu_dx/10 << ",";
		outfile<< qr_ti/10<<","<< qr_dx/10 << ",";
		outfile<< qre_ti/10<<","<< qre_dx/10<<",";
		outfile<< jac_co/10<<","<< jac_ti/10 << ",";
		outfile<< sor1_co/10<<","<< sor1_ti/10 << ",";
		outfile<< sor15_co/10<<","<< sor15_ti/10 << ",";
		outfile<< sor05_co/10<<","<< sor05_ti/10;
		outfile<<endl;
		outfile.flush();
		outfile.close();
	}

  return 1;
}

// Assembly:
subq $0x548, %rsp            # imm = 0x548
movl $0x0, 0x544(%rsp)
leaq 0x340(%rsp), %rdi
callq 0x21a0
movl $0x1, 0x33c(%rsp)
movl $0x10, 0x338(%rsp)
cmpl $0x6e, 0x338(%rsp)
jg 0x3714
movq $0x0, 0x330(%rsp)
movq $0x0, 0x328(%rsp)
movq $0x0, 0x320(%rsp)
movq $0x0, 0x318(%rsp)
movq $0x0, 0x310(%rsp)
movq $0x0, 0x308(%rsp)
movq $0x0, 0x300(%rsp)
movq $0x0, 0x2f8(%rsp)
movq $0x0, 0x2f0(%rsp)
movq $0x0, 0x2e8(%rsp)
movq $0x0, 0x2e0(%rsp)
movq $0x0, 0x2d8(%rsp)
movq $0x0, 0x2d0(%rsp)
movq $0x0, 0x2c8(%rsp)
movq $0x0, 0x2c0(%rsp)
movq $0x0, 0x2b8(%rsp)
movq $0x0, 0x2b0(%rsp)
movq $0x0, 0x2a8(%rsp)
movq $0x0, 0x2a0(%rsp)
movq $0x0, 0x298(%rsp)
movl 0x338(%rsp), %edi
movsd 0xcaa6(%rip), %xmm0     # 0xf008
callq 0x3760
movsd %xmm0, 0x170(%rsp)
jmp 0x2572
movsd 0x170(%rsp), %xmm0
movsd 0xca8d(%rip), %xmm1     # 0xf010
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, 0x33c(%rsp)
movl $0x0, 0x288(%rsp)
cmpl $0xa, 0x288(%rsp)
jg 0x3179
callq 0x20a0
movq %rax, 0x280(%rsp)
movl 0x33c(%rsp), %esi
leaq 0x270(%rsp), %rdi
callq 0xd270
jmp 0x25ce
leaq 0x260(%rsp), %rdi
leaq 0x270(%rsp), %rsi
callq 0xe6e0
jmp 0x25e5
leaq 0x270(%rsp), %rdi
leaq 0x260(%rsp), %rsi
callq 0xdea0
jmp 0x25fc
leaq 0x260(%rsp), %rdi
callq 0xd3a0
movl 0x33c(%rsp), %edx
leaq 0x250(%rsp), %rdi
movl %edx, %esi
callq 0x3790
jmp 0x2621
leaq 0x240(%rsp), %rdi
leaq 0x250(%rsp), %rsi
callq 0x5370
jmp 0x2638
leaq 0x250(%rsp), %rdi
leaq 0x240(%rsp), %rsi
callq 0x4410
jmp 0x264f
leaq 0x240(%rsp), %rdi
callq 0x3890
movl $0x1, 0x23c(%rsp)
movl 0x23c(%rsp), %eax
cmpl 0x33c(%rsp), %eax
jg 0x274e
movl 0x23c(%rsp), %edx
movl 0x33c(%rsp), %ecx
movl %edx, %eax
addl %ecx, %eax
cvtsi2sd %eax, %xmm0
leaq 0x250(%rsp), %rdi
movl %edx, %esi
callq 0x49f0
jmp 0x26a2
jmp 0x26a4
movl 0x23c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x23c(%rsp)
jmp 0x2667
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x290(%rsp)
movl %eax, 0x28c(%rsp)
jmp 0x373b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x290(%rsp)
movl %eax, 0x28c(%rsp)
jmp 0x3167
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x290(%rsp)
movl %eax, 0x28c(%rsp)
leaq 0x260(%rsp), %rdi
callq 0xd3a0
jmp 0x3167
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x290(%rsp)
movl %eax, 0x28c(%rsp)
jmp 0x315a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x290(%rsp)
movl %eax, 0x28c(%rsp)
leaq 0x240(%rsp), %rdi
callq 0x3890
jmp 0x315a
leaq 0x228(%rsp), %rdi
leaq 0x250(%rsp), %rsi
leaq 0x270(%rsp), %rdx
callq 0x4a30
jmp 0x276d
leaq 0x218(%rsp), %rdi
leaq 0x250(%rsp), %rsi
callq 0x5240
jmp 0x2784
callq 0x20a0
movq %rax, 0x210(%rsp)
movq 0x210(%rsp), %rax
movq 0x280(%rsp), %rcx
subq %rcx, %rax
cvtsi2sd %rax, %xmm0
movsd 0xc86f(%rip), %xmm1     # 0xf020
divsd %xmm1, %xmm0
movsd %xmm0, 0x208(%rsp)
movq 0xf803(%rip), %rdi      # 0x11fc8
leaq 0xc874(%rip), %rsi      # 0xf040
callq 0x2110
movq %rax, 0x168(%rsp)
jmp 0x27db
movq 0x168(%rsp), %rdi
movl 0x33c(%rsp), %esi
callq 0x21c0
movq %rax, 0x160(%rsp)
jmp 0x27f9
movq 0x160(%rsp), %rdi
leaq 0xc83f(%rip), %rsi      # 0xf047
callq 0x2110
movq %rax, 0x158(%rsp)
jmp 0x2817
movq 0x158(%rsp), %rdi
movsd 0x208(%rsp), %xmm0
callq 0x2210
movq %rax, 0x150(%rsp)
jmp 0x2837
movq 0x150(%rsp), %rdi
movq 0xf772(%rip), %rsi      # 0x11fb8
callq 0x2120
jmp 0x284d
movl $0x0, 0x204(%rsp)
movl 0x33c(%rsp), %esi
leaq 0x1f0(%rsp), %rdi
callq 0xd270
jmp 0x286e
callq 0x20a0
movq %rax, 0x280(%rsp)
movl $0x0, 0x204(%rsp)
leaq 0x1e0(%rsp), %rdi
leaq 0x250(%rsp), %rsi
leaq 0x228(%rsp), %rdx
leaq 0x204(%rsp), %rcx
callq 0xb150
jmp 0x28ad
leaq 0x1f0(%rsp), %rdi
leaq 0x1e0(%rsp), %rsi
callq 0xdea0
jmp 0x28c4
leaq 0x1e0(%rsp), %rdi
callq 0xd3a0
callq 0x20a0
movq %rax, 0x210(%rsp)
movq 0x210(%rsp), %rax
movq 0x280(%rsp), %rcx
subq %rcx, %rax
cvtsi2sd %rax, %xmm0
movsd 0xc722(%rip), %xmm1     # 0xf020
divsd %xmm1, %xmm0
movsd %xmm0, 0x208(%rsp)
movsd 0x208(%rsp), %xmm1
movsd 0x328(%rsp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x328(%rsp)
cvtsi2sdl 0x204(%rsp), %xmm1
movsd 0x330(%rsp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x330(%rsp)
movq 0xf678(%rip), %rdi      # 0x11fc8
leaq 0xc701(%rip), %rsi      # 0xf058
callq 0x2110
movq %rax, 0x148(%rsp)
jmp 0x2966
movq 0x148(%rsp), %rdi
movq 0xf65b(%rip), %rsi      # 0x11fd0
callq 0x2120
movq %rax, 0x140(%rsp)
jmp 0x2984
movq 0x140(%rsp), %rdi
movq 0xf625(%rip), %rsi      # 0x11fb8
callq 0x2120
jmp 0x299a
callq 0x20a0
movq %rax, 0x280(%rsp)
leaq 0x1d0(%rsp), %rdi
leaq 0x250(%rsp), %rsi
leaq 0x228(%rsp), %rdx
callq 0x68e0
jmp 0x29c6
leaq 0x1f0(%rsp), %rdi
leaq 0x1d0(%rsp), %rsi
callq 0xdea0
jmp 0x29dd
leaq 0x1d0(%rsp), %rdi
callq 0xd3a0
callq 0x20a0
movq %rax, 0x210(%rsp)
movq 0x210(%rsp), %rax
movq 0x280(%rsp), %rcx
subq %rcx, %rax
cvtsi2sd %rax, %xmm0
movsd 0xc609(%rip), %xmm1     # 0xf020
divsd %xmm1, %xmm0
movsd %xmm0, 0x208(%rsp)
leaq 0x1b8(%rsp), %rdi
leaq 0x1f0(%rsp), %rsi
leaq 0x270(%rsp), %rdx
callq 0xd6a0
jmp 0x2a43
leaq 0x1b8(%rsp), %rdi
movl $0x2, %esi
callq 0xe550
movsd %xmm0, 0x138(%rsp)
jmp 0x2a60
leaq 0x1b8(%rsp), %rdi
callq 0xd3a0
movsd 0x138(%rsp), %xmm0
movsd %xmm0, 0x1c8(%rsp)
movsd 0x208(%rsp), %xmm1
movsd 0x300(%rsp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x300(%rsp)
movsd 0x1c8(%rsp), %xmm1
movsd 0x2f8(%rsp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x2f8(%rsp)
movq 0xf504(%rip), %rdi      # 0x11fc8
leaq 0xc590(%rip), %rsi      # 0xf05b
callq 0x2110
movq %rax, 0x130(%rsp)
jmp 0x2ada
movq 0x130(%rsp), %rdi
movq 0xf4e7(%rip), %rsi      # 0x11fd0
callq 0x2120
movq %rax, 0x128(%rsp)
jmp 0x2af8
movq 0x128(%rsp), %rdi
movq 0xf4b1(%rip), %rsi      # 0x11fb8
callq 0x2120
jmp 0x2b0e
movl $0x0, 0x204(%rsp)
callq 0x20a0
movq %rax, 0x280(%rsp)
leaq 0x1a8(%rsp), %rdi
leaq 0x250(%rsp), %rsi
leaq 0x228(%rsp), %rdx
leaq 0x204(%rsp), %rcx
callq 0x91a0
jmp 0x2b4d
leaq 0x1f0(%rsp), %rdi
leaq 0x1a8(%rsp), %rsi
callq 0xdea0
jmp 0x2b64
leaq 0x1a8(%rsp), %rdi
callq 0xd3a0
callq 0x20a0
movq %rax, 0x210(%rsp)
movq 0x210(%rsp), %rax
movq 0x280(%rsp), %rcx
subq %rcx, %rax
cvtsi2sd %rax, %xmm0
movsd 0xc482(%rip), %xmm1     # 0xf020
divsd %xmm1, %xmm0
movsd %xmm0, 0x208(%rsp)
movsd 0x208(%rsp), %xmm1
movsd 0x2c8(%rsp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x2c8(%rsp)
cvtsi2sdl 0x204(%rsp), %xmm1
movsd 0x2d0(%rsp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x2d0(%rsp)
movq 0xf3d8(%rip), %rdi      # 0x11fc8
leaq 0xc468(%rip), %rsi      # 0xf05f
callq 0x2110
movq %rax, 0x120(%rsp)
jmp 0x2c06
movq 0x120(%rsp), %rdi
movq 0xf3bb(%rip), %rsi      # 0x11fd0
callq 0x2120
movq %rax, 0x118(%rsp)
jmp 0x2c24
movq 0x118(%rsp), %rdi
movq 0xf385(%rip), %rsi      # 0x11fb8
callq 0x2120
jmp 0x2c3a
callq 0x20a0
movq %rax, 0x280(%rsp)
cmpl $0x8c, 0x33c(%rsp)
jge 0x2f80
leaq 0x198(%rsp), %rdi
leaq 0x250(%rsp), %rsi
leaq 0x228(%rsp), %rdx
movsd 0xc3b0(%rip), %xmm0     # 0xf028
leaq 0x204(%rsp), %rcx
callq 0x9700
jmp 0x2c87
leaq 0x1f0(%rsp), %rdi
leaq 0x198(%rsp), %rsi
callq 0xdea0
jmp 0x2c9e
leaq 0x198(%rsp), %rdi
callq 0xd3a0
callq 0x20a0
movq %rax, 0x210(%rsp)
movq 0x210(%rsp), %rax
movq 0x280(%rsp), %rcx
subq %rcx, %rax
cvtsi2sd %rax, %xmm0
movsd 0xc348(%rip), %xmm1     # 0xf020
divsd %xmm1, %xmm0
movsd %xmm0, 0x208(%rsp)
movsd 0x208(%rsp), %xmm1
movsd 0x2b8(%rsp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x2b8(%rsp)
cvtsi2sdl 0x204(%rsp), %xmm1
movsd 0x2c0(%rsp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x2c0(%rsp)
movq 0xf29e(%rip), %rdi      # 0x11fc8
leaq 0xc333(%rip), %rsi      # 0xf064
callq 0x2110
movq %rax, 0x110(%rsp)
jmp 0x2d40
movq 0x110(%rsp), %rdi
movq 0xf281(%rip), %rsi      # 0x11fd0
callq 0x2120
movq %rax, 0x108(%rsp)
jmp 0x2d5e
movq 0x108(%rsp), %rdi
movq 0xf24b(%rip), %rsi      # 0x11fb8
callq 0x2120
jmp 0x2d74
callq 0x20a0
movq %rax, 0x280(%rsp)
movl $0x0, 0x204(%rsp)
leaq 0x188(%rsp), %rdi
leaq 0x250(%rsp), %rsi
leaq 0x228(%rsp), %rdx
movsd 0xc284(%rip), %xmm0     # 0xf030
leaq 0x204(%rsp), %rcx
callq 0x9700
jmp 0x2dbb
leaq 0x1f0(%rsp), %rdi
leaq 0x188(%rsp), %rsi
callq 0xdea0
jmp 0x2dd2
leaq 0x188(%rsp), %rdi
callq 0xd3a0
callq 0x20a0
movq %rax, 0x210(%rsp)
movq 0x210(%rsp), %rax
subq 0x280(%rsp), %rax
cvtsi2sd %rax, %xmm0
movsd 0xc217(%rip), %xmm1     # 0xf020
divsd %xmm1, %xmm0
movsd %xmm0, 0x208(%rsp)
movsd 0x208(%rsp), %xmm0
addsd 0x2a8(%rsp), %xmm0
movsd %xmm0, 0x2a8(%rsp)
cvtsi2sdl 0x204(%rsp), %xmm0
addsd 0x2b0(%rsp), %xmm0
movsd %xmm0, 0x2b0(%rsp)
jmp 0x2f80
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x290(%rsp)
movl %eax, 0x28c(%rsp)
jmp 0x314d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x290(%rsp)
movl %eax, 0x28c(%rsp)
jmp 0x3140
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x290(%rsp)
movl %eax, 0x28c(%rsp)
jmp 0x3133
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x290(%rsp)
movl %eax, 0x28c(%rsp)
leaq 0x1e0(%rsp), %rdi
callq 0xd3a0
jmp 0x3133
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x290(%rsp)
movl %eax, 0x28c(%rsp)
leaq 0x1d0(%rsp), %rdi
callq 0xd3a0
jmp 0x3133
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x290(%rsp)
movl %eax, 0x28c(%rsp)
leaq 0x1b8(%rsp), %rdi
callq 0xd3a0
jmp 0x3133
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x290(%rsp)
movl %eax, 0x28c(%rsp)
leaq 0x1a8(%rsp), %rdi
callq 0xd3a0
jmp 0x3133
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x290(%rsp)
movl %eax, 0x28c(%rsp)
leaq 0x198(%rsp), %rdi
callq 0xd3a0
jmp 0x3133
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x290(%rsp)
movl %eax, 0x28c(%rsp)
leaq 0x188(%rsp), %rdi
callq 0xd3a0
jmp 0x3133
cmpl $0x64, 0x33c(%rsp)
jge 0x30dc
movq 0xf033(%rip), %rdi      # 0x11fc8
leaq 0xc0ce(%rip), %rsi      # 0xf06a
callq 0x2110
movq %rax, 0x100(%rsp)
jmp 0x2fab
movq 0x100(%rsp), %rdi
movq 0xf016(%rip), %rsi      # 0x11fd0
callq 0x2120
movq %rax, 0xf8(%rsp)
jmp 0x2fc9
movq 0xf8(%rsp), %rdi
movq 0xefe0(%rip), %rsi      # 0x11fb8
callq 0x2120
jmp 0x2fdf
callq 0x20a0
movq %rax, 0x280(%rsp)
movl $0x0, 0x204(%rsp)
leaq 0x178(%rsp), %rdi
leaq 0x250(%rsp), %rsi
leaq 0x228(%rsp), %rdx
movsd 0xc021(%rip), %xmm0     # 0xf038
leaq 0x204(%rsp), %rcx
callq 0x9700
jmp 0x3026
leaq 0x1f0(%rsp), %rdi
leaq 0x178(%rsp), %rsi
callq 0xdea0
jmp 0x303d
leaq 0x178(%rsp), %rdi
callq 0xd3a0
callq 0x20a0
movq %rax, 0x210(%rsp)
movq 0x210(%rsp), %rax
subq 0x280(%rsp), %rax
cvtsi2sd %rax, %xmm0
movsd 0xbfac(%rip), %xmm1     # 0xf020
divsd %xmm1, %xmm0
movsd %xmm0, 0x208(%rsp)
movsd 0x208(%rsp), %xmm0
addsd 0x298(%rsp), %xmm0
movsd %xmm0, 0x298(%rsp)
cvtsi2sdl 0x204(%rsp), %xmm0
addsd 0x2a0(%rsp), %xmm0
movsd %xmm0, 0x2a0(%rsp)
jmp 0x30dc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x290(%rsp)
movl %eax, 0x28c(%rsp)
leaq 0x178(%rsp), %rdi
callq 0xd3a0
jmp 0x3133
leaq 0x1f0(%rsp), %rdi
callq 0xd3a0
leaq 0x218(%rsp), %rdi
callq 0x3890
leaq 0x228(%rsp), %rdi
callq 0xd3a0
leaq 0x250(%rsp), %rdi
callq 0x3890
leaq 0x270(%rsp), %rdi
callq 0xd3a0
movl 0x288(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x288(%rsp)
jmp 0x259d
leaq 0x1f0(%rsp), %rdi
callq 0xd3a0
leaq 0x218(%rsp), %rdi
callq 0x3890
leaq 0x228(%rsp), %rdi
callq 0xd3a0
leaq 0x250(%rsp), %rdi
callq 0x3890
leaq 0x270(%rsp), %rdi
callq 0xd3a0
jmp 0x373b
leaq 0xbeef(%rip), %rsi      # 0xf06f
leaq 0x340(%rsp), %rdi
movl $0x1, %edx
callq 0x2050
jmp 0x3194
movl 0x33c(%rsp), %esi
leaq 0x340(%rsp), %rdi
callq 0x21c0
movq %rax, 0xf0(%rsp)
jmp 0x31b2
movq 0xf0(%rsp), %rdi
leaq 0xbeb7(%rip), %rsi      # 0xf078
callq 0x2110
jmp 0x31c8
movsd 0x330(%rsp), %xmm0
movsd 0xbe3f(%rip), %xmm1     # 0xf018
divsd %xmm1, %xmm0
leaq 0x340(%rsp), %rdi
callq 0x2210
movq %rax, 0xe8(%rsp)
jmp 0x31f4
movq 0xe8(%rsp), %rdi
leaq 0xbe75(%rip), %rsi      # 0xf078
callq 0x2110
movq %rax, 0xe0(%rsp)
jmp 0x3212
movq 0xe0(%rsp), %rdi
movsd 0x328(%rsp), %xmm0
movsd 0xbded(%rip), %xmm1     # 0xf018
divsd %xmm1, %xmm0
callq 0x2210
movq %rax, 0xd8(%rsp)
jmp 0x323e
movq 0xd8(%rsp), %rdi
leaq 0xbe2b(%rip), %rsi      # 0xf078
callq 0x2110
jmp 0x3254
movsd 0x320(%rsp), %xmm0
movsd 0xbdb3(%rip), %xmm1     # 0xf018
divsd %xmm1, %xmm0
leaq 0x340(%rsp), %rdi
callq 0x2210
movq %rax, 0xd0(%rsp)
jmp 0x3280
movq 0xd0(%rsp), %rdi
leaq 0xbde9(%rip), %rsi      # 0xf078
callq 0x2110
movq %rax, 0xc8(%rsp)
jmp 0x329e
movq 0xc8(%rsp), %rdi
movsd 0x318(%rsp), %xmm0
movsd 0xbd61(%rip), %xmm1     # 0xf018
divsd %xmm1, %xmm0
callq 0x2210
movq %rax, 0xc0(%rsp)
jmp 0x32ca
movq 0xc0(%rsp), %rdi
leaq 0xbd9f(%rip), %rsi      # 0xf078
callq 0x2110
jmp 0x32e0
movsd 0x310(%rsp), %xmm0
movsd 0xbd27(%rip), %xmm1     # 0xf018
divsd %xmm1, %xmm0
leaq 0x340(%rsp), %rdi
callq 0x2210
movq %rax, 0xb8(%rsp)
jmp 0x330c
movq 0xb8(%rsp), %rdi
leaq 0xbd5d(%rip), %rsi      # 0xf078
callq 0x2110
movq %rax, 0xb0(%rsp)
jmp 0x332a
movq 0xb0(%rsp), %rdi
movsd 0x308(%rsp), %xmm0
movsd 0xbcd5(%rip), %xmm1     # 0xf018
divsd %xmm1, %xmm0
callq 0x2210
movq %rax, 0xa8(%rsp)
jmp 0x3356
movq 0xa8(%rsp), %rdi
leaq 0xbd13(%rip), %rsi      # 0xf078
callq 0x2110
jmp 0x336c
movsd 0x300(%rsp), %xmm0
movsd 0xbc9b(%rip), %xmm1     # 0xf018
divsd %xmm1, %xmm0
leaq 0x340(%rsp), %rdi
callq 0x2210
movq %rax, 0xa0(%rsp)
jmp 0x3398
movq 0xa0(%rsp), %rdi
leaq 0xbcd1(%rip), %rsi      # 0xf078
callq 0x2110
movq %rax, 0x98(%rsp)
jmp 0x33b6
movq 0x98(%rsp), %rdi
movsd 0x2f8(%rsp), %xmm0
movsd 0xbc49(%rip), %xmm1     # 0xf018
divsd %xmm1, %xmm0
callq 0x2210
movq %rax, 0x90(%rsp)
jmp 0x33e2
movq 0x90(%rsp), %rdi
leaq 0xbc87(%rip), %rsi      # 0xf078
callq 0x2110
jmp 0x33f8
movsd 0x2f0(%rsp), %xmm0
movsd 0xbc0f(%rip), %xmm1     # 0xf018
divsd %xmm1, %xmm0
leaq 0x340(%rsp), %rdi
callq 0x2210
movq %rax, 0x88(%rsp)
jmp 0x3424
movq 0x88(%rsp), %rdi
leaq 0xbc45(%rip), %rsi      # 0xf078
callq 0x2110
movq %rax, 0x80(%rsp)
jmp 0x3442
movq 0x80(%rsp), %rdi
movsd 0x2e8(%rsp), %xmm0
movsd 0xbbbd(%rip), %xmm1     # 0xf018
divsd %xmm1, %xmm0
callq 0x2210
movq %rax, 0x78(%rsp)
jmp 0x346b
movq 0x78(%rsp), %rdi
leaq 0xbc01(%rip), %rsi      # 0xf078
callq 0x2110
jmp 0x347e
movsd 0x2e0(%rsp), %xmm0
movsd 0xbb89(%rip), %xmm1     # 0xf018
divsd %xmm1, %xmm0
leaq 0x340(%rsp), %rdi
callq 0x2210
movq %rax, 0x70(%rsp)
jmp 0x34a7
movq 0x70(%rsp), %rdi
leaq 0xbbc5(%rip), %rsi      # 0xf078
callq 0x2110
movq %rax, 0x68(%rsp)
jmp 0x34bf
movq 0x68(%rsp), %rdi
movsd 0x2d8(%rsp), %xmm0
movsd 0xbb43(%rip), %xmm1     # 0xf018
divsd %xmm1, %xmm0
callq 0x2210
movq %rax, 0x60(%rsp)
jmp 0x34e5
movq 0x60(%rsp), %rdi
leaq 0xbb87(%rip), %rsi      # 0xf078
callq 0x2110
jmp 0x34f8
movsd 0x2d0(%rsp), %xmm0
movsd 0xbb0f(%rip), %xmm1     # 0xf018
divsd %xmm1, %xmm0
leaq 0x340(%rsp), %rdi
callq 0x2210
movq %rax, 0x58(%rsp)
jmp 0x3521
movq 0x58(%rsp), %rdi
leaq 0xbb4b(%rip), %rsi      # 0xf078
callq 0x2110
movq %rax, 0x50(%rsp)
jmp 0x3539
movq 0x50(%rsp), %rdi
movsd 0x2c8(%rsp), %xmm0
movsd 0xbac9(%rip), %xmm1     # 0xf018
divsd %xmm1, %xmm0
callq 0x2210
movq %rax, 0x48(%rsp)
jmp 0x355f
movq 0x48(%rsp), %rdi
leaq 0xbb0d(%rip), %rsi      # 0xf078
callq 0x2110
jmp 0x3572
movsd 0x2c0(%rsp), %xmm0
movsd 0xba95(%rip), %xmm1     # 0xf018
divsd %xmm1, %xmm0
leaq 0x340(%rsp), %rdi
callq 0x2210
movq %rax, 0x40(%rsp)
jmp 0x359b
movq 0x40(%rsp), %rdi
leaq 0xbad1(%rip), %rsi      # 0xf078
callq 0x2110
movq %rax, 0x38(%rsp)
jmp 0x35b3
movq 0x38(%rsp), %rdi
movsd 0x2b8(%rsp), %xmm0
movsd 0xba4f(%rip), %xmm1     # 0xf018
divsd %xmm1, %xmm0
callq 0x2210
movq %rax, 0x30(%rsp)
jmp 0x35d9
movq 0x30(%rsp), %rdi
leaq 0xba93(%rip), %rsi      # 0xf078
callq 0x2110
jmp 0x35ec
movsd 0x2b0(%rsp), %xmm0
movsd 0xba1b(%rip), %xmm1     # 0xf018
divsd %xmm1, %xmm0
leaq 0x340(%rsp), %rdi
callq 0x2210
movq %rax, 0x28(%rsp)
jmp 0x3615
movq 0x28(%rsp), %rdi
leaq 0xba57(%rip), %rsi      # 0xf078
callq 0x2110
movq %rax, 0x20(%rsp)
jmp 0x362d
movq 0x20(%rsp), %rdi
movsd 0x2a8(%rsp), %xmm0
movsd 0xb9d5(%rip), %xmm1     # 0xf018
divsd %xmm1, %xmm0
callq 0x2210
movq %rax, 0x18(%rsp)
jmp 0x3653
movq 0x18(%rsp), %rdi
leaq 0xba19(%rip), %rsi      # 0xf078
callq 0x2110
jmp 0x3666
movsd 0x2a0(%rsp), %xmm0
movsd 0xb9a1(%rip), %xmm1     # 0xf018
divsd %xmm1, %xmm0
leaq 0x340(%rsp), %rdi
callq 0x2210
movq %rax, 0x10(%rsp)
jmp 0x368f
movq 0x10(%rsp), %rdi
leaq 0xb9dd(%rip), %rsi      # 0xf078
callq 0x2110
movq %rax, 0x8(%rsp)
jmp 0x36a7
movq 0x8(%rsp), %rdi
movsd 0x298(%rsp), %xmm0
movsd 0xb95b(%rip), %xmm1     # 0xf018
divsd %xmm1, %xmm0
callq 0x2210
jmp 0x36c8
movq 0xe8e9(%rip), %rsi      # 0x11fb8
leaq 0x340(%rsp), %rdi
callq 0x2120
jmp 0x36de
leaq 0x340(%rsp), %rdi
callq 0x20b0
jmp 0x36ed
leaq 0x340(%rsp), %rdi
callq 0x2170
jmp 0x36fc
jmp 0x36fe
movl 0x338(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x338(%rsp)
jmp 0x2455
movl $0x1, 0x544(%rsp)
leaq 0x340(%rsp), %rdi
callq 0x2180
movl 0x544(%rsp), %eax
addq $0x548, %rsp            # imm = 0x548
retq
leaq 0x340(%rsp), %rdi
callq 0x2180
movq 0x290(%rsp), %rdi
callq 0x21e0
nopw %cs:(%rax,%rax)
nop