// File: /workspace/github_c_makefile_star2_O0/PoulinV[P]AxiCLASS/build/../source/transfer.c
// Function: transfer_compute_for_each_l
int transfer_compute_for_each_l(
                                struct transfer_workspace * ptw,
                                struct precision * ppr,
                                struct perturbations * ppt,
                                struct transfer * ptr,
                                int index_q,
                                int index_md,
                                int index_ic,
                                int index_tt,
                                int index_l,
                                double l,
                                double q_max_bessel,
                                radial_function_type radial_type,
                                short use_full_limber
                                ){

  /** Summary: */

  /** - define local variables */

  /* current wavenumber value */
  double q,k;

  /* value of transfer function */
  double transfer_function;

  /* whether to use the Limber approximation */
  short use_limber;

  /** - return zero transfer function if l is above l_max */
  if (index_l >= ptr->l_size_tt[index_md][index_tt]) {
     transfer_function = 0.;
  }
  else {

    if (ptr->transfer_verbose > 3)
      printf("Compute transfer for l=%d type=%d\n",(int)l,index_tt);

    if (use_full_limber == _FALSE_) {

      q = ptr->q[index_q];
      k = ptr->k[index_md][index_q];

      class_call(transfer_use_limber(ppr,
                                     ppt,
                                     ptr,
                                     q_max_bessel,
                                     index_md,
                                     index_tt,
                                     q,
                                     l,
                                     &use_limber),
                 ptr->error_message,
                 ptr->error_message);
    }
    else {
      q = ptr->q_limber[index_q];
      k = ptr->k_limber[index_md][index_q];
      use_limber = _TRUE_;
    }

    if (use_limber == _TRUE_) {

      class_call(transfer_limber(ptr,
                                 ptw,
                                 index_md,
                                 index_q,
                                 l,
                                 q,
                                 radial_type,
                                 &transfer_function),
                 ptr->error_message,
                 ptr->error_message);

    }
    else {
      class_call(transfer_integrate(
                                    ppt,
                                    ptr,
                                    ptw,
                                    index_q,
                                    index_md,
                                    index_tt,
                                    l,
                                    index_l,
                                    k,
                                    radial_type,
                                    &transfer_function
                                    ),
                 ptr->error_message,
                 ptr->error_message);
    }
  }

  /** - store transfer function in transfer structure */
  if (use_full_limber == _FALSE_) {
    ptr->transfer[index_md][((index_ic * ptr->tt_size[index_md] + index_tt)
                             * ptr->l_size[index_md] + index_l)
                            * ptr->q_size + index_q]
      = transfer_function;
  }
  else {
    ptr->transfer_limber[index_md][((index_ic * ptr->tt_size[index_md] + index_tt)
                                   * ptr->l_size[index_md] + index_l)
                                  * ptr->q_size_limber + index_q]
      = transfer_function;
  }

  return _SUCCESS_;

}

// Assembly:
subq $0x1888, %rsp           # imm = 0x1888
movw 0x18b0(%rsp), %ax
movl 0x18a8(%rsp), %eax
movl 0x18a0(%rsp), %eax
movl 0x1898(%rsp), %eax
movl 0x1890(%rsp), %eax
movq %rdi, 0x1878(%rsp)
movq %rsi, 0x1870(%rsp)
movq %rdx, 0x1868(%rsp)
movq %rcx, 0x1860(%rsp)
movl %r8d, 0x185c(%rsp)
movl %r9d, 0x1858(%rsp)
movsd %xmm0, 0x1850(%rsp)
movsd %xmm1, 0x1848(%rsp)
movl 0x18a0(%rsp), %eax
movq 0x1860(%rsp), %rcx
movq 0x8f8(%rcx), %rcx
movslq 0x1858(%rsp), %rdx
movq (%rcx,%rdx,8), %rcx
movslq 0x1898(%rsp), %rdx
cmpl (%rcx,%rdx,4), %eax
jl 0x140ebd
xorps %xmm0, %xmm0
movsd %xmm0, 0x1830(%rsp)
jmp 0x141222
movq 0x1860(%rsp), %rax
movswl 0x968(%rax), %eax
cmpl $0x3, %eax
jle 0x140eef
cvttsd2si 0x1850(%rsp), %esi
movl 0x1898(%rsp), %edx
leaq 0xc32b4(%rip), %rdi     # 0x20419c
movb $0x0, %al
callq 0x8030
movswl 0x18b0(%rsp), %eax
cmpl $0x0, %eax
jne 0x141019
movq 0x1860(%rsp), %rax
movq 0x928(%rax), %rax
movslq 0x185c(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, 0x1840(%rsp)
movq 0x1860(%rsp), %rax
movq 0x930(%rax), %rax
movslq 0x1858(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movslq 0x185c(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, 0x1838(%rsp)
movq 0x1870(%rsp), %rdi
movq 0x1868(%rsp), %rsi
movq 0x1860(%rsp), %rdx
movsd 0x1848(%rsp), %xmm0
movl 0x1858(%rsp), %ecx
movl 0x1898(%rsp), %r8d
movsd 0x1840(%rsp), %xmm1
movsd 0x1850(%rsp), %xmm2
leaq 0x182e(%rsp), %r9
callq 0x142700
cmpl $0x1, %eax
jne 0x141017
leaq 0x1020(%rsp), %rdi
movq 0x1860(%rsp), %rcx
addq $0x96a, %rcx            # imm = 0x96A
leaq 0x91410(%rip), %rsi     # 0x1d23d8
leaq 0xc31f0(%rip), %rdx     # 0x2041bf
movb $0x0, %al
callq 0x5b9c0
movq 0x1860(%rsp), %rdi
addq $0x96a, %rdi            # imm = 0x96A
leaq 0x1020(%rsp), %r8
leaq 0x91040(%rip), %rsi     # 0x1d2034
leaq 0xc321c(%rip), %rdx     # 0x204217
movl $0xccd, %ecx            # imm = 0xCCD
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x1884(%rsp)
jmp 0x141367
jmp 0x141079
movq 0x1860(%rsp), %rax
movq 0x948(%rax), %rax
movslq 0x185c(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, 0x1840(%rsp)
movq 0x1860(%rsp), %rax
movq 0x950(%rax), %rax
movslq 0x1858(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movslq 0x185c(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, 0x1838(%rsp)
movw $0x1, 0x182e(%rsp)
movswl 0x182e(%rsp), %eax
cmpl $0x1, %eax
jne 0x141146
movq 0x1860(%rsp), %rdi
movq 0x1878(%rsp), %rsi
movl 0x1858(%rsp), %edx
movl 0x185c(%rsp), %ecx
movsd 0x1850(%rsp), %xmm0
movsd 0x1840(%rsp), %xmm1
movl 0x18a8(%rsp), %r8d
leaq 0x1830(%rsp), %r9
callq 0x142d90
cmpl $0x1, %eax
jne 0x141141
leaq 0x820(%rsp), %rdi
movq 0x1860(%rsp), %rcx
addq $0x96a, %rcx            # imm = 0x96A
leaq 0x912e6(%rip), %rsi     # 0x1d23d8
leaq 0xc313a(%rip), %rdx     # 0x204233
movb $0x0, %al
callq 0x5b9c0
movq 0x1860(%rsp), %rdi
addq $0x96a, %rdi            # imm = 0x96A
leaq 0x820(%rsp), %r8
leaq 0x90f16(%rip), %rsi     # 0x1d2034
leaq 0xc30f2(%rip), %rdx     # 0x204217
movl $0xce0, %ecx            # imm = 0xCE0
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x1884(%rsp)
jmp 0x141367
jmp 0x141220
movq 0x1868(%rsp), %rdi
movq 0x1860(%rsp), %rsi
movq 0x1878(%rsp), %rdx
movl 0x185c(%rsp), %ecx
movl 0x1858(%rsp), %r8d
movl 0x1898(%rsp), %r9d
movsd 0x1850(%rsp), %xmm0
movl 0x18a0(%rsp), %r11d
movsd 0x1838(%rsp), %xmm1
movl 0x18a8(%rsp), %r10d
leaq 0x1830(%rsp), %rax
movl %r11d, (%rsp)
movl %r10d, 0x8(%rsp)
movq %rax, 0x10(%rsp)
callq 0x143b90
cmpl $0x1, %eax
jne 0x14121e
leaq 0x20(%rsp), %rdi
movq 0x1860(%rsp), %rcx
addq $0x96a, %rcx            # imm = 0x96A
leaq 0x91206(%rip), %rsi     # 0x1d23d8
leaq 0xc30ae(%rip), %rdx     # 0x204287
movb $0x0, %al
callq 0x5b9c0
movq 0x1860(%rsp), %rdi
addq $0x96a, %rdi            # imm = 0x96A
leaq 0x20(%rsp), %r8
leaq 0x90e39(%rip), %rsi     # 0x1d2034
leaq 0xc3015(%rip), %rdx     # 0x204217
movl $0xcf2, %ecx            # imm = 0xCF2
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x1884(%rsp)
jmp 0x141367
jmp 0x141220
jmp 0x141222
movswl 0x18b0(%rsp), %eax
cmpl $0x0, %eax
jne 0x1412ca
movsd 0x1830(%rsp), %xmm0
movq 0x1860(%rsp), %rax
movq 0x958(%rax), %rax
movslq 0x1858(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movl 0x1890(%rsp), %ecx
movq 0x1860(%rsp), %rdx
movq 0x8f0(%rdx), %rdx
movslq 0x1858(%rsp), %rsi
imull (%rdx,%rsi,4), %ecx
addl 0x1898(%rsp), %ecx
movq 0x1860(%rsp), %rdx
movq 0x900(%rdx), %rdx
movslq 0x1858(%rsp), %rsi
imull (%rdx,%rsi,4), %ecx
addl 0x18a0(%rsp), %ecx
movslq %ecx, %rcx
movq 0x1860(%rsp), %rdx
imulq 0x920(%rdx), %rcx
movslq 0x185c(%rsp), %rdx
addq %rdx, %rcx
movsd %xmm0, (%rax,%rcx,8)
jmp 0x14135c
movsd 0x1830(%rsp), %xmm0
movq 0x1860(%rsp), %rax
movq 0x960(%rax), %rax
movslq 0x1858(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movl 0x1890(%rsp), %ecx
movq 0x1860(%rsp), %rdx
movq 0x8f0(%rdx), %rdx
movslq 0x1858(%rsp), %rsi
imull (%rdx,%rsi,4), %ecx
addl 0x1898(%rsp), %ecx
movq 0x1860(%rsp), %rdx
movq 0x900(%rdx), %rdx
movslq 0x1858(%rsp), %rsi
imull (%rdx,%rsi,4), %ecx
addl 0x18a0(%rsp), %ecx
movslq %ecx, %rcx
movq 0x1860(%rsp), %rdx
imulq 0x940(%rdx), %rcx
movslq 0x185c(%rsp), %rdx
addq %rdx, %rcx
movsd %xmm0, (%rax,%rcx,8)
movl $0x0, 0x1884(%rsp)
movl 0x1884(%rsp), %eax
addq $0x1888, %rsp           # imm = 0x1888
retq
nopw %cs:(%rax,%rax)