// File: /workspace/github_cpp_makefile_star2_O2/CMU-SAFARI[P]ramulator/src/Scheduler.h
// Function: ramulator::RowTable<ramulator::DDR3>::update(ramulator::DDR3::Command, std::vector<int, std::allocator<int>> const&, long)
void update(typename T::Command cmd, const vector<int>& addr_vec, long clk)
    {
        auto begin = addr_vec.begin();
        auto end = begin + int(T::Level::Row);
        vector<int> rowgroup(begin, end); // bank or subarray
        int row = *end;

        T* spec = ctrl->channel->spec;

        if (spec->is_opening(cmd))
            table.insert({rowgroup, {row, 0, clk}});

        if (spec->is_accessing(cmd)) {
            // we are accessing a row -- update its entry
            auto match = table.find(rowgroup);
            assert(match != table.end());
            assert(match->second.row == row);
            match->second.hits++;
            match->second.timestamp = clk;
        } /* accessing */

        if (spec->is_closing(cmd)) {
          // we are closing one or more rows -- remove their entries
          int n_rm = 0;
          int scope;
          if (spec->is_accessing(cmd))
            scope = int(T::Level::Row) - 1; //special condition for RDA and WRA
          else
            scope = int(spec->scope[int(cmd)]);

          for (auto it = table.begin(); it != table.end();) {
            if (equal(begin, begin + scope + 1, it->first.begin())) {
              n_rm++;
              it = table.erase(it);
            }
            else
              it++;
          }

          assert(n_rm > 0);
        } /* closing */
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rcx, %r15
movl %esi, %r12d
movq %rdi, %rbx
movq (%rdx), %r14
leaq 0xc(%r14), %rdx
leaq 0x8(%rsp), %rdi
leaq 0x20(%rsp), %rcx
movq %r14, %rsi
callq 0x1b74e
movl 0xc(%r14), %ebp
testl %r12d, %r12d
je 0x2081b
movq (%rbx), %rax
movq 0x1098(%rax), %rax
movq 0x390(%rax), %rcx
leal -0x3(%r12), %r13d
cmpl $0x3, %r13d
ja 0x20852
movq %rcx, (%rsp)
leaq 0x8(%rbx), %rdi
leaq 0x8(%rsp), %rsi
callq 0x1b866
leaq 0x10(%rbx), %rcx
cmpq %rcx, %rax
je 0x208d3
cmpl %ebp, 0x38(%rax)
movq (%rsp), %rcx
jne 0x208f2
incl 0x3c(%rax)
movq %r15, 0x40(%rax)
leal -0x1(%r12), %eax
testl $0xfffffffa, %eax       # imm = 0xFFFFFFFA
jne 0x208ba
cmpl $0x4, %r13d
jae 0x2085e
pushq $0x2
popq %rax
jmp 0x20869
leaq 0x20(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x1bbca
leaq 0x20(%rsp), %rsi
movl %ebp, 0x18(%rsi)
andl $0x0, 0x1c(%rsi)
movq %r15, 0x20(%rsi)
addq $0x8, %rbx
movq %rbx, %rdi
callq 0x20ebe
leaq 0x20(%rsp), %rdi
callq 0x1b7dc
jmp 0x208ba
leal -0x1(%r12), %eax
testl $0xfffffffa, %eax       # imm = 0xFFFFFFFA
jne 0x208ba
movslq %r12d, %rax
movslq 0x180(%rcx,%rax,4), %rax
leaq 0x8(%rbx), %r15
movq 0x20(%rbx), %r13
addq $0x10, %rbx
leaq (%r14,%rax,4), %r12
addq $0x4, %r12
xorl %ebp, %ebp
cmpq %rbx, %r13
je 0x208b6
movq 0x20(%r13), %rdx
movq %r14, %rdi
movq %r12, %rsi
callq 0x2050e
testb %al, %al
jne 0x208a4
movq %r13, %rdi
callq 0xb230
movq %rax, %r13
jmp 0x2087f
movq %r15, %rdi
movq %r13, %rsi
callq 0x210c8
movq %rax, %r13
incl %ebp
jmp 0x2087f
testl %ebp, %ebp
je 0x20911
leaq 0x8(%rsp), %rdi
callq 0x1b7dc
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xb2384(%rip), %rdi     # 0xd2c5e
leaq 0xb2392(%rip), %rsi     # 0xd2c73
leaq 0xb239b(%rip), %rcx     # 0xd2c83
movl $0x12d, %edx            # imm = 0x12D
callq 0xb210
leaq 0xb2402(%rip), %rdi     # 0xd2cfb
leaq 0xb2373(%rip), %rsi     # 0xd2c73
leaq 0xb237c(%rip), %rcx     # 0xd2c83
movl $0x12e, %edx            # imm = 0x12E
callq 0xb210
leaq 0xb23fc(%rip), %rdi     # 0xd2d14
leaq 0xb2354(%rip), %rsi     # 0xd2c73
leaq 0xb235d(%rip), %rcx     # 0xd2c83
movl $0x145, %edx            # imm = 0x145
callq 0xb210
jmp 0x20945
jmp 0x20945
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x1b7dc
jmp 0x20948
jmp 0x20945
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x1b7dc
movq %rbx, %rdi
callq 0xb4d0