// File: /workspace/github_c_makefile_star2_O3/PoulinV[P]AxiCLASS/build/../tools/parser.c
// Function: parser_read_file
int parser_read_file(char * filename,
                     struct file_content * pfc,
                     ErrorMsg errmsg){

  FILE * inputfile;
  char line[_LINE_LENGTH_MAX_];
  int counter;
  int is_data;
  FileArg name;
  FileArg value;

  class_open(inputfile,filename,"r",errmsg);

  counter = 0;
  while (fgets(line,_LINE_LENGTH_MAX_,inputfile) != NULL) {
    class_call(parser_read_line(line,&is_data,name,value,errmsg),errmsg,errmsg);
    if (is_data == _TRUE_) counter++;
  }

  class_test(counter == 0,
             errmsg,
             "No readable input in file %s",filename);

  class_call(parser_init(pfc,counter,filename,errmsg),
             errmsg,
             errmsg);

  rewind(inputfile);

  counter = 0;
  while (fgets(line,_LINE_LENGTH_MAX_,inputfile) != NULL) {
    class_call(parser_read_line(line,&is_data,name,value,errmsg),errmsg,errmsg);
    if (is_data == _TRUE_) {
      strcpy(pfc->name[counter],name);
      strcpy(pfc->value[counter],value);
      pfc->read[counter]=_FALSE_;
      counter++;
    }
  }

  fclose(inputfile);

  return _SUCCESS_;

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1c28, %rsp           # imm = 0x1C28
movq %rdx, %r12
movq %rsi, %rbx
movq %rdi, %r14
leaq 0xeedf3(%rip), %rsi     # 0x10cda4
callq 0x8400
testq %rax, %rax
je 0x1e0b1
movq %rax, %r15
leaq 0x20(%rsp), %rdi
movl $0x400, %esi            # imm = 0x400
movq %rax, %rdx
callq 0x8540
testq %rax, %rax
je 0x1e0f6
movq %r14, 0x18(%rsp)
movq %rbx, 0x10(%rsp)
movq %r12, 0x8(%rsp)
xorl %ebp, %ebp
leaq 0x20(%rsp), %r13
leaq 0x4(%rsp), %r14
leaq 0x420(%rsp), %r12
leaq 0x1020(%rsp), %rbx
movq %r13, %rdi
movq %r14, %rsi
movq %r12, %rdx
movq %rbx, %rcx
movq 0x8(%rsp), %r8
callq 0x1e2c9
testl %eax, %eax
jne 0x1e150
xorl %eax, %eax
cmpl $0x1, 0x4(%rsp)
sete %al
addl %eax, %ebp
movq %r13, %rdi
movl $0x400, %esi            # imm = 0x400
movq %r15, %rdx
callq 0x8540
testq %rax, %rax
jne 0x1e008
testl %ebp, %ebp
movq 0x8(%rsp), %r12
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %r14
je 0x1e0f6
movl %ebp, %esi
movq %r14, %rdx
movq %r12, %rcx
callq 0x1e567
testl %eax, %eax
je 0x1e1af
leaq 0xd0376(%rip), %rsi     # 0xee3f0
leaq 0xd2a0d(%rip), %rdx     # 0xf0a8e
leaq 0x820(%rsp), %rbx
movq %rbx, %rdi
movq %r12, %rcx
xorl %eax, %eax
callq 0x30af0
leaq 0xcff97(%rip), %rsi     # 0xee034
leaq 0xd297d(%rip), %rdx     # 0xf0a21
movq %r12, %rdi
movl $0x1c, %ecx
jmp 0x1e18e
leaq 0xd2930(%rip), %rsi     # 0xf09e8
leaq 0xd2954(%rip), %rdx     # 0xf0a13
leaq 0xd2957(%rip), %r8      # 0xf0a1d
leaq 0x820(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30af0
leaq 0xcff52(%rip), %rsi     # 0xee034
leaq 0xd2938(%rip), %rdx     # 0xf0a21
movq %r12, %rdi
movl $0xe, %ecx
jmp 0x1e18e
leaq 0xd2967(%rip), %rsi     # 0xf0a64
leaq 0x820(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x30af0
leaq 0xcff69(%rip), %rsi     # 0xee082
leaq 0xd2961(%rip), %rdx     # 0xf0a81
leaq 0x1420(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x30af0
leaq 0xcfef8(%rip), %rsi     # 0xee034
leaq 0xd28de(%rip), %rdx     # 0xf0a21
movq %r12, %rdi
movl $0x18, %ecx
movq %r14, %r8
jmp 0x1e191
leaq 0xd0299(%rip), %rsi     # 0xee3f0
leaq 0xd28d4(%rip), %rdx     # 0xf0a32
leaq 0x820(%rsp), %rbx
movq %rbx, %rdi
movq 0x8(%rsp), %r14
movq %r14, %rcx
xorl %eax, %eax
callq 0x30af0
leaq 0xcfeb5(%rip), %rsi     # 0xee034
leaq 0xd289b(%rip), %rdx     # 0xf0a21
movq %r14, %rdi
movl $0x12, %ecx
movq %rbx, %r8
xorl %eax, %eax
callq 0x30af0
movl $0x1, %eax
addq $0x1c28, %rsp           # imm = 0x1C28
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r15, %rdi
callq 0x8060
leaq 0x20(%rsp), %rdi
movl $0x400, %esi            # imm = 0x400
movq %r15, %rdx
callq 0x8540
testq %rax, %rax
je 0x1e277
xorl %r14d, %r14d
leaq 0x20(%rsp), %r12
leaq 0x4(%rsp), %rbx
leaq 0x1020(%rsp), %r13
movq 0x10(%rsp), %rbp
movq %r12, %rdi
movq %rbx, %rsi
leaq 0x420(%rsp), %rdx
movq %r13, %rcx
movq 0x8(%rsp), %r8
callq 0x1e2c9
testl %eax, %eax
jne 0x1e286
cmpl $0x1, 0x4(%rsp)
jne 0x1e25e
movslq %r14d, %r14
movq %r13, %r12
movq %rbx, %r13
movq %r14, %rbx
shlq $0xa, %rbx
movq 0x10(%rbp), %rdi
addq %rbx, %rdi
leaq 0x420(%rsp), %rsi
callq 0x8350
addq 0x18(%rbp), %rbx
movq %rbx, %rdi
movq %r13, %rbx
movq %r12, %r13
leaq 0x20(%rsp), %r12
movq %r13, %rsi
callq 0x8350
movq 0x20(%rbp), %rax
movw $0x0, (%rax,%r14,2)
incl %r14d
movq %r12, %rdi
movl $0x400, %esi            # imm = 0x400
movq %r15, %rdx
callq 0x8540
testq %rax, %rax
jne 0x1e1ec
movq %r15, %rdi
callq 0x83a0
xorl %eax, %eax
jmp 0x1e19d
leaq 0xd0163(%rip), %rsi     # 0xee3f0
leaq 0xd279e(%rip), %rdx     # 0xf0a32
leaq 0x820(%rsp), %rbx
movq %rbx, %rdi
movq 0x8(%rsp), %r14
movq %r14, %rcx
xorl %eax, %eax
callq 0x30af0
leaq 0xcfd7f(%rip), %rsi     # 0xee034
leaq 0xd2765(%rip), %rdx     # 0xf0a21
movq %r14, %rdi
movl $0x22, %ecx
jmp 0x1e18e