// File: /workspace/github_cpp_makefile_star2_O2/chfeder[P]turbulence_generator/./TurbGen.h
// Function: TurbGen::get_turb_vector(double const*, double*)
void get_turb_vector(const double pos[], double v[]) {
        // ******************************************************
        // Compute physical turbulent vector v[ndim]=(vx,vy,vz) at position pos[ndim]=(x,y,z)
        // from loop over all turbulent modes; return into double v[ndim]
        // ******************************************************
        if (verbose > 1) TurbGen_printf(FuncSig(__func__)+"entering.\n");
        // containers for speeding-up calculations below
        std::vector<double> ampl(nmodes);
        std::vector<double> sinx(nmodes); std::vector<double> cosx(nmodes);
        std::vector<double> siny(nmodes); std::vector<double> cosy(nmodes);
        std::vector<double> sinz(nmodes); std::vector<double> cosz(nmodes);
        // pre-compute some trigonometry
        for (int m = 0; m < nmodes; m++) {
            ampl[m] = 2.0 * sol_weight_norm * this->ampl[m]; // pre-compute amplitude including normalisation factors
            sinx[m] = sin(mode[X][m]*pos[X]);
            cosx[m] = cos(mode[X][m]*pos[X]);
            if ((int)ndim > 1) {
                siny[m] = sin(mode[Y][m]*pos[Y]);
                cosy[m] = cos(mode[Y][m]*pos[Y]);
            } else {
                siny[m] = 0.0;
                cosy[m] = 1.0;
            }
            if ((int)ndim > 2) {
                sinz[m] = sin(mode[Z][m]*pos[Z]);
                cosz[m] = cos(mode[Z][m]*pos[Z]);
            } else {
                sinz[m] = 0.0;
                cosz[m] = 1.0;
            }
        }
        // scratch variables
        double real, imag;
        // init return vector with zero
        v[X] = 0.0; if (ncmp > 1) v[Y] = 0.0; if (ncmp > 2) v[Z] = 0.0;
        // loop over modes
        for (int m = 0; m < nmodes; m++) {
            // these are the real and imaginary parts, respectively, of
            //  e^{ i \vec{k} \cdot \vec{x} } = cos(kx*x + ky*y + kz*z) + i sin(kx*x + ky*y + kz*z)
            real = ( cosx[m]*cosy[m] - sinx[m]*siny[m] ) * cosz[m] - ( sinx[m]*cosy[m] + cosx[m]*siny[m] ) * sinz[m];
            imag = cosx[m] * ( cosy[m]*sinz[m] + siny[m]*cosz[m] ) + sinx[m] * ( cosy[m]*cosz[m] - siny[m]*sinz[m] );
            // return vector for this position x, y, z
            v[X] += ampl[m] * (aka[X][m]*real - akb[X][m]*imag) * ampl_factor[X];
            if (ncmp > 1) v[Y] += ampl[m] * (aka[Y][m]*real - akb[Y][m]*imag) * ampl_factor[Y];
            if (ncmp > 2) v[Z] += ampl[m] * (aka[Z][m]*real - akb[Z][m]*imag) * ampl_factor[Z];
        }
        if (verbose > 1) TurbGen_printf(FuncSig(__func__)+"exiting.\n");
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x188, %rsp            # imm = 0x188
movq %rdx, 0x10(%rsp)
movq %rsi, %r15
movq %rdi, %rbx
cmpl $0x2, (%rdi)
jl 0x409b
leaq 0x9223(%rip), %rsi      # 0xd241
leaq 0x148(%rsp), %rdi
leaq 0x90(%rsp), %rdx
callq 0x3e22
leaq 0x8485(%rip), %rdx      # 0xc4bf
leaq 0x18(%rsp), %rdi
leaq 0x148(%rsp), %rsi
callq 0x6693
leaq 0x8488(%rip), %rdx      # 0xc4db
leaq 0x168(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x6674
leaq 0x168(%rsp), %rsi
movq %rbx, %rdi
xorl %eax, %eax
callq 0x65ac
leaq 0x168(%rsp), %rdi
callq 0x3120
leaq 0x18(%rsp), %rdi
callq 0x3120
leaq 0x148(%rsp), %rdi
callq 0x3120
movslq 0x154(%rbx), %rsi
leaq 0x90(%rsp), %rdi
leaq 0x18(%rsp), %rdx
callq 0xaac6
movslq 0x154(%rbx), %rsi
leaq 0xf0(%rsp), %rdi
leaq 0x18(%rsp), %rdx
callq 0xaac6
movslq 0x154(%rbx), %rsi
leaq 0xd8(%rsp), %rdi
leaq 0x18(%rsp), %rdx
callq 0xaac6
movslq 0x154(%rbx), %rsi
leaq 0x78(%rsp), %rdi
leaq 0x18(%rsp), %rdx
callq 0xaac6
movslq 0x154(%rbx), %rsi
leaq 0xc0(%rsp), %rdi
leaq 0x18(%rsp), %rdx
callq 0xaac6
movslq 0x154(%rbx), %rsi
leaq 0x60(%rsp), %rdi
leaq 0x18(%rsp), %rdx
callq 0xaac6
movslq 0x154(%rbx), %rsi
leaq 0xa8(%rsp), %rdi
leaq 0x18(%rsp), %rdx
callq 0xaac6
xorl %r12d, %r12d
movslq 0x154(%rbx), %rax
cmpq %rax, %r12
jge 0x4292
movsd 0x1d8(%rbx), %xmm0
addsd %xmm0, %xmm0
movq 0x138(%rbx), %rax
mulsd (%rax,%r12,8), %xmm0
movq 0x90(%rsp), %rax
movsd %xmm0, (%rax,%r12,8)
movq 0x48(%rbx), %rax
movsd (%rax,%r12,8), %xmm0
mulsd (%r15), %xmm0
callq 0x3080
movq 0xf0(%rsp), %rax
movsd %xmm0, (%rax,%r12,8)
movq 0x48(%rbx), %rax
movsd (%rax,%r12,8), %xmm0
mulsd (%r15), %xmm0
callq 0x34b0
movq 0xd8(%rsp), %rax
movsd %xmm0, (%rax,%r12,8)
cvttsd2si 0x158(%rbx), %eax
cmpl $0x2, %eax
jl 0x4206
movq 0x60(%rbx), %rax
movsd (%rax,%r12,8), %xmm0
mulsd 0x8(%r15), %xmm0
callq 0x3080
movq 0x78(%rsp), %rax
movsd %xmm0, (%rax,%r12,8)
movq 0x60(%rbx), %rax
movsd (%rax,%r12,8), %xmm0
mulsd 0x8(%r15), %xmm0
callq 0x34b0
jmp 0x4218
movq 0x78(%rsp), %rax
andq $0x0, (%rax,%r12,8)
movsd 0x7e30(%rip), %xmm0     # 0xc048
movq 0xc0(%rsp), %rax
movsd %xmm0, (%rax,%r12,8)
cvttsd2si 0x158(%rbx), %eax
cmpl $0x3, %eax
jl 0x426a
movq 0x78(%rbx), %rax
movsd (%rax,%r12,8), %xmm0
mulsd 0x10(%r15), %xmm0
callq 0x3080
movq 0x60(%rsp), %rax
movsd %xmm0, (%rax,%r12,8)
movq 0x78(%rbx), %rax
movsd (%rax,%r12,8), %xmm0
mulsd 0x10(%r15), %xmm0
callq 0x34b0
jmp 0x427c
movq 0x60(%rsp), %rax
andq $0x0, (%rax,%r12,8)
movsd 0x7dcc(%rip), %xmm0     # 0xc048
movq 0xa8(%rsp), %rax
movsd %xmm0, (%rax,%r12,8)
incq %r12
jmp 0x4147
movq 0x10(%rsp), %rcx
andq $0x0, (%rcx)
movl 0x160(%rbx), %ecx
xorl %edx, %edx
movl $0x0, %esi
cmpl $0x1, %ecx
jle 0x42cd
movq 0x10(%rsp), %rsi
andq $0x0, 0x8(%rsi)
cmpl $0x2, %ecx
jne 0x42c0
xorl %esi, %esi
jmp 0x42cd
movq 0x10(%rsp), %rsi
andq $0x0, 0x10(%rsi)
movb $0x1, %sil
movq 0xd8(%rsp), %rdi
movq 0xc0(%rsp), %r8
movq 0xf0(%rsp), %r9
movq 0x78(%rsp), %r10
movq 0xa8(%rsp), %r11
movq 0x60(%rsp), %r15
movq 0x90(%rsp), %r12
movq 0x90(%rbx), %r13
movq 0xa8(%rbx), %rbp
movq %rbp, 0x58(%rsp)
movq 0xd8(%rbx), %rbp
movq 0xf0(%rbx), %r14
movq %r14, 0x48(%rsp)
movq 0xc0(%rbx), %r14
movq %r14, 0x40(%rsp)
movq 0x108(%rbx), %r14
movq %r14, 0x38(%rsp)
testl %eax, %eax
cmovlel %edx, %eax
shlq $0x3, %rax
xorpd %xmm0, %xmm0
movq %rbx, 0x50(%rsp)
cmpq %rdx, %rax
je 0x44d8
movsd (%rdi,%rdx), %xmm2
movsd (%r8,%rdx), %xmm3
movsd (%r9,%rdx), %xmm4
movsd (%r10,%rdx), %xmm7
movapd %xmm2, %xmm1
mulsd %xmm7, %xmm1
movapd %xmm4, %xmm5
mulsd %xmm3, %xmm5
addsd %xmm1, %xmm5
movsd (%r15,%rdx), %xmm6
mulsd %xmm6, %xmm5
movapd %xmm7, %xmm8
movapd %xmm3, %xmm1
mulsd %xmm6, %xmm1
mulsd %xmm7, %xmm6
mulsd %xmm4, %xmm7
movsd (%r11,%rdx), %xmm9
mulsd %xmm9, %xmm8
addsd %xmm8, %xmm1
mulsd %xmm2, %xmm1
mulsd %xmm3, %xmm2
subsd %xmm7, %xmm2
mulsd %xmm9, %xmm2
subsd %xmm5, %xmm2
mulsd %xmm9, %xmm3
subsd %xmm6, %xmm3
mulsd %xmm4, %xmm3
addsd %xmm3, %xmm1
movsd (%rbp,%rdx), %xmm3
mulsd %xmm1, %xmm3
movsd (%r13,%rdx), %xmm4
mulsd %xmm2, %xmm4
subsd %xmm3, %xmm4
mulsd (%r12,%rdx), %xmm4
mulsd 0x1f8(%rbx), %xmm4
addsd %xmm4, %xmm0
movq 0x10(%rsp), %r14
movsd %xmm0, (%r14)
cmpl $0x2, %ecx
jl 0x4491
movq 0x48(%rsp), %r14
movsd (%r14,%rdx), %xmm3
mulsd %xmm1, %xmm3
movq %rbp, %r14
movq %r13, %rbp
movq %r15, %r13
movq %r11, %r15
movq %r10, %r11
movq %r9, %r10
movq %r8, %r9
movq %rdi, %r8
movq %rsi, %rdi
movl %ecx, %esi
movq 0x58(%rsp), %rcx
movsd (%rcx,%rdx), %xmm4
movl %esi, %ecx
movq %rdi, %rsi
movq %r8, %rdi
movq %r9, %r8
movq %r10, %r9
movq %r11, %r10
movq %r15, %r11
movq %r13, %r15
movq %rbp, %r13
movq %r14, %rbp
movq 0x10(%rsp), %r14
movq 0x50(%rsp), %rbx
mulsd %xmm2, %xmm4
subsd %xmm3, %xmm4
mulsd (%r12,%rdx), %xmm4
mulsd 0x200(%rbx), %xmm4
addsd 0x8(%r14), %xmm4
movsd %xmm4, 0x8(%r14)
testb %sil, %sil
je 0x44cf
movq 0x38(%rsp), %r14
mulsd (%r14,%rdx), %xmm1
movq 0x40(%rsp), %r14
mulsd (%r14,%rdx), %xmm2
subsd %xmm1, %xmm2
mulsd (%r12,%rdx), %xmm2
mulsd 0x208(%rbx), %xmm2
movq 0x10(%rsp), %r14
addsd 0x10(%r14), %xmm2
movsd %xmm2, 0x10(%r14)
addq $0x8, %rdx
jmp 0x434f
cmpl $0x1, (%rbx)
jle 0x4562
leaq 0x8d59(%rip), %rsi      # 0xd241
leaq 0x108(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x3e22
leaq 0x7fbe(%rip), %rdx      # 0xc4bf
leaq 0x18(%rsp), %rdi
leaq 0x108(%rsp), %rsi
callq 0x6693
leaq 0x818f(%rip), %rdx      # 0xc6a9
leaq 0x128(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x6674
leaq 0x128(%rsp), %rsi
movq %rbx, %rdi
xorl %eax, %eax
callq 0x65ac
leaq 0x128(%rsp), %rdi
callq 0x3120
leaq 0x18(%rsp), %rdi
callq 0x3120
leaq 0x108(%rsp), %rdi
callq 0x3120
leaq 0xa8(%rsp), %rdi
callq 0x539a
leaq 0x60(%rsp), %rdi
callq 0x539a
leaq 0xc0(%rsp), %rdi
callq 0x539a
leaq 0x78(%rsp), %rdi
callq 0x539a
leaq 0xd8(%rsp), %rdi
callq 0x539a
leaq 0xf0(%rsp), %rdi
callq 0x539a
leaq 0x90(%rsp), %rdi
callq 0x539a
addq $0x188, %rsp            # imm = 0x188
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x128(%rsp), %rdi
callq 0x3120
jmp 0x45de
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x3120
jmp 0x45ed
movq %rax, %rbx
leaq 0x108(%rsp), %rdi
callq 0x3120
jmp 0x45ff
movq %rax, %rbx
leaq 0xa8(%rsp), %rdi
callq 0x539a
jmp 0x4646
movq %rax, %rbx
leaq 0x168(%rsp), %rdi
callq 0x3120
jmp 0x4623
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x3120
jmp 0x4632
movq %rax, %rbx
leaq 0x148(%rsp), %rdi
callq 0x3120
jmp 0x4698
jmp 0x46af
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x539a
jmp 0x4655
movq %rax, %rbx
leaq 0xc0(%rsp), %rdi
callq 0x539a
jmp 0x4667
movq %rax, %rbx
leaq 0x78(%rsp), %rdi
callq 0x539a
leaq 0xd8(%rsp), %rdi
callq 0x539a
leaq 0xf0(%rsp), %rdi
callq 0x539a
leaq 0x90(%rsp), %rdi
callq 0x539a
movq %rbx, %rdi
callq 0x3470
movq %rax, %rbx
jmp 0x4671
movq %rax, %rbx
jmp 0x467e
movq %rax, %rbx
jmp 0x468b
movq %rax, %rbx
jmp 0x4698