// File: /workspace/github_cpp_makefile_star2_O3/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 -0x60(%rbp), %r15
movq %r13, -0xa0(%rbp)
movq %r13, %rdi
callq 0x9feb
cmpb $0x1, 0x38a4(%rbx)
jne 0x551c
movq %r15, %r13
movq %r14, %r15
leaq 0x15ec4(%rip), %rax     # 0x1b358
movq (%rax), %rax
movq 0x10(%rax), %rax
cmpl $0x2, 0x4(%rax)
jl 0x5508
movl $0x8, %r12d
xorl %r14d, %r14d
movq 0x38a8(%rbx), %rax
cmpq $0x0, (%rax,%r12)
je 0x54e7
movl 0x38a0(%rbx), %edi
movl -0x4(%rax,%r12), %esi
movl 0x3898(%rbx), %edx
movl 0x389c(%rbx), %ecx
callq 0xf79f
testb %al, %al
je 0x54e7
movq 0x38a8(%rbx), %rax
movq $0x0, (%rax,%r12)
incq %r14
leaq 0x15e67(%rip), %rax     # 0x1b358
movq (%rax), %rax
movq 0x10(%rax), %rax
movslq 0x4(%rax), %rax
decq %rax
addq $0x38, %r12
cmpq %rax, %r14
jl 0x54aa
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 0x57f6
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 0x15dd6(%rip), %rax     # 0x1b368
movq (%rax), %rdi
movl 0x383c(%rbx), %esi
callq 0x7f98
movq %rax, %r12
leaq 0x166f6(%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 0x159d8(%rip), %rsi     # 0x1afb0
leaq 0xfac5(%rip), %rcx      # 0x150a4
movb $0x1, %al
callq 0x70ce
movl $0x10, %r8d
movq %r12, %rdi
xorl %esi, %esi
xorl %edx, %edx
leaq 0xfa80(%rip), %rcx      # 0x1507a
callq 0x3280
movq %r14, -0xc0(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x5628
movq %rdx, -0xc0(%rbp)
movq (%rcx), %rdx
movq %rdx, -0xb0(%rbp)
jmp 0x562f
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 0xf9f9(%rip), %rsi      # 0x15054
callq 0x34a0
movq %r15, -0x70(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x5680
movq %rdx, -0x70(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x60(%rbp)
jmp 0x5687
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 0x158f1(%rip), %rsi     # 0x1afb0
leaq 0xf9de(%rip), %rcx      # 0x150a4
movb $0x1, %al
callq 0x70ce
movq -0x70(%rbp), %rcx
movl $0xf, %edi
cmpq %r15, %rcx
je 0x56df
movq -0x60(%rbp), %rdi
movq -0x68(%rbp), %r8
movq -0x90(%rbp), %rsi
movq -0x88(%rbp), %rdx
leaq (%rdx,%r8), %rax
cmpq %rdi, %rax
jbe 0x5711
movl $0xf, %edi
leaq -0x80(%rbp), %r9
cmpq %r9, %rsi
je 0x570c
movq -0x80(%rbp), %rdi
cmpq %rdi, %rax
jbe 0x571c
leaq -0x70(%rbp), %rdi
callq 0x30d0
jmp 0x572c
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 0x5749
movq %rdx, -0x48(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x38(%rbp)
jmp 0x5751
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 0x5789
callq 0x3230
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0x579e
callq 0x3230
movq -0x70(%rbp), %rdi
cmpq %r15, %rdi
je 0x57ac
callq 0x3230
movq -0xc0(%rbp), %rdi
cmpq %r14, %rdi
je 0x57bd
callq 0x3230
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0x57d5
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 0x535c
movq -0x110(%rbp), %rsi
testq %rsi, %rsi
je 0x5827
movl -0x114(%rbp), %edx
leaq 0x15bf6(%rip), %rdi     # 0x1b418
callq 0x3b84
movq %r13, %rdi
callq 0xa049
jmp 0x5472
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r12, %rdi
je 0x584a
callq 0x3230
jmp 0x584a
movq %rax, %rbx
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0x5864
callq 0x3230
jmp 0x5864
movq %rax, %rbx
movq -0x70(%rbp), %rdi
cmpq %r15, %rdi
je 0x5877
callq 0x3230
jmp 0x5877
movq %rax, %rbx
movq -0xc0(%rbp), %rdi
cmpq %r14, %rdi
je 0x588d
callq 0x3230
jmp 0x588d
movq %rax, %rbx
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0x58a5
callq 0x3230
movq %rbx, %rdi
callq 0x3440
nop