LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]ramulator/src/Config.h
// Function: ramulator::Config::operator[](std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&) const
std::string operator [] (const std::string& name) const {
      if (options.find(name) != options.end()) {
        return (options.find(name))->second;
      } else {
        return "";
      }
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq %rsi, %rdi
movq %rdx, %rsi
callq 0x1711a
leaq 0x8(%r15), %rcx
cmpq %rcx, %rax
je 0x13b8f
movq %r15, %rdi
movq %r14, %rsi
callq 0x1711a
leaq 0x10(%rbx), %rcx
movq %rcx, (%rbx)
movq 0x40(%rax), %rsi
movq 0x48(%rax), %rdx
addq %rsi, %rdx
movq %rbx, %rdi
callq 0x171ae
jmp 0x13ba8
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x13ca3f(%rip), %rdx    # 0x1505dc
movq %rbx, %rdi
movq %rdx, %rsi
callq 0x175a0
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]ramulator/src/Config.h
// Function: ramulator::Config::add(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void add (const std::string& name, const std::string& value) {
      if (!contains(name)) {
        options.insert(make_pair(name, value));
      } else {
        printf("ramulator::Config::add options[%s] already set.\n", name.c_str());
      }
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
callq 0x1711a
leaq 0x8(%rbx), %rcx
cmpq %rcx, %rax
je 0x13bf0
movq (%r15), %rsi
leaq 0x136899(%rip), %rdi    # 0x14a477
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0xb060
leaq 0x8(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x174e0
movq %rbx, %rdi
movq %r12, %rsi
callq 0x1727a
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x13c29
movq 0x38(%rsp), %rsi
incq %rsi
callq 0xb2f0
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x13c44
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xb2f0
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x17244
movq %rbx, %rdi
callq 0xb510
nop
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]ramulator/src/Refresh.h
// Function: ramulator::Refresh<ramulator::DDR3>::Refresh(ramulator::Controller<ramulator::DDR3>*)
Refresh(Controller<T>* ctrl) : ctrl(ctrl) {
    clk = refreshed = 0;
    max_rank_count = ctrl->channel->children.size();
    max_bank_count = ctrl->channel->spec->org_entry.count[(int)T::Level::Bank];

    // Init refresh counters
    for (int r = 0; r < max_rank_count; r++) {
      bank_ref_counters.push_back(0);
      bank_refresh_backlog.push_back(new vector<int>(max_bank_count, 0));
    }

    level_chan = (int)T::Level::Channel;
    level_rank = (int)T::Level::Rank;
    level_bank = (int)T::Level::Bank;
    level_sa   = -1; // Most DRAM doesn't have subarray level
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
leaq 0x179aa8(%rip), %rax    # 0x19d4c0
movq %rax, (%rdi)
movq %rsi, 0x8(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rdi)
movq $0x0, 0x30(%rdi)
movups %xmm0, 0x50(%rdi)
movups %xmm0, 0x60(%rdi)
movups %xmm0, 0x70(%rdi)
movl $0x0, 0x80(%rdi)
movabsq $-0x7fffffff8, %rax     # imm = 0xFFFFFFF800000008
movq %rax, 0x84(%rdi)
movl $0xfffffffa, 0x8c(%rdi) # imm = 0xFFFFFFFA
movb $0x0, 0x90(%rdi)
movups %xmm0, 0x10(%rdi)
movq 0x1098(%rsi), %rax
movq 0x3b8(%rax), %rcx
subq 0x3b0(%rax), %rcx
shrq $0x3, %rcx
movl %ecx, 0x38(%rdi)
movq 0x390(%rax), %rax
movl 0x2734(%rax), %eax
movl %eax, 0x3c(%rdi)
testl %ecx, %ecx
jle 0x23b2f
leaq 0x20(%rbx), %rax
movq %rax, 0x10(%rsp)
leaq 0x50(%rbx), %r15
leaq 0x68(%rbx), %rax
movq %rax, 0x20(%rsp)
xorl %ebp, %ebp
leaq 0x18(%rsp), %r13
leaq 0xb(%rsp), %r12
movl $0x0, 0x18(%rsp)
movq 0x28(%rbx), %rsi
cmpq 0x30(%rbx), %rsi
je 0x23ae2
movl $0x0, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x28(%rbx)
jmp 0x23aef
movq 0x10(%rsp), %rdi
movq %r13, %rdx
callq 0x24ffe
movl $0x18, %edi
callq 0xb2e0
movq %rax, %r14
movslq 0x3c(%rbx), %rsi
movl $0x0, 0xc(%rsp)
movq %rax, %rdi
leaq 0xc(%rsp), %rdx
movq %r12, %rcx
callq 0x24d76
movq %r14, 0x18(%rsp)
movq %r15, %rdi
movq %r13, %rsi
callq 0x2511e
incl %ebp
cmpl 0x38(%rbx), %ebp
jl 0x23ac0
movaps 0x12652a(%rip), %xmm0   # 0x14a060
movups %xmm0, 0x40(%rbx)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x23b5f
jmp 0x23b5f
movq %rax, %r12
movl $0x18, %esi
movq %r14, %rdi
callq 0xb2f0
jmp 0x23b62
movq %rax, %r12
movq 0x20(%rsp), %rdi
callq 0x24ef2
movq (%r15), %rdi
testq %rdi, %rdi
je 0x23b80
movq 0x60(%rbx), %rsi
subq %rdi, %rsi
callq 0xb2f0
movq 0x10(%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x23b99
movq 0x30(%rbx), %rsi
subq %rdi, %rsi
callq 0xb2f0
movq %r12, %rdi
callq 0xb510
nop
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]ramulator/src/Config.h
// Function: ramulator::Config::record_cmd_trace() const
bool record_cmd_trace() const {
      // the default value is false
      if (options.find("record_cmd_trace") != options.end()) {
        if ((options.find("record_cmd_trace"))->second == "on") {
          return true;
        }
        return false;
      }
      return false;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x127541(%rip), %rsi    # 0x14b18f
leaq 0x12754a(%rip), %rdx    # 0x14b19f
leaq 0x8(%rsp), %rdi
callq 0x175a0
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x1711a
movq %rax, %r14
leaq 0x8(%rbx), %r12
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x23c8a
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xb2f0
cmpq %r12, %r14
je 0x23ce8
leaq 0x8(%rsp), %rdi
movq %r15, (%rdi)
leaq 0x1274f1(%rip), %rsi    # 0x14b18f
leaq 0x1274fa(%rip), %rdx    # 0x14b19f
callq 0x175a0
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x1711a
addq $0x40, %rax
leaq 0x127644(%rip), %rsi    # 0x14b306
movq %rax, %rdi
callq 0xb100
testl %eax, %eax
sete %bl
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x23cea
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xb2f0
jmp 0x23cea
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x23cfc
jmp 0x23d18
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x23d1b
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xb2f0
jmp 0x23d1b
movq %rax, %rbx
movq %rbx, %rdi
callq 0xb510
nop
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]ramulator/src/Config.h
// Function: ramulator::Config::print_cmd_trace() const
bool print_cmd_trace() const {
      // the default value is false
      if (options.find("print_cmd_trace") != options.end()) {
        if ((options.find("print_cmd_trace"))->second == "on") {
          return true;
        }
        return false;
      }
      return false;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x12745e(%rip), %rsi    # 0x14b1a0
leaq 0x127466(%rip), %rdx    # 0x14b1af
leaq 0x8(%rsp), %rdi
callq 0x175a0
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x1711a
movq %rax, %r14
leaq 0x8(%rbx), %r12
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x23d7e
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xb2f0
cmpq %r12, %r14
je 0x23ddc
leaq 0x8(%rsp), %rdi
movq %r15, (%rdi)
leaq 0x12740e(%rip), %rsi    # 0x14b1a0
leaq 0x127416(%rip), %rdx    # 0x14b1af
callq 0x175a0
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x1711a
addq $0x40, %rax
leaq 0x127550(%rip), %rsi    # 0x14b306
movq %rax, %rdi
callq 0xb100
testl %eax, %eax
sete %bl
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x23dde
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xb2f0
jmp 0x23dde
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x23df0
jmp 0x23e0c
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x23e0f
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xb2f0
jmp 0x23e0f
movq %rax, %rbx
movq %rbx, %rdi
callq 0xb510
nop
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]ramulator/src/StatType.h
// Function: Stats::VectorBase<Stats::Vector, Stats::Scalar>::print(std::basic_ofstream<char, std::char_traits<char>>&)
void print(std::ofstream& file) {
    Stat<Derived>::printname(file);
    file.precision(Stat<Derived>::_precision);
    file.width(20);
    file << std::fixed << total();
    Stat<Derived>::printdesc(file);
    for (off_type i = 0 ; i < size() ; ++i) {
      data[i].print(file);
    }
  }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq (%rsi), %rax
movq -0x18(%rax), %rax
movq $0x28, 0x10(%rsi,%rax)
movq 0x8(%rdi), %rsi
movq 0x10(%rdi), %rdx
movq %rbx, %rdi
callq 0xb340
movq (%rbx), %rax
movq -0x18(%rax), %rcx
movslq 0x48(%r14), %rdx
movq %rdx, 0x8(%rbx,%rcx)
movq -0x18(%rax), %rcx
movq $0x14, 0x10(%rbx,%rcx)
movq -0x18(%rax), %rax
movl $0xfffffefb, %ecx       # imm = 0xFFFFFEFB
andl 0x18(%rbx,%rax), %ecx
orl $0x4, %ecx
movl %ecx, 0x18(%rbx,%rax)
movq (%r14), %rax
movq %r14, %rdi
callq *0x30(%rax)
movq %rbx, %rdi
callq 0xb460
movq %r14, %rdi
movq %rbx, %rsi
callq 0x24238
movq (%r14), %rax
movq %r14, %rdi
callq *0x8(%rax)
testl %eax, %eax
je 0x24075
xorl %r15d, %r15d
xorl %r12d, %r12d
movq 0x78(%r14), %rdi
movq (%rdi,%r15), %rax
addq %r15, %rdi
movq %rbx, %rsi
callq *(%rax)
incq %r12
movq (%r14), %rax
movq %r14, %rdi
callq *0x8(%rax)
movl %eax, %eax
addq $0x78, %r15
cmpq %rax, %r12
jb 0x2404e
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]ramulator/src/StatType.h
// Function: Stats::VectorBase<Stats::Vector, Stats::Scalar>::vresult() const
VResult vresult() const {
    VResult vres;
    for (off_type i = 0 ; i < size() ; ++i) {
      vres[i] = data[i].result();
    }
    return vres;
  }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
movq (%rsi), %rax
movq %rsi, %rdi
callq *0x8(%rax)
testl %eax, %eax
je 0x24182
xorl %r15d, %r15d
xorl %r12d, %r12d
movq 0x78(%r14), %rdi
movq (%rdi,%r15), %rax
addq %r15, %rdi
callq *0x60(%rax)
incq %r12
movq (%r14), %rax
movq %r14, %rdi
callq *0x8(%rax)
movl %eax, %eax
addq $0x78, %r15
cmpq %rax, %r12
jb 0x2415d
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]ramulator/src/DRAM.h
// Function: ramulator::DRAM<ramulator::DDR3>::check(ramulator::DDR3::Command, int const*, long)
bool DRAM<T>::check(typename T::Command cmd, const int* addr, long clk)
{
    if (next[int(cmd)] != -1 && clk < next[int(cmd)])
        return false; // stop recursion: the check failed at this level

    int child_id = addr[int(level)+1];
    if (child_id < 0 || level == spec->scope[int(cmd)] || !children.size())
        return true; // stop recursion: the check passed at all levels

    // recursively check my child
    return children[child_id]->check(cmd, addr, clk);
}

// Assembly:
movslq %esi, %rsi
movq 0x450(%rdi,%rsi,8), %rax
cmpq $-0x1, %rax
setne %r8b
cmpq %rcx, %rax
setg %al
testb %al, %r8b
je 0x244c7
xorl %eax, %eax
retq
movslq 0x398(%rdi), %r9
movslq 0x4(%rdx,%r9,4), %r8
movb $0x1, %al
testq %r8, %r8
js 0x244c6
movq 0x390(%rdi), %r10
cmpl 0x180(%r10,%rsi,4), %r9d
je 0x244c6
movq 0x3b0(%rdi), %r9
cmpq %r9, 0x3b8(%rdi)
je 0x244c6
movq (%r9,%r8,8), %rdi
movq 0x450(%rdi,%rsi,8), %rax
cmpq $-0x1, %rax
sete %r8b
cmpq %rcx, %rax
setle %al
orb %r8b, %al
jne 0x244c7
jmp 0x244c4
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]ramulator/src/DRAM.h
// Function: ramulator::DRAM<ramulator::DDR3>::decode(ramulator::DDR3::Command, int const*)
typename T::Command DRAM<T>::decode(typename T::Command cmd, const int* addr)
{
    int child_id = addr[int(level)+1];
    if (prereq[int(cmd)]) {
        typename T::Command prereq_cmd = prereq[int(cmd)](this, cmd, child_id);
        if (prereq_cmd != T::Command::MAX)
            return prereq_cmd; // stop recursion: there is a prerequisite at this level
    }

    if (child_id < 0 || !children.size())
        return cmd; // stop recursion: there were no prequisites at any level

    // recursively decode at my child
    return children[child_id]->decode(cmd, addr);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %r14
movl %esi, %ebx
movq %rdi, %r15
movslq %esi, %r13
shlq $0x5, %r13
movslq 0x398(%r15), %rax
movl 0x4(%r14,%rax,4), %r12d
movq 0x870(%r15), %rdi
cmpq $0x0, 0x10(%rdi,%r13)
je 0x24564
addq %r13, %rdi
movq %r15, %rsi
movl %ebx, %edx
movl %r12d, %ecx
callq 0x2458e
cmpl $0xc, %eax
jne 0x2457f
testl %r12d, %r12d
js 0x24581
movq 0x3b0(%r15), %rax
cmpq %rax, 0x3b8(%r15)
je 0x24581
movq (%rax,%r12,8), %r15
jmp 0x24534
movl %eax, %ebx
movl %ebx, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]ramulator/src/Scheduler.h
// Function: ramulator::RowTable<ramulator::DDR3>::get_hits(std::vector<int, std::allocator<int>> const&, bool)
int get_hits(const vector<int>& addr_vec, const bool to_opened_row = false)
    {
        auto begin = addr_vec.begin();
        auto end = begin + int(T::Level::Row);

        vector<int> rowgroup(begin, end);
        int row = *end;

        auto itr = table.find(rowgroup);
        if (itr == table.end())
            return 0;

        if(!to_opened_row && (itr->second.row != row))
            return 0;

        return itr->second.hits;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movl %edx, %ebp
movq %rdi, %r14
movq (%rsi), %rbx
leaq 0xc(%rbx), %rdx
leaq 0x8(%rsp), %r15
leaq 0x7(%rsp), %rcx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x24766
movl 0xc(%rbx), %r12d
leaq 0x8(%r14), %rdi
movq %r15, %rsi
callq 0x24842
addq $0x10, %r14
xorl %ebx, %ebx
cmpq %r14, %rax
je 0x2471e
testb %bpl, %bpl
jne 0x2471b
cmpl %r12d, 0x38(%rax)
jne 0x2471e
movl 0x3c(%rax), %ebx
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x24735
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
callq 0xb2f0
movl %ebx, %eax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x2475e
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
callq 0xb2f0
movq %rbx, %rdi
callq 0xb510
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]ramulator/src/DRAM.h
// Function: ramulator::DRAM<ramulator::DDR3>::check_row_hit(ramulator::DDR3::Command, int const*)
bool DRAM<T>::check_row_hit(typename T::Command cmd, const int* addr)
{
    int child_id = addr[int(level)+1];
    if (rowhit[int(cmd)]) {
        return rowhit[int(cmd)](this, cmd, child_id);  // stop recursion: there is a row hit at this level
    }

    if (child_id < 0 || !children.size())
        return false; // stop recursion: there were no row hits at any level

    // recursively check for row hits at my child
    return children[child_id]->check_row_hit(cmd, addr);
}

// Assembly:
movl %esi, %eax
movq %rdi, %rsi
movslq %eax, %r8
movslq 0x398(%rdi), %rcx
movl 0x4(%rdx,%rcx,4), %ecx
movq 0x878(%rdi), %rdi
shlq $0x5, %r8
cmpq $0x0, 0x10(%rdi,%r8)
jne 0x24a4a
testl %ecx, %ecx
js 0x24a54
movq 0x3b0(%rsi), %rdi
cmpq %rdi, 0x3b8(%rsi)
je 0x24a54
movl %ecx, %ecx
movq (%rdi,%rcx,8), %rsi
movslq 0x398(%rsi), %rcx
movl 0x4(%rdx,%rcx,4), %ecx
movq 0x878(%rsi), %rdi
jmp 0x24a14
addq %r8, %rdi
movl %eax, %edx
jmp 0x24a58
xorl %eax, %eax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]ramulator/src/StatType.h
// Function: Stats::VectorBase<Stats::Vector, Stats::Scalar>::init(unsigned int)
void init(size_type __size) {
    _size = __size;
    data.resize(size());
    for (off_type i = 0 ; i < size() ; ++i) {
      data[i].flags(0)
             .name("[" + std::string(1, char(i + '0')) + "]");
    }
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdi, %rbx
movl %esi, 0x70(%rdi)
leaq 0x78(%rdi), %r14
movq (%rdi), %rax
callq *0x8(%rax)
movl %eax, %esi
movq %r14, 0x60(%rsp)
movq %r14, %rdi
callq 0x256de
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x8(%rax)
testl %eax, %eax
je 0x2566c
movl $0x4c, %r13d
leaq 0x30(%rsp), %r12
xorl %r14d, %r14d
leaq 0x40(%rsp), %r15
movq 0x60(%rsp), %rax
movq (%rax), %rbp
movw $0x0, (%rbp,%r13)
leal 0x30(%r14), %eax
leaq 0x50(%rsp), %rcx
movq %rcx, 0x40(%rsp)
movsbl %al, %edx
movl $0x1, %esi
movq %r15, %rdi
callq 0xb350
movl $0x1, %r8d
movq %r15, %rdi
xorl %esi, %esi
xorl %edx, %edx
leaq 0x1263ec(%rip), %rcx    # 0x14b93f
callq 0xb330
leaq 0x10(%rsp), %rsi
movq %rsi, (%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x2557e
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
jmp 0x25584
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x8(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq %rsp, %rdi
leaq 0x1263c7(%rip), %rsi    # 0x14b96d
callq 0xb550
movq %r12, 0x20(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x255ce
movq %rdx, 0x20(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x30(%rsp)
jmp 0x255d6
movups (%rcx), %xmm0
movups %xmm0, (%r12)
movq 0x8(%rax), %rdx
movq %rdx, 0x28(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq -0x44(,%r13), %rdi
addq %rbp, %rdi
leaq 0x20(%rsp), %rsi
callq 0xb1c0
movq 0x20(%rsp), %rdi
cmpq %r12, %rdi
je 0x2561a
movq 0x30(%rsp), %rsi
incq %rsi
callq 0xb2f0
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x25635
movq 0x10(%rsp), %rsi
incq %rsi
callq 0xb2f0
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x25651
movq 0x50(%rsp), %rsi
incq %rsi
callq 0xb2f0
incq %r14
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x8(%rax)
movl %eax, %eax
addq $0x78, %r13
cmpq %rax, %r14
jb 0x25511
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x256ba
movq %rax, %rbx
jmp 0x2569f
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %r12, %rdi
je 0x2569f
movq 0x30(%rsp), %rsi
incq %rsi
callq 0xb2f0
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x256ba
movq 0x10(%rsp), %rsi
incq %rsi
callq 0xb2f0
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x256d6
movq 0x50(%rsp), %rsi
incq %rsi
callq 0xb2f0
movq %rbx, %rdi
callq 0xb510
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]ramulator/src/Memory.h
// Function: ramulator::Memory<ramulator::DDR3, ramulator::Controller>::tick()
void tick()
    {
        ++num_dram_cycles;
        int cur_que_req_num = 0;
        int cur_que_readreq_num = 0;
        int cur_que_writereq_num = 0;
        for (auto ctrl : ctrls) {
          cur_que_req_num += ctrl->readq.size() + ctrl->writeq.size() + ctrl->pending.size();
          cur_que_readreq_num += ctrl->readq.size() + ctrl->pending.size();
          cur_que_writereq_num += ctrl->writeq.size();
        }
        in_queue_req_num_sum += cur_que_req_num;
        in_queue_read_req_num_sum += cur_que_readreq_num;
        in_queue_write_req_num_sum += cur_que_writereq_num;

        bool is_active = false;
        for (auto ctrl : ctrls) {
          is_active = is_active || ctrl->is_active();
          ctrl->tick();
        }
        if (is_active) {
          ramulator_active_cycles++;
        }
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movsd 0x110(%rdi), %xmm0
addsd 0x1237cf(%rip), %xmm0   # 0x14a0b8
movsd %xmm0, 0x110(%rdi)
movq 0xc08(%rdi), %r14
movq 0xc10(%rdi), %r15
cmpq %r15, %r14
je 0x269a1
xorl %eax, %eax
xorl %ecx, %ecx
movq %r14, %rsi
xorl %edx, %edx
movq (%rsi), %rdi
movq 0x1188(%rdi), %r8
movq %r8, %r9
subq 0x1168(%rdi), %r9
shrq $0x3, %r9
cmpq $0x1, %r8
adcl $-0x1, %r9d
leal (%r9,%r9,4), %r8d
movq 0x1170(%rdi), %r9
subq 0x1178(%rdi), %r9
shrq $0x5, %r9
imull $0xaaaaaaab, %r9d, %r9d # imm = 0xAAAAAAAB
addl %r8d, %r9d
movq 0x1160(%rdi), %r8
subq 0x1150(%rdi), %r8
movl 0x10f0(%rdi), %r10d
shrq $0x5, %r8
imull $0xaaaaaaab, %r8d, %r8d # imm = 0xAAAAAAAB
addl %r9d, %r8d
addl 0x10d0(%rdi), %r8d
addl %r10d, %eax
addl %r8d, %eax
addl %r8d, %ecx
addl %r10d, %edx
addq $0x8, %rsi
cmpq %r15, %rsi
jne 0x26911
cvtsi2sd %eax, %xmm2
cvtsi2sd %ecx, %xmm1
xorps %xmm0, %xmm0
cvtsi2sd %edx, %xmm0
jmp 0x269ad
xorpd %xmm0, %xmm0
xorpd %xmm1, %xmm1
xorpd %xmm2, %xmm2
addsd 0x6c8(%rbx), %xmm2
movsd %xmm2, 0x6c8(%rbx)
addsd 0x760(%rbx), %xmm1
movsd %xmm1, 0x760(%rbx)
addsd 0x7f8(%rbx), %xmm0
movsd %xmm0, 0x7f8(%rbx)
cmpq %r15, %r14
je 0x26a40
xorl %ebp, %ebp
movq (%r14), %rdi
testb $0x1, %bpl
je 0x26a00
callq 0x28556
addq $0x8, %r14
movb $0x1, %bpl
cmpq %r15, %r14
jne 0x269e4
jmp 0x26a28
movq 0x1098(%rdi), %rax
movl 0x400(%rax), %r12d
testl %r12d, %r12d
setg %bpl
callq 0x28556
addq $0x8, %r14
cmpq %r15, %r14
jne 0x269e4
testl %r12d, %r12d
jle 0x26a40
movsd 0x3a0(%rbx), %xmm0
addsd 0x123680(%rip), %xmm0   # 0x14a0b8
movsd %xmm0, 0x3a0(%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]ramulator/src/Memory.h
// Function: ramulator::Memory<ramulator::DDR3, ramulator::Controller>::finish()
void finish(void) {
      dram_capacity = max_address;
      int *sz = spec->org_entry.count;
      maximum_bandwidth = spec->speed_entry.rate * 1e6 * spec->channel_width * sz[int(T::Level::Channel)] / 8;
      long dram_cycles = num_dram_cycles.value();
      for (auto ctrl : ctrls) {
        long read_req = long(incoming_read_reqs_per_channel[ctrl->channel->id].value());
        ctrl->finish(read_req, dram_cycles);
      }

      // finalize average queueing requests
      in_queue_req_num_avg = in_queue_req_num_sum.value() / dram_cycles;
      in_queue_read_req_num_avg = in_queue_read_req_num_sum.value() / dram_cycles;
      in_queue_write_req_num_avg = in_queue_write_req_num_sum.value() / dram_cycles;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
cvtsi2sdq 0xb48(%rdi), %xmm0
movsd %xmm0, 0x78(%rdi)
movq 0xc20(%rdi), %rax
xorps %xmm0, %xmm0
cvtsi2sdl 0x2d68(%rax), %xmm0
mulsd 0x123388(%rip), %xmm0   # 0x14a0c0
cvtsi2sdl 0x2744(%rax), %xmm1
cvtsi2sdl 0x272c(%rax), %xmm2
mulsd %xmm0, %xmm1
mulsd %xmm1, %xmm2
mulsd 0x123370(%rip), %xmm2   # 0x14a0c8
movsd %xmm2, 0x630(%rdi)
cvttsd2si 0x110(%rdi), %r14
movq 0xc08(%rdi), %r12
movq 0xc10(%rdi), %r13
cmpq %r13, %r12
je 0x26e3b
leaq 0x478(%rbx), %r15
xorps %xmm0, %xmm0
cvtsi2sd %r14, %xmm0
movsd %xmm0, (%rsp)
movq (%r12), %rbp
movq 0x1098(%rbp), %rax
movl 0x39c(%rax), %esi
movq %r15, %rdi
callq 0x2ac3a
movq (%rax), %rcx
movq %rax, %rdi
callq *0x58(%rcx)
cvttsd2si %xmm0, %rax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
movsd 0x8b8(%rbp), %xmm1
divsd %xmm0, %xmm1
movsd 0x9e8(%rbp), %xmm0
movsd %xmm1, 0x820(%rbp)
movsd (%rsp), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x950(%rbp)
movsd 0xb18(%rbp), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, 0xa80(%rbp)
movsd 0xc48(%rbp), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, 0xbb0(%rbp)
movq 0x1098(%rbp), %rdi
movq %r14, %rsi
callq 0x2b55c
addq $0x8, %r12
cmpq %r13, %r12
jne 0x26d94
movsd (%rsp), %xmm2
jmp 0x26e43
xorps %xmm2, %xmm2
cvtsi2sd %r14, %xmm2
movsd 0x6c8(%rbx), %xmm0
movsd 0x760(%rbx), %xmm1
divsd %xmm2, %xmm0
movsd %xmm0, 0x890(%rbx)
divsd %xmm2, %xmm1
movsd %xmm1, 0x928(%rbx)
movsd 0x7f8(%rbx), %xmm0
divsd %xmm2, %xmm0
movsd %xmm0, 0x9c0(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]ramulator/src/Memory.h
// Function: ramulator::Memory<ramulator::DDR3, ramulator::Controller>::record_core(int)
void record_core(int coreid) {
#ifndef INTEGRATED_WITH_GEM5
      record_read_requests[coreid] = num_read_requests[coreid];
      record_write_requests[coreid] = num_write_requests[coreid];
#endif
      for (auto ctrl : ctrls) {
        ctrl->record_core(coreid);
      }
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
addq $0x1d0, %rdi            # imm = 0x1D0
callq 0x2ac3a
movq %rax, %r15
leaq 0x9e8(%r14), %rdi
movl %ebx, %esi
callq 0x2ac3a
movq %rax, %r12
leaq 0x8(%rax), %rdi
leaq 0x8(%r15), %rsi
callq 0xb1c0
leaq 0x28(%r12), %rdi
leaq 0x28(%r15), %rsi
callq 0xb1c0
movzwl 0x4c(%r15), %eax
movw %ax, 0x4c(%r12)
movl 0x48(%r15), %eax
movl %eax, 0x48(%r12)
leaq 0x50(%r12), %rdi
leaq 0x50(%r15), %rsi
callq 0xb1c0
movsd 0x70(%r15), %xmm0
movsd %xmm0, 0x70(%r12)
leaq 0x280(%r14), %rdi
movl %ebx, %esi
callq 0x2ac3a
movq %rax, %r15
leaq 0xa98(%r14), %rdi
movl %ebx, %esi
callq 0x2ac3a
movq %rax, %r12
leaq 0x8(%rax), %rdi
leaq 0x8(%r15), %rsi
callq 0xb1c0
leaq 0x28(%r12), %rdi
leaq 0x28(%r15), %rsi
callq 0xb1c0
movzwl 0x4c(%r15), %eax
movw %ax, 0x4c(%r12)
movl 0x48(%r15), %eax
movl %eax, 0x48(%r12)
leaq 0x50(%r12), %rdi
leaq 0x50(%r15), %rsi
callq 0xb1c0
movsd 0x70(%r15), %xmm0
movsd %xmm0, 0x70(%r12)
movq 0xc08(%r14), %r15
movq 0xc10(%r14), %r14
cmpq %r14, %r15
je 0x27166
movq (%r15), %rdi
movl %ebx, %esi
callq 0x2b940
addq $0x8, %r15
jmp 0x27151
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]ramulator/src/Memory.h
// Function: ramulator::Memory<ramulator::DDR3, ramulator::Controller>::dump_mapping_scheme()
void dump_mapping_scheme(){
        cout << "Mapping Scheme: " << endl;
        for (MapScheme::iterator mapit = mapping_scheme.begin(); mapit != mapping_scheme.end(); mapit++)
        {
            int level = mapit->first;
            for (MapSchemeEntry::iterator entit = mapit->second.begin(); entit != mapit->second.end(); entit++){
                cout << T::level_str[level] << "[" << entit->first << "] := ";
                cout << "PhysicalAddress[" << *(entit->second.begin()) << "]";
                entit->second.erase(entit->second.begin());
                for (MapSrcVector::iterator it = entit->second.begin() ; it != entit->second.end(); it ++)
                    cout << " xor PhysicalAddress[" << *it << "]";
                cout << endl;
            }
        }
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq 0x1789bc(%rip), %r14    # 0x19ff98
leaq 0x124331(%rip), %rsi    # 0x14b914
movl $0x10, %edx
movq %r14, %rdi
callq 0xb340
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0xb2c0
movsbl %al, %esi
movq %r14, %rdi
callq 0xb030
movq %rax, %rdi
callq 0xb220
movq 0xb68(%rbx), %rax
addq $0xb58, %rbx            # imm = 0xB58
movq %rbx, 0x8(%rsp)
cmpq %rbx, %rax
je 0x277a7
leaq 0x124333(%rip), %rbx    # 0x14b96d
leaq 0x1242ea(%rip), %r15    # 0x14b92b
movq 0x40(%rax), %r12
movq %rax, (%rsp)
addq $0x30, %rax
movq %rax, 0x10(%rsp)
cmpq %rax, %r12
je 0x27793
movq (%rsp), %rax
movslq 0x20(%rax), %rbp
shlq $0x5, %rbp
addq 0x17890a(%rip), %rbp    # 0x19ff78
movq (%rbp), %rsi
movq 0x8(%rbp), %rdx
movq %r14, %rdi
callq 0xb340
movq %rax, %r13
movl $0x1, %edx
movq %rax, %rdi
leaq 0x1242af(%rip), %rsi    # 0x14b93f
callq 0xb340
movl 0x20(%r12), %esi
movq %r13, %rdi
callq 0xb210
movl $0x5, %edx
movq %rax, %rdi
leaq 0x124274(%rip), %rsi    # 0x14b925
callq 0xb340
movl $0x10, %edx
movq %r14, %rdi
leaq 0x12426b(%rip), %rsi    # 0x14b930
callq 0xb340
movq 0x28(%r12), %rax
movl (%rax), %esi
movq %r14, %rdi
callq 0xb210
movl $0x1, %edx
movq %rax, %rdi
movq %rbx, %rsi
callq 0xb340
movq 0x28(%r12), %r13
movq 0x30(%r12), %rdx
leaq 0x4(%r13), %rsi
cmpq %rdx, %rsi
je 0x27711
subq %rsi, %rdx
movq %r13, %rdi
callq 0xb480
movq 0x28(%r12), %r13
movq 0x30(%r12), %rdx
addq $-0x4, %rdx
movq %rdx, 0x30(%r12)
cmpq %rdx, %r13
je 0x27756
movl $0x15, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0xb340
movl (%r13), %esi
movq %r14, %rdi
callq 0xb210
movl $0x1, %edx
movq %rax, %rdi
movq %rbx, %rsi
callq 0xb340
addq $0x4, %r13
cmpq 0x30(%r12), %r13
jne 0x2771f
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0xb2c0
movsbl %al, %esi
movq %r14, %rdi
callq 0xb030
movq %rax, %rdi
callq 0xb220
movq %r12, %rdi
callq 0xb230
movq %rax, %r12
cmpq 0x10(%rsp), %rax
jne 0x2766e
movq (%rsp), %rdi
callq 0xb230
cmpq 0x8(%rsp), %rax
jne 0x27641
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]ramulator/src/Refresh.h
// Function: ramulator::Refresh<ramulator::DDR3>::inject_refresh(bool)
void inject_refresh(bool b_ref_rank) {
    // Rank-level refresh
    if (b_ref_rank) {
      for (auto rank : ctrl->channel->children)
        refresh_target(ctrl, rank->id, -1, -1);
    }
    // Bank-level refresh. Simultaneously issue to all ranks (better performance than staggered refreshes).
    else {
      for (auto rank : ctrl->channel->children)
        refresh_target(ctrl, rank->id, bank_ref_counters[rank->id], -1);
    }
    refreshed = clk;
  }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rax
movq 0x1098(%rax), %rax
movq 0x3b0(%rax), %r14
movq 0x3b8(%rax), %r15
testl %esi, %esi
je 0x295c4
cmpq %r15, %r14
je 0x295f2
movq (%r14), %rax
movq 0x8(%rbx), %rsi
movl 0x39c(%rax), %edx
movq %rbx, %rdi
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
callq 0x29600
addq $0x8, %r14
jmp 0x29599
cmpq %r15, %r14
je 0x295f2
movq (%r14), %rax
movslq 0x39c(%rax), %rdx
movq 0x8(%rbx), %rsi
movq 0x20(%rbx), %rax
movl (%rax,%rdx,4), %ecx
movq %rbx, %rdi
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
callq 0x29600
addq $0x8, %r14
jmp 0x295c4
movq 0x10(%rbx), %rax
movq %rax, 0x18(%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]ramulator/src/Refresh.h
// Function: ramulator::Refresh<ramulator::DDR3>::refresh_target(ramulator::Controller<ramulator::DDR3>*, int, int, int)
void refresh_target(Controller<T>* ctrl, int rank, int bank, int sa)
  {
    vector<int> addr_vec(int(T::Level::MAX), -1);
    addr_vec[0] = ctrl->channel->id;
    addr_vec[1] = rank;
    addr_vec[2] = bank;
    addr_vec[3] = sa;
    Request req(addr_vec, Request::Type::REFRESH, NULL);
    bool res = ctrl->enqueue(req);
    assert(res);
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0xa8, %rsp
movl %r8d, %ebp
movl %ecx, %r14d
movl %edx, %r15d
movq %rsi, %rbx
movl $0x14, %edi
callq 0xb2e0
leaq 0x8(%rsp), %rsi
movq %rax, (%rsi)
leaq 0x14(%rax), %rcx
movq %rcx, 0x10(%rsi)
pcmpeqd %xmm0, %xmm0
movdqu %xmm0, (%rax)
movl $0xffffffff, 0x10(%rax) # imm = 0xFFFFFFFF
movq %rcx, 0x8(%rsi)
movq 0x1098(%rbx), %rcx
movl 0x39c(%rcx), %ecx
movl %ecx, (%rax)
movl %r15d, 0x4(%rax)
movl %r14d, 0x8(%rax)
movl %ebp, 0xc(%rax)
pxor %xmm0, %xmm0
leaq 0x20(%rsp), %rcx
movdqa %xmm0, 0x10(%rcx)
movdqa %xmm0, (%rcx)
leaq 0x48(%rsp), %rdi
movl $0x2, %edx
xorl %r8d, %r8d
callq 0x2977e
movq 0x30(%rsp), %rax
testq %rax, %rax
je 0x2969d
leaq 0x20(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
leaq 0x48(%rsp), %rsi
movq %rbx, %rdi
callq 0x297e6
testb %al, %al
je 0x29709
movq 0x98(%rsp), %rax
testq %rax, %rax
je 0x296cd
leaq 0x88(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x296e4
movq 0x68(%rsp), %rsi
subq %rdi, %rsi
callq 0xb2f0
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x296fb
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
callq 0xb2f0
addq $0xa8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x122322(%rip), %rdi    # 0x14ba32
leaq 0x12231f(%rip), %rsi    # 0x14ba36
leaq 0x122326(%rip), %rcx    # 0x14ba44
movl $0x6b, %edx
callq 0xb200
jmp 0x29776
jmp 0x29776
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x25c78
jmp 0x29757
movq %rax, %rbx
movq 0x30(%rsp), %rax
testq %rax, %rax
je 0x29757
leaq 0x20(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x2976e
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
callq 0xb2f0
movq %rbx, %rdi
callq 0xb510
movq %rax, %rdi
callq 0x171a3
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]ramulator/src/Controller.h
// Function: ramulator::Controller<ramulator::DDR3>::enqueue(ramulator::Request&)
bool enqueue(Request& req)
    {
        Queue& queue = get_queue(req.type);
        if (queue.max == queue.size())
            return false;

        req.arrive = clk;
        queue.q.push_back(req);
        // shortcut for read requests, if a write to same addr exists
        // necessary for coherence
        if (req.type == Request::Type::READ && find_if(writeq.q.begin(), writeq.q.end(),
                [req](Request& wreq){ return req.addr == wreq.addr;}) != writeq.q.end()){
            req.depart = clk + 1;
            pending.push_back(req);
            readq.q.pop_back();
        }
        return true;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movl 0x2c(%rsi), %eax
xorl %ecx, %ecx
cmpl $0x1, %eax
setne %cl
shll $0x6, %ecx
addq $0x10e0, %rcx           # imm = 0x10E0
testl %eax, %eax
movl $0x10c0, %r15d          # imm = 0x10C0
cmovneq %rcx, %r15
movl 0x10(%rdi,%r15), %ebp
movl 0x18(%rdi,%r15), %r13d
cmpl %ebp, %r13d
je 0x2991c
movq %rsi, %rbx
movq %rdi, %r14
addq %rdi, %r15
movq 0x1090(%rdi), %rax
movq %rax, 0x30(%rsi)
movq %r15, %rdi
callq 0x2acde
movq %rax, %rdi
movq %r15, %rsi
callq 0xb080
incq 0x10(%r15)
cmpl $0x0, 0x2c(%rbx)
jne 0x2991c
movq 0x10e0(%r14), %r12
movups (%rbx), %xmm0
leaq 0x10(%rsp), %r15
movaps %xmm0, -0x10(%r15)
leaq 0x10(%rbx), %rsi
movq %r15, %rdi
callq 0x24b42
movq 0x38(%rbx), %rax
movq %rax, 0x28(%r15)
movups 0x28(%rbx), %xmm0
movups %xmm0, 0x18(%r15)
leaq 0x40(%rsp), %rdi
leaq 0x40(%rbx), %rsi
callq 0x29968
leaq 0x10e0(%r14), %r15
movq %rsp, %rdx
movq %r12, %rdi
movq %r15, %rsi
callq 0x299c6
movq %rax, %r12
movq 0x50(%rsp), %rax
testq %rax, %rax
je 0x298cd
leaq 0x40(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x298e4
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0xb2f0
cmpq %r15, %r12
je 0x2991c
movq 0x1090(%r14), %rax
incq %rax
movq %rax, 0x38(%rbx)
leaq 0x1140(%r14), %rdi
movq %rbx, %rsi
callq 0x294c4
movq 0x10c8(%r14), %rsi
addq $0x10c0, %r14           # imm = 0x10C0
movq %r14, %rdi
callq 0x29c9c
cmpl %ebp, %r13d
setne %al
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rdi
callq 0x171a3
movq %rax, %rbx
movq %rsp, %rdi
callq 0x29c24
jmp 0x29960
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x29960
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0xb2f0
movq %rbx, %rdi
callq 0xb510
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]ramulator/src/DRAM.h
// Function: ramulator::DRAM<ramulator::DDR3>::update_state(ramulator::DDR3::Command, int const*)
void DRAM<T>::update_state(typename T::Command cmd, const int* addr)
{
    int child_id = addr[int(level)+1];
    if (lambda[int(cmd)])
        lambda[int(cmd)](this, child_id); // update this level

    if (level == spec->scope[int(cmd)] || !children.size())
        return; // stop recursion: updated all levels

    // recursively update my child
    children[child_id]->update_state(cmd, addr);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r14
movslq 0x398(%rdi), %rax
movl 0x4(%rdx,%rax,4), %r15d
movq 0x888(%rdi), %rdi
movslq %esi, %r12
movq %r12, %rcx
shlq $0x5, %rcx
cmpq $0x0, 0x10(%rdi,%rcx)
je 0x2a4ae
addq %rcx, %rdi
leaq 0x8(%rsp), %rsi
movq %r14, (%rsi)
leaq 0x4(%rsp), %rdx
movl %r15d, (%rdx)
callq *0x18(%rdi)
movl 0x398(%r14), %eax
movq 0x390(%r14), %rcx
cmpl 0x180(%rcx,%r12,4), %eax
je 0x2a4e0
movq 0x3b0(%r14), %rax
cmpq %rax, 0x3b8(%r14)
je 0x2a4e0
movslq %r15d, %rcx
movq (%rax,%rcx,8), %rdi
movl %ebp, %esi
movq %rbx, %rdx
callq 0x2a458
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]ramulator/src/DRAM.h
// Function: ramulator::DRAM<ramulator::DDR3>::check_row_open(ramulator::DDR3::Command, int const*)
bool DRAM<T>::check_row_open(typename T::Command cmd, const int* addr)
{
    int child_id = addr[int(level)+1];
    if (rowopen[int(cmd)]) {
        return rowopen[int(cmd)](this, cmd, child_id);  // stop recursion: there is a row hit at this level
    }

    if (child_id < 0 || !children.size())
        return false; // stop recursion: there were no row hits at any level

    // recursively check for row hits at my child
    return children[child_id]->check_row_open(cmd, addr);
}

// Assembly:
movl %esi, %eax
movq %rdi, %rsi
movslq %eax, %r8
movslq 0x398(%rdi), %rcx
movl 0x4(%rdx,%rcx,4), %ecx
movq 0x880(%rdi), %rdi
shlq $0x5, %r8
cmpq $0x0, 0x10(%rdi,%r8)
jne 0x2acd0
testl %ecx, %ecx
js 0x2acda
movq 0x3b0(%rsi), %rdi
cmpq %rdi, 0x3b8(%rsi)
je 0x2acda
movl %ecx, %ecx
movq (%rdi,%rcx,8), %rsi
movslq 0x398(%rsi), %rcx
movl 0x4(%rdx,%rcx,4), %ecx
movq 0x880(%rsi), %rdi
jmp 0x2ac9a
addq %r8, %rdi
movl %eax, %edx
jmp 0x24a58
xorl %eax, %eax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]ramulator/src/Config.h
// Function: ramulator::Config::is_early_exit() const
bool is_early_exit() const {
      // the default value is true
      if (options.find("early_exit") != options.end()) {
        if ((options.find("early_exit"))->second == "off") {
          return false;
        }
        return true;
      }
      return true;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x1203aa(%rip), %rsi    # 0x14c022
leaq 0x1203ad(%rip), %rdx    # 0x14c02c
leaq 0x8(%rsp), %rdi
callq 0x175a0
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x1711a
movq %rax, %r14
leaq 0x8(%rbx), %r12
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x2bcb4
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xb2f0
cmpq %r12, %r14
je 0x2bd12
leaq 0x8(%rsp), %rdi
movq %r15, (%rdi)
leaq 0x12035a(%rip), %rsi    # 0x14c022
leaq 0x12035d(%rip), %rdx    # 0x14c02c
callq 0x175a0
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x1711a
addq $0x40, %rax
leaq 0x120341(%rip), %rsi    # 0x14c02d
movq %rax, %rdi
callq 0xb100
testl %eax, %eax
setne %bl
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x2bd14
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xb2f0
jmp 0x2bd14
movb $0x1, %bl
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x2bd26
jmp 0x2bd42
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x2bd45
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xb2f0
jmp 0x2bd45
movq %rax, %rbx
movq %rbx, %rdi
callq 0xb510
nop
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]ramulator/src/ALDRAM.cpp
// Function: ramulator::ALDRAM::init_rowhit()
void ALDRAM::init_rowhit()
{
    // RD
    rowhit[int(Level::Bank)][int(Command::RD)] = [] (DRAM<ALDRAM>* node, Command cmd, int id) {
        switch (int(node->state)) {
            case int(State::Closed): return false;
            case int(State::Opened):
                if (node->row_state.find(id) != node->row_state.end())
                    return true;
                return false;
            default: assert(false);
        }};

    // WR
    rowhit[int(Level::Bank)][int(Command::WR)] = rowhit[int(Level::Bank)][int(Command::RD)];
}

// Assembly:
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
movups 0xcc0(%rdi), %xmm0
movaps %xmm0, (%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0xcc0(%rdi)
movq 0xcd0(%rdi), %rax
movq %rax, 0x10(%rsp)
leaq 0x22ea(%rip), %rcx      # 0x101db8
movq %rcx, 0xcd0(%rdi)
movq 0xcd8(%rdi), %rcx
movq %rcx, 0x18(%rsp)
leaq 0x224e(%rip), %rcx      # 0x101d36
movq %rcx, 0xcd8(%rdi)
testq %rax, %rax
je 0xffb01
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
leaq 0xcc0(%rbx), %rsi
addq $0xce0, %rbx            # imm = 0xCE0
movq %rbx, %rdi
callq 0x10228a
addq $0x20, %rsp
popq %rbx
retq
movq %rax, %rdi
callq 0x171a3
nop
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]ramulator/src/ALDRAM.cpp
// Function: ramulator::ALDRAM::aldram_timing(ramulator::ALDRAM::Temp)
void ALDRAM::aldram_timing(Temp current_temperature)
{
    for (int i = 0; i < int(Level::MAX); i++) {
        for (int j = 0; j < int(Command::MAX); j++) {
            timing[i][j].clear();
        }
    }
    temperature = current_temperature;
    read_latency = speed_entry.nCL + speed_entry.nBL;
    init_timing(speed_table[int(temperature)][int(current_speed)]);

    //std::cout << "vector size: " << timing[int(Temp::HOT)][int(current_speed)].size() << endl;
    //std::cout << "after cold nRCD : ";
    //std::cout << int(timing[int(Level::Bank)][int(Command::ACT)][0].val) << endl << endl;
}

// Assembly:
subq $0x78, %rsp
movq %rdi, %rax
leaq 0x1868(%rdi), %rcx
xorl %edx, %edx
xorl %edi, %edi
movq -0x8(%rcx,%rdi), %r8
cmpq %r8, (%rcx,%rdi)
je 0x101ad7
movq %r8, (%rcx,%rdi)
addq $0x18, %rdi
cmpq $0x120, %rdi            # imm = 0x120
jne 0x101ac8
incq %rdx
addq $0x120, %rcx            # imm = 0x120
cmpq $0x5, %rdx
jne 0x101ac6
movl %esi, 0x2744(%rax)
movl 0x33a8(%rax), %ecx
addl 0x33b4(%rax), %ecx
movl %ecx, 0x3400(%rax)
movslq %esi, %rcx
imulq $0x620, %rcx, %rcx      # imm = 0x620
addq %rax, %rcx
movslq 0x2740(%rax), %rdx
imulq $0x70, %rdx, %rdx
leaq (%rdx,%rcx), %rsi
addq $0x2750, %rsi           # imm = 0x2750
movl $0xe, %ecx
movq %rsp, %rdi
rep  movsq (%rsi), %es:(%rdi)
movq %rax, %rdi
callq 0xfff96
addq $0x78, %rsp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]ramulator/src/Cache.cpp
// Function: ramulator::Cache::is_hit(std::__cxx11::list<ramulator::Cache::Line, std::allocator<ramulator::Cache::Line>>&, long, std::_List_iterator<ramulator::Cache::Line>*)
bool Cache::is_hit(std::list<Line>& lines, long addr,
    std::list<Line>::iterator* pos_ptr) {
  auto pos = find_if(lines.begin(), lines.end(),
      [addr, this](Line l){return (l.tag == get_tag(addr));});
  *pos_ptr = pos;
  if (pos == lines.end()) {
    return false;
  }
  return !pos->lock;
}

// Assembly:
movq %rcx, %rax
movq (%rsi), %r8
cmpq %rsi, %r8
je 0x104ae2
movb 0x684(%rdi), %cl
sarq %cl, %rdx
cmpq 0x18(%r8), %rdx
je 0x104ae2
movq (%r8), %r8
cmpq %rsi, %r8
jne 0x104ad4
movq %r8, (%rax)
cmpq %rsi, %r8
je 0x104af1
movb 0x20(%r8), %al
xorb $0x1, %al
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]ramulator/src/Cache.cpp
// Function: ramulator::Cache::allocate_line(std::__cxx11::list<ramulator::Cache::Line, std::allocator<ramulator::Cache::Line>>&, long)
std::list<Cache::Line>::iterator Cache::allocate_line(
    std::list<Line>& lines, long addr) {
  // See if an eviction is needed
  if (need_eviction(lines, addr)) {
    // Get victim.
    // The first one might still be locked due to reorder in MC
    auto victim = find_if(lines.begin(), lines.end(),
        [this](Line line) {
          bool check = !line.lock;
          if (!is_first_level) {
            for (auto hc : higher_cache) {
              if(!check) {
                return check;
              }
              check = check && hc->check_unlock(line.addr);
            }
          }
          return check;
        });
    if (victim == lines.end()) {
      return victim;  // doesn't exist a line that's already unlocked in each level
    }
    assert(victim != lines.end());
    evict(&lines, victim);
  }

  // Allocate newline, with lock bit on and dirty bit off
  lines.push_back(Line(addr, get_tag(addr)));
  auto last_element = lines.end();
  --last_element;
  return last_element;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r12
movq %rsi, %rbx
movq %rdi, %r15
callq 0x105078
testb %al, %al
je 0x104b88
movq %r12, (%rsp)
movq (%rbx), %r12
cmpq %rbx, %r12
je 0x104b71
movb 0x20(%r12), %cl
movl %ecx, %eax
xorb $0x1, %al
cmpb $0x0, 0x660(%r15)
jne 0x104b67
movq 0x640(%r15), %rbp
movq 0x648(%r15), %r14
cmpq %r14, %rbp
je 0x104b67
movq 0x10(%r12), %r13
cmpb $0x1, %cl
setne %al
testb $0x1, %al
je 0x104b6b
movq (%rbp), %rdi
movq %r13, %rsi
callq 0x105e40
addq $0x8, %rbp
cmpq %r14, %rbp
jne 0x104b4e
testb $0x1, %al
jne 0x104b71
movq (%r12), %r12
jmp 0x104b18
cmpq %rbx, %r12
je 0x104bc0
movq %r15, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x104e22
movq (%rsp), %r12
movb 0x684(%r15), %cl
movq %r12, %r14
sarq %cl, %r14
movl $0x28, %edi
callq 0xb2e0
movq %r12, 0x10(%rax)
movq %r14, 0x18(%rax)
movw $0x1, 0x20(%rax)
movq %rax, %rdi
movq %rbx, %rsi
callq 0xb080
incq 0x10(%rbx)
movq 0x8(%rbx), %r12
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]ramulator/src/Cache.cpp
// Function: ramulator::Cache::invalidate(long)
std::pair<long, bool> Cache::invalidate(long addr) {
  long delay = latency_each[int(level)];
  bool dirty = false;

  auto& lines = get_lines(addr);
  if (lines.size() == 0) {
    // The line of this address doesn't exist.
    return make_pair(0, false);
  }
  auto line = find_if(lines.begin(), lines.end(),
      [addr, this](Line l){return (l.tag == get_tag(addr));});

  // If the line is in this level cache, then erase it from
  // the buffer.
  if (line != lines.end()) {
    assert(!line->lock);
    debug("invalidate %lx @ level %d", addr, int(level));
    lines.erase(line);
  } else {
    // If it's not in current level, then no need to go up.
    return make_pair(delay, false);
  }

  if (higher_cache.size()) {
    long max_delay = delay;
    for (auto hc : higher_cache) {
      auto result = hc->invalidate(addr);
      if (result.second) {
        max_delay = max(max_delay, delay + result.first * 2);
      } else {
        max_delay = max(max_delay, delay + result.first);
      }
      dirty = dirty || line->dirty || result.second;
    }
    delay = max_delay;
  } else {
    dirty = line->dirty;
  }
  return make_pair(delay, dirty);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r15
movslq 0x5f0(%rdi), %rax
movslq 0x624(%rdi,%rax,4), %rax
movq %rax, (%rsp)
callq 0x105514
movq 0x10(%rax), %rdx
testq %rdx, %rdx
je 0x104de1
movq (%rax), %r14
cmpq %rax, %r14
je 0x104d51
movb 0x684(%r15), %cl
movq %rbx, %rsi
sarq %cl, %rsi
cmpq 0x18(%r14), %rsi
je 0x104d51
movq (%r14), %r14
cmpq %rax, %r14
jne 0x104d43
cmpq %rax, %r14
je 0x104de7
cmpb $0x1, 0x20(%r14)
je 0x104e02
decq %rdx
movq %rdx, 0x10(%rax)
movq %r14, %rdi
callq 0xb490
movl $0x28, %esi
movq %r14, %rdi
callq 0xb2f0
movq 0x640(%r15), %r13
movq 0x648(%r15), %r15
cmpq %r13, %r15
je 0x104deb
xorl %ebp, %ebp
movq (%rsp), %rax
movq %rax, %r12
movq (%r13), %rdi
movq %rbx, %rsi
callq 0x104cf8
movl %edx, %ecx
andb $0x1, %cl
shlq %cl, %rax
addq (%rsp), %rax
cmpq %rax, %r12
cmovgq %r12, %rax
movb $0x1, %dl
testb $0x1, %bpl
jne 0x104dd4
movzbl %cl, %edx
cmpb $0x0, 0x21(%r14)
movl $0x1, %ecx
cmovnel %ecx, %edx
addq $0x8, %r13
movl %edx, %ebp
cmpq %r15, %r13
jne 0x104d9a
jmp 0x104df3
xorl %eax, %eax
xorl %edx, %edx
jmp 0x104df3
xorl %edx, %edx
jmp 0x104def
movb 0x21(%r14), %dl
movq (%rsp), %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5095e(%rip), %rdi     # 0x155767
leaq 0x5063f(%rip), %rsi     # 0x15544f
leaq 0x5095c(%rip), %rcx     # 0x155773
movl $0xe6, %edx
callq 0xb200
nop
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]ramulator/src/Cache.cpp
// Function: ramulator::Cache::need_eviction(std::__cxx11::list<ramulator::Cache::Line, std::allocator<ramulator::Cache::Line>> const&, long)
bool Cache::need_eviction(const std::list<Line>& lines, long addr) {
  if (find_if(lines.begin(), lines.end(),
      [addr, this](Line l){
        return (get_tag(addr) == l.tag);})
      != lines.end()) {
    // Due to MSHR, the program can't reach here. Just for checking
    assert(false);
  } else {
    if (lines.size() < assoc) {
      return false;
    } else {
      return true;
    }
  }
}

// Assembly:
pushq %rax
movq (%rsi), %rax
cmpq %rsi, %rax
je 0x10509f
movb 0x684(%rdi), %cl
sarq %cl, %rdx
cmpq 0x18(%rax), %rdx
je 0x10509a
movq (%rax), %rax
cmpq %rsi, %rax
jne 0x10508a
jmp 0x10509f
cmpq %rsi, %rax
jne 0x1050ae
movl 0x670(%rdi), %eax
cmpq %rax, 0x10(%rsi)
setae %al
popq %rcx
retq
leaq 0x452e4(%rip), %rdi     # 0x14a399
leaq 0x50393(%rip), %rsi     # 0x15544f
leaq 0x50788(%rip), %rcx     # 0x15584b
movl $0x165, %edx            # imm = 0x165
callq 0xb200
nop