// File: /workspace/github_cpp_makefile_star2_O2/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 $0x178, %rsp            # imm = 0x178
movq %rdi, %rbx
cmpl $0x2, (%rdi)
jl 0x8794
leaq 0x4447(%rip), %rsi      # 0xcb61
leaq 0xb8(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x3e22
leaq 0x3d8c(%rip), %rdx      # 0xc4bf
leaq 0x20(%rsp), %rdi
leaq 0xb8(%rsp), %rsi
callq 0x6693
leaq 0x3d8f(%rip), %rdx      # 0xc4db
leaq 0xd8(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x6674
leaq 0xd8(%rsp), %rsi
movq %rbx, %rdi
xorl %eax, %eax
callq 0x65ac
leaq 0xd8(%rsp), %rdi
callq 0x3120
leaq 0x20(%rsp), %rdi
callq 0x3120
leaq 0xb8(%rsp), %rdi
callq 0x3120
leaq 0x90(%rbx), %rax
movq %rax, 0x40(%rsp)
leaq 0xd8(%rbx), %r14
pushq $0x3
popq %r15
subq $0x1, %r15
jb 0x87d6
leaq -0x48(%r14), %rdi
movslq 0x154(%rbx), %rsi
callq 0x9406
movslq 0x154(%rbx), %rsi
movq %r14, %rdi
callq 0x9406
addq $0x18, %r14
jmp 0x87ab
leaq 0x48(%rbx), %r13
movq $0x0, 0x10(%rsp)
xorl %r15d, %r15d
movq %rbx, 0x8(%rsp)
movslq 0x154(%rbx), %rax
cmpq %rax, %r15
jge 0x8afd
cvttsd2si 0x158(%rbx), %ecx
movl 0x160(%rbx), %eax
leal -0x1(%rcx), %edx
movq 0x120(%rbx), %r8
xorl %esi, %esi
testl %eax, %eax
movl $0x0, %edi
cmovgl %eax, %edi
testl %ecx, %ecx
cmovlel %esi, %ecx
movl %eax, %r9d
imull 0x10(%rsp), %r9d
movslq %r9d, %r9
leaq (%r8,%r9,8), %r8
addq $0x8, %r8
xorpd %xmm2, %xmm2
xorpd %xmm3, %xmm3
cmpl %ecx, %esi
je 0x889b
movq %r8, %r9
xorl %r10d, %r10d
cmpq %r10, %rdi
je 0x8897
cmpl %r10d, %edx
movl %r10d, %r11d
cmovll %edx, %r11d
movslq %r11d, %r11
imulq $0x18, %r11, %r11
movq (%r13,%r11), %r11
movsd (%r11,%r15,8), %xmm0
movsd (%r9), %xmm1
mulsd %xmm0, %xmm1
addsd %xmm1, %xmm3
movsd -0x8(%r9), %xmm1
unpcklpd %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0]
unpcklpd %xmm0, %xmm0            # xmm0 = xmm0[0,0]
mulpd %xmm1, %xmm0
addpd %xmm0, %xmm2
incq %r10
addq $0x10, %r9
jmp 0x884a
incl %esi
jmp 0x8840
movapd %xmm2, %xmm0
unpckhpd %xmm2, %xmm0            # xmm0 = xmm0[1],xmm2[1]
movapd %xmm0, 0x60(%rsp)
movq 0x40(%rsp), %r12
pushq $0x1
popq %rcx
movl %ecx, %r14d
xorl %ebp, %ebp
movapd %xmm2, 0x50(%rsp)
movsd %xmm3, 0x48(%rsp)
movslq %eax, %rcx
cmpq %rcx, %rbp
jge 0x8ae3
movq 0x8(%rsp), %rdi
cvttsd2si 0x158(%rdi), %ecx
decl %ecx
cmpl %ebp, %ecx
cmovgel %ebp, %ecx
movslq %ecx, %rcx
imulq $0x18, %rcx, %rcx
movq (%r13,%rcx), %rcx
movsd (%rcx,%r15,8), %xmm4
movapd %xmm3, %xmm0
mulsd %xmm4, %xmm0
movapd 0x60(%rsp), %xmm3
divsd %xmm3, %xmm0
movapd %xmm2, %xmm1
movsd %xmm4, 0x18(%rsp)
mulsd %xmm4, %xmm1
divsd %xmm3, %xmm1
movq 0x10(%rsp), %rcx
imull %eax, %ecx
leal (%r14,%rcx), %edx
addl %r14d, %ecx
decl %ecx
movslq %ecx, %rcx
movq 0x120(%rdi), %rsi
movsd (%rsi,%rcx,8), %xmm2
subsd %xmm1, %xmm2
movslq %edx, %rcx
movsd (%rsi,%rcx,8), %xmm3
subsd %xmm0, %xmm3
movsd 0x1d0(%rdi), %xmm4
movsd 0x36f0(%rip), %xmm6     # 0xc048
movapd %xmm6, %xmm5
subsd %xmm4, %xmm5
mulsd %xmm1, %xmm5
mulsd %xmm4, %xmm2
addsd %xmm5, %xmm2
movq (%r12), %rcx
movsd %xmm2, (%rcx,%r15,8)
movsd 0x1d0(%rdi), %xmm1
movapd %xmm6, %xmm2
subsd %xmm1, %xmm2
mulsd %xmm0, %xmm2
mulsd %xmm1, %xmm3
addsd %xmm2, %xmm3
movq 0x48(%r12), %rcx
movsd %xmm3, (%rcx,%r15,8)
cmpl $0x2, (%rdi)
jl 0x8ac7
leaq 0x158(%rsp), %rbx
movq %rbx, %rdi
leaq 0x41c2(%rip), %rsi      # 0xcb7a
leaq 0x20(%rsp), %rdx
callq 0x3e22
movq 0x8(%rsp), %rdi
movq %rbx, %rsi
movl %ebp, %edx
movl %r15d, %ecx
movsd 0x18(%rsp), %xmm0
movb $0x1, %al
callq 0x65ac
movq %rbx, %rdi
callq 0x3120
leaq 0x138(%rsp), %rbx
movq %rbx, %rdi
leaq 0x41a6(%rip), %rsi      # 0xcb9c
leaq 0x20(%rsp), %rdx
callq 0x3e22
movq (%r12), %rax
movsd (%rax,%r15,8), %xmm0
movq 0x8(%rsp), %rdi
movq %rbx, %rsi
movl %ebp, %edx
movl %r15d, %ecx
movb $0x1, %al
callq 0x65ac
movq %rbx, %rdi
callq 0x3120
leaq 0x118(%rsp), %rbx
movq %rbx, %rdi
leaq 0x4186(%rip), %rsi      # 0xcbbe
leaq 0x20(%rsp), %rdx
callq 0x3e22
movq 0x48(%r12), %rax
movsd (%rax,%r15,8), %xmm0
movq 0x8(%rsp), %rdi
movq %rbx, %rsi
movl %ebp, %edx
movl %r15d, %ecx
movb $0x1, %al
callq 0x65ac
movq %r12, 0x18(%rsp)
movq %r14, %r12
movq %rbx, %rdi
callq 0x3120
leaq 0xf8(%rsp), %r14
movq %r14, %rdi
leaq 0x415d(%rip), %rsi      # 0xcbe0
leaq 0x20(%rsp), %rdx
callq 0x3e22
movq 0x8(%rsp), %rbx
movq 0x138(%rbx), %rax
movsd (%rax,%r15,8), %xmm0
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
movl %r15d, %ecx
movb $0x1, %al
callq 0x65ac
movq %r14, %rdi
callq 0x3120
movl 0x160(%rbx), %eax
movq %r12, %r14
movq 0x18(%rsp), %r12
incq %rbp
addl $0x2, %r14d
addq $0x18, %r12
movapd 0x50(%rsp), %xmm2
movsd 0x48(%rsp), %xmm3
jmp 0x88c2
incq %r15
movq 0x10(%rsp), %rax
addl $0x2, %eax
movq %rax, 0x10(%rsp)
movq 0x8(%rsp), %rbx
jmp 0x87eb
cmpl $0x1, (%rbx)
jle 0x8b7a
leaq 0x4058(%rip), %rsi      # 0xcb61
leaq 0x78(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x3e22
leaq 0x39a0(%rip), %rdx      # 0xc4bf
leaq 0x20(%rsp), %rdi
leaq 0x78(%rsp), %rsi
callq 0x6693
leaq 0x3b74(%rip), %rdx      # 0xc6a9
leaq 0x98(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x6674
leaq 0x98(%rsp), %rsi
movq %rbx, %rdi
xorl %eax, %eax
callq 0x65ac
leaq 0x98(%rsp), %rdi
callq 0x3120
leaq 0x20(%rsp), %rdi
callq 0x3120
leaq 0x78(%rsp), %rdi
callq 0x3120
addq $0x178, %rsp            # imm = 0x178
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x98(%rsp), %rdi
callq 0x3120
jmp 0x8ba1
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x3120
jmp 0x8bb0
movq %rax, %rbx
leaq 0x78(%rsp), %rdi
jmp 0x8c26
jmp 0x8c09
movq %rax, %rbx
leaq 0xd8(%rsp), %rdi
callq 0x3120
jmp 0x8bce
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x3120
jmp 0x8bdd
movq %rax, %rbx
leaq 0xb8(%rsp), %rdi
jmp 0x8c26
jmp 0x8c09
movq %rax, %rbx
leaq 0xf8(%rsp), %rdi
jmp 0x8c26
jmp 0x8c09
jmp 0x8c09
jmp 0x8c09
movq %rax, %rbx
leaq 0x158(%rsp), %rdi
jmp 0x8c26
movq %rax, %rbx
jmp 0x8c2b
movq %rax, %rbx
leaq 0x118(%rsp), %rdi
jmp 0x8c26
movq %rax, %rbx
leaq 0x138(%rsp), %rdi
callq 0x3120
movq %rbx, %rdi
callq 0x3470
nop