// File: /workspace/github_c_makefile_star2_O3/PoulinV[P]AxiCLASS/build/../source/input.c
// Function: input_find_file
int input_find_file(int argc,
                    char **argv,
                    struct file_content * fc,
                    ErrorMsg errmsg){

  /** Summary: */

  /** Define local variables */
  struct file_content fc_input;       // Temporary structure with all input parameters
  struct file_content fc_precision;   // Temporary structure with all precision parameters
  struct file_content * pfc_input;    // Pointer to either fc_root or fc_inputroot
  struct file_content fc_setroot;     // Temporary structure for setroot

  int i;
  char extension[5];
  char input_file[_ARGUMENT_LENGTH_MAX_];
  char precision_file[_ARGUMENT_LENGTH_MAX_];

  pfc_input = &fc_input;

  /** Initialize the two file_content structures (for input parameters and
      precision parameters) to some null content. If no arguments are passed,
      they will remain null and inform input_init that all parameters take
      default values. */
  fc->size = 0;
  fc_input.size = 0;
  fc_precision.size = 0;
  input_file[0]='\0';
  precision_file[0]='\0';

  /** If some arguments are passed, identify eventually some 'xxx.ini' and
      'xxx.pre' files, and store their name. */
  if (argc > 1) {
    for (i=1; i<argc; i++) {
      strncpy(extension,(argv[i]+strlen(argv[i])-4),4);
      extension[4]='\0';
      if (strcmp(extension,".ini") == 0) {
        class_test(input_file[0] != '\0',
                   errmsg,
                   "You have passed more than one input file with extension '.ini', choose one.");
        strcpy(input_file,argv[i]);
      }
      else if (strcmp(extension,".pre") == 0) {
        class_test(precision_file[0] != '\0',
                   errmsg,
                   "You have passed more than one precision with extension '.pre', choose one.");
        strcpy(precision_file,argv[i]);
      }
      else {
        fprintf(stdout,"Warning: the file '%s' has an extension different from .ini and .pre, so it has been ignored\n",argv[i]);
      }
    }
  }

  /** If there is an 'xxx.ini' file, read it and store its content. */
  if (input_file[0] != '\0'){
    class_call(parser_read_file(input_file,&fc_input,errmsg),
               errmsg,
               errmsg);

    /* *
     * Set correctly the pfc_input within the set_root function,
     * including the adjusted 'root' field.
     * It is either set to a pointer to fc_input,
     * or when a new filecontent is created with root appended,
     * it is set as the pointer to fc_setroot.
     * */
    class_call(input_set_root(input_file,&pfc_input,&fc_setroot,errmsg),
               errmsg,
               errmsg);
  }

  /** If there is an 'xxx.pre' file, read it and store its content. */
  if (precision_file[0] != '\0'){
    class_call(parser_read_file(precision_file,&fc_precision,errmsg),
               errmsg,
               errmsg);
  }

  /** If one or two files were read, merge their contents in a single 'file_content'
      structure. */
  if ((input_file[0]!='\0') || (precision_file[0]!='\0')){
    class_call(parser_cat(pfc_input,
                          &fc_precision,
                          fc,
                          errmsg),
               errmsg,
               errmsg);
  }

  /** Free local strutures */
  class_call(parser_free(pfc_input),
             errmsg,
             errmsg);
  class_call(parser_free(&fc_precision),
             errmsg,
             errmsg);

  return _SUCCESS_;

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1878, %rsp           # imm = 0x1878
movq %rcx, %r14
leaq 0x48(%rsp), %rcx
movq %rcx, 0x18(%rsp)
xorl %eax, %eax
movl %eax, 0x8(%rdx)
movl %eax, 0x8(%rcx)
movl %eax, 0x28(%rsp)
movb %al, 0x70(%rsp)
movb %al, 0x470(%rsp)
cmpl $0x2, %edi
jl 0x317fb
movq %rsi, %r15
movq %rdx, 0x10(%rsp)
movq %r14, 0x8(%rsp)
movl %edi, %ebp
movl $0x1, %r13d
leaq 0x3(%rsp), %r12
movl $0x6572702e, %ebx       # imm = 0x6572702E
movq (%r15,%r13,8), %r14
movq %r14, %rdi
callq 0x8180
leaq (%r14,%rax), %rsi
addq $-0x4, %rsi
movl $0x4, %edx
movq %r12, %rdi
callq 0x81e0
movb $0x0, 0x7(%rsp)
cmpl $0x696e692e, 0x3(%rsp)  # imm = 0x696E692E
je 0x315c7
movl 0x3(%rsp), %eax
xorl %ebx, %eax
movzbl 0x7(%rsp), %ecx
orl %eax, %ecx
je 0x315d9
movq 0x1179af(%rip), %rax    # 0x148f60
movq (%rax), %rdi
leaq 0xc1974(%rip), %rsi     # 0xf2f2f
movq %r14, %rdx
xorl %eax, %eax
callq 0x84e0
jmp 0x315f7
cmpb $0x0, 0x70(%rsp)
jne 0x3166c
leaq 0x70(%rsp), %rdi
jmp 0x315ef
cmpb $0x0, 0x470(%rsp)
jne 0x3178b
leaq 0x470(%rsp), %rdi
movq %r14, %rsi
callq 0x8350
incq %r13
cmpq %r13, %rbp
jne 0x3156b
cmpb $0x0, 0x70(%rsp)
movq 0x8(%rsp), %r14
je 0x31721
leaq 0x70(%rsp), %rdi
leaq 0x48(%rsp), %rsi
movq %r14, %rdx
callq 0x1df90
cmpl $0x1, %eax
jne 0x316c5
leaq 0xbcdbb(%rip), %rsi     # 0xee3f0
leaq 0xc1951(%rip), %rdx     # 0xf2f8d
leaq 0x870(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30af0
leaq 0xbc9dc(%rip), %rsi     # 0xee034
leaq 0xc1856(%rip), %rdx     # 0xf2eb5
movq %r14, %rdi
movl $0xa3, %ecx
jmp 0x318f2
leaq 0xc17e0(%rip), %rsi     # 0xf2e53
leaq 0x870(%rsp), %rbx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x30af0
leaq 0xbc9f6(%rip), %rsi     # 0xee082
leaq 0xc180c(%rip), %rdx     # 0xf2e9f
leaq 0x1070(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x30af0
leaq 0xbc985(%rip), %rsi     # 0xee034
leaq 0xc17ff(%rip), %rdx     # 0xf2eb5
movq 0x8(%rsp), %rdi
movl $0x90, %ecx
jmp 0x317df
leaq 0x70(%rsp), %rdi
leaq 0x18(%rsp), %rsi
leaq 0x1070(%rsp), %rdx
movq %r14, %rcx
callq 0x31c59
testl %eax, %eax
je 0x31721
leaq 0xbcd06(%rip), %rsi     # 0xee3f0
leaq 0xc18ca(%rip), %rdx     # 0xf2fbb
leaq 0x870(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30af0
leaq 0xbc927(%rip), %rsi     # 0xee034
leaq 0xc17a1(%rip), %rdx     # 0xf2eb5
movq %r14, %rdi
movl $0xae, %ecx
jmp 0x318f2
cmpb $0x0, 0x470(%rsp)
je 0x317e7
leaq 0x470(%rsp), %rdi
leaq 0x20(%rsp), %rsi
movq %r14, %rdx
callq 0x1df90
cmpl $0x1, %eax
jne 0x317eb
leaq 0xbcc9c(%rip), %rsi     # 0xee3f0
leaq 0xc1899(%rip), %rdx     # 0xf2ff4
leaq 0x870(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30af0
leaq 0xbc8bd(%rip), %rsi     # 0xee034
leaq 0xc1737(%rip), %rdx     # 0xf2eb5
movq %r14, %rdi
movl $0xb5, %ecx
jmp 0x318f2
leaq 0xc1738(%rip), %rsi     # 0xf2eca
leaq 0x870(%rsp), %rbx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x30af0
leaq 0xbc8d7(%rip), %rsi     # 0xee082
leaq 0xc1763(%rip), %rdx     # 0xf2f15
leaq 0x1070(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x30af0
leaq 0xbc866(%rip), %rsi     # 0xee034
leaq 0xc16e0(%rip), %rdx     # 0xf2eb5
movq 0x8(%rsp), %rdi
movl $0x96, %ecx
movq %r14, %r8
jmp 0x318f5
xorl %eax, %eax
jmp 0x317f6
cmpb $0x0, 0x470(%rsp)
setne %al
movq 0x10(%rsp), %rdx
cmpb $0x0, 0x70(%rsp)
movq 0x18(%rsp), %rbx
jne 0x3180b
testb %al, %al
je 0x3185e
leaq 0x20(%rsp), %rsi
movq %rbx, %rdi
movq %r14, %rcx
callq 0x1f5f0
cmpl $0x1, %eax
jne 0x3185e
leaq 0xbcbc9(%rip), %rsi     # 0xee3f0
leaq 0xc17fc(%rip), %rdx     # 0xf302a
leaq 0x870(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30af0
leaq 0xbc7ea(%rip), %rsi     # 0xee034
leaq 0xc1664(%rip), %rdx     # 0xf2eb5
movq %r14, %rdi
movl $0xc0, %ecx
jmp 0x318f2
movq %rbx, %rdi
callq 0x1e705
cmpl $0x1, %eax
jne 0x318a6
leaq 0xbcb7e(%rip), %rsi     # 0xee3f0
leaq 0xc17e2(%rip), %rdx     # 0xf305b
leaq 0x870(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30af0
leaq 0xbc79f(%rip), %rsi     # 0xee034
leaq 0xc1619(%rip), %rdx     # 0xf2eb5
movq %r14, %rdi
movl $0xc6, %ecx
jmp 0x318f2
leaq 0x20(%rsp), %rdi
callq 0x1e705
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x1, %ecx
jne 0x31901
leaq 0xbcb30(%rip), %rsi     # 0xee3f0
leaq 0xc17ab(%rip), %rdx     # 0xf3072
leaq 0x870(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30af0
leaq 0xbc751(%rip), %rsi     # 0xee034
leaq 0xc15cb(%rip), %rdx     # 0xf2eb5
movq %r14, %rdi
movl $0xc9, %ecx
movq %rbx, %r8
xorl %eax, %eax
callq 0x30af0
movl $0x1, %eax
addq $0x1878, %rsp           # imm = 0x1878
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq