// File: /workspace/github_c_makefile_star2_O3/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 0x8460
movq %rax, %r15
movb $0x0, (%rax)
movq %rax, %rdi
movq %r13, %rsi
callq 0x8660
movq %r15, %rdi
callq 0x8180
movabsq $0x666977735f746966, %rcx # imm = 0x666977735F746966
movq %rcx, (%r15,%rax)
movabsq $0x7461642e746669, %rcx # imm = 0x7461642E746669
movq %rcx, 0x6(%r15,%rax)
leaq 0x377fe(%rip), %rsi     # 0x10cda4
movq %r15, %rdi
callq 0x8400
testq %rax, %rax
je 0xd56cb
movq %rax, %r13
movq %r15, 0x8(%rsp)
movl $0x109, %edi            # imm = 0x109
movq %rbx, %rsi
movq %r14, %rdx
callq 0xd3766
movq %rax, (%r12)
movl $0x109, %edi            # imm = 0x109
movq %rbx, %rsi
movq %r14, %rdx
callq 0xd3766
movq %rax, 0x8(%r12)
movl $0x109, %edi            # imm = 0x109
movq %rbx, %rsi
movq %r14, %rdx
callq 0xd3766
movq %rax, 0x10(%r12)
movl $0x109, %edi            # imm = 0x109
movq %rbx, %rsi
movq %r14, %rdx
callq 0xd3766
movq %rax, 0x18(%r12)
movl $0x109, %edi            # imm = 0x109
movq %rbx, 0x18(%rsp)
movq %rbx, %rsi
movq %r14, 0x10(%rsp)
movq %r14, %rdx
callq 0xd3766
movq %rax, 0x20(%r12)
leaq 0x5155a(%rip), %rbp     # 0x126b92
xorl %ebx, %ebx
leaq (,%rbx,8), %r14
xorl %r15d, %r15d
movq (%r12,%r15,8), %rdx
addq %r14, %rdx
movq %r13, %rdi
movq %rbp, %rsi
xorl %eax, %eax
callq 0x8690
cmpl $0x1, %eax
jne 0xd5696
incq %r15
cmpq $0x5, %r15
jne 0xd5645
incq %rbx
cmpq $0x109, %rbx            # imm = 0x109
jne 0xd563a
movq %r13, %rdi
callq 0x83a0
movq 0x8(%rsp), %rdi
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x8410
leaq 0x54e21(%rip), %rsi     # 0x12a4be
leaq 0x20(%rsp), %r12
movq %r12, %rdi
movq 0x8(%rsp), %rdx
xorl %eax, %eax
callq 0x8090
movq 0x10(%rsp), %rdi
movq %r12, %rsi
callq 0x8660
movq 0x18(%rsp), %rax
movl $0x1, (%rax)
jmp 0xd56f5
leaq 0x54e6f(%rip), %rsi     # 0x12a541
leaq 0x20(%rsp), %r12
movq %r12, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x8090
movq %r14, %rdi
movq %r12, %rsi
callq 0x8660
movl $0x1, (%rbx)
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq