// File: /workspace/github_c_makefile_star2_O2/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
movq %rdx, %r12
leaq 0x48(%rsp), %rax
movq %rax, 0x10(%rsp)
andl $0x0, 0x8(%rdx)
andl $0x0, 0x8(%rax)
andl $0x0, 0x28(%rsp)
xorl %eax, %eax
movb %al, 0x70(%rsp)
movb %al, 0x470(%rsp)
cmpl $0x2, %edi
jl 0x2ed13
movq %rsi, %r15
movq %r12, 0x18(%rsp)
movq %r14, (%rsp)
movl %edi, %r13d
pushq $0x1
popq %rbp
leaq 0xb(%rsp), %r12
pushq $0x5
popq %rbx
cmpq %rbp, %r13
je 0x2eb1e
movq (%r15,%rbp,8), %r14
movq %r14, %rdi
callq 0x8190
leaq (%r14,%rax), %rsi
addq $-0x4, %rsi
movq %r12, %rdi
pushq $0x4
popq %rdx
callq 0x8200
movb $0x0, 0xf(%rsp)
movq %r12, %rdi
leaq 0xbb4cd(%rip), %rsi     # 0xe9f74
movq %rbx, %rdx
callq 0x83f0
testl %eax, %eax
je 0x2eae6
movq %r12, %rdi
leaq 0xbb2d0(%rip), %rsi     # 0xe9d8d
movq %rbx, %rdx
callq 0x83f0
testl %eax, %eax
je 0x2eaf8
movq 0x114480(%rip), %rax    # 0x142f50
movq (%rax), %rdi
leaq 0xbb31d(%rip), %rsi     # 0xe9df7
movq %r14, %rdx
xorl %eax, %eax
callq 0x8510
jmp 0x2eb16
cmpb $0x0, 0x70(%rsp)
jne 0x2eb8b
leaq 0x70(%rsp), %rdi
jmp 0x2eb0e
cmpb $0x0, 0x470(%rsp)
jne 0x2eca9
leaq 0x470(%rsp), %rdi
movq %r14, %rsi
callq 0x8370
incq %rbp
jmp 0x2ea70
cmpb $0x0, 0x70(%rsp)
movq (%rsp), %r14
movq 0x18(%rsp), %r12
je 0x2ec3f
leaq 0x70(%rsp), %rdi
leaq 0x48(%rsp), %rsi
movq %r14, %rdx
callq 0x1bea4
cmpl $0x1, %eax
jne 0x2ebe3
leaq 0xb689c(%rip), %rsi     # 0xe53f0
leaq 0xbb2fa(%rip), %rdx     # 0xe9e55
leaq 0x870(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x2e014
leaq 0xb64bd(%rip), %rsi     # 0xe5034
leaq 0xbb1ff(%rip), %rdx     # 0xe9d7d
movq %r14, %rdi
movl $0xa3, %ecx
jmp 0x2ee0d
leaq 0xbb189(%rip), %rsi     # 0xe9d1b
leaq 0x870(%rsp), %rbx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2e014
leaq 0xb64d7(%rip), %rsi     # 0xe5082
leaq 0xbb1b5(%rip), %rdx     # 0xe9d67
leaq 0x1070(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x2e014
leaq 0xb6466(%rip), %rsi     # 0xe5034
leaq 0xbb1a8(%rip), %rdx     # 0xe9d7d
movq (%rsp), %rdi
movl $0x90, %ecx
jmp 0x2ecfc
leaq 0x70(%rsp), %rdi
leaq 0x10(%rsp), %rsi
leaq 0x1070(%rsp), %rdx
movq %r14, %rcx
callq 0x2f16f
testl %eax, %eax
je 0x2ec3f
leaq 0xb67e8(%rip), %rsi     # 0xe53f0
leaq 0xbb274(%rip), %rdx     # 0xe9e83
leaq 0x870(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x2e014
leaq 0xb6409(%rip), %rsi     # 0xe5034
leaq 0xbb14b(%rip), %rdx     # 0xe9d7d
movq %r14, %rdi
movl $0xae, %ecx
jmp 0x2ee0d
cmpb $0x0, 0x470(%rsp)
je 0x2ed04
leaq 0x470(%rsp), %rdi
leaq 0x20(%rsp), %rsi
movq %r14, %rdx
callq 0x1bea4
cmpl $0x1, %eax
jne 0x2ed08
leaq 0xb677e(%rip), %rsi     # 0xe53f0
leaq 0xbb243(%rip), %rdx     # 0xe9ebc
leaq 0x870(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x2e014
leaq 0xb639f(%rip), %rsi     # 0xe5034
leaq 0xbb0e1(%rip), %rdx     # 0xe9d7d
movq %r14, %rdi
movl $0xb5, %ecx
jmp 0x2ee0d
leaq 0xbb0e2(%rip), %rsi     # 0xe9d92
leaq 0x870(%rsp), %rbx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2e014
leaq 0xb63b9(%rip), %rsi     # 0xe5082
leaq 0xbb10d(%rip), %rdx     # 0xe9ddd
leaq 0x1070(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x2e014
leaq 0xb6348(%rip), %rsi     # 0xe5034
leaq 0xbb08a(%rip), %rdx     # 0xe9d7d
movq (%rsp), %rdi
movl $0x96, %ecx
movq %r14, %r8
jmp 0x2ee10
xorl %eax, %eax
jmp 0x2ed13
cmpb $0x0, 0x470(%rsp)
setne %al
cmpb $0x0, 0x70(%rsp)
movq 0x10(%rsp), %rbx
jne 0x2ed23
testb %al, %al
je 0x2ed79
leaq 0x20(%rsp), %rsi
movq %rbx, %rdi
movq %r12, %rdx
movq %r14, %rcx
callq 0x1d48c
cmpl $0x1, %eax
jne 0x2ed79
leaq 0xb66ae(%rip), %rsi     # 0xe53f0
leaq 0xbb1a9(%rip), %rdx     # 0xe9ef2
leaq 0x870(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x2e014
leaq 0xb62cf(%rip), %rsi     # 0xe5034
leaq 0xbb011(%rip), %rdx     # 0xe9d7d
movq %r14, %rdi
movl $0xc0, %ecx
jmp 0x2ee0d
movq %rbx, %rdi
callq 0x1c593
cmpl $0x1, %eax
jne 0x2edc1
leaq 0xb6663(%rip), %rsi     # 0xe53f0
leaq 0xbb18f(%rip), %rdx     # 0xe9f23
leaq 0x870(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x2e014
leaq 0xb6284(%rip), %rsi     # 0xe5034
leaq 0xbafc6(%rip), %rdx     # 0xe9d7d
movq %r14, %rdi
movl $0xc6, %ecx
jmp 0x2ee0d
leaq 0x20(%rsp), %rdi
callq 0x1c593
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x1, %ecx
jne 0x2ee1a
leaq 0xb6615(%rip), %rsi     # 0xe53f0
leaq 0xbb158(%rip), %rdx     # 0xe9f3a
leaq 0x870(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x2e014
leaq 0xb6236(%rip), %rsi     # 0xe5034
leaq 0xbaf78(%rip), %rdx     # 0xe9d7d
movq %r14, %rdi
movl $0xc9, %ecx
movq %rbx, %r8
xorl %eax, %eax
callq 0x2e014
pushq $0x1
popq %rax
addq $0x1878, %rsp           # imm = 0x1878
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq