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

  char * string;
  char * substring;
  FileArg string_with_one_value;

  char * 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(FileArg),errmsg);
  *pointer_to_list = list;

  /* read one string 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';
    }
    strcpy(list+(i-1)*_ARGUMENT_LENGTH_MAX_,string_with_one_value);
    //Insert EOL character:
    *(list+i*_ARGUMENT_LENGTH_MAX_-1) = '\n';
    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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1438, %rsp           # imm = 0x1438
movq %r9, %r12
movq %rcx, %r15
movq %rdx, %rbx
movq %rsi, 0x10(%rsp)
movq %r8, 0x28(%rsp)
movl $0x0, (%r8)
movq %rdi, 0x8(%rsp)
movslq 0x8(%rdi), %r14
xorl %ebp, %ebp
movl $0x0, %r13d
testq %r14, %r14
jle 0x1f401
movq %rbx, (%rsp)
movq %r12, %rbx
movq %r15, %r12
movq 0x8(%rsp), %rax
movq 0x10(%rax), %r15
xorl %r13d, %r13d
movq %r15, %rdi
movq 0x10(%rsp), %rsi
callq 0x84b0
testl %eax, %eax
je 0x1f3f7
incq %r13
addq $0x400, %r15            # imm = 0x400
cmpq %r13, %r14
jne 0x1f3d0
xorl %ebp, %ebp
jmp 0x1f5dc
movq %r12, %r15
movq %rbx, %r12
movq (%rsp), %rbx
cmpl %r14d, %r13d
je 0x1f5dc
movl %r13d, %ecx
movq %rcx, 0x20(%rsp)
shlq $0xa, %rcx
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rdi
movq %rcx, (%rsp)
addq %rcx, %rdi
xorl %ebp, %ebp
xorl %r14d, %r14d
incl %r14d
movl $0x2c, %esi
callq 0x8130
leaq 0x1(%rax), %rdi
addq $0x400, %rbp            # imm = 0x400
testq %rax, %rax
jne 0x1f42b
movl %r14d, (%rbx)
movq %rbp, %rdi
callq 0x8460
testq %rax, %rax
je 0x1f595
movq %rax, %rbx
movq %r12, 0x18(%rsp)
movq %rax, (%r15)
movq 0x8(%rsp), %rax
movq 0x18(%rax), %r12
addq (%rsp), %r12
leaq 0x30(%rsp), %rbp
movq %r12, %rdi
movl $0x2c, %esi
callq 0x8130
movq %rax, %r14
testq %rax, %rax
je 0x1f4aa
movq %r14, %r15
subq %r12, %r15
movq %rbp, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x81e0
movb $0x0, 0x30(%rsp,%r15)
jmp 0x1f4b5
movq %rbp, %rdi
movq %r12, %rsi
callq 0x8350
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x8350
leaq 0x1(%r14), %r12
movb $0xa, 0x3ff(%rbx)
addq $0x400, %rbx            # imm = 0x400
testq %r14, %r14
jne 0x1f479
movq 0x28(%rsp), %rax
movl $0x1, (%rax)
movq 0x8(%rsp), %r12
movq 0x20(%r12), %rax
movq 0x20(%rsp), %rcx
movw $0x1, (%rax,%rcx,2)
movl 0x8(%r12), %ebx
movq (%rsp), %rdi
addq $0x400, %rdi            # imm = 0x400
movq 0x18(%rsp), %r15
incl %r13d
cmpl %r13d, %ebx
jle 0x1f3f0
leaq 0x400(%rdi), %r14
addq 0x10(%r12), %rdi
movq 0x10(%rsp), %rsi
callq 0x84b0
movq %r14, %rdi
testl %eax, %eax
jne 0x1f50c
movq (%r12), %rcx
leaq 0xd1750(%rip), %rsi     # 0xf0c90
leaq 0x430(%rsp), %rbx
movq %rbx, %rdi
movq 0x10(%rsp), %rdx
xorl %eax, %eax
callq 0x30af0
leaq 0xceb24(%rip), %rsi     # 0xee082
leaq 0xd175a(%rip), %rdx     # 0xf0cbf
leaq 0xc30(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x30af0
leaq 0xceab3(%rip), %rsi     # 0xee034
leaq 0xd18ae(%rip), %rdx     # 0xf0e36
movq %r15, %rdi
movl $0x266, %ecx            # imm = 0x266
movq %r14, %r8
jmp 0x1f5d0
leaq 0xcea68(%rip), %rsi     # 0xee004
leaq 0xf5c4d(%rip), %rdx     # 0x1151f0
leaq 0x430(%rsp), %rbx
movq %rbx, %rdi
movl %ebp, %ecx
xorl %eax, %eax
callq 0x30af0
leaq 0xcea76(%rip), %rsi     # 0xee034
leaq 0xd1871(%rip), %rdx     # 0xf0e36
movq %r12, %rdi
movl $0x245, %ecx            # imm = 0x245
movq %rbx, %r8
xorl %eax, %eax
callq 0x30af0
movl $0x1, %ebp
movl %ebp, %eax
addq $0x1438, %rsp           # imm = 0x1438
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq