// File: /workspace/github_cpp_makefile_star2_O3/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
leaq 0x3888(%rdi), %r13
movl $0x0, 0x3888(%rdi)
leaq 0x3838(%rdi), %rax
movq %rax, -0x50(%rbp)
leaq 0x8(%rdi), %rax
movq %rax, -0x98(%rbp)
leaq -0xb0(%rbp), %r14
leaq -0x60(%rbp), %r15
movq %r13, -0xa0(%rbp)
movq %r13, %rdi
callq 0x9feb
cmpb $0x1, 0x38a4(%rbx)
jne 0x5c66
movq %r15, %r13
movq %r14, %r15
leaq 0x1577a(%rip), %rax     # 0x1b358
movq (%rax), %rax
movq 0x18(%rax), %rax
cmpl $0x2, 0x4(%rax)
jl 0x5c52
movl $0x8, %r12d
xorl %r14d, %r14d
movq 0x38a8(%rbx), %rax
cmpq $0x0, (%rax,%r12)
je 0x5c31
movl 0x38a0(%rbx), %edi
movl -0x4(%rax,%r12), %esi
movl 0x3898(%rbx), %edx
movl 0x389c(%rbx), %ecx
callq 0xf79f
testb %al, %al
je 0x5c31
movq 0x38a8(%rbx), %rax
movq $0x0, (%rax,%r12)
incq %r14
leaq 0x1571d(%rip), %rax     # 0x1b358
movq (%rax), %rax
movq 0x18(%rax), %rax
movslq 0x4(%rax), %rax
decq %rax
addq $0x38, %r12
cmpq %rax, %r14
jl 0x5bf4
movb $0x0, 0x38a4(%rbx)
movq %r15, %r14
movq %r13, %r15
movq -0xa0(%rbp), %r13
movq $0x0, 0x3840(%rbx)
movslq 0x3808(%rbx), %rax
cmpl 0x380c(%rbx), %eax
je 0x5f40
imulq $0x38, %rax, %rcx
leal 0x1(%rax), %edx
leal 0x100(%rax), %esi
testl %edx, %edx
cmovnsl %edx, %esi
andl $0xffffff00, %esi       # imm = 0xFFFFFF00
negl %esi
addl %esi, %eax
incl %eax
movl %eax, 0x3808(%rbx)
movq -0x98(%rbp), %rsi
movq 0x30(%rsi,%rcx), %rax
movq -0x50(%rbp), %rdx
movq %rax, 0x30(%rdx)
movups (%rsi,%rcx), %xmm0
movups 0x10(%rsi,%rcx), %xmm1
movups 0x20(%rsi,%rcx), %xmm2
movups %xmm2, 0x20(%rdx)
movups %xmm1, 0x10(%rdx)
movups %xmm0, (%rdx)
leaq 0x1568c(%rip), %rax     # 0x1b368
movq (%rax), %rdi
movl 0x383c(%rbx), %esi
callq 0x7f98
movq %rax, %r12
leaq 0x15fac(%rip), %rdi     # 0x1bca0
callq 0x96d0
movl %eax, 0x54(%r12)
movq 0x3848(%rbx), %rax
xorps %xmm0, %xmm0
cvtss2sd (%rax), %xmm0
movl $0x3a, %edx
leaq -0xe0(%rbp), %r12
movq %r12, %rdi
movq 0x1528e(%rip), %rsi     # 0x1afb0
leaq 0xf37b(%rip), %rcx      # 0x150a4
movb $0x1, %al
callq 0x70ce
movl $0x10, %r8d
movq %r12, %rdi
xorl %esi, %esi
xorl %edx, %edx
leaq 0xf336(%rip), %rcx      # 0x1507a
callq 0x3280
movq %r14, -0xc0(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x5d72
movq %rdx, -0xc0(%rbp)
movq (%rcx), %rdx
movq %rdx, -0xb0(%rbp)
jmp 0x5d79
movups (%rcx), %xmm0
movups %xmm0, (%r14)
leaq -0x38(%rbp), %r12
movq 0x8(%rax), %rdx
movq %rdx, -0xb8(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq -0xc0(%rbp), %rdi
leaq 0xf2e6(%rip), %rsi      # 0x1508b
callq 0x34a0
movq %r15, -0x70(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x5dca
movq %rdx, -0x70(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x60(%rbp)
jmp 0x5dd1
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
movq %rdx, -0x68(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x3850(%rbx), %rax
xorps %xmm0, %xmm0
cvtss2sd (%rax), %xmm0
movl $0x3a, %edx
leaq -0x90(%rbp), %rdi
movq 0x151a7(%rip), %rsi     # 0x1afb0
leaq 0xf294(%rip), %rcx      # 0x150a4
movb $0x1, %al
callq 0x70ce
movq -0x70(%rbp), %rcx
movl $0xf, %edi
cmpq %r15, %rcx
je 0x5e29
movq -0x60(%rbp), %rdi
movq -0x68(%rbp), %r8
movq -0x90(%rbp), %rsi
movq -0x88(%rbp), %rdx
leaq (%rdx,%r8), %rax
cmpq %rdi, %rax
jbe 0x5e5b
movl $0xf, %edi
leaq -0x80(%rbp), %r9
cmpq %r9, %rsi
je 0x5e56
movq -0x80(%rbp), %rdi
cmpq %rdi, %rax
jbe 0x5e66
leaq -0x70(%rbp), %rdi
callq 0x30d0
jmp 0x5e76
leaq -0x90(%rbp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3280
movq %r12, -0x48(%rbp)
movq (%rax), %rdx
leaq 0x10(%rax), %rcx
cmpq %rcx, %rdx
je 0x5e93
movq %rdx, -0x48(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x38(%rbp)
jmp 0x5e9b
movups (%rcx), %xmm0
movups %xmm0, (%r12)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, -0x40(%rbp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq -0x48(%rbp), %rdi
movl $0x3, %esi
callq 0x9f0f
movq -0x48(%rbp), %rdi
cmpq %r12, %rdi
je 0x5ed3
callq 0x3230
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0x5ee8
callq 0x3230
movq -0x70(%rbp), %rdi
cmpq %r15, %rdi
je 0x5ef6
callq 0x3230
movq -0xc0(%rbp), %rdi
cmpq %r14, %rdi
je 0x5f07
callq 0x3230
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0x5f1f
callq 0x3230
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 -0x50(%rbp), %rsi
leaq -0x118(%rbp), %rdx
callq 0x5aa6
movq -0x110(%rbp), %rsi
testq %rsi, %rsi
je 0x5f71
movl -0x114(%rbp), %edx
leaq 0x154ac(%rip), %rdi     # 0x1b418
callq 0x3b84
movq %r13, %rdi
callq 0xa049
jmp 0x5bbc
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r12, %rdi
je 0x5f94
callq 0x3230
jmp 0x5f94
movq %rax, %rbx
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0x5fae
callq 0x3230
jmp 0x5fae
movq %rax, %rbx
movq -0x70(%rbp), %rdi
cmpq %r15, %rdi
je 0x5fc1
callq 0x3230
jmp 0x5fc1
movq %rax, %rbx
movq -0xc0(%rbp), %rdi
cmpq %r14, %rdi
je 0x5fd7
callq 0x3230
jmp 0x5fd7
movq %rax, %rbx
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0x5fef
callq 0x3230
movq %rbx, %rdi
callq 0x3440
nop