// File: /workspace/github_c_makefile_star2_O2/PoulinV[P]AxiCLASS/build/../external/HyRec2020/hydrogen.c
// Function: allocate_and_read_fit
void allocate_and_read_fit(FIT_FUNC *fit, int *error, char *path_to_hyrec, char error_message[SIZE_ErrorM]){

  char sub_message[128];

  /*********** Effective rates *************/
  char *fit_file;
  fit_file = malloc(SIZE_InputFile);
  fit_file[0] = 0;
  strcat(fit_file, path_to_hyrec);
  strcat(fit_file, FIT_FILE);

  FILE *fA = fopen(fit_file, "r");
  if (fA == NULL) {
    sprintf(sub_message, "in allocate_and_read_fit: could not open file %s \n", fit_file);
    strcat(error_message, sub_message);
    *error = 1;
    return;
  }
  unsigned i, j;

  /* Allocate memory */
  fit->swift_func[0] = create_1D_array(DKK_SIZE, error, error_message);
  fit->swift_func[1] = create_1D_array(DKK_SIZE, error, error_message);
  fit->swift_func[2] = create_1D_array(DKK_SIZE, error, error_message);
  fit->swift_func[3] = create_1D_array(DKK_SIZE, error, error_message);
  fit->swift_func[4] = create_1D_array(DKK_SIZE, error, error_message);

  for (i = 0; i < DKK_SIZE; i++) {
    for (j = 0; j < 5; j++) {
      if( fscanf(fA,"%le", &(fit->swift_func[j][i])) != 1){
        sprintf(sub_message, "in allocate_and_read_atomic: could not read file %s completely -- The file might be corrupted\n", fit_file);
        strcat(error_message, sub_message);
        *error = 1;
        return;
      }
    }
  }
  fclose(fA);
  free(fit_file);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rcx, %r14
movq %rdx, %r13
movq %rsi, %rbx
movq %rdi, %r12
movl $0x200, %edi            # imm = 0x200
callq 0x8490
movq %rax, %r15
movb $0x0, (%rax)
movq %rax, %rdi
movq %r13, %rsi
callq 0x8690
movq %r15, %rdi
callq 0x8190
movabsq $0x666977735f746966, %rcx # imm = 0x666977735F746966
movq %rcx, (%r15,%rax)
movabsq $0x7461642e746669, %rcx # imm = 0x7461642E746669
movq %rcx, 0x6(%r15,%rax)
leaq 0x36203(%rip), %rsi     # 0x103c64
movq %r15, %rdi
callq 0x8420
testq %rax, %rax
je 0xcdb6b
movq %rax, %r13
movq %r15, 0x8(%rsp)
movl $0x109, %edi            # imm = 0x109
movq %rbx, %rsi
movq %r14, %rdx
callq 0xcbe5a
movq %rax, (%r12)
movl $0x109, %edi            # imm = 0x109
movq %rbx, %rsi
movq %r14, %rdx
callq 0xcbe5a
movq %rax, 0x8(%r12)
movl $0x109, %edi            # imm = 0x109
movq %rbx, %rsi
movq %r14, %rdx
callq 0xcbe5a
movq %rax, 0x10(%r12)
movl $0x109, %edi            # imm = 0x109
movq %rbx, %rsi
movq %r14, %rdx
callq 0xcbe5a
movq %rax, 0x18(%r12)
movl $0x109, %edi            # imm = 0x109
movq %rbx, 0x18(%rsp)
movq %rbx, %rsi
movq %r14, 0x10(%rsp)
movq %r14, %rdx
callq 0xcbe5a
movq %rax, 0x20(%r12)
leaq 0x4ff4f(%rip), %rbp     # 0x11da42
xorl %ebx, %ebx
cmpq $0x109, %rbx            # imm = 0x109
je 0xcdba7
leaq (,%rbx,8), %r14
xorl %r15d, %r15d
cmpq $0x5, %r15
je 0xcdb31
movq (%r12,%r15,8), %rdx
addq %r14, %rdx
movq %r13, %rdi
movq %rbp, %rsi
xorl %eax, %eax
callq 0x86c0
incq %r15
cmpl $0x1, %eax
je 0xcdb0d
jmp 0xcdb36
incq %rbx
jmp 0xcdaf5
leaq 0x537f9(%rip), %rsi     # 0x121336
leaq 0x20(%rsp), %r12
movq %r12, %rdi
movq 0x8(%rsp), %rdx
xorl %eax, %eax
callq 0x8090
movq 0x10(%rsp), %rdi
movq %r12, %rsi
callq 0x8690
movq 0x18(%rsp), %rax
movl $0x1, (%rax)
jmp 0xcdb95
leaq 0x53847(%rip), %rsi     # 0x1213b9
leaq 0x20(%rsp), %r12
movq %r12, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x8090
movq %r14, %rdi
movq %r12, %rsi
callq 0x8690
movl $0x1, (%rbx)
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r13, %rdi
callq 0x83c0
movq 0x8(%rsp), %rdi
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x8430