LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/CMU-SAFARI[P]ramulator/src/LPDDR3.cpp
// Function: ramulator::LPDDR3::init_speed()
void LPDDR3::init_speed()
{
    // 12Gb/16Gb RFCab/RFCpb TBD

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

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

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

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

// Assembly:
pushq %rax
movl 0x2bb8(%rdi), %eax
cmpl $0x749, %eax            # imm = 0x749
jg 0x121bad
cmpl $0x535, %eax            # imm = 0x535
je 0x121bc6
cmpl $0x640, %eax            # imm = 0x640
jne 0x121c57
movl $0x1, %eax
jmp 0x121bcf
cmpl $0x74a, %eax            # imm = 0x74A
je 0x121bca
cmpl $0x855, %eax            # imm = 0x855
jne 0x121c57
movl $0x3, %eax
jmp 0x121bcf
xorl %eax, %eax
jmp 0x121bcf
movl $0x2, %eax
movl 0x29b0(%rdi), %ecx
sarl $0xa, %ecx
cmpl $0x4, %ecx
je 0x121bf5
cmpl $0x8, %ecx
je 0x121bee
cmpl $0x6, %ecx
jne 0x121c38
movl $0x1, %ecx
jmp 0x121bf7
movl $0x2, %ecx
jmp 0x121bf7
xorl %ecx, %ecx
shll $0x4, %ecx
leaq 0x3a68f(%rip), %rdx     # 0x15c290
addq %rcx, %rdx
shll $0x2, %eax
movl (%rax,%rdx), %edx
movl %edx, 0x2c14(%rdi)
leaq 0x3a6a9(%rip), %rdx     # 0x15c2c0
addq %rcx, %rdx
movl (%rax,%rdx), %edx
movl %edx, 0x2c10(%rdi)
leaq 0x3a6c6(%rip), %rdx     # 0x15c2f0
addq %rcx, %rdx
movl (%rax,%rdx), %eax
movl %eax, 0x2c28(%rdi)
popq %rax
retq
leaq 0x3a1ac(%rip), %rdi     # 0x15bdeb
leaq 0x3a171(%rip), %rsi     # 0x15bdb7
leaq 0x3a179(%rip), %rcx     # 0x15bdc6
movl $0x59, %edx
callq 0xb200
leaq 0x2b6fb(%rip), %rdi     # 0x14d359
leaq 0x3a152(%rip), %rsi     # 0x15bdb7
leaq 0x3a15a(%rip), %rcx     # 0x15bdc6
movl $0x53, %edx
callq 0xb200
// File: /workspace/github_cpp_makefile_star2_O1/CMU-SAFARI[P]ramulator/src/LPDDR3.cpp
// Function: ramulator::LPDDR3::init_rowopen()
void LPDDR3::init_rowopen()
{
    // RD
    rowopen[int(Level::Bank)][int(Command::RD)] = [] (DRAM<LPDDR3>* node, Command cmd, int id) {
        switch (int(node->state)) {
            case int(State::Closed): return false;
            case int(State::Opened): return true;
            default: assert(false);
        }};

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

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

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

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

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

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

// Assembly:
pushq %rax
movl 0x2a80(%rdi), %eax
cmpl $0x640, %eax            # imm = 0x640
je 0x125e78
cmpl $0xc80, %eax            # imm = 0xC80
je 0x125e71
cmpl $0x960, %eax            # imm = 0x960
jne 0x125f11
movl $0x1, %eax
jmp 0x125e7a
movl $0x2, %eax
jmp 0x125e7a
xorl %eax, %eax
movl 0x28ec(%rdi), %ecx
sarl $0xa, %ecx
addl $-0x2, %ecx
cmpl $0x3, %ecx
jae 0x125ef2
movl %ecx, %ecx
shlq $0x2, %rcx
leaq (%rcx,%rcx,2), %rcx
leaq 0x36b84(%rip), %rdx     # 0x15ca20
addq %rcx, %rdx
shll $0x2, %eax
movl (%rax,%rdx), %edx
movl %edx, 0x2ae0(%rdi)
leaq 0x36b9e(%rip), %rdx     # 0x15ca50
addq %rcx, %rdx
movl (%rax,%rdx), %edx
movl %edx, 0x2adc(%rdi)
movslq 0x2908(%rdi), %rdx
leaq (%rdx,%rdx,2), %rdx
leaq 0x36bb0(%rip), %rsi     # 0x15ca80
leaq (%rsi,%rdx,4), %rdx
movl (%rax,%rdx), %edx
movl %edx, 0x2ae4(%rdi)
leaq 0x36bcc(%rip), %rdx     # 0x15cab0
addq %rcx, %rdx
movl (%rax,%rdx), %eax
movl %eax, 0x2af4(%rdi)
popq %rax
retq
leaq 0x35ef2(%rip), %rdi     # 0x15bdeb
leaq 0x36794(%rip), %rsi     # 0x15c694
leaq 0x3679c(%rip), %rcx     # 0x15c6a3
movl $0x5c, %edx
callq 0xb200
leaq 0x27441(%rip), %rdi     # 0x14d359
leaq 0x36775(%rip), %rsi     # 0x15c694
leaq 0x3677d(%rip), %rcx     # 0x15c6a3
movl $0x56, %edx
callq 0xb200
// File: /workspace/github_cpp_makefile_star2_O1/CMU-SAFARI[P]ramulator/src/MemoryFactory.h
// Function: ramulator::MemoryFactory<ramulator::WideIO2>::extend_channel_width(ramulator::WideIO2*, int)
static void extend_channel_width(T* spec, int cacheline)
    {
        int channel_unit = spec->prefetch_size * spec->channel_width / 8;
        int gang_number = cacheline / channel_unit;
        
        assert(gang_number >= 1 && 
            "cacheline size must be greater or equal to minimum channel width");
        
        assert(cacheline == gang_number * channel_unit &&
            "cacheline size must be a multiple of minimum channel width");
        
        spec->channel_width *= gang_number;
    }

// Assembly:
pushq %rax
movl 0x28b8(%rdi), %ecx
movl 0x28b4(%rdi), %eax
imull %ecx, %eax
leal 0x7(%rax), %r8d
testl %eax, %eax
cmovnsl %eax, %r8d
sarl $0x3, %r8d
movl %esi, %eax
cltd
idivl %r8d
testl %eax, %eax
jle 0x12a63c
imull %eax, %r8d
cmpl %esi, %r8d
jne 0x12a65b
imull %ecx, %eax
movl %eax, 0x28b8(%rdi)
popq %rax
retq
leaq 0x32a8c(%rip), %rdi     # 0x15d0cf
leaq 0x32adc(%rip), %rsi     # 0x15d126
leaq 0x32ae9(%rip), %rcx     # 0x15d13a
movl $0x1c, %edx
callq 0xb200
leaq 0x32b4a(%rip), %rdi     # 0x15d1ac
leaq 0x32abd(%rip), %rsi     # 0x15d126
leaq 0x32aca(%rip), %rcx     # 0x15d13a
movl $0x1f, %edx
callq 0xb200
// File: /workspace/github_cpp_makefile_star2_O1/CMU-SAFARI[P]ramulator/src/PCM.cpp
// Function: ramulator::PCM::init_speed()
void PCM::init_speed()
{
    // nRRD, nFAW
    int page = (org_entry.dq * org_entry.count[int(Level::Column)]) >> 13;
    switch (speed_entry.rate) {
        case 800:  speed_entry.nFAW = (page==1) ? 16 : 20; break;
        default: assert(false);
    }

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

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

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
cmpb $0x0, 0x3a(%rdi)
je 0x12f56f
movq (%r14), %rax
movq (%rax), %rax
cmpb $0x0, 0x58(%rax)
jne 0x12f57b
movq (%r14), %rax
cmpq %rax, 0x8(%r14)
je 0x12f57b
movl $0x1, %ebp
xorl %ecx, %ecx
movq (%rax,%rcx,8), %rax
movq 0x80(%rax), %rax
movq (%rax), %rdi
movq %rbx, %rsi
callq 0x107bc8
movl %ebp, %ecx
movq (%r14), %rax
movq 0x8(%r14), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
incl %ebp
cmpq %rcx, %rdx
ja 0x12f540
jmp 0x12f57b
leaq 0x60(%r14), %rdi
movq %rbx, %rsi
callq 0x107bc8
movq (%r14), %rax
cmpq %rax, 0x8(%r14)
je 0x12f5ae
movl $0x1, %ebp
xorl %ecx, %ecx
movq (%rax,%rcx,8), %rdi
movq %rbx, %rsi
callq 0x12fc70
movl %ebp, %ecx
movq (%r14), %rax
movq 0x8(%r14), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
incl %ebp
cmpq %rcx, %rdx
ja 0x12f58b
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/CMU-SAFARI[P]ramulator/src/Processor.cpp
// Function: ramulator::Processor::tick()
void Processor::tick() {
  cpu_cycles++;

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

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

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

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rax
movq 0x8(%rdi), %rcx
cmpb $0x0, 0x38(%rdi)
je 0x12fdce
subq %rax, %rcx
setne %bpl
je 0x12fe9e
movq (%rax), %rdx
cmpb $0x0, 0x47c(%rdx)
jne 0x12fd27
cmpl $0x0, 0x418(%rdx)
je 0x12fd57
sarq $0x3, %rcx
movl $0x1, %edx
movl %edx, %edx
cmpq %rdx, %rcx
seta %bpl
jbe 0x12fe9e
movq (%rax,%rdx,8), %rsi
incl %edx
cmpb $0x0, 0x47c(%rsi)
jne 0x12fd30
cmpl $0x0, 0x418(%rsi)
jne 0x12fd30
movq (%rbx), %rax
cmpq %rax, 0x8(%rbx)
je 0x12fe9e
movl $0x1, %r15d
leaq 0x2dfce(%rip), %r14     # 0x15dd3f
xorl %ecx, %ecx
movq (%rax,%rcx,8), %r12
movl 0x10(%r12), %esi
movq (%r12), %rcx
movq 0x8(%r12), %rdx
movq %r14, %rdi
xorl %eax, %eax
callq 0xb060
xorps %xmm0, %xmm0
cvtsi2sdq 0x8(%r12), %xmm0
xorps %xmm1, %xmm1
cvtsi2sdq (%r12), %xmm1
divsd %xmm1, %xmm0
addsd 0x30(%rbx), %xmm0
movsd %xmm0, 0x30(%rbx)
movq (%rbx), %rax
movq 0x8(%rbx), %rdx
movl %r15d, %ecx
subq %rax, %rdx
sarq $0x3, %rdx
incl %r15d
cmpq %rcx, %rdx
ja 0x12fd73
jmp 0x12fe9e
cmpq %rax, %rcx
sete %bpl
je 0x12fe9e
movq (%rax), %r12
cmpb $0x0, 0x47c(%r12)
jne 0x12fe9e
cmpl $0x0, 0x418(%r12)
jne 0x12fe9e
movl $0x1, %r15d
xorpd %xmm0, %xmm0
leaq 0x2df32(%rip), %r14     # 0x15dd3f
xorl %r13d, %r13d
movq 0x18(%rbx), %rax
ucomisd (%rax,%r13,8), %xmm0
jbe 0x12fe63
movl 0x10(%r12), %esi
movq (%r12), %rcx
movq 0x8(%r12), %rdx
movq %r14, %rdi
xorl %eax, %eax
callq 0xb060
xorps %xmm0, %xmm0
cvtsi2sdq 0x8(%r12), %xmm0
xorps %xmm1, %xmm1
cvtsi2sdq (%r12), %xmm1
divsd %xmm1, %xmm0
movq 0x18(%rbx), %rax
movsd %xmm0, (%rax,%r13,8)
addsd 0x30(%rbx), %xmm0
movsd %xmm0, 0x30(%rbx)
xorpd %xmm0, %xmm0
movl %r15d, %r13d
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %r13, %rcx
setbe %bpl
jbe 0x12fe9e
movq (%rax,%r13,8), %r12
cmpb $0x0, 0x47c(%r12)
jne 0x12fe9e
incl %r15d
cmpl $0x0, 0x418(%r12)
je 0x12fe10
movl %ebp, %eax
addq $0x8, %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/Processor.cpp
// Function: ramulator::Processor::has_reached_limit()
bool Processor::has_reached_limit() {
  for (unsigned int i = 0 ; i < cores.size() ; ++i) {
    if (!cores[i]->has_reached_limit()) {
      return false;
    }
  }
  return true;
}

// Assembly:
movq (%rdi), %rcx
movq 0x8(%rdi), %rdx
subq %rcx, %rdx
sete %al
je 0x12ff31
movq (%rcx), %rsi
cmpb $0x1, 0x1d8(%rsi)
jne 0x12ff31
sarq $0x3, %rdx
movl $0x1, %esi
movl %esi, %esi
cmpq %rsi, %rdx
setbe %al
jbe 0x12ff31
movq (%rcx,%rsi,8), %rdi
incl %esi
cmpb $0x0, 0x1d8(%rdi)
jne 0x12ff18
retq
// File: /workspace/github_cpp_makefile_star2_O1/CMU-SAFARI[P]ramulator/src/Processor.cpp
// Function: ramulator::Processor::get_insts()
long Processor::get_insts() {
    long insts_total = 0;
    for (unsigned int i = 0 ; i < cores.size(); i++) {
        insts_total += cores[i]->get_insts();
    }

    return insts_total;
}

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

    if (load == 0) return 0;

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

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

    return retired;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl 0x8(%rdi), %eax
cmpl 0x4(%rdi), %eax
jg 0x1313b8
testl %eax, %eax
je 0x1313b1
movq %rdi, %rbx
xorl %eax, %eax
cmpl $0x0, 0x8(%rdi)
jle 0x1313b3
cmpl $0x0, (%rbx)
jle 0x1313b3
leaq 0x18(%rbx), %r14
xorl %ebp, %ebp
movslq 0x10(%rbx), %rsi
movq %r14, %rdi
callq 0x131e84
testq %rdx, (%rax)
je 0x1313ad
movl 0x10(%rbx), %eax
incl %eax
cltd
idivl 0x4(%rbx)
movl %edx, 0x10(%rbx)
movl (%rbx), %eax
movl 0x8(%rbx), %ecx
leal -0x1(%rcx), %edx
movl %edx, 0x8(%rbx)
incl %ebp
cmpl $0x2, %ecx
jl 0x1313ad
cmpl %eax, %ebp
jl 0x13137a
movl %ebp, %eax
jmp 0x1313b3
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x2ca4c(%rip), %rdi     # 0x15de0b
leaq 0x2c6ee(%rip), %rsi     # 0x15dab4
leaq 0x2ca77(%rip), %rcx     # 0x15de44
movl $0x159, %edx            # imm = 0x159
callq 0xb200
nop
// File: /workspace/github_cpp_makefile_star2_O1/CMU-SAFARI[P]ramulator/src/Processor.cpp
// Function: ramulator::Window::insert(bool, long)
void Window::insert(bool ready, long addr)
{
    assert(load <= depth);

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

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

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl 0x8(%rdi), %eax
cmpl 0x4(%rdi), %eax
jg 0x131444
movq %rdx, %r14
movl %esi, %ebp
movq %rdi, %rbx
addq $0x18, %rdi
movslq 0xc(%rbx), %rsi
callq 0x131e84
testb %bpl, %bpl
je 0x13140d
orq (%rax), %rdx
jmp 0x131413
notq %rdx
andq (%rax), %rdx
movq %rdx, (%rax)
movslq 0xc(%rbx), %rsi
movq 0x40(%rbx), %rax
movq 0x48(%rbx), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq %rsi, %rdx
jbe 0x131463
movq %r14, (%rax,%rsi,8)
leal 0x1(%rsi), %eax
cltd
idivl 0x4(%rbx)
movl %edx, 0xc(%rbx)
incl 0x8(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x2c9c0(%rip), %rdi     # 0x15de0b
leaq 0x2c662(%rip), %rsi     # 0x15dab4
leaq 0x2c9c0(%rip), %rcx     # 0x15de19
movl $0x14d, %edx            # imm = 0x14D
callq 0xb200
leaq 0x2cb06(%rip), %rdi     # 0x15df70
xorl %eax, %eax
callq 0xb3f0
nop
// File: /workspace/github_cpp_makefile_star2_O1/CMU-SAFARI[P]ramulator/src/Processor.cpp
// Function: ramulator::Window::set_ready(long, int)
void Window::set_ready(long addr, int mask)
{
    if (load == 0) return;

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

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

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

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdx, %rbp
movq %rsi, %r14
movq %rdi, %r15
leaq 0x18(%rsp), %r13
movq %r13, -0x10(%r13)
movq $0x0, -0x8(%r13)
movb $0x0, (%r13)
movq 0x8(%rdi), %rax
addq $0x8, %r15
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0xb2c0
movsbl %al, %edx
leaq 0x8(%rsp), %rsi
movq %r15, %rdi
callq 0xb540
movq (%r15), %rax
movq -0x18(%rax), %rax
movl 0x20(%r15,%rax), %ebx
testb $0x2, %bl
jne 0x13172a
movq 0x8(%rsp), %r12
callq 0xb050
movq %rax, %r15
movl (%rax), %eax
movl %eax, 0x4(%rsp)
movl $0x0, (%r15)
leaq 0x28(%rsp), %r13
movq %r12, %rdi
movq %r13, %rsi
movl $0x10, %edx
callq 0xb120
movq (%r13), %rdx
subq %r12, %rdx
je 0x131756
movl (%r15), %ecx
cmpl $0x22, %ecx
je 0x131762
testl %ecx, %ecx
leaq 0x18(%rsp), %r13
jne 0x131675
movl 0x4(%rsp), %ecx
movl %ecx, (%r15)
movq %rax, (%r14)
incq %rdx
leaq 0x8(%rsp), %rdi
movl $0x20, %esi
callq 0xb2a0
movq %rax, %r14
cmpq $-0x1, %rax
je 0x1316ba
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
movq %r14, %rdx
movq $-0x1, %rcx
callq 0xb310
movq 0x28(%rsp), %rax
cmpb $0x52, (%rax)
sete %r15b
jmp 0x1316bd
movb $0x1, %r15b
cmpq $-0x1, %r14
je 0x1316de
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1316de
movq 0x38(%rsp), %rsi
incq %rsi
callq 0xb2f0
xorl %eax, %eax
testb %r15b, %r15b
jne 0x131727
leaq 0x48(%rsp), %rdi
leaq 0x8(%rsp), %rsi
movq %r14, %rdx
movq $-0x1, %rcx
callq 0xb310
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
movb (%rdi), %r14b
cmpq %rax, %rdi
je 0x13171c
movq 0x58(%rsp), %rsi
incq %rsi
callq 0xb2f0
movl $0x1, %eax
cmpb $0x57, %r14b
jne 0x13176e
movl %eax, (%rbp)
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x131741
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xb2f0
testb $0x2, %bl
sete %al
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2c7bd(%rip), %rdi     # 0x15df1a
callq 0xb1f0
leaq 0x2c7b1(%rip), %rdi     # 0x15df1a
callq 0xb3d0
leaq 0x1bbe4(%rip), %rdi     # 0x14d359
leaq 0x2c338(%rip), %rsi     # 0x15dab4
leaq 0x2c742(%rip), %rcx     # 0x15dec5
movl $0x1d7, %edx            # imm = 0x1D7
callq 0xb200
jmp 0x1317a3
jmp 0x1317a3
movq %rax, %rbx
cmpl $0x0, (%r15)
jne 0x1317a6
movl 0x4(%rsp), %eax
movl %eax, (%r15)
jmp 0x1317a6
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x1317c2
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xb2f0
movq %rbx, %rdi
callq 0xb510
// File: /workspace/github_cpp_makefile_star2_O1/CMU-SAFARI[P]ramulator/src/Config.h
// Function: ramulator::Config::has_core_caches() const
bool has_core_caches() const {
      if (options.find("cache") != options.end()) {
        const std::string& cache_option = (options.find("cache"))->second;
        return (cache_option == "all" || cache_option == "L1L2");
      } else {
        return false;
      }
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x2c6a1(%rip), %rsi     # 0x15df0b
leaq 0x2c69f(%rip), %rdx     # 0x15df10
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 0x1318a6
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xb2f0
cmpq %r12, %r14
je 0x13191a
leaq 0x8(%rsp), %rdi
movq %r15, (%rdi)
leaq 0x2c651(%rip), %rsi     # 0x15df0b
leaq 0x2c64f(%rip), %rdx     # 0x15df10
callq 0x17586
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x17106
movq %rax, %rbx
addq $0x40, %rbx
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x1318f1
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xb2f0
leaq 0x2c619(%rip), %rsi     # 0x15df11
movq %rbx, %rdi
callq 0xb100
testl %eax, %eax
je 0x13191e
leaq 0x2c60a(%rip), %rsi     # 0x15df15
movq %rbx, %rdi
callq 0xb100
testl %eax, %eax
sete %al
jmp 0x131920
xorl %eax, %eax
jmp 0x131920
movb $0x1, %al
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x131930
jmp 0x13194c
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x13194f
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xb2f0
jmp 0x13194f
movq %rax, %rbx
movq %rbx, %rdi
callq 0xb510
nop
// File: /workspace/github_cpp_makefile_star2_O1/CMU-SAFARI[P]ramulator/src/Config.h
// Function: ramulator::Config::has_l3_cache() const
bool has_l3_cache() const {
      if (options.find("cache") != options.end()) {
        const std::string& cache_option = (options.find("cache"))->second;
        return (cache_option == "all") || (cache_option == "L3");
      } else {
        return false;
      }
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x2c595(%rip), %rsi     # 0x15df0b
leaq 0x2c593(%rip), %rdx     # 0x15df10
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 0x1319b2
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xb2f0
cmpq %r12, %r14
je 0x131a26
leaq 0x8(%rsp), %rdi
movq %r15, (%rdi)
leaq 0x2c545(%rip), %rsi     # 0x15df0b
leaq 0x2c543(%rip), %rdx     # 0x15df10
callq 0x17586
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x17106
movq %rax, %rbx
addq $0x40, %rbx
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x1319fd
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xb2f0
leaq 0x2c50d(%rip), %rsi     # 0x15df11
movq %rbx, %rdi
callq 0xb100
testl %eax, %eax
je 0x131a2a
leaq 0x269dc(%rip), %rsi     # 0x1583f3
movq %rbx, %rdi
callq 0xb100
testl %eax, %eax
sete %al
jmp 0x131a2c
xorl %eax, %eax
jmp 0x131a2c
movb $0x1, %al
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x131a3c
jmp 0x131a58
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x131a5b
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xb2f0
jmp 0x131a5b
movq %rax, %rbx
movq %rbx, %rdi
callq 0xb510
nop
// File: /workspace/github_cpp_makefile_star2_O1/CMU-SAFARI[P]ramulator/src/Cache.h
// Function: ramulator::CacheSystem::CacheSystem(ramulator::Config const&, std::function<bool (ramulator::Request)>)
CacheSystem(const Config& configs, std::function<bool(Request)> send_memory):
    send_memory(send_memory) {
      if (configs.has_core_caches()) {
        first_level = Cache::Level::L1;
      } else if (configs.has_l3_cache()) {
        first_level = Cache::Level::L3;
      } else {
        last_level = Cache::Level::MAX; // no cache
      }

      if (configs.has_l3_cache()) {
        last_level = Cache::Level::L3;
      } else if (configs.has_core_caches()) {
        last_level = Cache::Level::L2;
      } else {
        last_level = Cache::Level::MAX; // no cache
      }
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r12
movq %rdi, %rbx
movq %rdi, 0x8(%rdi)
movq %rdi, (%rdi)
xorl %eax, %eax
movq %rax, 0x10(%rdi)
leaq 0x18(%rdi), %r14
movq %r14, 0x20(%rdi)
movq %r14, 0x18(%rdi)
movq %rax, 0x28(%rdi)
leaq 0x30(%rdi), %r15
movq %r15, %rdi
movq %rdx, %rsi
callq 0x131a64
movq $0x0, 0x50(%rbx)
movq %r12, %rdi
callq 0x13184c
testb %al, %al
je 0x131b21
movl $0x0, 0x58(%rbx)
jmp 0x131b3d
movq %r12, %rdi
callq 0x131958
testb %al, %al
je 0x131b36
movl $0x2, 0x58(%rbx)
jmp 0x131b3d
movl $0x3, 0x5c(%rbx)
movq %r12, %rdi
callq 0x131958
testb %al, %al
je 0x131b52
movl $0x2, 0x5c(%rbx)
jmp 0x131b6e
movq %r12, %rdi
callq 0x13184c
testb %al, %al
je 0x131b67
movl $0x1, 0x5c(%rbx)
jmp 0x131b6e
movl $0x3, 0x5c(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %r12
jmp 0x131b98
movq %rax, %r12
movq 0x40(%rbx), %rax
testq %rax, %rax
je 0x131b98
movq %r15, %rdi
movq %r15, %rsi
movl $0x3, %edx
callq *%rax
movq %r14, %rdi
callq 0x131eea
movq %rbx, %rdi
callq 0x131eea
movq %r12, %rdi
callq 0xb510
movq %rax, %rdi
callq 0x1718f
// File: /workspace/github_cpp_makefile_star2_O1/CMU-SAFARI[P]ramulator/src/Refresh.cpp
// Function: ramulator::Refresh<ramulator::DSARP>::tick_ref()
void Refresh<DSARP>::tick_ref() {
  clk++;

  bool b_ref_rank = ctrl->channel->spec->b_ref_rank;
  int refresh_interval =
      (b_ref_rank) ?
          ctrl->channel->spec->speed_entry.nREFI :
          ctrl->channel->spec->speed_entry.nREFIpb;

  // DARP
  if (ctrl->channel->spec->type == DSARP::Type::DARP ||
    ctrl->channel->spec->type == DSARP::Type::DSARP) {
    // Write-Refresh Parallelization. Issue refreshes when the controller enters writeback mode
    if (!ctrl_write_mode && ctrl->write_mode)
      wrp();
    // Record write mode
    ctrl_write_mode = ctrl->write_mode;
    // Inject early to pull in some refreshes during read mode
    early_inject_refresh();
  }

  // Time to schedule a refresh and also try to skip some refreshes
  if ((clk - refreshed) >= refresh_interval)
    inject_refresh(b_ref_rank);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
incq 0x10(%rdi)
movq 0x8(%rdi), %rax
movq 0x1098(%rax), %rcx
movq 0x390(%rcx), %rcx
movzbl 0x31f8(%rcx), %ebp
movl %ebp, %edx
xorl $0x1, %edx
movslq 0x31cc(%rcx,%rdx,4), %r14
movl (%rcx), %ecx
cmpl $0x4, %ecx
je 0x1335d1
cmpl $0x2, %ecx
jne 0x133603
cmpb $0x0, 0x90(%rbx)
jne 0x1335eb
cmpb $0x1, 0x1190(%rax)
jne 0x1335eb
movq %rbx, %rdi
callq 0x13313c
movq 0x8(%rbx), %rax
movb 0x1190(%rax), %al
movb %al, 0x90(%rbx)
movq %rbx, %rdi
callq 0x132a3e
movq 0x10(%rbx), %rax
subq 0x18(%rbx), %rax
cmpq %r14, %rax
jge 0x133615
popq %rbx
popq %r14
popq %rbp
retq
movzbl %bpl, %esi
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x132ec4
nop
// File: /workspace/github_cpp_makefile_star2_O1/CMU-SAFARI[P]ramulator/src/STTMRAM.cpp
// Function: ramulator::STTMRAM::init_speed()
void STTMRAM::init_speed()
{
    // nRRD, nFAW
    int page = (org_entry.dq * org_entry.count[int(Level::Column)]) >> 13;
    switch (speed_entry.rate) {
          case 1600: speed_entry.nRRD = ceil(speed_entry.nRRD  * ((page==1) ? 5 : 6) /10.0); speed_entry.nFAW = ceil(speed_entry.nFAW *((page==1) ? 24 : 32)/10.0); break;
        default: assert(false);
    }

    // nRFC, nXS
    int chip = org_entry.size;
    switch (speed_entry.rate) {
        case 1600: speed_entry.nRFC = 1; break;
        default: assert(false);
    }
    switch (speed_entry.rate) {
          case 1600: speed_entry.nXS  = ceil(speed_entry.nXS * ((chip==512) ? 80  : (chip==1<<10) ? 96  : (chip==1<<11) ? 136 : (chip==1<<12) ? 216 : 288) /10.0); break;
        default: assert(false);
    }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
cmpl $0x640, 0x2898(%rdi)    # imm = 0x640
jne 0x13aeaa
movq %rdi, %rbx
movl 0x273c(%rdi), %eax
imull 0x2728(%rdi), %eax
movl 0x2724(%rdi), %ebp
andl $0xffffe000, %eax       # imm = 0xFFFFE000
xorl %r14d, %r14d
cmpl $0x2000, %eax           # imm = 0x2000
setne %r14b
leal 0x5(%r14), %eax
imull 0x28e0(%rdi), %eax
cvtsi2sd %eax, %xmm0
divsd 0x24890(%rip), %xmm0    # 0x15f688
callq 0xb0b0
cvttsd2si %xmm0, %eax
movl %eax, 0x28e0(%rbx)
leal 0x18(,%r14,8), %eax
imull 0x28e4(%rbx), %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd 0x24863(%rip), %xmm0    # 0x15f688
callq 0xb0b0
cvttsd2si %xmm0, %eax
movl %eax, 0x28e4(%rbx)
movl $0x1, 0x28e8(%rbx)
movl 0x2900(%rbx), %eax
cmpl $0x200, %ebp            # imm = 0x200
je 0x13ae6a
cmpl $0x400, %ebp            # imm = 0x400
je 0x13ae63
cmpl $0x800, %ebp            # imm = 0x800
jne 0x13ae71
movl $0x88, %ecx
jmp 0x13ae84
movl $0x60, %ecx
jmp 0x13ae84
movl $0x50, %ecx
jmp 0x13ae84
cmpl $0x1000, %ebp           # imm = 0x1000
movl $0xd8, %edx
movl $0x120, %ecx            # imm = 0x120
cmovel %edx, %ecx
imull %eax, %ecx
xorps %xmm0, %xmm0
cvtsi2sd %ecx, %xmm0
divsd 0x247f2(%rip), %xmm0    # 0x15f688
callq 0xb0b0
cvttsd2si %xmm0, %eax
movl %eax, 0x2900(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x124a8(%rip), %rdi     # 0x14d359
leaq 0x248eb(%rip), %rsi     # 0x15f7a3
leaq 0x248f4(%rip), %rcx     # 0x15f7b3
movl $0x44, %edx
callq 0xb200
nop
// File: /workspace/github_cpp_makefile_star2_O1/CMU-SAFARI[P]ramulator/src/STTMRAM.cpp
// Function: ramulator::STTMRAM::init_rowopen()
void STTMRAM::init_rowopen()
{
    // RD
    rowopen[int(Level::Bank)][int(Command::RD)] = [] (DRAM<STTMRAM>* 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 0x234a(%rip), %rcx      # 0x13d518
movq %rcx, 0x18(%rsp)
leaq 0x2376(%rip), %rdx      # 0x13d550
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 0x13b229
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
leaq 0x1440(%rbx), %rsi
addq $0x1460, %rbx           # imm = 0x1460
movq %rbx, %rdi
callq 0x13da3c
addq $0x20, %rsp
popq %rbx
retq
movq %rax, %rdi
callq 0x1718f
nop
// File: /workspace/github_cpp_makefile_star2_O1/CMU-SAFARI[P]ramulator/src/StatType.cpp
// Function: Stats::Histogram::grow_convert()
void
Histogram::grow_convert()
{
    int size = cvec.size();
    int half = (size + 1) / 2; // round up!
    //bool even = (size & 1) == 0;

    int pair = size - 1;
    for (int i = size - 1; i >= half; --i) {
        cvec[i] = cvec[pair];
        if (pair - 1 >= 0)
            cvec[i] += cvec[pair - 1];
        pair -= 2;
    }

    for (int i = half - 1; i >= 0; i--)
        cvec[i] = Counter();

    min_bucket = -max_bucket;// - (even ? bucket_size : 0);
    bucket_size *= 2;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0xb0(%rdi), %rax
movq 0xb8(%rdi), %r9
subq %rax, %r9
movq %r9, %rdx
shrq $0x3, %rdx
leal 0x1(%rdx), %ecx
shrl $0x1f, %ecx
addl %edx, %ecx
incl %ecx
sarl %ecx
cmpl %edx, %ecx
jge 0x13eba1
shlq $0x1d, %r9
movslq %edx, %rsi
movslq %ecx, %rdi
movabsq $-0x100000000, %r8      # imm = 0xFFFFFFFF00000000
addq %r9, %r8
sarq $0x20, %r8
movsd (%rax,%r8,8), %xmm0
movsd %xmm0, -0x8(%rax,%rsi,8)
testq %r8, %r8
jle 0x13eb95
addsd -0x8(%rax,%r8,8), %xmm0
movsd %xmm0, -0x8(%rax,%rsi,8)
decq %rsi
addq $-0x2, %r8
cmpq %rdi, %rsi
jg 0x13eb77
testl %edx, %edx
jle 0x13ebca
leal -0x1(%rcx), %edx
testl %ecx, %ecx
movl $0x1, %esi
cmovlel %ecx, %esi
subl %esi, %ecx
subq %rcx, %rdx
leaq (%rax,%rdx,8), %rdi
leaq 0x8(,%rcx,8), %rdx
xorl %esi, %esi
callq 0xb1d0
movsd 0x80(%rbx), %xmm0
xorps 0x21397(%rip), %xmm0    # 0x15ff70
movlps %xmm0, 0x78(%rbx)
movsd 0x88(%rbx), %xmm0
addsd %xmm0, %xmm0
movsd %xmm0, 0x88(%rbx)
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/CMU-SAFARI[P]ramulator/src/StatType.cpp
// Function: Stats::Histogram::grow_up()
void
Histogram::grow_up()
{
    int size = cvec.size();
    int half = (size + 1) / 2; // round up!

    int pair = 0;
    for (int i = 0; i < half; i++) {
        cvec[i] = cvec[pair];
        if (pair + 1 < size)
            cvec[i] += cvec[pair + 1];
        pair += 2;
    }
    assert(pair == size || pair == size + 1);

    for (int i = half; i < size; i++)
        cvec[i] = Counter();

    max_bucket *= 2;
    bucket_size *= 2;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0xb0(%rdi), %rcx
movq 0xb8(%rdi), %rax
subq %rcx, %rax
shrq $0x3, %rax
leal 0x1(%rax), %esi
movl %esi, %edx
shrl $0x1f, %edx
addl %eax, %edx
incl %edx
sarl %edx
testl %eax, %eax
jle 0x13ec67
movl %eax, %edi
andl $0x7fffffff, %edi       # imm = 0x7FFFFFFF
cmpl $0x2, %edx
movl $0x1, %r9d
cmovgel %edx, %r9d
addl %r9d, %r9d
xorl %r8d, %r8d
movsd (%rcx,%r8,8), %xmm0
movsd %xmm0, (%rcx,%r8,4)
leaq 0x1(%r8), %r10
cmpq %rdi, %r10
jae 0x13ec5c
addsd 0x8(%rcx,%r8,8), %xmm0
movsd %xmm0, (%rcx,%r8,4)
addq $0x2, %r8
cmpq %r8, %r9
jne 0x13ec3a
jmp 0x13ec6a
xorl %r8d, %r8d
cmpl %eax, %r8d
setne %dil
cmpl %esi, %r8d
setne %sil
testb %sil, %dil
jne 0x13ecc5
cmpl %eax, %edx
jge 0x13ec9b
movslq %edx, %rsi
leaq (%rcx,%rsi,8), %rdi
notl %edx
addl %eax, %edx
leaq 0x8(,%rdx,8), %rdx
xorl %esi, %esi
callq 0xb1d0
movsd 0x80(%rbx), %xmm0
movsd 0x88(%rbx), %xmm1
addsd %xmm0, %xmm0
movsd %xmm0, 0x80(%rbx)
addsd %xmm1, %xmm1
movsd %xmm1, 0x88(%rbx)
popq %rbx
retq
leaq 0x21344(%rip), %rdi     # 0x160010
leaq 0x212df(%rip), %rsi     # 0x15ffb2
leaq 0x21357(%rip), %rcx     # 0x160031
movl $0x5b, %edx
callq 0xb200
// File: /workspace/github_cpp_makefile_star2_O1/CMU-SAFARI[P]ramulator/src/StatType.cpp
// Function: Stats::Histogram::sample(double, int)
void
Histogram::sample(Counter val, int number)
{
    assert(min_bucket < max_bucket);
    if (val < min_bucket) {
        if (min_bucket == 0)
            grow_convert();

        while (val < min_bucket)
            grow_out();
    } else if (val >= max_bucket + bucket_size) {
        if (min_bucket == 0) {
            while (val >= max_bucket + bucket_size)
                grow_up();
        } else {
            while (val >= max_bucket + bucket_size)
                grow_out();
        }
    }

    size_type index =
        (int64_t)std::floor((val - min_bucket) / bucket_size);

    assert(index >= 0 && index < size());
    cvec[index] += number;

    sum += val * number;
    squares += val * val * number;
    logs += log(val) * number;
    samples += number;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movsd 0x78(%rdi), %xmm2
movsd 0x80(%rdi), %xmm1
ucomisd %xmm2, %xmm1
jbe 0x13eef6
movl %esi, %ebp
movq %rdi, %rbx
ucomisd %xmm0, %xmm2
movsd %xmm0, (%rsp)
jbe 0x13ee7e
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm2
jne 0x13ef1a
jp 0x13ef1a
movq %rbx, %rdi
callq 0x13eb30
jmp 0x13ef15
addsd 0x88(%rbx), %xmm1
ucomisd %xmm1, %xmm0
jb 0x13ef2f
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm2
movsd 0x80(%rbx), %xmm1
addsd 0x88(%rbx), %xmm1
jne 0x13eeac
jnp 0x13eeee
ucomisd %xmm1, %xmm0
jb 0x13ef2f
movq %rbx, %rdi
callq 0x13e96a
movsd (%rsp), %xmm0
movsd 0x80(%rbx), %xmm1
addsd 0x88(%rbx), %xmm1
jmp 0x13eeac
movq %rbx, %rdi
callq 0x13ebf4
movsd (%rsp), %xmm0
movsd 0x80(%rbx), %xmm1
addsd 0x88(%rbx), %xmm1
ucomisd %xmm1, %xmm0
jae 0x13eed1
jmp 0x13ef2f
leaq 0x211aa(%rip), %rdi     # 0x1600a7
leaq 0x210ae(%rip), %rsi     # 0x15ffb2
leaq 0x211b4(%rip), %rcx     # 0x1600bf
movl $0x7c, %edx
callq 0xb200
movsd (%rsp), %xmm0
movsd 0x78(%rbx), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x13ef2f
movq %rbx, %rdi
callq 0x13e96a
jmp 0x13ef15
subsd 0x78(%rbx), %xmm0
divsd 0x88(%rbx), %xmm0
callq 0xb4b0
cvttsd2si %xmm0, %r14
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x8(%rax)
cmpl %r14d, %eax
jbe 0x13efee
xorps %xmm2, %xmm2
cvtsi2sd %ebp, %xmm2
movsd %xmm2, 0x8(%rsp)
movl %r14d, %eax
movq 0xb0(%rbx), %rcx
movsd (%rcx,%rax,8), %xmm0
addsd %xmm2, %xmm0
movsd %xmm0, (%rcx,%rax,8)
movsd (%rsp), %xmm0
movapd %xmm0, %xmm1
mulsd %xmm2, %xmm1
addsd 0x90(%rbx), %xmm1
movsd %xmm1, 0x90(%rbx)
movapd %xmm0, %xmm1
mulsd %xmm0, %xmm1
mulsd %xmm2, %xmm1
addsd 0xa0(%rbx), %xmm1
movsd %xmm1, 0xa0(%rbx)
callq 0xb260
movsd 0x8(%rsp), %xmm1
mulsd %xmm1, %xmm0
addsd 0x98(%rbx), %xmm0
movsd %xmm0, 0x98(%rbx)
addsd 0xa8(%rbx), %xmm1
movsd %xmm1, 0xa8(%rbx)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
leaq 0xfd6c(%rip), %rdi      # 0x14ed61
leaq 0x20fb6(%rip), %rsi     # 0x15ffb2
leaq 0x210bc(%rip), %rcx     # 0x1600bf
movl $0x90, %edx
callq 0xb200
nop
// File: /workspace/github_cpp_makefile_star2_O1/CMU-SAFARI[P]ramulator/src/TLDRAM.cpp
// Function: ramulator::TLDRAM::init_rowhit()
void TLDRAM::init_rowhit()
{
    // RD
    rowhit[int(Level::Bank)][int(Command::RD)] = [] (DRAM<TLDRAM>* 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 0x3b36(%rip), %rcx      # 0x143a9c
movq %rcx, 0x18(%rsp)
leaq 0x3bac(%rip), %rdx      # 0x143b1e
movq %rdx, 0x10(%rsp)
movups 0x11d8(%rdi), %xmm1
movaps %xmm1, (%rsp)
movups %xmm0, 0x11d8(%rdi)
movq 0x11e8(%rdi), %rax
movq %rax, 0x10(%rsp)
movq %rdx, 0x11e8(%rdi)
movq 0x11f0(%rdi), %rdx
movq %rdx, 0x18(%rsp)
movq %rcx, 0x11f0(%rdi)
testq %rax, %rax
je 0x13ffc1
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
leaq 0x11d8(%rbx), %rsi
addq $0x11f8, %rbx           # imm = 0x11F8
movq %rbx, %rdi
callq 0x1441ce
addq $0x20, %rsp
popq %rbx
retq
movq %rax, %rdi
callq 0x1718f
nop
// File: /workspace/github_cpp_makefile_star2_O1/CMU-SAFARI[P]ramulator/src/TLDRAM.cpp
// Function: ramulator::TLDRAM::init_rowopen()
void TLDRAM::init_rowopen()
{
    // RD
    rowopen[int(Level::Bank)][int(Command::RD)] = [] (DRAM<TLDRAM>* 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 0x3b3a(%rip), %rcx      # 0x143b36
movq %rcx, 0x18(%rsp)
leaq 0x3b66(%rip), %rdx      # 0x143b6e
movq %rdx, 0x10(%rsp)
movups 0x1c78(%rdi), %xmm1
movaps %xmm1, (%rsp)
movups %xmm0, 0x1c78(%rdi)
movq 0x1c88(%rdi), %rax
movq %rax, 0x10(%rsp)
movq %rdx, 0x1c88(%rdi)
movq 0x1c90(%rdi), %rdx
movq %rdx, 0x18(%rsp)
movq %rcx, 0x1c90(%rdi)
testq %rax, %rax
je 0x140057
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
leaq 0x1c78(%rbx), %rsi
addq $0x1c98, %rbx           # imm = 0x1C98
movq %rbx, %rdi
callq 0x1441ce
addq $0x20, %rsp
popq %rbx
retq
movq %rax, %rdi
callq 0x1718f
nop
// File: /workspace/github_cpp_makefile_star2_O1/CMU-SAFARI[P]ramulator/src/WideIO.cpp
// Function: ramulator::WideIO::init_speed()
void WideIO::init_speed()
{
    const static int RFC_TABLE[int(Speed::MAX)][int(Org::MAX)] = {
        {18, 26, 26, 42},
        {24, 35, 35, 56}
    };
    const static int REFI_TABLE[int(Speed::MAX)][int(Org::MAX)] = {
        {3120, 1560, 780, 780},
        {4160, 2080, 1040, 520}
    };
    int speed = 0, density = 0;
    switch(speed_entry.rate){
        case 200: speed = 0; break;
        case 266: speed = 1; break;
        default: assert(false);
    }
    switch(org_entry.size >> 8){
        case 1: density = 0; break;
        case 2: density = 1; break;
        case 4: density = 2; break;
        case 8: density = 3; break;
        default: assert(false);
    }
    speed_entry.nRFC = RFC_TABLE[speed][density];
    speed_entry.nREFI = REFI_TABLE[speed][density];
}

// Assembly:
pushq %rax
movl 0x26f8(%rdi), %eax
cmpl $0xc8, %eax
je 0x1455e0
cmpl $0x10a, %eax            # imm = 0x10A
jne 0x145653
movl $0x1, %eax
jmp 0x1455e2
xorl %eax, %eax
movl 0x25f0(%rdi), %ecx
sarl $0x8, %ecx
decl %ecx
cmpl $0x8, %ecx
jae 0x145634
movl $0x8b, %edx
btl %ecx, %edx
jae 0x145634
movl %ecx, %ecx
leaq 0x1c383(%rip), %rdx     # 0x161988
movq (%rdx,%rcx,8), %rcx
shll $0x4, %eax
leaq 0x1c3bd(%rip), %rdx     # 0x1619d0
addq %rax, %rdx
movl (%rdx,%rcx,4), %edx
movl %edx, 0x274c(%rdi)
leaq 0x1c3ca(%rip), %rdx     # 0x1619f0
addq %rax, %rdx
movl (%rdx,%rcx,4), %eax
movl %eax, 0x2750(%rdi)
popq %rax
retq
leaq 0x7d1e(%rip), %rdi      # 0x14d359
leaq 0x1bcab(%rip), %rsi     # 0x1612ed
leaq 0x1bd43(%rip), %rcx     # 0x16138c
movl $0x4a, %edx
callq 0xb200
leaq 0x7cff(%rip), %rdi      # 0x14d359
leaq 0x1bc8c(%rip), %rsi     # 0x1612ed
leaq 0x1bd24(%rip), %rcx     # 0x16138c
movl $0x43, %edx
callq 0xb200
// File: /workspace/github_cpp_makefile_star2_O1/CMU-SAFARI[P]ramulator/src/WideIO2.cpp
// Function: ramulator::WideIO2::init_rowopen()
void WideIO2::init_rowopen()
{
    // RD
    rowopen[int(Level::Bank)][int(Command::RD)] = [] (DRAM<WideIO2>* 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 0x308(%rip), %rcx       # 0x14b85a
movq %rcx, 0x18(%rsp)
leaq 0x334(%rip), %rdx       # 0x14b892
movq %rdx, 0x10(%rsp)
movups 0x15e0(%rdi), %xmm1
movaps %xmm1, (%rsp)
movups %xmm0, 0x15e0(%rdi)
movq 0x15f0(%rdi), %rax
movq %rax, 0x10(%rsp)
movq %rdx, 0x15f0(%rdi)
movq 0x15f8(%rdi), %rdx
movq %rdx, 0x18(%rsp)
movq %rcx, 0x15f8(%rdi)
testq %rax, %rax
je 0x14b5ad
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
leaq 0x15e0(%rbx), %rsi
addq $0x1600, %rbx           # imm = 0x1600
movq %rbx, %rdi
callq 0x14bd30
addq $0x20, %rsp
popq %rbx
retq
movq %rax, %rdi
callq 0x1718f
nop
// File: /workspace/github_cpp_makefile_star2_O1/lega911[P]ijson/src/buffer.h
// Function: ISlice::operator==(char const*) const
bool equal(const char *s) const {
        int i = 0;
        while(*s) {
            if(i >= _size) return false;
            if(*s != _ptr[i]) return false;
            i++;
            s++;
        }
        return i == _size;
    }

// Assembly:
movb (%rsi), %cl
testb %cl, %cl
je 0x6fe6
movl 0x8(%rdi), %edx
movq (%rdi), %r8
xorl %eax, %eax
testl %edx, %edx
cmovlel %eax, %edx
cmpq %rax, %rdx
je 0x6fe3
cmpb (%r8,%rax), %cl
jne 0x6fe3
movb 0x1(%rsi,%rax), %cl
incq %rax
testb %cl, %cl
jne 0x6fcb
jmp 0x6fe8
xorl %eax, %eax
retq
xorl %eax, %eax
cmpl 0x8(%rdi), %eax
sete %al
retq
nop