// File: /workspace/github_cpp_makefile_star2_O2/Ziang95[P]Tomasulo_simulator/FU.cpp
// Function: flpMtplr::FU_automat()
void flpMtplr::FU_automat()
{
    next_vdd = 0;
    FU_QEntry shift_out;
    while (true)
    {
        at_rising_edge(next_vdd);
        if (squash_p.flag)
        {
            for (int i = 0; i<CPU_cfg->fp_mul->exe_time - 1; i++)
                if (pLatency_Q[i].res && is_prev_index(squash_p.ROB_i, pLatency_Q[i].dest, squash_p.R_f, squash_p.R_r))
                    pLatency_Q[i].res = nullptr;
            squash_p.flag = false;
        }
        task.res = nullptr;
        auto newTask = queue.deQ();
        if (newTask != nullptr)
        {
            task = *newTask;
            ROBEntry *R = CPU_ROB->get_entry(task.dest);
            R->output.exe = sys_clk.get_prog_cyc();
            msg_log("Calculating FLP "+to_string(task.oprnd1->f)+" X "+to_string(task.oprnd2->f), 3);
            task.res->f = task.oprnd1->f * task.oprnd2->f;
        }
        shift(task, shift_out);
        if (shift_out.res)
            fCDB.enQ(shift_out.res, shift_out.dest);
        at_falling_edge(next_vdd);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf8, %rsp
movq %rdi, %rbx
addq $0x3888, %rdi           # imm = 0x3888
andl $0x0, 0x3888(%rbx)
leaq 0x3838(%rbx), %rax
movq %rax, -0x30(%rbp)
leaq 0x8(%rbx), %rax
movq %rax, -0x40(%rbp)
leaq 0x11537(%rip), %r12     # 0x16360
leaq -0xc0(%rbp), %r13
movq %rdi, -0x38(%rbp)
callq 0x83e0
cmpb $0x1, 0x38a4(%rbx)
jne 0x4ead
movq %r13, %r15
pushq $0x8
popq %r13
xorl %r14d, %r14d
movq (%r12), %rax
movq 0x18(%rax), %rax
movslq 0x4(%rax), %rax
decq %rax
cmpq %rax, %r14
jge 0x4ea3
movq 0x38a8(%rbx), %rax
cmpq $0x0, (%rax,%r13)
je 0x4e9a
movl 0x38a0(%rbx), %edi
movl -0x4(%rax,%r13), %esi
movl 0x3898(%rbx), %edx
movl 0x389c(%rbx), %ecx
callq 0xc3de
testb %al, %al
je 0x4e9a
movq 0x38a8(%rbx), %rax
andq $0x0, (%rax,%r13)
incq %r14
addq $0x38, %r13
jmp 0x4e4c
movb $0x0, 0x38a4(%rbx)
movq %r15, %r13
andq $0x0, 0x3840(%rbx)
movq -0x40(%rbp), %rdi
callq 0x3f84
testq %rax, %rax
je 0x4fdd
movq 0x30(%rax), %rcx
movq -0x30(%rbp), %rdx
movq %rcx, 0x30(%rdx)
movups (%rax), %xmm0
movups 0x10(%rax), %xmm1
movups 0x20(%rax), %xmm2
movups %xmm2, 0x20(%rdx)
movups %xmm1, 0x10(%rdx)
movups %xmm0, (%rdx)
leaq 0x11480(%rip), %rax     # 0x16370
movq (%rax), %rdi
movl 0x383c(%rbx), %esi
callq 0x6c7e
movq %r13, %r15
movq %rax, %r13
leaq 0x11d9d(%rip), %rdi     # 0x16ca8
callq 0x7e24
movl %eax, 0x54(%r13)
movq 0x3848(%rbx), %rax
movss (%rax), %xmm0
leaq -0xa0(%rbp), %r13
movq %r13, %rdi
callq 0x5bf1
movq %r15, %rdi
leaq 0xa142(%rip), %rsi      # 0xf07a
movq %r13, %rdx
callq 0x5a8a
leaq -0x60(%rbp), %rdi
movq %r15, %rsi
leaq 0xa13d(%rip), %rdx      # 0xf08b
callq 0x5bc8
movq %r15, %r13
movq 0x3850(%rbx), %rax
movss (%rax), %xmm0
leaq -0x80(%rbp), %r15
movq %r15, %rdi
callq 0x5bf1
leaq -0xe0(%rbp), %r14
movq %r14, %rdi
leaq -0x60(%rbp), %rsi
movq %r15, %rdx
callq 0x5b57
movq %r14, %rdi
pushq $0x3
popq %rsi
callq 0x8343
movq %r14, %rdi
callq 0x3140
leaq -0x80(%rbp), %rdi
callq 0x3140
leaq -0x60(%rbp), %rdi
callq 0x3140
movq %r13, %rdi
callq 0x3140
leaq -0xa0(%rbp), %rdi
callq 0x3140
movq 0x3840(%rbx), %rax
movq 0x3848(%rbx), %rcx
movss (%rcx), %xmm0
movq 0x3850(%rbx), %rcx
mulss (%rcx), %xmm0
movss %xmm0, (%rax)
movq %rbx, %rdi
movq -0x30(%rbp), %rsi
leaq -0x118(%rbp), %rdx
callq 0x4d3a
movq -0x110(%rbp), %rsi
testq %rsi, %rsi
je 0x500e
movl -0x114(%rbp), %edx
leaq 0x11417(%rip), %rdi     # 0x16420
callq 0x3a0e
movq -0x38(%rbp), %r14
movq %r14, %rdi
callq 0x8437
movq %r14, %rdi
jmp 0x4e34
movq %rax, %rbx
leaq -0xe0(%rbp), %rdi
callq 0x3140
jmp 0x5036
movq %rax, %rbx
leaq -0x80(%rbp), %rdi
callq 0x3140
jmp 0x5044
movq %rax, %rbx
leaq -0x60(%rbp), %rdi
callq 0x3140
jmp 0x5052
movq %rax, %rbx
leaq -0xc0(%rbp), %rdi
callq 0x3140
jmp 0x5063
movq %rax, %rbx
leaq -0xa0(%rbp), %rdi
callq 0x3140
movq %rbx, %rdi
callq 0x3440
nop