// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %rax
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r14
callq 0xf108
testb %al, %al
je 0x11f22
movq 0xff8(%r14), %rcx
movq 0x1000(%r14), %rdi
movq (%rbx), %rdx
movl %ebp, %esi
callq 0x12a12
movq 0xff8(%r14), %rcx
movq 0x1018(%r14), %rdi
movl %ebp, %esi
movq %rbx, %rdx
callq 0x12a4a
cmpb $0x1, 0x1118(%r14)
movslq %ebp, %r13
jne 0x11ea2
movq (%rbx), %rax
movslq 0x4(%rax), %r15
shlq $0x9, %r15
addq 0x1100(%r14), %r15
movq 0xff8(%r14), %rsi
movq 0x1000(%r14), %rax
movq %r13, %r12
shlq $0x5, %r12
addq 0x390(%rax), %r12
movq %r15, %rdi
callq 0x5290
pushq $0x2c
popq %rsi
movq %rax, %rdi
callq 0x5300
movq %rax, %rdi
movq %r12, %rsi
callq 0x5270
leaq 0x23965(%rip), %rsi     # 0x35777
movq %r12, %rdi
callq 0x66a8
testb %al, %al
jne 0x11e9a
leaq 0x260bb(%rip), %rsi     # 0x37ee0
movq %r12, %rdi
callq 0x66a8
testb %al, %al
jne 0x11e9a
movq (%rbx), %rax
movl 0x8(%rax), %ebp
leaq 0x3f7b2(%rip), %rdi     # 0x515f0
leaq 0x23937(%rip), %rsi     # 0x3577c
callq 0x66a8
testb %al, %al
jne 0x11e65
leaq 0x3f79b(%rip), %rdi     # 0x515f0
leaq 0x23925(%rip), %rsi     # 0x35781
callq 0x66a8
testb %al, %al
je 0x11e82
movq (%rbx), %rax
movq 0x1000(%r14), %rcx
movq 0x390(%rcx), %rcx
movl 0x2600(%rcx), %ecx
imull 0x4(%rax), %ecx
addl %ecx, %ebp
pushq $0x2c
popq %rsi
movq %r15, %rdi
callq 0x5300
movq %rax, %rdi
movl %ebp, %esi
callq 0x5490
movq %rax, %r15
movq %r15, %rdi
callq 0x5180
cmpb $0x1, 0x1119(%r14)
jne 0x11efd
movq 0xff8(%r14), %rdx
movq 0x1000(%r14), %rax
movq 0x390(%rax), %rax
shlq $0x5, %r13
movq (%rax,%r13), %rsi
leaq 0x238b7(%rip), %rdi     # 0x35787
xorl %eax, %eax
callq 0x5050
leaq 0x238b4(%rip), %r14     # 0x35792
xorl %r15d, %r15d
cmpq $0x5, %r15
je 0x11f0c
movq (%rbx), %rax
movl (%rax,%r15,4), %esi
movq %r14, %rdi
xorl %eax, %eax
callq 0x5050
incq %r15
jmp 0x11ee1
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0xa
popq %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x5360
leaq 0x237aa(%rip), %rdi     # 0x356d3
leaq 0x237bb(%rip), %rsi     # 0x356eb
leaq 0x237c5(%rip), %rcx     # 0x356fc
movl $0x1eb, %edx            # imm = 0x1EB
callq 0x5200
nop