// File: /workspace/github_cpp_makefile_star2_O3/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 0xa867
leaq 0x140(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x43eb(%rip), %rsi      # 0xeb61
leaq 0x43fc(%rip), %rdx      # 0xeb79
leaq 0x130(%rsp), %rdi
callq 0xba58
leaq 0x20(%rsp), %rdi
leaq 0x130(%rsp), %rdx
movq %rbx, %rsi
callq 0x7a28
leaq 0x3d35(%rip), %rsi      # 0xe4db
leaq 0x20(%rsp), %rdi
callq 0x34f0
leaq 0xe0(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xa7e0
movq %rdx, 0xd0(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xe0(%rsp)
jmp 0xa7e9
movupd (%rcx), %xmm0
movupd %xmm0, (%r15)
movq 0x8(%rax), %rdx
leaq 0xd0(%rsp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq %rbx, %rdi
xorl %eax, %eax
callq 0x794e
movq 0xd0(%rsp), %rdi
cmpq %r15, %rdi
je 0xa82f
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x32a0
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xa84a
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x32a0
movq 0x130(%rsp), %rdi
cmpq %r14, %rdi
je 0xa867
movq 0x140(%rsp), %rsi
incq %rsi
callq 0x32a0
leaq 0x90(%rbx), %rax
movq %rax, 0x40(%rsp)
leaq 0xd8(%rbx), %r14
movl $0x3, %r15d
leaq -0x48(%r14), %rdi
movslq 0x154(%rbx), %rsi
callq 0xb8b8
movslq 0x154(%rbx), %rsi
movq %r14, %rdi
callq 0xb8b8
addq $0x18, %r14
decq %r15
jne 0xa880
movl 0x154(%rbx), %ecx
testl %ecx, %ecx
jle 0xac91
leaq 0x48(%rbx), %r14
movl 0x160(%rbx), %eax
xorl %r15d, %r15d
xorl %r13d, %r13d
movq %rbx, 0x8(%rsp)
cvttsd2si 0x158(%rbx), %edx
testl %edx, %edx
movq %r15, (%rsp)
jle 0xa967
leal -0x1(%rdx), %esi
movq 0x120(%rbx), %r8
movl %eax, %edi
movl %eax, %r9d
imull %r15d, %r9d
movslq %r9d, %r9
leaq (%r8,%r9,8), %r8
addq $0x8, %r8
xorpd %xmm7, %xmm7
xorpd %xmm8, %xmm8
xorl %r9d, %r9d
testl %eax, %eax
jle 0xa95d
movq %r8, %r10
xorl %r11d, %r11d
cmpl %r11d, %esi
movl %r11d, %ebp
cmovll %esi, %ebp
movslq %ebp, %r15
leaq (%r15,%r15,2), %r15
movq (%r14,%r15,8), %r15
movsd (%r15,%r13,8), %xmm0
movsd (%r10), %xmm1
mulsd %xmm0, %xmm1
addsd %xmm1, %xmm8
movsd -0x8(%r10), %xmm1
unpcklpd %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0]
unpcklpd %xmm0, %xmm0            # xmm0 = xmm0[0,0]
mulpd %xmm1, %xmm0
addpd %xmm0, %xmm7
incq %r11
addq $0x10, %r10
cmpq %r11, %rdi
jne 0xa913
incl %r9d
cmpl %edx, %r9d
jne 0xa909
jmp 0xa970
xorpd %xmm7, %xmm7
xorpd %xmm8, %xmm8
testl %eax, %eax
jle 0xac7a
movapd %xmm7, %xmm0
unpckhpd %xmm7, %xmm0            # xmm0 = xmm0[1],xmm7[1]
movapd %xmm0, 0x160(%rsp)
movl $0x1, %esi
movq 0x40(%rsp), %rbp
xorl %r12d, %r12d
movq (%rsp), %r15
movapd %xmm7, 0x150(%rsp)
movsd %xmm8, 0x10(%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), %xmm9
movapd %xmm8, %xmm0
mulsd %xmm9, %xmm0
movapd 0x160(%rsp), %xmm2
divsd %xmm2, %xmm0
movapd %xmm7, %xmm1
mulsd %xmm9, %xmm1
divsd %xmm2, %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 0x361f(%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 0xac58
movq %rsi, 0x18(%rsp)
movq %rbx, %r15
leaq 0xc0(%rsp), %rbx
movq %rbx, 0xb0(%rsp)
leaq 0xb0(%rsp), %rdi
leaq 0x40dd(%rip), %rsi      # 0xeb7a
leaq 0x40f7(%rip), %rdx      # 0xeb9b
movsd %xmm9, 0x48(%rsp)
callq 0xba58
movq %r15, %rdi
leaq 0xb0(%rsp), %rsi
movl %r12d, %edx
movl %r13d, %ecx
movsd 0x48(%rsp), %xmm0
movb $0x1, %al
callq 0x794e
movq 0xb0(%rsp), %rdi
cmpq %rbx, %rdi
je 0xaaeb
movq 0xc0(%rsp), %rsi
incq %rsi
callq 0x32a0
leaq 0xa0(%rsp), %r15
movq %r15, 0x90(%rsp)
leaq 0x90(%rsp), %rdi
leaq 0x4092(%rip), %rsi      # 0xeb9c
leaq 0x40ac(%rip), %rdx      # 0xebbd
callq 0xba58
movq (%rbp), %rax
movsd (%rax,%r13,8), %xmm0
movq 0x8(%rsp), %rdi
movq %rdi, %rbx
leaq 0x90(%rsp), %rsi
movl %r12d, %edx
movl %r13d, %ecx
movb $0x1, %al
callq 0x794e
movq 0x90(%rsp), %rdi
cmpq %r15, %rdi
je 0xab5a
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x32a0
leaq 0x80(%rsp), %r15
movq %r15, 0x70(%rsp)
leaq 0x70(%rsp), %rdi
leaq 0x404b(%rip), %rsi      # 0xebbe
leaq 0x4065(%rip), %rdx      # 0xebdf
callq 0xba58
movq 0x48(%rbp), %rax
movsd (%rax,%r13,8), %xmm0
movq %rbx, %rdi
leaq 0x70(%rsp), %rsi
movl %r12d, %edx
movl %r13d, %ecx
movb $0x1, %al
callq 0x794e
movq 0x70(%rsp), %rdi
cmpq %r15, %rdi
je 0xabb8
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x32a0
leaq 0x120(%rsp), %r15
movq %r15, 0x110(%rsp)
leaq 0x110(%rsp), %rbx
movq %rbx, %rdi
leaq 0x4006(%rip), %rsi      # 0xebe0
leaq 0x4017(%rip), %rdx      # 0xebf8
callq 0xba58
movq 0x8(%rsp), %rdi
movq 0x138(%rdi), %rax
movsd (%rax,%r13,8), %xmm0
movq %rbx, %rsi
movl %r12d, %edx
movl %r13d, %ecx
movb $0x1, %al
callq 0x794e
movq 0x110(%rsp), %rdi
cmpq %r15, %rdi
movq (%rsp), %r15
movq 0x8(%rsp), %rbx
movapd 0x150(%rsp), %xmm7
movsd 0x10(%rsp), %xmm8
movq 0x18(%rsp), %rsi
je 0xac58
movq 0x120(%rsp), %rsi
incq %rsi
callq 0x32a0
movq 0x18(%rsp), %rsi
movsd 0x10(%rsp), %xmm8
movapd 0x150(%rsp), %xmm7
incq %r12
movslq 0x160(%rbx), %rax
addl $0x2, %esi
addq $0x18, %rbp
cmpq %rax, %r12
jl 0xa9aa
movl 0x154(%rbx), %ecx
jmp 0xac7e
movq (%rsp), %r15
incq %r13
movslq %ecx, %rdx
addl $0x2, %r15d
cmpq %rdx, %r13
jl 0xa8cb
cmpl $0x1, (%rbx)
jle 0xad8c
leaq 0x100(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x3eb4(%rip), %rsi      # 0xeb61
leaq 0x3ec5(%rip), %rdx      # 0xeb79
leaq 0xf0(%rsp), %rdi
callq 0xba58
leaq 0x20(%rsp), %rdi
leaq 0xf0(%rsp), %rdx
movq %rbx, %rsi
callq 0x7a28
leaq 0x39cc(%rip), %rsi      # 0xe6a9
leaq 0x20(%rsp), %rdi
callq 0x34f0
leaq 0x60(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xad0e
movq %rdx, 0x50(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x60(%rsp)
jmp 0xad17
movupd (%rcx), %xmm0
movupd %xmm0, (%r15)
movq 0x8(%rax), %rdx
leaq 0x50(%rsp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq %rbx, %rdi
xorl %eax, %eax
callq 0x794e
movq 0x50(%rsp), %rdi
cmpq %r15, %rdi
je 0xad54
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x32a0
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xad6f
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x32a0
movq 0xf0(%rsp), %rdi
cmpq %r14, %rdi
je 0xad8c
movq 0x100(%rsp), %rsi
incq %rsi
callq 0x32a0
addq $0x178, %rsp            # imm = 0x178
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r12
movq 0x50(%rsp), %rdi
cmpq %r15, %rdi
je 0xadbd
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x32a0
jmp 0xadbd
movq %rax, %r12
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xaddd
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x32a0
jmp 0xaddd
movq %rax, %r12
movq 0xf0(%rsp), %rdi
cmpq %r14, %rdi
je 0xaec9
movq 0x100(%rsp), %rsi
jmp 0xaec1
jmp 0xae59
movq %rax, %r12
movq 0xd0(%rsp), %rdi
cmpq %r15, %rdi
je 0xae22
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x32a0
jmp 0xae22
movq %rax, %r12
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xae42
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x32a0
jmp 0xae42
movq %rax, %r12
movq 0x130(%rsp), %rdi
cmpq %r14, %rdi
je 0xaec9
movq 0x140(%rsp), %rsi
jmp 0xaec1
movq %rax, %r12
jmp 0xaec9
movq %rax, %r12
movq 0x70(%rsp), %rdi
cmpq %r15, %rdi
je 0xaec9
movq 0x80(%rsp), %rsi
jmp 0xaec1
movq %rax, %r12
movq 0xb0(%rsp), %rdi
cmpq %rbx, %rdi
je 0xaec9
movq 0xc0(%rsp), %rsi
jmp 0xaec1
movq %rax, %r12
movq 0x110(%rsp), %rdi
cmpq %r15, %rdi
je 0xaec9
movq 0x120(%rsp), %rsi
jmp 0xaec1
movq %rax, %r12
movq 0x90(%rsp), %rdi
cmpq %r15, %rdi
je 0xaec9
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x32a0
movq %r12, %rdi
callq 0x3480
nop