// File: /workspace/github_c_makefile_star2_O2/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 $0x1c38, %rsp           # imm = 0x1C38
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r12
leaq 0xe7d9f(%rip), %rsi     # 0x103c64
callq 0x8420
testq %rax, %rax
je 0x1bf41
movq %rax, %r15
movq %r12, 0x18(%rsp)
movq %rbx, 0x20(%rsp)
movq %r14, 0x10(%rsp)
xorl %ebp, %ebp
leaq 0x1030(%rsp), %r13
leaq 0xc(%rsp), %r14
leaq 0xc30(%rsp), %r12
leaq 0x830(%rsp), %rbx
movq %r13, %rdi
movl $0x400, %esi            # imm = 0x400
movq %r15, %rdx
callq 0x8570
testq %rax, %rax
je 0x1bf7d
movq %r13, %rdi
movq %r14, %rsi
movq %r12, %rdx
movq %rbx, %rcx
movq 0x10(%rsp), %r8
callq 0x1c178
testl %eax, %eax
jne 0x1bfd8
xorl %eax, %eax
cmpl $0x1, 0xc(%rsp)
sete %al
addl %eax, %ebp
jmp 0x1bf00
leaq 0xcba60(%rip), %rsi     # 0xe79a8
leaq 0xcba84(%rip), %rdx     # 0xe79d3
leaq 0xcba87(%rip), %r8      # 0xe79dd
leaq 0x30(%rsp), %rbx
movq %rbx, %rdi
movq %r12, %rcx
xorl %eax, %eax
callq 0x2e014
leaq 0xc90c5(%rip), %rsi     # 0xe5034
leaq 0xcba6b(%rip), %rdx     # 0xe79e1
pushq $0xe
jmp 0x1c00d
testl %ebp, %ebp
je 0x1c030
movq 0x20(%rsp), %rdi
movl %ebp, %esi
movq 0x18(%rsp), %rdx
movq 0x10(%rsp), %r14
movq %r14, %rcx
callq 0x1c40b
testl %eax, %eax
je 0x1c089
leaq 0xc9443(%rip), %rsi     # 0xe53f0
leaq 0xcba9a(%rip), %rdx     # 0xe7a4e
leaq 0x30(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x2e014
leaq 0xc9067(%rip), %rsi     # 0xe5034
leaq 0xcba0d(%rip), %rdx     # 0xe79e1
pushq $0x1c
jmp 0x1c00d
leaq 0xc9411(%rip), %rsi     # 0xe53f0
leaq 0xcba0c(%rip), %rdx     # 0xe79f2
leaq 0x30(%rsp), %rbx
movq %rbx, %rdi
movq 0x10(%rsp), %r14
movq %r14, %rcx
xorl %eax, %eax
callq 0x2e014
leaq 0xc9030(%rip), %rsi     # 0xe5034
leaq 0xcb9d6(%rip), %rdx     # 0xe79e1
pushq $0x12
popq %rcx
movq %r14, %rdi
movq %rbx, %r8
xorl %eax, %eax
callq 0x2e014
pushq $0x1
popq %rax
addq $0x1c38, %rsp           # imm = 0x1C38
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xcb9ed(%rip), %rsi     # 0xe7a24
leaq 0x30(%rsp), %rbx
movq %rbx, %rdi
movq 0x18(%rsp), %rdx
xorl %eax, %eax
callq 0x2e014
leaq 0xc9030(%rip), %rsi     # 0xe5082
leaq 0xcb9e8(%rip), %rdx     # 0xe7a41
leaq 0x1430(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x2e014
leaq 0xc8fbf(%rip), %rsi     # 0xe5034
leaq 0xcb965(%rip), %rdx     # 0xe79e1
pushq $0x18
popq %rcx
movq 0x10(%rsp), %rdi
movq %r14, %r8
jmp 0x1c014
movq %r15, %rdi
callq 0x8060
xorl %ebx, %ebx
leaq 0x1030(%rsp), %r12
leaq 0xc30(%rsp), %rbp
leaq 0x830(%rsp), %r13
movq %r12, %rdi
movl $0x400, %esi            # imm = 0x400
movq %r15, %rdx
callq 0x8570
testq %rax, %rax
je 0x1c134
movq %r12, %rdi
leaq 0xc(%rsp), %rsi
movq %rbp, %rdx
movq %r13, %rcx
movq %r14, %r8
callq 0x1c178
testl %eax, %eax
jne 0x1c143
cmpl $0x1, 0xc(%rsp)
jne 0x1c0ab
movl %ebx, %eax
movq %rax, 0x28(%rsp)
movl %ebx, 0x18(%rsp)
movq %rax, %rbx
shlq $0xa, %rbx
movq 0x20(%rsp), %r14
movq 0x10(%r14), %rdi
addq %rbx, %rdi
movq %rbp, %rsi
callq 0x8370
addq 0x18(%r14), %rbx
movq %rbx, %rdi
movl 0x18(%rsp), %ebx
movq %r13, %rsi
callq 0x8370
movq 0x20(%r14), %rax
movq 0x28(%rsp), %rcx
andw $0x0, (%rax,%rcx,2)
movq 0x10(%rsp), %r14
incl %ebx
jmp 0x1c0ab
movq %r15, %rdi
callq 0x83c0
xorl %eax, %eax
jmp 0x1c01e
leaq 0xc92a6(%rip), %rsi     # 0xe53f0
leaq 0xcb8a1(%rip), %rdx     # 0xe79f2
leaq 0x30(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x2e014
leaq 0xc8eca(%rip), %rsi     # 0xe5034
leaq 0xcb870(%rip), %rdx     # 0xe79e1
pushq $0x22
jmp 0x1c00d