// File: /workspace/github_cpp_makefile_star2_O3/chfeder[P]turbulence_generator/./TurbGen.h
// Function: TurbGen::read_ampl_factor_from_evol_file(double)
bool read_ampl_factor_from_evol_file(const double time) {
        if (verbose > 1) TurbGen_printf("Reading from evolution file: time = %e, time/t_turb = %-7.2f\n", time, time/t_decay);
        std::ifstream infilestream(evolfile.c_str());
        if (infilestream.is_open()) {
            // read each line from file into a vector
            std::vector<std::string> lines;
            std::string line;
            while (std::getline(infilestream, line)) lines.push_back(line);
            infilestream.close();
            TurbGen_printf("Restoring ampl_factor from '%s' for current simulation time = %e\n", evolfile.c_str(), time);
            bool initial_copy_done = false;
            // loop backwards through the vector to find the right time entry
            for (int i = lines.size() - 1; i >= 0; i--) {
                if (verbose > 1) TurbGen_printf((lines[i]+'\n').c_str());
                // skip header line(s)
                if (lines[i].find("time") != std::string::npos) continue;
                // split line
                std::istringstream buffer(lines[i]);
                std::vector<std::string> line_split((std::istream_iterator<std::string>(buffer)), std::istream_iterator<std::string>());
                double time_in_file = double(atof(line_split[0].c_str())); // time
                double ampl_factor_in_file[3];
                for (unsigned int d = 0; d < ncmp; d++) ampl_factor_in_file[d] = double(atof(line_split[d+2].c_str()));
                if (verbose > 1) TurbGen_printf("time_in_file, ampl_factor_in_file = %e %e %e %e\n", time_in_file, ampl_factor_in_file[X], ampl_factor_in_file[Y], ampl_factor_in_file[Z]);
                if (!initial_copy_done) { // copy the last valid ampl_factor from the evolution file
                    for (unsigned int d = 0; d < ncmp; d++) ampl_factor[d] = ampl_factor_in_file[d];
                    initial_copy_done = true;
                }
                if (time_in_file >= time-1.1*dt) { // search backwards and update ampl_factor with last valid time
                    for (unsigned int d = 0; d < ncmp; d++) ampl_factor[d] = ampl_factor_in_file[d];
                }
                else break;
            }
            TurbGen_printf("restored ampl_factor = %e %e %e \n", ampl_factor[X], ampl_factor[Y], ampl_factor[Z]);
        }
        else {
            TurbGen_printf("This is a restart with ampl_auto_adjust = 1, but unable to open file '%s' to restore ampl_factor.\n", evolfile.c_str());
            return false;
        }
        return true;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x548, %rsp            # imm = 0x548
movsd %xmm0, 0x10(%rsp)
movq %rdi, %r14
cmpl $0x2, (%rdi)
jl 0x8a6a
leaq 0x180(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x5e58(%rip), %rsi      # 0xe86e
leaq 0x5e8e(%rip), %rdx      # 0xe8ab
leaq 0x170(%rsp), %rbx
movq %rbx, %rdi
callq 0xba58
movsd 0x10(%rsp), %xmm0
movapd %xmm0, %xmm1
divsd 0x198(%r14), %xmm1
movq %r14, %rdi
movq %rbx, %rsi
movb $0x2, %al
callq 0x794e
movq 0x170(%rsp), %rdi
cmpq %r15, %rdi
je 0x8a6a
movq 0x180(%rsp), %rsi
incq %rsi
callq 0x32a0
movq 0x218(%r14), %rsi
leaq 0x340(%rsp), %rbx
movq %rbx, %rdi
movl $0x8, %edx
callq 0x34b0
leaq 0x3b8(%rsp), %rdi
callq 0x3090
movl %eax, %ebp
testb %al, %al
je 0x8b0a
xorpd %xmm0, %xmm0
leaq 0x30(%rsp), %r15
movapd %xmm0, (%r15)
xorl %eax, %eax
movq %rax, 0x10(%r15)
leaq 0xd0(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb $0x0, (%rcx)
leaq 0xc0(%rsp), %r12
movq 0x340(%rsp), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3270
movsbl %al, %edx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x34c0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x8b70
movq %r15, %rdi
movq %r12, %rsi
callq 0xbaee
jmp 0x8ac8
leaq 0x120(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x5e24(%rip), %rsi      # 0xe941
leaq 0x5e7f(%rip), %rdx      # 0xe9a3
leaq 0x110(%rsp), %rdi
callq 0xba58
movq 0x218(%r14), %rdx
leaq 0x110(%rsp), %rsi
movq %r14, %rdi
xorl %eax, %eax
callq 0x794e
movq 0x110(%rsp), %rdi
cmpq %r15, %rdi
je 0x9034
movq 0x120(%rsp), %rsi
incq %rsi
callq 0x32a0
jmp 0x9034
leaq 0x340(%rsp), %rdi
callq 0x3070
leaq 0x160(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x5d1c(%rip), %rsi      # 0xe8ac
leaq 0x5d56(%rip), %rdx      # 0xe8ed
leaq 0x150(%rsp), %rdi
callq 0xba58
movq 0x218(%r14), %rdx
leaq 0x150(%rsp), %rsi
movq %r14, %rdi
movsd 0x10(%rsp), %xmm0
movb $0x1, %al
callq 0x794e
movb %bpl, 0xf(%rsp)
movq 0x150(%rsp), %rdi
cmpq %r15, %rdi
je 0x8be5
movq 0x160(%rsp), %rsi
incq %rsi
callq 0x32a0
movq 0x38(%rsp), %rax
subq 0x30(%rsp), %rax
shrq $0x5, %rax
decl %eax
js 0x8f8f
leaq 0x1d0(%rsp), %r15
leaq 0xf8(%rsp), %rbx
leaq 0x1f8(%r14), %rcx
movq %rcx, 0x18(%rsp)
movl %eax, %ebp
leaq 0x1c0(%rsp), %r13
leaq 0x88(%rsp), %r12
movq $0x0, 0x20(%rsp)
cmpl $0x2, (%r14)
movq 0x30(%rsp), %rdi
jl 0x8ced
movq %rbp, %rax
shlq $0x5, %rax
movq %r15, 0x1c0(%rsp)
movq (%rdi,%rax), %rsi
movq 0x8(%rdi,%rax), %rdx
addq %rsi, %rdx
movq %r13, %rdi
callq 0xde20
movq 0x1c8(%rsp), %rsi
movl $0x1, %ecx
movq %r13, %rdi
xorl %edx, %edx
movl $0xa, %r8d
callq 0x34d0
movq 0x1c0(%rsp), %rsi
movq %r12, %rdi
leaq 0xa8(%rsp), %rdx
callq 0x3f7a
movq %r14, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x794e
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x8ccb
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x32a0
movq 0x1c0(%rsp), %rdi
cmpq %r15, %rdi
je 0x8ce8
movq 0x1d0(%rsp), %rsi
incq %rsi
callq 0x32a0
movq 0x30(%rsp), %rdi
movq %rbp, %r12
shlq $0x5, %r12
addq %r12, %rdi
movl $0x4, %ecx
leaq 0x5922(%rip), %rsi      # 0xe625
xorl %edx, %edx
callq 0x3460
cmpq $-0x1, %rax
je 0x8d1d
leaq 0x88(%rsp), %r12
jmp 0x8f4f
addq 0x30(%rsp), %r12
movq %r13, %rdi
movq %r12, %rsi
movl $0x8, %edx
callq 0x3420
leaq 0x190(%rsp), %r15
movq %r15, %rdi
movq %r13, %rsi
callq 0xbb2c
xorl %eax, %eax
movq %rax, 0xe0(%rsp)
movq %rbx, 0xe8(%rsp)
movq %rax, 0xf0(%rsp)
movb %al, 0xf8(%rsp)
movb %al, 0x108(%rsp)
leaq 0xa8(%rsp), %rdi
movq %r15, %rsi
leaq 0xe0(%rsp), %rdx
leaq 0x50(%rsp), %rcx
callq 0xbb7a
movq 0xe8(%rsp), %rdi
cmpq %rbx, %rdi
je 0x8da7
movq 0xf8(%rsp), %rsi
incq %rsi
callq 0x32a0
movq %rbx, %r13
movq 0x198(%rsp), %rdi
leaq 0x1a8(%rsp), %rax
cmpq %rax, %rdi
je 0x8dcf
movq 0x1a8(%rsp), %rsi
incq %rsi
callq 0x32a0
movq 0xa8(%rsp), %r12
movq (%r12), %rdi
callq 0x3320
movsd %xmm0, 0x28(%rsp)
movl 0x160(%r14), %ebx
testq %rbx, %rbx
je 0x8e22
negq %rbx
movl $0x2, %r15d
movl %r15d, %eax
shlq $0x5, %rax
movq (%r12,%rax), %rdi
callq 0x3320
movsd %xmm0, 0x40(%rsp,%r15,8)
leaq (%rbx,%r15), %rax
incq %rax
incq %r15
cmpq $0x2, %rax
jne 0x8dfb
cmpl $0x1, (%r14)
leaq 0x1d0(%rsp), %r15
movq %r13, %rbx
leaq 0x1c0(%rsp), %r13
leaq 0x88(%rsp), %r12
jle 0x8eb7
movq %rbx, %r15
leaq 0x78(%rsp), %rax
movq %rax, 0x68(%rsp)
leaq 0x68(%rsp), %rbx
movq %rbx, %rdi
leaq 0x5a8f(%rip), %rsi      # 0xe8ee
leaq 0x5ab8(%rip), %rdx      # 0xe91e
callq 0xba58
movsd 0x50(%rsp), %xmm1
movsd 0x58(%rsp), %xmm2
movsd 0x60(%rsp), %xmm3
movq %r14, %rdi
movq %rbx, %rsi
movsd 0x28(%rsp), %xmm0
movb $0x4, %al
callq 0x794e
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
movq %r15, %rbx
leaq 0x1d0(%rsp), %r15
je 0x8eb7
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x32a0
testb $0x1, 0x20(%rsp)
jne 0x8edd
movl 0x160(%r14), %edx
testq %rdx, %rdx
je 0x8edd
shlq $0x3, %rdx
movq 0x18(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0x3230
movsd 0x1a0(%r14), %xmm0
mulsd 0x518a(%rip), %xmm0     # 0xe078
addsd 0x10(%rsp), %xmm0
movsd 0x28(%rsp), %xmm1
ucomisd %xmm0, %xmm1
jb 0x8f61
movl 0x160(%r14), %edx
testq %rdx, %rdx
je 0x8f1f
shlq $0x3, %rdx
movq 0x18(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0x3230
leaq 0xa8(%rsp), %rdi
callq 0xbc9a
movq %r13, %rdi
movq 0x909a(%rip), %rsi      # 0x11fd0
callq 0x3380
leaq 0x238(%rsp), %rdi
callq 0x30e0
movb $0x1, %al
movq %rax, 0x20(%rsp)
leaq -0x1(%rbp), %rax
testq %rbp, %rbp
movq %rax, %rbp
jg 0x8c32
jmp 0x8f8f
leaq 0xa8(%rsp), %rdi
callq 0xbc9a
movq 0x905b(%rip), %rsi      # 0x11fd0
leaq 0x1c0(%rsp), %rdi
callq 0x3380
leaq 0x238(%rsp), %rdi
callq 0x30e0
leaq 0x140(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x597d(%rip), %rsi      # 0xe91f
leaq 0x5997(%rip), %rdx      # 0xe940
leaq 0x130(%rsp), %rdi
callq 0xba58
movsd 0x1f8(%r14), %xmm0
movsd 0x200(%r14), %xmm1
movsd 0x208(%r14), %xmm2
leaq 0x130(%rsp), %rsi
movq %r14, %rdi
movb $0x3, %al
callq 0x794e
movb 0xf(%rsp), %bpl
movq 0x130(%rsp), %rdi
cmpq %r15, %rdi
je 0x9005
movq 0x140(%rsp), %rsi
incq %rsi
callq 0x32a0
movq 0xc0(%rsp), %rdi
leaq 0xd0(%rsp), %rax
cmpq %rax, %rdi
je 0x902a
movq 0xd0(%rsp), %rsi
incq %rsi
callq 0x32a0
leaq 0x30(%rsp), %rdi
callq 0xbc9a
leaq 0x340(%rsp), %rdi
callq 0x30a0
movl %ebp, %eax
addq $0x548, %rsp            # imm = 0x548
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x130(%rsp), %rdi
cmpq %r15, %rdi
je 0x9210
movq 0x140(%rsp), %rsi
jmp 0x9203
jmp 0x920d
movq %rax, %rbx
movq 0x150(%rsp), %rdi
cmpq %r15, %rdi
je 0x9210
movq 0x160(%rsp), %rsi
jmp 0x9203
jmp 0x920d
jmp 0x920d
movq %rax, %rbx
movq 0x110(%rsp), %rdi
cmpq %r15, %rdi
je 0x923f
movq 0x120(%rsp), %rsi
incq %rsi
callq 0x32a0
jmp 0x923f
movq %rax, %rbx
jmp 0x923f
movq %rax, %rbx
movq 0x170(%rsp), %rdi
cmpq %r15, %rdi
je 0x924c
movq 0x180(%rsp), %rsi
incq %rsi
callq 0x32a0
jmp 0x924c
movq %rax, %rbx
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x9124
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x32a0
jmp 0x9124
movq %rax, %rbx
leaq 0xa8(%rsp), %rdi
callq 0xbc9a
jmp 0x9180
movq %rbx, %rcx
movq %rax, %rbx
movq 0xe8(%rsp), %rdi
cmpq %rcx, %rdi
je 0x9156
movq 0xf8(%rsp), %rsi
incq %rsi
callq 0x32a0
movq 0x198(%rsp), %rdi
leaq 0x1a8(%rsp), %rax
cmpq %rax, %rdi
je 0x9180
movq 0x1a8(%rsp), %rsi
incq %rsi
callq 0x32a0
jmp 0x9180
movq %rax, %rbx
movq 0x8e49(%rip), %rsi      # 0x11fd0
leaq 0x1c0(%rsp), %rdi
callq 0x3380
leaq 0x238(%rsp), %rdi
callq 0x30e0
jmp 0x9210
jmp 0x920d
jmp 0x920d
movq %rax, %rbx
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x91d4
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x32a0
jmp 0x91d4
movq %rax, %rbx
movq 0x1c0(%rsp), %rdi
leaq 0x1d0(%rsp), %rax
cmpq %rax, %rdi
jne 0x91fb
jmp 0x9210
movq %rax, %rbx
movq 0x1c0(%rsp), %rdi
cmpq %r15, %rdi
je 0x9210
movq 0x1d0(%rsp), %rsi
incq %rsi
callq 0x32a0
jmp 0x9210
movq %rax, %rbx
movq 0xc0(%rsp), %rdi
leaq 0xd0(%rsp), %rax
cmpq %rax, %rdi
je 0x9235
movq 0xd0(%rsp), %rsi
incq %rsi
callq 0x32a0
leaq 0x30(%rsp), %rdi
callq 0xbc9a
leaq 0x340(%rsp), %rdi
callq 0x30a0
movq %rbx, %rdi
callq 0x3480