// File: /workspace/github_cpp_makefile_star2_O1/Ziang95[P]Tomasulo_simulator/FU.cpp
// Function: flpAdder::FU_automat()
void flpAdder::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_add->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)+" + "+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 0x54b4
movq %r15, %r13
movq %r14, %r15
leaq 0x15f2c(%rip), %rax     # 0x1b358
movq (%rax), %rax
movq 0x10(%rax), %rax
cmpl $0x2, 0x4(%rax)
jl 0x54a0
movl $0x8, %r12d
xorl %r14d, %r14d
movq 0x38a8(%rbx), %rax
cmpq $0x0, (%rax,%r12)
je 0x547f
movl 0x38a0(%rbx), %edi
movl -0x4(%rax,%r12), %esi
movl 0x3898(%rbx), %edx
movl 0x389c(%rbx), %ecx
callq 0xf729
testb %al, %al
je 0x547f
movq 0x38a8(%rbx), %rax
movq $0x0, (%rax,%r12)
incq %r14
leaq 0x15ecf(%rip), %rax     # 0x1b358
movq (%rax), %rax
movq 0x10(%rax), %rax
movslq 0x4(%rax), %rax
decq %rax
addq $0x38, %r12
cmpq %rax, %r14
jl 0x5442
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 0x54d2
xorl %eax, %eax
jmp 0x54fd
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 0x579a
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 0x15e39(%rip), %rax     # 0x1b368
movq (%rax), %rdi
movl 0x383c(%rbx), %esi
callq 0x7f30
movq %rax, %r12
leaq 0x16759(%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 0x15a3b(%rip), %rsi     # 0x1afb0
leaq 0xfb28(%rip), %rcx      # 0x150a4
movb $0x1, %al
callq 0x70b6
movl $0x10, %r8d
movq %r12, %rdi
xorl %esi, %esi
xorl %edx, %edx
leaq 0xfae3(%rip), %rcx      # 0x1507a
callq 0x3280
movq %r14, -0xc0(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x55c5
movq %rdx, -0xc0(%rbp)
movq (%rcx), %rdx
movq %rdx, -0xb0(%rbp)
jmp 0x55cc
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 0xfa5c(%rip), %rsi      # 0x15054
callq 0x34a0
movq %r15, -0x90(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x5623
movq %rdx, -0x90(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x80(%rbp)
jmp 0x562a
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 0x1594e(%rip), %rsi     # 0x1afb0
leaq 0xfa3b(%rip), %rcx      # 0x150a4
movb $0x1, %al
callq 0x70b6
movq -0x90(%rbp), %rcx
movl $0xf, %esi
cmpq %r15, %rcx
je 0x5685
movq -0x80(%rbp), %rsi
movq -0x88(%rbp), %r8
movq -0x68(%rbp), %rdx
leaq (%rdx,%r8), %rax
cmpq %rsi, %rax
jbe 0x56b1
movl $0xf, %esi
leaq -0x60(%rbp), %rdi
cmpq %rdi, -0x70(%rbp)
je 0x56ac
movq -0x60(%rbp), %rsi
cmpq %rsi, %rax
jbe 0x56c3
movq -0x70(%rbp), %rsi
leaq -0x90(%rbp), %rdi
callq 0x30d0
jmp 0x56d0
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 0x56ed
movq %rdx, -0x48(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x38(%rbp)
jmp 0x56f5
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 0x572d
callq 0x3230
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x573f
callq 0x3230
movq -0x90(%rbp), %rdi
cmpq %r15, %rdi
je 0x5750
callq 0x3230
movq -0xc0(%rbp), %rdi
cmpq %r14, %rdi
je 0x5761
callq 0x3230
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0x5779
callq 0x3230
movq 0x3840(%rbx), %rax
movq 0x3848(%rbx), %rcx
movss (%rcx), %xmm0
movq 0x3850(%rbx), %rcx
addss (%rcx), %xmm0
movss %xmm0, (%rax)
movq %rbx, %rdi
movq -0x50(%rbp), %rsi
leaq -0x118(%rbp), %rdx
callq 0x52f4
movq -0x110(%rbp), %rsi
testq %rsi, %rsi
je 0x57cb
movl -0x114(%rbp), %edx
leaq 0x15c52(%rip), %rdi     # 0x1b418
callq 0x3b84
movq %r13, %rdi
callq 0xa03d
jmp 0x540a
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r12, %rdi
je 0x57ee
callq 0x3230
jmp 0x57ee
movq %rax, %rbx
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x5805
callq 0x3230
jmp 0x5805
movq %rax, %rbx
movq -0x90(%rbp), %rdi
cmpq %r15, %rdi
je 0x581b
callq 0x3230
jmp 0x581b
movq %rax, %rbx
movq -0xc0(%rbp), %rdi
cmpq %r14, %rdi
je 0x5831
callq 0x3230
jmp 0x5831
movq %rax, %rbx
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0x5849
callq 0x3230
movq %rbx, %rdi
callq 0x3440
nop