// File: /workspace/github_c_makefile_star2_O0/PoulinV[P]AxiCLASS/build/../external/HyRec2020/history.c
// Function: hyrec_allocate
void hyrec_allocate(HYREC_DATA *data, double zmax, double zmin) {
  double DLNA;
  if (MODEL == SWIFT) DLNA = DLNA_SWIFT;
  else DLNA = DLNA_HYREC;

  data->error = 0;
  data->error_message=malloc(SIZE_ErrorM);
  sprintf(data->error_message, "\n**** ERROR HAS OCCURRED in HYREC-2 ****\n");

  data->zmax = (zmax > 3000.? zmax : 3000.);
  data->zmin = zmin;

  data->atomic = (HYREC_ATOMIC *) malloc(sizeof(HYREC_ATOMIC));
  allocate_and_read_atomic(data->atomic, &data->error, data->path_to_hyrec, data->error_message);

  data->fit = (FIT_FUNC *) malloc(sizeof(FIT_FUNC));
  allocate_and_read_fit(data->fit, &data->error, data->path_to_hyrec, data->error_message);

  data->cosmo  = (REC_COSMOPARAMS *) malloc(sizeof(REC_COSMOPARAMS));
  data->cosmo->inj_params = (INJ_PARAMS *)  malloc(sizeof(INJ_PARAMS));

  data->Nz = (long int) (log((1.+zmax)/(1.+zmin))/DLNA) + 2;
  data->rad = (RADIATION *) malloc(sizeof(RADIATION));

  // For now assume that radiation field never needed over more than 1 decade in redshift
  // (typically from z ~ 1700 to 800 for recombination history)
  // Will have to adapt for outputting radiation fields at lower z
  if (MODEL == FULL)  allocate_radiation(data->rad, (long int) (log(10.)/DLNA), &data->error, data->error_message);

  data->xe_output = create_1D_array(data->Nz, &data->error, data->error_message);
  data->Tm_output = create_1D_array(data->Nz, &data->error, data->error_message);
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movsd %xmm0, 0x18(%rsp)
movsd %xmm1, 0x10(%rsp)
movsd 0x5b7d3(%rip), %xmm0    # 0x20e910
movsd %xmm0, 0x8(%rsp)
movq 0x20(%rsp), %rax
movl $0x0, 0x38(%rax)
movl $0x800, %edi            # imm = 0x800
callq 0x8460
movq %rax, %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x48(%rax)
movq 0x20(%rsp), %rax
movq 0x48(%rax), %rdi
leaq 0x5c600(%rip), %rsi     # 0x20f775
movb $0x0, %al
callq 0x8090
movsd 0x18(%rsp), %xmm0
movsd 0x5bb2e(%rip), %xmm1    # 0x20ecb8
ucomisd %xmm1, %xmm0
jbe 0x1b319d
movsd 0x18(%rsp), %xmm0
movsd %xmm0, (%rsp)
jmp 0x1b31ac
movsd 0x5bb13(%rip), %xmm0    # 0x20ecb8
movsd %xmm0, (%rsp)
jmp 0x1b31ac
movsd (%rsp), %xmm0
movq 0x20(%rsp), %rax
movsd %xmm0, 0x10(%rax)
movsd 0x10(%rsp), %xmm0
movq 0x20(%rsp), %rax
movsd %xmm0, 0x18(%rax)
movl $0x3848, %edi           # imm = 0x3848
callq 0x8460
movq %rax, %rcx
movq 0x20(%rsp), %rax
movq %rcx, (%rax)
movq 0x20(%rsp), %rax
movq (%rax), %rdi
movq 0x20(%rsp), %rsi
addq $0x38, %rsi
movq 0x20(%rsp), %rax
movq 0x50(%rax), %rdx
movq 0x20(%rsp), %rax
movq 0x48(%rax), %rcx
callq 0x1a7d50
movl $0x28, %edi
callq 0x8460
movq %rax, %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x60(%rax)
movq 0x20(%rsp), %rax
movq 0x60(%rax), %rdi
movq 0x20(%rsp), %rsi
addq $0x38, %rsi
movq 0x20(%rsp), %rax
movq 0x50(%rax), %rdx
movq 0x20(%rsp), %rax
movq 0x48(%rax), %rcx
callq 0x1a8590
movl $0xc0, %edi
callq 0x8460
movq %rax, %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x8(%rax)
movl $0x70, %edi
callq 0x8460
movq %rax, %rcx
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rax
movq %rcx, 0xb8(%rax)
movsd 0x1efc6(%rip), %xmm0    # 0x1d2248
addsd 0x18(%rsp), %xmm0
movsd 0x1efb8(%rip), %xmm1    # 0x1d2248
addsd 0x10(%rsp), %xmm1
divsd %xmm1, %xmm0
callq 0x82f0
divsd 0x8(%rsp), %xmm0
cvttsd2si %xmm0, %rcx
addq $0x2, %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x20(%rax)
movl $0x28, %edi
callq 0x8460
movq %rax, %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x58(%rax)
movq 0x20(%rsp), %rax
movq 0x20(%rax), %rax
movl %eax, %edi
movq 0x20(%rsp), %rsi
addq $0x38, %rsi
movq 0x20(%rsp), %rax
movq 0x48(%rax), %rdx
callq 0x1a5690
movq %rax, %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x28(%rax)
movq 0x20(%rsp), %rax
movq 0x20(%rax), %rax
movl %eax, %edi
movq 0x20(%rsp), %rsi
addq $0x38, %rsi
movq 0x20(%rsp), %rax
movq 0x48(%rax), %rdx
callq 0x1a5690
movq %rax, %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x30(%rax)
addq $0x28, %rsp
retq
nop