// File: /workspace/github_c_makefile_star2_O3/olcaytaner[P]Isell/dataset.c
// Function: export_subset_of_features
void export_subset_of_features(Datasetptr d, Instanceptr list, int featurecount, char* outfilename)
{
 /*!Last Changed 14.03.2007*/
 int bound, *selected, i;
 FILE* outfile;
 outfile = fopen(outfilename, "w");
 if (!outfile)
   return;
 selected = random_array(d->featurecount);
 /* If the class definition feature is in the selected feature list, increment bound so that exactly featurecount features will be selected*/
 if (selected[d->classdefno] < featurecount)
   bound = featurecount + 1;
 else
   bound = featurecount;
 for (i = 0; i < d->featurecount; i++)
   if (i != d->classdefno)
    {
     if (selected[i] < bound)
       d->features[i].selected = YES;
     else
       d->features[i].selected = NO;
    }
   else
     d->features[i].selected = YES;
 print_instance_list(outfile, d->separator, d, list);
 fclose(outfile);
 for (i = 0; i < d->featurecount; i++)
   d->features[i].selected = YES;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x98d19(%rip), %rsi     # 0xab96d
movq %rcx, %rdi
callq 0x40f0
testq %rax, %rax
je 0x12e1b
movq %rax, %r15
movl 0x1bc(%rbx), %edi
callq 0x3afe4
movslq 0x1407128(%rbx), %rsi
xorl %ecx, %ecx
cmpl %ebp, (%rax,%rsi,4)
setl %dil
movslq 0x1bc(%rbx), %rdx
testq %rdx, %rdx
jle 0x12ce3
movl %esi, %esi
movb %dil, %cl
addl %ebp, %ecx
imulq $0x340, %rsi, %rdi      # imm = 0x340
addq %rbx, %rdi
addq $0x30f24, %rdi          # imm = 0x30F24
leaq 0x30f24(%rbx), %r8
xorl %r9d, %r9d
cmpq %r9, %rsi
jne 0x12cbe
movl $0x1, (%rdi)
jmp 0x12cd4
cmpl %ecx, (%rax,%r9,4)
jge 0x12ccd
movl $0x1, (%r8)
jmp 0x12cd4
movl $0x0, (%r8)
incq %r9
addq $0x340, %r8             # imm = 0x340
cmpq %r9, %rdx
jne 0x12cb1
movsbl 0x1a8(%rbx), %esi
movq %r15, %rdi
movq %rbx, %rdx
movq %r14, %rcx
callq 0x304a2
movq %r15, %rdi
callq 0x42a0
movslq 0x1bc(%rbx), %rax
testq %rax, %rax
jle 0x12e1b
leal 0x3(%rax), %ecx
decq %rax
movq %rax, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
shrl $0x2, %ecx
imulq $0xd00, %rcx, %rax      # imm = 0xD00
movdqa 0x936fe(%rip), %xmm1    # 0xa6430
movdqa 0x93706(%rip), %xmm2    # 0xa6440
xorl %ecx, %ecx
movdqa 0x9370c(%rip), %xmm3    # 0xa6450
pxor %xmm3, %xmm0
pcmpeqd %xmm4, %xmm4
movdqa 0x9370c(%rip), %xmm5    # 0xa6460
movdqa %xmm2, %xmm6
pxor %xmm3, %xmm6
movdqa %xmm6, %xmm7
pcmpgtd %xmm0, %xmm7
pcmpeqd %xmm0, %xmm6
pshufd $0xf5, %xmm6, %xmm8     # xmm8 = xmm6[1,1,3,3]
pand %xmm7, %xmm8
pshufd $0xf5, %xmm7, %xmm6     # xmm6 = xmm7[1,1,3,3]
por %xmm8, %xmm6
movd %xmm6, %edx
notl %edx
testb $0x1, %dl
je 0x12d93
movl $0x1, 0x30f24(%rbx,%rcx)
pxor %xmm4, %xmm6
pextrw $0x4, %xmm6, %edx
testb $0x1, %dl
je 0x12dac
movl $0x1, 0x31264(%rbx,%rcx)
movdqa %xmm1, %xmm6
pxor %xmm3, %xmm6
movdqa %xmm6, %xmm7
pcmpgtd %xmm0, %xmm7
pcmpeqd %xmm0, %xmm6
pshufd $0xf5, %xmm6, %xmm8     # xmm8 = xmm6[1,1,3,3]
pand %xmm7, %xmm8
pshufd $0xf5, %xmm7, %xmm6     # xmm6 = xmm7[1,1,3,3]
por %xmm8, %xmm6
pxor %xmm4, %xmm6
pextrw $0x0, %xmm6, %edx
testb $0x1, %dl
je 0x12dee
movl $0x1, 0x315a4(%rbx,%rcx)
pextrw $0x4, %xmm6, %edx
testb $0x1, %dl
je 0x12e03
movl $0x1, 0x318e4(%rbx,%rcx)
paddq %xmm5, %xmm2
paddq %xmm5, %xmm1
addq $0xd00, %rcx            # imm = 0xD00
cmpq %rcx, %rax
jne 0x12d54
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq