// File: /workspace/github_c_makefile_star2_O2/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 0xb887d(%rip), %rax     # 0xcd878
movq (%rax), %rdi
movq %r14, %rsi
callq 0x13da6
testq %rax, %rax
je 0x15241
movq %rax, %rbx
movb 0x1a8(%rax), %al
movb %al, 0xe(%rsp)
movb $0x0, 0xf(%rsp)
movq %rbx, %rdi
callq 0x14f75
leaq 0x8684f(%rip), %rsi     # 0x9b87f
movq %rax, 0x18(%rsp)
movq %rax, %rdi
callq 0x40f0
movq %rax, 0x10(%rsp)
testq %rax, %rax
je 0x15277
leaq 0x30f08(%rbx), %r15
movslq 0x1bc(%rbx), %rax
movq %rbx, %rcx
addq $0x30f20, %rcx          # imm = 0x30F20
xorl %edx, %edx
leaq 0x813ec(%rip), %rsi     # 0x96458
movapd 0x8149c(%rip), %xmm0    # 0x96510
cmpq %rax, %rdx
jge 0x150b1
movl -0x18(%rcx), %edi
cmpq $0x4, %rdi
ja 0x150a5
movslq (%rsi,%rdi,4), %rdi
addq %rsi, %rdi
jmpq *%rdi
movupd %xmm0, -0x10(%rcx)
jmp 0x150a5
andl $0x0, (%rcx)
jmp 0x150a5
movl $0x80000001, -0x8(%rcx) # imm = 0x80000001
movl $0x7fffffff, -0x10(%rcx) # imm = 0x7FFFFFFF
incq %rdx
addq $0x340, %rcx            # imm = 0x340
jmp 0x15074
xorl %eax, %eax
leaq 0x20(%rsp), %r14
leaq 0xe(%rsp), %r12
movl %eax, 0x1407120(%rbx)
movq %r14, %rdi
movl $0x7a120, %esi          # imm = 0x7A120
movq 0x10(%rsp), %rdx
callq 0x4120
testq %rax, %rax
je 0x15263
movq %r14, %rdi
callq 0x4190
movb $0x0, -0x1(%rax,%r14)
movq %r14, %rdi
movq %r12, %rsi
callq 0x4280
cmpl $0x2, 0x140713c(%rbx)
jne 0x1511f
xorl %edi, %edi
movq %r12, %rsi
callq 0x4280
xorl %edi, %edi
movq %r12, %rsi
callq 0x4280
movq %rax, %r14
pushq $0x1
popq %rbp
jmp 0x15226
movq %rax, %r14
xorl %ebp, %ebp
jmp 0x15226
movslq %ebp, %rax
imulq $0x340, %rax, %r13      # imm = 0x340
movl (%r15,%r13), %eax
cmpq $0x4, %rax
ja 0x151ff
addq %r15, %r13
leaq 0x812f9(%rip), %rcx     # 0x96444
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %r14, %rdi
callq 0x3567d
testl %eax, %eax
je 0x15277
movq %r14, %rdi
callq 0x4130
movsd 0x8(%r13), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x151e5
movsd %xmm0, 0x8(%r13)
jmp 0x151ff
leaq 0x20(%r13), %rsi
movl 0x18(%r13), %edx
movq %r14, %rdi
callq 0x35f17
cmpl $-0x1, %eax
jne 0x151ff
movslq 0x18(%r13), %rax
movq 0x20(%r13,%rax,8), %rdi
movq %r14, %rsi
callq 0x3604c
movslq 0x18(%r13), %rcx
leal 0x1(%rcx), %edx
movq %rax, 0x20(%r13,%rcx,8)
movl %edx, 0x18(%r13)
cmpq $0x64, %rcx
jl 0x151ff
jmp 0x15289
movq %r14, %rdi
callq 0x356ca
testl %eax, %eax
je 0x15277
movq %r14, %rdi
callq 0x4200
cmpl 0x8(%r13), %eax
jge 0x151f5
movl %eax, 0x8(%r13)
jmp 0x151ff
ucomisd 0x10(%r13), %xmm0
jbe 0x151ff
movsd %xmm0, 0x10(%r13)
jmp 0x151ff
cmpl 0x10(%r13), %eax
jle 0x151ff
movl %eax, 0x10(%r13)
xorl %edi, %edi
movq %r12, %rsi
callq 0x4280
movq %rax, %r14
incl %ebp
cmpl $0x2, 0x140713c(%rbx)
jne 0x15226
pushq $0x1
popq %rax
cmpl 0x1bc(%rbx), %ebp
je 0x15224
movl %ebp, %eax
movl %eax, %ebp
testq %r14, %r14
jne 0x15129
movl 0x1407120(%rbx), %eax
incl %eax
leaq 0x20(%rsp), %r14
jmp 0x150bd
leaq 0x81686(%rip), %rdi     # 0x968ce
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
movq 0x10(%rsp), %rdi
callq 0x42a0
movq 0x18(%rsp), %rdi
callq 0x34ff7
addq $0x7a148, %rsp          # imm = 0x7A148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
incl %ebp
leaq 0x81657(%rip), %rdi     # 0x968e9
movl %ebp, %esi
xorl %eax, %eax
callq 0x4030
xorl %edi, %edi
callq 0x40c0