// File: /workspace/github_c_makefile_star2_O0/PoulinV[P]AxiCLASS/build/../tools/parser.c
// Function: parser_read_list_of_doubles
int parser_read_list_of_doubles(struct file_content * pfc,
                                char * name,
                                int * size,
                                double ** pointer_to_list,
                                int * found,
                                ErrorMsg errmsg) {
  int index;
  int i;

  char * string;
  char * substring;
  FileArg string_with_one_value;

  double * list;

  /* intialize the 'found' flag to false */

  * found = _FALSE_;

  /* search parameter */

  index=0;
  while ((index < pfc->size) && (strcmp(pfc->name[index],name) != 0))
    index++;

  /* if parameter not found, return with 'found' flag still equal to false */

  if (index == pfc->size)
    return _SUCCESS_;

  /* count number of comas and compute size = number of comas + 1 */
  i = 0;
  string = pfc->value[index];
  do {
    i ++;
    substring = strchr(string,',');
    string = substring+1;
  } while(substring != NULL);

  *size = i;

  /* free and re-allocate array of values */
  class_alloc(list,*size*sizeof(double),errmsg);
  *pointer_to_list = list;

  /* read one double between each comas */
  i = 0;
  string = pfc->value[index];
  do {
    i ++;
    substring = strchr(string,',');
    if (substring == NULL) {
      strcpy(string_with_one_value,string);
    }
    else {
      strncpy(string_with_one_value,string,(substring-string));
      string_with_one_value[substring-string]='\0';
    }
    class_test(sscanf(string_with_one_value,"%lg",&(list[i-1])) != 1,
               errmsg,
               "could not read %dth value of list of parameters '%s' in file '%s'\n",
               i,name,pfc->filename);
    string = substring+1;
  } while(substring != NULL);

  /* if parameter read correctly, set 'found' flag to true, as well as the flag
     associated with this parameter in the file_content structure */

  * found = _TRUE_;
  pfc->read[index] = _TRUE_;

  /* check for multiple entries of the same parameter. If another occurence is found,
     return an error. */

  for (i=index+1; i < pfc->size; i++) {
    class_test(strcmp(pfc->name[i],name) == 0,
               errmsg,
               "multiple entry of parameter '%s' in file '%s'\n",name,pfc->filename);
  }

  /* if everything proceeded normally, return with 'found' flag equal to true */

  return _SUCCESS_;

}

// Assembly:
subq $0x2c78, %rsp           # imm = 0x2C78
movq %rdi, 0x2c68(%rsp)
movq %rsi, 0x2c60(%rsp)
movq %rdx, 0x2c58(%rsp)
movq %rcx, 0x2c50(%rsp)
movq %r8, 0x2c48(%rsp)
movq %r9, 0x2c40(%rsp)
movq 0x2c48(%rsp), %rax
movl $0x0, (%rax)
movl $0x0, 0x2c3c(%rsp)
movl 0x2c3c(%rsp), %ecx
movq 0x2c68(%rsp), %rdx
xorl %eax, %eax
cmpl 0x8(%rdx), %ecx
movb %al, 0xf(%rsp)
jge 0x38e4c
movq 0x2c68(%rsp), %rax
movq 0x10(%rax), %rdi
movslq 0x2c3c(%rsp), %rax
shlq $0xa, %rax
addq %rax, %rdi
movq 0x2c60(%rsp), %rsi
callq 0x84b0
cmpl $0x0, %eax
setne %al
movb %al, 0xf(%rsp)
movb 0xf(%rsp), %al
testb $0x1, %al
jne 0x38e56
jmp 0x38e69
movl 0x2c3c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2c3c(%rsp)
jmp 0x38e00
movl 0x2c3c(%rsp), %eax
movq 0x2c68(%rsp), %rcx
cmpl 0x8(%rcx), %eax
jne 0x38e8d
movl $0x0, 0x2c74(%rsp)
jmp 0x3928e
movl $0x0, 0x2c38(%rsp)
movq 0x2c68(%rsp), %rax
movq 0x18(%rax), %rax
movslq 0x2c3c(%rsp), %rcx
shlq $0xa, %rcx
addq %rcx, %rax
movq %rax, 0x2c30(%rsp)
movl 0x2c38(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2c38(%rsp)
movq 0x2c30(%rsp), %rdi
movl $0x2c, %esi
callq 0x8140
movq %rax, 0x2c28(%rsp)
movq 0x2c28(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x2c30(%rsp)
cmpq $0x0, 0x2c28(%rsp)
jne 0x38ebb
movl 0x2c38(%rsp), %ecx
movq 0x2c58(%rsp), %rax
movl %ecx, (%rax)
movq 0x2c58(%rsp), %rax
movslq (%rax), %rdi
shlq $0x3, %rdi
callq 0x8460
movq %rax, 0x2818(%rsp)
cmpq $0x0, 0x2818(%rsp)
jne 0x38fb1
movq 0x2c58(%rsp), %rax
movslq (%rax), %rax
shlq $0x3, %rax
movl %eax, 0x2814(%rsp)
leaq 0x2010(%rsp), %rdi
movl 0x2814(%rsp), %ecx
leaq 0x19909b(%rip), %rsi    # 0x1d2004
leaq 0x1c0265(%rip), %rdx    # 0x1f91d5
movb $0x0, %al
callq 0x5b9c0
movq 0x2c40(%rsp), %rdi
leaq 0x2010(%rsp), %r8
leaq 0x1990a6(%rip), %rsi    # 0x1d2034
leaq 0x19bda2(%rip), %rdx    # 0x1d4d37
movl $0x19a, %ecx            # imm = 0x19A
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x2c74(%rsp)
jmp 0x3928e
movq 0x2818(%rsp), %rcx
movq 0x2c50(%rsp), %rax
movq %rcx, (%rax)
movl $0x0, 0x2c38(%rsp)
movq 0x2c68(%rsp), %rax
movq 0x18(%rax), %rax
movslq 0x2c3c(%rsp), %rcx
shlq $0xa, %rcx
addq %rcx, %rax
movq %rax, 0x2c30(%rsp)
movl 0x2c38(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2c38(%rsp)
movq 0x2c30(%rsp), %rdi
movl $0x2c, %esi
callq 0x8140
movq %rax, 0x2c28(%rsp)
cmpq $0x0, 0x2c28(%rsp)
jne 0x3903f
leaq 0x2820(%rsp), %rdi
movq 0x2c30(%rsp), %rsi
callq 0x8370
jmp 0x39082
leaq 0x2820(%rsp), %rdi
movq 0x2c30(%rsp), %rsi
movq 0x2c28(%rsp), %rdx
movq 0x2c30(%rsp), %rax
subq %rax, %rdx
callq 0x81f0
movq 0x2c28(%rsp), %rax
movq 0x2c30(%rsp), %rcx
subq %rcx, %rax
movb $0x0, 0x2820(%rsp,%rax)
leaq 0x2820(%rsp), %rdi
movq 0x2818(%rsp), %rdx
movl 0x2c38(%rsp), %eax
subl $0x1, %eax
cltq
shlq $0x3, %rax
addq %rax, %rdx
leaq 0x1d4acf(%rip), %rsi    # 0x20db7b
movb $0x0, %al
callq 0x83b0
cmpl $0x1, %eax
je 0x3914b
leaq 0x1810(%rsp), %rdi
movl 0x2c38(%rsp), %edx
movq 0x2c60(%rsp), %rcx
movq 0x2c68(%rsp), %rax
movq (%rax), %r8
leaq 0x19bc6e(%rip), %rsi    # 0x1d4d53
movb $0x0, %al
callq 0x5b9c0
leaq 0x1010(%rsp), %rdi
leaq 0x1810(%rsp), %rcx
leaq 0x198f7f(%rip), %rsi    # 0x1d2082
leaq 0x19bc8c(%rip), %rdx    # 0x1d4d96
movb $0x0, %al
callq 0x5b9c0
movq 0x2c40(%rsp), %rdi
leaq 0x1010(%rsp), %r8
leaq 0x198f0c(%rip), %rsi    # 0x1d2034
leaq 0x19bc08(%rip), %rdx    # 0x1d4d37
movl $0x1ad, %ecx            # imm = 0x1AD
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x2c74(%rsp)
jmp 0x3928e
movq 0x2c28(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x2c30(%rsp)
cmpq $0x0, 0x2c28(%rsp)
jne 0x38ff2
movq 0x2c48(%rsp), %rax
movl $0x1, (%rax)
movq 0x2c68(%rsp), %rax
movq 0x20(%rax), %rax
movslq 0x2c3c(%rsp), %rcx
movw $0x1, (%rax,%rcx,2)
movl 0x2c3c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2c38(%rsp)
movl 0x2c38(%rsp), %eax
movq 0x2c68(%rsp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x39283
movq 0x2c68(%rsp), %rax
movq 0x10(%rax), %rdi
movslq 0x2c38(%rsp), %rax
shlq $0xa, %rax
addq %rax, %rdi
movq 0x2c60(%rsp), %rsi
callq 0x84b0
cmpl $0x0, %eax
jne 0x3926b
leaq 0x810(%rsp), %rdi
movq 0x2c60(%rsp), %rdx
movq 0x2c68(%rsp), %rax
movq (%rax), %rcx
leaq 0x19ba6a(%rip), %rsi    # 0x1d4c78
movb $0x0, %al
callq 0x5b9c0
leaq 0x10(%rsp), %rdi
leaq 0x810(%rsp), %rcx
leaq 0x198e59(%rip), %rsi    # 0x1d2082
leaq 0x19ba77(%rip), %rdx    # 0x1d4ca7
movb $0x0, %al
callq 0x5b9c0
movq 0x2c40(%rsp), %rdi
leaq 0x10(%rsp), %r8
leaq 0x198de9(%rip), %rsi    # 0x1d2034
leaq 0x19bae5(%rip), %rdx    # 0x1d4d37
movl $0x1bd, %ecx            # imm = 0x1BD
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x2c74(%rsp)
jmp 0x3928e
jmp 0x3926d
movl 0x2c38(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2c38(%rsp)
jmp 0x391a7
movl $0x0, 0x2c74(%rsp)
movl 0x2c74(%rsp), %eax
addq $0x2c78, %rsp           # imm = 0x2C78
retq
nopl (%rax)