// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x3c38, %rsp           # imm = 0x3C38
movq %rdi, 0x3c28(%rsp)
movq %rsi, 0x3c20(%rsp)
movq %rdx, 0x3c18(%rsp)
movq 0x3c28(%rsp), %rdi
leaq 0x1b95c9(%rip), %rsi    # 0x1f0c37
callq 0x8410
movq %rax, 0x3c10(%rsp)
cmpq $0x0, 0x3c10(%rsp)
jne 0x376ec
leaq 0x2800(%rsp), %rdi
movq 0x3c28(%rsp), %rcx
leaq 0x19d333(%rip), %rsi    # 0x1d49d0
leaq 0x19d357(%rip), %rdx    # 0x1d49fb
leaq 0x19d35a(%rip), %r8     # 0x1d4a05
movb $0x0, %al
callq 0x5b9c0
movq 0x3c18(%rsp), %rdi
leaq 0x2800(%rsp), %r8
leaq 0x19a96b(%rip), %rsi    # 0x1d2034
leaq 0x19d339(%rip), %rdx    # 0x1d4a09
movl $0xe, %ecx
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x3c34(%rsp)
jmp 0x37a40
movl $0x0, 0x380c(%rsp)
leaq 0x3810(%rsp), %rdi
movq 0x3c10(%rsp), %rdx
movl $0x400, %esi            # imm = 0x400
callq 0x8530
cmpq $0x0, %rax
je 0x377cc
leaq 0x3810(%rsp), %rdi
leaq 0x3400(%rsp), %rdx
leaq 0x3000(%rsp), %rcx
movq 0x3c18(%rsp), %r8
leaq 0x3808(%rsp), %rsi
callq 0x37a50
cmpl $0x1, %eax
jne 0x377ac
leaq 0x2000(%rsp), %rdi
movq 0x3c18(%rsp), %rcx
leaq 0x19ac74(%rip), %rsi    # 0x1d23d8
leaq 0x19d2af(%rip), %rdx    # 0x1d4a1a
movb $0x0, %al
callq 0x5b9c0
movq 0x3c18(%rsp), %rdi
leaq 0x2000(%rsp), %r8
leaq 0x19a8ab(%rip), %rsi    # 0x1d2034
leaq 0x19d279(%rip), %rdx    # 0x1d4a09
movl $0x12, %ecx
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x3c34(%rsp)
jmp 0x37a40
cmpl $0x1, 0x3808(%rsp)
jne 0x377c7
movl 0x380c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x380c(%rsp)
jmp 0x376f7
cmpl $0x0, 0x380c(%rsp)
jne 0x37853
leaq 0x1800(%rsp), %rdi
movq 0x3c28(%rsp), %rdx
leaq 0x19d25f(%rip), %rsi    # 0x1d4a4c
movb $0x0, %al
callq 0x5b9c0
leaq 0x1000(%rsp), %rdi
leaq 0x1800(%rsp), %rcx
leaq 0x19a877(%rip), %rsi    # 0x1d2082
leaq 0x19d257(%rip), %rdx    # 0x1d4a69
movb $0x0, %al
callq 0x5b9c0
movq 0x3c18(%rsp), %rdi
leaq 0x1000(%rsp), %r8
leaq 0x19a804(%rip), %rsi    # 0x1d2034
leaq 0x19d1d2(%rip), %rdx    # 0x1d4a09
movl $0x18, %ecx
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x3c34(%rsp)
jmp 0x37a40
movq 0x3c20(%rsp), %rdi
movl 0x380c(%rsp), %esi
movq 0x3c28(%rsp), %rdx
movq 0x3c18(%rsp), %rcx
callq 0x37fb0
cmpl $0x1, %eax
jne 0x378db
leaq 0x800(%rsp), %rdi
movq 0x3c18(%rsp), %rcx
leaq 0x19ab45(%rip), %rsi    # 0x1d23d8
leaq 0x19d1dc(%rip), %rdx    # 0x1d4a76
movb $0x0, %al
callq 0x5b9c0
movq 0x3c18(%rsp), %rdi
leaq 0x800(%rsp), %r8
leaq 0x19a77c(%rip), %rsi    # 0x1d2034
leaq 0x19d14a(%rip), %rdx    # 0x1d4a09
movl $0x1c, %ecx
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x3c34(%rsp)
jmp 0x37a40
movq 0x3c10(%rsp), %rdi
callq 0x8060
movl $0x0, 0x380c(%rsp)
leaq 0x3810(%rsp), %rdi
movq 0x3c10(%rsp), %rdx
movl $0x400, %esi            # imm = 0x400
callq 0x8530
cmpq $0x0, %rax
je 0x37a28
leaq 0x3810(%rsp), %rdi
leaq 0x3400(%rsp), %rdx
leaq 0x3000(%rsp), %rcx
movq 0x3c18(%rsp), %r8
leaq 0x3808(%rsp), %rsi
callq 0x37a50
cmpl $0x1, %eax
jne 0x3799e
movq %rsp, %rdi
movq 0x3c18(%rsp), %rcx
leaq 0x19aa7d(%rip), %rsi    # 0x1d23d8
leaq 0x19d0b8(%rip), %rdx    # 0x1d4a1a
movb $0x0, %al
callq 0x5b9c0
movq 0x3c18(%rsp), %rdi
movq %rsp, %r8
leaq 0x19a6b9(%rip), %rsi    # 0x1d2034
leaq 0x19d087(%rip), %rdx    # 0x1d4a09
movl $0x22, %ecx
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x3c34(%rsp)
jmp 0x37a40
cmpl $0x1, 0x3808(%rsp)
jne 0x37a23
movq 0x3c20(%rsp), %rax
movq 0x10(%rax), %rdi
movslq 0x380c(%rsp), %rax
shlq $0xa, %rax
addq %rax, %rdi
leaq 0x3400(%rsp), %rsi
callq 0x8370
movq 0x3c20(%rsp), %rax
movq 0x18(%rax), %rdi
movslq 0x380c(%rsp), %rax
shlq $0xa, %rax
addq %rax, %rdi
leaq 0x3000(%rsp), %rsi
callq 0x8370
movq 0x3c20(%rsp), %rax
movq 0x20(%rax), %rax
movslq 0x380c(%rsp), %rcx
movw $0x0, (%rax,%rcx,2)
movl 0x380c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x380c(%rsp)
jmp 0x378f3
movq 0x3c10(%rsp), %rdi
callq 0x83c0
movl $0x0, 0x3c34(%rsp)
movl 0x3c34(%rsp), %eax
addq $0x3c38, %rsp           # imm = 0x3C38
retq
nop