// File: /workspace/github_c_makefile_star2_O0/PoulinV[P]AxiCLASS/build/../source/thermodynamics.c
// Function: thermodynamics_calculate_conformal_drag_time
int thermodynamics_calculate_conformal_drag_time(
                                                 struct background* pba,
                                                 struct thermodynamics* pth,
                                                 double* pvecback
                                                 ) {

  /** Summary: */

  /** Define local variables */
  double R;
  int index_tau;
  int last_index_back;

  /** - compute minus the baryon drag interaction rate time, -dkappa_d/dtau = -[1/R * kappa'], with R = 3 rho_b / 4 rho_gamma,
      stored temporarily in column ddkappa */

  /* find the value of last_index_back for tau_table[0] in order to speed up subsequent interpolations in the loop */
  class_call(background_at_tau(pba,
                               pth->tau_table[0],
                               normal_info,
                               inter_normal,
                               &last_index_back,
                               pvecback),
             pba->error_message,
             pth->error_message);

  for (index_tau=0; index_tau < pth->tt_size; index_tau++) {

    class_call(background_at_tau(pba,
                                 pth->tau_table[index_tau],
                                 normal_info,
                                 inter_closeby,
                                 &last_index_back,
                                 pvecback),
               pba->error_message,
               pth->error_message);

    R = 3./4.*pvecback[pba->index_bg_rho_b]/pvecback[pba->index_bg_rho_g];

    pth->thermodynamics_table[index_tau*pth->th_size+pth->index_th_ddkappa] =
      -1./R*pth->thermodynamics_table[index_tau*pth->th_size+pth->index_th_dkappa];

  }

  /** - compute second derivative of this rate, -[1/R * kappa']'', stored temporarily in column dddkappa */
  class_call(array_spline_table_line_to_line(pth->tau_table,
                                             pth->tt_size,
                                             pth->thermodynamics_table,
                                             pth->th_size,
                                             pth->index_th_ddkappa,
                                             pth->index_th_dddkappa,
                                             _SPLINE_EST_DERIV_,
                                             pth->error_message),
             pth->error_message,
             pth->error_message);

  /** - compute tau_d = [int_{tau_today}^{tau} dtau -dkappa_d/dtau] */
  class_call(array_integrate_spline_table_line_to_line(pth->tau_table,
                                                       pth->tt_size,
                                                       pth->thermodynamics_table,
                                                       pth->th_size,
                                                       pth->index_th_ddkappa,
                                                       pth->index_th_dddkappa,
                                                       pth->index_th_tau_d,
                                                       pth->error_message),
             pth->error_message,
             pth->error_message);

  return _SUCCESS_;
}

// Assembly:
subq $0x2048, %rsp           # imm = 0x2048
movq %rdi, 0x2038(%rsp)
movq %rsi, 0x2030(%rsp)
movq %rdx, 0x2028(%rsp)
movq 0x2038(%rsp), %rdi
movq 0x2030(%rsp), %rax
movq 0xf18(%rax), %rax
movsd (%rax), %xmm0
movq 0x2028(%rsp), %r8
movl $0x1, %esi
xorl %edx, %edx
leaq 0x2018(%rsp), %rcx
callq 0x9e9b0
cmpl $0x1, %eax
jne 0xbff18
leaq 0x1810(%rsp), %rdi
movq 0x2038(%rsp), %rcx
addq $0xd1c, %rcx            # imm = 0xD1C
leaq 0x11250f(%rip), %rsi    # 0x1d23d8
leaq 0x13461f(%rip), %rdx    # 0x1f44ef
movb $0x0, %al
callq 0x5b9c0
movq 0x2030(%rsp), %rdi
addq $0x1064, %rdi           # imm = 0x1064
leaq 0x1810(%rsp), %r8
leaq 0x11213f(%rip), %rsi    # 0x1d2034
leaq 0x134654(%rip), %rdx    # 0x1f4550
movl $0xc6f, %ecx            # imm = 0xC6F
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x2044(%rsp)
jmp 0xc02b6
movl $0x0, 0x201c(%rsp)
movl 0x201c(%rsp), %eax
movq 0x2030(%rsp), %rcx
cmpl 0xf08(%rcx), %eax
jge 0xc00d6
movq 0x2038(%rsp), %rdi
movq 0x2030(%rsp), %rax
movq 0xf18(%rax), %rax
movslq 0x201c(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq 0x2028(%rsp), %r8
movl $0x1, %edx
leaq 0x2018(%rsp), %rcx
movl %edx, %esi
callq 0x9e9b0
cmpl $0x1, %eax
jne 0xbfff0
leaq 0x1010(%rsp), %rdi
movq 0x2038(%rsp), %rcx
addq $0xd1c, %rcx            # imm = 0xD1C
leaq 0x112437(%rip), %rsi    # 0x1d23d8
leaq 0x1345d5(%rip), %rdx    # 0x1f457d
movb $0x0, %al
callq 0x5b9c0
movq 0x2030(%rsp), %rdi
addq $0x1064, %rdi           # imm = 0x1064
leaq 0x1010(%rsp), %r8
leaq 0x112067(%rip), %rsi    # 0x1d2034
leaq 0x13457c(%rip), %rdx    # 0x1f4550
movl $0xc7a, %ecx            # imm = 0xC7A
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x2044(%rsp)
jmp 0xc02b6
movq 0x2028(%rsp), %rax
movq 0x2038(%rsp), %rcx
movslq 0x390(%rcx), %rcx
movsd 0x112cb9(%rip), %xmm0   # 0x1d2cc8
mulsd (%rax,%rcx,8), %xmm0
movq 0x2028(%rsp), %rax
movq 0x2038(%rsp), %rcx
movslq 0x38c(%rcx), %rcx
divsd (%rax,%rcx,8), %xmm0
movsd %xmm0, 0x2020(%rsp)
movsd 0x11278f(%rip), %xmm0   # 0x1d27d0
divsd 0x2020(%rsp), %xmm0
movq 0x2030(%rsp), %rax
movq 0xf20(%rax), %rax
movl 0x201c(%rsp), %ecx
movq 0x2030(%rsp), %rdx
imull 0xf04(%rdx), %ecx
movq 0x2030(%rsp), %rdx
addl 0xe80(%rdx), %ecx
movslq %ecx, %rcx
mulsd (%rax,%rcx,8), %xmm0
movq 0x2030(%rsp), %rax
movq 0xf20(%rax), %rax
movl 0x201c(%rsp), %ecx
movq 0x2030(%rsp), %rdx
imull 0xf04(%rdx), %ecx
movq 0x2030(%rsp), %rdx
addl 0xe88(%rdx), %ecx
movslq %ecx, %rcx
movsd %xmm0, (%rax,%rcx,8)
movl 0x201c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x201c(%rsp)
jmp 0xbff23
movq 0x2030(%rsp), %rax
movq 0xf18(%rax), %rdi
movq 0x2030(%rsp), %rax
movl 0xf08(%rax), %esi
movq 0x2030(%rsp), %rax
movq 0xf20(%rax), %rdx
movq 0x2030(%rsp), %rax
movl 0xf04(%rax), %ecx
movq 0x2030(%rsp), %rax
movl 0xe88(%rax), %r8d
movq 0x2030(%rsp), %rax
movl 0xe8c(%rax), %r9d
movq 0x2030(%rsp), %rax
addq $0x1064, %rax           # imm = 0x1064
movl $0x1, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x1c1c0
cmpl $0x1, %eax
jne 0xc01bf
leaq 0x810(%rsp), %rdi
movq 0x2030(%rsp), %rcx
addq $0x1064, %rcx           # imm = 0x1064
leaq 0x112268(%rip), %rsi    # 0x1d23d8
leaq 0x134470(%rip), %rdx    # 0x1f45e7
movb $0x0, %al
callq 0x5b9c0
movq 0x2030(%rsp), %rdi
addq $0x1064, %rdi           # imm = 0x1064
leaq 0x810(%rsp), %r8
leaq 0x111e98(%rip), %rsi    # 0x1d2034
leaq 0x1343ad(%rip), %rdx    # 0x1f4550
movl $0xc8d, %ecx            # imm = 0xC8D
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x2044(%rsp)
jmp 0xc02b6
movq 0x2030(%rsp), %rax
movq 0xf18(%rax), %rdi
movq 0x2030(%rsp), %rax
movl 0xf08(%rax), %esi
movq 0x2030(%rsp), %rax
movq 0xf20(%rax), %rdx
movq 0x2030(%rsp), %rax
movl 0xf04(%rax), %ecx
movq 0x2030(%rsp), %rax
movl 0xe88(%rax), %r8d
movq 0x2030(%rsp), %rax
movl 0xe8c(%rax), %r9d
movq 0x2030(%rsp), %rax
movl 0xe84(%rax), %r10d
movq 0x2030(%rsp), %rax
addq $0x1064, %rax           # imm = 0x1064
movl %r10d, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x1ac60
cmpl $0x1, %eax
jne 0xc02ab
leaq 0x10(%rsp), %rdi
movq 0x2030(%rsp), %rcx
addq $0x1064, %rcx           # imm = 0x1064
leaq 0x112176(%rip), %rsi    # 0x1d23d8
leaq 0x13442b(%rip), %rdx    # 0x1f4694
movb $0x0, %al
callq 0x5b9c0
movq 0x2030(%rsp), %rdi
addq $0x1064, %rdi           # imm = 0x1064
leaq 0x10(%rsp), %r8
leaq 0x111da9(%rip), %rsi    # 0x1d2034
leaq 0x1342be(%rip), %rdx    # 0x1f4550
movl $0xc99, %ecx            # imm = 0xC99
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x2044(%rsp)
jmp 0xc02b6
movl $0x0, 0x2044(%rsp)
movl 0x2044(%rsp), %eax
addq $0x2048, %rsp           # imm = 0x2048
retq
nopw %cs:(%rax,%rax)