// File: /workspace/github_c_makefile_star2_O1/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 0x4ee74(%rip), %rdi     # 0xa2772
callq 0xa075c
testq %rax, %rax
je 0x53cfb
movq %rax, %rbx
movq %rax, %rdi
callq 0xa0e78
testl %eax, %eax
je 0x53d07
movq 0x8(%rbx), %rdi
callq 0xa0d0f
movl %eax, 0x7ebba(%rip)     # 0xd24e8
movslq %eax, %rdi
shlq $0x5, %rdi
leaq 0x5417a(%rip), %rsi     # 0xa7ab6
movl $0x8, %edx
callq 0x390f5
movq %rax, 0x7eba3(%rip)     # 0xd24f0
movq %rbx, (%rsp)
movq 0x8(%rbx), %rax
movq 0x20(%rax), %r14
testq %r14, %r14
je 0x53ceb
xorl %r12d, %r12d
movq %r14, %rdi
leaq 0x58145(%rip), %rsi     # 0xabab4
callq 0xa0b21
movq %r12, %rbx
shlq $0x5, %rbx
movq 0x7eb6e(%rip), %rcx     # 0xd24f0
addq %rbx, %rcx
testq %rax, %rax
je 0x539a2
movq (%rcx), %rdi
movq %rax, %rsi
callq 0x3a404
movq 0x7eb54(%rip), %rcx     # 0xd24f0
movq %rax, (%rcx,%rbx)
jmp 0x539a9
movq $0x0, (%rcx)
movq %r14, %rdi
leaq 0x50bdf(%rip), %rsi     # 0xa4592
callq 0xa0b21
testq %rax, %rax
je 0x539d3
movq %rax, %rdi
leaq 0x7e659(%rip), %rsi     # 0xd2020
movl $0x6, %edx
callq 0x3a2c5
jmp 0x539d5
xorl %eax, %eax
movq 0x7eb14(%rip), %rcx     # 0xd24f0
movl %eax, 0x8(%rcx,%rbx)
movq %r14, %rdi
leaq 0x52e8d(%rip), %rsi     # 0xa6877
callq 0xa0b21
movq %rax, %rbp
movq 0x7eaf7(%rip), %rsi     # 0xd24f0
movl 0x8(%rsi,%rbx), %eax
cmpq $0x5, %rax
ja 0x53cdb
addq %rbx, %rsi
leaq 0x54067(%rip), %rcx     # 0xa7a78
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
addq $0x18, %rsi
testq %rbp, %rbp
je 0x53ba3
movq %rbp, %rdi
movl $0x80000001, %edx       # imm = 0x80000001
movl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
callq 0x39980
jmp 0x53cdb
testq %rbp, %rbp
je 0x53b96
movq 0x18(%rsi), %rdi
movq %rbp, %rsi
callq 0x3a404
movq 0x7ea96(%rip), %rcx     # 0xd24f0
movq %rax, 0x18(%rcx,%rbx)
jmp 0x53cdb
movq %rbp, %rdi
leaq 0x7e5e2(%rip), %rsi     # 0xd2050
movl $0x2, %edx
callq 0x3a2c5
cmpl $-0x1, %eax
je 0x53cdb
movl $0x1, %ecx
subl %eax, %ecx
movq 0x7ea61(%rip), %rax     # 0xd24f0
movl %ecx, 0x18(%rax,%rbx)
jmp 0x53cdb
movq %r14, %rdi
callq 0xa0d0f
movq 0x7ea49(%rip), %rcx     # 0xd24f0
movl %eax, 0xc(%rcx,%rbx)
movslq %eax, %rdi
shlq $0x3, %rdi
leaq 0x53ffd(%rip), %rsi     # 0xa7ab6
movl $0x36, %edx
callq 0x390f5
movq 0x7ea26(%rip), %rcx     # 0xd24f0
movq %rax, 0x10(%rcx,%rbx)
movq 0x20(%r14), %r13
testq %r13, %r13
je 0x53b11
xorl %r15d, %r15d
movq 0x7ea0e(%rip), %rax     # 0xd24f0
movq 0x10(%rax,%rbx), %rax
movq (%rax,%r15), %rdi
movq 0x8(%r13), %rsi
callq 0x3a404
movq 0x7e9f5(%rip), %rcx     # 0xd24f0
movq 0x10(%rcx,%rbx), %rcx
movq %rax, (%rcx,%r15)
movq 0x28(%r13), %r13
addq $0x8, %r15
testq %r13, %r13
jne 0x53adb
movq 0x7e9d8(%rip), %rax     # 0xd24f0
movq 0x10(%rax,%rbx), %rsi
movl 0xc(%rax,%rbx), %edx
movq %rbp, %rdi
callq 0x3a2c5
movq 0x7e9c0(%rip), %rcx     # 0xd24f0
movl %eax, 0x18(%rcx,%rbx)
jmp 0x53cdb
addq $0x18, %rsi
testq %rbp, %rbp
je 0x53bae
movq %rbp, %rdi
movsd 0x53f1b(%rip), %xmm0    # 0xa7a68
movsd 0x53f1b(%rip), %xmm1    # 0xa7a70
callq 0x399fb
jmp 0x53cdb
movq %r14, %rdi
leaq 0x4ec3d(%rip), %rsi     # 0xa27a6
callq 0xa0b21
movq 0x7e97b(%rip), %rcx     # 0xd24f0
leaq (%rcx,%rbx), %rsi
addq $0xc, %rsi
testq %rax, %rax
je 0x53bba
movq %rax, %rdi
movl $0x1, %edx
movl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
callq 0x39980
jmp 0x53bc0
movq $0x0, 0x18(%rsi)
jmp 0x53cdb
movl $0x0, (%rsi)
jmp 0x53cdb
movq $0x0, (%rsi)
jmp 0x53cdb
movl $0x0, (%rsi)
movq %r14, %rdi
leaq 0x53f04(%rip), %rsi     # 0xa7ace
callq 0xa0b21
testq %rax, %rax
je 0x53cdb
movq %rax, %rdi
leaq 0x7e43e(%rip), %rsi     # 0xd2020
movl $0x6, %edx
callq 0x3a2c5
cmpl $0x1, %eax
je 0x53c6d
testl %eax, %eax
jne 0x53cdb
movq 0x7e8f0(%rip), %rax     # 0xd24f0
movslq 0xc(%rax,%rbx), %rdi
shlq $0x2, %rdi
leaq 0x53ea6(%rip), %rsi     # 0xa7ab6
movl $0x49, %edx
callq 0x390f5
movq 0x7e8cf(%rip), %rcx     # 0xd24f0
movq %rax, 0x18(%rcx,%rbx)
movq %r14, %rdi
leaq 0x52c47(%rip), %rsi     # 0xa6877
callq 0xa0b21
movq 0x7e8b4(%rip), %r13     # 0xd24f0
cmpl $0x0, 0xc(%r13,%rbx)
jle 0x53cdb
movq %rax, %rbp
addq %rbx, %r13
xorl %ebx, %ebx
movq %rbp, %rdi
callq 0x4200
movq 0x18(%r13), %rcx
movl %eax, (%rcx,%rbx,4)
incq %rbx
movslq 0xc(%r13), %rax
cmpq %rax, %rbx
jl 0x53c50
jmp 0x53cdb
movq 0x7e87c(%rip), %rax     # 0xd24f0
movslq 0xc(%rax,%rbx), %rdi
shlq $0x3, %rdi
leaq 0x53e32(%rip), %rsi     # 0xa7ab6
movl $0x4e, %edx
callq 0x390f5
movq 0x7e85b(%rip), %rcx     # 0xd24f0
movq %rax, 0x18(%rcx,%rbx)
movq %r14, %rdi
leaq 0x52bd3(%rip), %rsi     # 0xa6877
callq 0xa0b21
movq 0x7e840(%rip), %r13     # 0xd24f0
movslq 0xc(%r13,%rbx), %r15
testq %r15, %r15
jle 0x53cdb
movq %rax, %rbp
addq %rbx, %r13
xorl %ebx, %ebx
movq %rbp, %rdi
callq 0x4130
movq 0x18(%r13), %rax
movsd %xmm0, (%rax,%rbx,8)
incq %rbx
cmpq %rbx, %r15
jne 0x53cc2
incq %r12
movq 0x28(%r14), %r14
testq %r14, %r14
jne 0x53965
movq (%rsp), %rdi
callq 0xa0e5a
movl $0x1, %eax
jmp 0x53d09
leaq 0x53df5(%rip), %rdi     # 0xa7af7
callq 0x4090
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq