// File: /workspace/github_c_makefile_star2_O3/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 0x5097d(%rip), %rdi     # 0xa5772
callq 0xa36cc
testq %rax, %rax
je 0x551f2
movq %rax, %rbx
movq %rax, %rdi
callq 0xa3de1
testl %eax, %eax
je 0x551fe
movq 0x8(%rbx), %rdi
callq 0xa3c78
movl %eax, 0x806c3(%rip)     # 0xd54e8
movslq %eax, %rdi
shlq $0x5, %rdi
leaq 0x55d33(%rip), %rsi     # 0xaab66
movl $0x8, %edx
callq 0x3a0e1
movq %rax, 0x806ac(%rip)     # 0xd54f0
movq %rbx, (%rsp)
movq 0x8(%rbx), %rax
movq 0x20(%rax), %r14
testq %r14, %r14
je 0x551e2
xorl %r12d, %r12d
movq %r14, %rdi
leaq 0x59d1a(%rip), %rsi     # 0xaeb80
callq 0xa3a8c
movq %r12, %rbx
shlq $0x5, %rbx
movq 0x80677(%rip), %rcx     # 0xd54f0
addq %rbx, %rcx
testq %rax, %rax
je 0x54e99
movq (%rcx), %rdi
movq %rax, %rsi
callq 0x3b494
movq 0x8065d(%rip), %rcx     # 0xd54f0
movq %rax, (%rcx,%rbx)
jmp 0x54ea0
movq $0x0, (%rcx)
movq %r14, %rdi
leaq 0x5272a(%rip), %rsi     # 0xa75d4
callq 0xa3a8c
testq %rax, %rax
je 0x54eca
movq %rax, %rdi
leaq 0x80162(%rip), %rsi     # 0xd5020
movl $0x6, %edx
callq 0x3b355
jmp 0x54ecc
xorl %eax, %eax
movq 0x8061d(%rip), %rcx     # 0xd54f0
movl %eax, 0x8(%rcx,%rbx)
movq %r14, %rdi
leaq 0x549c4(%rip), %rsi     # 0xa98a5
callq 0xa3a8c
movq %rax, %rbp
movq 0x80600(%rip), %rsi     # 0xd54f0
movl 0x8(%rsi,%rbx), %eax
cmpq $0x5, %rax
ja 0x551d2
addq %rbx, %rsi
leaq 0x55c20(%rip), %rcx     # 0xaab28
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
addq $0x18, %rsi
testq %rbp, %rbp
je 0x5509a
movq %rbp, %rdi
movl $0x80000001, %edx       # imm = 0x80000001
movl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
callq 0x3a98c
jmp 0x551d2
testq %rbp, %rbp
je 0x5508d
movq 0x18(%rsi), %rdi
movq %rbp, %rsi
callq 0x3b494
movq 0x8059f(%rip), %rcx     # 0xd54f0
movq %rax, 0x18(%rcx,%rbx)
jmp 0x551d2
movq %rbp, %rdi
leaq 0x800eb(%rip), %rsi     # 0xd5050
movl $0x2, %edx
callq 0x3b355
cmpl $-0x1, %eax
je 0x551d2
movl $0x1, %ecx
subl %eax, %ecx
movq 0x8056a(%rip), %rax     # 0xd54f0
movl %ecx, 0x18(%rax,%rbx)
jmp 0x551d2
movq %r14, %rdi
callq 0xa3c78
movq 0x80552(%rip), %rcx     # 0xd54f0
movl %eax, 0xc(%rcx,%rbx)
movslq %eax, %rdi
shlq $0x3, %rdi
leaq 0x55bb6(%rip), %rsi     # 0xaab66
movl $0x36, %edx
callq 0x3a0e1
movq 0x8052f(%rip), %rcx     # 0xd54f0
movq %rax, 0x10(%rcx,%rbx)
movq 0x20(%r14), %r13
testq %r13, %r13
je 0x55008
xorl %r15d, %r15d
movq 0x80517(%rip), %rax     # 0xd54f0
movq 0x10(%rax,%rbx), %rax
movq (%rax,%r15), %rdi
movq 0x8(%r13), %rsi
callq 0x3b494
movq 0x804fe(%rip), %rcx     # 0xd54f0
movq 0x10(%rcx,%rbx), %rcx
movq %rax, (%rcx,%r15)
movq 0x28(%r13), %r13
addq $0x8, %r15
testq %r13, %r13
jne 0x54fd2
movq 0x804e1(%rip), %rax     # 0xd54f0
movq 0x10(%rax,%rbx), %rsi
movl 0xc(%rax,%rbx), %edx
movq %rbp, %rdi
callq 0x3b355
movq 0x804c9(%rip), %rcx     # 0xd54f0
movl %eax, 0x18(%rcx,%rbx)
jmp 0x551d2
addq $0x18, %rsi
testq %rbp, %rbp
je 0x550a5
movq %rbp, %rdi
movsd 0x55ad4(%rip), %xmm0    # 0xaab18
movsd 0x55ad4(%rip), %xmm1    # 0xaab20
callq 0x3aa07
jmp 0x551d2
movq %r14, %rdi
leaq 0x50746(%rip), %rsi     # 0xa57a6
callq 0xa3a8c
movq 0x80484(%rip), %rcx     # 0xd54f0
leaq (%rcx,%rbx), %rsi
addq $0xc, %rsi
testq %rax, %rax
je 0x550b1
movq %rax, %rdi
movl $0x1, %edx
movl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
callq 0x3a98c
jmp 0x550b7
movq $0x0, 0x18(%rsi)
jmp 0x551d2
movl $0x0, (%rsi)
jmp 0x551d2
movq $0x0, (%rsi)
jmp 0x551d2
movl $0x0, (%rsi)
movq %r14, %rdi
leaq 0x55abd(%rip), %rsi     # 0xaab7e
callq 0xa3a8c
testq %rax, %rax
je 0x551d2
movq %rax, %rdi
leaq 0x7ff47(%rip), %rsi     # 0xd5020
movl $0x6, %edx
callq 0x3b355
cmpl $0x1, %eax
je 0x55164
testl %eax, %eax
jne 0x551d2
movq 0x803f9(%rip), %rax     # 0xd54f0
movslq 0xc(%rax,%rbx), %rdi
shlq $0x2, %rdi
leaq 0x55a5f(%rip), %rsi     # 0xaab66
movl $0x49, %edx
callq 0x3a0e1
movq 0x803d8(%rip), %rcx     # 0xd54f0
movq %rax, 0x18(%rcx,%rbx)
movq %r14, %rdi
leaq 0x5477e(%rip), %rsi     # 0xa98a5
callq 0xa3a8c
movq 0x803bd(%rip), %r13     # 0xd54f0
cmpl $0x0, 0xc(%r13,%rbx)
jle 0x551d2
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 0x55147
jmp 0x551d2
movq 0x80385(%rip), %rax     # 0xd54f0
movslq 0xc(%rax,%rbx), %rdi
shlq $0x3, %rdi
leaq 0x559eb(%rip), %rsi     # 0xaab66
movl $0x4e, %edx
callq 0x3a0e1
movq 0x80364(%rip), %rcx     # 0xd54f0
movq %rax, 0x18(%rcx,%rbx)
movq %r14, %rdi
leaq 0x5470a(%rip), %rsi     # 0xa98a5
callq 0xa3a8c
movq 0x80349(%rip), %r13     # 0xd54f0
movslq 0xc(%r13,%rbx), %r15
testq %r15, %r15
jle 0x551d2
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 0x551b9
incq %r12
movq 0x28(%r14), %r14
testq %r14, %r14
jne 0x54e5c
movq (%rsp), %rdi
callq 0xa3dc3
movl $0x1, %eax
jmp 0x55200
leaq 0x559ae(%rip), %rdi     # 0xaaba7
callq 0x4090
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq