// File: /workspace/github_c_makefile_star2_O1/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, %rbx
movq %rsi, %r14
movq %rdi, %r12
leaq 0xf1e3b(%rip), %rsi     # 0x10fd84
callq 0x8400
testq %rax, %rax
je 0x1e045
movq %rax, %r15
movq %r12, 0x10(%rsp)
movq %r14, 0x18(%rsp)
movq %rbx, 0x8(%rsp)
leaq 0x20(%rsp), %rdi
movl $0x400, %esi            # imm = 0x400
movq %rax, %rdx
callq 0x8540
xorl %ebp, %ebp
testq %rax, %rax
je 0x1dfdb
leaq 0x20(%rsp), %r13
leaq 0x4(%rsp), %r14
leaq 0x820(%rsp), %r12
leaq 0x420(%rsp), %rbx
movq %r13, %rdi
movq %r14, %rsi
movq %r12, %rdx
movq %rbx, %rcx
movq 0x8(%rsp), %r8
callq 0x1e253
testl %eax, %eax
jne 0x1e08a
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 0x1df9c
testl %ebp, %ebp
je 0x1e0e9
movq 0x18(%rsp), %rdi
movl %ebp, %esi
movq 0x10(%rsp), %rdx
movq 0x8(%rsp), %rbx
movq %rbx, %rcx
callq 0x1e4f1
testl %eax, %eax
je 0x1e147
leaq 0xd33e5(%rip), %rsi     # 0xf13f0
leaq 0xd5a6c(%rip), %rdx     # 0xf3a7e
movq %rbx, %r14
leaq 0xc20(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30c2c
leaq 0xd3003(%rip), %rsi     # 0xf1034
leaq 0xd59d9(%rip), %rdx     # 0xf3a11
movq %r14, %rdi
movl $0x1c, %ecx
jmp 0x1e0c8
leaq 0xd598c(%rip), %rsi     # 0xf39d8
leaq 0xd59b0(%rip), %rdx     # 0xf3a03
leaq 0xd59b3(%rip), %r8      # 0xf3a0d
movq %rbx, %r14
leaq 0xc20(%rsp), %rbx
movq %rbx, %rdi
movq %r12, %rcx
xorl %eax, %eax
callq 0x30c2c
leaq 0xd2fbb(%rip), %rsi     # 0xf1034
leaq 0xd5991(%rip), %rdx     # 0xf3a11
movq %r14, %rdi
movl $0xe, %ecx
jmp 0x1e0c8
leaq 0xd335f(%rip), %rsi     # 0xf13f0
leaq 0xd598a(%rip), %rdx     # 0xf3a22
leaq 0xc20(%rsp), %rbx
movq %rbx, %rdi
movq 0x8(%rsp), %r14
movq %r14, %rcx
xorl %eax, %eax
callq 0x30c2c
leaq 0xd2f7b(%rip), %rsi     # 0xf1034
leaq 0xd5951(%rip), %rdx     # 0xf3a11
movq %r14, %rdi
movl $0x12, %ecx
movq %rbx, %r8
xorl %eax, %eax
callq 0x30c2c
movl $0x1, %eax
addq $0x1c28, %rsp           # imm = 0x1C28
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xd5964(%rip), %rsi     # 0xf3a54
leaq 0xc20(%rsp), %rbx
movq %rbx, %rdi
movq 0x10(%rsp), %rdx
xorl %eax, %eax
callq 0x30c2c
leaq 0xd2f74(%rip), %rsi     # 0xf1082
leaq 0xd595c(%rip), %rdx     # 0xf3a71
leaq 0x1420(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x30c2c
leaq 0xd2f03(%rip), %rsi     # 0xf1034
leaq 0xd58d9(%rip), %rdx     # 0xf3a11
movq 0x8(%rsp), %rdi
movl $0x18, %ecx
movq %r14, %r8
jmp 0x1e0cb
movq %r15, %rdi
callq 0x8060
leaq 0x20(%rsp), %rdi
movl $0x400, %esi            # imm = 0x400
movq %r15, %rdx
callq 0x8540
testq %rax, %rax
je 0x1e203
xorl %r14d, %r14d
leaq 0x20(%rsp), %r12
leaq 0x4(%rsp), %r13
movq 0x18(%rsp), %rbp
movq %r12, %rdi
movq %r13, %rsi
leaq 0x820(%rsp), %rdx
leaq 0x420(%rsp), %rcx
movq %rbx, %r8
callq 0x1e253
testl %eax, %eax
jne 0x1e212
cmpl $0x1, 0x4(%rsp)
jne 0x1e1ea
movslq %r14d, %r14
movq %r14, %rbx
shlq $0xa, %rbx
movq 0x10(%rbp), %rdi
addq %rbx, %rdi
leaq 0x820(%rsp), %rsi
callq 0x8350
addq 0x18(%rbp), %rbx
movq %rbx, %rdi
movq 0x8(%rsp), %rbx
leaq 0x420(%rsp), %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 0x1e17c
movq %r15, %rdi
callq 0x83a0
xorl %eax, %eax
jmp 0x1e0d7
leaq 0xd31d7(%rip), %rsi     # 0xf13f0
leaq 0xd5802(%rip), %rdx     # 0xf3a22
movq %rbx, %r14
leaq 0xc20(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30c2c
leaq 0xd2df5(%rip), %rsi     # 0xf1034
leaq 0xd57cb(%rip), %rdx     # 0xf3a11
movq %r14, %rdi
movl $0x22, %ecx
jmp 0x1e0c8