// File: /workspace/github_cpp_makefile_star2_O1/chfeder[P]turbulence_generator/./TurbGen.h
// Function: TurbGen::get_decomposition_coeffs()
void get_decomposition_coeffs(void) {
        // ******************************************************
        // This routine applies the projection operator based on the OU phases.
        // See Eq. (6) in Federrath et al. (2010).
        // ******************************************************
        if (verbose > 1) TurbGen_printf(FuncSig(__func__)+"entering.\n");
        // resize aka and akb
        for (int d = 0; d < 3; d++) {
            aka[d].resize(nmodes);
            akb[d].resize(nmodes);
        }
        double ka, kb, kk, diva, divb, curla, curlb;
        for (int m = 0; m < nmodes; m++) {
            ka = 0.0;
            kb = 0.0;
            kk = 0.0;
            for (int d = 0; d < (int)ndim; d++)
            for (int d = 0; d < ncmp; d++) {
                double this_mode = mode[std::min(d,(int)ndim-1)][m];
                kk = kk + this_mode*this_mode; // get k**2
                ka = ka + this_mode*OUphases[2*ncmp*m+2*d+1];
                kb = kb + this_mode*OUphases[2*ncmp*m+2*d+0];
            }
            for (int d = 0; d < ncmp; d++) {
                double this_mode = mode[std::min(d,(int)ndim-1)][m];
                diva  = this_mode*ka/kk;
                divb  = this_mode*kb/kk;
                curla = OUphases[2*ncmp*m+2*d+0] - divb;
                curlb = OUphases[2*ncmp*m+2*d+1] - diva;
                aka[d][m] = sol_weight*curla+(1.0-sol_weight)*divb;
                akb[d][m] = sol_weight*curlb+(1.0-sol_weight)*diva;
                // purely compressive
                // aka[d][m] = mode[d][m]*kb/kk;
                // akb[d][m] = mode[d][m]*ka/kk;
                // purely solenoidal
                // aka[d][m] = R - mode[d][m]*kb/kk;
                // akb[d][m] = I - mode[d][m]*ka/kk;
                if (verbose > 1) {
                    TurbGen_printf("mode(dim=%1i, mode=%3i) = %12.6f\n", d, m, this_mode);
                    TurbGen_printf("aka (dim=%1i, mode=%3i) = %12.6f\n", d, m, aka [d][m]);
                    TurbGen_printf("akb (dim=%1i, mode=%3i) = %12.6f\n", d, m, akb [d][m]);
                    TurbGen_printf("ampl(mode=%3i) = %12.6f\n", d, m, ampl[m]);
                }
            }
        }
        if (verbose > 1) TurbGen_printf(FuncSig(__func__)+"exiting.\n");
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x168, %rsp            # imm = 0x168
movq %rdi, %rbx
cmpl $0x2, (%rdi)
jl 0xa9b3
leaq 0x158(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x424f(%rip), %rsi      # 0xeb11
leaq 0x4260(%rip), %rdx      # 0xeb29
leaq 0x148(%rsp), %rdi
callq 0xbba2
leaq 0x30(%rsp), %rdi
leaq 0x148(%rsp), %rdx
movq %rbx, %rsi
callq 0x7ac4
leaq 0x3b99(%rip), %rsi      # 0xe48b
leaq 0x30(%rsp), %rdi
callq 0x34f0
leaq 0xf8(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xa92c
movq %rdx, 0xe8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xf8(%rsp)
jmp 0xa935
movupd (%rcx), %xmm0
movupd %xmm0, (%r15)
movq 0x8(%rax), %rdx
leaq 0xe8(%rsp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq %rbx, %rdi
xorl %eax, %eax
callq 0x79ea
movq 0xe8(%rsp), %rdi
cmpq %r15, %rdi
je 0xa97b
movq 0xf8(%rsp), %rsi
incq %rsi
callq 0x32a0
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xa996
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x32a0
movq 0x148(%rsp), %rdi
cmpq %r14, %rdi
je 0xa9b3
movq 0x158(%rsp), %rsi
incq %rsi
callq 0x32a0
leaq 0xd8(%rbx), %r14
movl $0x3, %r15d
leaq -0x48(%r14), %rdi
movslq 0x154(%rbx), %rsi
callq 0xba08
movslq 0x154(%rbx), %rsi
movq %r14, %rdi
callq 0xba08
addq $0x18, %r14
decq %r15
jne 0xa9c0
cmpl $0x0, 0x154(%rbx)
jle 0xadd5
leaq 0x48(%rbx), %r14
leaq 0x90(%rbx), %rax
movq %rax, 0x70(%rsp)
xorl %r15d, %r15d
xorl %r13d, %r13d
movq %rbx, 0x20(%rsp)
cvttsd2si 0x158(%rbx), %eax
testl %eax, %eax
jle 0xaaaf
movl 0x160(%rbx), %ecx
leal -0x1(%rax), %edx
movq 0x120(%rbx), %rsi
movl %ecx, %edi
imull %r15d, %edi
movslq %edi, %rdi
leaq (%rsi,%rdi,8), %rsi
addq $0x8, %rsi
xorpd %xmm7, %xmm7
xorl %edi, %edi
xorpd %xmm9, %xmm9
xorpd %xmm8, %xmm8
testl %ecx, %ecx
jle 0xaaa7
movq %rsi, %r8
xorl %r9d, %r9d
cmpl %r9d, %edx
movl %r9d, %r10d
cmovll %edx, %r10d
movslq %r10d, %r10
leaq (%r10,%r10,2), %r10
movq (%r14,%r10,8), %r10
movsd (%r10,%r13,8), %xmm0
movapd %xmm0, %xmm1
mulsd %xmm0, %xmm1
addsd %xmm1, %xmm8
movsd (%r8), %xmm1
mulsd %xmm0, %xmm1
addsd %xmm1, %xmm7
mulsd -0x8(%r8), %xmm0
addsd %xmm0, %xmm9
incq %r9
addq $0x10, %r8
cmpq %r9, %rcx
jne 0xaa5b
incl %edi
cmpl %eax, %edi
jne 0xaa51
jmp 0xaabd
xorpd %xmm8, %xmm8
xorpd %xmm9, %xmm9
xorpd %xmm7, %xmm7
movl 0x160(%rbx), %eax
testl %eax, %eax
jle 0xadbe
movl $0x1, %esi
movq 0x70(%rsp), %rbp
xorl %r12d, %r12d
movq %r15, 0x78(%rsp)
movsd %xmm7, 0x18(%rsp)
movsd %xmm8, 0x10(%rsp)
movsd %xmm9, 0x8(%rsp)
cvttsd2si 0x158(%rbx), %ecx
decl %ecx
cmpl %r12d, %ecx
cmovgel %r12d, %ecx
movslq %ecx, %rcx
leaq (%rcx,%rcx,2), %rcx
movq (%r14,%rcx,8), %rcx
movsd (%rcx,%r13,8), %xmm10
movapd %xmm7, %xmm0
mulsd %xmm10, %xmm0
divsd %xmm8, %xmm0
movapd %xmm9, %xmm1
mulsd %xmm10, %xmm1
divsd %xmm8, %xmm1
imull %r15d, %eax
leal (%rsi,%rax), %ecx
addl %esi, %eax
decl %eax
cltq
movq 0x120(%rbx), %rdx
movsd (%rdx,%rax,8), %xmm2
subsd %xmm1, %xmm2
movslq %ecx, %rax
movsd (%rdx,%rax,8), %xmm3
subsd %xmm0, %xmm3
movsd 0x1d0(%rbx), %xmm4
movsd 0x34df(%rip), %xmm6     # 0xe048
movapd %xmm6, %xmm5
subsd %xmm4, %xmm5
mulsd %xmm1, %xmm5
mulsd %xmm4, %xmm2
addsd %xmm5, %xmm2
movq (%rbp), %rax
movsd %xmm2, (%rax,%r13,8)
movsd 0x1d0(%rbx), %xmm1
movapd %xmm6, %xmm2
subsd %xmm1, %xmm2
mulsd %xmm0, %xmm2
mulsd %xmm1, %xmm3
addsd %xmm2, %xmm3
movq 0x48(%rbp), %rax
movsd %xmm3, (%rax,%r13,8)
cmpl $0x2, (%rbx)
jl 0xada4
movq %rsi, 0x28(%rsp)
movq %rbx, %r15
leaq 0x60(%rsp), %rbx
movq %rbx, 0x50(%rsp)
leaq 0x50(%rsp), %rdi
leaq 0x3f56(%rip), %rsi      # 0xeb2a
leaq 0x3f70(%rip), %rdx      # 0xeb4b
movsd %xmm10, 0x80(%rsp)
callq 0xbba2
movq %r15, %rbx
movq %r15, %rdi
leaq 0x50(%rsp), %rsi
movl %r12d, %edx
movl %r13d, %ecx
movsd 0x80(%rsp), %xmm0
movb $0x1, %al
callq 0x79ea
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0xac27
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x32a0
leaq 0xd8(%rsp), %r15
movq %r15, 0xc8(%rsp)
leaq 0xc8(%rsp), %rdi
leaq 0x3f06(%rip), %rsi      # 0xeb4c
leaq 0x3f20(%rip), %rdx      # 0xeb6d
callq 0xbba2
movq (%rbp), %rax
movsd (%rax,%r13,8), %xmm0
movq %rbx, %rdi
leaq 0xc8(%rsp), %rsi
movl %r12d, %edx
movl %r13d, %ecx
movb $0x1, %al
callq 0x79ea
movq 0xc8(%rsp), %rdi
cmpq %r15, %rdi
je 0xac91
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x32a0
leaq 0x138(%rsp), %r15
movq %r15, 0x128(%rsp)
leaq 0x128(%rsp), %rbx
movq %rbx, %rdi
leaq 0x3ebb(%rip), %rsi      # 0xeb6e
leaq 0x3ed5(%rip), %rdx      # 0xeb8f
callq 0xbba2
movq 0x48(%rbp), %rax
movsd (%rax,%r13,8), %xmm0
movq 0x20(%rsp), %rdi
movq %rbx, %rsi
movl %r12d, %edx
movl %r13d, %ecx
movb $0x1, %al
callq 0x79ea
movq 0x128(%rsp), %rdi
cmpq %r15, %rdi
je 0xacfb
movq 0x138(%rsp), %rsi
incq %rsi
callq 0x32a0
leaq 0xb8(%rsp), %r15
movq %r15, 0xa8(%rsp)
leaq 0xa8(%rsp), %rdi
leaq 0x3e76(%rip), %rsi      # 0xeb90
leaq 0x3e87(%rip), %rdx      # 0xeba8
callq 0xbba2
movq 0x20(%rsp), %rdi
movq 0x138(%rdi), %rax
movsd (%rax,%r13,8), %xmm0
movq %rdi, %rbx
leaq 0xa8(%rsp), %rsi
movl %r12d, %edx
movl %r13d, %ecx
movb $0x1, %al
callq 0x79ea
movq 0xa8(%rsp), %rdi
cmpq %r15, %rdi
movq 0x78(%rsp), %r15
movsd 0x18(%rsp), %xmm7
movsd 0x10(%rsp), %xmm8
movsd 0x8(%rsp), %xmm9
movq 0x28(%rsp), %rsi
je 0xada4
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x32a0
movq 0x28(%rsp), %rsi
movsd 0x8(%rsp), %xmm9
movsd 0x10(%rsp), %xmm8
movsd 0x18(%rsp), %xmm7
incq %r12
movslq 0x160(%rbx), %rax
addl $0x2, %esi
addq $0x18, %rbp
cmpq %rax, %r12
jl 0xaaf1
incq %r13
movslq 0x154(%rbx), %rax
addl $0x2, %r15d
cmpq %rax, %r13
jl 0xaa10
cmpl $0x1, (%rbx)
jle 0xaee2
leaq 0x118(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x3d20(%rip), %rsi      # 0xeb11
leaq 0x3d31(%rip), %rdx      # 0xeb29
leaq 0x108(%rsp), %rdi
callq 0xbba2
leaq 0x30(%rsp), %rdi
leaq 0x108(%rsp), %rdx
movq %rbx, %rsi
callq 0x7ac4
leaq 0x3838(%rip), %rsi      # 0xe659
leaq 0x30(%rsp), %rdi
callq 0x34f0
leaq 0x98(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xae5b
movq %rdx, 0x88(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x98(%rsp)
jmp 0xae64
movupd (%rcx), %xmm0
movupd %xmm0, (%r15)
movq 0x8(%rax), %rdx
leaq 0x88(%rsp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq %rbx, %rdi
xorl %eax, %eax
callq 0x79ea
movq 0x88(%rsp), %rdi
cmpq %r15, %rdi
je 0xaeaa
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x32a0
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xaec5
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x32a0
movq 0x108(%rsp), %rdi
cmpq %r14, %rdi
je 0xaee2
movq 0x118(%rsp), %rsi
incq %rsi
callq 0x32a0
addq $0x168, %rsp            # imm = 0x168
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r12
movq 0x88(%rsp), %rdi
cmpq %r15, %rdi
je 0xaf19
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x32a0
jmp 0xaf19
movq %rax, %r12
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xaf39
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x32a0
jmp 0xaf39
movq %rax, %r12
movq 0x108(%rsp), %rdi
cmpq %r14, %rdi
je 0xb027
movq 0x118(%rsp), %rsi
jmp 0xb01f
jmp 0xafb5
movq %rax, %r12
movq 0xe8(%rsp), %rdi
cmpq %r15, %rdi
je 0xaf7e
movq 0xf8(%rsp), %rsi
incq %rsi
callq 0x32a0
jmp 0xaf7e
movq %rax, %r12
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xaf9e
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x32a0
jmp 0xaf9e
movq %rax, %r12
movq 0x148(%rsp), %rdi
cmpq %r14, %rdi
je 0xb027
movq 0x158(%rsp), %rsi
jmp 0xb01f
movq %rax, %r12
jmp 0xb027
movq %rax, %r12
movq 0x128(%rsp), %rdi
cmpq %r15, %rdi
je 0xb027
movq 0x138(%rsp), %rsi
jmp 0xb01f
movq %rax, %r12
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0xb027
movq 0x60(%rsp), %rsi
jmp 0xb01f
movq %rax, %r12
movq 0xa8(%rsp), %rdi
cmpq %r15, %rdi
je 0xb027
movq 0xb8(%rsp), %rsi
jmp 0xb01f
movq %rax, %r12
movq 0xc8(%rsp), %rdi
cmpq %r15, %rdi
je 0xb027
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x32a0
movq %r12, %rdi
callq 0x3480
nop