LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]ramulator/src/Cache.cpp
// Function: ramulator::Cache::callback(ramulator::Request&)
void Cache::callback(Request& req) {
  debug("level %d", int(level));

  auto it = find_if(mshr_entries.begin(), mshr_entries.end(),
      [&req, this](std::pair<long, std::list<Line>::iterator> mshr_entry) {
        return (align(mshr_entry.first) == align(req.addr));
      });

  if (it != mshr_entries.end()) {
    it->second->lock = false;
    mshr_entries.erase(it);
  }

  if (higher_cache.size()) {
    for (auto hc : higher_cache) {
      hc->callback(req);
    }
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq 0x690(%rdi), %rsi
movq 0x698(%rdi), %rax
movq %rax, %r9
subq %rsi, %r9
movq %r9, %rdx
sarq $0x6, %rdx
testq %rdx, %rdx
jle 0x1051aa
movq 0x8(%rbx), %rdi
movl 0x67c(%r14), %r8d
negq %r8
andq $-0x40, %r9
movq %r9, %rcx
addq %rsi, %rcx
incq %rdx
addq $0x20, %rsi
movq -0x20(%rsi), %r9
xorq %rdi, %r9
testq %r8, %r9
je 0x1051d7
movq -0x10(%rsi), %r9
xorq %rdi, %r9
testq %r8, %r9
je 0x1051dd
movq (%rsi), %r9
xorq %rdi, %r9
testq %r8, %r9
je 0x105232
movq 0x10(%rsi), %r9
xorq %rdi, %r9
testq %r8, %r9
je 0x10522e
decq %rdx
addq $0x40, %rsi
cmpq $0x1, %rdx
jg 0x10515e
movq %rax, %r9
subq %rcx, %r9
jmp 0x1051ad
movq %rsi, %rcx
sarq $0x4, %r9
cmpq $0x3, %r9
je 0x1051f3
cmpq $0x2, %r9
je 0x1051e3
cmpq $0x1, %r9
jne 0x10524b
movq 0x8(%rbx), %rdx
movl 0x67c(%r14), %esi
negq %rsi
jmp 0x10521f
addq $-0x20, %rsi
jmp 0x105232
addq $-0x10, %rsi
jmp 0x105232
movq 0x8(%rbx), %rdx
movl 0x67c(%r14), %esi
negq %rsi
jmp 0x105210
movq 0x8(%rbx), %rdx
movl 0x67c(%r14), %esi
negq %rsi
movq (%rcx), %rdi
xorq %rdx, %rdi
testq %rsi, %rdi
je 0x105229
addq $0x10, %rcx
movq (%rcx), %rdi
xorq %rdx, %rdi
testq %rsi, %rdi
je 0x105229
addq $0x10, %rcx
xorq (%rcx), %rdx
testq %rsi, %rdx
cmovneq %rax, %rcx
movq %rcx, %rsi
jmp 0x105232
addq $0x10, %rsi
cmpq %rax, %rsi
je 0x10524b
leaq 0x690(%r14), %rdi
movq 0x8(%rsi), %rax
movb $0x0, 0x20(%rax)
callq 0x105712
movq 0x640(%r14), %r15
movq 0x648(%r14), %r14
cmpq %r15, %r14
je 0x105272
movq (%r15), %rdi
movq %rbx, %rsi
callq 0x105114
addq $0x8, %r15
cmpq %r14, %r15
jne 0x10525e
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]ramulator/src/Cache.cpp
// Function: ramulator::Cache::tick()
void Cache::tick() {

    if(!lower_cache->is_last_level)
        lower_cache->tick();

    for (auto it = retry_list.begin(); it != retry_list.end(); it++) {
        if(lower_cache->send(*it))
            it = retry_list.erase(it);
    }

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdi, %rbx
movq 0x658(%rdi), %rdi
cmpb $0x0, 0x661(%rdi)
jne 0x10529e
callq 0x105278
leaq 0x6a8(%rbx), %r14
movq 0x6a8(%rbx), %r15
cmpq %r14, %r15
je 0x105358
leaq 0x10(%rsp), %r12
leaq 0x40(%rsp), %r13
movq 0x658(%rbx), %rbp
movups 0x10(%r15), %xmm0
movaps %xmm0, (%rsp)
leaq 0x20(%r15), %rsi
movq %r12, %rdi
callq 0x24b42
movq 0x48(%r15), %rax
movq %rax, 0x28(%r12)
movups 0x38(%r15), %xmm0
movups %xmm0, 0x18(%r12)
leaq 0x50(%r15), %rsi
movq %r13, %rdi
callq 0x29968
movq %rbp, %rdi
movq %rsp, %rsi
callq 0x10468e
movl %eax, %ebp
movq 0x50(%rsp), %rax
testq %rax, %rax
je 0x10531f
movq %r13, %rdi
movq %r13, %rsi
movl $0x3, %edx
callq *%rax
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x105336
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0xb2f0
testb %bpl, %bpl
je 0x10534c
movq (%r15), %rbp
movq %r14, %rdi
movq %r15, %rsi
callq 0x29c9c
movq %rbp, %r15
movq (%r15), %r15
cmpq %r14, %r15
jne 0x1052bf
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 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x105396
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0xb2f0
jmp 0x105396
movq %rax, %rbx
movq %rsp, %rdi
callq 0x25c78
movq %rbx, %rdi
callq 0xb510
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]ramulator/src/Cache.cpp
// Function: ramulator::CacheSystem::tick()
void CacheSystem::tick() {
  debug("clk %ld", clk);

  ++clk;

  // Sends ready waiting request to memory
  auto it = wait_list.begin();
  while (it != wait_list.end() && clk >= it->first) {
    if (!send_memory(it->second)) {
      ++it;
    } else {

      debug("complete req: addr %lx", (it->second).addr);

      it = wait_list.erase(it);
    }
  }

  // hit request callback
  it = hit_list.begin();
  while (it != hit_list.end()) {
    if (clk >= it->first) {
      it->second.callback(it->second);

      debug("finish hit: addr %lx", (it->second).addr);

      it = hit_list.erase(it);
    } else {
      ++it;
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rdi, %rbx
incq 0x50(%rdi)
movq (%rdi), %r15
cmpq %rdi, %r15
je 0x10547d
leaq 0x30(%rbx), %rax
movq %rax, 0x8(%rsp)
leaq 0x20(%rsp), %r12
leaq 0x50(%rsp), %r13
movq 0x50(%rbx), %rax
cmpq 0x10(%r15), %rax
jl 0x10547d
movups 0x18(%r15), %xmm0
movaps %xmm0, 0x10(%rsp)
leaq 0x28(%r15), %rsi
movq %r12, %rdi
callq 0x24b42
movq 0x50(%r15), %rax
movq %rax, 0x28(%r12)
movups 0x40(%r15), %xmm0
movups %xmm0, 0x18(%r12)
leaq 0x58(%r15), %rsi
movq %r13, %rdi
callq 0x29968
cmpq $0x0, 0x40(%rbx)
je 0x1054d3
movq 0x8(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq *0x48(%rbx)
movl %eax, %ebp
movq 0x60(%rsp), %rax
testq %rax, %rax
je 0x105447
movq %r13, %rdi
movq %r13, %rsi
movl $0x3, %edx
callq *%rax
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x10545e
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0xb2f0
movq (%r15), %r14
testb %bpl, %bpl
je 0x105471
movq %rbx, %rdi
movq %r15, %rsi
callq 0x106064
movq %r14, %r15
cmpq %rbx, %r14
jne 0x1053d2
leaq 0x18(%rbx), %r14
movq 0x18(%rbx), %r15
cmpq %r14, %r15
je 0x1054bf
movq 0x50(%rbx), %rax
cmpq 0x10(%r15), %rax
jge 0x105499
movq (%r15), %r15
jmp 0x105485
cmpq $0x0, 0x68(%r15)
je 0x1054ce
leaq 0x58(%r15), %rdi
leaq 0x18(%r15), %rsi
callq *0x70(%r15)
movq (%r15), %r12
movq %r14, %rdi
movq %r15, %rsi
callq 0x106064
movq %r12, %r15
jmp 0x105485
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0xb160
callq 0xb160
movq %rax, %rdi
callq 0x171a3
jmp 0x1054fe
movq %rax, %rbx
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x10550b
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0xb2f0
jmp 0x10550b
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x25c78
movq %rbx, %rdi
callq 0xb510
nop
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]ramulator/src/Cache.h
// Function: ramulator::Cache::get_lines[abi:cxx11](long)
std::list<Line>& get_lines(long addr) {
    if (cache_lines.find(get_index(addr))
        == cache_lines.end()) {
      cache_lines.insert(make_pair(get_index(addr),
          std::list<Line>()));
    }
    return cache_lines[get_index(addr)];
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %r14
movq %rdi, %r15
leaq 0x6c0(%rdi), %rbx
movb 0x680(%rdi), %cl
movq %rsi, %rax
sarq %cl, %rax
andl 0x678(%rdi), %eax
movq 0x6d0(%rdi), %rcx
testq %rcx, %rcx
je 0x10557c
leaq 0x6c8(%r15), %rsi
movq %rsi, %rdx
xorl %edi, %edi
cmpl %eax, 0x20(%rcx)
setl %dil
cmovgeq %rcx, %rdx
movq 0x10(%rcx,%rdi,8), %rcx
testq %rcx, %rcx
jne 0x105557
cmpq %rsi, %rdx
je 0x10557c
cmpl 0x20(%rdx), %eax
jge 0x105603
leaq 0x20(%rsp), %r12
movq %r12, 0x8(%r12)
movq %r12, (%r12)
xorl %ecx, %ecx
movq %rcx, 0x10(%r12)
leaq 0x8(%rsp), %r13
movl %eax, -0x8(%r13)
movq %rcx, 0x10(%r13)
movq %r13, 0x8(%r13)
movq %r13, (%r13)
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x1057be
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x1055d0
movq (%rdi), %rbp
movl $0x28, %esi
callq 0xb2f0
movq %rbp, %rdi
cmpq %r13, %rbp
jne 0x1055bb
movq 0x20(%rsp), %rdi
cmpq %r12, %rdi
je 0x1055ef
movq (%rdi), %r13
movl $0x28, %esi
callq 0xb2f0
movq %r13, %rdi
cmpq %r12, %r13
jne 0x1055da
movb 0x680(%r15), %cl
sarq %cl, %r14
andl 0x678(%r15), %r14d
movl %r14d, %eax
movq %rsp, %rsi
movl %eax, (%rsi)
movq %rbx, %rdi
callq 0x105758
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x105641
movq (%rdi), %r14
movl $0x28, %esi
callq 0xb2f0
movq %r14, %rdi
cmpq %r13, %r14
jne 0x10562c
leaq 0x20(%rsp), %rdi
callq 0xbc15
movq %rbx, %rdi
callq 0xb510
nop
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]ramulator/src/Controller.cpp
// Function: ramulator::Controller<ramulator::SALP>::get_addr_vec(ramulator::SALP::Command, std::_List_iterator<ramulator::Request>)
vector<int> Controller<SALP>::get_addr_vec(SALP::Command cmd, list<Request>::iterator req){
    if (cmd == SALP::Command::PRE_OTHER)
        return get_offending_subarray(channel, req->addr_vec);
    else
        return req->addr_vec;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
cmpl $0xd, %edx
jne 0x106b48
movq 0x1098(%rsi), %rax
addq $0x20, %rcx
movq 0x3b0(%rax), %rsi
movq %rbx, %rdi
movq %rcx, %rdx
callq 0x106b5c
jmp 0x106b57
addq $0x20, %rcx
movq %rbx, %rdi
movq %rcx, %rsi
callq 0x24b42
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]ramulator/src/Controller.cpp
// Function: ramulator::get_offending_subarray(ramulator::DRAM<ramulator::SALP>*, std::vector<int, std::allocator<int>>&)
static vector<int> get_offending_subarray(DRAM<SALP>* channel, vector<int> & addr_vec){
    int sa_id = 0;
    auto rank = channel->children[addr_vec[int(SALP::Level::Rank)]];
    auto bank = rank->children[addr_vec[int(SALP::Level::Bank)]];
    auto sa = bank->children[addr_vec[int(SALP::Level::SubArray)]];
    for (auto sa_other : bank->children)
        if (sa != sa_other && sa_other->state == SALP::State::Opened){
            sa_id = sa_other->id;
            break;
        }
    vector<int> offending = addr_vec;
    offending[int(SALP::Level::SubArray)] = sa_id;
    offending[int(SALP::Level::Row)] = -1;
    return offending;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdx), %rdi
movslq 0x4(%rdi), %rax
movq (%rsi,%rax,8), %rax
movslq 0x8(%rdi), %rcx
movq 0x3b0(%rax), %rax
movq (%rax,%rcx,8), %rcx
movq 0x3b0(%rcx), %rax
movq 0x3b8(%rcx), %rcx
xorl %ebp, %ebp
cmpq %rcx, %rax
je 0x106bbb
movslq 0xc(%rdi), %rsi
movq (%rax,%rsi,8), %rsi
movq (%rax), %rdi
cmpq %rdi, %rsi
je 0x106baa
cmpl $0x0, 0x3c8(%rdi)
je 0x106bb5
addq $0x8, %rax
cmpq %rcx, %rax
jne 0x106b99
jmp 0x106bbb
movl 0x39c(%rdi), %ebp
movq %rbx, %rdi
movq %rdx, %rsi
callq 0x24b42
movq (%rbx), %rax
movl %ebp, 0xc(%rax)
movl $0xffffffff, 0x10(%rax) # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]ramulator/src/Controller.cpp
// Function: ramulator::Controller<ramulator::SALP>::is_ready(std::_List_iterator<ramulator::Request>)
bool Controller<SALP>::is_ready(list<Request>::iterator req){
    SALP::Command cmd = get_first_cmd(req);
    if (cmd == SALP::Command::PRE_OTHER){

        vector<int> addr_vec = get_offending_subarray(channel, req->addr_vec);
        return channel->check(cmd, addr_vec.data(), clk);
    }
    else return channel->check(cmd, req->addr_vec.data(), clk);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq 0x1098(%rdi), %rdi
movq 0x390(%rdi), %rax
movslq 0x3c(%rsi), %rcx
movl 0x238(%rax,%rcx,4), %esi
movq 0x20(%r14), %rdx
addq $0x20, %r14
callq 0x4c350
cmpl $0xd, %eax
jne 0x106c72
movq 0x1098(%rbx), %rax
movq 0x3b0(%rax), %rsi
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movq %r14, %rdx
callq 0x106b5c
movq 0x1090(%rbx), %rcx
movq 0x1098(%rbx), %rdi
movq (%r15), %rdx
movl $0xd, %esi
callq 0x48fa2
movl %eax, %ebx
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x106c66
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
callq 0xb2f0
movl %ebx, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq 0x1090(%rbx), %rcx
movq 0x1098(%rbx), %rdi
movq (%r14), %rdx
movl %eax, %esi
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x48fa2
movq %rax, %rbx
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x106cad
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
callq 0xb2f0
movq %rbx, %rdi
callq 0xb510
nop
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]ramulator/src/DDR3.cpp
// Function: ramulator::DDR3::init_rowopen()
void DDR3::init_rowopen()
{
    // RD
    rowopen[int(Level::Bank)][int(Command::RD)] = [] (DRAM<DDR3>* node, Command cmd, int id) {
        switch (int(node->state)) {
            case int(State::Closed): return false;
            case int(State::Opened): return true;
            default: assert(false);
        }};

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

// Assembly:
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
movups 0x1440(%rdi), %xmm0
movaps %xmm0, (%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x1440(%rdi)
movq 0x1450(%rdi), %rax
movq %rax, 0x10(%rsp)
leaq 0x2334(%rip), %rcx      # 0x10b48c
movq %rcx, 0x1450(%rdi)
movq 0x1458(%rdi), %rcx
movq %rcx, 0x18(%rsp)
leaq 0x22e2(%rip), %rcx      # 0x10b454
movq %rcx, 0x1458(%rdi)
testq %rax, %rax
je 0x10918b
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
leaq 0x1440(%rbx), %rsi
addq $0x1460, %rbx           # imm = 0x1460
movq %rbx, %rdi
callq 0x10b95e
addq $0x20, %rsp
popq %rbx
retq
movq %rax, %rdi
callq 0x171a3
nop
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]ramulator/src/DDR4.cpp
// Function: ramulator::DDR4::init_rowopen()
void DDR4::init_rowopen()
{
    // RD
    rowopen[int(Level::Bank)][int(Command::RD)] = [] (DRAM<DDR4>* node, Command cmd, int id) {
        switch (int(node->state)) {
            case int(State::Closed): return false;
            case int(State::Opened): return true;
            default: assert(false);
        }};

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

// Assembly:
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
movups 0x18c0(%rdi), %xmm0
movaps %xmm0, (%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x18c0(%rdi)
movq 0x18d0(%rdi), %rax
movq %rax, 0x10(%rsp)
leaq 0x28b8(%rip), %rcx      # 0x10fd78
movq %rcx, 0x18d0(%rdi)
movq 0x18d8(%rdi), %rcx
movq %rcx, 0x18(%rsp)
leaq 0x2866(%rip), %rcx      # 0x10fd40
movq %rcx, 0x18d8(%rdi)
testq %rax, %rax
je 0x10d4f3
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
leaq 0x18c0(%rbx), %rsi
addq $0x18e0, %rbx           # imm = 0x18E0
movq %rbx, %rdi
callq 0x11028a
addq $0x20, %rsp
popq %rbx
retq
movq %rax, %rdi
callq 0x171a3
nop
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]ramulator/src/DSARP.cpp
// Function: ramulator::DSARP::init_rowhit()
void DSARP::init_rowhit()
{
  // RD
  rowhit[int(Level::SubArray)][int(Command::RD)] = [] (DRAM<DSARP>* 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;
              else return false;
          default: assert(false);
      }};
  // WR
  rowhit[int(Level::SubArray)][int(Command::WR)] = rowhit[int(Level::SubArray)][int(Command::RD)];
}

// Assembly:
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
movups 0x1110(%rdi), %xmm0
movaps %xmm0, (%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x1110(%rdi)
movq 0x1120(%rdi), %rax
movq %rax, 0x10(%rsp)
leaq 0x346a(%rip), %rcx      # 0x11501c
movq %rcx, 0x1120(%rdi)
movq 0x1128(%rdi), %rcx
movq %rcx, 0x18(%rsp)
leaq 0x33ce(%rip), %rcx      # 0x114f9a
movq %rcx, 0x1128(%rdi)
testq %rax, %rax
je 0x111be5
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
leaq 0x1110(%rbx), %rsi
addq $0x1130, %rbx           # imm = 0x1130
movq %rbx, %rdi
callq 0x11572e
addq $0x20, %rsp
popq %rbx
retq
movq %rax, %rdi
callq 0x171a3
nop
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]ramulator/src/DSARP.cpp
// Function: ramulator::DSARP::init_rowopen()
void DSARP::init_rowopen()
{
  // RD
  rowopen[int(Level::SubArray)][int(Command::RD)] = [] (DRAM<DSARP>* node, Command cmd, int id) {
      switch (int(node->state)){
          case int(State::Closed): return false;
          case int(State::Opened): return true;
          default: assert(false);
      }};
  // WR
  rowopen[int(Level::SubArray)][int(Command::WR)] = rowopen[int(Level::SubArray)][int(Command::RD)];
}

// Assembly:
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
movups 0x1ad0(%rdi), %xmm0
movaps %xmm0, (%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x1ad0(%rdi)
movq 0x1ae0(%rdi), %rax
movq %rax, 0x10(%rsp)
leaq 0x3432(%rip), %rcx      # 0x11506c
movq %rcx, 0x1ae0(%rdi)
movq 0x1ae8(%rdi), %rcx
movq %rcx, 0x18(%rsp)
leaq 0x33e0(%rip), %rcx      # 0x115034
movq %rcx, 0x1ae8(%rdi)
testq %rax, %rax
je 0x111c6d
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
leaq 0x1ad0(%rbx), %rsi
addq $0x1af0, %rbx           # imm = 0x1AF0
movq %rbx, %rdi
callq 0x11572e
addq $0x20, %rsp
popq %rbx
retq
movq %rax, %rdi
callq 0x171a3
nop
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]ramulator/src/GDDR5.cpp
// Function: ramulator::GDDR5::init_rowopen()
void GDDR5::init_rowopen()
{
    // RD
    rowopen[int(Level::Bank)][int(Command::RD)] = [] (DRAM<GDDR5>* node, Command cmd, int id) {
        switch (int(node->state)) {
            case int(State::Closed): return false;
            case int(State::Opened): return true;
            default: assert(false);
        }};

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

// Assembly:
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
movups 0x18c0(%rdi), %xmm0
movaps %xmm0, (%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x18c0(%rdi)
movq 0x18d0(%rdi), %rax
movq %rax, 0x10(%rsp)
leaq 0x2160(%rip), %rcx      # 0x119020
movq %rcx, 0x18d0(%rdi)
movq 0x18d8(%rdi), %rcx
movq %rcx, 0x18(%rsp)
leaq 0x210e(%rip), %rcx      # 0x118fe8
movq %rcx, 0x18d8(%rdi)
testq %rax, %rax
je 0x116ef3
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
leaq 0x18c0(%rbx), %rsi
addq $0x18e0, %rbx           # imm = 0x18E0
movq %rbx, %rdi
callq 0x119532
addq $0x20, %rsp
popq %rbx
retq
movq %rax, %rdi
callq 0x171a3
nop
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]ramulator/src/HBM.cpp
// Function: ramulator::HBM::init_speed()
void HBM::init_speed()
{
    const static int RFC_TABLE[int(Speed::MAX)][int(Org::MAX)] = {
        {55, 80, 130}
    };
    const static int REFI1B_TABLE[int(Speed::MAX)][int(Org::MAX)] = {
        {64, 128, 256}
    };
    const static int XS_TABLE[int(Speed::MAX)][int(Org::MAX)] = {
        {60, 85, 135}
    };

    int speed = 0, density = 0;
    switch (speed_entry.rate) {
        case 1000: speed = 0; break;
        default: assert(false);
    };
    switch (org_entry.size >> 10){
        case 1: density = 0; break;
        case 2: density = 1; break;
        case 4: density = 2; break;
        default: assert(false);
    }
    speed_entry.nRFC = RFC_TABLE[speed][density];
    speed_entry.nREFI1B = REFI1B_TABLE[speed][density];
    speed_entry.nXS = XS_TABLE[speed][density];
}

// Assembly:
pushq %rax
cmpl $0x3e8, 0x3158(%rdi)    # imm = 0x3E8
jne 0x11a950
movl 0x30b8(%rdi), %eax
sarl $0xa, %eax
cmpl $0x1, %eax
je 0x11a919
cmpl $0x2, %eax
je 0x11a912
cmpl $0x4, %eax
jne 0x11a96f
movl $0x2, %eax
jmp 0x11a91b
movl $0x1, %eax
jmp 0x11a91b
xorl %eax, %eax
shll $0x2, %eax
leaq 0x3e10b(%rip), %rcx     # 0x158a30
movl (%rax,%rcx), %ecx
movl %ecx, 0x31b4(%rdi)
leaq 0x3e107(%rip), %rcx     # 0x158a3c
movl (%rax,%rcx), %ecx
movl %ecx, 0x31bc(%rdi)
leaq 0x3e103(%rip), %rcx     # 0x158a48
movl (%rax,%rcx), %eax
movl %eax, 0x31cc(%rdi)
popq %rax
retq
leaq 0x2fa42(%rip), %rdi     # 0x14a399
leaq 0x3de51(%rip), %rsi     # 0x1587af
leaq 0x3de56(%rip), %rcx     # 0x1587bb
movl $0x42, %edx
callq 0xb200
leaq 0x2fa23(%rip), %rdi     # 0x14a399
leaq 0x3de32(%rip), %rsi     # 0x1587af
leaq 0x3de37(%rip), %rcx     # 0x1587bb
movl $0x48, %edx
callq 0xb200
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]ramulator/src/HBM.cpp
// Function: ramulator::HBM::init_rowopen()
void HBM::init_rowopen()
{
    // RD
    rowopen[int(Level::Bank)][int(Command::RD)] = [] (DRAM<HBM>* node, Command cmd, int id) {
        switch (int(node->state)) {
            case int(State::Closed): return false;
            case int(State::Opened): return true;
            default: assert(false);
        }};

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

// Assembly:
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
movups 0x1ac8(%rdi), %xmm0
movaps %xmm0, (%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x1ac8(%rdi)
movq 0x1ad8(%rdi), %rax
movq %rax, 0x10(%rsp)
leaq 0x24bc(%rip), %rcx      # 0x11d172
movq %rcx, 0x1ad8(%rdi)
movq 0x1ae0(%rdi), %rcx
movq %rcx, 0x18(%rsp)
leaq 0x246a(%rip), %rcx      # 0x11d13a
movq %rcx, 0x1ae0(%rdi)
testq %rax, %rax
je 0x11ace9
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
leaq 0x1ac8(%rbx), %rsi
addq $0x1ae8, %rbx           # imm = 0x1AE8
movq %rbx, %rdi
callq 0x11d684
addq $0x20, %rsp
popq %rbx
retq
movq %rax, %rdi
callq 0x171a3
nop
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]ramulator/src/LPDDR3.cpp
// Function: ramulator::LPDDR3::init_speed()
void LPDDR3::init_speed()
{
    // 12Gb/16Gb RFCab/RFCpb TBD

    const static int RFCPB_TABLE[3][4] = {
        {40, 48, 56, 64},
        {60, 72, 84, 96},
        {60, 72, 84, 96}
    };

    const static int RFCAB_TABLE[3][4] = {
        {87, 104, 122, 139},
        {140, 168, 196, 224},
        {140, 168, 196, 224}
    };

    const static int XSR_TABLE[3][4] = {
        {94, 112, 131, 150},
        {147, 176, 206, 235},
        {147, 176, 206, 235}
    };

    int speed = 0, density = 0;
    switch (speed_entry.rate) {
        case 1333: speed = 0; break;
        case 1600: speed = 1; break;
        case 1866: speed = 2; break;
        case 2133: speed = 3; break;
        default: assert(false);
    };
    switch (org_entry.size >> 10){
        case 4: density = 0; break;
        case 6: density = 1; break;
        case 8: density = 2; break;
        default: assert(false && "12Gb/16Gb is still TBD");
    }
    speed_entry.nRFCpb = RFCPB_TABLE[density][speed];
    speed_entry.nRFCab = RFCAB_TABLE[density][speed];
    speed_entry.nXSR = XSR_TABLE[density][speed];
}

// Assembly:
pushq %rax
movl 0x2bb8(%rdi), %eax
cmpl $0x749, %eax            # imm = 0x749
jg 0x11ea6b
cmpl $0x535, %eax            # imm = 0x535
je 0x11ea84
cmpl $0x640, %eax            # imm = 0x640
jne 0x11eb15
movl $0x1, %eax
jmp 0x11ea8d
cmpl $0x74a, %eax            # imm = 0x74A
je 0x11ea88
cmpl $0x855, %eax            # imm = 0x855
jne 0x11eb15
movl $0x3, %eax
jmp 0x11ea8d
xorl %eax, %eax
jmp 0x11ea8d
movl $0x2, %eax
movl 0x29b0(%rdi), %ecx
sarl $0xa, %ecx
cmpl $0x4, %ecx
je 0x11eab3
cmpl $0x8, %ecx
je 0x11eaac
cmpl $0x6, %ecx
jne 0x11eaf6
movl $0x1, %ecx
jmp 0x11eab5
movl $0x2, %ecx
jmp 0x11eab5
xorl %ecx, %ecx
shll $0x4, %ecx
leaq 0x3a831(%rip), %rdx     # 0x1592f0
addq %rcx, %rdx
shll $0x2, %eax
movl (%rax,%rdx), %edx
movl %edx, 0x2c14(%rdi)
leaq 0x3a84b(%rip), %rdx     # 0x159320
addq %rcx, %rdx
movl (%rax,%rdx), %edx
movl %edx, 0x2c10(%rdi)
leaq 0x3a868(%rip), %rdx     # 0x159350
addq %rcx, %rdx
movl (%rax,%rdx), %eax
movl %eax, 0x2c28(%rdi)
popq %rax
retq
leaq 0x3a34e(%rip), %rdi     # 0x158e4b
leaq 0x3a313(%rip), %rsi     # 0x158e17
leaq 0x3a31b(%rip), %rcx     # 0x158e26
movl $0x59, %edx
callq 0xb200
leaq 0x2b87d(%rip), %rdi     # 0x14a399
leaq 0x3a2f4(%rip), %rsi     # 0x158e17
leaq 0x3a2fc(%rip), %rcx     # 0x158e26
movl $0x53, %edx
callq 0xb200
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]ramulator/src/LPDDR3.cpp
// Function: ramulator::LPDDR3::init_rowopen()
void LPDDR3::init_rowopen()
{
    // RD
    rowopen[int(Level::Bank)][int(Command::RD)] = [] (DRAM<LPDDR3>* node, Command cmd, int id) {
        switch (int(node->state)) {
            case int(State::Closed): return false;
            case int(State::Opened): return true;
            default: assert(false);
        }};

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

// Assembly:
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
movups 0x15e0(%rdi), %xmm0
movaps %xmm0, (%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x15e0(%rdi)
movq 0x15f0(%rdi), %rax
movq %rax, 0x10(%rsp)
leaq 0x25ec(%rip), %rcx      # 0x121448
movq %rcx, 0x15f0(%rdi)
movq 0x15f8(%rdi), %rcx
movq %rcx, 0x18(%rsp)
leaq 0x259a(%rip), %rcx      # 0x121410
movq %rcx, 0x15f8(%rdi)
testq %rax, %rax
je 0x11ee8f
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
leaq 0x15e0(%rbx), %rsi
addq $0x1600, %rbx           # imm = 0x1600
movq %rbx, %rdi
callq 0x12191a
addq $0x20, %rsp
popq %rbx
retq
movq %rax, %rdi
callq 0x171a3
nop
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]ramulator/src/LPDDR4.cpp
// Function: ramulator::LPDDR4::init_speed()
void LPDDR4::init_speed()
{
    // 12Gb/16Gb RFCab/RFCpb TBD
    // Numbers are in DRAM cycles
    const static int RFCPB_TABLE[int(Org::MAX)][int(Speed::MAX)] = {
        {48,  72,  96},
        {72, 108, 144},
        {72, 108, 144}
    };

    const static int RFCAB_TABLE[int(Org::MAX)][int(Speed::MAX)] = {
        {104, 156, 208},
        {144, 216, 288},
        {144, 216, 288}
    };

    const static int REFI_TABLE[int(RefreshMode::MAX)][int(Speed::MAX)] = {
        {3124, 4685, 6247},
        {1563, 2344, 3125},
        { 782, 1172, 1563}
    };

    const static int XSR_TABLE[int(Org::MAX)][int(Speed::MAX)] = {
        {110, 165, 220},
        {150, 225, 300},
        {150, 225, 300},
    };

    int speed = 0, density = 0;
    switch (speed_entry.rate) {
        case 1600: speed = 0; break;
        case 2400: speed = 1; break;
        case 3200: speed = 2; break;
        default: assert(false);
    };
    switch (org_entry.size >> 10){
        case 2: density = 0; break;
        case 3: density = 1; break;
        case 4: density = 2; break;
        default: assert(false && "12Gb/16Gb is still TBD");
    }
    speed_entry.nRFCpb = RFCPB_TABLE[density][speed];
    speed_entry.nRFCab = RFCAB_TABLE[density][speed];
    speed_entry.nREFI = REFI_TABLE[int(refresh_mode)][speed];
    speed_entry.nXSR = XSR_TABLE[density][speed];
}

// Assembly:
pushq %rax
movl 0x2a80(%rdi), %eax
cmpl $0x640, %eax            # imm = 0x640
je 0x122d0e
cmpl $0xc80, %eax            # imm = 0xC80
je 0x122d07
cmpl $0x960, %eax            # imm = 0x960
jne 0x122da7
movl $0x1, %eax
jmp 0x122d10
movl $0x2, %eax
jmp 0x122d10
xorl %eax, %eax
movl 0x28ec(%rdi), %ecx
sarl $0xa, %ecx
addl $-0x2, %ecx
cmpl $0x3, %ecx
jae 0x122d88
movl %ecx, %ecx
shlq $0x2, %rcx
leaq (%rcx,%rcx,2), %rcx
leaq 0x36d4e(%rip), %rdx     # 0x159a80
addq %rcx, %rdx
shll $0x2, %eax
movl (%rax,%rdx), %edx
movl %edx, 0x2ae0(%rdi)
leaq 0x36d68(%rip), %rdx     # 0x159ab0
addq %rcx, %rdx
movl (%rax,%rdx), %edx
movl %edx, 0x2adc(%rdi)
movslq 0x2908(%rdi), %rdx
leaq (%rdx,%rdx,2), %rdx
leaq 0x36d7a(%rip), %rsi     # 0x159ae0
leaq (%rsi,%rdx,4), %rdx
movl (%rax,%rdx), %edx
movl %edx, 0x2ae4(%rdi)
leaq 0x36d96(%rip), %rdx     # 0x159b10
addq %rcx, %rdx
movl (%rax,%rdx), %eax
movl %eax, 0x2af4(%rdi)
popq %rax
retq
leaq 0x360bc(%rip), %rdi     # 0x158e4b
leaq 0x3695e(%rip), %rsi     # 0x1596f4
leaq 0x36966(%rip), %rcx     # 0x159703
movl $0x5c, %edx
callq 0xb200
leaq 0x275eb(%rip), %rdi     # 0x14a399
leaq 0x3693f(%rip), %rsi     # 0x1596f4
leaq 0x36947(%rip), %rcx     # 0x159703
movl $0x56, %edx
callq 0xb200
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]ramulator/src/MemoryFactory.h
// Function: ramulator::MemoryFactory<ramulator::WideIO2>::extend_channel_width(ramulator::WideIO2*, int)
static void extend_channel_width(T* spec, int cacheline)
    {
        int channel_unit = spec->prefetch_size * spec->channel_width / 8;
        int gang_number = cacheline / channel_unit;
        
        assert(gang_number >= 1 && 
            "cacheline size must be greater or equal to minimum channel width");
        
        assert(cacheline == gang_number * channel_unit &&
            "cacheline size must be a multiple of minimum channel width");
        
        spec->channel_width *= gang_number;
    }

// Assembly:
pushq %rax
movl 0x28b8(%rdi), %ecx
movl 0x28b4(%rdi), %eax
imull %ecx, %eax
leal 0x7(%rax), %r8d
testl %eax, %eax
cmovnsl %eax, %r8d
sarl $0x3, %r8d
movl %esi, %eax
cltd
idivl %r8d
testl %eax, %eax
jle 0x12751c
imull %eax, %r8d
cmpl %esi, %r8d
jne 0x12753b
imull %ecx, %eax
movl %eax, 0x28b8(%rdi)
popq %rax
retq
leaq 0x32c0c(%rip), %rdi     # 0x15a12f
leaq 0x32c5c(%rip), %rsi     # 0x15a186
leaq 0x32c69(%rip), %rcx     # 0x15a19a
movl $0x1c, %edx
callq 0xb200
leaq 0x32cca(%rip), %rdi     # 0x15a20c
leaq 0x32c3d(%rip), %rsi     # 0x15a186
leaq 0x32c4a(%rip), %rcx     # 0x15a19a
movl $0x1f, %edx
callq 0xb200
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]ramulator/src/PCM.cpp
// Function: ramulator::PCM::init_speed()
void PCM::init_speed()
{
    // nRRD, nFAW
    int page = (org_entry.dq * org_entry.count[int(Level::Column)]) >> 13;
    switch (speed_entry.rate) {
        case 800:  speed_entry.nFAW = (page==1) ? 16 : 20; break;
        default: assert(false);
    }

    // nRFC, nXS
    int chip = org_entry.size;
    switch (speed_entry.rate) {
        case 800:  speed_entry.nRFC = 0; break;
        default: assert(false);
    }
    switch (speed_entry.rate) {
        case 800:  speed_entry.nXS  = (chip==512) ? 40  : (chip==1<<10) ? 48  : (chip==1<<11) ? 68  : (chip==1<<12) ? 108 : 144; break;
        default: assert(false);
    }
}

// Assembly:
cmpl $0x320, 0x27c0(%rdi)    # imm = 0x320
jne 0x12811c
movl 0x2724(%rdi), %eax
movl 0x273c(%rdi), %ecx
imull 0x2728(%rdi), %ecx
andl $0xffffe000, %ecx       # imm = 0xFFFFE000
xorl %edx, %edx
cmpl $0x2000, %ecx           # imm = 0x2000
setne %dl
leal 0x10(,%rdx,4), %ecx
movl %ecx, 0x2810(%rdi)
movl $0x0, 0x2814(%rdi)
cmpl $0x200, %eax            # imm = 0x200
je 0x1280fc
cmpl $0x400, %eax            # imm = 0x400
je 0x1280f5
cmpl $0x800, %eax            # imm = 0x800
jne 0x128103
movl $0x44, %eax
jmp 0x128115
movl $0x30, %eax
jmp 0x128115
movl $0x28, %eax
jmp 0x128115
cmpl $0x1000, %eax           # imm = 0x1000
movl $0x6c, %ecx
movl $0x90, %eax
cmovel %ecx, %eax
movl %eax, 0x282c(%rdi)
retq
pushq %rax
leaq 0x22275(%rip), %rdi     # 0x14a399
leaq 0x322ef(%rip), %rsi     # 0x15a41a
leaq 0x322f4(%rip), %rcx     # 0x15a426
movl $0x44, %edx
callq 0xb200
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]ramulator/src/Processor.cpp
// Function: ramulator::Processor::receive(ramulator::Request&)
void Processor::receive(Request& req) {
  if (!no_shared_cache) {
    llc.callback(req);
  } else if (!cores[0]->no_core_caches) {
    // Assume all cores have caches or don't have caches
    // at the same time.
    for (unsigned int i = 0 ; i < cores.size() ; ++i) {
      Core* core = cores[i].get();
      core->caches[0]->callback(req);
    }
  }
  for (unsigned int i = 0 ; i < cores.size() ; ++i) {
    Core* core = cores[i].get();
    core->receive(req);
  }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
cmpb $0x0, 0x3a(%rdi)
je 0x12c3fa
movq (%r14), %rax
movq (%rax), %rcx
cmpb $0x0, 0x58(%rcx)
jne 0x12c409
cmpq %rax, 0x8(%r14)
je 0x12c409
movl $0x1, %ebp
xorl %ecx, %ecx
movq (%rax,%rcx,8), %rax
movq 0x80(%rax), %rax
movq (%rax), %rdi
movq %rbx, %rsi
callq 0x105114
movl %ebp, %ecx
movq (%r14), %rax
movq 0x8(%r14), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
incl %ebp
cmpq %rcx, %rdx
ja 0x12c3cb
jmp 0x12c409
leaq 0x60(%r14), %rdi
movq %rbx, %rsi
callq 0x105114
movq (%r14), %rax
cmpq %rax, 0x8(%r14)
je 0x12c439
movl $0x1, %ebp
xorl %ecx, %ecx
movq (%rax,%rcx,8), %rdi
movq %rbx, %rsi
callq 0x12caf2
movl %ebp, %ecx
movq (%r14), %rax
movq 0x8(%r14), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
incl %ebp
cmpq %rcx, %rdx
ja 0x12c416
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]ramulator/src/Processor.cpp
// Function: ramulator::Processor::tick()
void Processor::tick() {
  cpu_cycles++;

  if((int(cpu_cycles.value()) % 50000000) == 0)
      printf("CPU heartbeat, cycles: %d \n", (int(cpu_cycles.value())));

  if (!(no_core_caches && no_shared_cache)) {
    cachesys->tick();
  }
  for (unsigned int i = 0 ; i < cores.size() ; ++i) {
    Core* core = cores[i].get();
    core->tick();
  }
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movsd 0x7c0(%rdi), %xmm0
addsd 0x1dc64(%rip), %xmm0    # 0x14a0b8
movsd %xmm0, 0x7c0(%rdi)
cvttsd2si %xmm0, %esi
imull $0x22e90e21, %esi, %eax # imm = 0x22E90E21
addl $0x1500, %eax           # imm = 0x1500
rorl $0x7, %eax
cmpl $0x54, %eax
ja 0x12c481
leaq 0x2e765(%rip), %rdi     # 0x15abdf
xorl %eax, %eax
callq 0xb060
cmpb $0x1, 0x39(%rbx)
jne 0x12c48d
cmpb $0x0, 0x3a(%rbx)
jne 0x12c496
movq 0x50(%rbx), %rdi
callq 0x10539e
movq (%rbx), %rax
cmpq %rax, 0x8(%rbx)
je 0x12c4c6
movl $0x1, %ebp
xorl %ecx, %ecx
movq (%rax,%rcx,8), %rdi
callq 0x12c4ce
movl %ebp, %ecx
movq (%rbx), %rax
movq 0x8(%rbx), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
incl %ebp
cmpq %rcx, %rdx
ja 0x12c4a6
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]ramulator/src/Processor.cpp
// Function: ramulator::Core::receive(ramulator::Request&)
void Core::receive(Request& req)
{
    window.set_ready(req.addr, ~(l1_blocksz - 1l));
    if (req.arrive != -1 && req.depart > last) {
      memory_access_cycles += (req.depart - max(last, req.arrive));
      last = req.depart;
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
addq $0x410, %rdi            # imm = 0x410
movq 0x8(%rsi), %rsi
xorl %edx, %edx
subl 0x64(%rbx), %edx
callq 0x12e286
movq 0x30(%r14), %rcx
cmpq $-0x1, %rcx
je 0x12cb54
movq 0x38(%r14), %rax
movq 0x480(%rbx), %rdx
cmpq %rdx, %rax
jle 0x12cb54
cmpq %rcx, %rdx
cmovgq %rdx, %rcx
movq %rax, %rdx
subq %rcx, %rdx
cvtsi2sd %rdx, %xmm0
addsd 0x500(%rbx), %xmm0
movsd %xmm0, 0x500(%rbx)
movq %rax, 0x480(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]ramulator/src/Processor.cpp
// Function: ramulator::Processor::finished()
bool Processor::finished() {
  if (early_exit) {
    for (unsigned int i = 0 ; i < cores.size(); ++i) {
      if (cores[i]->finished()) {
        for (unsigned int j = 0 ; j < cores.size() ; ++j) {
          ipc += cores[j]->calc_ipc();
        }
        return true;
      }
    }
    return false;
  } else {
    for (unsigned int i = 0 ; i < cores.size(); ++i) {
      if (!cores[i]->finished()) {
        return false;
      }
      if (ipcs[i] < 0) {
        ipcs[i] = cores[i]->calc_ipc();
        ipc += ipcs[i];
      }
    }
    return true;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rax
movq 0x8(%rdi), %rcx
cmpb $0x0, 0x38(%rdi)
je 0x12cbb1
subq %rax, %rcx
je 0x12cbaa
sarq $0x3, %rcx
movl $0x1, %edx
xorl %esi, %esi
movq (%rax,%rsi,8), %rsi
cmpb $0x0, 0x47c(%rsi)
jne 0x12cba1
cmpl $0x0, 0x418(%rsi)
je 0x12cc5d
movl %edx, %esi
incl %edx
cmpq %rsi, %rcx
ja 0x12cb87
xorl %ebp, %ebp
jmp 0x12ccbd
cmpq %rax, %rcx
je 0x12ccba
movl $0x1, %r15d
xorpd %xmm0, %xmm0
leaq 0x2e1d4(%rip), %r14     # 0x15ad9f
xorl %r12d, %r12d
movq (%rax,%r12,8), %r13
cmpl $0x0, 0x418(%r13)
setne %bpl
orb 0x47c(%r13), %bpl
jne 0x12cc57
movq 0x18(%rbx), %rdx
ucomisd (%rdx,%r12,8), %xmm0
jbe 0x12cc3e
movl 0x10(%r13), %esi
movq (%r13), %rcx
movq 0x8(%r13), %rdx
movq %r14, %rdi
xorl %eax, %eax
callq 0xb060
xorps %xmm0, %xmm0
cvtsi2sdq 0x8(%r13), %xmm0
xorps %xmm1, %xmm1
cvtsi2sdq (%r13), %xmm1
divsd %xmm1, %xmm0
movq 0x18(%rbx), %rax
movsd %xmm0, (%rax,%r12,8)
addsd 0x30(%rbx), %xmm0
movsd %xmm0, 0x30(%rbx)
xorpd %xmm0, %xmm0
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
movl %r15d, %r12d
movq %rcx, %rdx
subq %rax, %rdx
sarq $0x3, %rdx
incl %r15d
cmpq %r12, %rdx
ja 0x12cbce
xorb $0x1, %bpl
jmp 0x12ccbd
movl $0x1, %ebp
leaq 0x2e136(%rip), %r14     # 0x15ad9f
xorl %ecx, %ecx
movq (%rax,%rcx,8), %r15
movl 0x10(%r15), %esi
movq (%r15), %rcx
movq 0x8(%r15), %rdx
movq %r14, %rdi
xorl %eax, %eax
callq 0xb060
xorps %xmm0, %xmm0
cvtsi2sdq 0x8(%r15), %xmm0
xorps %xmm1, %xmm1
cvtsi2sdq (%r15), %xmm1
divsd %xmm1, %xmm0
addsd 0x30(%rbx), %xmm0
movsd %xmm0, 0x30(%rbx)
movq (%rbx), %rax
movq 0x8(%rbx), %rdx
movl %ebp, %ecx
subq %rax, %rdx
sarq $0x3, %rdx
incl %ebp
cmpq %rcx, %rdx
ja 0x12cc6b
movb $0x1, %bpl
movl %ebp, %eax
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/Processor.cpp
// Function: ramulator::Processor::has_reached_limit()
bool Processor::has_reached_limit() {
  for (unsigned int i = 0 ; i < cores.size() ; ++i) {
    if (!cores[i]->has_reached_limit()) {
      return false;
    }
  }
  return true;
}

// Assembly:
movq (%rdi), %rcx
movq 0x8(%rdi), %rdx
subq %rcx, %rdx
je 0x12cd41
sarq $0x3, %rdx
movl $0x1, %esi
xorl %edi, %edi
movq (%rcx,%rdi,8), %rax
movb 0x1d8(%rax), %al
cmpb $0x1, %al
jne 0x12cd40
movl %esi, %edi
incl %esi
cmpq %rdi, %rdx
ja 0x12cd29
retq
movb $0x1, %al
retq
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]ramulator/src/Processor.cpp
// Function: ramulator::Processor::get_insts()
long Processor::get_insts() {
    long insts_total = 0;
    for (unsigned int i = 0 ; i < cores.size(); i++) {
        insts_total += cores[i]->get_insts();
    }

    return insts_total;
}

// Assembly:
movq (%rdi), %rcx
movq 0x8(%rdi), %rdx
subq %rcx, %rdx
je 0x12cd7b
sarq $0x3, %rdx
xorl %esi, %esi
xorl %eax, %eax
movq (%rcx,%rsi,8), %rdi
cvttsd2si 0x598(%rdi), %rdi
addq %rdi, %rax
incq %rsi
movl %esi, %edi
cmpq %rdi, %rdx
ja 0x12cd60
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]ramulator/src/Processor.cpp
// Function: ramulator::Window::retire()
long Window::retire()
{
    assert(load <= depth);

    if (load == 0) return 0;

    int retired = 0;
    while (load > 0 && retired < ipc) {
        if (!ready_list.at(tail))
            break;

        tail = (tail + 1) % depth;
        load--;
        retired++;
    }

    return retired;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl 0x8(%rdi), %ecx
cmpl 0x4(%rdi), %ecx
jg 0x12e1c4
xorl %eax, %eax
testl %ecx, %ecx
je 0x12e1bf
testl %ecx, %ecx
jle 0x12e1bf
movq %rdi, %rbx
cmpl $0x0, (%rdi)
jle 0x12e1bf
leaq 0x18(%rbx), %r14
movl 0x10(%rbx), %edx
xorl %ebp, %ebp
movslq %edx, %rsi
movq %r14, %rdi
callq 0x12ed04
testq %rdx, (%rax)
je 0x12e1bd
movl 0x10(%rbx), %eax
incl %eax
cltd
idivl 0x4(%rbx)
movl %edx, 0x10(%rbx)
movl (%rbx), %eax
movl 0x8(%rbx), %ecx
leal -0x1(%rcx), %esi
movl %esi, 0x8(%rbx)
incl %ebp
cmpl $0x2, %ecx
jl 0x12e1bd
cmpl %eax, %ebp
jl 0x12e18b
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x2cca0(%rip), %rdi     # 0x15ae6b
leaq 0x2c942(%rip), %rsi     # 0x15ab14
leaq 0x2cccb(%rip), %rcx     # 0x15aea4
movl $0x159, %edx            # imm = 0x159
callq 0xb200
nop
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]ramulator/src/Processor.cpp
// Function: ramulator::Window::insert(bool, long)
void Window::insert(bool ready, long addr)
{
    assert(load <= depth);

    ready_list.at(head) = ready;
    addr_list.at(head) = addr;

    head = (head + 1) % depth;
    load++;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl 0x8(%rdi), %eax
cmpl 0x4(%rdi), %eax
jg 0x12e250
movq %rdx, %r14
movl %esi, %ebp
movq %rdi, %rbx
addq $0x18, %rdi
movslq 0xc(%rbx), %rsi
callq 0x12ed04
testb %bpl, %bpl
je 0x12e219
orq (%rax), %rdx
jmp 0x12e21f
notq %rdx
andq (%rax), %rdx
movq %rdx, (%rax)
movslq 0xc(%rbx), %rsi
movq 0x40(%rbx), %rax
movq 0x48(%rbx), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq %rsi, %rdx
jbe 0x12e26f
movq %r14, (%rax,%rsi,8)
leal 0x1(%rsi), %eax
cltd
idivl 0x4(%rbx)
movl %edx, 0xc(%rbx)
incl 0x8(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x2cc14(%rip), %rdi     # 0x15ae6b
leaq 0x2c8b6(%rip), %rsi     # 0x15ab14
leaq 0x2cc14(%rip), %rcx     # 0x15ae79
movl $0x14d, %edx            # imm = 0x14D
callq 0xb200
leaq 0x2cd5a(%rip), %rdi     # 0x15afd0
xorl %eax, %eax
callq 0xb3f0
nop
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]ramulator/src/Processor.cpp
// Function: ramulator::Window::set_ready(long, int)
void Window::set_ready(long addr, int mask)
{
    if (load == 0) return;

    for (int i = 0; i < load; i++) {
        int index = (tail + i) % depth;
        if ((addr_list.at(index) & mask) != (addr & mask))
            continue;
        ready_list.at(index) = true;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl 0x8(%rdi), %ecx
testl %ecx, %ecx
jle 0x12e2e7
movq %rsi, %rbx
movq %rdi, %r14
movslq %edx, %r12
leaq 0x18(%rdi), %r15
xorl %ebp, %ebp
movl 0x10(%r14), %eax
addl %ebp, %eax
cltd
idivl 0x4(%r14)
movslq %edx, %rsi
movq 0x40(%r14), %rax
movq 0x48(%r14), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq %rsi, %rdx
jbe 0x12e2f0
movq (%rax,%rsi,8), %rax
xorq %rbx, %rax
testq %r12, %rax
jne 0x12e2e1
movq %r15, %rdi
callq 0x12ed04
orq %rdx, (%rax)
movl 0x8(%r14), %ecx
incl %ebp
cmpl %ecx, %ebp
jl 0x12e2a4
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2ccd9(%rip), %rdi     # 0x15afd0
xorl %eax, %eax
callq 0xb3f0
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]ramulator/src/Processor.cpp
// Function: ramulator::Trace::get_dramtrace_request(long&, ramulator::Request::Type&)
bool Trace::get_dramtrace_request(long& req_addr, Request::Type& req_type)
{
    string line;
    getline(file, line);
    if (file.eof()) {
        return false;
    }
    size_t pos;
    req_addr = std::stoul(line, &pos, 16);

    pos = line.find_first_not_of(' ', pos+1);

    if (pos == string::npos || line.substr(pos)[0] == 'R')
        req_type = Request::Type::READ;
    else if (line.substr(pos)[0] == 'W')
        req_type = Request::Type::WRITE;
    else assert(false);
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdx, 0x30(%rsp)
movq %rsi, %r14
movq %rdi, %r15
leaq 0x20(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq $0x0, -0x8(%rbp)
movb $0x0, (%rbp)
movq 0x8(%rdi), %rax
addq $0x8, %r15
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0xb2c0
movsbl %al, %edx
leaq 0x10(%rsp), %rsi
movq %r15, %rdi
callq 0xb540
movq (%r15), %rax
movq -0x18(%rax), %rax
movl 0x20(%r15,%rax), %ebx
testb $0x2, %bl
jne 0x12e529
movq 0x10(%rsp), %r12
callq 0xb050
movq %rax, %r15
movl (%rax), %eax
movl %eax, 0xc(%rsp)
movl $0x0, (%r15)
leaq 0x38(%rsp), %r13
movq %r12, %rdi
movq %r13, %rsi
movl $0x10, %edx
callq 0xb120
movq (%r13), %rdx
subq %r12, %rdx
je 0x12e555
movl (%r15), %ecx
cmpl $0x22, %ecx
je 0x12e561
testl %ecx, %ecx
jne 0x12e47f
movl 0xc(%rsp), %ecx
movl %ecx, (%r15)
movq %rax, (%r14)
incq %rdx
leaq 0x10(%rsp), %rdi
movl $0x20, %esi
callq 0xb2a0
xorl %r15d, %r15d
cmpq $-0x1, %rax
je 0x12e521
movq %rax, %r14
leaq 0x38(%rsp), %rdi
leaq 0x10(%rsp), %rsi
movq %rax, %rdx
movq $-0x1, %rcx
callq 0xb310
leaq 0x48(%rsp), %r12
movq -0x10(%r12), %rdi
movb (%rdi), %r13b
cmpq %r12, %rdi
je 0x12e4dc
movq 0x48(%rsp), %rsi
incq %rsi
callq 0xb2f0
cmpb $0x52, %r13b
je 0x12e521
leaq 0x38(%rsp), %rdi
leaq 0x10(%rsp), %rsi
movq %r14, %rdx
movq $-0x1, %rcx
callq 0xb310
movq 0x38(%rsp), %rdi
movb (%rdi), %r14b
cmpq %r12, %rdi
je 0x12e515
movq 0x48(%rsp), %rsi
incq %rsi
callq 0xb2f0
movl $0x1, %r15d
cmpb $0x57, %r14b
jne 0x12e56d
movq 0x30(%rsp), %rax
movl %r15d, (%rax)
movq 0x10(%rsp), %rdi
cmpq %rbp, %rdi
je 0x12e540
movq 0x20(%rsp), %rsi
incq %rsi
callq 0xb2f0
testb $0x2, %bl
sete %al
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2ca1e(%rip), %rdi     # 0x15af7a
callq 0xb1f0
leaq 0x2ca12(%rip), %rdi     # 0x15af7a
callq 0xb3d0
leaq 0x1be25(%rip), %rdi     # 0x14a399
leaq 0x2c599(%rip), %rsi     # 0x15ab14
leaq 0x2c9a3(%rip), %rcx     # 0x15af25
movl $0x1d7, %edx            # imm = 0x1D7
callq 0xb200
jmp 0x12e5a2
jmp 0x12e5a2
movq %rax, %rbx
cmpl $0x0, (%r15)
jne 0x12e5a5
movl 0xc(%rsp), %eax
movl %eax, (%r15)
jmp 0x12e5a5
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %rbp, %rdi
je 0x12e5bc
movq 0x20(%rsp), %rsi
incq %rsi
callq 0xb2f0
movq %rbx, %rdi
callq 0xb510
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]ramulator/src/Config.h
// Function: ramulator::Config::has_core_caches() const
bool has_core_caches() const {
      if (options.find("cache") != options.end()) {
        const std::string& cache_option = (options.find("cache"))->second;
        return (cache_option == "all" || cache_option == "L1L2");
      } else {
        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 0x2c867(%rip), %rsi     # 0x15af6b
leaq 0x2c865(%rip), %rdx     # 0x15af70
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 0x12e740
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xb2f0
cmpq %r12, %r14
je 0x12e7b4
leaq 0x8(%rsp), %rdi
movq %r15, (%rdi)
leaq 0x2c817(%rip), %rsi     # 0x15af6b
leaq 0x2c815(%rip), %rdx     # 0x15af70
callq 0x175a0
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x1711a
movq %rax, %rbx
addq $0x40, %rbx
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x12e78b
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xb2f0
leaq 0x2c7df(%rip), %rsi     # 0x15af71
movq %rbx, %rdi
callq 0xb100
testl %eax, %eax
je 0x12e7b8
leaq 0x2c7d0(%rip), %rsi     # 0x15af75
movq %rbx, %rdi
callq 0xb100
testl %eax, %eax
sete %al
jmp 0x12e7ba
xorl %eax, %eax
jmp 0x12e7ba
movb $0x1, %al
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x12e7ca
jmp 0x12e7e6
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x12e7e9
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xb2f0
jmp 0x12e7e9
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::has_l3_cache() const
bool has_l3_cache() const {
      if (options.find("cache") != options.end()) {
        const std::string& cache_option = (options.find("cache"))->second;
        return (cache_option == "all") || (cache_option == "L3");
      } else {
        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 0x2c75b(%rip), %rsi     # 0x15af6b
leaq 0x2c759(%rip), %rdx     # 0x15af70
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 0x12e84c
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xb2f0
cmpq %r12, %r14
je 0x12e8c0
leaq 0x8(%rsp), %rdi
movq %r15, (%rdi)
leaq 0x2c70b(%rip), %rsi     # 0x15af6b
leaq 0x2c709(%rip), %rdx     # 0x15af70
callq 0x175a0
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x1711a
movq %rax, %rbx
addq $0x40, %rbx
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x12e897
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xb2f0
leaq 0x2c6d3(%rip), %rsi     # 0x15af71
movq %rbx, %rdi
callq 0xb100
testl %eax, %eax
je 0x12e8c4
leaq 0x26b82(%rip), %rsi     # 0x155433
movq %rbx, %rdi
callq 0xb100
testl %eax, %eax
sete %al
jmp 0x12e8c6
xorl %eax, %eax
jmp 0x12e8c6
movb $0x1, %al
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x12e8d6
jmp 0x12e8f2
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x12e8f5
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xb2f0
jmp 0x12e8f5
movq %rax, %rbx
movq %rbx, %rdi
callq 0xb510
nop