// File: /workspace/github_cpp_makefile_star2_O3/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 0x14796
testb %al, %al
je 0x1884a
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 0x1954c
movq %r12, %rdi
movl %ebp, %esi
movq %r13, %rdx
movq %r15, %rcx
callq 0x195e2
movq 0xff8(%r14), %rcx
movq 0x1018(%r14), %rdi
movl %ebp, %esi
movq %rbx, %rdx
callq 0x19338
cmpb $0x1, 0x1118(%r14)
movslq %ebp, %r13
jne 0x187d8
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 0x370a8(%rip), %rsi     # 0x4f7b7
movq %r12, %rdi
callq 0x50f0
testl %eax, %eax
je 0x187ac
leaq 0x397da(%rip), %rsi     # 0x51f00
movq %r12, %rdi
callq 0x50f0
testl %eax, %eax
je 0x187ac
movq (%rbx), %rax
movl 0x8(%rax), %ebp
leaq 0x4deb9(%rip), %rdi     # 0x665f8
leaq 0x37076(%rip), %rsi     # 0x4f7bc
callq 0x50f0
testl %eax, %eax
movq 0x10(%rsp), %r13
je 0x1876b
leaq 0x4de9d(%rip), %rdi     # 0x665f8
leaq 0x3705f(%rip), %rsi     # 0x4f7c1
callq 0x50f0
testl %eax, %eax
jne 0x18788
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 0x187b1
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 0x1883b
movq 0xff8(%r14), %rdx
movq 0x1000(%r14), %rax
movq 0x390(%rax), %rax
shlq $0x5, %r13
movq (%rax,%r13), %rsi
leaq 0x36fc1(%rip), %rdi     # 0x4f7c7
xorl %eax, %eax
callq 0x5060
leaq 0x36fbe(%rip), %r14     # 0x4f7d2
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 0x18817
movl $0xa, %edi
callq 0x5370
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x36ec2(%rip), %rdi     # 0x4f713
leaq 0x36ed3(%rip), %rsi     # 0x4f72b
leaq 0x36edd(%rip), %rcx     # 0x4f73c
movl $0x1eb, %edx            # imm = 0x1EB
callq 0x51f0
nop