LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/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
leaq 0x40(%rsp), %rdx
orl $-0x1, (%rdx)
leaq 0x8(%rsp), %r12
pushq $0x5
popq %rsi
leaq 0x7(%rsp), %rcx
movq %r12, %rdi
callq 0x1bea0
movq 0x1098(%rbx), %rax
movl 0x39c(%rax), %eax
movq (%r12), %rcx
movl %eax, (%rcx)
movl %r15d, 0x4(%rcx)
movl %r14d, 0x8(%rcx)
movl %ebp, 0xc(%rcx)
xorps %xmm0, %xmm0
leaq 0x20(%rsp), %rcx
movaps %xmm0, (%rcx)
movaps %xmm0, 0x10(%rcx)
leaq 0x40(%rsp), %rdi
pushq $0x2
popq %rdx
movq %r12, %rsi
xorl %r8d, %r8d
callq 0x1fde8
leaq 0x20(%rsp), %rdi
callq 0x96b6a
leaq 0x40(%rsp), %rsi
movq %rbx, %rdi
callq 0x1fe4c
testb %al, %al
je 0x1fd9d
leaq 0x40(%rsp), %rdi
callq 0x1cc14
leaq 0x8(%rsp), %rdi
callq 0x1b7dc
addq $0xa0, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0xb2c0a(%rip), %rdi     # 0xd29ae
leaq 0xb2c07(%rip), %rsi     # 0xd29b2
leaq 0xb2c0e(%rip), %rcx     # 0xd29c0
pushq $0x6b
popq %rdx
callq 0xb210
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x1cc14
jmp 0x1fdd6
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x96b6a
leaq 0x8(%rsp), %rdi
callq 0x1b7dc
movq %rbx, %rdi
callq 0xb4d0
// File: /workspace/github_cpp_makefile_star2_O2/CMU-SAFARI[P]ramulator/src/Controller.h
// Function: ramulator::Controller<ramulator::DDR3>::enqueue(ramulator::Request&)
bool enqueue(Request& req)
    {
        Queue& queue = get_queue(req.type);
        if (queue.max == queue.size())
            return false;

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movl 0x2c(%rsi), %eax
xorl %ecx, %ecx
cmpl $0x1, %eax
setne %cl
shll $0x6, %ecx
addq $0x10e0, %rcx           # imm = 0x10E0
testl %eax, %eax
movl $0x10c0, %eax           # imm = 0x10C0
cmovneq %rcx, %rax
movl 0x10(%rdi,%rax), %ebp
movl 0x18(%rdi,%rax), %r13d
cmpl %ebp, %r13d
je 0x1ff17
movq %rsi, %rbx
movq %rdi, %r14
addq %rdi, %rax
movq 0x1090(%rdi), %rcx
movq %rcx, 0x30(%rsi)
movq %rax, %rdi
callq 0x1fb18
cmpl $0x0, 0x2c(%rbx)
jne 0x1ff17
leaq 0x10e0(%r14), %r15
movq 0x10e0(%r14), %r12
leaq 0x8(%rsp), %rdi
movq %rbx, %rsi
callq 0x2000a
movq %r12, %rdi
movq %r15, %rsi
leaq 0x8(%rsp), %rdx
callq 0x1ff88
movq %rax, %r12
leaq 0x8(%rsp), %rdi
callq 0x1cc14
cmpq %r15, %r12
je 0x1ff17
movq 0x1090(%r14), %rax
incq %rax
movq %rax, 0x38(%rbx)
leaq 0x1140(%r14), %rdi
movq %rbx, %rsi
callq 0x1fb32
addq $0x10c0, %r14           # imm = 0x10C0
movq %r14, %rdi
callq 0x2006a
cmpl %ebp, %r13d
setne %al
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x1cc14
movq %rbx, %rdi
callq 0xb4d0
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rdi, %r14
movslq %esi, %r12
movq %r12, %r13
shlq $0x5, %r13
movslq 0x398(%r14), %rax
movslq 0x4(%rbx,%rax,4), %r15
movq 0x888(%r14), %rdi
cmpq $0x0, 0x10(%rdi,%r13)
je 0x209a3
addq %r13, %rdi
movq %r14, %rsi
movl %r15d, %edx
callq 0x20bfc
movl 0x398(%r14), %eax
movq 0x390(%r14), %rcx
cmpl 0x180(%rcx,%r12,4), %eax
je 0x209ca
movq 0x3b0(%r14), %rax
cmpq %rax, 0x3b8(%r14)
je 0x209ca
movq (%rax,%r15,8), %r14
jmp 0x20973
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0x211b5
testl %ecx, %ecx
js 0x211b2
movq 0x3b0(%rsi), %rdi
cmpq %rdi, 0x3b8(%rsi)
je 0x211b2
movq (%rdi,%rcx,8), %rsi
jmp 0x2117e
xorl %eax, %eax
retq
addq %r8, %rdi
movl %eax, %edx
jmp 0x1ba9c
nop
// File: /workspace/github_cpp_makefile_star2_O2/CMU-SAFARI[P]ramulator/src/Memory.h
// Function: ramulator::Memory<ramulator::DDR3, ramulator::Controller>::apply_mapping(long, std::vector<int, std::allocator<int>>&)
void apply_mapping(long addr, std::vector<int>& addr_vec){
        int *sz = spec->org_entry.count;
        int addr_total_bits = sizeof(addr_vec)*8;
        int addr_bits [int(T::Level::MAX)];
        for (int i = 0 ; i < int(T::Level::MAX) ; i ++)
        {
            if ( i != int(T::Level::Row))
            {
                addr_bits[i] = calc_log2(sz[i]);
                addr_total_bits -= addr_bits[i];
            }
        }
        // Row address is an integer.
        addr_bits[int(T::Level::Row)] = min((int)sizeof(int)*8, max(addr_total_bits, calc_log2(sz[int(T::Level::Row)])));

        // printf("Address: %lx => ",addr);
        for (unsigned int lvl = 0; lvl < int(T::Level::MAX); lvl++)
        {
            unsigned int lvl_bits = addr_bits[lvl];
            addr_vec[lvl] = 0;
            for (unsigned int bitindex = 0 ; bitindex < lvl_bits ; bitindex++){
                bool bitvalue = false;
                for (MapSrcVector::iterator it = mapping_scheme[lvl][bitindex].begin() ;
                    it != mapping_scheme[lvl][bitindex].end(); it ++)
                {
                    bitvalue = bitvalue xor get_bit_at(addr, *it);
                }
                addr_vec[lvl] |= (bitvalue << bitindex);
            }
            // printf("%s: %x, ",T::level_str[lvl].c_str(),addr_vec[lvl]);
        }
        // printf("\n");
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, 0x18(%rsp)
movq %rsi, %r14
movq %rdi, %r15
movq 0xc20(%rdi), %r12
movl $0xc0, %ebp
xorl %ebx, %ebx
cmpq $0x3, %rbx
je 0x21519
cmpq $0x5, %rbx
je 0x2151e
movl 0x272c(%r12,%rbx,4), %esi
movq %r15, %rdi
callq 0x1cf80
movl %eax, 0x20(%rsp,%rbx,4)
subl %eax, %ebp
incq %rbx
jmp 0x214f7
movl 0x2738(%r12), %esi
movq %r15, %rdi
callq 0x1cf80
cmpl %eax, %ebp
cmovgl %ebp, %eax
cmpl $0x20, %eax
pushq $0x20
popq %rcx
cmovll %eax, %ecx
movl %ecx, 0x2c(%rsp)
addq $0xb50, %r15            # imm = 0xB50
xorl %eax, %eax
leaq 0x10(%rsp), %r12
leaq 0xc(%rsp), %r13
movl %eax, 0x10(%rsp)
cmpl $0x5, %eax
jae 0x215f9
movl %eax, %eax
movl 0x20(%rsp,%rax,4), %ecx
movl %ecx, 0x14(%rsp)
movq 0x18(%rsp), %rcx
movq (%rcx), %rcx
andl $0x0, (%rcx,%rax,4)
xorl %eax, %eax
movl %eax, 0xc(%rsp)
cmpl 0x14(%rsp), %eax
jae 0x215ee
movq %r15, %rdi
movq %r12, %rsi
callq 0x216fe
movq %rax, %rdi
movq %r13, %rsi
callq 0x2174c
movq (%rax), %rbp
xorl %ebx, %ebx
movq %r15, %rdi
movq %r12, %rsi
callq 0x216fe
movq %rax, %rdi
movq %r13, %rsi
callq 0x2174c
cmpq 0x8(%rax), %rbp
je 0x215cb
movl (%rbp), %eax
btq %rax, %r14
setb %al
xorb %al, %bl
addq $0x4, %rbp
jmp 0x2159d
movzbl %bl, %eax
andl $0x1, %eax
movb 0xc(%rsp), %cl
shll %cl, %eax
movl 0x10(%rsp), %ecx
movq 0x18(%rsp), %rdx
movq (%rdx), %rdx
orl %eax, (%rdx,%rcx,4)
movl 0xc(%rsp), %eax
incl %eax
jmp 0x21578
movl 0x10(%rsp), %eax
incl %eax
jmp 0x21553
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/CMU-SAFARI[P]ramulator/src/Controller.h
// Function: ramulator::Controller<ramulator::DDR3>::finish(long, long)
void finish(long read_req, long dram_cycles) {
      read_latency_avg = read_latency_sum.value() / read_req;
      req_queue_length_avg = req_queue_length_sum.value() / dram_cycles;
      read_req_queue_length_avg = read_req_queue_length_sum.value() / dram_cycles;
      write_req_queue_length_avg = write_req_queue_length_sum.value() / dram_cycles;
      // call finish function of each channel
      channel->finish(dram_cycles);
    }

// Assembly:
cvtsi2sd %rsi, %xmm0
movsd 0x8b8(%rdi), %xmm1
divsd %xmm0, %xmm1
movsd 0x9e8(%rdi), %xmm0
cvtsi2sd %rdx, %xmm2
movsd %xmm1, 0x820(%rdi)
divsd %xmm2, %xmm0
movsd %xmm0, 0x950(%rdi)
movsd 0xb18(%rdi), %xmm0
divsd %xmm2, %xmm0
movsd %xmm0, 0xa80(%rdi)
movsd 0xc48(%rdi), %xmm0
divsd %xmm2, %xmm0
movsd %xmm0, 0xbb0(%rdi)
movq 0x1098(%rdi), %rdi
movq %rdx, %rsi
jmp 0x21968
nop
// File: /workspace/github_cpp_makefile_star2_O2/CMU-SAFARI[P]ramulator/src/Controller.h
// Function: ramulator::Controller<ramulator::DDR3>::record_core(int)
void record_core(int coreid) {
#ifndef INTEGRATED_WITH_GEM5
      record_read_hits[coreid] = read_row_hits[coreid];
      record_read_misses[coreid] = read_row_misses[coreid];
      record_read_conflicts[coreid] = read_row_conflicts[coreid];
      record_write_hits[coreid] = write_row_hits[coreid];
      record_write_misses[coreid] = write_row_misses[coreid];
      record_write_conflicts[coreid] = write_row_conflicts[coreid];
#endif
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
addq $0x2f8, %rdi            # imm = 0x2F8
callq 0x21130
movq %rax, %r15
leaq 0xc70(%r14), %rdi
movl %ebx, %esi
callq 0x21130
movq %rax, %rdi
movq %r15, %rsi
callq 0x21db4
leaq 0x3a8(%r14), %rdi
movl %ebx, %esi
callq 0x21130
movq %rax, %r15
leaq 0xd20(%r14), %rdi
movl %ebx, %esi
callq 0x21130
movq %rax, %rdi
movq %r15, %rsi
callq 0x21db4
leaq 0x458(%r14), %rdi
movl %ebx, %esi
callq 0x21130
movq %rax, %r15
leaq 0xdd0(%r14), %rdi
movl %ebx, %esi
callq 0x21130
movq %rax, %rdi
movq %r15, %rsi
callq 0x21db4
leaq 0x508(%r14), %rdi
movl %ebx, %esi
callq 0x21130
movq %rax, %r15
leaq 0xe80(%r14), %rdi
movl %ebx, %esi
callq 0x21130
movq %rax, %rdi
movq %r15, %rsi
callq 0x21db4
leaq 0x5b8(%r14), %rdi
movl %ebx, %esi
callq 0x21130
movq %rax, %r15
leaq 0xf30(%r14), %rdi
movl %ebx, %esi
callq 0x21130
movq %rax, %rdi
movq %r15, %rsi
callq 0x21db4
leaq 0x668(%r14), %rdi
movl %ebx, %esi
callq 0x21130
movq %rax, %r15
addq $0xfe0, %r14            # imm = 0xFE0
movq %r14, %rdi
movl %ebx, %esi
callq 0x21130
movq %rax, %rdi
movq %r15, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x21db4
// File: /workspace/github_cpp_makefile_star2_O2/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 %rbx
subq $0x30, %rsp
movq %rdi, %rbx
leaq 0xb0fbf(%rip), %rsi     # 0xd2f9e
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x10eea
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x1385e
movq %rax, %r14
leaq 0x8(%rbx), %r15
leaq 0x10(%rsp), %rdi
callq 0xb568
cmpq %r15, %r14
je 0x22058
leaq 0xb0f86(%rip), %rsi     # 0xd2f9e
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x10eea
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x1385e
addq $0x40, %rax
leaq 0xb0f6a(%rip), %rsi     # 0xd2fa9
movq %rax, %rdi
callq 0x110e2
movl %eax, %ebx
leaq 0x10(%rsp), %rdi
callq 0xb568
xorb $0x1, %bl
jmp 0x2205a
movb $0x1, %bl
movl %ebx, %eax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq
jmp 0x2206a
jmp 0x22079
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0xb568
jmp 0x2207c
movq %rax, %rbx
movq %rbx, %rdi
callq 0xb4d0
// File: /workspace/github_cpp_makefile_star2_O2/CMU-SAFARI[P]ramulator/src/StatType.h
// Function: Stats::StatList::printall()
void printall() {
    for(off_type i = 0 ; i < list.size() ; ++i) {
      if (!list[i]) {
        continue;
      }
      if (list[i]->is_nozero() && list[i]->zero()) {
        continue;
      }
      if (list[i]->is_display()) {
        list[i]->prepare();
        list[i]->print(stat_output);
      }
    }
  }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x18(%rdi), %r14
xorl %r15d, %r15d
movl %r15d, %r15d
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %r15, %rcx
jbe 0x220ff
movq (%rax,%r15,8), %rdi
testq %rdi, %rdi
je 0x220fa
movq (%rdi), %rax
callq *0x40(%rax)
testb %al, %al
je 0x220cd
movq (%rbx), %rax
movq (%rax,%r15,8), %rdi
movq (%rdi), %rax
callq *0x10(%rax)
testb %al, %al
jne 0x220fa
movq (%rbx), %rax
movq (%rax,%r15,8), %rdi
movq (%rdi), %rax
callq *0x38(%rax)
testb %al, %al
je 0x220fa
movq (%rbx), %rax
movq (%rax,%r15,8), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
movq (%rbx), %rax
movq (%rax,%r15,8), %rdi
movq (%rdi), %rax
movq %r14, %rsi
callq *(%rax)
incl %r15d
jmp 0x22093
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/CMU-SAFARI[P]ramulator/src/Controller.h
// Function: ramulator::Controller<ramulator::DDR3>::~Controller()
~Controller(){
        delete scheduler;
        delete rowpolicy;
        delete rowtable;
        delete channel;
        delete refresh;
        for (auto& file : cmd_trace_files)
            file.close();
        cmd_trace_files.clear();
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x10a0(%rdi), %r14
testq %r14, %r14
je 0x22b27
movq %r14, %rdi
callq 0x22e36
movl $0x98, %esi
movq %r14, %rdi
callq 0xb2e0
movq 0x10a8(%rbx), %r14
testq %r14, %r14
je 0x22b48
movq %r14, %rdi
callq 0x22e5c
movl $0x90, %esi
movq %r14, %rdi
callq 0xb2e0
movq 0x10b0(%rbx), %r14
testq %r14, %r14
je 0x22b6a
leaq 0x8(%r14), %rdi
callq 0x22f5e
pushq $0x38
popq %rsi
movq %r14, %rdi
callq 0xb2e0
movq 0x1098(%rbx), %r14
testq %r14, %r14
je 0x22b89
movq %r14, %rdi
callq 0x22e82
movl $0x898, %esi            # imm = 0x898
movq %r14, %rdi
callq 0xb2e0
movq 0x10b8(%rbx), %rdi
testq %rdi, %rdi
je 0x22ba8
movq (%rdi), %rax
callq *0x8(%rax)
leaq 0x11c0(%rbx), %r14
movq 0x11c0(%rbx), %r15
movq 0x11c8(%rbx), %r12
cmpq %r12, %r15
je 0x22bd3
movq %r15, %rdi
callq 0xb3a0
addq $0x200, %r15            # imm = 0x200
jmp 0x22bbd
movq %r14, %rdi
callq 0x22f56
movq %r14, %rdi
callq 0x1af30
leaq 0x11a0(%rbx), %rdi
callq 0xb568
leaq 0x1140(%rbx), %rdi
callq 0x1af52
leaq 0x1120(%rbx), %rdi
callq 0x1cc2e
leaq 0x1100(%rbx), %rdi
callq 0x1cc2e
leaq 0x10e0(%rbx), %rdi
callq 0x1cc2e
leaq 0x10c0(%rbx), %rdi
callq 0x1cc2e
leaq 0xfe0(%rbx), %rdi
callq 0x1af9e
leaq 0xf30(%rbx), %rdi
callq 0x1af9e
leaq 0xe80(%rbx), %rdi
callq 0x1af9e
leaq 0xdd0(%rbx), %rdi
callq 0x1af9e
leaq 0xd20(%rbx), %rdi
callq 0x1af9e
leaq 0xc70(%rbx), %rdi
callq 0x1af9e
leaq 0xbd8(%rbx), %rdi
callq 0x186e4
leaq 0xb40(%rbx), %rdi
callq 0x186e4
leaq 0xaa8(%rbx), %rdi
callq 0x186e4
leaq 0xa10(%rbx), %rdi
callq 0x186e4
leaq 0x978(%rbx), %rdi
callq 0x186e4
leaq 0x8e0(%rbx), %rdi
callq 0x186e4
leaq 0x848(%rbx), %rdi
callq 0x186e4
leaq 0x7b0(%rbx), %rdi
callq 0x186e4
leaq 0x718(%rbx), %rdi
callq 0x186e4
leaq 0x668(%rbx), %rdi
callq 0x1af9e
leaq 0x5b8(%rbx), %rdi
callq 0x1af9e
leaq 0x508(%rbx), %rdi
callq 0x1af9e
leaq 0x458(%rbx), %rdi
callq 0x1af9e
leaq 0x3a8(%rbx), %rdi
callq 0x1af9e
leaq 0x2f8(%rbx), %rdi
callq 0x1af9e
leaq 0x260(%rbx), %rdi
callq 0x186e4
leaq 0x1c8(%rbx), %rdi
callq 0x186e4
leaq 0x130(%rbx), %rdi
callq 0x186e4
leaq 0x98(%rbx), %rdi
callq 0x186e4
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x186e4
movq %rax, %rdi
callq 0x138e7
// File: /workspace/github_cpp_makefile_star2_O2/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 %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
leaq 0xcc0(%rdi), %r14
movups 0xcc0(%rdi), %xmm0
movq %rsp, %rdi
movaps %xmm0, (%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0xcc0(%rbx)
movups 0xcd0(%rbx), %xmm0
leaq 0x16c6(%rip), %rax      # 0x98c40
movq %rax, 0xcd0(%rbx)
movaps %xmm0, 0x10(%rdi)
leaq 0x1650(%rip), %rax      # 0x98bdc
movq %rax, 0xcd8(%rbx)
callq 0x96b6a
addq $0xce0, %rbx            # imm = 0xCE0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x99116
addq $0x28, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
cmpq $0x5, %rdx
je 0x989be
xorl %edi, %edi
cmpq $0x120, %rdi            # imm = 0x120
je 0x989b2
movq -0x8(%rcx,%rdi), %r8
cmpq %r8, (%rcx,%rdi)
je 0x989ac
movq %r8, (%rcx,%rdi)
addq $0x18, %rdi
jmp 0x98994
incq %rdx
addq $0x120, %rcx            # imm = 0x120
jmp 0x9898c
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
pushq $0xe
popq %rcx
movq %rsp, %rdi
rep  movsq (%rsi), %es:(%rdi)
movq %rax, %rdi
callq 0x97922
addq $0x78, %rsp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/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
movb 0x684(%rdi), %cl
sarq %cl, %rdx
movq %rsi, %rcx
movq (%rcx), %rcx
cmpq %rsi, %rcx
je 0x9b0a4
cmpq %rdx, 0x18(%rcx)
jne 0x9b08d
movq %rcx, (%rax)
movb 0x20(%rcx), %al
xorb $0x1, %al
retq
movq %rsi, (%rax)
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 $0x28, %rsp
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
callq 0x9b52a
testb %al, %al
je 0x9b13e
movq %r14, 0x8(%rsp)
movq %rbx, %r12
movq (%r12), %r12
cmpq %rbx, %r12
je 0x9b166
movb 0x20(%r12), %al
cmpb $0x0, 0x660(%r15)
je 0x9b0f4
testb $0x1, %al
jne 0x9b0d2
jmp 0x9b12b
movq 0x10(%r12), %r13
movq 0x640(%r15), %rbp
movq 0x648(%r15), %r14
cmpb $0x1, %al
setne %al
cmpq %r14, %rbp
je 0x9b127
testb $0x1, %al
je 0x9b0d2
movq (%rbp), %rdi
movq %r13, %rsi
callq 0x9c314
addq $0x8, %rbp
jmp 0x9b10c
testb $0x1, %al
je 0x9b0d2
movq %r15, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x9b362
movq 0x8(%rsp), %r14
movb 0x684(%r15), %cl
leaq 0x10(%rsp), %rsi
movq %r14, (%rsi)
sarq %cl, %r14
movq %r14, 0x8(%rsi)
movw $0x1, 0x10(%rsi)
movq %rbx, %rdi
callq 0x9b97a
movq 0x8(%rbx), %r12
movq %r12, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 %rbx
subq $0x18, %rsp
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r15
addq $0x6c0, %rdi            # imm = 0x6C0
movb 0x680(%r15), %cl
movq %rsi, %rax
sarq %cl, %rax
andl 0x678(%r15), %eax
movq %rsp, %rsi
movl %eax, (%rsi)
callq 0x9bece
movq %rax, %r14
leaq 0x6c8(%r15), %rax
cmpq %rax, %r14
je 0x9b239
addq $0x28, %r14
movb 0x684(%r15), %cl
movq %rbx, %rax
sarq %cl, %rax
movq %r14, %r15
movq (%r15), %r15
cmpq %r14, %r15
je 0x9b21a
cmpq %rax, 0x18(%r15)
jne 0x9b1d2
movb $0x1, %cl
testb %bpl, %bpl
jne 0x9b1eb
movb 0x21(%r15), %cl
movq %rsp, %rsi
movq %rbx, (%rsi)
movq %rax, 0x8(%rsi)
movb $0x0, 0x10(%rsi)
movb %cl, 0x11(%rsi)
movq %r14, %rdi
callq 0x9b97a
movq %r14, %rdi
movq %r15, %rsi
callq 0x9b986
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x414d2(%rip), %rdi     # 0xdc6f3
leaq 0x411c7(%rip), %rsi     # 0xdc3ef
leaq 0x41497(%rip), %rcx     # 0xdc6c6
movl $0xcf, %edx
callq 0xb210
leaq 0x4146e(%rip), %rdi     # 0xdc6ae
leaq 0x411a8(%rip), %rsi     # 0xdc3ef
leaq 0x41478(%rip), %rcx     # 0xdc6c6
movl $0xca, %edx
callq 0xb210
// File: /workspace/github_cpp_makefile_star2_O2/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, %r14
movq %rdi, %r12
movslq 0x5f0(%rdi), %rax
movslq 0x624(%rdi,%rax,4), %rbx
callq 0x9b894
cmpq $0x0, 0x10(%rax)
je 0x9b323
movb 0x684(%r12), %cl
movq %r14, %rdx
sarq %cl, %rdx
movq %rax, %r15
movq (%r15), %r15
cmpq %rax, %r15
je 0x9b325
cmpq %rdx, 0x18(%r15)
jne 0x9b299
cmpb $0x1, 0x20(%r15)
je 0x9b343
movq %rax, %rdi
movq %r15, %rsi
callq 0x9b986
movq 0x640(%r12), %r13
movq 0x648(%r12), %rbp
cmpq %r13, %rbp
je 0x9b33d
movq %r14, (%rsp)
xorl %r12d, %r12d
movq %rbx, %r14
cmpq %rbp, %r13
je 0x9b328
movq (%r13), %rdi
movq (%rsp), %rsi
callq 0x9b258
movl %edx, %ecx
andb $0x1, %cl
shlq %cl, %rax
addq %r14, %rax
cmpq %rax, %rbx
cmovleq %rax, %rbx
movb $0x1, %al
testb $0x1, %r12b
jne 0x9b31a
movzbl %cl, %eax
cmpb $0x0, 0x21(%r15)
pushq $0x1
popq %rcx
cmovnel %ecx, %eax
addq $0x8, %r13
movl %eax, %r12d
jmp 0x9b2e0
xorl %ebx, %ebx
xorl %r12d, %r12d
movq %rbx, %rax
movl %r12d, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movb 0x21(%r15), %r12b
jmp 0x9b328
leaq 0x413bd(%rip), %rdi     # 0xdc707
leaq 0x4109e(%rip), %rsi     # 0xdc3ef
leaq 0x413bb(%rip), %rcx     # 0xdc713
movl $0xe6, %edx
callq 0xb210
// File: /workspace/github_cpp_makefile_star2_O2/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
movb 0x684(%rdi), %cl
sarq %cl, %rdx
movq %rsi, %rax
movq (%rax), %rax
cmpq %rsi, %rax
je 0x9b54a
cmpq 0x18(%rax), %rdx
jne 0x9b537
cmpq %rsi, %rax
jne 0x9b559
movl 0x670(%rdi), %eax
cmpq %rax, 0x10(%rsi)
setae %al
popq %rcx
retq
leaq 0x35df9(%rip), %rdi     # 0xd1359
leaq 0x40e88(%rip), %rsi     # 0xdc3ef
leaq 0x4127d(%rip), %rcx     # 0xdc7eb
movl $0x165, %edx            # imm = 0x165
callq 0xb210
// File: /workspace/github_cpp_makefile_star2_O2/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
addq $0x690, %rdi            # imm = 0x690
movq 0x690(%r14), %rsi
movq 0x698(%r14), %rax
movq %rax, %r8
subq %rsi, %r8
movq %r8, %r9
sarq $0x6, %r9
movl 0x67c(%r14), %ecx
negq %rcx
movq 0x8(%rbx), %rdx
testq %r9, %r9
jle 0x9b63e
movq (%rsi), %r10
xorq %rdx, %r10
testq %rcx, %r10
je 0x9b68e
movq 0x10(%rsi), %r10
xorq %rdx, %r10
testq %rcx, %r10
je 0x9b67e
movq 0x20(%rsi), %r10
xorq %rdx, %r10
testq %rcx, %r10
je 0x9b684
movq 0x30(%rsi), %r10
xorq %rdx, %r10
testq %rcx, %r10
je 0x9b68a
addq $0x40, %rsi
decq %r9
addq $-0x40, %r8
jmp 0x9b5f9
sarq $0x4, %r8
cmpq $0x1, %r8
je 0x9b672
cmpq $0x2, %r8
je 0x9b663
cmpq $0x3, %r8
jne 0x9b6a0
movq (%rsi), %r8
xorq %rdx, %r8
testq %rcx, %r8
je 0x9b68e
addq $0x10, %rsi
movq (%rsi), %r8
xorq %rdx, %r8
testq %rcx, %r8
je 0x9b68e
addq $0x10, %rsi
xorq (%rsi), %rdx
testq %rcx, %rdx
cmovneq %rax, %rsi
jmp 0x9b68e
addq $0x10, %rsi
jmp 0x9b68e
addq $0x20, %rsi
jmp 0x9b68e
addq $0x30, %rsi
cmpq %rax, %rsi
je 0x9b6a0
movq 0x8(%rsi), %rax
movb $0x0, 0x20(%rax)
callq 0x9b9de
movq 0x640(%r14), %r15
movq 0x648(%r14), %r14
cmpq %r15, %r14
je 0x9b6c9
cmpq %r14, %r15
je 0x9b6c9
movq (%r15), %rdi
movq %rbx, %rsi
callq 0x9b5be
addq $0x8, %r15
jmp 0x9b6b3
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 0x9b6f6
callq 0x9b6d0
leaq 0x6a8(%rbx), %r14
leaq 0x8(%rsp), %r15
movq %r14, %r12
movq (%r12), %r12
cmpq %r14, %r12
je 0x9b74c
movq 0x658(%rbx), %r13
leaq 0x10(%r12), %rsi
movq %r15, %rdi
callq 0x2000a
movq %r13, %rdi
movq %r15, %rsi
callq 0x9ad0a
movl %eax, %ebp
movq %r15, %rdi
callq 0x1cc14
testb %bpl, %bpl
je 0x9b705
movq %r14, %rdi
movq %r12, %rsi
callq 0x1fb24
movq %rax, %r12
jmp 0x9b705
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x1cc14
movq %rbx, %rdi
callq 0xb4d0
// File: /workspace/github_cpp_makefile_star2_O2/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 %r12
pushq %rbx
subq $0x60, %rsp
movq %rdi, %rbx
incq 0x50(%rdi)
movq (%rdi), %r12
leaq 0x30(%rdi), %r14
movq %rsp, %r15
cmpq %rbx, %r12
je 0x9b7da
movq 0x50(%rbx), %rax
cmpq 0x10(%r12), %rax
jl 0x9b7da
leaq 0x18(%r12), %rsi
movq %r15, %rdi
callq 0x2000a
movq %r14, %rdi
movq %r15, %rsi
callq 0x9b9e4
movl %eax, %ebp
movq %r15, %rdi
callq 0x1cc14
testb %bpl, %bpl
je 0x9b7d4
movq %rbx, %rdi
movq %r12, %rsi
callq 0x9b9f8
movq %rax, %r12
jmp 0x9b78d
movq (%r12), %r12
jmp 0x9b78d
leaq 0x18(%rbx), %r14
movq 0x18(%rbx), %r15
cmpq %r14, %r15
je 0x9b813
movq 0x50(%rbx), %rax
cmpq 0x10(%r15), %rax
jge 0x9b7f6
movq (%r15), %r15
jmp 0x9b7e2
leaq 0x58(%r15), %rdi
leaq 0x18(%r15), %rsi
callq 0x1f5d6
movq %r14, %rdi
movq %r15, %rsi
callq 0x9b9f8
movq %rax, %r15
jmp 0x9b7e2
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x1cc14
movq %rbx, %rdi
callq 0xb4d0
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 %r15
pushq %r14
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
leaq 0x18(%rsp), %rsi
movl %eax, (%rsi)
movq %rbx, %rdi
callq 0x9bece
leaq 0x6c8(%r15), %rcx
cmpq %rcx, %rax
jne 0x9b932
movb 0x680(%r15), %cl
movq %r14, %rax
sarq %cl, %rax
andl 0x678(%r15), %eax
movq %rsp, %rcx
movq %rcx, 0x8(%rcx)
movq %rcx, (%rcx)
andq $0x0, 0x10(%rcx)
leaq 0x20(%rsp), %r12
movl %eax, -0x8(%r12)
andq $0x0, 0x10(%r12)
movq %r12, 0x8(%r12)
movq %r12, (%r12)
leaq 0x18(%rsp), %rsi
movq %rbx, %rdi
callq 0x9ba88
movq %r12, %rdi
callq 0x223fa
movq %rsp, %rdi
callq 0x223fa
movb 0x680(%r15), %cl
sarq %cl, %r14
andl 0x678(%r15), %r14d
leaq 0x18(%rsp), %rsi
movl %r14d, (%rsi)
movq %rbx, %rdi
callq 0x9ba3a
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
movq %r12, %rdi
callq 0x223fa
movq %rsp, %rdi
callq 0x223fa
movq %rbx, %rdi
callq 0xb4d0
// File: /workspace/github_cpp_makefile_star2_O2/CMU-SAFARI[P]ramulator/src/Cache.h
// Function: ramulator::Cache::all_sets_locked(std::__cxx11::list<ramulator::Cache::Line, std::allocator<ramulator::Cache::Line>> const&)
bool all_sets_locked(const std::list<Line>& lines) {
    if (lines.size() < assoc) {
      return false;
    }
    for (const auto& line : lines) {
      if (!line.lock) {
        return false;
      }
    }
    return true;
  }

// Assembly:
movl 0x670(%rdi), %eax
cmpq %rax, 0x10(%rsi)
jae 0x9b9c9
xorl %eax, %eax
retq
movq %rsi, %rcx
movq (%rcx), %rcx
cmpq %rsi, %rcx
sete %al
je 0x9b9dd
cmpb $0x0, 0x20(%rcx)
jne 0x9b9cc
retq
// File: /workspace/github_cpp_makefile_star2_O2/CMU-SAFARI[P]ramulator/src/Cache.h
// Function: ramulator::Cache::check_unlock(long)
bool check_unlock(long addr) {
    auto it = cache_lines.find(get_index(addr));
    if (it == cache_lines.end()) {
      return true;
    } else {
      auto& lines = it->second;
      auto line = find_if(lines.begin(), lines.end(),
          [addr, this](Line l){return (l.tag == get_tag(addr));});
      if (line == lines.end()) {
        return true;
      } else {
        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;
      }
    }
  }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %r14
addq $0x6c0, %rdi            # imm = 0x6C0
movb 0x680(%r14), %cl
movq %rsi, %rax
sarq %cl, %rax
andl 0x678(%r14), %eax
leaq 0x4(%rsp), %rsi
movl %eax, (%rsi)
callq 0x9bece
leaq 0x6c8(%r14), %rcx
movb $0x1, %bl
cmpq %rcx, %rax
je 0x9c3b7
movq %rax, %r12
addq $0x28, %r12
movq 0x28(%rax), %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %r14, %rcx
callq 0x9c3c8
cmpq %r12, %rax
je 0x9c3b7
movq %rax, %r15
movb 0x20(%rax), %bl
xorb $0x1, %bl
cmpb $0x0, 0x660(%r14)
jne 0x9c3b7
movq 0x640(%r14), %r12
movq 0x648(%r14), %r14
cmpq %r14, %r12
je 0x9c3b7
testb $0x1, %bl
je 0x9c3b5
movq (%r12), %rdi
movq 0x10(%r15), %rsi
callq 0x9c314
movl %eax, %ebx
addq $0x8, %r12
jmp 0x9c396
xorl %ebx, %ebx
andb $0x1, %bl
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0x9ceb9
movq 0x1098(%rsi), %rsi
addq $0x20, %rcx
movq %rbx, %rdi
movq %rcx, %rdx
callq 0x9cecd
jmp 0x9cec8
addq $0x20, %rcx
movq %rbx, %rdi
movq %rcx, %rsi
callq 0x1bbca
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/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), %rax
movslq 0x4(%rax), %rcx
movq 0x3b0(%rsi), %rsi
movq (%rsi,%rcx,8), %rcx
movslq 0x8(%rax), %rsi
movq 0x3b0(%rcx), %rcx
movq (%rcx,%rsi,8), %rcx
movslq 0xc(%rax), %rsi
movq 0x3b0(%rcx), %rax
movq 0x3b8(%rcx), %rcx
movq (%rax,%rsi,8), %rsi
cmpq %rcx, %rax
je 0x9cf26
movq (%rax), %rdi
cmpq %rdi, %rsi
je 0x9cf20
cmpl $0x0, 0x3c8(%rdi)
je 0x9cf2a
addq $0x8, %rax
jmp 0x9cf0a
xorl %ebp, %ebp
jmp 0x9cf30
movl 0x39c(%rdi), %ebp
movq %rbx, %rdi
movq %rdx, %rsi
callq 0x1bbca
movq (%rbx), %rax
movl %ebp, 0xc(%rax)
orl $-0x1, 0x10(%rax)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/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
callq 0x33652
cmpl $0xd, %eax
jne 0x9cfb5
movq 0x1098(%rbx), %rsi
addq $0x20, %r14
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movq %r14, %rdx
callq 0x9cecd
movq 0x1090(%rbx), %rcx
movq 0x1098(%rbx), %rdi
movq (%r15), %rdx
pushq $0xd
popq %rsi
callq 0x313ce
movl %eax, %ebx
leaq 0x8(%rsp), %rdi
callq 0x1b7dc
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 0x313ce
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x1b7dc
movq %rbx, %rdi
callq 0xb4d0
// File: /workspace/github_cpp_makefile_star2_O2/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 %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
leaq 0x1440(%rdi), %r14
movups 0x1440(%rdi), %xmm0
movq %rsp, %rdi
movaps %xmm0, (%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x1440(%rbx)
movups 0x1450(%rbx), %xmm0
leaq 0x16f6(%rip), %rax      # 0xa0576
movq %rax, 0x1450(%rbx)
movaps %xmm0, 0x10(%rdi)
leaq 0x16ac(%rip), %rax      # 0xa053e
movq %rax, 0x1458(%rbx)
callq 0x96b6a
addq $0x1460, %rbx           # imm = 0x1460
movq %rbx, %rdi
movq %r14, %rsi
callq 0xa0a4c
addq $0x28, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
leaq 0x18c0(%rdi), %r14
movups 0x18c0(%rdi), %xmm0
movq %rsp, %rdi
movaps %xmm0, (%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x18c0(%rbx)
movups 0x18d0(%rbx), %xmm0
leaq 0x19ae(%rip), %rax      # 0xa3f46
movq %rax, 0x18d0(%rbx)
movaps %xmm0, 0x10(%rdi)
leaq 0x1964(%rip), %rax      # 0xa3f0e
movq %rax, 0x18d8(%rbx)
callq 0x96b6a
addq $0x18e0, %rbx           # imm = 0x18E0
movq %rbx, %rdi
movq %r14, %rsi
callq 0xa441a
addq $0x28, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
leaq 0x1110(%rdi), %r14
movups 0x1110(%rdi), %xmm0
movq %rsp, %rdi
movaps %xmm0, (%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x1110(%rbx)
movups 0x1120(%rbx), %xmm0
leaq 0x1ea0(%rip), %rax      # 0xa7bae
movq %rax, 0x1120(%rbx)
movaps %xmm0, 0x10(%rdi)
leaq 0x1e2a(%rip), %rax      # 0xa7b4a
movq %rax, 0x1128(%rbx)
callq 0x96b6a
addq $0x1130, %rbx           # imm = 0x1130
movq %rbx, %rdi
movq %r14, %rsi
callq 0xa8254
addq $0x28, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
leaq 0x1ad0(%rdi), %r14
movups 0x1ad0(%rdi), %xmm0
movq %rsp, %rdi
movaps %xmm0, (%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x1ad0(%rbx)
movups 0x1ae0(%rbx), %xmm0
leaq 0x1e82(%rip), %rax      # 0xa7bfe
movq %rax, 0x1ae0(%rbx)
movaps %xmm0, 0x10(%rdi)
leaq 0x1e38(%rip), %rax      # 0xa7bc6
movq %rax, 0x1ae8(%rbx)
callq 0x96b6a
addq $0x1af0, %rbx           # imm = 0x1AF0
movq %rbx, %rdi
movq %r14, %rsi
callq 0xa8254
addq $0x28, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/CMU-SAFARI[P]ramulator/src/GDDR5.cpp
// Function: ramulator::GDDR5::init_speed()
void GDDR5::init_speed()
{
    const int REFIL_TABLE[int(Speed::MAX)] = {3900, 4388, 4875, 5363, 5850, 6338, 6825};
    const int REFIS_TABLE[int(Speed::MAX)] = {1900, 2138, 2375, 2613, 2850, 3088, 3325};
    const int RFC_TABLE[5][int(Speed::MAX)] = {
        // using DDR3 values
        {90, 102, 113, 124, 135, 147, 158},
        {110, 124, 138, 152, 165, 179, 193},
        {160, 180, 200, 220, 240, 260, 280},
        {260, 293, 325, 358, 390, 423, 455},
        {350, 394, 438, 482, 525, 569, 613}
    };
    int speed = 0, density = 0;
    switch (speed_entry.rate){
        case 4000: speed = 0; break;
        case 4500: speed = 1; break;
        case 5000: speed = 2; break;
        case 5500: speed = 3; break;
        case 6000: speed = 4; break;
        case 6500: speed = 5; break;
        case 7000: speed = 6; break;
        default: assert(0);
    }
    switch (org_entry.size >> 9){
        case 1: density = 0; break;
        case 2: density = 1; break;
        case 4: density = 2; break;
        case 8: density = 3; break;
        case 16: density = 4; break;
        default: assert(0);
    }
    if (org_entry.size <= 1024) speed_entry.nREFI = REFIL_TABLE[speed];
    else speed_entry.nREFI = REFIS_TABLE[speed];
    speed_entry.nRFC = RFC_TABLE[density][speed];
}

// Assembly:
pushq %rax
movl 0x3188(%rdi), %eax
cmpl $0xfa0, %eax            # imm = 0xFA0
je 0xa9731
cmpl $0x1b58, %eax           # imm = 0x1B58
je 0xa96b6
cmpl $0x1388, %eax           # imm = 0x1388
je 0xa96a6
cmpl $0x157c, %eax           # imm = 0x157C
je 0xa96aa
cmpl $0x1770, %eax           # imm = 0x1770
je 0xa96ae
cmpl $0x1964, %eax           # imm = 0x1964
je 0xa96b2
cmpl $0x1194, %eax           # imm = 0x1194
jne 0xa974e
pushq $0x1
jmp 0xa96b8
pushq $0x2
jmp 0xa96b8
pushq $0x3
jmp 0xa96b8
pushq $0x4
jmp 0xa96b8
pushq $0x5
jmp 0xa96b8
pushq $0x6
popq %rax
movl 0x2de0(%rdi), %ecx
movl %ecx, %edx
sarl $0x9, %edx
leal -0x1(%rdx), %esi
cmpl $0x7, %esi
ja 0xa96e0
leaq 0x354dd(%rip), %rdx     # 0xdebb0
movslq (%rdx,%rsi,4), %rsi
addq %rdx, %rsi
jmpq *%rsi
xorl %edx, %edx
jmp 0xa96f4
cmpl $0x10, %edx
jne 0xa9735
pushq $0x4
jmp 0xa96f3
pushq $0x3
jmp 0xa96f3
pushq $0x2
jmp 0xa96f3
pushq $0x1
popq %rdx
cmpl $0x401, %ecx            # imm = 0x401
leaq 0x359df(%rip), %rcx     # 0xdf0e0
leaq 0x359f8(%rip), %rsi     # 0xdf100
cmovlq %rcx, %rsi
shll $0x2, %eax
movl (%rsi,%rax), %ecx
movl %ecx, 0x31e8(%rdi)
imulq $0x1c, %rdx, %rcx
leaq 0x359fd(%rip), %rdx     # 0xdf120
addq %rcx, %rdx
movl (%rax,%rdx), %eax
movl %eax, 0x31e4(%rdi)
popq %rax
retq
xorl %eax, %eax
jmp 0xa96b9
leaq 0x27dc5(%rip), %rdi     # 0xd1501
leaq 0x35e60(%rip), %rsi     # 0xdf5a3
leaq 0x35e93(%rip), %rcx     # 0xdf5dd
pushq $0x54
jmp 0xa9765
leaq 0x27dac(%rip), %rdi     # 0xd1501
leaq 0x35e47(%rip), %rsi     # 0xdf5a3
leaq 0x35e7a(%rip), %rcx     # 0xdf5dd
pushq $0x4c
popq %rdx
callq 0xb210
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
leaq 0x18c0(%rdi), %r14
movups 0x18c0(%rdi), %xmm0
movq %rsp, %rdi
movaps %xmm0, (%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x18c0(%rbx)
movups 0x18d0(%rbx), %xmm0
leaq 0x150c(%rip), %rax      # 0xaaec8
movq %rax, 0x18d0(%rbx)
movaps %xmm0, 0x10(%rdi)
leaq 0x14c2(%rip), %rax      # 0xaae90
movq %rax, 0x18d8(%rbx)
callq 0x96b6a
addq $0x18e0, %rbx           # imm = 0x18E0
movq %rbx, %rdi
movq %r14, %rsi
callq 0xab37a
addq $0x28, %rsp
popq %rbx
popq %r14
retq