// File: /workspace/github_c_makefile_star2_O3/olcaytaner[P]Isell/dataset.c
// Function: extract_definitions_of_dataset
void extract_definitions_of_dataset(char* datasetname)
{
 /*!Last Changed 09.05.2008 added time variant datasets*/
 /*!Last Changed 02.04.2005*/
 /*!Last Changed 31.01.2004*/
 Datasetptr tmp;
 int i, tmpi, framecount;
 FILE* infile;
 char* fname, myline[READLINELENGTH], *st, separators[2];
 double tmpf;
 tmp = search_dataset(Datasets, datasetname);
 if (!tmp)
  {
   printf(m1259, datasetname);
   return;
  }
 sprintf(separators,"%c",tmp->separator);
 fname = dataset_file_name(tmp);
 infile = fopen(fname, "r");
 if (!infile)
   return;
 for (i = 0; i < tmp->featurecount; i++)
   switch (tmp->features[i].type)
    {
     case  INTEGER:tmp->features[i].max.intvalue = -INT_MAX;
                   tmp->features[i].min.intvalue = +INT_MAX;
                   break;
     case     REAL:
     case   REGDEF:tmp->features[i].max.floatvalue = (double) -INT_MAX;
                   tmp->features[i].min.floatvalue = (double) +INT_MAX;
                   break;
     case   STRING:tmp->features[i].valuecount = 0;
                   break;
    }
 tmp->datacount = 0;
 while (fgets(myline, READLINELENGTH, infile))
  {
   myline[strlen(myline) - 1] = '\0';
   st = strtok(myline, separators);
   i = 0;
   if (tmp->storetype == STORE_SEQUENTIAL)
    {
     st = strtok(NULL, separators);
     framecount = atoi(st);
     st = strtok(NULL, separators);
     i++;
    }
   while (st)
    {
     switch (tmp->features[i].type)
      {
       case INTEGER:if (isinteger(st))
                     {
                      tmpi = atoi(st);
                      if (tmpi < tmp->features[i].min.intvalue)
                        tmp->features[i].min.intvalue = tmpi;
                      else
                        if (tmpi > tmp->features[i].max.intvalue)
                          tmp->features[i].max.intvalue = tmpi;
                     }
                    else                      
                      return;
                    break;
       case    REAL:
       case  REGDEF:if (isfloat(st))
                     {
                      tmpf = (double) atof(st);
                      if (tmpf < tmp->features[i].min.floatvalue)
                        tmp->features[i].min.floatvalue = tmpf;
                      else
                        if (tmpf > tmp->features[i].max.floatvalue)
                          tmp->features[i].max.floatvalue = tmpf;
                     }
                    else
                      return;
                    break;
       case  STRING:if (listindex(st, tmp->features[i].strings, tmp->features[i].valuecount) == -1)
                     {
                      tmp->features[i].strings[tmp->features[i].valuecount] = strcopy(tmp->features[i].strings[tmp->features[i].valuecount], st);
                      (tmp->features[i].valuecount)++;
                      if (tmp->features[i].valuecount > MAXVALUES)
                       {
                        printf(m1420, i + 1);
                        exit(0);
                       }
                     }
                    break;  
      }
     st = strtok(NULL, separators);
     i++;
     if (tmp->storetype == STORE_SEQUENTIAL && i == tmp->featurecount)
       i = 1;
    }
   (tmp->datacount)++;
  }
 fclose(infile);
 safe_free(fname);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x7a148, %rsp          # imm = 0x7A148
movq %rdi, %r14
leaq 0xbf2ae(%rip), %rax     # 0xd5878
movq (%rax), %rbx
testq %rbx, %rbx
je 0x165eb
movq 0x8(%rbx), %rdi
movq %r14, %rsi
callq 0x4260
testl %eax, %eax
je 0x1660d
movq 0x1407270(%rbx), %rbx
jmp 0x165cd
leaq 0x9033c(%rip), %rdi     # 0xa692e
movq %r14, %rsi
xorl %eax, %eax
addq $0x7a148, %rsp          # imm = 0x7A148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4030
movb 0x1a8(%rbx), %al
movb %al, 0xe(%rsp)
movb $0x0, 0xf(%rsp)
movq %rbx, %rdi
callq 0x16542
leaq 0x95330(%rip), %rsi     # 0xab95b
movq %rax, 0x18(%rsp)
movq %rax, %rdi
callq 0x40f0
movq %rax, 0x10(%rsp)
testq %rax, %rax
je 0x1686d
movslq 0x1bc(%rbx), %rax
testq %rax, %rax
jle 0x166a8
leaq 0x30f20(%rbx), %rcx
xorl %edx, %edx
leaq 0x8fe62(%rip), %rsi     # 0xa64c4
movapd 0x8fe36(%rip), %xmm0    # 0xa64a0
movl -0x18(%rcx), %edi
cmpq $0x4, %rdi
ja 0x16699
movslq (%rsi,%rdi,4), %rdi
addq %rsi, %rdi
jmpq *%rdi
movupd %xmm0, -0x10(%rcx)
jmp 0x16699
movl $0x0, (%rcx)
jmp 0x16699
movl $0x80000001, -0x8(%rcx) # imm = 0x80000001
movl $0x7fffffff, -0x10(%rcx) # imm = 0x7FFFFFFF
incq %rdx
addq $0x340, %rcx            # imm = 0x340
cmpq %rax, %rdx
jb 0x1666a
movl $0x0, 0x1407120(%rbx)
leaq 0x20(%rsp), %r14
movq %r14, %rdi
movl $0x7a120, %esi          # imm = 0x7A120
movq 0x10(%rsp), %rdx
callq 0x4120
testq %rax, %rax
je 0x16859
leaq 0x30f08(%rbx), %r15
leaq 0xe(%rsp), %r12
movq %r14, %rdi
callq 0x4190
movb $0x0, -0x1(%rax,%r14)
movq %r14, %rdi
movq %r12, %rsi
callq 0x4280
cmpl $0x2, 0x140713c(%rbx)
jne 0x16721
xorl %edi, %edi
movq %r12, %rsi
callq 0x4280
xorl %edi, %edi
movq %r12, %rsi
callq 0x4280
movq %rax, %r14
movl $0x1, %ebp
jmp 0x1682a
movq %rax, %r14
xorl %ebp, %ebp
jmp 0x1682a
movslq %ebp, %rax
imulq $0x340, %rax, %r13      # imm = 0x340
movl (%r15,%r13), %eax
cmpq $0x4, %rax
ja 0x16801
addq %r15, %r13
leaq 0x8fd8b(%rip), %rcx     # 0xa64d8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %r14, %rdi
callq 0x3a8ed
testl %eax, %eax
je 0x1686d
movq %r14, %rdi
callq 0x4130
movsd 0x8(%r13), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x167e7
movsd %xmm0, 0x8(%r13)
jmp 0x16801
leaq 0x20(%r13), %rsi
movl 0x18(%r13), %edx
movq %r14, %rdi
callq 0x3b355
cmpl $-0x1, %eax
jne 0x16801
movslq 0x18(%r13), %rax
movq 0x20(%r13,%rax,8), %rdi
movq %r14, %rsi
callq 0x3b494
movslq 0x18(%r13), %rcx
leal 0x1(%rcx), %edx
movq %rax, 0x20(%r13,%rcx,8)
movl %edx, 0x18(%r13)
cmpq $0x64, %rcx
jl 0x16801
jmp 0x1687f
movq %r14, %rdi
callq 0x3a938
testl %eax, %eax
je 0x1686d
movq %r14, %rdi
callq 0x4200
cmpl 0x8(%r13), %eax
jge 0x167f7
movl %eax, 0x8(%r13)
jmp 0x16801
ucomisd 0x10(%r13), %xmm0
jbe 0x16801
movsd %xmm0, 0x10(%r13)
jmp 0x16801
cmpl 0x10(%r13), %eax
jle 0x16801
movl %eax, 0x10(%r13)
xorl %edi, %edi
movq %r12, %rsi
callq 0x4280
movq %rax, %r14
incl %ebp
cmpl $0x2, 0x140713c(%rbx)
jne 0x1682a
movl $0x1, %eax
cmpl 0x1bc(%rbx), %ebp
je 0x16828
movl %ebp, %eax
movl %eax, %ebp
testq %r14, %r14
jne 0x1672b
incl 0x1407120(%rbx)
leaq 0x20(%rsp), %r14
movq %r14, %rdi
movl $0x7a120, %esi          # imm = 0x7A120
movq 0x10(%rsp), %rdx
callq 0x4120
testq %rax, %rax
jne 0x166de
movq 0x10(%rsp), %rdi
callq 0x42a0
movq 0x18(%rsp), %rdi
callq 0x3a180
addq $0x7a148, %rsp          # imm = 0x7A148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
incl %ebp
leaq 0x900c1(%rip), %rdi     # 0xa6949
movl %ebp, %esi
xorl %eax, %eax
callq 0x4030
xorl %edi, %edi
callq 0x40c0