// File: /workspace/github_c_makefile_star2_O3/olcaytaner[P]Isell/rule.c
// Function: write_condition
void write_condition(Decisionconditionptr condition)
{
	/*!Last Changed 29.01.2004*/
	/*!Last Changed 30.10.2003*/
	char st[10], pst[READLINELENGTH];
	int sindex, i, j, dim = current_dataset->multifeaturecount - 1;
	double newsplit;
	double newweight, *weights;
	weights = safecalloc(dim, sizeof(double), "write_condition", 5);
	if (condition->next != NULL)
		 strcpy(st," AND ");
	else
		 strcpy(st,"");
	if (condition->featureindex >= 0)
   switch (current_dataset->features[condition->featureindex].type)
			 { 
    	case INTEGER:fprintf(output,"F%d %c %d%s",condition->featureindex + 1, condition->comparison, (int)condition->value, st);
		  		            break;
   		case    REAL:if (!mustrealize)
  						            fprintf(output,"F%d %c %5.4f%s", condition->featureindex + 1, condition->comparison, condition->value, st);
						            else
																		 {
																			 newsplit = (double) (condition->value * sqrt(variance.values[condition->featureindex].floatvalue) + mean.values[condition->featureindex].floatvalue);
                    fprintf(output,"F%d %c %5.4f%s", condition->featureindex + 1, condition->comparison, newsplit, st);
																		 }
	  			            break;
   		case  STRING:sindex = (int) condition->value;
						            fprintf(output,"F%d %c %s%s",condition->featureindex + 1,condition->comparison,current_dataset->features[condition->featureindex].strings[sindex], st);
		  		            break;
	   }
	else
	 {
		 if (condition->featureindex == LINEAR)
			 {
     newsplit = (double) condition->w0;
		   for (i = 0; i < dim - 1; i++)
					 {
						 newweight = condition->w.values[0][i] / sqrt(variance.values[i].floatvalue);
							newsplit += (double) (mean.values[i].floatvalue * newweight);
							set_precision(pst, NULL, "F%d ");
			  	 fprintf(output, pst, newweight, i + 1);
					 }
					newweight = condition->w.values[0][i] / sqrt(variance.values[i].floatvalue);
					newsplit += (double) (mean.values[i].floatvalue * newweight);
			  set_precision(pst, NULL, NULL);
			  fprintf(output, pst, newweight);
					set_precision(pst, "F%d %c ", "%s");
			  fprintf(output, pst, dim, condition->comparison, newsplit, st);
			 }
			else
				 if (condition->featureindex == QUADRATIC)
					 {
						 sindex = 0;
       newsplit = (double) condition->w0;
   		  for (i = 0; i < dim; i++)
							  for (j = i; j < dim; j++)
									 {
										 newweight = condition->w.values[0][sindex] / sqrt(variance.values[i].floatvalue * variance.values[j].floatvalue);
											weights[i] -= newweight * mean.values[j].floatvalue;
											weights[j] -= newweight * mean.values[i].floatvalue;
											newsplit -= (double) (newweight * mean.values[i].floatvalue * mean.values[j].floatvalue);
           set_precision(pst, NULL, "F%dF%d ");
										 fprintf(output, pst, newweight, i + 1, j + 1);  
										 sindex++;
									 }
							for (i = 0; i < dim - 1; i++)
							 {								 
								 newweight = condition->w.values[0][sindex] / sqrt(variance.values[i].floatvalue);
								 weights[i] += newweight;
									newsplit += (double) (newweight * mean.values[i].floatvalue);
         set_precision(pst, NULL, "F%d ");
								 fprintf(output, pst, weights[i], i + 1);  
								 sindex++;
							 }
							newweight = condition->w.values[0][sindex] / sqrt(variance.values[i].floatvalue);
							weights[i] += newweight;
							newsplit += (double) (newweight * mean.values[i].floatvalue);
			    set_precision(pst, NULL, NULL);
       fprintf(output, pst, weights[i]);
			    set_precision(pst, "F%d %c ", "%s");
       fprintf(output, pst, i + 1, condition->comparison, newsplit, st);
					 }
		}
	safe_free(weights);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x7a188, %rsp          # imm = 0x7A188
movq %rdi, %r14
leaq 0x5a6a8(%rip), %rbx     # 0xd5870
movq (%rbx), %rax
movslq 0x1c0(%rax), %r15
leaq -0x1(%r15), %rdi
leaq 0x34b5f(%rip), %rdx     # 0xafd3c
movl $0x8, %esi
movq %rdi, 0x40(%rsp)
movl $0x5, %ecx
callq 0x3a1fc
movq %rax, 0x28(%rsp)
movq %r14, 0x8(%rsp)
cmpq $0x0, 0x48(%r14)
je 0x7b213
movw $0x20, 0x20(%rsp)
movl $0x444e4120, 0x1c(%rsp) # imm = 0x444E4120
jmp 0x7b218
movb $0x0, 0x1c(%rsp)
movq 0x8(%rsp), %rax
movslq (%rax), %rdx
testq %rdx, %rdx
js 0x7b283
movq (%rbx), %rax
imulq $0x340, %rdx, %rcx      # imm = 0x340
movl 0x30f08(%rax,%rcx), %esi
cmpl $0x2, %esi
je 0x7b3b2
cmpl $0x1, %esi
je 0x7b36d
testl %esi, %esi
jne 0x7b89e
leaq 0x336e51(%rip), %rax    # 0x3b20a8
movq (%rax), %rdi
incl %edx
movq 0x8(%rsp), %rax
movsbl 0x4(%rax), %ecx
cvttsd2si 0x8(%rax), %r8d
leaq 0x34ae0(%rip), %rsi     # 0xafd52
leaq 0x1c(%rsp), %r9
xorl %eax, %eax
callq 0x42e0
jmp 0x7b89e
cmpl $-0x3, %edx
je 0x7b3f2
cmpl $-0x2, %edx
jne 0x7b89e
movq 0x8(%rsp), %rax
movsd 0x30(%rax), %xmm0
movsd %xmm0, 0x10(%rsp)
cmpl $0x3, %r15d
jl 0x7b589
addl $-0x2, %r15d
movl %r15d, %ebx
xorl %r12d, %r12d
leaq 0x336ce8(%rip), %r15    # 0x3b1fa8
leaq 0x34abd(%rip), %r13     # 0xafd84
leaq 0x60(%rsp), %rbp
leaq 0x336dd5(%rip), %r14    # 0x3b20a8
movq 0x8(%rsp), %rax
movq 0x28(%rax), %rax
movq (%rax), %rax
movsd (%rax,%r12,8), %xmm0
movsd %xmm0, (%rsp)
leaq 0x336ce7(%rip), %rax    # 0x3b1fd8
movq (%rax), %rax
movsd (%rax,%r12,8), %xmm0
ucomisd 0x2aa06(%rip), %xmm0    # 0xa5d08
jb 0x7b30a
sqrtsd %xmm0, %xmm0
jmp 0x7b30f
callq 0x4300
movsd (%rsp), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, (%rsp)
movq (%r15), %rax
movsd (%rax,%r12,8), %xmm0
mulsd %xmm1, %xmm0
movsd 0x10(%rsp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, 0x10(%rsp)
movq %rbp, %rdi
xorl %esi, %esi
movq %r13, %rdx
callq 0x3a535
movq (%r14), %rdi
incq %r12
movq %rbp, %rsi
movsd (%rsp), %xmm0
movl %r12d, %edx
movb $0x1, %al
callq 0x42e0
cmpq %r12, %rbx
jne 0x7b2d3
jmp 0x7b58b
movq 0x8(%rsp), %r8
cvttsd2si 0x8(%r8), %esi
addq %rcx, %rax
addq $0x30f08, %rax          # imm = 0x30F08
leaq 0x336d20(%rip), %rcx    # 0x3b20a8
movq (%rcx), %rdi
incl %edx
movsbl 0x4(%r8), %ecx
movslq %esi, %rsi
movq 0x20(%rax,%rsi,8), %r8
leaq 0x349cc(%rip), %rsi     # 0xafd6d
leaq 0x1c(%rsp), %r9
xorl %eax, %eax
callq 0x42e0
jmp 0x7b89e
leaq 0x336beb(%rip), %rax    # 0x3b1fa4
cmpl $0x0, (%rax)
je 0x7b65f
movq 0x8(%rsp), %rax
movsd 0x8(%rax), %xmm2
leaq 0x336c05(%rip), %rax    # 0x3b1fd8
movq (%rax), %rax
movsd (%rax,%rdx,8), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x7b68a
sqrtsd %xmm0, %xmm0
jmp 0x7b699
movq 0x8(%rsp), %rax
movsd 0x30(%rax), %xmm0
movsd %xmm0, 0x10(%rsp)
cmpl $0x2, %r15d
jl 0x7b656
movq %r15, 0x30(%rsp)
movl 0x40(%rsp), %eax
movq %rax, 0x50(%rsp)
xorl %r15d, %r15d
movq 0x28(%rsp), %rbx
xorl %ebp, %ebp
xorl %eax, %eax
leaq 0x1(%rbp), %rcx
movq %rcx, 0x48(%rsp)
movq %rax, 0x38(%rsp)
cltq
movq %rax, 0x58(%rsp)
leaq (,%rax,8), %r13
xorl %r14d, %r14d
movq 0x8(%rsp), %rax
movq 0x28(%rax), %rax
movq (%rax), %rax
addq %r13, %rax
movsd (%rax,%r14,8), %xmm0
movsd %xmm0, (%rsp)
leaq 0x336b71(%rip), %rax    # 0x3b1fd8
movq (%rax), %rax
movsd (%rax,%rbp,8), %xmm0
addq %r15, %rax
mulsd (%rax,%r14,8), %xmm0
ucomisd 0x2a888(%rip), %xmm0    # 0xa5d08
jb 0x7b488
sqrtsd %xmm0, %xmm0
jmp 0x7b48d
callq 0x4300
movsd (%rsp), %xmm2
divsd %xmm0, %xmm2
movsd %xmm2, (%rsp)
leaq 0x336b06(%rip), %rax    # 0x3b1fa8
movq (%rax), %rax
leaq (%rax,%r15), %rcx
movq 0x28(%rsp), %rdx
movsd (%rdx,%rbp,8), %xmm0
movsd (%rcx,%r14,8), %xmm1
mulsd %xmm2, %xmm1
subsd %xmm1, %xmm0
movsd %xmm0, (%rdx,%rbp,8)
movsd (%rbx,%r14,8), %xmm0
movsd (%rax,%rbp,8), %xmm1
mulsd %xmm2, %xmm1
subsd %xmm1, %xmm0
movsd %xmm0, (%rbx,%r14,8)
movsd (%rax,%rbp,8), %xmm0
mulsd %xmm2, %xmm0
mulsd (%rcx,%r14,8), %xmm0
movsd 0x10(%rsp), %xmm1
subsd %xmm0, %xmm1
movsd %xmm1, 0x10(%rsp)
leaq 0x60(%rsp), %r12
movq %r12, %rdi
xorl %esi, %esi
leaq 0x34872(%rip), %rdx     # 0xafd81
callq 0x3a535
leaq 0x336b8d(%rip), %rax    # 0x3b20a8
movq (%rax), %rdi
leal (%r14,%rbp), %ecx
incl %ecx
movq %r12, %rsi
movsd (%rsp), %xmm0
movq 0x48(%rsp), %rdx
movb $0x1, %al
callq 0x42e0
incq %r14
leal (%r14,%rbp), %eax
cmpl %eax, 0x40(%rsp)
jg 0x7b446
addq $0x8, %rbx
addq $0x8, %r15
movq 0x58(%rsp), %rax
addq %r14, %rax
movq 0x48(%rsp), %rcx
movq %rcx, %rbp
cmpq 0x50(%rsp), %rcx
jne 0x7b426
movq 0x30(%rsp), %rax
cmpl $0x2, %eax
jne 0x7b6da
movslq 0x38(%rsp), %rax
addq %r14, %rax
xorl %edx, %edx
jmp 0x7b7c4
xorl %ebx, %ebx
movq 0x8(%rsp), %rax
movq 0x28(%rax), %rax
movq (%rax), %rax
movsd (%rax,%rbx,8), %xmm0
movsd %xmm0, (%rsp)
leaq 0x336a30(%rip), %rax    # 0x3b1fd8
movq (%rax), %rax
movsd (%rax,%rbx,8), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x7b5c0
sqrtsd %xmm0, %xmm0
jmp 0x7b5c5
callq 0x4300
movsd (%rsp), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, (%rsp)
leaq 0x3369ce(%rip), %rax    # 0x3b1fa8
movq (%rax), %rax
movsd (%rax,%rbx,8), %xmm0
mulsd %xmm1, %xmm0
addsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
leaq 0x60(%rsp), %r12
movq %r12, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3a535
leaq 0x336a9e(%rip), %rbx    # 0x3b20a8
movq (%rbx), %rdi
movq %r12, %rsi
movsd (%rsp), %xmm0
movb $0x1, %al
callq 0x42e0
leaq 0x34756(%rip), %rsi     # 0xafd79
leaq 0x2c926(%rip), %rdx     # 0xa7f50
movq %r12, %rdi
callq 0x3a535
movq (%rbx), %rdi
movq 0x8(%rsp), %rax
movsbl 0x4(%rax), %ecx
leaq 0x1c(%rsp), %r8
movq %r12, %rsi
movq 0x40(%rsp), %rdx
movsd 0x10(%rsp), %xmm0
jmp 0x7b897
xorl %edx, %edx
xorl %eax, %eax
jmp 0x7b7c4
leaq 0x336a42(%rip), %rax    # 0x3b20a8
movq (%rax), %rdi
incl %edx
movq 0x8(%rsp), %rax
movsbl 0x4(%rax), %ecx
movsd 0x8(%rax), %xmm0
leaq 0x346de(%rip), %rsi     # 0xafd5e
leaq 0x1c(%rsp), %r8
jmp 0x7b897
movsd %xmm2, (%rsp)
callq 0x4300
movsd (%rsp), %xmm2
mulsd %xmm0, %xmm2
leaq 0x336904(%rip), %rax    # 0x3b1fa8
movq (%rax), %rax
movq 0x8(%rsp), %rsi
movslq (%rsi), %rcx
addsd (%rax,%rcx,8), %xmm2
leaq 0x3369ed(%rip), %rax    # 0x3b20a8
movq (%rax), %rdi
leal 0x1(%rcx), %edx
movsbl 0x4(%rsi), %ecx
leaq 0x34692(%rip), %rsi     # 0xafd5e
leaq 0x1c(%rsp), %r8
movapd %xmm2, %xmm0
jmp 0x7b897
addl $-0x2, %eax
movq %rax, 0x30(%rsp)
movl %eax, %ebx
movq 0x38(%rsp), %rax
addl %r14d, %eax
movslq %eax, %rbp
shlq $0x3, %rbp
xorl %r15d, %r15d
leaq 0x60(%rsp), %r13
movq 0x28(%rsp), %r12
movq 0x8(%rsp), %rax
movq 0x28(%rax), %rax
movq (%rax), %rax
addq %rbp, %rax
movsd (%rax,%r15,8), %xmm1
leaq 0x3368bc(%rip), %rax    # 0x3b1fd8
movq (%rax), %rax
movsd (%rax,%r15,8), %xmm0
ucomisd 0x2a5db(%rip), %xmm0    # 0xa5d08
jb 0x7b735
sqrtsd %xmm0, %xmm0
jmp 0x7b744
movsd %xmm1, (%rsp)
callq 0x4300
movsd (%rsp), %xmm1
divsd %xmm0, %xmm1
movsd (%r12,%r15,8), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, (%r12,%r15,8)
leaq 0x336849(%rip), %rax    # 0x3b1fa8
movq (%rax), %rax
mulsd (%rax,%r15,8), %xmm1
movsd 0x10(%rsp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x10(%rsp)
movq %r13, %rdi
xorl %esi, %esi
leaq 0x34600(%rip), %rdx     # 0xafd84
callq 0x3a535
leaq 0x336918(%rip), %rax    # 0x3b20a8
movq (%rax), %rdi
movsd (%r12,%r15,8), %xmm0
incq %r15
movq %r13, %rsi
movl %r15d, %edx
movb $0x1, %al
callq 0x42e0
cmpq %r15, %rbx
jne 0x7b700
movq 0x38(%rsp), %rax
addl %r14d, %eax
cltq
addq %r15, %rax
movq 0x30(%rsp), %rdx
movq 0x8(%rsp), %rcx
movq 0x28(%rcx), %rcx
movq (%rcx), %rcx
cltq
movsd (%rcx,%rax,8), %xmm0
movsd %xmm0, (%rsp)
leaq 0x3367f5(%rip), %rax    # 0x3b1fd8
movq (%rax), %rax
movl %edx, %ebx
movsd (%rax,%rbx,8), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x7b7fd
sqrtsd %xmm0, %xmm0
jmp 0x7b802
callq 0x4300
movsd (%rsp), %xmm1
divsd %xmm0, %xmm1
movq 0x28(%rsp), %r12
movsd (%r12,%rbx,8), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, (%r12,%rbx,8)
leaq 0x336781(%rip), %rax    # 0x3b1fa8
movq (%rax), %rax
mulsd (%rax,%rbx,8), %xmm1
addsd 0x10(%rsp), %xmm1
movsd %xmm1, (%rsp)
leaq 0x60(%rsp), %r15
movq %r15, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3a535
leaq 0x336856(%rip), %r14    # 0x3b20a8
movq (%r14), %rdi
movsd (%r12,%rbx,8), %xmm0
movq %r15, %rsi
movb $0x1, %al
callq 0x42e0
leaq 0x3450d(%rip), %rsi     # 0xafd79
leaq 0x2c6dd(%rip), %rdx     # 0xa7f50
movq %r15, %rdi
callq 0x3a535
movq (%r14), %rdi
leal 0x1(%rbx), %edx
movq 0x8(%rsp), %rax
movsbl 0x4(%rax), %ecx
leaq 0x1c(%rsp), %r8
movq %r15, %rsi
movsd (%rsp), %xmm0
movb $0x1, %al
callq 0x42e0
movq 0x28(%rsp), %rdi
callq 0x3a180
addq $0x7a188, %rsp          # imm = 0x7A188
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq