// File: /workspace/github_cpp_makefile_star2_O1/CMU-SAFARI[P]ramulator/src/Controller.h
// Function: ramulator::Controller<ramulator::SALP>::issue_cmd(ramulator::SALP::Command, std::vector<int, std::allocator<int>> const&)
void issue_cmd(typename T::Command cmd, const vector<int>& addr_vec)
    {
        cmd_issue_autoprecharge(cmd, addr_vec);
        assert(is_ready(cmd, addr_vec));
        channel->update(cmd, addr_vec.data(), clk);

        if(cmd == T::Command::PRE){
            if(rowtable->get_hits(addr_vec, true) == 0){
                useless_activates++;
            }
        }
 
        rowtable->update(cmd, addr_vec, clk);
        if (record_cmd_trace){
            // select rank
            auto& file = cmd_trace_files[addr_vec[1]];
            string& cmd_name = channel->spec->command_name[int(cmd)];
            file<<clk<<','<<cmd_name;
            // TODO bad coding here
            if (cmd_name == "PREA" || cmd_name == "REF")
                file<<endl;
            else{
                int bank_id = addr_vec[int(T::Level::Bank)];
                if (channel->spec->standard_name == "DDR4" || channel->spec->standard_name == "GDDR5")
                    bank_id += addr_vec[int(T::Level::Bank) - 1] * channel->spec->org_entry.count[int(T::Level::Bank)];
                file<<','<<bank_id<<endl;
            }
        }
        if (print_cmd_trace){
            printf("%5s %10ld:", channel->spec->command_name[int(cmd)].c_str(), clk);
            for (int lev = 0; lev < int(T::Level::MAX); lev++)
                printf(" %5d", addr_vec[lev]);
            printf("\n");
        }
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rdi, %r14
movq %rsp, %r15
movl %esi, (%r15)
movq %r15, %rsi
callq 0x4c774
movl (%r15), %esi
movq 0x1090(%r14), %rcx
movq 0x1098(%r14), %rdi
movq (%rbx), %rdx
callq 0x491de
testb %al, %al
je 0x4bf7c
movq 0x1090(%r14), %r15
movq 0x1098(%r14), %r12
movl (%rsp), %ebp
movq (%rbx), %r13
movq %r15, 0x448(%r12)
movq %r12, %rdi
movl %ebp, %esi
movq %r13, %rdx
callq 0x4cc2a
movq %r12, %rdi
movl %ebp, %esi
movq %r13, %rdx
movq %r15, %rcx
callq 0x4ccd0
cmpl $0x2, (%rsp)
jne 0x4bda3
movq 0x10b0(%r14), %rdi
movq %rbx, %rsi
movl $0x1, %edx
callq 0x48e00
testl %eax, %eax
jne 0x4bda3
movsd 0x788(%r14), %xmm0
addsd 0x1012de(%rip), %xmm0   # 0x14d078
movsd %xmm0, 0x788(%r14)
movq 0x1090(%r14), %rcx
movq 0x10b0(%r14), %rdi
movl (%rsp), %esi
movq %rbx, %rdx
callq 0x4c9f6
cmpb $0x1, 0x11d8(%r14)
jne 0x4bf05
movq (%rbx), %rax
movslq 0x4(%rax), %r15
shlq $0x9, %r15
addq 0x11c0(%r14), %r15
movq 0x1090(%r14), %rsi
movq 0x1098(%r14), %rax
movq 0x390(%rax), %rax
movslq (%rsp), %rcx
shlq $0x5, %rcx
leaq (%rax,%rcx), %r12
addq $0x28, %r12
movq %r15, %rdi
callq 0xb2b0
leaq 0x6(%rsp), %rsi
movb $0x2c, (%rsi)
movl $0x1, %edx
movq %rax, %rdi
callq 0xb340
movq (%r12), %rsi
movq 0x8(%r12), %rdx
movq %rax, %rdi
callq 0xb340
leaq 0x102cdd(%rip), %rsi    # 0x14eb13
movq %r12, %rdi
callq 0xb100
testl %eax, %eax
je 0x4bede
leaq 0x114435(%rip), %rsi    # 0x160282
movq %r12, %rdi
callq 0xb100
testl %eax, %eax
je 0x4bede
movq (%rbx), %rax
movl 0x8(%rax), %ebp
movq 0x1098(%r14), %rax
movq 0x390(%rax), %rdi
leaq 0x10152c(%rip), %rsi    # 0x14d3a4
callq 0xb100
testl %eax, %eax
je 0x4be9f
movq 0x1098(%r14), %rax
movq 0x390(%rax), %rdi
leaq 0x101513(%rip), %rsi    # 0x14d3a9
callq 0xb100
testl %eax, %eax
jne 0x4bebc
movq (%rbx), %rax
movq 0x1098(%r14), %rcx
movq 0x390(%rcx), %rcx
movl 0x3624(%rcx), %ecx
imull 0x4(%rax), %ecx
addl %ecx, %ebp
leaq 0x7(%rsp), %rsi
movb $0x2c, (%rsi)
movl $0x1, %edx
movq %r15, %rdi
callq 0xb340
movq %rax, %rdi
movl %ebp, %esi
callq 0xb4f0
movq %rax, %r15
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0xb2c0
movsbl %al, %esi
movq %r15, %rdi
callq 0xb030
movq %rax, %rdi
callq 0xb220
cmpb $0x1, 0x11d9(%r14)
jne 0x4bf6d
movq 0x1090(%r14), %rdx
movq 0x1098(%r14), %rax
movq 0x390(%rax), %rax
movslq (%rsp), %rcx
shlq $0x5, %rcx
movq 0x28(%rax,%rcx), %rsi
leaq 0x102be0(%rip), %rdi    # 0x14eb18
xorl %eax, %eax
callq 0xb060
leaq 0x102bdd(%rip), %r14    # 0x14eb23
xorl %r15d, %r15d
movq (%rbx), %rax
movl (%rax,%r15,4), %esi
movq %r14, %rdi
xorl %eax, %eax
callq 0xb060
incq %r15
cmpq $0x6, %r15
jne 0x4bf49
movl $0xa, %edi
callq 0xb390
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x102af0(%rip), %rdi    # 0x14ea73
leaq 0x102b01(%rip), %rsi    # 0x14ea8b
leaq 0x103843(%rip), %rcx    # 0x14f7d4
movl $0x259, %edx            # imm = 0x259
callq 0xb200
nop