// File: /workspace/github_c_makefile_star2_O1/olcaytaner[P]Isell/poly.c
// Function: polylearn
Polynomptr polylearn(char* trainfname, char* testfname, int maxdegree, double* trainerror, double* testerror, int regression)
{
	/*!Last Changed 22.01.2005 rewritten*/
	/*!Last Changed 02.02.2004 added safemalloc*/
 char varname[MAXLENGTH];
 char varvalue[MAXLENGTH], pst[READLINELENGTH];
	FILE* errorfile;
 Polynomptr p;
	double** traindata, **testdata, bestgeneralization = +LONG_MAX, error, generalizationerror, calcsigma;
	double*** trainfolds, ***testfolds, loglikelihood;
	char fname[20], **fnames, line[READLINELENGTH];
	int traincount, testcount, i, bestdegree = -1, d, j, k, *trainortest;
 int foldcount, foldtraincount, dummy1, dummy2, *ordering;
	traindata = readpolydata(trainfname, &traincount);
	testdata = readpolydata(testfname, &testcount);
	if (get_parameter_l("modelselectionmethod") != 0)
	 {
   for (i = 0; i <= maxdegree; i++)
			 {
				 if (regression)
					 {
  	  	 p = polyfit(traindata, traincount, i);
							error = calculate_mse(traindata, traincount, p);
					 }
					else
					 {
						 p = polyfitcls(traindata, traincount, i);
							error = calculate_poly_clserror(traindata, traincount, p);
							loglikelihood = calculate_poly_loglikelihood(traindata, traincount, p);
					 }
		  	d = i + 1;
			  switch (get_parameter_l("modelselectionmethod"))
					 {
			  		case MODEL_SELECTION_AIC:if (regression)
															                   if (get_parameter_f("sigma") <= 0.0)
																                   {
								                            generalizationerror = aic_squared_error(error, d, traincount);
															  	                  calcsigma = (error * traincount) / (traincount - d);
	                                   sprintf(varname,"aout1[%d]", d);
			                                 set_precision(pst, NULL, NULL);
	                                   sprintf(varvalue, pst, calcsigma);
	                                   set_variable(varname, varvalue);
																                   }
																                  else
																	                   generalizationerror = aic_squared_error_with_sigma(error, d, traincount, get_parameter_f("sigma"));
								                        else
															                   generalizationerror = aic_loglikelihood(loglikelihood, d);
														                  break;
			  		case MODEL_SELECTION_BIC:if (regression)
															                   if (get_parameter_f("sigma") <= 0.0)
																                   {
														  	                   generalizationerror = bic_squared_error(error, d, traincount);
														  		                  calcsigma = (error * traincount) / (traincount - d);
	                                   sprintf(varname,"aout1[%d]", d);
			                                 set_precision(pst, NULL, NULL);
	                                   sprintf(varvalue, pst, calcsigma);
	                                   set_variable(varname, varvalue);
																                   }
																                  else
																	                   generalizationerror = bic_squared_error_with_sigma(error, d, traincount, get_parameter_f("sigma"));
								                        else
															                   generalizationerror = bic_loglikelihood(loglikelihood, d, traincount);
								                        break;
			  		case MODEL_SELECTION_SRM:if (regression) 
															                   generalizationerror = srm_regression(error, d, traincount, 1.0, 1.0);
								                        else
															                   generalizationerror = srm_classification(error, d, traincount, 1.0, 1.0);
														                  break;
				  	case MODEL_SELECTION_MDL:if (regression)
  								                        generalizationerror = mdl(error, d, 1.0 / traincount, 6);
								                        else
															                   generalizationerror = mdl(error, d, 0.01, 6);
														                  break;
					 }
					if (generalizationerror < bestgeneralization)
					 {
						 bestdegree = i;
       bestgeneralization = generalizationerror;
					 }
			  free_polynom(p);
			 }
	 }
	else
	 {
		 if (traincount < 50) /*Leave one out*/
			 {
				 foldcount = traincount;
					foldtraincount = traincount - 1;
				 trainfolds = (double***) safemalloc_3d(sizeof(double**), sizeof(double*), sizeof(double), traincount, traincount - 1, 2, "polylearn", 37);
					testfolds = (double***) safemalloc_3d(sizeof(double**), sizeof(double*), sizeof(double), traincount, 1, 2, "polylearn", 38);
					for (i = 0; i < traincount; i++)
					 { /*Prepare fold i*/
							k = 0;
							for (j = 0; j < traincount; j++)
								 if (i != j)
									 {
										 trainfolds[i][k][0] = traindata[j][0];
										 trainfolds[i][k][1] = traindata[j][1];
											k++;
									 }
									else
									 {
										 testfolds[i][0][0] = traindata[j][0];
										 testfolds[i][0][1] = traindata[j][1];
									 }       
					 }
			 }
			else /*5x2 Cross validation*/
			 {
				 foldcount = 10;
					foldtraincount = traincount / 2;
				 trainfolds = (double***) safemalloc_3d(sizeof(double**), sizeof(double*), sizeof(double), 10, traincount / 2, 2, "polylearn", 63);
					testfolds = (double***) safemalloc_3d(sizeof(double**), sizeof(double*), sizeof(double), 10, traincount / 2, 2, "polylearn", 64);
					for (i = 0; i < 5; i++)
					 {
       trainortest = random_array(traincount);
							k = 0;
       for (j = 0; j < traincount; j++)
								 if (trainortest[j] % 2 == 0)
									 {
										 trainfolds[2 * i][k][0] = traindata[j][0];
										 trainfolds[2 * i][k][1] = traindata[j][1];
											testfolds[2 * i + 1][k][0] = traindata[j][0];
											testfolds[2 * i + 1][k][1] = traindata[j][1];
											k++;
									 }
									else
									 {
										 trainfolds[2 * i + 1][j - k][0] = traindata[j][0];
										 trainfolds[2 * i + 1][j - k][1] = traindata[j][1];
											testfolds[2 * i][j - k][0] = traindata[j][0];
											testfolds[2 * i][j - k][1] = traindata[j][1];										 
									 }
					  safe_free(trainortest);
					 }
			 }
			fnames = safemalloc((maxdegree + 1) * sizeof(char *), "polylearn", 138); 
   for (i = 0; i <= maxdegree; i++)
			 { 
				 sprintf(fname, "%s/error%d.txt", get_parameter_s("tempdirectory"), i);
					fnames[i] = strcopy(fnames[i], fname);
				 errorfile = fopen(fname, "w");
					if (!errorfile)
						 return NULL;
				 for (j = 0; j < foldcount; j++)
					 {
						 if (regression)
							 {
  						 p = polyfit(trainfolds[j], foldtraincount, i);
							  error = calculate_mse(testfolds[j], traincount - foldtraincount, p);
							 }
							else
							 {
								 p = polyfitcls(trainfolds[j], foldtraincount, i);
									error = calculate_poly_clserror(testfolds[j], traincount - foldtraincount, p);
							 }
			    set_precision(pst, NULL, "\n");
							fprintf(errorfile, pst, error);
							free_polynom(p);
					 }
					fclose(errorfile);
 			}
			free_3d((void***)trainfolds, foldcount, foldtraincount);
			free_3d((void***)testfolds, foldcount, traincount - foldtraincount);
			sprintf(line, "-");
			ordering = multiple_comparison(fnames, maxdegree + 1, get_parameter_l("testtype"), line, &dummy1, &dummy2, get_parameter_l("correctiontype"));
			bestdegree = ordering[0] - 1;
			safe_free(ordering);
   free_2d((void**)fnames, maxdegree + 1);
	 }
	if (regression)
	 {
  	p = polyfit(traindata, traincount, bestdegree);
	  *trainerror = calculate_mse(traindata, traincount, p);
	  *testerror = calculate_mse(testdata, testcount, p);
	 }
 else
	 {
		 p = polyfitcls(traindata, traincount, bestdegree);
			*trainerror = calculate_poly_clserror(traindata, traincount, p);
			*testerror = calculate_poly_clserror(testdata, testcount, p);
	 }
	free_2d((void**)traindata, traincount);
	free_2d((void**)testdata, testcount);
 return p;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x16e3f8, %rsp         # imm = 0x16E3F8
movl %r9d, 0x1c(%rsp)
movq %r8, 0x80(%rsp)
movq %rcx, 0x68(%rsp)
movl %edx, %ebp
movq %rsi, %rbx
leaq 0x2c(%rsp), %rsi
callq 0x58eb0
movq %rax, %r12
leaq 0x44(%rsp), %rsi
movq %rbx, %rdi
callq 0x58eb0
movq %rax, %rbx
leaq 0x47d53(%rip), %rdi     # 0xa27d6
callq 0x535f7
testl %eax, %eax
movq %r12, 0x50(%rsp)
movq %rbx, 0x70(%rsp)
je 0x5ade6
testl %ebp, %ebp
js 0x5aec9
movl 0x2c(%rsp), %eax
cvtsi2sd %eax, %xmm0
movsd 0x47a6e(%rip), %xmm1    # 0xa2520
movsd %xmm0, 0x30(%rsp)
divsd %xmm0, %xmm1
movsd %xmm1, 0x48(%rsp)
incl %ebp
movq %rbp, 0x58(%rsp)
movq %rax, 0x20(%rsp)
leal -0x1(%rax), %ebp
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movsd 0x48852(%rip), %xmm0    # 0xa3330
xorl %r13d, %r13d
movsd %xmm0, 0x60(%rsp)
cmpl $0x0, 0x1c(%rsp)
je 0x5ab1f
movq 0x50(%rsp), %r12
movq %r12, %rdi
movq 0x20(%rsp), %r14
movl %r14d, %esi
movl %r13d, %edx
callq 0x5a3f9
movq %rax, %r15
movq %r12, %rdi
movl %r14d, %esi
movq %rax, %rdx
callq 0x5a1e4
movsd %xmm0, 0x10(%rsp)
jmp 0x5ab62
movq 0x50(%rsp), %r12
movq %r12, %rdi
movq 0x20(%rsp), %r14
movl %r14d, %esi
movl %r13d, %edx
callq 0x5a616
movq %rax, %r15
movq %r12, %rdi
movl %r14d, %esi
movq %rax, %rdx
callq 0x59fd1
movsd %xmm0, 0x10(%rsp)
movq %r12, %rdi
movl %r14d, %esi
movq %r15, %rdx
callq 0x5a0dc
movsd %xmm0, 0x38(%rsp)
leal 0x1(%r13), %r12d
leaq 0x47c69(%rip), %rdi     # 0xa27d6
callq 0x535f7
decl %eax
cmpl $0x3, %eax
ja 0x5acfb
leaq 0x4d140(%rip), %rcx     # 0xa7cc4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpl $0x0, 0x1c(%rsp)
leaq 0x47ca3(%rip), %r14     # 0xa283c
je 0x5acd0
movq %r14, %rdi
callq 0x534b6
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
xorps %xmm1, %xmm1
cvtsi2sd %r12d, %xmm1
jae 0x5ad3c
movq %r14, %rdi
movsd %xmm1, 0x8(%rsp)
callq 0x534b6
movapd %xmm0, %xmm2
movsd 0x10(%rsp), %xmm0
movsd 0x8(%rsp), %xmm1
movq 0x20(%rsp), %rdi
callq 0x4750d
jmp 0x5acf5
cmpl $0x0, 0x1c(%rsp)
je 0x5ac92
movsd 0x10(%rsp), %xmm0
movl %r12d, %edi
movq 0x20(%rsp), %rsi
movsd 0x47915(%rip), %xmm1    # 0xa2520
movapd %xmm1, %xmm2
callq 0x4768a
jmp 0x5acf5
cmpl $0x0, 0x1c(%rsp)
je 0x5acb3
movsd 0x10(%rsp), %xmm0
movl %r12d, %edi
movsd 0x48(%rsp), %xmm1
jmp 0x5acc4
xorps %xmm1, %xmm1
cvtsi2sd %r12d, %xmm1
cmpl $0x0, 0x1c(%rsp)
leaq 0x47bf0(%rip), %r14     # 0xa283c
je 0x5ace5
movsd %xmm1, 0x8(%rsp)
movq %r14, %rdi
callq 0x534b6
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
jae 0x5ad4e
movq %r14, %rdi
callq 0x534b6
movapd %xmm0, %xmm2
movsd 0x10(%rsp), %xmm0
movsd 0x8(%rsp), %xmm1
movq 0x20(%rsp), %rdi
callq 0x4752d
jmp 0x5acf5
movsd 0x10(%rsp), %xmm0
movl %r12d, %edi
movq 0x20(%rsp), %rsi
movsd 0x47878(%rip), %xmm1    # 0xa2520
movapd %xmm1, %xmm2
callq 0x475c7
jmp 0x5acf5
movsd 0x10(%rsp), %xmm0
movl %r12d, %edi
movsd 0x480fc(%rip), %xmm1    # 0xa2dc0
movl $0x6, %esi
callq 0x47717
jmp 0x5acf5
xorps %xmm1, %xmm1
cvtsi2sd %r12d, %xmm1
movsd 0x38(%rsp), %xmm0
callq 0x464c1
jmp 0x5acf5
movsd 0x38(%rsp), %xmm0
movq 0x20(%rsp), %rdi
callq 0x46930
movsd %xmm0, 0x8(%rsp)
movsd 0x60(%rsp), %xmm0
movsd 0x8(%rsp), %xmm1
ucomisd %xmm1, %xmm0
cmoval %r13d, %ebx
minsd %xmm0, %xmm1
movsd %xmm1, 0x10(%rsp)
movq %r15, %rdi
callq 0x59683
decl %ebp
movsd 0x10(%rsp), %xmm0
movl %r12d, %r13d
cmpl %r12d, 0x58(%rsp)
jne 0x5aae1
jmp 0x5b217
movsd 0x10(%rsp), %xmm0
movq 0x20(%rsp), %rdi
callq 0x46491
jmp 0x5ad64
movsd 0x10(%rsp), %xmm0
movsd 0x8(%rsp), %xmm1
movq 0x20(%rsp), %rdi
callq 0x468e1
movsd %xmm0, 0x8(%rsp)
movsd 0x10(%rsp), %xmm1
mulsd 0x30(%rsp), %xmm1
xorps %xmm0, %xmm0
cvtsi2sd %ebp, %xmm0
divsd %xmm0, %xmm1
movsd %xmm1, 0x10(%rsp)
leaq 0x7a1b0(%rsp), %rdi
leaq 0x4b80d(%rip), %rsi     # 0xa65a3
movl %r12d, %edx
xorl %eax, %eax
callq 0x41b0
leaq 0xf42d0(%rsp), %r14
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x39529
leaq 0x90(%rsp), %rdi
movq %r14, %rsi
movsd 0x10(%rsp), %xmm0
movb $0x1, %al
callq 0x41b0
leaq 0x7a1b0(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x32e47
jmp 0x5acfb
movslq 0x2c(%rsp), %rcx
cmpq $0x31, %rcx
movq %rcx, 0x38(%rsp)
jg 0x5aed3
leal -0x1(%rcx), %r8d
leaq 0x4cf84(%rip), %r14     # 0xa7d89
movl $0x8, %edi
movl $0x8, %esi
movl $0x8, %edx
movl %r8d, 0x8(%rsp)
movl $0x2, %r9d
pushq $0x25
pushq %r14
callq 0x39422
addq $0x10, %rsp
movq %rax, %r15
movl $0x8, %edi
movl $0x8, %esi
movl $0x8, %edx
movq 0x38(%rsp), %rcx
movl $0x1, %r8d
movl $0x2, %r9d
pushq $0x26
pushq %r14
callq 0x39422
movq 0x48(%rsp), %r8
addq $0x10, %rsp
movq %rax, %r13
testl %r8d, %r8d
jle 0x5aebf
xorl %eax, %eax
xorl %ecx, %ecx
xorl %edx, %edx
movq (%r12,%rcx,8), %rsi
movsd (%rsi), %xmm0
cmpq %rcx, %rax
jne 0x5ae94
movq (%r13,%rax,8), %rdi
movq (%rdi), %rdi
movsd %xmm0, (%rdi)
movsd 0x8(%rsi), %xmm0
movsd %xmm0, 0x8(%rdi)
jmp 0x5aeaf
movq (%r15,%rax,8), %rdi
movslq %edx, %rdx
movq (%rdi,%rdx,8), %rdi
movsd %xmm0, (%rdi)
movsd 0x8(%rsi), %xmm0
movsd %xmm0, 0x8(%rdi)
incl %edx
incq %rcx
cmpq %rcx, %r8
jne 0x5ae6f
incq %rax
cmpq %r8, %rax
jne 0x5ae6b
movl %r8d, 0x30(%rsp)
jmp 0x5b017
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jmp 0x5b217
movl %ecx, %r13d
shrl %r13d
leaq 0x4cea9(%rip), %r14     # 0xa7d89
movl $0x8, %edi
movl $0x8, %esi
movl $0x8, %edx
movl $0xa, %ecx
movl %r13d, %r8d
movl $0x2, %r9d
pushq $0x3f
pushq %r14
callq 0x39422
addq $0x10, %rsp
movq %rax, %r15
movl $0x8, %edi
movl $0x8, %esi
movl $0x8, %edx
movl $0xa, %ecx
movl %r13d, 0x8(%rsp)
movl %r13d, %r8d
movl $0x2, %r9d
pushq $0x40
pushq %r14
callq 0x39422
addq $0x10, %rsp
movq %rax, %r13
xorl %r14d, %r14d
movq 0x38(%rsp), %rbx
movl %ebx, %edi
callq 0x39fdc
leaq (%r14,%r14), %rcx
leaq 0x1(,%r14,2), %rdx
xorl %esi, %esi
xorl %edi, %edi
movq (%r12,%rsi,8), %r8
movsd (%r8), %xmm0
testb $0x1, (%rax,%rsi,4)
movslq %edi, %r9
jne 0x5afac
movq (%r15,%rcx,8), %rdi
movq (%rdi,%r9,8), %rdi
movsd %xmm0, (%rdi)
movsd 0x8(%r8), %xmm0
movsd %xmm0, 0x8(%rdi)
movsd (%r8), %xmm0
movq (%r13,%rdx,8), %rdi
movq (%rdi,%r9,8), %rdi
movsd %xmm0, (%rdi)
movsd 0x8(%r8), %xmm0
movsd %xmm0, 0x8(%rdi)
incl %r9d
movl %r9d, %edi
jmp 0x5afee
movq (%r15,%rdx,8), %r10
shlq $0x3, %r9
subq %r9, %r10
movq (%r10,%rsi,8), %r10
movsd %xmm0, (%r10)
movsd 0x8(%r8), %xmm0
movsd %xmm0, 0x8(%r10)
movsd (%r8), %xmm0
movq (%r13,%rcx,8), %r10
subq %r9, %r10
movq (%r10,%rsi,8), %r9
movsd %xmm0, (%r9)
movsd 0x8(%r8), %xmm0
movsd %xmm0, 0x8(%r9)
incq %rsi
cmpq %rsi, %rbx
jne 0x5af5e
movq %rax, %rdi
callq 0x39194
incq %r14
cmpq $0x5, %r14
jne 0x5af47
movl $0xa, 0x30(%rsp)
leal 0x1(%rbp), %eax
movq %rax, 0x78(%rsp)
movslq %ebp, %rax
leaq 0x8(,%rax,8), %rdi
leaq 0x4cd58(%rip), %rsi     # 0xa7d89
movl $0x8a, %edx
callq 0x390f5
movq %rax, 0x48(%rsp)
testl %ebp, %ebp
js 0x5b17b
movq 0x38(%rsp), %rax
subl 0x8(%rsp), %eax
movl %eax, 0x20(%rsp)
movl 0x30(%rsp), %eax
movq %rax, 0x58(%rsp)
xorl %ebx, %ebx
leaq 0x4c355(%rip), %rdi     # 0xa73bc
callq 0x5356b
leaq 0x90(%rsp), %r12
movq %r12, %rdi
leaq 0x4cd15(%rip), %rsi     # 0xa7d93
movq %rax, %rdx
movl %ebx, %ecx
xorl %eax, %eax
callq 0x41b0
movq 0x48(%rsp), %r14
movq (%r14,%rbx,8), %rdi
movq %r12, %rsi
callq 0x3a404
movq %rax, (%r14,%rbx,8)
movq %r12, %rdi
leaq 0x4d7f8(%rip), %rsi     # 0xa88a1
callq 0x40f0
testq %rax, %rax
je 0x5b2d9
movq %rax, %rbp
cmpl $0x0, 0x30(%rsp)
jle 0x5b165
xorl %r14d, %r14d
movq %rbx, 0x60(%rsp)
movq (%r15,%r14,8), %rdi
cmpl $0x0, 0x1c(%rsp)
je 0x5b0f9
movl 0x8(%rsp), %esi
movl %ebx, %edx
callq 0x5a3f9
movq %rax, %r12
movq (%r13,%r14,8), %rdi
movl 0x20(%rsp), %esi
movq %rax, %rdx
callq 0x5a1e4
jmp 0x5b118
movl 0x8(%rsp), %esi
movl %ebx, %edx
callq 0x5a616
movq %rax, %r12
movq (%r13,%r14,8), %rdi
movl 0x20(%rsp), %esi
movq %rax, %rdx
callq 0x59fd1
movsd %xmm0, 0x10(%rsp)
leaq 0xf42d0(%rsp), %rbx
movq %rbx, %rdi
xorl %esi, %esi
leaq 0x4b039(%rip), %rdx     # 0xa616b
callq 0x39529
movq %rbp, %rdi
movq %rbx, %rsi
movsd 0x10(%rsp), %xmm0
movb $0x1, %al
callq 0x42e0
movq %r12, %rdi
callq 0x59683
incq %r14
cmpq %r14, 0x58(%rsp)
movq 0x60(%rsp), %rbx
jne 0x5b0cd
movq %rbp, %rdi
callq 0x42a0
incq %rbx
cmpq 0x78(%rsp), %rbx
jne 0x5b060
movq %r15, %rdi
movl 0x30(%rsp), %r14d
movl %r14d, %esi
movl 0x8(%rsp), %ebp
movl %ebp, %edx
callq 0x39199
movq 0x38(%rsp), %rdx
subl %ebp, %edx
movq %r13, %rdi
movl %r14d, %esi
callq 0x39199
leaq 0x7a1b0(%rsp), %rbx
movw $0x2d, (%rbx)
leaq 0x4c24a(%rip), %rdi     # 0xa7401
callq 0x535f7
movl %eax, %ebp
leaq 0x47773(%rip), %rdi     # 0xa2938
callq 0x535f7
subq $0x8, %rsp
leaq 0x94(%rsp), %r8
leaq 0x90(%rsp), %r9
movq 0x50(%rsp), %r15
movq %r15, %rdi
movq 0x80(%rsp), %r14
movl %r14d, %esi
movl %ebp, %edx
movq %rbx, %rcx
pushq %rax
callq 0x8c4bc
addq $0x10, %rsp
movl (%rax), %ebx
decl %ebx
movq %rax, %rdi
callq 0x39194
movq %r15, %rdi
movl %r14d, %esi
callq 0x3915f
movl 0x2c(%rsp), %ebp
cmpl $0x0, 0x1c(%rsp)
je 0x5b262
movq 0x50(%rsp), %r14
movq %r14, %rdi
movl %ebp, %esi
movl %ebx, %edx
callq 0x5a3f9
movq %rax, %r15
movq %r14, %rdi
movl %ebp, %esi
movq %rax, %rdx
callq 0x5a1e4
movq 0x68(%rsp), %rax
movsd %xmm0, (%rax)
movl 0x44(%rsp), %esi
movq 0x70(%rsp), %rbx
movq %rbx, %rdi
movq %r15, %rdx
callq 0x5a1e4
jmp 0x5b2a0
movq 0x50(%rsp), %r14
movq %r14, %rdi
movl %ebp, %esi
movl %ebx, %edx
callq 0x5a616
movq %rax, %r15
movq %r14, %rdi
movl %ebp, %esi
movq %rax, %rdx
callq 0x59fd1
movq 0x68(%rsp), %rax
movsd %xmm0, (%rax)
movl 0x44(%rsp), %esi
movq 0x70(%rsp), %rbx
movq %rbx, %rdi
movq %r15, %rdx
callq 0x59fd1
movq 0x80(%rsp), %rax
movsd %xmm0, (%rax)
movl 0x2c(%rsp), %esi
movq %r14, %rdi
callq 0x3915f
movl 0x44(%rsp), %esi
movq %rbx, %rdi
callq 0x3915f
movq %r15, %rax
addq $0x16e3f8, %rsp         # imm = 0x16E3F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %r15d, %r15d
jmp 0x5b2c4