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

  char * string;
  char * substring;
  FileArg string_with_one_value;

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

  /* read one integer 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,"%d",&(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 0x3933c
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 0x39346
jmp 0x39359
movl 0x2c3c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2c3c(%rsp)
jmp 0x392f0
movl 0x2c3c(%rsp), %eax
movq 0x2c68(%rsp), %rcx
cmpl 0x8(%rcx), %eax
jne 0x3937d
movl $0x0, 0x2c74(%rsp)
jmp 0x3977e
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 0x393ab
movl 0x2c38(%rsp), %ecx
movq 0x2c58(%rsp), %rax
movl %ecx, (%rax)
movq 0x2c58(%rsp), %rax
movslq (%rax), %rdi
shlq $0x2, %rdi
callq 0x8460
movq %rax, 0x2818(%rsp)
cmpq $0x0, 0x2818(%rsp)
jne 0x394a1
movq 0x2c58(%rsp), %rax
movslq (%rax), %rax
shlq $0x2, %rax
movl %eax, 0x2814(%rsp)
leaq 0x2010(%rsp), %rdi
movl 0x2814(%rsp), %ecx
leaq 0x198bab(%rip), %rsi    # 0x1d2004
leaq 0x1bfd75(%rip), %rdx    # 0x1f91d5
movb $0x0, %al
callq 0x5b9c0
movq 0x2c40(%rsp), %rdi
leaq 0x2010(%rsp), %r8
leaq 0x198bb6(%rip), %rsi    # 0x1d2034
leaq 0x19b947(%rip), %rdx    # 0x1d4dcc
movl $0x1f0, %ecx            # imm = 0x1F0
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x2c74(%rsp)
jmp 0x3977e
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 0x3952f
leaq 0x2820(%rsp), %rdi
movq 0x2c30(%rsp), %rsi
callq 0x8370
jmp 0x39572
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 $0x2, %rax
addq %rax, %rdx
leaq 0x1a791a(%rip), %rsi    # 0x1e0eb6
movb $0x0, %al
callq 0x83b0
cmpl $0x1, %eax
je 0x3963b
leaq 0x1810(%rsp), %rdi
movl 0x2c38(%rsp), %edx
movq 0x2c60(%rsp), %rcx
movq 0x2c68(%rsp), %rax
movq (%rax), %r8
leaq 0x19b77e(%rip), %rsi    # 0x1d4d53
movb $0x0, %al
callq 0x5b9c0
leaq 0x1010(%rsp), %rdi
leaq 0x1810(%rsp), %rcx
leaq 0x198a8f(%rip), %rsi    # 0x1d2082
leaq 0x19b7ef(%rip), %rdx    # 0x1d4de9
movb $0x0, %al
callq 0x5b9c0
movq 0x2c40(%rsp), %rdi
leaq 0x1010(%rsp), %r8
leaq 0x198a1c(%rip), %rsi    # 0x1d2034
leaq 0x19b7ad(%rip), %rdx    # 0x1d4dcc
movl $0x203, %ecx            # imm = 0x203
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x2c74(%rsp)
jmp 0x3977e
movq 0x2c28(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x2c30(%rsp)
cmpq $0x0, 0x2c28(%rsp)
jne 0x394e2
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 0x39773
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 0x3975b
leaq 0x810(%rsp), %rdi
movq 0x2c60(%rsp), %rdx
movq 0x2c68(%rsp), %rax
movq (%rax), %rcx
leaq 0x19b57a(%rip), %rsi    # 0x1d4c78
movb $0x0, %al
callq 0x5b9c0
leaq 0x10(%rsp), %rdi
leaq 0x810(%rsp), %rcx
leaq 0x198969(%rip), %rsi    # 0x1d2082
leaq 0x19b587(%rip), %rdx    # 0x1d4ca7
movb $0x0, %al
callq 0x5b9c0
movq 0x2c40(%rsp), %rdi
leaq 0x10(%rsp), %r8
leaq 0x1988f9(%rip), %rsi    # 0x1d2034
leaq 0x19b68a(%rip), %rdx    # 0x1d4dcc
movl $0x213, %ecx            # imm = 0x213
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x2c74(%rsp)
jmp 0x3977e
jmp 0x3975d
movl 0x2c38(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2c38(%rsp)
jmp 0x39697
movl $0x0, 0x2c74(%rsp)
movl 0x2c74(%rsp), %eax
addq $0x2c78, %rsp           # imm = 0x2C78
retq
nopl (%rax)