// File: /workspace/github_cpp_makefile_star2_O1/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 -0x80(%rbp), %r15
movq %r13, -0xa0(%rbp)
movq %r13, %rdi
callq 0x9fdf
cmpb $0x1, 0x38a4(%rbx)
jne 0x5c10
movq %r15, %r13
movq %r14, %r15
leaq 0x157d0(%rip), %rax     # 0x1b358
movq (%rax), %rax
movq 0x18(%rax), %rax
cmpl $0x2, 0x4(%rax)
jl 0x5bfc
movl $0x8, %r12d
xorl %r14d, %r14d
movq 0x38a8(%rbx), %rax
cmpq $0x0, (%rax,%r12)
je 0x5bdb
movl 0x38a0(%rbx), %edi
movl -0x4(%rax,%r12), %esi
movl 0x3898(%rbx), %edx
movl 0x389c(%rbx), %ecx
callq 0xf729
testb %al, %al
je 0x5bdb
movq 0x38a8(%rbx), %rax
movq $0x0, (%rax,%r12)
incq %r14
leaq 0x15773(%rip), %rax     # 0x1b358
movq (%rax), %rax
movq 0x18(%rax), %rax
movslq 0x4(%rax), %rax
decq %rax
addq $0x38, %r12
cmpq %rax, %r14
jl 0x5b9e
movb $0x0, 0x38a4(%rbx)
movq %r15, %r14
movq %r13, %r15
movq -0xa0(%rbp), %r13
movq $0x0, 0x3840(%rbx)
movslq 0x3808(%rbx), %rcx
cmpl 0x380c(%rbx), %ecx
jne 0x5c2e
xorl %eax, %eax
jmp 0x5c59
imulq $0x38, %rcx, %rax
addq -0x98(%rbp), %rax
leal 0x1(%rcx), %edx
leal 0x100(%rcx), %esi
testl %edx, %edx
cmovnsl %edx, %esi
andl $0xffffff00, %esi       # imm = 0xFFFFFF00
negl %esi
addl %esi, %ecx
incl %ecx
movl %ecx, 0x3808(%rbx)
testq %rax, %rax
je 0x5ef6
movq 0x30(%rax), %rcx
movq -0x50(%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 0x156dd(%rip), %rax     # 0x1b368
movq (%rax), %rdi
movl 0x383c(%rbx), %esi
callq 0x7f30
movq %rax, %r12
leaq 0x15ffd(%rip), %rdi     # 0x1bca0
callq 0x9674
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 0x152df(%rip), %rsi     # 0x1afb0
leaq 0xf3cc(%rip), %rcx      # 0x150a4
movb $0x1, %al
callq 0x70b6
movl $0x10, %r8d
movq %r12, %rdi
xorl %esi, %esi
xorl %edx, %edx
leaq 0xf387(%rip), %rcx      # 0x1507a
callq 0x3280
movq %r14, -0xc0(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x5d21
movq %rdx, -0xc0(%rbp)
movq (%rcx), %rdx
movq %rdx, -0xb0(%rbp)
jmp 0x5d28
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 0xf337(%rip), %rsi      # 0x1508b
callq 0x34a0
movq %r15, -0x90(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x5d7f
movq %rdx, -0x90(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x80(%rbp)
jmp 0x5d86
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
movq %rdx, -0x88(%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 -0x70(%rbp), %rdi
movq 0x151f2(%rip), %rsi     # 0x1afb0
leaq 0xf2df(%rip), %rcx      # 0x150a4
movb $0x1, %al
callq 0x70b6
movq -0x90(%rbp), %rcx
movl $0xf, %esi
cmpq %r15, %rcx
je 0x5de1
movq -0x80(%rbp), %rsi
movq -0x88(%rbp), %r8
movq -0x68(%rbp), %rdx
leaq (%rdx,%r8), %rax
cmpq %rsi, %rax
jbe 0x5e0d
movl $0xf, %esi
leaq -0x60(%rbp), %rdi
cmpq %rdi, -0x70(%rbp)
je 0x5e08
movq -0x60(%rbp), %rsi
cmpq %rsi, %rax
jbe 0x5e1f
movq -0x70(%rbp), %rsi
leaq -0x90(%rbp), %rdi
callq 0x30d0
jmp 0x5e2c
leaq -0x70(%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 0x5e49
movq %rdx, -0x48(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x38(%rbp)
jmp 0x5e51
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 0x9f03
movq -0x48(%rbp), %rdi
cmpq %r12, %rdi
je 0x5e89
callq 0x3230
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x5e9b
callq 0x3230
movq -0x90(%rbp), %rdi
cmpq %r15, %rdi
je 0x5eac
callq 0x3230
movq -0xc0(%rbp), %rdi
cmpq %r14, %rdi
je 0x5ebd
callq 0x3230
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0x5ed5
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 0x5a50
movq -0x110(%rbp), %rsi
testq %rsi, %rsi
je 0x5f27
movl -0x114(%rbp), %edx
leaq 0x154f6(%rip), %rdi     # 0x1b418
callq 0x3b84
movq %r13, %rdi
callq 0xa03d
jmp 0x5b66
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r12, %rdi
je 0x5f4a
callq 0x3230
jmp 0x5f4a
movq %rax, %rbx
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x5f61
callq 0x3230
jmp 0x5f61
movq %rax, %rbx
movq -0x90(%rbp), %rdi
cmpq %r15, %rdi
je 0x5f77
callq 0x3230
jmp 0x5f77
movq %rax, %rbx
movq -0xc0(%rbp), %rdi
cmpq %r14, %rdi
je 0x5f8d
callq 0x3230
jmp 0x5f8d
movq %rax, %rbx
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0x5fa5
callq 0x3230
movq %rbx, %rdi
callq 0x3440
nop