// File: /workspace/github_c_makefile_star2_O2/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 0xa6df4
cmpl $0x1, %eax
je 0xa6ddc
testl %eax, %eax
jne 0xa6f79
movl 0x74(%rbx), %eax
movslq %r15d, %rcx
movslq %ebp, %rdx
xorl %esi, %esi
testl %eax, %eax
cmovlel %esi, %eax
movsd 0x3e4e5(%rip), %xmm0    # 0xe5260
cmpq %rsi, %rax
je 0xa6f79
movq 0x930(%r14), %rdi
movq (%rdi,%rcx,8), %rdi
movsd (%rdi,%rdx,8), %xmm1
movq 0x90(%rbx), %rdi
movq 0xa0(%rbx), %r8
mulsd (%rdi,%rsi,8), %xmm1
movsd %xmm1, (%r8,%rsi,8)
movapd %xmm0, %xmm2
divsd %xmm1, %xmm2
movq 0xa8(%rbx), %rdi
movsd %xmm2, (%rdi,%rsi,8)
movapd %xmm0, %xmm1
divsd (%r8,%rsi,8), %xmm1
movq 0xb0(%rbx), %rdi
movsd %xmm1, (%rdi,%rsi,8)
incq %rsi
jmp 0xa6d7b
movsd 0xb8(%rbx), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0xa6e23
sqrtsd %xmm0, %xmm0
jmp 0xa6e28
movsd 0xb8(%rbx), %xmm1
movapd 0x3e42c(%rip), %xmm0    # 0xe5230
xorpd %xmm1, %xmm0
movsd 0x416b8(%rip), %xmm2    # 0xe84c8
ucomisd %xmm1, %xmm2
jb 0xa6ece
sqrtsd %xmm0, %xmm0
jmp 0xa6ed3
callq 0x82d0
movsd %xmm0, 0x10(%rsp)
movslq %r15d, %r15
movslq %ebp, %r12
xorl %r13d, %r13d
movslq 0x74(%rbx), %rax
cmpq %rax, %r13
jge 0xa6f79
movq 0x90(%rbx), %rax
movq 0xa0(%rbx), %rcx
movsd (%rax,%r13,8), %xmm0
movsd 0x10(%rsp), %xmm1
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 0x86d0
mulsd 0x8(%rsp), %xmm0
movq 0xb0(%rbx), %rax
movsd %xmm0, (%rax,%r13,8)
incq %r13
jmp 0xa6e37
callq 0x82d0
movsd %xmm0, 0x10(%rsp)
movslq %r15d, %r15
movslq %ebp, %r12
xorl %r13d, %r13d
movslq 0x74(%rbx), %rax
cmpq %rax, %r13
jge 0xa6f79
movq 0x90(%rbx), %rax
movq 0xa0(%rbx), %rcx
movsd (%rax,%r13,8), %xmm0
movsd 0x10(%rsp), %xmm1
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 0x8390
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 0x84d0
mulsd 0x8(%rsp), %xmm0
movq 0xb0(%rbx), %rax
movsd %xmm0, (%rax,%r13,8)
incq %r13
jmp 0xa6ee2
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq