// File: /workspace/github_c_makefile_star2_O0/PoulinV[P]AxiCLASS/build/../source/perturbations.c
// Function: perturbations_timescale
int perturbations_timescale(
                            double tau,
                            void * parameters_and_workspace,
                            double * timescale,
                            ErrorMsg error_message
                            ) {
  /** Summary: */

  /** - define local variables */

  /* (a) time scale of Fourier mode, \f$ \tau_k = 1/k \f$ */
  double tau_k;
  /* (b) time scale of expansion, \f$ \tau_h = a/a' \f$ */
  double tau_h;
  /* (c) time scale of recombination, \f$ \tau_{\gamma} = 1/\kappa' \f$ */
  double tau_c;

  /* various pointers allowing to extract the fields of the
     parameter_and_workspace input structure */
  struct perturbations_parameters_and_workspace * pppaw;
  struct background * pba;
  struct thermodynamics * pth;
  struct perturbations * ppt;
  struct perturbations_workspace * ppw;
  double * pvecback;
  double * pvecthermo;

  /** - extract the fields of the parameter_and_workspace input structure */
  pppaw = (struct perturbations_parameters_and_workspace *)parameters_and_workspace;
  pba = pppaw->pba;
  pth = pppaw->pth;
  ppt = pppaw->ppt;
  ppw = pppaw->ppw;
  pvecback = ppw->pvecback;
  pvecthermo = ppw->pvecthermo;

  /** - compute Fourier mode time scale = \f$ \tau_k = 1/k \f$ */

  class_test(pppaw->k == 0.,
             ppt->error_message,
             "stop to avoid division by zero");

  tau_k = 1./pppaw->k;

  /** - evaluate background quantities with background_at_tau() and
      Hubble time scale \f$ \tau_h = a/a' \f$ */

  class_call(background_at_tau(pba,tau, normal_info, (interpolation_method)ppw->inter_mode, &(ppw->last_index_back), pvecback),
             pba->error_message,
             error_message);

  class_test(pvecback[pba->index_bg_H]*pvecback[pba->index_bg_a] == 0.,
             error_message,
             "aH=0, stop to avoid division by zero");

  tau_h = 1./(pvecback[pba->index_bg_H]*pvecback[pba->index_bg_a]);

  /** - for scalars modes: */

  if ((ppt->has_scalars == _TRUE_) && (pppaw->index_md == ppt->index_md_scalars)) {

    *timescale = tau_h;

    if ((ppw->approx[ppw->index_ap_rsa] == (int)rsa_off) || (pba->has_ncdm == _TRUE_))
      *timescale = MIN(tau_k,*timescale);

    if (ppw->approx[ppw->index_ap_tca] == (int)tca_off) {

      class_call(thermodynamics_at_z(pba,
                                     pth,
                                     1./pvecback[pba->index_bg_a]-1.,  /* redshift z=1/a-1 */
                                     (interpolation_method)ppw->inter_mode,
                                     &(ppw->last_index_thermo),
                                     pvecback,
                                     pvecthermo),
                 pth->error_message,
                 error_message);

      if (pvecthermo[pth->index_th_dkappa] != 0.) {

        /** - -->  compute recombination time scale for photons, \f$ \tau_{\gamma} = 1/ \kappa' \f$ */

        tau_c = 1./pvecthermo[pth->index_th_dkappa];

        *timescale = MIN(tau_c,*timescale);

      }
    }

  }

  /** - for vector modes: */

  if ((ppt->has_vectors == _TRUE_) && (pppaw->index_md == ppt->index_md_vectors)) {

    *timescale = MIN(tau_h,tau_k);

    if (ppw->approx[ppw->index_ap_tca] == (int)tca_off) {

      class_call(thermodynamics_at_z(pba,
                                     pth,
                                     1./pvecback[pba->index_bg_a]-1.,  /* redshift z=1/a-1 */
                                     (interpolation_method)ppw->inter_mode,
                                     &(ppw->last_index_thermo),
                                     pvecback,
                                     pvecthermo),
                 pth->error_message,
                 error_message);

      if (pvecthermo[pth->index_th_dkappa] != 0.) {

        /** - -->  compute recombination time scale for photons, \f$ \tau_{\gamma} = 1/ \kappa' \f$ */

        tau_c = 1./pvecthermo[pth->index_th_dkappa];

        *timescale = MIN(tau_c,*timescale);

      }
    }
  }

  /** - for tensor modes: */

  if ((ppt->has_tensors == _TRUE_) && (pppaw->index_md == ppt->index_md_tensors)) {

    *timescale = MIN(tau_h,tau_k);

    if (ppw->approx[ppw->index_ap_tca] == (int)tca_off) {

      class_call(thermodynamics_at_z(pba,
                                     pth,
                                     1./pvecback[pba->index_bg_a]-1.,  /* redshift z=1/a-1 */
                                     (interpolation_method)ppw->inter_mode,
                                     &(ppw->last_index_thermo),
                                     pvecback,
                                     pvecthermo),
                 pth->error_message,
                 error_message);

      if (pvecthermo[pth->index_th_dkappa] != 0.) {

        /** - --> compute recombination time scale for photons, \f$ \tau_{\gamma} = 1/ \kappa' \f$ */

        tau_c = 1./pvecthermo[pth->index_th_dkappa];

        *timescale = MIN(tau_c,*timescale);

      }
    }
  }

  return _SUCCESS_;
}

// Assembly:
subq $0x40a8, %rsp           # imm = 0x40A8
movsd %xmm0, 0x4098(%rsp)
movq %rdi, 0x4090(%rsp)
movq %rsi, 0x4088(%rsp)
movq %rdx, 0x4080(%rsp)
movq 0x4090(%rsp), %rax
movq %rax, 0x4060(%rsp)
movq 0x4060(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x4058(%rsp)
movq 0x4060(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x4050(%rsp)
movq 0x4060(%rsp), %rax
movq 0x18(%rax), %rax
movq %rax, 0x4048(%rsp)
movq 0x4060(%rsp), %rax
movq 0x38(%rax), %rax
movq %rax, 0x4040(%rsp)
movq 0x4040(%rsp), %rax
movq 0x30(%rax), %rax
movq %rax, 0x4038(%rsp)
movq 0x4040(%rsp), %rax
movq 0x38(%rax), %rax
movq %rax, 0x4030(%rsp)
movq 0x4060(%rsp), %rax
movsd 0x30(%rax), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0xf28e4
jp 0xf28e4
leaq 0x3830(%rsp), %rdi
leaq 0xe14ad(%rip), %rsi     # 0x1d3d24
movb $0x0, %al
callq 0x5b9c0
leaq 0x3030(%rsp), %rdi
leaq 0x3830(%rsp), %rcx
leaq 0xdf7ed(%rip), %rsi     # 0x1d2082
leaq 0x108e9e(%rip), %rdx    # 0x1fb73a
movb $0x0, %al
callq 0x5b9c0
movq 0x4048(%rsp), %rdi
addq $0x6c8a, %rdi           # imm = 0x6C8A
leaq 0x3030(%rsp), %r8
leaq 0xdf773(%rip), %rsi     # 0x1d2034
leaq 0x108e81(%rip), %rdx    # 0x1fb749
movl $0x1a3a, %ecx           # imm = 0x1A3A
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x40a4(%rsp)
jmp 0xf3192
movq 0x4060(%rsp), %rax
movsd 0xdf954(%rip), %xmm0    # 0x1d2248
divsd 0x30(%rax), %xmm0
movsd %xmm0, 0x4078(%rsp)
movq 0x4058(%rsp), %rdi
movsd 0x4098(%rsp), %xmm0
movq 0x4040(%rsp), %rax
movswl 0x154(%rax), %edx
movq 0x4040(%rsp), %rcx
addq $0x158, %rcx            # imm = 0x158
movq 0x4038(%rsp), %r8
movl $0x1, %esi
callq 0x9e9b0
cmpl $0x1, %eax
jne 0xf29ae
leaq 0x2830(%rsp), %rdi
movq 0x4058(%rsp), %rcx
addq $0xd1c, %rcx            # imm = 0xD1C
leaq 0xdfa72(%rip), %rsi     # 0x1d23d8
leaq 0x108df4(%rip), %rdx    # 0x1fb761
movb $0x0, %al
callq 0x5b9c0
movq 0x4080(%rsp), %rdi
leaq 0x2830(%rsp), %r8
leaq 0xdf6a9(%rip), %rsi     # 0x1d2034
leaq 0x108db7(%rip), %rdx    # 0x1fb749
movl $0x1a43, %ecx           # imm = 0x1A43
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x40a4(%rsp)
jmp 0xf3192
movq 0x4038(%rsp), %rax
movq 0x4058(%rsp), %rcx
movslq 0x384(%rcx), %rcx
movsd (%rax,%rcx,8), %xmm0
movq 0x4038(%rsp), %rax
movq 0x4058(%rsp), %rcx
movslq 0x380(%rcx), %rcx
mulsd (%rax,%rcx,8), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0xf2a66
jp 0xf2a66
leaq 0x2030(%rsp), %rdi
leaq 0x1089f0(%rip), %rsi    # 0x1fb3f0
movb $0x0, %al
callq 0x5b9c0
leaq 0x1830(%rsp), %rdi
leaq 0x2030(%rsp), %rcx
leaq 0xdf664(%rip), %rsi     # 0x1d2082
leaq 0x108dae(%rip), %rdx    # 0x1fb7d3
movb $0x0, %al
callq 0x5b9c0
movq 0x4080(%rsp), %rdi
leaq 0x1830(%rsp), %r8
leaq 0xdf5f1(%rip), %rsi     # 0x1d2034
leaq 0x108cff(%rip), %rdx    # 0x1fb749
movl $0x1a47, %ecx           # imm = 0x1A47
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x40a4(%rsp)
jmp 0xf3192
movq 0x4038(%rsp), %rax
movq 0x4058(%rsp), %rcx
movslq 0x384(%rcx), %rcx
movsd (%rax,%rcx,8), %xmm1
movq 0x4038(%rsp), %rax
movq 0x4058(%rsp), %rcx
movslq 0x380(%rcx), %rcx
mulsd (%rax,%rcx,8), %xmm1
movsd 0xdf7a2(%rip), %xmm0    # 0x1d2248
divsd %xmm1, %xmm0
movsd %xmm0, 0x4070(%rsp)
movq 0x4048(%rsp), %rax
movswl 0xe(%rax), %eax
cmpl $0x1, %eax
jne 0xf2d34
movq 0x4060(%rsp), %rax
movl 0x20(%rax), %eax
movq 0x4048(%rsp), %rcx
cmpl 0x848(%rcx), %eax
jne 0xf2d34
movsd 0x4070(%rsp), %xmm0
movq 0x4088(%rsp), %rax
movsd %xmm0, (%rax)
movq 0x4040(%rsp), %rax
movq 0x180(%rax), %rax
movq 0x4040(%rsp), %rcx
movslq 0x164(%rcx), %rcx
cmpl $0x0, (%rax,%rcx,4)
je 0xf2b34
movq 0x4058(%rsp), %rax
movswl 0x4be(%rax), %eax
cmpl $0x1, %eax
jne 0xf2b84
movsd 0x4078(%rsp), %xmm1
movq 0x4088(%rsp), %rax
movsd (%rax), %xmm0
ucomisd %xmm1, %xmm0
jbe 0xf2b60
movsd 0x4078(%rsp), %xmm0
movsd %xmm0, 0x28(%rsp)
jmp 0xf2b72
movq 0x4088(%rsp), %rax
movsd (%rax), %xmm0
movsd %xmm0, 0x28(%rsp)
movsd 0x28(%rsp), %xmm0
movq 0x4088(%rsp), %rax
movsd %xmm0, (%rax)
movq 0x4040(%rsp), %rax
movq 0x180(%rax), %rax
movq 0x4040(%rsp), %rcx
movslq 0x160(%rcx), %rcx
cmpl $0x1, (%rax,%rcx,4)
jne 0xf2d32
movq 0x4058(%rsp), %rdi
movq 0x4050(%rsp), %rsi
movq 0x4038(%rsp), %rax
movq 0x4058(%rsp), %rcx
movslq 0x380(%rcx), %rcx
movsd 0xdf66d(%rip), %xmm0    # 0x1d2248
divsd (%rax,%rcx,8), %xmm0
movsd 0xdf660(%rip), %xmm1    # 0x1d2248
subsd %xmm1, %xmm0
movq 0x4040(%rsp), %rax
movswl 0x154(%rax), %edx
movq 0x4040(%rsp), %rcx
addq $0x15c, %rcx            # imm = 0x15C
movq 0x4038(%rsp), %r8
movq 0x4030(%rsp), %r9
callq 0xb05b0
cmpl $0x1, %eax
jne 0xf2c8a
leaq 0x1030(%rsp), %rdi
movq 0x4050(%rsp), %rcx
addq $0x1064, %rcx           # imm = 0x1064
leaq 0xdf796(%rip), %rsi     # 0x1d23d8
leaq 0x108bc4(%rip), %rdx    # 0x1fb80d
movb $0x0, %al
callq 0x5b9c0
movq 0x4080(%rsp), %rdi
leaq 0x1030(%rsp), %r8
leaq 0xdf3cd(%rip), %rsi     # 0x1d2034
leaq 0x108adb(%rip), %rdx    # 0x1fb749
movl $0x1a5e, %ecx           # imm = 0x1A5E
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x40a4(%rsp)
jmp 0xf3192
movq 0x4030(%rsp), %rax
movq 0x4050(%rsp), %rcx
movslq 0xe80(%rcx), %rcx
movsd (%rax,%rcx,8), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0xf2cb3
jp 0xf2cb3
jmp 0xf2d30
movq 0x4030(%rsp), %rax
movq 0x4050(%rsp), %rcx
movslq 0xe80(%rcx), %rcx
movsd 0xdf576(%rip), %xmm0    # 0x1d2248
divsd (%rax,%rcx,8), %xmm0
movsd %xmm0, 0x4068(%rsp)
movsd 0x4068(%rsp), %xmm1
movq 0x4088(%rsp), %rax
movsd (%rax), %xmm0
ucomisd %xmm1, %xmm0
jbe 0xf2d0c
movsd 0x4068(%rsp), %xmm0
movsd %xmm0, 0x20(%rsp)
jmp 0xf2d1e
movq 0x4088(%rsp), %rax
movsd (%rax), %xmm0
movsd %xmm0, 0x20(%rsp)
movsd 0x20(%rsp), %xmm0
movq 0x4088(%rsp), %rax
movsd %xmm0, (%rax)
jmp 0xf2d32
jmp 0xf2d34
movq 0x4048(%rsp), %rax
movswl 0x10(%rax), %eax
cmpl $0x1, %eax
jne 0xf2f62
movq 0x4060(%rsp), %rax
movl 0x20(%rax), %eax
movq 0x4048(%rsp), %rcx
cmpl 0x850(%rcx), %eax
jne 0xf2f62
movsd 0x4070(%rsp), %xmm1
movsd 0x4078(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0xf2d91
movsd 0x4070(%rsp), %xmm0
movsd %xmm0, 0x18(%rsp)
jmp 0xf2da0
movsd 0x4078(%rsp), %xmm0
movsd %xmm0, 0x18(%rsp)
movsd 0x18(%rsp), %xmm0
movq 0x4088(%rsp), %rax
movsd %xmm0, (%rax)
movq 0x4040(%rsp), %rax
movq 0x180(%rax), %rax
movq 0x4040(%rsp), %rcx
movslq 0x160(%rcx), %rcx
cmpl $0x1, (%rax,%rcx,4)
jne 0xf2f60
movq 0x4058(%rsp), %rdi
movq 0x4050(%rsp), %rsi
movq 0x4038(%rsp), %rax
movq 0x4058(%rsp), %rcx
movslq 0x380(%rcx), %rcx
movsd 0xdf43f(%rip), %xmm0    # 0x1d2248
divsd (%rax,%rcx,8), %xmm0
movsd 0xdf432(%rip), %xmm1    # 0x1d2248
subsd %xmm1, %xmm0
movq 0x4040(%rsp), %rax
movswl 0x154(%rax), %edx
movq 0x4040(%rsp), %rcx
addq $0x15c, %rcx            # imm = 0x15C
movq 0x4038(%rsp), %r8
movq 0x4030(%rsp), %r9
callq 0xb05b0
cmpl $0x1, %eax
jne 0xf2eb8
leaq 0x830(%rsp), %rdi
movq 0x4050(%rsp), %rcx
addq $0x1064, %rcx           # imm = 0x1064
leaq 0xdf568(%rip), %rsi     # 0x1d23d8
leaq 0x108996(%rip), %rdx    # 0x1fb80d
movb $0x0, %al
callq 0x5b9c0
movq 0x4080(%rsp), %rdi
leaq 0x830(%rsp), %r8
leaq 0xdf19f(%rip), %rsi     # 0x1d2034
leaq 0x1088ad(%rip), %rdx    # 0x1fb749
movl $0x1a7d, %ecx           # imm = 0x1A7D
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x40a4(%rsp)
jmp 0xf3192
movq 0x4030(%rsp), %rax
movq 0x4050(%rsp), %rcx
movslq 0xe80(%rcx), %rcx
movsd (%rax,%rcx,8), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0xf2ee1
jp 0xf2ee1
jmp 0xf2f5e
movq 0x4030(%rsp), %rax
movq 0x4050(%rsp), %rcx
movslq 0xe80(%rcx), %rcx
movsd 0xdf348(%rip), %xmm0    # 0x1d2248
divsd (%rax,%rcx,8), %xmm0
movsd %xmm0, 0x4068(%rsp)
movsd 0x4068(%rsp), %xmm1
movq 0x4088(%rsp), %rax
movsd (%rax), %xmm0
ucomisd %xmm1, %xmm0
jbe 0xf2f3a
movsd 0x4068(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
jmp 0xf2f4c
movq 0x4088(%rsp), %rax
movsd (%rax), %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x10(%rsp), %xmm0
movq 0x4088(%rsp), %rax
movsd %xmm0, (%rax)
jmp 0xf2f60
jmp 0xf2f62
movq 0x4048(%rsp), %rax
movswl 0x12(%rax), %eax
cmpl $0x1, %eax
jne 0xf3187
movq 0x4060(%rsp), %rax
movl 0x20(%rax), %eax
movq 0x4048(%rsp), %rcx
cmpl 0x84c(%rcx), %eax
jne 0xf3187
movsd 0x4070(%rsp), %xmm1
movsd 0x4078(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0xf2fbf
movsd 0x4070(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
jmp 0xf2fce
movsd 0x4078(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0x8(%rsp), %xmm0
movq 0x4088(%rsp), %rax
movsd %xmm0, (%rax)
movq 0x4040(%rsp), %rax
movq 0x180(%rax), %rax
movq 0x4040(%rsp), %rcx
movslq 0x160(%rcx), %rcx
cmpl $0x1, (%rax,%rcx,4)
jne 0xf3185
movq 0x4058(%rsp), %rdi
movq 0x4050(%rsp), %rsi
movq 0x4038(%rsp), %rax
movq 0x4058(%rsp), %rcx
movslq 0x380(%rcx), %rcx
movsd 0xdf211(%rip), %xmm0    # 0x1d2248
divsd (%rax,%rcx,8), %xmm0
movsd 0xdf204(%rip), %xmm1    # 0x1d2248
subsd %xmm1, %xmm0
movq 0x4040(%rsp), %rax
movswl 0x154(%rax), %edx
movq 0x4040(%rsp), %rcx
addq $0x15c, %rcx            # imm = 0x15C
movq 0x4038(%rsp), %r8
movq 0x4030(%rsp), %r9
callq 0xb05b0
cmpl $0x1, %eax
jne 0xf30e0
leaq 0x30(%rsp), %rdi
movq 0x4050(%rsp), %rcx
addq $0x1064, %rcx           # imm = 0x1064
leaq 0xdf33d(%rip), %rsi     # 0x1d23d8
leaq 0x10876b(%rip), %rdx    # 0x1fb80d
movb $0x0, %al
callq 0x5b9c0
movq 0x4080(%rsp), %rdi
leaq 0x30(%rsp), %r8
leaq 0xdef77(%rip), %rsi     # 0x1d2034
leaq 0x108685(%rip), %rdx    # 0x1fb749
movl $0x1a9b, %ecx           # imm = 0x1A9B
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x40a4(%rsp)
jmp 0xf3192
movq 0x4030(%rsp), %rax
movq 0x4050(%rsp), %rcx
movslq 0xe80(%rcx), %rcx
movsd (%rax,%rcx,8), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0xf3109
jp 0xf3109
jmp 0xf3183
movq 0x4030(%rsp), %rax
movq 0x4050(%rsp), %rcx
movslq 0xe80(%rcx), %rcx
movsd 0xdf120(%rip), %xmm0    # 0x1d2248
divsd (%rax,%rcx,8), %xmm0
movsd %xmm0, 0x4068(%rsp)
movsd 0x4068(%rsp), %xmm1
movq 0x4088(%rsp), %rax
movsd (%rax), %xmm0
ucomisd %xmm1, %xmm0
jbe 0xf3161
movsd 0x4068(%rsp), %xmm0
movsd %xmm0, (%rsp)
jmp 0xf3172
movq 0x4088(%rsp), %rax
movsd (%rax), %xmm0
movsd %xmm0, (%rsp)
movsd (%rsp), %xmm0
movq 0x4088(%rsp), %rax
movsd %xmm0, (%rax)
jmp 0xf3185
jmp 0xf3187
movl $0x0, 0x40a4(%rsp)
movl 0x40a4(%rsp), %eax
addq $0x40a8, %rsp           # imm = 0x40A8
retq
nopw %cs:(%rax,%rax)