LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/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 0x17c9fc(%rip), %r14    # 0x1a3f98
leaq 0x127331(%rip), %rsi    # 0x14e8d4
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 0x27764
leaq 0x127333(%rip), %rbx    # 0x14e92d
leaq 0x1272ea(%rip), %r15    # 0x14e8eb
movq 0x40(%rax), %r12
movq %rax, (%rsp)
addq $0x30, %rax
movq %rax, 0x10(%rsp)
cmpq %rax, %r12
je 0x27750
movq (%rsp), %rax
movslq 0x20(%rax), %rbp
shlq $0x5, %rbp
addq 0x17c94a(%rip), %rbp    # 0x1a3f78
movq (%rbp), %rsi
movq 0x8(%rbp), %rdx
movq %r14, %rdi
callq 0xb340
movq %rax, %r13
movl $0x1, %edx
movq %rax, %rdi
leaq 0x1272af(%rip), %rsi    # 0x14e8ff
callq 0xb340
movl 0x20(%r12), %esi
movq %r13, %rdi
callq 0xb210
movl $0x5, %edx
movq %rax, %rdi
leaq 0x127274(%rip), %rsi    # 0x14e8e5
callq 0xb340
movl $0x10, %edx
movq %r14, %rdi
leaq 0x12726b(%rip), %rsi    # 0x14e8f0
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), %rdi
movq 0x30(%r12), %rdx
leaq 0x4(%rdi), %rsi
cmpq %rdx, %rsi
je 0x276c4
subq %rsi, %rdx
callq 0xb480
movq 0x28(%r12), %r13
movq 0x30(%r12), %rax
addq $-0x4, %rax
movq %rax, 0x30(%r12)
cmpq %rax, %r13
je 0x27713
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 0x276dc
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 0x2762e
movq (%rsp), %rdi
callq 0xb230
cmpq 0x8(%rsp), %rax
jne 0x27601
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/CMU-SAFARI[P]ramulator/src/Refresh.h
// Function: ramulator::Refresh<ramulator::ALDRAM>::tick_ref()
void tick_ref() {
    clk++;

    int refresh_interval = ctrl->channel->spec->speed_entry.nREFI;

    // Time to schedule a refresh
    if ((clk - refreshed) >= refresh_interval) {
      inject_refresh(true);
      // ALDRAM: update timing parameters based on temperatures
      ALDRAM::Temp current_temperature = ALDRAM::Temp::COLD;
      ctrl->update_temp(current_temperature);
    }
  }

// Assembly:
movq 0x8(%rdi), %rax
movq 0x10(%rdi), %rcx
incq %rcx
movq %rcx, 0x10(%rdi)
movq 0x1098(%rax), %rax
movq 0x390(%rax), %rax
movslq 0x33e4(%rax), %rax
subq 0x18(%rdi), %rcx
cmpq %rax, %rcx
jge 0xefa16
retq
pushq %rbx
movq %rdi, %rbx
movl $0x1, %esi
callq 0xf00a0
movq 0x8(%rbx), %rdi
xorl %esi, %esi
popq %rbx
jmp 0x1097ae
// File: /workspace/github_cpp_makefile_star2_O1/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 0x291d6
cmpq %r15, %r14
je 0x29204
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 0x29212
addq $0x8, %r14
jmp 0x291ab
cmpq %r15, %r14
je 0x29204
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 0x29212
addq $0x8, %r14
jmp 0x291d6
movq 0x10(%rbx), %rax
movq %rax, 0x18(%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 %r12
pushq %rbx
subq $0xa0, %rsp
movl %r8d, %ebp
movl %ecx, %r14d
movl %edx, %r15d
movq %rsi, %rbx
pxor %xmm0, %xmm0
movq %rsp, %r12
movdqa %xmm0, (%r12)
movq $0x0, 0x10(%r12)
movl $0x14, %edi
callq 0xb2e0
movq %rax, (%r12)
movq %rax, 0x8(%r12)
leaq 0x14(%rax), %rcx
movq %rcx, 0x10(%r12)
pcmpeqd %xmm0, %xmm0
movdqu %xmm0, (%rax)
movl $0xffffffff, 0x10(%rax) # imm = 0xFFFFFFFF
movq %rcx, 0x8(%r12)
movq 0x1098(%rbx), %rcx
movl 0x39c(%rcx), %ecx
movl %ecx, (%rax)
movl %r15d, 0x4(%rax)
movl %r14d, 0x8(%rax)
movl %ebp, 0xc(%rax)
leaq 0x20(%rsp), %rcx
pxor %xmm0, %xmm0
movdqa %xmm0, 0x10(%rcx)
movdqa %xmm0, (%rcx)
leaq 0x40(%rsp), %rdi
movq %r12, %rsi
movl $0x2, %edx
xorl %r8d, %r8d
callq 0x293ae
movq 0x30(%rsp), %rax
testq %rax, %rax
je 0x292cd
leaq 0x20(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
leaq 0x40(%rsp), %rsi
movq %rbx, %rdi
callq 0x29416
testb %al, %al
je 0x2933a
movq 0x90(%rsp), %rax
testq %rax, %rax
je 0x292fd
leaq 0x80(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x29314
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0xb2f0
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x2932a
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0xb2f0
addq $0xa0, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1256b1(%rip), %rdi    # 0x14e9f2
leaq 0x1256ae(%rip), %rsi    # 0x14e9f6
leaq 0x1256b5(%rip), %rcx    # 0x14ea04
movl $0x6b, %edx
callq 0xb200
jmp 0x293a6
jmp 0x293a6
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x25bb6
jmp 0x29388
movq %rax, %rbx
movq 0x30(%rsp), %rax
testq %rax, %rax
je 0x29388
leaq 0x20(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x2939e
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0xb2f0
movq %rbx, %rdi
callq 0xb510
movq %rax, %rdi
callq 0x1718f
// File: /workspace/github_cpp_makefile_star2_O1/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 $0x78, %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 0x29565
movq %rsi, %rbx
movq %rdi, %r14
addq %rdi, %r15
movq 0x1090(%rdi), %rax
movq %rax, 0x30(%rsi)
movq %r15, %rdi
callq 0x2aaac
movq %rax, %rdi
movq %r15, %rsi
callq 0xb080
incq 0x10(%r15)
movl 0x2c(%rbx), %r15d
testl %r15d, %r15d
je 0x29491
xorl %r12d, %r12d
jmp 0x294f8
movq 0x10e0(%r14), %rax
movq %rax, 0x8(%rsp)
movups (%rbx), %xmm0
leaq 0x20(%rsp), %r12
movaps %xmm0, -0x10(%r12)
leaq 0x10(%rbx), %rsi
movq %r12, %rdi
callq 0x24b6e
movq 0x38(%rbx), %rax
movq %rax, 0x28(%r12)
movups 0x28(%rbx), %xmm0
movups %xmm0, 0x18(%r12)
leaq 0x50(%rsp), %rdi
leaq 0x40(%rbx), %rsi
callq 0x295b4
leaq 0x10e0(%r14), %r12
leaq 0x10(%rsp), %rdx
movq 0x8(%rsp), %rdi
movq %r12, %rsi
callq 0x29619
cmpq %r12, %rax
setne %r12b
testl %r15d, %r15d
jne 0x2952d
movq 0x60(%rsp), %rax
testq %rax, %rax
je 0x29516
leaq 0x50(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x2952d
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0xb2f0
testb %r12b, %r12b
je 0x29565
movq 0x1090(%r14), %rax
incq %rax
movq %rax, 0x38(%rbx)
leaq 0x1140(%r14), %rdi
movq %rbx, %rsi
callq 0x290d6
movq 0x10c8(%r14), %rsi
addq $0x10c0, %r14           # imm = 0x10C0
movq %r14, %rdi
callq 0x29984
cmpl %ebp, %r13d
setne %al
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rdi
callq 0x1718f
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x2990c
jmp 0x295ab
movq %rax, %rbx
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x295ab
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0xb2f0
movq %rbx, %rdi
callq 0xb510
nop
// File: /workspace/github_cpp_makefile_star2_O1/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, %rax
shlq $0x5, %rax
cmpq $0x0, 0x10(%rdi,%rax)
je 0x2a1bc
addq %rax, %rdi
movq %r14, 0x8(%rsp)
movl %r15d, 0x4(%rsp)
cmpq $0x0, 0x10(%rdi)
je 0x2a202
leaq 0x8(%rsp), %rsi
leaq 0x4(%rsp), %rdx
callq *0x18(%rdi)
movl 0x398(%r14), %eax
movq 0x390(%r14), %rcx
cmpl 0x180(%rcx,%r12,4), %eax
je 0x2a1f5
movq 0x3b0(%r14), %rax
cmpq %rax, 0x3b8(%r14)
je 0x2a1f5
movslq %r15d, %rcx
movq (%rax,%rcx,8), %rdi
movl %ebp, %esi
movq %rbx, %rdx
callq 0x2a162
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
callq 0xb160
nop
// File: /workspace/github_cpp_makefile_star2_O1/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
shlq $0x5, %r8
movslq 0x398(%rsi), %rcx
movl 0x4(%rdx,%rcx,4), %ecx
movq 0x880(%rsi), %rdi
cmpq $0x0, 0x10(%rdi,%r8)
jne 0x2aaa1
testl %ecx, %ecx
js 0x2aa9e
movq 0x3b0(%rsi), %rdi
cmpq %rdi, 0x3b8(%rsi)
je 0x2aa9e
movq (%rdi,%rcx,8), %rsi
jmp 0x2aa6a
xorl %eax, %eax
retq
addq %r8, %rdi
movl %eax, %edx
jmp 0x24a6e
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x123572(%rip), %rsi    # 0x14efe2
leaq 0x123575(%rip), %rdx    # 0x14efec
leaq 0x8(%rsp), %rdi
callq 0x17586
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x17106
movq %rax, %r14
leaq 0x8(%rbx), %r12
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x2baac
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xb2f0
cmpq %r12, %r14
je 0x2bb0a
leaq 0x8(%rsp), %rdi
movq %r15, (%rdi)
leaq 0x123522(%rip), %rsi    # 0x14efe2
leaq 0x123525(%rip), %rdx    # 0x14efec
callq 0x17586
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x17106
addq $0x40, %rax
leaq 0x123509(%rip), %rsi    # 0x14efed
movq %rax, %rdi
callq 0xb100
testl %eax, %eax
setne %bl
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x2bb0c
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xb2f0
jmp 0x2bb0c
movb $0x1, %bl
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x2bb1e
jmp 0x2bb3a
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x2bb3d
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xb2f0
jmp 0x2bb3d
movq %rax, %rbx
movq %rbx, %rdi
callq 0xb510
nop
// File: /workspace/github_cpp_makefile_star2_O1/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
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
leaq 0x21ea(%rip), %rcx      # 0x10475e
movq %rcx, 0x18(%rsp)
leaq 0x2260(%rip), %rdx      # 0x1047e0
movq %rdx, 0x10(%rsp)
movups 0xcc0(%rdi), %xmm1
movaps %xmm1, (%rsp)
movups %xmm0, 0xcc0(%rdi)
movq 0xcd0(%rdi), %rax
movq %rax, 0x10(%rsp)
movq %rdx, 0xcd0(%rdi)
movq 0xcd8(%rdi), %rdx
movq %rdx, 0x18(%rsp)
movq %rcx, 0xcd8(%rdi)
testq %rax, %rax
je 0x1025cf
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
leaq 0xcc0(%rbx), %rsi
addq $0xce0, %rbx            # imm = 0xCE0
movq %rbx, %rdi
callq 0x104ccc
addq $0x20, %rsp
popq %rbx
retq
movq %rax, %rdi
callq 0x1718f
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x1044ff
movq %r8, (%rcx,%rdi)
addq $0x18, %rdi
cmpq $0x120, %rdi            # imm = 0x120
jne 0x1044f0
incq %rdx
addq $0x120, %rcx            # imm = 0x120
cmpq $0x5, %rdx
jne 0x1044ee
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 0x102b0c
addq $0x78, %rsp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x107560
movb 0x684(%rdi), %cl
sarq %cl, %rdx
cmpq %rdx, 0x18(%r8)
je 0x107560
movq (%r8), %r8
cmpq %rsi, %r8
jne 0x107552
movq %r8, (%rax)
cmpq %rsi, %r8
je 0x10756f
movb 0x20(%r8), %al
xorb $0x1, %al
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/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
subq $0x18, %rsp
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
callq 0x107b2e
testb %al, %al
je 0x107645
movq %r15, (%rsp)
movq (%r14), %r12
cmpq %r14, %r12
je 0x10762e
movq %r14, 0x10(%rsp)
movq %rbx, 0x8(%rsp)
movb 0x20(%r12), %bpl
xorb $0x1, %bpl
cmpb $0x0, 0x660(%rbx)
jne 0x10761f
movq 0x640(%rbx), %r14
movq 0x648(%rbx), %rbx
cmpq %rbx, %r14
sete %r15b
je 0x10760b
movq 0x10(%r12), %r13
xorl %r15d, %r15d
movl %ebp, %eax
testb $0x1, %bpl
je 0x1075f4
movq (%r14), %rdi
movq %r13, %rsi
callq 0x108908
testb $0x1, %bpl
je 0x10760d
addq $0x8, %r14
movl %eax, %ebp
cmpq %rbx, %r14
sete %r15b
jne 0x1075e3
jmp 0x10760d
movl %ebp, %eax
movl %eax, %ebp
testb $0x1, %r15b
movq 0x10(%rsp), %r14
movq 0x8(%rsp), %rbx
je 0x107625
testb $0x1, %bpl
jne 0x10762e
movq (%r12), %r12
cmpq %r14, %r12
jne 0x1075b0
cmpq %r14, %r12
je 0x10767c
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x1078e6
movq (%rsp), %r15
movb 0x684(%rbx), %cl
movq %r15, %rbx
sarq %cl, %rbx
movl $0x28, %edi
callq 0xb2e0
movq %r15, 0x10(%rax)
movq %rbx, 0x18(%rax)
movw $0x1, 0x20(%rax)
movq %rax, %rdi
movq %r14, %rsi
callq 0xb080
incq 0x10(%r14)
movq 0x8(%r14), %r12
movq %r12, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/CMU-SAFARI[P]ramulator/src/Cache.cpp
// Function: ramulator::Cache::evictline(long, bool)
void Cache::evictline(long addr, bool dirty) {

  auto it = cache_lines.find(get_index(addr));
  assert(it != cache_lines.end()); // check inclusive cache
  auto& lines = it->second;
  auto line = find_if(lines.begin(), lines.end(),
      [addr, this](Line l){return (l.tag == get_tag(addr));});

  assert(line != lines.end());
  // Update LRU queue. The dirty bit will be set if the dirty
  // bit inherited from higher level(s) is set.
  lines.push_back(Line(addr, get_tag(addr), false,
      dirty || line->dirty));
  lines.erase(line);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movb 0x680(%rdi), %cl
movq %rsi, %rax
sarq %cl, %rax
andl 0x678(%rdi), %eax
movq 0x6d0(%rdi), %r8
leaq 0x6c8(%rdi), %rcx
movq %rcx, %rsi
testq %r8, %r8
je 0x1076dd
movq %rcx, %rsi
xorl %r9d, %r9d
cmpl %eax, 0x20(%r8)
setl %r9b
cmovgeq %r8, %rsi
movq 0x10(%r8,%r9,8), %r8
testq %r8, %r8
jne 0x1076c4
movq %rcx, %r14
cmpq %rcx, %rsi
je 0x1076ef
cmpl 0x20(%rsi), %eax
cmovlq %rcx, %rsi
movq %rsi, %r14
cmpq %rcx, %r14
je 0x10777d
movq 0x28(%r14), %r15
addq $0x28, %r14
cmpq %r14, %r15
je 0x10771f
movb 0x684(%rdi), %cl
movq %rbx, %rax
sarq %cl, %rax
cmpq %rax, 0x18(%r15)
je 0x10771f
movq (%r15), %r15
cmpq %r14, %r15
jne 0x107711
cmpq %r14, %r15
je 0x10779c
movl 0x684(%rdi), %ecx
movb $0x1, %bpl
testb %dl, %dl
jne 0x107735
movb 0x21(%r15), %bpl
movq %rbx, %r12
sarq %cl, %r12
movl $0x28, %edi
callq 0xb2e0
movq %rbx, 0x10(%rax)
movq %r12, 0x18(%rax)
movb $0x0, 0x20(%rax)
movb %bpl, 0x21(%rax)
movq %rax, %rdi
movq %r14, %rsi
callq 0xb080
movq %r15, %rdi
callq 0xb490
movl $0x28, %esi
movq %r15, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xb2f0
leaq 0x50f4a(%rip), %rdi     # 0x1586ce
leaq 0x50c84(%rip), %rsi     # 0x15840f
leaq 0x50f54(%rip), %rcx     # 0x1586e6
movl $0xca, %edx
callq 0xb200
leaq 0x50f70(%rip), %rdi     # 0x158713
leaq 0x50c65(%rip), %rsi     # 0x15840f
leaq 0x50f35(%rip), %rcx     # 0x1586e6
movl $0xcf, %edx
callq 0xb200
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x107fc4
movq 0x10(%rax), %rdx
testq %rdx, %rdx
je 0x1078a5
movq (%rax), %r14
cmpq %rax, %r14
je 0x107815
movb 0x684(%r15), %cl
movq %rbx, %rsi
sarq %cl, %rsi
cmpq %rsi, 0x18(%r14)
je 0x107815
movq (%r14), %r14
cmpq %rax, %r14
jne 0x107807
cmpq %rax, %r14
je 0x1078ab
cmpb $0x1, 0x20(%r14)
je 0x1078c6
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 0x1078af
xorl %ebp, %ebp
movq (%rsp), %rax
movq %rax, %r12
movq (%r13), %rdi
movq %rbx, %rsi
callq 0x1077bc
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 0x107898
movzbl %cl, %edx
cmpb $0x0, 0x21(%r14)
movl $0x1, %ecx
cmovnel %ecx, %edx
addq $0x8, %r13
movl %edx, %ebp
cmpq %r15, %r13
jne 0x10785e
jmp 0x1078b7
xorl %eax, %eax
xorl %edx, %edx
jmp 0x1078b7
xorl %edx, %edx
jmp 0x1078b3
movb 0x21(%r14), %dl
movq (%rsp), %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x50e5a(%rip), %rdi     # 0x158727
leaq 0x50b3b(%rip), %rsi     # 0x15840f
leaq 0x50e58(%rip), %rcx     # 0x158733
movl $0xe6, %edx
callq 0xb200
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x107b4e
movb 0x684(%rdi), %cl
sarq %cl, %rdx
cmpq 0x18(%rax), %rdx
je 0x107b4e
movq (%rax), %rax
cmpq %rsi, %rax
jne 0x107b40
cmpq %rsi, %rax
jne 0x107b62
movl 0x670(%rdi), %eax
cmpq %rax, 0x10(%rsi)
setae %al
popq %rcx
retq
leaq 0x457f0(%rip), %rdi     # 0x14d359
leaq 0x5089f(%rip), %rsi     # 0x15840f
leaq 0x50c94(%rip), %rcx     # 0x15880b
movl $0x165, %edx            # imm = 0x165
callq 0xb200
nop
// File: /workspace/github_cpp_makefile_star2_O1/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), %rcx
movq 0x698(%rdi), %rax
movq %rax, %rdx
subq %rcx, %rdx
movq %rdx, %rdi
sarq $0x6, %rdi
testq %rdi, %rdi
jle 0x107c61
movl 0x67c(%r14), %r8d
negq %r8
movq 0x8(%rbx), %r9
andq $-0x40, %rdx
addq %rcx, %rdx
incq %rdi
addq $0x20, %rcx
movq %rcx, %rsi
movq -0x20(%rsi), %rcx
xorq %r9, %rcx
testq %r8, %rcx
je 0x107cd1
movq -0x10(%rsi), %rcx
xorq %r9, %rcx
testq %r8, %rcx
je 0x107cd7
movq (%rsi), %rcx
xorq %r9, %rcx
testq %r8, %rcx
je 0x107ce1
movq 0x10(%rsi), %rcx
xorq %r9, %rcx
testq %r8, %rcx
je 0x107cdd
decq %rdi
addq $0x40, %rsi
cmpq $0x1, %rdi
jg 0x107c12
movq %rdx, %rcx
movq %rax, %rdx
subq %rcx, %rdx
sarq $0x4, %rdx
cmpq $0x1, %rdx
je 0x107cb4
cmpq $0x2, %rdx
je 0x107c9a
movq %rax, %rsi
cmpq $0x3, %rdx
jne 0x107ce1
movl 0x67c(%r14), %edx
negq %rdx
movq 0x8(%rbx), %rsi
xorq (%rcx), %rsi
testq %rdx, %rsi
je 0x107ccc
addq $0x10, %rcx
movl 0x67c(%r14), %edx
negq %rdx
movq 0x8(%rbx), %rsi
xorq (%rcx), %rsi
testq %rdx, %rsi
je 0x107ccc
addq $0x10, %rcx
movl 0x67c(%r14), %edx
negq %rdx
movq 0x8(%rbx), %rsi
xorq (%rcx), %rsi
testq %rdx, %rsi
cmovneq %rax, %rcx
movq %rcx, %rsi
jmp 0x107ce1
addq $-0x20, %rsi
jmp 0x107ce1
addq $-0x10, %rsi
jmp 0x107ce1
addq $0x10, %rsi
cmpq %rax, %rsi
je 0x107cfa
leaq 0x690(%r14), %rdi
movq 0x8(%rsi), %rax
movb $0x0, 0x20(%rax)
callq 0x1081d2
movq 0x640(%r14), %r15
movq 0x648(%r14), %r14
cmpq %r15, %r14
je 0x107d21
movq (%r15), %rdi
movq %rbx, %rsi
callq 0x107bc8
addq $0x8, %r15
cmpq %r14, %r15
jne 0x107d0d
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x107d4e
callq 0x107d28
leaq 0x6a8(%rbx), %r14
movq 0x6a8(%rbx), %r15
cmpq %r14, %r15
je 0x107e08
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 0x24b6e
movq 0x48(%r15), %rax
movq %rax, 0x28(%r12)
movups 0x38(%r15), %xmm0
movups %xmm0, 0x18(%r12)
leaq 0x50(%r15), %rsi
movq %r13, %rdi
callq 0x295b4
movq %rbp, %rdi
movq %rsp, %rsi
callq 0x1070ea
movl %eax, %ebp
movq 0x50(%rsp), %rax
testq %rax, %rax
je 0x107dcf
movq %r13, %rdi
movq %r13, %rsi
movl $0x3, %edx
callq *%rax
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x107de6
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0xb2f0
testb %bpl, %bpl
je 0x107dfc
movq (%r15), %rbp
movq %r14, %rdi
movq %r15, %rsi
callq 0x29984
movq %rbp, %r15
movq (%r15), %r15
cmpq %r14, %r15
jne 0x107d6f
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rdi
callq 0x1718f
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x107e46
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0xb2f0
jmp 0x107e46
movq %rax, %rbx
movq %rsp, %rdi
callq 0x25bb6
movq %rbx, %rdi
callq 0xb510
// File: /workspace/github_cpp_makefile_star2_O1/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 0x107f2d
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 0x107f2d
movups 0x18(%r15), %xmm0
movaps %xmm0, 0x10(%rsp)
leaq 0x28(%r15), %rsi
movq %r12, %rdi
callq 0x24b6e
movq 0x50(%r15), %rax
movq %rax, 0x28(%r12)
movups 0x40(%r15), %xmm0
movups %xmm0, 0x18(%r12)
leaq 0x58(%r15), %rsi
movq %r13, %rdi
callq 0x295b4
cmpq $0x0, 0x40(%rbx)
je 0x107f83
movq 0x8(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq *0x48(%rbx)
movl %eax, %ebp
movq 0x60(%rsp), %rax
testq %rax, %rax
je 0x107ef7
movq %r13, %rdi
movq %r13, %rsi
movl $0x3, %edx
callq *%rax
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x107f0e
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0xb2f0
movq (%r15), %r14
testb %bpl, %bpl
je 0x107f21
movq %rbx, %rdi
movq %r15, %rsi
callq 0x108b54
movq %r14, %r15
cmpq %rbx, %r14
jne 0x107e82
leaq 0x18(%rbx), %r14
movq 0x18(%rbx), %r15
cmpq %r14, %r15
je 0x107f6f
movq 0x50(%rbx), %rax
cmpq 0x10(%r15), %rax
jge 0x107f49
movq (%r15), %r15
jmp 0x107f35
cmpq $0x0, 0x68(%r15)
je 0x107f7e
leaq 0x58(%r15), %rdi
leaq 0x18(%r15), %rsi
callq *0x70(%r15)
movq (%r15), %r12
movq %r14, %rdi
movq %r15, %rsi
callq 0x108b54
movq %r12, %r15
jmp 0x107f35
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0xb160
callq 0xb160
movq %rax, %rdi
callq 0x1718f
jmp 0x107fae
movq %rax, %rbx
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x107fbb
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0xb2f0
jmp 0x107fbb
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x25bb6
movq %rbx, %rdi
callq 0xb510
nop
// File: /workspace/github_cpp_makefile_star2_O1/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, %rbx
movq %rdi, %r14
movb 0x680(%rdi), %cl
movq %rsi, %rax
sarq %cl, %rax
andl 0x678(%rdi), %eax
movq 0x6d0(%rdi), %rsi
leaq 0x6c8(%rdi), %rcx
movq %rcx, %rdx
testq %rsi, %rsi
je 0x10801a
movq %rcx, %rdx
xorl %edi, %edi
cmpl %eax, 0x20(%rsi)
setl %dil
cmovgeq %rsi, %rdx
movq 0x10(%rsi,%rdi,8), %rsi
testq %rsi, %rsi
jne 0x108003
movq %rcx, %rsi
cmpq %rcx, %rdx
je 0x10802c
cmpl 0x20(%rdx), %eax
cmovlq %rcx, %rdx
movq %rdx, %rsi
leaq 0x6c0(%r14), %r15
cmpq %rcx, %rsi
jne 0x1080b3
xorps %xmm0, %xmm0
leaq 0x20(%rsp), %r12
movaps %xmm0, (%r12)
xorl %ecx, %ecx
movq %rcx, 0x10(%r12)
movq %r12, 0x8(%r12)
movq %r12, (%r12)
leaq 0x8(%rsp), %r13
movl %eax, -0x8(%r13)
movq %rcx, 0x10(%r13)
movq %r13, 0x8(%r13)
movq %r13, (%r13)
movq %rsp, %rsi
movq %r15, %rdi
callq 0x108278
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x108094
movq (%rdi), %rbp
movl $0x28, %esi
callq 0xb2f0
movq %rbp, %rdi
cmpq %r13, %rbp
jne 0x10807f
movq 0x20(%rsp), %rdi
cmpq %r12, %rdi
je 0x1080b3
movq (%rdi), %r13
movl $0x28, %esi
callq 0xb2f0
movq %r13, %rdi
cmpq %r12, %r13
jne 0x10809e
movb 0x680(%r14), %cl
sarq %cl, %rbx
andl 0x678(%r14), %ebx
movq %rsp, %rsi
movl %ebx, (%rsi)
movq %r15, %rdi
callq 0x108214
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 0x108102
movq (%rdi), %r14
movl $0x28, %esi
callq 0xb2f0
movq %r14, %rdi
cmpq %r13, %r14
jne 0x1080ed
leaq 0x20(%rsp), %rdi
callq 0xbbfd
movq %rbx, %rdi
callq 0xb510
// File: /workspace/github_cpp_makefile_star2_O1/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 0x109625
movq 0x1098(%rsi), %rsi
addq $0x20, %rcx
movq %rbx, %rdi
movq %rcx, %rdx
callq 0x109639
jmp 0x109634
addq $0x20, %rcx
movq %rbx, %rdi
movq %rcx, %rsi
callq 0x24b6e
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x3b0(%rsi), %rcx
movq (%rcx,%rax,8), %rax
movslq 0x8(%rdi), %rcx
movq 0x3b0(%rax), %rax
movq (%rax,%rcx,8), %rax
movq 0x3b0(%rax), %rcx
movq 0x3b8(%rax), %rax
cmpq %rax, %rcx
je 0x1096b3
movslq 0xc(%rdi), %rsi
movq (%rcx,%rsi,8), %rsi
addq $0x8, %rcx
xorl %ebp, %ebp
movq -0x8(%rcx), %rdi
cmpq %rdi, %rsi
je 0x109693
cmpl $0x0, 0x3c8(%rdi)
je 0x109697
xorl %edi, %edi
jmp 0x1096a0
movl 0x39c(%rdi), %ebp
movb $0x1, %dil
testb %dil, %dil
jne 0x1096b5
leaq 0x8(%rcx), %rdi
cmpq %rax, %rcx
movq %rdi, %rcx
jne 0x109681
jmp 0x1096b5
xorl %ebp, %ebp
movq %rbx, %rdi
movq %rdx, %rsi
callq 0x24b6e
movq (%rbx), %rax
movl %ebp, 0xc(%rax)
movl $0xffffffff, 0x10(%rax) # imm = 0xFFFFFFFF
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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
callq 0x4c6ce
cmpl $0xd, %eax
jne 0x109769
movq 0x1098(%rbx), %rsi
addq $0x20, %r14
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movq %r14, %rdx
callq 0x109639
movq 0x1090(%rbx), %rcx
movq 0x1098(%rbx), %rdi
movq (%r15), %rdx
movl $0xd, %esi
callq 0x491de
movl %eax, %ebx
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x10975d
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 0x20(%r14), %rdx
movl %eax, %esi
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x491de
movq %rax, %rbx
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x1097a5
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
callq 0xb2f0
movq %rbx, %rdi
callq 0xb510
nop
// File: /workspace/github_cpp_makefile_star2_O1/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
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
leaq 0x241a(%rip), %rcx      # 0x10e2fa
movq %rcx, 0x18(%rsp)
leaq 0x2446(%rip), %rdx      # 0x10e332
movq %rdx, 0x10(%rsp)
movups 0x1440(%rdi), %xmm1
movaps %xmm1, (%rsp)
movups %xmm0, 0x1440(%rdi)
movq 0x1450(%rdi), %rax
movq %rax, 0x10(%rsp)
movq %rdx, 0x1450(%rdi)
movq 0x1458(%rdi), %rdx
movq %rdx, 0x18(%rsp)
movq %rcx, 0x1458(%rdi)
testq %rax, %rax
je 0x10bf3b
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
leaq 0x1440(%rbx), %rsi
addq $0x1460, %rbx           # imm = 0x1460
movq %rbx, %rdi
callq 0x10e81e
addq $0x20, %rsp
popq %rbx
retq
movq %rax, %rdi
callq 0x1718f
nop
// File: /workspace/github_cpp_makefile_star2_O1/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
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
leaq 0x282c(%rip), %rcx      # 0x112cd8
movq %rcx, 0x18(%rsp)
leaq 0x2858(%rip), %rdx      # 0x112d10
movq %rdx, 0x10(%rsp)
movups 0x18c0(%rdi), %xmm1
movaps %xmm1, (%rsp)
movups %xmm0, 0x18c0(%rdi)
movq 0x18d0(%rdi), %rax
movq %rax, 0x10(%rsp)
movq %rdx, 0x18d0(%rdi)
movq 0x18d8(%rdi), %rdx
movq %rdx, 0x18(%rsp)
movq %rcx, 0x18d8(%rdi)
testq %rax, %rax
je 0x110507
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
leaq 0x18c0(%rbx), %rsi
addq $0x18e0, %rbx           # imm = 0x18E0
movq %rbx, %rdi
callq 0x113256
addq $0x20, %rsp
popq %rbx
retq
movq %rax, %rdi
callq 0x1718f
nop
// File: /workspace/github_cpp_makefile_star2_O1/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
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
leaq 0x3322(%rip), %rcx      # 0x117f56
movq %rcx, 0x18(%rsp)
leaq 0x3398(%rip), %rdx      # 0x117fd8
movq %rdx, 0x10(%rsp)
movups 0x1110(%rdi), %xmm1
movaps %xmm1, (%rsp)
movups %xmm0, 0x1110(%rdi)
movq 0x1120(%rdi), %rax
movq %rax, 0x10(%rsp)
movq %rdx, 0x1120(%rdi)
movq 0x1128(%rdi), %rdx
movq %rdx, 0x18(%rsp)
movq %rcx, 0x1128(%rdi)
testq %rax, %rax
je 0x114c8f
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
leaq 0x1110(%rbx), %rsi
addq $0x1130, %rbx           # imm = 0x1130
movq %rbx, %rdi
callq 0x118730
addq $0x20, %rsp
popq %rbx
retq
movq %rax, %rdi
callq 0x1718f
nop
// File: /workspace/github_cpp_makefile_star2_O1/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
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
leaq 0x3326(%rip), %rcx      # 0x117ff0
movq %rcx, 0x18(%rsp)
leaq 0x3352(%rip), %rdx      # 0x118028
movq %rdx, 0x10(%rsp)
movups 0x1ad0(%rdi), %xmm1
movaps %xmm1, (%rsp)
movups %xmm0, 0x1ad0(%rdi)
movq 0x1ae0(%rdi), %rax
movq %rax, 0x10(%rsp)
movq %rdx, 0x1ae0(%rdi)
movq 0x1ae8(%rdi), %rdx
movq %rdx, 0x18(%rsp)
movq %rcx, 0x1ae8(%rdi)
testq %rax, %rax
je 0x114d25
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
leaq 0x1ad0(%rbx), %rsi
addq $0x1af0, %rbx           # imm = 0x1AF0
movq %rbx, %rdi
callq 0x118730
addq $0x20, %rsp
popq %rbx
retq
movq %rax, %rdi
callq 0x1718f
nop
// File: /workspace/github_cpp_makefile_star2_O1/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
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
leaq 0x20c4(%rip), %rcx      # 0x11c034
movq %rcx, 0x18(%rsp)
leaq 0x20f0(%rip), %rdx      # 0x11c06c
movq %rdx, 0x10(%rsp)
movups 0x18c0(%rdi), %xmm1
movaps %xmm1, (%rsp)
movups %xmm0, 0x18c0(%rdi)
movq 0x18d0(%rdi), %rax
movq %rax, 0x10(%rsp)
movq %rdx, 0x18d0(%rdi)
movq 0x18d8(%rdi), %rdx
movq %rdx, 0x18(%rsp)
movq %rcx, 0x18d8(%rdi)
testq %rax, %rax
je 0x119fcb
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
leaq 0x18c0(%rbx), %rsi
addq $0x18e0, %rbx           # imm = 0x18E0
movq %rbx, %rdi
callq 0x11c5b2
addq $0x20, %rsp
popq %rbx
retq
movq %rax, %rdi
callq 0x1718f
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x11da42
movl 0x30b8(%rdi), %eax
sarl $0xa, %eax
cmpl $0x1, %eax
je 0x11da0b
cmpl $0x2, %eax
je 0x11da04
cmpl $0x4, %eax
jne 0x11da61
movl $0x2, %eax
jmp 0x11da0d
movl $0x1, %eax
jmp 0x11da0d
xorl %eax, %eax
shll $0x2, %eax
leaq 0x3dfb9(%rip), %rcx     # 0x15b9d0
movl (%rax,%rcx), %ecx
movl %ecx, 0x31b4(%rdi)
leaq 0x3dfb5(%rip), %rcx     # 0x15b9dc
movl (%rax,%rcx), %ecx
movl %ecx, 0x31bc(%rdi)
leaq 0x3dfb1(%rip), %rcx     # 0x15b9e8
movl (%rax,%rcx), %eax
movl %eax, 0x31cc(%rdi)
popq %rax
retq
leaq 0x2f910(%rip), %rdi     # 0x14d359
leaq 0x3dcff(%rip), %rsi     # 0x15b74f
leaq 0x3dd04(%rip), %rcx     # 0x15b75b
movl $0x42, %edx
callq 0xb200
leaq 0x2f8f1(%rip), %rdi     # 0x14d359
leaq 0x3dce0(%rip), %rsi     # 0x15b74f
leaq 0x3dce5(%rip), %rcx     # 0x15b75b
movl $0x48, %edx
callq 0xb200
// File: /workspace/github_cpp_makefile_star2_O1/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
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
leaq 0x23e8(%rip), %rcx      # 0x1201d8
movq %rcx, 0x18(%rsp)
leaq 0x2414(%rip), %rdx      # 0x120210
movq %rdx, 0x10(%rsp)
movups 0x1ac8(%rdi), %xmm1
movaps %xmm1, (%rsp)
movups %xmm0, 0x1ac8(%rdi)
movq 0x1ad8(%rdi), %rax
movq %rax, 0x10(%rsp)
movq %rdx, 0x1ad8(%rdi)
movq 0x1ae0(%rdi), %rdx
movq %rdx, 0x18(%rsp)
movq %rcx, 0x1ae0(%rdi)
testq %rax, %rax
je 0x11de4b
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
leaq 0x1ac8(%rbx), %rsi
addq $0x1ae8, %rbx           # imm = 0x1AE8
movq %rbx, %rdi
callq 0x120756
addq $0x20, %rsp
popq %rbx
retq
movq %rax, %rdi
callq 0x1718f
nop