// File: /workspace/github_c_makefile_star2_O2/olcaytaner[P]Isell/parameter.c
// Function: read_program_parameters
BOOLEAN read_program_parameters()
{
 /*!Last Changed 04.03.2009*/
 /*!Last Changed 08.08.2007*/
 Xmldocumentptr doc;
 Xmlelementptr xmlparameter, xmlvalue;
 int i, j, index;
 char *st;
 doc = xml_document("parameters.xml");
 if (!doc)
  {
   printf(m1429);
   return BOOLEAN_FALSE;
  }
 if (!xml_parse(doc))
   return BOOLEAN_FALSE;
 parametercount = xml_number_of_children(doc->root);
 parameters = safemalloc(parametercount * sizeof(Parameter), "read_program_parameters", 8);
 xmlparameter = doc->root->child;
 i = 0;
 while (xmlparameter)
  {
   st = xml_get_attribute_value(xmlparameter, "name");
   if (st)
     parameters[i].name = strcopy(parameters[i].name, st);
   else
     parameters[i].name = NULL;
   st = xml_get_attribute_value(xmlparameter, "type");
   if (st)
     parameters[i].type = listindex(st, parameter_types, MAX_PARAMETER_TYPE);
   else
     parameters[i].type = INTEGER_PARAMETER;
   st = xml_get_attribute_value(xmlparameter, "value");
   switch (parameters[i].type)
    {
     case INTEGER_PARAMETER:if (st)
                              atoi_check(st, &(parameters[i].value.intvalue), -INT_MAX, +INT_MAX);
                            else
                              parameters[i].value.intvalue = 0;
                            break;
     case   FLOAT_PARAMETER:if (st)
                              atof_check(st, &(parameters[i].value.floatvalue), -DBL_MAX, +DBL_MAX);
                            else
                              parameters[i].value.floatvalue = 0.0;
                            break;
     case   ONOFF_PARAMETER:index = listindex(st, onoff_type, 2);
                            if (index != -1)
                              parameters[i].value.onoffvalue = 1 - index;
                            break;
     case  STRING_PARAMETER:if (st != NULL)
                              parameters[i].value.stringvalue = strcopy(parameters[i].value.stringvalue, st);
                            else
                              parameters[i].value.stringvalue = NULL;
                            break;
     case   ARRAY_PARAMETER:st = xml_get_attribute_value(xmlparameter, "size");
                            if (st)
                              atoi_check(st, &(parameters[i].arraysize), 1, +INT_MAX);
                            else
                              parameters[i].arraysize = 0;
                            st = xml_get_attribute_value(xmlparameter, "subtype");
                            if (st)
                             {
                              switch (listindex(st, parameter_types, MAX_PARAMETER_TYPE)){
                                case INTEGER_PARAMETER:parameters[i].value.arrayvalue = (int*) safemalloc(parameters[i].arraysize * sizeof(int), "read_program_parameters", 73);
                                                       st = xml_get_attribute_value(xmlparameter, "value");
                                                       for (j = 0; j < parameters[i].arraysize; j++)
                                                           ((int *)(parameters[i].value.arrayvalue))[j] = atoi(st);
                                                       break;
                                case   FLOAT_PARAMETER:parameters[i].value.arrayvalue = (double*) safemalloc(parameters[i].arraysize * sizeof(double), "read_program_parameters", 78);
                                                       st = xml_get_attribute_value(xmlparameter, "value");
                                                       for (j = 0; j < parameters[i].arraysize; j++)
                                                           ((double *)(parameters[i].value.arrayvalue))[j] = atof(st);
                                                       break;
                              }
                             }
                            break;
     case    LIST_PARAMETER:parameters[i].arraysize = xml_number_of_children(xmlparameter);
                            parameters[i].listvalues = safemalloc(parameters[i].arraysize * sizeof(char*), "read_program_parameters", 54);
                            xmlvalue = xmlparameter->child;
                            j = 0;
                            while (xmlvalue)
                             {
                              parameters[i].listvalues[j] = strcopy(parameters[i].listvalues[j], xmlvalue->pcdata);
                              xmlvalue = xmlvalue->sibling;
                              j++;
                             }
                            parameters[i].value.listvalue = listindex(st, parameters[i].listvalues, parameters[i].arraysize); 
                            break;
    }     
   xmlparameter = xmlparameter->sibling;
   i++;
  }
 xml_free_document(doc);
 return BOOLEAN_TRUE;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x4859e(%rip), %rdi     # 0x95772
callq 0x93f7c
testq %rax, %rax
je 0x4d5ae
movq %rax, %rbx
movq %rax, %rdi
callq 0x94657
testl %eax, %eax
je 0x4d5ba
movq 0x8(%rbx), %rdi
callq 0x944ea
movl %eax, 0x802e4(%rip)     # 0xcd4e8
movslq %eax, %rdi
shlq $0x5, %rdi
leaq 0x4d884(%rip), %rsi     # 0x9aa96
pushq $0x8
popq %rdx
callq 0x34f59
movq %rax, 0x802cf(%rip)     # 0xcd4f0
movq %rbx, (%rsp)
movq 0x8(%rbx), %r15
addq $0x20, %r15
xorl %r13d, %r13d
movq (%r15), %r15
testq %r15, %r15
je 0x4d5a0
movq %r15, %rdi
leaq 0x5185e(%rip), %rsi     # 0x9eaa4
callq 0x94309
movq %r13, %r12
shlq $0x5, %r12
movq 0x80297(%rip), %rcx     # 0xcd4f0
addq %r12, %rcx
testq %rax, %rax
je 0x4d279
movq (%rcx), %rdi
movq %rax, %rsi
callq 0x3604c
movq 0x8027d(%rip), %rcx     # 0xcd4f0
movq %rax, (%rcx,%r12)
jmp 0x4d27d
andq $0x0, (%rcx)
movq %r15, %rdi
leaq 0x4a2ed(%rip), %rsi     # 0x97574
callq 0x94309
testq %rax, %rax
je 0x4d2a5
movq %rax, %rdi
leaq 0x7fd85(%rip), %rsi     # 0xcd020
pushq $0x6
popq %rdx
callq 0x35f17
jmp 0x4d2a7
xorl %eax, %eax
movq 0x80242(%rip), %rcx     # 0xcd4f0
movl %eax, 0x8(%rcx,%r12)
movq %r15, %rdi
leaq 0x4c558(%rip), %rsi     # 0x99815
callq 0x94309
movq %rax, %rbx
movq 0x80224(%rip), %rsi     # 0xcd4f0
movl 0x8(%rsi,%r12), %eax
cmpq $0x5, %rax
ja 0x4d594
addq %r12, %rsi
leaq 0x4d773(%rip), %rcx     # 0x9aa58
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
addq $0x18, %rsi
testq %rbx, %rbx
je 0x4d468
movq %rbx, %rdi
movl $0x80000001, %edx       # imm = 0x80000001
movl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
callq 0x35716
jmp 0x4d594
testq %rbx, %rbx
je 0x4d45e
movq 0x18(%rsi), %rdi
movq %rbx, %rsi
callq 0x3604c
movq 0x801c2(%rip), %rcx     # 0xcd4f0
movq %rax, 0x18(%rcx,%r12)
jmp 0x4d594
movq %rbx, %rdi
leaq 0x7fd0e(%rip), %rsi     # 0xcd050
pushq $0x2
popq %rdx
callq 0x35f17
cmpl $-0x1, %eax
je 0x4d594
pushq $0x1
popq %rcx
subl %eax, %ecx
movq 0x80191(%rip), %rax     # 0xcd4f0
movl %ecx, 0x18(%rax,%r12)
jmp 0x4d594
movq %r15, %rdi
callq 0x944ea
movq 0x80178(%rip), %rcx     # 0xcd4f0
movl %eax, 0xc(%rcx,%r12)
movslq %eax, %rdi
shlq $0x3, %rdi
leaq 0x4d70b(%rip), %rsi     # 0x9aa96
pushq $0x36
popq %rdx
callq 0x34f59
movq 0x80156(%rip), %rcx     # 0xcd4f0
movq %rax, 0x10(%rcx,%r12)
leaq 0x20(%r15), %r14
xorl %ebp, %ebp
movq (%r14), %r14
movq 0x80141(%rip), %rax     # 0xcd4f0
testq %r14, %r14
je 0x4d3e0
movq 0x10(%rax,%r12), %rax
movq (%rax,%rbp), %rdi
movq 0x8(%r14), %rsi
callq 0x3604c
movq 0x80123(%rip), %rcx     # 0xcd4f0
movq 0x10(%rcx,%r12), %rcx
movq %rax, (%rcx,%rbp)
addq $0x28, %r14
addq $0x8, %rbp
jmp 0x4d3a5
movq 0x10(%rax,%r12), %rsi
movl 0xc(%rax,%r12), %edx
movq %rbx, %rdi
callq 0x35f17
movq 0x800f7(%rip), %rcx     # 0xcd4f0
movl %eax, 0x18(%rcx,%r12)
jmp 0x4d594
addq $0x18, %rsi
testq %rbx, %rbx
je 0x4d470
movq %rbx, %rdi
movsd 0x4d631(%rip), %xmm0    # 0x9aa48
movsd 0x4d631(%rip), %xmm1    # 0x9aa50
callq 0x3578f
jmp 0x4d594
movq %r15, %rdi
leaq 0x48373(%rip), %rsi     # 0x957a6
callq 0x94309
movq 0x800b1(%rip), %rcx     # 0xcd4f0
leaq (%rcx,%r12), %rsi
addq $0xc, %rsi
testq %rax, %rax
je 0x4d479
movq %rax, %rdi
pushq $0x1
popq %rdx
movl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
callq 0x35716
jmp 0x4d47c
andq $0x0, 0x18(%rsi)
jmp 0x4d594
andl $0x0, (%rsi)
jmp 0x4d594
andq $0x0, (%rsi)
jmp 0x4d594
andl $0x0, (%rsi)
movq %r15, %rdi
leaq 0x4d628(%rip), %rsi     # 0x9aaae
callq 0x94309
testq %rax, %rax
je 0x4d594
movq %rax, %rdi
leaq 0x7fb82(%rip), %rsi     # 0xcd020
pushq $0x6
popq %rdx
callq 0x35f17
cmpl $0x1, %eax
je 0x4d51e
testl %eax, %eax
jne 0x4d594
movq 0x80036(%rip), %rax     # 0xcd4f0
movslq 0xc(%rax,%r12), %rdi
shlq $0x2, %rdi
leaq 0x4d5cc(%rip), %rsi     # 0x9aa96
pushq $0x49
popq %rdx
callq 0x34f59
movq 0x80017(%rip), %rcx     # 0xcd4f0
movq %rax, 0x18(%rcx,%r12)
movq %r15, %rdi
leaq 0x4c32d(%rip), %rsi     # 0x99815
callq 0x94309
movq %rax, %rbx
addq 0x7fff9(%rip), %r12     # 0xcd4f0
xorl %r14d, %r14d
movslq 0xc(%r12), %rax
cmpq %rax, %r14
jge 0x4d594
movq %rbx, %rdi
callq 0x4200
movq 0x18(%r12), %rcx
movl %eax, (%rcx,%r14,4)
incq %r14
jmp 0x4d4fa
movq 0x7ffcb(%rip), %rax     # 0xcd4f0
movslq 0xc(%rax,%r12), %rdi
shlq $0x3, %rdi
leaq 0x4d561(%rip), %rsi     # 0x9aa96
pushq $0x4e
popq %rdx
callq 0x34f59
movq 0x7ffac(%rip), %rcx     # 0xcd4f0
movq %rax, 0x18(%rcx,%r12)
movq %r15, %rdi
leaq 0x4c2c2(%rip), %rsi     # 0x99815
callq 0x94309
movq %rax, %rbx
movq 0x7ff8e(%rip), %rax     # 0xcd4f0
leaq (%rax,%r12), %r14
movl 0xc(%rax,%r12), %r12d
testl %r12d, %r12d
movl $0x0, %eax
cmovlel %eax, %r12d
xorl %ebp, %ebp
cmpq %rbp, %r12
je 0x4d594
movq %rbx, %rdi
callq 0x4130
movq 0x18(%r14), %rax
movsd %xmm0, (%rax,%rbp,8)
incq %rbp
jmp 0x4d579
addq $0x28, %r15
incq %r13
jmp 0x4d230
movq (%rsp), %rdi
callq 0x94639
pushq $0x1
popq %rax
jmp 0x4d5bc
leaq 0x4d522(%rip), %rdi     # 0x9aad7
callq 0x4090
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq