// File: /workspace/github_cpp_makefile_star2_O1/CMU-SAFARI[P]SMLA/src/Controller.h
// Function: ramulator::Controller<ramulator::WideIO>::issue_cmd(ramulator::WideIO::Command, std::vector<int, std::allocator<int>> const&)
void issue_cmd(typename T::Command cmd, const vector<int>& addr_vec)
    {
        assert(is_ready(cmd, addr_vec));
        channel->update(cmd, addr_vec.data(), clk);
        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
subq $0x18, %rsp
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r14
movq 0xff8(%rdi), %rcx
movq 0x1000(%rdi), %rdi
movq (%rdx), %rdx
callq 0x147a0
testb %al, %al
je 0x1855c
movq 0xff8(%r14), %r15
movq 0x1000(%r14), %r12
movq (%rbx), %r13
movq %r15, 0x448(%r12)
movq %r12, %rdi
movl %ebp, %esi
movq %r13, %rdx
callq 0x1933e
movq %r12, %rdi
movl %ebp, %esi
movq %r13, %rdx
movq %r15, %rcx
callq 0x193e4
movq 0xff8(%r14), %rcx
movq 0x1018(%r14), %rdi
movl %ebp, %esi
movq %rbx, %rdx
callq 0x1913e
cmpb $0x1, 0x1118(%r14)
movslq %ebp, %r13
jne 0x184ea
movq (%rbx), %rax
movslq 0x4(%rax), %r15
shlq $0x9, %r15
addq 0x1100(%r14), %r15
movq 0xff8(%r14), %rsi
movq 0x1000(%r14), %rax
movq 0x390(%rax), %rbp
movq %r13, 0x10(%rsp)
shlq $0x5, %r13
movq %rbp, %r12
addq %r13, %r12
movq %r15, %rdi
callq 0x5290
leaq 0xe(%rsp), %rsi
movb $0x2c, (%rsi)
movl $0x1, %edx
movq %rax, %rdi
callq 0x5320
movq (%rbp,%r13), %rsi
movq 0x8(%rbp,%r13), %rdx
movq %rax, %rdi
callq 0x5320
leaq 0x37366(%rip), %rsi     # 0x4f787
movq %r12, %rdi
callq 0x50f0
testl %eax, %eax
je 0x184be
leaq 0x39a4f(%rip), %rsi     # 0x51e87
movq %r12, %rdi
callq 0x50f0
testl %eax, %eax
je 0x184be
movq (%rbx), %rax
movl 0x8(%rax), %ebp
leaq 0x4e1a7(%rip), %rdi     # 0x665f8
leaq 0x37334(%rip), %rsi     # 0x4f78c
callq 0x50f0
testl %eax, %eax
movq 0x10(%rsp), %r13
je 0x1847d
leaq 0x4e18b(%rip), %rdi     # 0x665f8
leaq 0x3731d(%rip), %rsi     # 0x4f791
callq 0x50f0
testl %eax, %eax
jne 0x1849a
movq (%rbx), %rax
movq 0x1000(%r14), %rcx
movq 0x390(%rcx), %rcx
movl 0x2600(%rcx), %ecx
imull 0x4(%rax), %ecx
addl %ecx, %ebp
leaq 0xf(%rsp), %rsi
movb $0x2c, (%rsi)
movl $0x1, %edx
movq %r15, %rdi
callq 0x5320
movq %rax, %rdi
movl %ebp, %esi
callq 0x54b0
movq %rax, %r15
jmp 0x184c3
movq 0x10(%rsp), %r13
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x52a0
movsbl %al, %esi
movq %r15, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5200
cmpb $0x1, 0x1119(%r14)
jne 0x1854d
movq 0xff8(%r14), %rdx
movq 0x1000(%r14), %rax
movq 0x390(%rax), %rax
shlq $0x5, %r13
movq (%rax,%r13), %rsi
leaq 0x3727f(%rip), %rdi     # 0x4f797
xorl %eax, %eax
callq 0x5060
leaq 0x3727c(%rip), %r14     # 0x4f7a2
xorl %r15d, %r15d
movq (%rbx), %rax
movl (%rax,%r15,4), %esi
movq %r14, %rdi
xorl %eax, %eax
callq 0x5060
incq %r15
cmpq $0x5, %r15
jne 0x18529
movl $0xa, %edi
callq 0x5370
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x37180(%rip), %rdi     # 0x4f6e3
leaq 0x37191(%rip), %rsi     # 0x4f6fb
leaq 0x3719b(%rip), %rcx     # 0x4f70c
movl $0x1eb, %edx            # imm = 0x1EB
callq 0x51f0
nop