// File: /workspace/github_cpp_makefile_star2_O3/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 0x4c3f6
movl (%r15), %esi
movq 0x1090(%r14), %rcx
movq 0x1098(%r14), %rdi
movq (%rbx), %rdx
callq 0x48fa2
testb %al, %al
je 0x4bccc
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 0x4c896
movq %r12, %rdi
movl %ebp, %esi
movq %r13, %rdx
movq %r15, %rcx
callq 0x4c92c
cmpl $0x2, (%rsp)
jne 0x4baf3
movq 0x10b0(%r14), %rdi
movq %rbx, %rsi
movl $0x1, %edx
callq 0x48c50
testl %eax, %eax
jne 0x4baf3
movsd 0x788(%r14), %xmm0
addsd 0xfe5ce(%rip), %xmm0    # 0x14a0b8
movsd %xmm0, 0x788(%r14)
movq 0x1090(%r14), %rcx
movq 0x10b0(%r14), %rdi
movl (%rsp), %esi
movq %rbx, %rdx
callq 0x4c66c
cmpb $0x1, 0x11d8(%r14)
jne 0x4bc55
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 0xfffcd(%rip), %rsi     # 0x14bb53
movq %r12, %rdi
callq 0xb100
testl %eax, %eax
je 0x4bc2e
leaq 0x11178a(%rip), %rsi    # 0x15d327
movq %r12, %rdi
callq 0xb100
testl %eax, %eax
je 0x4bc2e
movq (%rbx), %rax
movl 0x8(%rax), %ebp
movq 0x1098(%r14), %rax
movq 0x390(%rax), %rdi
leaq 0xfe81c(%rip), %rsi     # 0x14a3e4
callq 0xb100
testl %eax, %eax
je 0x4bbef
movq 0x1098(%r14), %rax
movq 0x390(%rax), %rdi
leaq 0xfe803(%rip), %rsi     # 0x14a3e9
callq 0xb100
testl %eax, %eax
jne 0x4bc0c
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 0x4bcbd
movq 0x1090(%r14), %rdx
movq 0x1098(%r14), %rax
movq 0x390(%rax), %rax
movslq (%rsp), %rcx
shlq $0x5, %rcx
movq 0x28(%rax,%rcx), %rsi
leaq 0xffed0(%rip), %rdi     # 0x14bb58
xorl %eax, %eax
callq 0xb060
leaq 0xffecd(%rip), %r14     # 0x14bb63
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 0x4bc99
movl $0xa, %edi
callq 0xb390
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xffde0(%rip), %rdi     # 0x14bab3
leaq 0xffdf1(%rip), %rsi     # 0x14bacb
leaq 0x100b33(%rip), %rcx    # 0x14c814
movl $0x259, %edx            # imm = 0x259
callq 0xb200
nop