// File: /workspace/github_c_makefile_star2_O0/PoulinV[P]AxiCLASS/build/../source/output.c
// Function: output_total_cl_at_l
int output_total_cl_at_l(
                         struct harmonic * phr,
                         struct lensing * ple,
                         struct output * pop,
                         int l,
                         double * cl
                         ){

  double ** cl_md_ic; /* array with argument
                         cl_md_ic[index_md][index_ic1_ic2*phr->ct_size+index_ct] */

  double ** cl_md;    /* array with argument
                         cl_md[index_md][index_ct] */

  int index_md;

  if (ple->has_lensed_cls == _TRUE_) {
    class_call(lensing_cl_at_l(ple,
                               l,
                               cl),
               ple->error_message,
               pop->error_message);
  }
  else {

    class_alloc(cl_md_ic,
                phr->md_size*sizeof(double *),
                pop->error_message);

    class_alloc(cl_md,
                phr->md_size*sizeof(double *),
                pop->error_message);

    for (index_md = 0; index_md < phr->md_size; index_md++) {

      if (phr->md_size > 1)

        class_alloc(cl_md[index_md],
                    phr->ct_size*sizeof(double),
                    ple->error_message);

      if (phr->ic_size[index_md] > 1)

        class_alloc(cl_md_ic[index_md],
                    phr->ic_ic_size[index_md]*phr->ct_size*sizeof(double),
                    ple->error_message);
    }

    class_call(harmonic_cl_at_l(phr,
                                (double)l,
                                cl,
                                cl_md,
                                cl_md_ic),
               phr->error_message,
               pop->error_message);

    for (index_md = 0; index_md < phr->md_size; index_md++) {

      if (phr->md_size > 1)
        free(cl_md[index_md]);

      if (phr->ic_size[index_md] > 1)
        free(cl_md_ic[index_md]);

    }

    free(cl_md_ic);
    free(cl_md);

  }

  return _SUCCESS_;

}

// Assembly:
subq $0x3088, %rsp           # imm = 0x3088
movq %rdi, 0x3078(%rsp)
movq %rsi, 0x3070(%rsp)
movq %rdx, 0x3068(%rsp)
movl %ecx, 0x3064(%rsp)
movq %r8, 0x3058(%rsp)
movq 0x3070(%rsp), %rax
movswl (%rax), %eax
cmpl $0x1, %eax
jne 0x1c72c5
movq 0x3070(%rsp), %rdi
movl 0x3064(%rsp), %esi
movq 0x3058(%rsp), %rdx
callq 0x155e00
cmpl $0x1, %eax
jne 0x1c72c0
leaq 0x2840(%rsp), %rdi
movq 0x3070(%rsp), %rcx
addq $0x92, %rcx
leaq 0xb167(%rip), %rsi      # 0x1d23d8
leaq 0x4ba58(%rip), %rdx     # 0x212cd0
movb $0x0, %al
callq 0x5b9c0
movq 0x3068(%rsp), %rdi
addq $0x420, %rdi            # imm = 0x420
leaq 0x2840(%rsp), %r8
leaq 0xad97(%rip), %rsi      # 0x1d2034
leaq 0x4ba48(%rip), %rdx     # 0x212cec
movl $0x27, %ecx
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x3084(%rsp)
jmp 0x1c7789
jmp 0x1c777e
movq 0x3078(%rsp), %rax
movslq 0x10(%rax), %rdi
shlq $0x3, %rdi
callq 0x8460
movq %rax, 0x3050(%rsp)
cmpq $0x0, 0x3050(%rsp)
jne 0x1c7369
movq 0x3078(%rsp), %rax
movslq 0x10(%rax), %rax
shlq $0x3, %rax
movl %eax, 0x283c(%rsp)
leaq 0x2030(%rsp), %rdi
movl 0x283c(%rsp), %ecx
leaq 0xacea(%rip), %rsi      # 0x1d2004
leaq 0x42c8b(%rip), %rdx     # 0x209fac
movb $0x0, %al
callq 0x5b9c0
movq 0x3068(%rsp), %rdi
addq $0x420, %rdi            # imm = 0x420
leaq 0x2030(%rsp), %r8
leaq 0xacee(%rip), %rsi      # 0x1d2034
leaq 0x4b99f(%rip), %rdx     # 0x212cec
movl $0x2d, %ecx
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x3084(%rsp)
jmp 0x1c7789
movq 0x3078(%rsp), %rax
movslq 0x10(%rax), %rdi
shlq $0x3, %rdi
callq 0x8460
movq %rax, 0x3048(%rsp)
cmpq $0x0, 0x3048(%rsp)
jne 0x1c740d
movq 0x3078(%rsp), %rax
movslq 0x10(%rax), %rax
shlq $0x3, %rax
movl %eax, 0x202c(%rsp)
leaq 0x1820(%rsp), %rdi
movl 0x202c(%rsp), %ecx
leaq 0xac46(%rip), %rsi      # 0x1d2004
leaq 0x42bf0(%rip), %rdx     # 0x209fb5
movb $0x0, %al
callq 0x5b9c0
movq 0x3068(%rsp), %rdi
addq $0x420, %rdi            # imm = 0x420
leaq 0x1820(%rsp), %r8
leaq 0xac4a(%rip), %rsi      # 0x1d2034
leaq 0x4b8fb(%rip), %rdx     # 0x212cec
movl $0x31, %ecx
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x3084(%rsp)
jmp 0x1c7789
movl $0x0, 0x3044(%rsp)
movl 0x3044(%rsp), %eax
movq 0x3078(%rsp), %rcx
cmpl 0x10(%rcx), %eax
jge 0x1c763d
movq 0x3078(%rsp), %rax
cmpl $0x1, 0x10(%rax)
jle 0x1c7509
movq 0x3078(%rsp), %rax
movslq 0x9c(%rax), %rdi
shlq $0x3, %rdi
callq 0x8460
movq %rax, %rdx
movq 0x3048(%rsp), %rax
movslq 0x3044(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movq 0x3048(%rsp), %rax
movslq 0x3044(%rsp), %rcx
cmpq $0x0, (%rax,%rcx,8)
jne 0x1c7507
movq 0x3078(%rsp), %rax
movslq 0x9c(%rax), %rax
shlq $0x3, %rax
movl %eax, 0x181c(%rsp)
leaq 0x1010(%rsp), %rdi
movl 0x181c(%rsp), %ecx
leaq 0xab4c(%rip), %rsi      # 0x1d2004
leaq 0x42afc(%rip), %rdx     # 0x209fbb
movb $0x0, %al
callq 0x5b9c0
movq 0x3070(%rsp), %rdi
addq $0x92, %rdi
leaq 0x1010(%rsp), %r8
leaq 0xab50(%rip), %rsi      # 0x1d2034
leaq 0x4b801(%rip), %rdx     # 0x212cec
movl $0x39, %ecx
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x3084(%rsp)
jmp 0x1c7789
jmp 0x1c7509
movq 0x3078(%rsp), %rax
movq 0x18(%rax), %rax
movslq 0x3044(%rsp), %rcx
cmpl $0x1, (%rax,%rcx,4)
jle 0x1c7625
movq 0x3078(%rsp), %rax
movq 0x20(%rax), %rax
movslq 0x3044(%rsp), %rcx
movl (%rax,%rcx,4), %eax
movq 0x3078(%rsp), %rcx
imull 0x9c(%rcx), %eax
movslq %eax, %rdi
shlq $0x3, %rdi
callq 0x8460
movq %rax, %rdx
movq 0x3050(%rsp), %rax
movslq 0x3044(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movq 0x3050(%rsp), %rax
movslq 0x3044(%rsp), %rcx
cmpq $0x0, (%rax,%rcx,8)
jne 0x1c7623
movq 0x3078(%rsp), %rax
movq 0x20(%rax), %rax
movslq 0x3044(%rsp), %rcx
movl (%rax,%rcx,4), %eax
movq 0x3078(%rsp), %rcx
imull 0x9c(%rcx), %eax
cltq
shlq $0x3, %rax
movl %eax, 0x100c(%rsp)
leaq 0x800(%rsp), %rdi
movl 0x100c(%rsp), %ecx
leaq 0xaa30(%rip), %rsi      # 0x1d2004
leaq 0x429f0(%rip), %rdx     # 0x209fcb
movb $0x0, %al
callq 0x5b9c0
movq 0x3070(%rsp), %rdi
addq $0x92, %rdi
leaq 0x800(%rsp), %r8
leaq 0xaa34(%rip), %rsi      # 0x1d2034
leaq 0x4b6e5(%rip), %rdx     # 0x212cec
movl $0x3f, %ecx
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x3084(%rsp)
jmp 0x1c7789
jmp 0x1c7625
jmp 0x1c7627
movl 0x3044(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x3044(%rsp)
jmp 0x1c7418
movq 0x3078(%rsp), %rdi
cvtsi2sdl 0x3064(%rsp), %xmm0
movq 0x3058(%rsp), %rsi
movq 0x3048(%rsp), %rdx
movq 0x3050(%rsp), %rcx
callq 0x14be30
cmpl $0x1, %eax
jne 0x1c76d3
movq %rsp, %rdi
movq 0x3078(%rsp), %rcx
addq $0xea, %rcx
leaq 0xad4f(%rip), %rsi      # 0x1d23d8
leaq 0x4b671(%rip), %rdx     # 0x212d01
movb $0x0, %al
callq 0x5b9c0
movq 0x3068(%rsp), %rdi
addq $0x420, %rdi            # imm = 0x420
movq %rsp, %r8
leaq 0xa984(%rip), %rsi      # 0x1d2034
leaq 0x4b635(%rip), %rdx     # 0x212cec
movl $0x48, %ecx
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x3084(%rsp)
jmp 0x1c7789
movl $0x0, 0x3044(%rsp)
movl 0x3044(%rsp), %eax
movq 0x3078(%rsp), %rcx
cmpl 0x10(%rcx), %eax
jge 0x1c7764
movq 0x3078(%rsp), %rax
cmpl $0x1, 0x10(%rax)
jle 0x1c7719
movq 0x3048(%rsp), %rax
movslq 0x3044(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x8420
movq 0x3078(%rsp), %rax
movq 0x18(%rax), %rax
movslq 0x3044(%rsp), %rcx
cmpl $0x1, (%rax,%rcx,4)
jle 0x1c774c
movq 0x3050(%rsp), %rax
movslq 0x3044(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x8420
jmp 0x1c774e
movl 0x3044(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x3044(%rsp)
jmp 0x1c76de
movq 0x3050(%rsp), %rdi
callq 0x8420
movq 0x3048(%rsp), %rdi
callq 0x8420
movl $0x0, 0x3084(%rsp)
movl 0x3084(%rsp), %eax
addq $0x3088, %rsp           # imm = 0x3088
retq
nopl (%rax,%rax)