// File: /workspace/github_cpp_makefile_star2_O3/Ziang95[P]Tomasulo_simulator/FU.cpp
// Function: ldsdUnit::FU_automat()
void ldsdUnit::FU_automat()
{
    next_vdd = 0;
    while (true)
    {
A:      at_rising_edge(next_vdd);
        if (squash_p.flag)
        {
            squash_p.flag = false;
            at_falling_edge(next_vdd);
            continue;
        }
        auto newTask = queue.deQ();
        if (newTask)
        {
            task = *newTask;
            ROBEntry *R = CPU_ROB->get_entry(task.dest);
            R->output.exe = sys_clk.get_prog_cyc();
            for (int i = 0; ;i++)
            {
                if (squash_p.flag)
                {
                    squash_p.flag = false;
                    if (is_prev_index(squash_p.ROB_i, task.dest, squash_p.R_f, squash_p.R_r))
                        break;
                }
                msg_log("Calculating address "+to_string(task.oprnd1->i)+" + "+to_string(task.offset) + ", ROB = " + to_string(task.dest), 3);
                if (i == CPU_cfg->ld_str->exe_time - 1)
                {
                    task.lsqe->addr = task.oprnd1->i + task.offset;
                    if (task.code == SD)
                    {
                        *task.busy = false;
                        if (task.lsqe->SD_source == -1)
                        {
                            at_falling_edge(next_vdd);
                            task.lsqe->ready = true;
                            R->finished = true;
                            goto A;
                        }
                    }
                    else
                    {
                        at_falling_edge(next_vdd);
                        task.lsqe->ready = true;
                        goto A;
                    }
                    break;
                }
                at_falling_edge(next_vdd);
                at_rising_edge(next_vdd);
            }
        }
        at_falling_edge(next_vdd);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x128, %rsp            # imm = 0x128
movq %rdi, %rbx
leaq 0x3888(%rdi), %r14
movl $0x0, 0x3888(%rdi)
leaq 0x8(%rdi), %rax
movq %rax, -0x120(%rbp)
leaq 0x3838(%rdi), %rax
movq %rax, -0x118(%rbp)
movq %r14, -0x130(%rbp)
movq %r14, %rdi
callq 0x9feb
cmpb $0x0, 0x38a4(%rbx)
jne 0x6874
movslq 0x3808(%rbx), %rax
cmpl 0x380c(%rbx), %eax
je 0x687b
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 -0x120(%rbp), %rdx
movq 0x30(%rdx,%rcx), %rax
movq -0x118(%rbp), %rsi
movq %rax, 0x30(%rsi)
movups (%rdx,%rcx), %xmm0
movups 0x10(%rdx,%rcx), %xmm1
movups 0x20(%rdx,%rcx), %xmm2
movups %xmm2, 0x20(%rsi)
movups %xmm1, 0x10(%rsi)
movups %xmm0, (%rsi)
leaq 0x15113(%rip), %rax     # 0x1b368
movq (%rax), %rdi
movl 0x383c(%rbx), %esi
callq 0x7f98
movq %rax, %r15
leaq 0x15a33(%rip), %rdi     # 0x1bca0
callq 0x96d0
movq %r15, -0x128(%rbp)
movl %eax, 0x54(%r15)
xorl %r15d, %r15d
cmpb $0x1, 0x38a4(%rbx)
jne 0x62b5
movb $0x0, 0x38a4(%rbx)
movl 0x38a0(%rbx), %edi
movl 0x383c(%rbx), %esi
movl 0x3898(%rbx), %edx
movl 0x389c(%rbx), %ecx
callq 0xf79f
testb %al, %al
jne 0x687b
movl %r15d, -0x4c(%rbp)
movq 0x3848(%rbx), %rax
movl (%rax), %r13d
movl %r13d, %r15d
negl %r15d
cmovsl %r13d, %r15d
movl $0x1, %r12d
cmpl $0xa, %r15d
jb 0x6320
movl $0x4, %r12d
movl %r15d, %eax
movl $0xd1b71759, %edx       # imm = 0xD1B71759
cmpl $0x63, %eax
jbe 0x6317
cmpl $0x3e7, %eax            # imm = 0x3E7
jbe 0x631d
cmpl $0x2710, %eax           # imm = 0x2710
jb 0x6320
movl %eax, %ecx
imulq %rdx, %rcx
shrq $0x2d, %rcx
addl $0x4, %r12d
cmpl $0x1869f, %eax          # imm = 0x1869F
movl %ecx, %eax
ja 0x62e7
addl $-0x3, %r12d
jmp 0x6320
addl $-0x2, %r12d
jmp 0x6320
decl %r12d
shrl $0x1f, %r13d
movl %r13d, %esi
addl %r12d, %esi
leaq -0x140(%rbp), %rax
movq %rax, -0x150(%rbp)
leaq -0x150(%rbp), %r14
movq %r14, %rdi
movl $0x2d, %edx
callq 0x32b0
movq -0x150(%rbp), %rdi
addq %r13, %rdi
movl %r12d, %esi
movl %r15d, %edx
callq 0x7056
movl $0x14, %r8d
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
leaq 0xed1a(%rip), %rcx      # 0x1508f
callq 0x3280
leaq -0x100(%rbp), %rsi
movq %rsi, -0x110(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x63aa
movq %rdx, -0x110(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x100(%rbp)
jmp 0x63b0
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
leaq -0x38(%rbp), %r15
movq 0x8(%rax), %rdx
movq %rdx, -0x108(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq -0x110(%rbp), %rdi
leaq 0xec78(%rip), %rsi      # 0x15054
callq 0x34a0
movq %r15, -0x48(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x6401
movq %rdx, -0x48(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x38(%rbp)
jmp 0x6408
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
movq %rdx, -0x40(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movl 0x3860(%rbx), %r15d
movl %r15d, %r13d
negl %r13d
cmovsl %r15d, %r13d
movl $0x1, %r12d
cmpl $0xa, %r13d
jb 0x6483
movl $0x4, %r12d
movl %r13d, %eax
movl $0xd1b71759, %edx       # imm = 0xD1B71759
cmpl $0x63, %eax
jbe 0x647a
cmpl $0x3e7, %eax            # imm = 0x3E7
jbe 0x6480
cmpl $0x2710, %eax           # imm = 0x2710
jb 0x6483
movl %eax, %ecx
imulq %rdx, %rcx
shrq $0x2d, %rcx
addl $0x4, %r12d
cmpl $0x1869f, %eax          # imm = 0x1869F
movl %ecx, %eax
ja 0x644a
addl $-0x3, %r12d
jmp 0x6483
addl $-0x2, %r12d
jmp 0x6483
decl %r12d
shrl $0x1f, %r15d
leal (%r12,%r15), %esi
leaq -0xa0(%rbp), %rax
movq %rax, -0xb0(%rbp)
leaq -0xb0(%rbp), %rdi
movl $0x2d, %edx
callq 0x32b0
addq -0xb0(%rbp), %r15
movq %r15, %rdi
movl %r12d, %esi
movl %r13d, %edx
callq 0x7056
movq -0x48(%rbp), %rcx
movl $0xf, %edi
leaq -0x38(%rbp), %r15
cmpq %r15, %rcx
je 0x64d5
movq -0x38(%rbp), %rdi
movq -0x40(%rbp), %r8
movq -0xb0(%rbp), %rsi
movq -0xa8(%rbp), %rdx
leaq (%rdx,%r8), %rax
cmpq %rdi, %rax
leaq -0x60(%rbp), %r12
leaq -0xc0(%rbp), %r13
jbe 0x6518
movl $0xf, %edi
leaq -0xa0(%rbp), %r9
cmpq %r9, %rsi
je 0x6513
movq -0xa0(%rbp), %rdi
cmpq %rdi, %rax
jbe 0x6523
leaq -0x48(%rbp), %rdi
callq 0x30d0
jmp 0x6533
leaq -0xb0(%rbp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3280
movq %r12, -0x70(%rbp)
movq (%rax), %rdx
leaq 0x10(%rax), %rcx
cmpq %rcx, %rdx
je 0x6550
movq %rdx, -0x70(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x60(%rbp)
jmp 0x6558
movups (%rcx), %xmm0
movups %xmm0, (%r12)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, -0x68(%rbp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq -0x70(%rbp), %rdi
leaq 0xf1ee(%rip), %rsi      # 0x1576d
callq 0x34a0
movq %r13, -0xd0(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x65ad
movq %rdx, -0xd0(%rbp)
movq (%rcx), %rdx
movq %rdx, -0xc0(%rbp)
jmp 0x65b5
movups (%rcx), %xmm0
movups %xmm0, (%r13)
movq 0x8(%rax), %rdx
movq %rdx, -0xc8(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movl 0x383c(%rbx), %r15d
movl %r15d, %r13d
negl %r13d
cmovsl %r15d, %r13d
movl $0x1, %r12d
cmpl $0xa, %r13d
jb 0x6633
movl $0x4, %r12d
movl %r13d, %eax
movl $0xd1b71759, %edx       # imm = 0xD1B71759
cmpl $0x63, %eax
jbe 0x662a
cmpl $0x3e7, %eax            # imm = 0x3E7
jbe 0x6630
cmpl $0x2710, %eax           # imm = 0x2710
jb 0x6633
movl %eax, %ecx
imulq %rdx, %rcx
shrq $0x2d, %rcx
addl $0x4, %r12d
cmpl $0x1869f, %eax          # imm = 0x1869F
movl %ecx, %eax
ja 0x65fa
addl $-0x3, %r12d
jmp 0x6633
addl $-0x2, %r12d
jmp 0x6633
decl %r12d
shrl $0x1f, %r15d
leal (%r12,%r15), %esi
leaq -0x80(%rbp), %rax
movq %rax, -0x90(%rbp)
leaq -0x90(%rbp), %rdi
movl $0x2d, %edx
callq 0x32b0
addq -0x90(%rbp), %r15
movq %r15, %rdi
movl %r12d, %esi
movl %r13d, %edx
callq 0x7056
movq -0xd0(%rbp), %rcx
movl $0xf, %edi
leaq -0xc0(%rbp), %r13
cmpq %r13, %rcx
je 0x668b
movq -0xc0(%rbp), %rdi
movq -0xc8(%rbp), %r8
movq -0x90(%rbp), %rsi
movq -0x88(%rbp), %rdx
leaq (%rdx,%r8), %rax
cmpq %rdi, %rax
leaq -0x38(%rbp), %r15
leaq -0x60(%rbp), %r12
leaq -0xe0(%rbp), %r14
jbe 0x66cf
movl $0xf, %edi
leaq -0x80(%rbp), %r9
cmpq %r9, %rsi
je 0x66ca
movq -0x80(%rbp), %rdi
cmpq %rdi, %rax
jbe 0x66dd
leaq -0xd0(%rbp), %rdi
callq 0x30d0
jmp 0x66ed
leaq -0x90(%rbp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3280
movq %r14, -0xf0(%rbp)
movq (%rax), %rdx
leaq 0x10(%rax), %rcx
cmpq %rcx, %rdx
je 0x6713
movq %rdx, -0xf0(%rbp)
movq (%rcx), %rdx
movq %rdx, -0xe0(%rbp)
jmp 0x671a
movups (%rcx), %xmm0
movups %xmm0, (%r14)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, -0xe8(%rbp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq -0xf0(%rbp), %rdi
movl $0x3, %esi
callq 0x9f0f
movq -0xf0(%rbp), %rdi
cmpq %r14, %rdi
je 0x675b
callq 0x3230
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0x6770
callq 0x3230
movq -0xd0(%rbp), %rdi
cmpq %r13, %rdi
je 0x6781
callq 0x3230
movq -0x70(%rbp), %rdi
cmpq %r12, %rdi
je 0x678f
callq 0x3230
movq -0xb0(%rbp), %rdi
leaq -0xa0(%rbp), %rax
cmpq %rax, %rdi
movq -0x130(%rbp), %r14
je 0x67ae
callq 0x3230
movq -0x48(%rbp), %rdi
cmpq %r15, %rdi
je 0x67bc
callq 0x3230
movq -0x110(%rbp), %rdi
leaq -0x100(%rbp), %rax
cmpq %rax, %rdi
movl -0x4c(%rbp), %r15d
je 0x67d8
callq 0x3230
movq -0x150(%rbp), %rdi
leaq -0x140(%rbp), %rax
cmpq %rax, %rdi
je 0x67f0
callq 0x3230
leaq 0x14b61(%rip), %rax     # 0x1b358
movq (%rax), %rax
movq 0x20(%rax), %rax
movl 0x4(%rax), %eax
decl %eax
cmpl %eax, %r15d
je 0x6820
movq %r14, %rdi
callq 0xa049
movq %r14, %rdi
callq 0x9feb
incl %r15d
jmp 0x6280
movl 0x3860(%rbx), %ecx
movq 0x3848(%rbx), %rax
addl (%rax), %ecx
movq 0x3858(%rbx), %rax
movl %ecx, 0x10(%rax)
cmpl $0x7, 0x3838(%rbx)
jne 0x6888
movq 0x3868(%rbx), %rcx
movb $0x0, (%rcx)
cmpl $-0x1, 0x4(%rax)
jne 0x687b
movq %r14, %rdi
callq 0xa049
movq 0x3858(%rbx), %rax
movb $0x1, %cl
movb %cl, 0x14(%rax)
movq -0x128(%rbp), %rax
movb %cl, (%rax)
jmp 0x61d2
movb $0x0, 0x38a4(%rbx)
movq %r14, %rdi
callq 0xa049
jmp 0x61d2
movq %r14, %rdi
callq 0xa049
movq 0x3858(%rbx), %rax
movb $0x1, 0x14(%rax)
jmp 0x61d2
movq %rax, %rbx
jmp 0x68f8
movq %rax, %rbx
leaq -0x38(%rbp), %r15
leaq -0x60(%rbp), %r12
leaq -0xc0(%rbp), %r13
jmp 0x68e7
movq %rax, %rbx
jmp 0x68d2
movq %rax, %rbx
movq -0xf0(%rbp), %rdi
cmpq %r14, %rdi
je 0x68d2
callq 0x3230
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0x68e7
callq 0x3230
movq -0xd0(%rbp), %rdi
cmpq %r13, %rdi
je 0x68f8
callq 0x3230
movq -0x70(%rbp), %rdi
cmpq %r12, %rdi
je 0x691e
callq 0x3230
jmp 0x691e
movq %rax, %rbx
jmp 0x695c
movq %rax, %rbx
jmp 0x6944
movq %rax, %rbx
leaq -0x38(%rbp), %r15
jmp 0x6936
movq %rax, %rbx
movq -0xb0(%rbp), %rdi
leaq -0xa0(%rbp), %rax
cmpq %rax, %rdi
je 0x6936
callq 0x3230
movq -0x48(%rbp), %rdi
cmpq %r15, %rdi
je 0x6944
callq 0x3230
movq -0x110(%rbp), %rdi
leaq -0x100(%rbp), %rax
cmpq %rax, %rdi
je 0x695c
callq 0x3230
movq -0x150(%rbp), %rdi
leaq -0x140(%rbp), %rax
cmpq %rax, %rdi
je 0x6974
callq 0x3230
movq %rbx, %rdi
callq 0x3440