// File: /workspace/github_c_makefile_star2_O2/PoulinV[P]AxiCLASS/build/../source/primordial.c
// Function: primordial_indices
int primordial_indices(
                       struct perturbations   * ppt,
                       struct primordial * ppm
                       ) {

  int index_md;

  ppm->md_size = ppt->md_size;

  class_alloc(ppm->lnpk,ppt->md_size*sizeof(double*),ppm->error_message);

  class_alloc(ppm->ddlnpk,ppt->md_size*sizeof(double*),ppm->error_message);

  class_alloc(ppm->ic_size,ppt->md_size*sizeof(int*),ppm->error_message);

  class_alloc(ppm->ic_ic_size,ppt->md_size*sizeof(int*),ppm->error_message);

  class_alloc(ppm->is_non_zero,ppm->md_size*sizeof(short *),ppm->error_message);

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

    ppm->ic_size[index_md] = ppt->ic_size[index_md];

    ppm->ic_ic_size[index_md] = (ppm->ic_size[index_md]*(ppm->ic_size[index_md]+1))/2;

    class_alloc(ppm->lnpk[index_md],
                ppm->lnk_size*ppm->ic_ic_size[index_md]*sizeof(double),
                ppm->error_message);

    class_alloc(ppm->ddlnpk[index_md],
                ppm->lnk_size*ppm->ic_ic_size[index_md]*sizeof(double),
                ppm->error_message);

    class_alloc(ppm->is_non_zero[index_md],
                ppm->ic_ic_size[index_md]*sizeof(short),
                ppm->error_message);


  }

  return _SUCCESS_;

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x808, %rsp            # imm = 0x808
movq %rsi, %rbx
movq %rdi, %r14
movslq 0x854(%rdi), %r12
movl %r12d, 0x278(%rsi)
movq %r12, %r15
shlq $0x3, %r15
movq %r15, %rdi
callq 0x8490
movq %rax, 0x2a0(%rbx)
testq %rax, %rax
je 0x9128a
movq %r15, %rdi
callq 0x8490
movq %rax, 0x2a8(%rbx)
testq %rax, %rax
je 0x912cf
movq %r15, %rdi
callq 0x8490
movq %rax, 0x280(%rbx)
testq %rax, %rax
je 0x91314
movq %r15, %rdi
callq 0x8490
movq %rax, 0x288(%rbx)
testq %rax, %rax
je 0x91359
movq %r15, %rdi
callq 0x8490
movq %rax, 0x2b0(%rbx)
testq %rax, %rax
je 0x9139e
xorl %r15d, %r15d
pushq $0x2
popq %r12
xorl %r13d, %r13d
movslq 0x854(%r14), %rax
cmpq %rax, %r13
jge 0x91473
movq 0x870(%r14), %rax
movl (%rax,%r13,4), %ecx
movq 0x280(%rbx), %rax
movl %ecx, (%rax,%r13,4)
leal 0x1(%rcx), %eax
imull %ecx, %eax
cltd
idivl %r12d
movq 0x288(%rbx), %rcx
movl %eax, (%rcx,%r13,4)
movl 0x290(%rbx), %ebp
imull %ebp, %eax
movslq %eax, %rdi
shlq $0x3, %rdi
callq 0x8490
movq 0x2a0(%rbx), %rcx
movq %rax, (%rcx,%r13,8)
movq 0x288(%rbx), %rax
movq 0x2a0(%rbx), %rcx
cmpq $0x0, (%rcx,%r13,8)
movl (%rax,%r13,4), %eax
je 0x913e3
imull %ebp, %eax
movslq %eax, %rdi
shlq $0x3, %rdi
callq 0x8490
movq 0x2a8(%rbx), %rcx
movq %rax, (%rcx,%r13,8)
movq 0x288(%rbx), %rax
movq 0x2a8(%rbx), %rcx
cmpq $0x0, (%rcx,%r13,8)
movslq (%rax,%r13,4), %rdi
je 0x91425
addq %rdi, %rdi
callq 0x8490
movq 0x2b0(%rbx), %rcx
movq %rax, (%rcx,%r13,8)
movq 0x2b0(%rbx), %rcx
leaq 0x1(%r13), %rax
cmpq $0x0, (%rcx,%r13,8)
movq %rax, %r13
jne 0x91165
movq 0x288(%rbx), %rcx
movl -0x4(%rcx,%rax,4), %ecx
addl %ecx, %ecx
leaq 0x53db0(%rip), %rsi     # 0xe5004
leaq 0x7ee3b(%rip), %rdx     # 0x110096
movq %rsp, %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x2e014
addq $0x32a, %rbx            # imm = 0x32A
leaq 0x53dbe(%rip), %rsi     # 0xe5034
leaq 0x7eda2(%rip), %rdx     # 0x11001f
movq %rbx, %rdi
movl $0x2ab, %ecx            # imm = 0x2AB
jmp 0x91465
leal (,%r12,8), %ecx
leaq 0x53d6b(%rip), %rsi     # 0xe5004
leaq 0x7ed75(%rip), %rdx     # 0x110015
movq %rsp, %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x2e014
addq $0x32a, %rbx            # imm = 0x32A
leaq 0x53d79(%rip), %rsi     # 0xe5034
leaq 0x7ed5d(%rip), %rdx     # 0x11001f
movq %rbx, %rdi
movl $0x291, %ecx            # imm = 0x291
jmp 0x91465
leal (,%r12,8), %ecx
leaq 0x53d26(%rip), %rsi     # 0xe5004
leaq 0x7ed4d(%rip), %rdx     # 0x110032
movq %rsp, %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x2e014
addq $0x32a, %rbx            # imm = 0x32A
leaq 0x53d34(%rip), %rsi     # 0xe5034
leaq 0x7ed18(%rip), %rdx     # 0x11001f
movq %rbx, %rdi
movl $0x293, %ecx            # imm = 0x293
jmp 0x91465
leal (,%r12,8), %ecx
leaq 0x53ce1(%rip), %rsi     # 0xe5004
leaq 0x7ed14(%rip), %rdx     # 0x11003e
movq %rsp, %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x2e014
addq $0x32a, %rbx            # imm = 0x32A
leaq 0x53cef(%rip), %rsi     # 0xe5034
leaq 0x7ecd3(%rip), %rdx     # 0x11001f
movq %rbx, %rdi
movl $0x295, %ecx            # imm = 0x295
jmp 0x91465
leal (,%r12,8), %ecx
leaq 0x53c9c(%rip), %rsi     # 0xe5004
leaq 0x7ecdc(%rip), %rdx     # 0x11004b
movq %rsp, %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x2e014
addq $0x32a, %rbx            # imm = 0x32A
leaq 0x53caa(%rip), %rsi     # 0xe5034
leaq 0x7ec8e(%rip), %rdx     # 0x11001f
movq %rbx, %rdi
movl $0x297, %ecx            # imm = 0x297
jmp 0x91465
leal (,%r12,8), %ecx
leaq 0x53c57(%rip), %rsi     # 0xe5004
leaq 0x7eca7(%rip), %rdx     # 0x11005b
movq %rsp, %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x2e014
addq $0x32a, %rbx            # imm = 0x32A
leaq 0x53c65(%rip), %rsi     # 0xe5034
leaq 0x7ec49(%rip), %rdx     # 0x11001f
movq %rbx, %rdi
movl $0x299, %ecx            # imm = 0x299
jmp 0x91465
imull %eax, %ebp
shll $0x3, %ebp
leaq 0x53c14(%rip), %rsi     # 0xe5004
leaq 0x7ec75(%rip), %rdx     # 0x11006c
movq %rsp, %r14
movq %r14, %rdi
movl %ebp, %ecx
xorl %eax, %eax
callq 0x2e014
addq $0x32a, %rbx            # imm = 0x32A
leaq 0x53c20(%rip), %rsi     # 0xe5034
leaq 0x7ec04(%rip), %rdx     # 0x11001f
movq %rbx, %rdi
movl $0x2a3, %ecx            # imm = 0x2A3
jmp 0x91465
imull %edi, %ebp
shll $0x3, %ebp
leaq 0x53bd2(%rip), %rsi     # 0xe5004
leaq 0x7ec47(%rip), %rdx     # 0x110080
movq %rsp, %r14
movq %r14, %rdi
movl %ebp, %ecx
xorl %eax, %eax
callq 0x2e014
addq $0x32a, %rbx            # imm = 0x32A
leaq 0x53bde(%rip), %rsi     # 0xe5034
leaq 0x7ebc2(%rip), %rdx     # 0x11001f
movq %rbx, %rdi
movl $0x2a7, %ecx            # imm = 0x2A7
movq %r14, %r8
xorl %eax, %eax
callq 0x2e014
pushq $0x1
popq %r15
movl %r15d, %eax
addq $0x808, %rsp            # imm = 0x808
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq