// File: /workspace/github_c_makefile_star2_O1/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, 0x8(%rsp)
leaq 0x48(%rsp), %rax
movq %rax, 0x10(%rsp)
xorl %ecx, %ecx
movq %rdx, 0x18(%rsp)
movl %ecx, 0x8(%rdx)
movl %ecx, 0x8(%rax)
movl %ecx, 0x28(%rsp)
movb %cl, 0x70(%rsp)
movb %cl, 0x470(%rsp)
cmpl $0x2, %edi
jl 0x3173c
movq %rsi, %r15
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 0x31700
movl 0x3(%rsp), %eax
xorl %ebx, %eax
movzbl 0x7(%rsp), %ecx
orl %eax, %ecx
je 0x31712
movq 0x11a856(%rip), %rax    # 0x14bf40
movq (%rax), %rdi
leaq 0xc4813(%rip), %rsi     # 0xf5f07
movq %r14, %rdx
xorl %eax, %eax
callq 0x84e0
jmp 0x31730
cmpb $0x0, 0x70(%rsp)
jne 0x31917
leaq 0x70(%rsp), %rdi
jmp 0x31728
cmpb $0x0, 0x470(%rsp)
jne 0x319c5
leaq 0x470(%rsp), %rdi
movq %r14, %rsi
callq 0x8350
incq %r13
cmpq %r13, %rbp
jne 0x316a4
cmpb $0x0, 0x70(%rsp)
movq 0x8(%rsp), %r14
je 0x317fd
leaq 0x70(%rsp), %rdi
leaq 0x48(%rsp), %rsi
movq %r14, %rdx
callq 0x1df28
cmpl $0x1, %eax
jne 0x317a1
leaq 0xbfc86(%rip), %rsi     # 0xf13f0
leaq 0xc47f4(%rip), %rdx     # 0xf5f65
leaq 0x870(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30c2c
leaq 0xbf8a7(%rip), %rsi     # 0xf1034
leaq 0xc46f9(%rip), %rdx     # 0xf5e8d
movq %r14, %rdi
movl $0xa3, %ecx
jmp 0x319c0
leaq 0x70(%rsp), %rdi
leaq 0x10(%rsp), %rsi
leaq 0x1070(%rsp), %rdx
movq %r14, %rcx
callq 0x31d91
testl %eax, %eax
je 0x317fd
leaq 0xbfc2a(%rip), %rsi     # 0xf13f0
leaq 0xc47c6(%rip), %rdx     # 0xf5f93
leaq 0x870(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30c2c
leaq 0xbf84b(%rip), %rsi     # 0xf1034
leaq 0xc469d(%rip), %rdx     # 0xf5e8d
movq %r14, %rdi
movl $0xae, %ecx
jmp 0x319c0
cmpb $0x0, 0x470(%rsp)
je 0x3185f
leaq 0x470(%rsp), %rdi
leaq 0x20(%rsp), %rsi
movq %r14, %rdx
callq 0x1df28
cmpl $0x1, %eax
jne 0x3185f
leaq 0xbfbc8(%rip), %rsi     # 0xf13f0
leaq 0xc479d(%rip), %rdx     # 0xf5fcc
leaq 0x870(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30c2c
leaq 0xbf7e9(%rip), %rsi     # 0xf1034
leaq 0xc463b(%rip), %rdx     # 0xf5e8d
movq %r14, %rdi
movl $0xb5, %ecx
jmp 0x319c0
movb 0x470(%rsp), %al
orb 0x70(%rsp), %al
je 0x318c6
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq %r14, %rcx
callq 0x1f57a
cmpl $0x1, %eax
jne 0x318c6
leaq 0xbfb61(%rip), %rsi     # 0xf13f0
leaq 0xc476c(%rip), %rdx     # 0xf6002
leaq 0x870(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30c2c
leaq 0xbf782(%rip), %rsi     # 0xf1034
leaq 0xc45d4(%rip), %rdx     # 0xf5e8d
movq %r14, %rdi
movl $0xc0, %ecx
jmp 0x319c0
movq 0x10(%rsp), %rdi
callq 0x1e68f
cmpl $0x1, %eax
jne 0x31970
leaq 0xbfb10(%rip), %rsi     # 0xf13f0
leaq 0xc474c(%rip), %rdx     # 0xf6033
leaq 0x870(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30c2c
leaq 0xbf731(%rip), %rsi     # 0xf1034
leaq 0xc4583(%rip), %rdx     # 0xf5e8d
movq %r14, %rdi
movl $0xc6, %ecx
jmp 0x319c0
leaq 0xc450d(%rip), %rsi     # 0xf5e2b
leaq 0x870(%rsp), %rbx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x30c2c
leaq 0xbf74b(%rip), %rsi     # 0xf1082
leaq 0xc4539(%rip), %rdx     # 0xf5e77
leaq 0x1070(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x30c2c
leaq 0xbf6da(%rip), %rsi     # 0xf1034
leaq 0xc452c(%rip), %rdx     # 0xf5e8d
movq 0x8(%rsp), %rdi
movl $0x90, %ecx
jmp 0x31a19
leaq 0x20(%rsp), %rdi
callq 0x1e68f
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x1, %ecx
jne 0x31a28
leaq 0xbfa62(%rip), %rsi     # 0xf13f0
leaq 0xc46b5(%rip), %rdx     # 0xf604a
leaq 0x870(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30c2c
leaq 0xbf683(%rip), %rsi     # 0xf1034
leaq 0xc44d5(%rip), %rdx     # 0xf5e8d
movq %r14, %rdi
movl $0xc9, %ecx
movq %rbx, %r8
jmp 0x31a1c
leaq 0xc44d6(%rip), %rsi     # 0xf5ea2
leaq 0x870(%rsp), %rbx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x30c2c
leaq 0xbf69d(%rip), %rsi     # 0xf1082
leaq 0xc4501(%rip), %rdx     # 0xf5eed
leaq 0x1070(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x30c2c
leaq 0xbf62c(%rip), %rsi     # 0xf1034
leaq 0xc447e(%rip), %rdx     # 0xf5e8d
movq 0x8(%rsp), %rdi
movl $0x96, %ecx
movq %r14, %r8
xorl %eax, %eax
callq 0x30c2c
movl $0x1, %eax
addq $0x1878, %rsp           # imm = 0x1878
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq