// File: 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
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x38(%rbp)
movl -0xc(%rbp), %esi
movq -0x18(%rbp), %rdx
callq 0x1fd50
testb $0x1, %al
jne 0x2ab7d
jmp 0x2ab7f
jmp 0x2ab9e
leaq 0x70d17(%rip), %rdi     # 0x9b89d
leaq 0x70d28(%rip), %rsi     # 0x9b8b5
movl $0x1eb, %edx            # imm = 0x1EB
leaq 0x70d2d(%rip), %rcx     # 0x9b8c6
callq 0x6270
movq -0x38(%rbp), %rax
movq 0x1000(%rax), %rax
movq %rax, -0x48(%rbp)
movl -0xc(%rbp), %eax
movl %eax, -0x3c(%rbp)
movq -0x18(%rbp), %rdi
callq 0x1fdd0
movq -0x48(%rbp), %rdi
movl -0x3c(%rbp), %esi
movq %rax, %rdx
movq -0x38(%rbp), %rax
movq 0xff8(%rax), %rcx
callq 0x2d5e0
movq -0x38(%rbp), %rax
movq 0x1018(%rax), %rdi
movl -0xc(%rbp), %esi
movq -0x18(%rbp), %rdx
movq 0xff8(%rax), %rcx
callq 0x2d630
movq -0x38(%rbp), %rax
testb $0x1, 0x1118(%rax)
je 0x2ad59
movq -0x38(%rbp), %rax
addq $0x1100, %rax           # imm = 0x1100
movq %rax, -0x50(%rbp)
movq -0x18(%rbp), %rdi
movl $0x1, %esi
callq 0x2dac0
movq -0x50(%rbp), %rdi
movslq (%rax), %rsi
callq 0x1a950
movq %rax, %rcx
movq -0x38(%rbp), %rax
movq %rcx, -0x20(%rbp)
movq 0x1000(%rax), %rcx
movq 0x390(%rcx), %rcx
movslq -0xc(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rcx
movq %rcx, -0x28(%rbp)
movq -0x20(%rbp), %rdi
movq 0xff8(%rax), %rsi
callq 0x65e0
movq %rax, %rdi
movl $0x2c, %esi
callq 0x63f0
movq %rax, %rdi
movq -0x28(%rbp), %rsi
callq 0x6320
movq -0x28(%rbp), %rdi
leaq 0x70cb8(%rip), %rsi     # 0x9b941
callq 0x8c30
testb $0x1, %al
jne 0x2aca8
movq -0x28(%rbp), %rdi
leaq 0x73ab4(%rip), %rsi     # 0x9e751
callq 0x8c30
testb $0x1, %al
jne 0x2aca8
jmp 0x2acbd
movq -0x20(%rbp), %rdi
movq 0xb82fd(%rip), %rsi     # 0xe2fb0
callq 0x6390
jmp 0x2ad57
movq -0x18(%rbp), %rdi
movl $0x2, %esi
callq 0x2dac0
movl (%rax), %eax
movl %eax, -0x2c(%rbp)
leaq 0xb89c9(%rip), %rdi     # 0xe36a0
leaq 0x70c68(%rip), %rsi     # 0x9b946
callq 0x8c30
testb $0x1, %al
jne 0x2ad00
leaq 0xb89b2(%rip), %rdi     # 0xe36a0
leaq 0x70c56(%rip), %rsi     # 0x9b94b
callq 0x8c30
testb $0x1, %al
jne 0x2ad00
jmp 0x2ad2f
movq -0x18(%rbp), %rdi
movl $0x1, %esi
callq 0x2dac0
movq -0x38(%rbp), %rcx
movl (%rax), %eax
movq 0x1000(%rcx), %rcx
movq 0x390(%rcx), %rcx
imull 0x2600(%rcx), %eax
addl -0x2c(%rbp), %eax
movl %eax, -0x2c(%rbp)
movq -0x20(%rbp), %rdi
movl $0x2c, %esi
callq 0x63f0
movq %rax, %rdi
movl -0x2c(%rbp), %esi
callq 0x65a0
movq %rax, %rdi
movq 0xb825e(%rip), %rsi     # 0xe2fb0
callq 0x6390
jmp 0x2ad59
movq -0x38(%rbp), %rax
testb $0x1, 0x1119(%rax)
je 0x2adeb
movq -0x38(%rbp), %rax
movq 0x1000(%rax), %rax
movq 0x390(%rax), %rdi
movslq -0xc(%rbp), %rax
shlq $0x5, %rax
addq %rax, %rdi
callq 0x61a0
movq %rax, %rsi
movq -0x38(%rbp), %rax
movq 0xff8(%rax), %rdx
leaq 0x70bb0(%rip), %rdi     # 0x9b951
movb $0x0, %al
callq 0x6070
movl $0x0, -0x30(%rbp)
cmpl $0x5, -0x30(%rbp)
jge 0x2addd
movq -0x18(%rbp), %rdi
movslq -0x30(%rbp), %rsi
callq 0x2dac0
movl (%rax), %esi
leaq 0x70b91(%rip), %rdi     # 0x9b95c
movb $0x0, %al
callq 0x6070
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x2adaf
leaq 0x6f62f(%rip), %rdi     # 0x9a413
movb $0x0, %al
callq 0x6070
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)