// File: /workspace/github_c_makefile_star2_O3/PoulinV[P]AxiCLASS/build/../source/transfer.c
// Function: transfer_radial_coordinates
int transfer_radial_coordinates(
                                struct transfer * ptr,
                                struct transfer_workspace * ptw,
                                int index_md,
                                int index_q
                                ) {

  int index_tau;
  double sqrt_absK=0.;

  switch (ptw->sgnK){
  case 1:
    sqrt_absK = sqrt(ptw->K);
    for (index_tau=0; index_tau < ptw->tau_size; index_tau++) {
      ptw->chi[index_tau] = sqrt_absK*ptw->tau0_minus_tau[index_tau];
      ptw->cscKgen[index_tau] = sqrt_absK/ptr->k[index_md][index_q]/sin(ptw->chi[index_tau]);
      ptw->cotKgen[index_tau] = ptw->cscKgen[index_tau]*cos(ptw->chi[index_tau]);
    }
    break;
  case 0:
    for (index_tau=0; index_tau < ptw->tau_size; index_tau++) {
      ptw->chi[index_tau] = ptr->k[index_md][index_q] * ptw->tau0_minus_tau[index_tau];
      ptw->cscKgen[index_tau] = 1.0/ptw->chi[index_tau];
      ptw->cotKgen[index_tau] = 1.0/ptw->chi[index_tau];
    }
    break;
  case -1:
    sqrt_absK = sqrt(-ptw->K);
    for (index_tau=0; index_tau < ptw->tau_size; index_tau++) {
      ptw->chi[index_tau] = sqrt_absK*ptw->tau0_minus_tau[index_tau];
      ptw->cscKgen[index_tau] = sqrt_absK/ptr->k[index_md][index_q]/sinh(ptw->chi[index_tau]);
      ptw->cotKgen[index_tau] = ptw->cscKgen[index_tau]*cosh(ptw->chi[index_tau]);
    }
    break;
  }

  return _SUCCESS_;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %ecx, %ebp
movl %edx, %r15d
movq %rsi, %rbx
movq %rdi, %r14
movl 0xc0(%rsi), %eax
cmpl $-0x1, %eax
je 0xac451
cmpl $0x1, %eax
je 0xac436
testl %eax, %eax
jne 0xac5f0
movslq 0x74(%rbx), %rax
testq %rax, %rax
jle 0xac5f0
movq 0x930(%r14), %rcx
movslq %r15d, %rdx
movq (%rcx,%rdx,8), %rcx
movslq %ebp, %rdx
movq 0x90(%rbx), %rsi
movq 0xa0(%rbx), %rdi
movq 0xa8(%rbx), %r8
movq 0xb0(%rbx), %r9
xorl %r10d, %r10d
movsd 0x41e66(%rip), %xmm0    # 0xee260
movsd (%rcx,%rdx,8), %xmm1
mulsd (%rsi,%r10,8), %xmm1
movsd %xmm1, (%rdi,%r10,8)
movapd %xmm0, %xmm2
divsd %xmm1, %xmm2
movsd %xmm2, (%r8,%r10,8)
movapd %xmm0, %xmm1
divsd (%rdi,%r10,8), %xmm1
movsd %xmm1, (%r9,%r10,8)
incq %r10
cmpq %r10, %rax
jne 0xac3fa
jmp 0xac5f0
movsd 0xb8(%rbx), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0xac483
xorps %xmm1, %xmm1
sqrtsd %xmm0, %xmm1
jmp 0xac48c
movsd 0xb8(%rbx), %xmm1
movapd 0x41dcf(%rip), %xmm0    # 0xee230
xorpd %xmm1, %xmm0
movsd 0x4509b(%rip), %xmm2    # 0xf1508
ucomisd %xmm1, %xmm2
jb 0xac53c
xorps %xmm1, %xmm1
sqrtsd %xmm0, %xmm1
jmp 0xac545
callq 0x82b0
movapd %xmm0, %xmm1
cmpl $0x0, 0x74(%rbx)
jle 0xac5f0
movslq %r15d, %r15
movslq %ebp, %r12
xorl %r13d, %r13d
movsd %xmm1, 0x10(%rsp)
movq 0x90(%rbx), %rax
movq 0xa0(%rbx), %rcx
movsd (%rax,%r13,8), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, (%rcx,%r13,8)
movq 0x930(%r14), %rax
movq (%rax,%r15,8), %rax
divsd (%rax,%r12,8), %xmm1
movsd %xmm1, 0x8(%rsp)
callq 0x80a0
movsd 0x8(%rsp), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
movq 0xa8(%rbx), %rax
movsd %xmm1, (%rax,%r13,8)
movq 0xa0(%rbx), %rax
movsd (%rax,%r13,8), %xmm0
callq 0x86a0
movsd 0x10(%rsp), %xmm1
mulsd 0x8(%rsp), %xmm0
movq 0xb0(%rbx), %rax
movsd %xmm0, (%rax,%r13,8)
incq %r13
movslq 0x74(%rbx), %rax
cmpq %rax, %r13
jl 0xac4a5
jmp 0xac5f0
callq 0x82b0
movapd %xmm0, %xmm1
cmpl $0x0, 0x74(%rbx)
jle 0xac5f0
movslq %r15d, %r15
movslq %ebp, %r12
xorl %r13d, %r13d
movsd %xmm1, 0x10(%rsp)
movq 0x90(%rbx), %rax
movq 0xa0(%rbx), %rcx
movsd (%rax,%r13,8), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, (%rcx,%r13,8)
movq 0x930(%r14), %rax
movq (%rax,%r15,8), %rax
divsd (%rax,%r12,8), %xmm1
movsd %xmm1, 0x8(%rsp)
callq 0x8370
movsd 0x8(%rsp), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
movq 0xa8(%rbx), %rax
movsd %xmm1, (%rax,%r13,8)
movq 0xa0(%rbx), %rax
movsd (%rax,%r13,8), %xmm0
callq 0x84a0
movsd 0x10(%rsp), %xmm1
mulsd 0x8(%rsp), %xmm0
movq 0xb0(%rbx), %rax
movsd %xmm0, (%rax,%r13,8)
incq %r13
movslq 0x74(%rbx), %rax
cmpq %rax, %r13
jl 0xac55e
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq