// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x7a1a0, %rsp          # imm = 0x7A1A0
movq %rdi, -0x8(%rbp)
leaq 0x5938a(%rip), %rax     # 0x105840
movq (%rax), %rax
movl 0x1c0(%rax), %eax
subl $0x1, %eax
movl %eax, -0x7a150(%rbp)
movslq -0x7a150(%rbp), %rdi
movl $0x8, %esi
leaq 0x3ff71(%rip), %rdx     # 0xec44c
movl $0x5, %ecx
callq 0x52f40
movq %rax, -0x7a168(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x48(%rax)
je 0xac509
leaq -0x12(%rbp), %rdi
leaq 0x3ff5a(%rip), %rsi     # 0xec45c
callq 0x4220
jmp 0xac519
leaq -0x12(%rbp), %rdi
leaq 0x41ac6(%rip), %rsi     # 0xedfda
callq 0x4220
movq -0x8(%rbp), %rax
cmpl $0x0, (%rax)
jl 0xac6f7
leaq 0x59313(%rip), %rax     # 0x105840
movq (%rax), %rax
movq -0x8(%rbp), %rcx
movslq (%rcx), %rcx
imulq $0x340, %rcx, %rcx      # imm = 0x340
movl 0x30f08(%rax,%rcx), %eax
movl %eax, -0x7a16c(%rbp)
testl %eax, %eax
je 0xac572
jmp 0xac551
movl -0x7a16c(%rbp), %eax
subl $0x1, %eax
je 0xac689
jmp 0xac562
movl -0x7a16c(%rbp), %eax
subl $0x2, %eax
je 0xac5ae
jmp 0xac6f2
leaq 0x335aff(%rip), %rax    # 0x3e2078
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movl (%rax), %edx
addl $0x1, %edx
movq -0x8(%rbp), %rax
movsbl 0x4(%rax), %ecx
movq -0x8(%rbp), %rax
cvttsd2si 0x8(%rax), %r8d
leaq -0x12(%rbp), %r9
leaq 0x3fec0(%rip), %rsi     # 0xec462
movb $0x0, %al
callq 0x4280
jmp 0xac6f2
leaq 0x3359bf(%rip), %rax    # 0x3e1f74
cmpl $0x0, (%rax)
jne 0xac5f5
leaq 0x335ab7(%rip), %rax    # 0x3e2078
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movl (%rax), %edx
addl $0x1, %edx
movq -0x8(%rbp), %rax
movsbl 0x4(%rax), %ecx
movq -0x8(%rbp), %rax
movsd 0x8(%rax), %xmm0
leaq -0x12(%rbp), %r8
leaq 0x3fe85(%rip), %rsi     # 0xec46e
movb $0x1, %al
callq 0x4280
jmp 0xac687
movq -0x8(%rbp), %rax
movsd 0x8(%rax), %xmm0
movsd %xmm0, -0x7a178(%rbp)
leaq 0x33599b(%rip), %rax    # 0x3e1fa8
movq (%rax), %rax
movq -0x8(%rbp), %rcx
movslq (%rcx), %rcx
movsd (%rax,%rcx,8), %xmm0
callq 0x42a0
movaps %xmm0, %xmm2
movsd -0x7a178(%rbp), %xmm0
leaq 0x335945(%rip), %rax    # 0x3e1f78
movq (%rax), %rax
movq -0x8(%rbp), %rcx
movslq (%rcx), %rcx
movsd (%rax,%rcx,8), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x7a158(%rbp)
leaq 0x335a1f(%rip), %rax    # 0x3e2078
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movl (%rax), %edx
addl $0x1, %edx
movq -0x8(%rbp), %rax
movsbl 0x4(%rax), %ecx
movsd -0x7a158(%rbp), %xmm0
leaq -0x12(%rbp), %r8
leaq 0x3fdee(%rip), %rsi     # 0xec46e
movb $0x1, %al
callq 0x4280
jmp 0xac6f2
movq -0x8(%rbp), %rax
cvttsd2si 0x8(%rax), %eax
movl %eax, -0x7a144(%rbp)
leaq 0x3359d9(%rip), %rax    # 0x3e2078
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movl (%rax), %edx
addl $0x1, %edx
movq -0x8(%rbp), %rax
movsbl 0x4(%rax), %ecx
leaq 0x59186(%rip), %rax     # 0x105840
movq (%rax), %rax
addq $0x30f08, %rax          # imm = 0x30F08
movq -0x8(%rbp), %rsi
movslq (%rsi), %rsi
imulq $0x340, %rsi, %rsi      # imm = 0x340
addq %rsi, %rax
movslq -0x7a144(%rbp), %rsi
movq 0x20(%rax,%rsi,8), %r8
leaq -0x12(%rbp), %r9
leaq 0x3fd92(%rip), %rsi     # 0xec47d
movb $0x0, %al
callq 0x4280
jmp 0xacde2
movq -0x8(%rbp), %rax
cmpl $-0x2, (%rax)
jne 0xac91c
movq -0x8(%rbp), %rax
movsd 0x30(%rax), %xmm0
movsd %xmm0, -0x7a158(%rbp)
movl $0x0, -0x7a148(%rbp)
movl -0x7a148(%rbp), %eax
movl -0x7a150(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0xac811
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq (%rax), %rax
movslq -0x7a148(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x7a180(%rbp)
leaq 0x33584c(%rip), %rax    # 0x3e1fa8
movq (%rax), %rax
movslq -0x7a148(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
callq 0x42a0
movaps %xmm0, %xmm1
movsd -0x7a180(%rbp), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, -0x7a160(%rbp)
leaq 0x3357ea(%rip), %rax    # 0x3e1f78
movq (%rax), %rax
movslq -0x7a148(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd -0x7a160(%rbp), %xmm2
movsd -0x7a158(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x7a158(%rbp)
leaq -0x7a140(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
leaq 0x3fcc5(%rip), %rdx     # 0xec494
callq 0x53310
leaq 0x33589d(%rip), %rax    # 0x3e2078
movq (%rax), %rdi
leaq -0x7a140(%rbp), %rsi
movsd -0x7a160(%rbp), %xmm0
movl -0x7a148(%rbp), %edx
addl $0x1, %edx
movb $0x1, %al
callq 0x4280
movl -0x7a148(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x7a148(%rbp)
jmp 0xac71f
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq (%rax), %rax
movslq -0x7a148(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x7a188(%rbp)
leaq 0x335771(%rip), %rax    # 0x3e1fa8
movq (%rax), %rax
movslq -0x7a148(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
callq 0x42a0
movaps %xmm0, %xmm1
movsd -0x7a188(%rbp), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, -0x7a160(%rbp)
leaq 0x33570f(%rip), %rax    # 0x3e1f78
movq (%rax), %rax
movslq -0x7a148(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd -0x7a160(%rbp), %xmm2
movsd -0x7a158(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x7a158(%rbp)
leaq -0x7a140(%rbp), %rdi
xorl %eax, %eax
movl %eax, %edx
movq %rdx, %rsi
callq 0x53310
leaq 0x3357c6(%rip), %rax    # 0x3e2078
movq (%rax), %rdi
leaq -0x7a140(%rbp), %rsi
movsd -0x7a160(%rbp), %xmm0
movb $0x1, %al
callq 0x4280
leaq -0x7a140(%rbp), %rdi
leaq 0x3fbb0(%rip), %rsi     # 0xec489
leaq 0x381b8(%rip), %rdx     # 0xe4a98
callq 0x53310
leaq 0x33578c(%rip), %rax    # 0x3e2078
movq (%rax), %rdi
leaq -0x7a140(%rbp), %rsi
movl -0x7a150(%rbp), %edx
movq -0x8(%rbp), %rax
movsbl 0x4(%rax), %ecx
movsd -0x7a158(%rbp), %xmm0
leaq -0x12(%rbp), %r8
movb $0x1, %al
callq 0x4280
jmp 0xacde0
movq -0x8(%rbp), %rax
cmpl $-0x3, (%rax)
jne 0xacdde
movl $0x0, -0x7a144(%rbp)
movq -0x8(%rbp), %rax
movsd 0x30(%rax), %xmm0
movsd %xmm0, -0x7a158(%rbp)
movl $0x0, -0x7a148(%rbp)
movl -0x7a148(%rbp), %eax
cmpl -0x7a150(%rbp), %eax
jge 0xacb74
movl -0x7a148(%rbp), %eax
movl %eax, -0x7a14c(%rbp)
movl -0x7a14c(%rbp), %eax
cmpl -0x7a150(%rbp), %eax
jge 0xacb5e
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq (%rax), %rax
movslq -0x7a144(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x7a190(%rbp)
leaq 0x335604(%rip), %rax    # 0x3e1fa8
movq (%rax), %rax
movslq -0x7a148(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
leaq 0x3355ee(%rip), %rax    # 0x3e1fa8
movq (%rax), %rax
movslq -0x7a14c(%rbp), %rcx
mulsd (%rax,%rcx,8), %xmm0
callq 0x42a0
movaps %xmm0, %xmm1
movsd -0x7a190(%rbp), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, -0x7a160(%rbp)
movsd -0x7a160(%rbp), %xmm0
leaq 0x335584(%rip), %rax    # 0x3e1f78
movq (%rax), %rax
movslq -0x7a14c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm2
movq -0x7a168(%rbp), %rax
movslq -0x7a148(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm1
movq %xmm0, %rdx
movabsq $-0x8000000000000000, %rsi # imm = 0x8000000000000000
xorq %rsi, %rdx
movq %rdx, %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movsd -0x7a160(%rbp), %xmm0
leaq 0x33552f(%rip), %rax    # 0x3e1f78
movq (%rax), %rax
movslq -0x7a148(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm2
movq -0x7a168(%rbp), %rax
movslq -0x7a14c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm1
movq %xmm0, %rdx
movabsq $-0x8000000000000000, %rsi # imm = 0x8000000000000000
xorq %rsi, %rdx
movq %rdx, %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movsd -0x7a160(%rbp), %xmm0
leaq 0x3354da(%rip), %rax    # 0x3e1f78
movq (%rax), %rax
movslq -0x7a148(%rbp), %rcx
mulsd (%rax,%rcx,8), %xmm0
leaq 0x3354c4(%rip), %rax    # 0x3e1f78
movq (%rax), %rax
movslq -0x7a14c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm2
movsd -0x7a158(%rbp), %xmm1
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x7a158(%rbp)
leaq -0x7a140(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
leaq 0x3f98d(%rip), %rdx     # 0xec491
callq 0x53310
leaq 0x335568(%rip), %rax    # 0x3e2078
movq (%rax), %rdi
leaq -0x7a140(%rbp), %rsi
movsd -0x7a160(%rbp), %xmm0
movl -0x7a148(%rbp), %edx
addl $0x1, %edx
movl -0x7a14c(%rbp), %ecx
addl $0x1, %ecx
movb $0x1, %al
callq 0x4280
movl -0x7a144(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x7a144(%rbp)
movl -0x7a14c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x7a14c(%rbp)
jmp 0xac96c
jmp 0xacb60
movl -0x7a148(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x7a148(%rbp)
jmp 0xac94e
movl $0x0, -0x7a148(%rbp)
movl -0x7a148(%rbp), %eax
movl -0x7a150(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0xaccaa
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq (%rax), %rax
movslq -0x7a144(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x7a198(%rbp)
leaq 0x3353ed(%rip), %rax    # 0x3e1fa8
movq (%rax), %rax
movslq -0x7a148(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
callq 0x42a0
movaps %xmm0, %xmm1
movsd -0x7a198(%rbp), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, -0x7a160(%rbp)
movsd -0x7a160(%rbp), %xmm0
movq -0x7a168(%rbp), %rax
movslq -0x7a148(%rbp), %rcx
addsd (%rax,%rcx,8), %xmm0
movsd %xmm0, (%rax,%rcx,8)
movsd -0x7a160(%rbp), %xmm0
leaq 0x335363(%rip), %rax    # 0x3e1f78
movq (%rax), %rax
movslq -0x7a148(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm2
movsd -0x7a158(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x7a158(%rbp)
leaq -0x7a140(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
leaq 0x3f846(%rip), %rdx     # 0xec494
callq 0x53310
leaq 0x33541e(%rip), %rax    # 0x3e2078
movq (%rax), %rdi
leaq -0x7a140(%rbp), %rsi
movq -0x7a168(%rbp), %rax
movslq -0x7a148(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movl -0x7a148(%rbp), %edx
addl $0x1, %edx
movb $0x1, %al
callq 0x4280
movl -0x7a144(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x7a144(%rbp)
movl -0x7a148(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x7a148(%rbp)
jmp 0xacb7e
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq (%rax), %rax
movslq -0x7a144(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x7a1a0(%rbp)
leaq 0x3352d8(%rip), %rax    # 0x3e1fa8
movq (%rax), %rax
movslq -0x7a148(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
callq 0x42a0
movaps %xmm0, %xmm1
movsd -0x7a1a0(%rbp), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, -0x7a160(%rbp)
movsd -0x7a160(%rbp), %xmm0
movq -0x7a168(%rbp), %rax
movslq -0x7a148(%rbp), %rcx
addsd (%rax,%rcx,8), %xmm0
movsd %xmm0, (%rax,%rcx,8)
movsd -0x7a160(%rbp), %xmm0
leaq 0x33524e(%rip), %rax    # 0x3e1f78
movq (%rax), %rax
movslq -0x7a148(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm2
movsd -0x7a158(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x7a158(%rbp)
leaq -0x7a140(%rbp), %rdi
xorl %eax, %eax
movl %eax, %edx
movq %rdx, %rsi
callq 0x53310
leaq 0x33530d(%rip), %rax    # 0x3e2078
movq (%rax), %rdi
leaq -0x7a140(%rbp), %rsi
movq -0x7a168(%rbp), %rax
movslq -0x7a148(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movb $0x1, %al
callq 0x4280
leaq -0x7a140(%rbp), %rdi
leaq 0x3f6ec(%rip), %rsi     # 0xec489
leaq 0x37cf4(%rip), %rdx     # 0xe4a98
callq 0x53310
leaq 0x3352c8(%rip), %rax    # 0x3e2078
movq (%rax), %rdi
leaq -0x7a140(%rbp), %rsi
movl -0x7a148(%rbp), %edx
addl $0x1, %edx
movq -0x8(%rbp), %rax
movsbl 0x4(%rax), %ecx
movsd -0x7a158(%rbp), %xmm0
leaq -0x12(%rbp), %r8
movb $0x1, %al
callq 0x4280
jmp 0xacde0
jmp 0xacde2
movq -0x7a168(%rbp), %rdi
callq 0x52e80
addq $0x7a1a0, %rsp          # imm = 0x7A1A0
popq %rbp
retq
nopw (%rax,%rax)