LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/CMU-SAFARI[P]ramulator/src/HBM.cpp
// Function: ramulator::HBM::init_speed()
void HBM::init_speed()
{
    const static int RFC_TABLE[int(Speed::MAX)][int(Org::MAX)] = {
        {55, 80, 130}
    };
    const static int REFI1B_TABLE[int(Speed::MAX)][int(Org::MAX)] = {
        {64, 128, 256}
    };
    const static int XS_TABLE[int(Speed::MAX)][int(Org::MAX)] = {
        {60, 85, 135}
    };

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

// Assembly:
pushq %rax
cmpl $0x3e8, 0x3158(%rdi)    # imm = 0x3E8
jne 0xac811
movl 0x30b8(%rdi), %eax
sarl $0xa, %eax
cmpl $0x1, %eax
je 0xac7da
cmpl $0x2, %eax
je 0xac7d5
cmpl $0x4, %eax
jne 0xac82a
pushq $0x2
jmp 0xac7d7
pushq $0x1
popq %rax
jmp 0xac7dc
xorl %eax, %eax
shll $0x2, %eax
leaq 0x331fa(%rip), %rcx     # 0xdf9e0
movl (%rax,%rcx), %ecx
movl %ecx, 0x31b4(%rdi)
leaq 0x331f6(%rip), %rcx     # 0xdf9ec
movl (%rax,%rcx), %ecx
movl %ecx, 0x31bc(%rdi)
leaq 0x331f2(%rip), %rcx     # 0xdf9f8
movl (%rax,%rcx), %eax
movl %eax, 0x31cc(%rdi)
popq %rax
retq
leaq 0x24b41(%rip), %rdi     # 0xd1359
leaq 0x32f40(%rip), %rsi     # 0xdf75f
leaq 0x32f45(%rip), %rcx     # 0xdf76b
pushq $0x42
jmp 0xac841
leaq 0x24b28(%rip), %rdi     # 0xd1359
leaq 0x32f27(%rip), %rsi     # 0xdf75f
leaq 0x32f2c(%rip), %rcx     # 0xdf76b
pushq $0x48
popq %rdx
callq 0xb210
nop
// File: /workspace/github_cpp_makefile_star2_O2/CMU-SAFARI[P]ramulator/src/HBM.cpp
// Function: ramulator::HBM::init_rowopen()
void HBM::init_rowopen()
{
    // RD
    rowopen[int(Level::Bank)][int(Command::RD)] = [] (DRAM<HBM>* node, Command cmd, int id) {
        switch (int(node->state)) {
            case int(State::Closed): return false;
            case int(State::Opened): return true;
            default: assert(false);
        }};

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

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
leaq 0x1ac8(%rdi), %r14
movups 0x1ac8(%rdi), %xmm0
movq %rsp, %rdi
movaps %xmm0, (%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x1ac8(%rbx)
movups 0x1ad8(%rbx), %xmm0
leaq 0x1640(%rip), %rax      # 0xae120
movq %rax, 0x1ad8(%rbx)
movaps %xmm0, 0x10(%rdi)
leaq 0x15f6(%rip), %rax      # 0xae0e8
movq %rax, 0x1ae0(%rbx)
callq 0x96b6a
addq $0x1ae8, %rbx           # imm = 0x1AE8
movq %rbx, %rdi
movq %r14, %rsi
callq 0xae5b0
addq $0x28, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 $0x535, %eax            # imm = 0x535
je 0xafa13
cmpl $0x855, %eax            # imm = 0x855
je 0xafa17
cmpl $0x74a, %eax            # imm = 0x74A
je 0xafa0f
cmpl $0x640, %eax            # imm = 0x640
jne 0xafa97
pushq $0x1
jmp 0xafa19
pushq $0x2
jmp 0xafa19
xorl %eax, %eax
jmp 0xafa1a
pushq $0x3
popq %rax
movl 0x29b0(%rdi), %ecx
sarl $0xa, %ecx
cmpl $0x4, %ecx
je 0xafa3b
cmpl $0x8, %ecx
je 0xafa36
cmpl $0x6, %ecx
jne 0xafa7e
pushq $0x1
jmp 0xafa38
pushq $0x2
popq %rcx
jmp 0xafa3d
xorl %ecx, %ecx
shll $0x4, %ecx
leaq 0x30859(%rip), %rdx     # 0xe02a0
addq %rcx, %rdx
shll $0x2, %eax
movl (%rax,%rdx), %edx
movl %edx, 0x2c14(%rdi)
leaq 0x30873(%rip), %rdx     # 0xe02d0
addq %rcx, %rdx
movl (%rax,%rdx), %edx
movl %edx, 0x2c10(%rdi)
leaq 0x30890(%rip), %rdx     # 0xe0300
addq %rcx, %rdx
movl (%rax,%rdx), %eax
movl %eax, 0x2c28(%rdi)
popq %rax
retq
leaq 0x30376(%rip), %rdi     # 0xdfdfb
leaq 0x3033b(%rip), %rsi     # 0xdfdc7
leaq 0x30343(%rip), %rcx     # 0xdfdd6
pushq $0x59
jmp 0xafaae
leaq 0x218bb(%rip), %rdi     # 0xd1359
leaq 0x30322(%rip), %rsi     # 0xdfdc7
leaq 0x3032a(%rip), %rcx     # 0xdfdd6
pushq $0x53
popq %rdx
callq 0xb210
// File: /workspace/github_cpp_makefile_star2_O2/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 %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
leaq 0x15e0(%rdi), %r14
movups 0x15e0(%rdi), %xmm0
movq %rsp, %rdi
movaps %xmm0, (%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x15e0(%rbx)
movups 0x15f0(%rbx), %xmm0
leaq 0x1790(%rip), %rax      # 0xb14dc
movq %rax, 0x15f0(%rbx)
movaps %xmm0, 0x10(%rdi)
leaq 0x1746(%rip), %rax      # 0xb14a4
movq %rax, 0x15f8(%rbx)
callq 0x96b6a
addq $0x1600, %rbx           # imm = 0x1600
movq %rbx, %rdi
movq %r14, %rsi
callq 0xb194c
addq $0x28, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0xb2daf
cmpl $0xc80, %eax            # imm = 0xC80
je 0xb2daa
cmpl $0x960, %eax            # imm = 0x960
jne 0xb2e3d
pushq $0x1
jmp 0xb2dac
pushq $0x2
popq %rax
jmp 0xb2db1
xorl %eax, %eax
movl 0x28ec(%rdi), %ecx
sarl $0xa, %ecx
addl $-0x2, %ecx
cmpl $0x3, %ecx
jae 0xb2e24
movl %ecx, %ecx
imulq $0xc, %rcx, %rcx
leaq 0x2dc61(%rip), %rdx     # 0xe0a30
addq %rcx, %rdx
shll $0x2, %eax
movl (%rax,%rdx), %edx
movl %edx, 0x2ae0(%rdi)
leaq 0x2dc7b(%rip), %rdx     # 0xe0a60
addq %rcx, %rdx
movl (%rax,%rdx), %edx
movl %edx, 0x2adc(%rdi)
movslq 0x2908(%rdi), %rdx
imulq $0xc, %rdx, %rdx
leaq 0x2dc8d(%rip), %rsi     # 0xe0a90
addq %rdx, %rsi
movl (%rax,%rsi), %edx
movl %edx, 0x2ae4(%rdi)
leaq 0x2dcaa(%rip), %rdx     # 0xe0ac0
addq %rcx, %rdx
movl (%rax,%rdx), %eax
movl %eax, 0x2af4(%rdi)
popq %rax
retq
leaq 0x2cfd0(%rip), %rdi     # 0xdfdfb
leaq 0x2d872(%rip), %rsi     # 0xe06a4
leaq 0x2d87a(%rip), %rcx     # 0xe06b3
pushq $0x5c
jmp 0xb2e54
leaq 0x1e515(%rip), %rdi     # 0xd1359
leaq 0x2d859(%rip), %rsi     # 0xe06a4
leaq 0x2d861(%rip), %rcx     # 0xe06b3
pushq $0x56
popq %rdx
callq 0xb210
// File: /workspace/github_cpp_makefile_star2_O2/CMU-SAFARI[P]ramulator/src/MemoryFactory.cpp
// Function: ramulator::MemoryFactory<ramulator::WideIO2>::create(ramulator::Config const&, int)
MemoryBase *MemoryFactory<WideIO2>::create(const Config& configs, int cacheline) {
    int channels = stoi(configs["channels"], NULL, 0);
    int ranks = stoi(configs["ranks"], NULL, 0);
    validate(channels, ranks, configs);

    const string& org_name = configs["org"];
    const string& speed_name = configs["speed"];

    WideIO2 *spec = new WideIO2(org_name, speed_name, channels);

    extend_channel_width(spec, cacheline);

    return (MemoryBase *)populate_memory(configs, spec, channels, ranks);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x70, %rsp
movl %esi, %ebp
movq %rdi, %rbx
leaq 0x26b1e(%rip), %rsi     # 0xdc900
leaq 0x10(%rsp), %rdi
leaq 0x50(%rsp), %rdx
callq 0x10eea
leaq 0x30(%rsp), %rdi
leaq 0x10(%rsp), %rdx
movq %rbx, %rsi
callq 0x10f26
leaq 0x30(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x1e04b
movl %eax, %r14d
leaq 0x30(%rsp), %rdi
callq 0xb568
leaq 0x10(%rsp), %rdi
callq 0xb568
leaq 0x26ada(%rip), %rsi     # 0xdc909
leaq 0x10(%rsp), %rdi
leaq 0x50(%rsp), %rdx
callq 0x10eea
leaq 0x30(%rsp), %rdi
leaq 0x10(%rsp), %rdx
movq %rbx, %rsi
callq 0x10f26
leaq 0x30(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x1e04b
movl %eax, %r15d
leaq 0x30(%rsp), %rdi
callq 0xb568
leaq 0x10(%rsp), %rdi
callq 0xb568
movl %r14d, %edi
movl %r15d, %esi
callq 0xb5d5c
leaq 0x1b500(%rip), %rsi     # 0xd1387
leaq 0x10(%rsp), %rdi
leaq 0x50(%rsp), %rdx
callq 0x10eea
leaq 0x30(%rsp), %rdi
leaq 0x10(%rsp), %rdx
movq %rbx, %rsi
callq 0x10f26
leaq 0x10(%rsp), %rdi
callq 0xb568
leaq 0x1b4d2(%rip), %rsi     # 0xd138b
leaq 0x50(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x10eea
leaq 0x10(%rsp), %rdi
leaq 0x50(%rsp), %rdx
movq %rbx, %rsi
callq 0x10f26
leaq 0x50(%rsp), %rdi
callq 0xb568
movl $0x2a30, %edi           # imm = 0x2A30
callq 0xb2d0
movq %rax, %r12
leaq 0x30(%rsp), %rsi
leaq 0x10(%rsp), %rdx
movq %rax, %rdi
movl %r14d, %ecx
callq 0xcf218
movq %r12, %rdi
movl %ebp, %esi
callq 0xb6252
movq %rbx, %rdi
movq %r12, %rsi
movl %r14d, %edx
movl %r15d, %ecx
callq 0xb62be
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0xb568
leaq 0x30(%rsp), %rdi
callq 0xb568
movq %rbx, %rax
addq $0x70, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movl $0x2a30, %esi           # imm = 0x2A30
movq %r12, %rdi
callq 0xb2e0
jmp 0xb5f94
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
jmp 0xb5f99
movq %rax, %rbx
jmp 0xb5f9e
jmp 0xb5f82
jmp 0xb5f8c
jmp 0xb5f73
jmp 0xb5f82
jmp 0xb5f8c
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0xb568
jmp 0xb5f85
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
jmp 0xb5fa3
movq %rax, %rbx
jmp 0xb5fa8
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0xb568
leaq 0x30(%rsp), %rdi
callq 0xb568
movq %rbx, %rdi
callq 0xb4d0
// File: /workspace/github_cpp_makefile_star2_O2/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), %r8d
movl 0x28b4(%rdi), %eax
imull %r8d, %eax
pushq $0x8
popq %rcx
cltd
idivl %ecx
movl %eax, %ecx
movl %esi, %eax
cltd
idivl %ecx
testl %eax, %eax
jle 0xb6288
imull %eax, %ecx
cmpl %esi, %ecx
jne 0xb62a1
imull %r8d, %eax
movl %eax, 0x28b8(%rdi)
popq %rax
retq
leaq 0x2ae50(%rip), %rdi     # 0xe10df
leaq 0x2aea0(%rip), %rsi     # 0xe1136
leaq 0x2aead(%rip), %rcx     # 0xe114a
pushq $0x1c
jmp 0xb62b8
leaq 0x2af14(%rip), %rdi     # 0xe11bc
leaq 0x2ae87(%rip), %rsi     # 0xe1136
leaq 0x2ae94(%rip), %rcx     # 0xe114a
pushq $0x1f
popq %rdx
callq 0xb210
// File: /workspace/github_cpp_makefile_star2_O2/CMU-SAFARI[P]ramulator/src/MemoryFactory.h
// Function: ramulator::MemoryFactory<ramulator::WideIO2>::populate_memory(ramulator::Config const&, ramulator::WideIO2*, int, int)
static Memory<T> *populate_memory(const Config& configs, T *spec, int channels, int ranks) {
        int& default_ranks = spec->org_entry.count[int(T::Level::Rank)];
        int& default_channels = spec->org_entry.count[int(T::Level::Channel)];

        if (default_channels == 0) default_channels = channels;
        if (default_ranks == 0) default_ranks = ranks;

        vector<Controller<T> *> ctrls;
        for (int c = 0; c < channels; c++){
            DRAM<T>* channel = new DRAM<T>(spec, T::Level::Channel);
            channel->id = c;
            channel->regStats("");
            ctrls.push_back(new Controller<T>(configs, channel));
        }
        return new Memory<T>(configs, ctrls);
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, 0x8(%rsp)
cmpl $0x0, 0x28a0(%rsi)
jne 0xb62e6
movl %ebp, 0x28a0(%r14)
cmpl $0x0, 0x28a4(%r14)
jne 0xb62f7
movl %ecx, 0x28a4(%r14)
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rax
andq $0x0, 0x10(%rax)
xorl %ebx, %ebx
testl %ebp, %ebp
cmovlel %ebx, %ebp
movaps %xmm0, (%rax)
leaq 0x48(%rsp), %r13
cmpl %ebx, %ebp
je 0xb6393
movl $0x8f0, %edi            # imm = 0x8F0
callq 0xb2d0
movq %rax, %r12
movq %rax, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x62334
movl %ebx, 0x39c(%r12)
movq %r13, %rdi
leaq 0x21215(%rip), %rsi     # 0xd7558
leaq 0x7(%rsp), %rdx
callq 0x10eea
movq %r12, %rdi
movq %r13, %rsi
callq 0x626d4
movq %r13, %rdi
callq 0xb568
movl $0x11e0, %edi           # imm = 0x11E0
callq 0xb2d0
movq %rax, %r15
movq %rax, %rdi
movq 0x8(%rsp), %rsi
movq %r12, %rdx
callq 0x631a0
movq %r15, 0x48(%rsp)
leaq 0x10(%rsp), %rdi
movq %r13, %rsi
callq 0xb666e
incl %ebx
jmp 0xb6313
movl $0xc68, %edi            # imm = 0xC68
callq 0xb2d0
movq %rax, %r14
leaq 0x30(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x650c6
leaq 0x30(%rsp), %rdx
movq %r14, %rdi
movq 0x8(%rsp), %rsi
callq 0x65114
leaq 0x30(%rsp), %rdi
callq 0x67c28
leaq 0x10(%rsp), %rdi
callq 0x67c28
movq %r14, %rax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x67c28
jmp 0xb63f9
movq %rax, %rbx
movl $0xc68, %esi            # imm = 0xC68
movq %r14, %rdi
jmp 0xb642e
jmp 0xb6437
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0xb568
jmp 0xb643a
movq %rax, %rbx
movl $0x11e0, %esi           # imm = 0x11E0
movq %r15, %rdi
jmp 0xb642e
jmp 0xb6437
movq %rax, %rbx
movl $0x8f0, %esi            # imm = 0x8F0
movq %r12, %rdi
callq 0xb2e0
jmp 0xb643a
jmp 0xb6437
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x67c28
movq %rbx, %rdi
callq 0xb4d0
// File: /workspace/github_cpp_makefile_star2_O2/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 0xb6c5b
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)
andl $0x0, 0x2814(%rdi)
cmpl $0x200, %eax            # imm = 0x200
je 0xb6c3f
cmpl $0x400, %eax            # imm = 0x400
je 0xb6c3b
cmpl $0x800, %eax            # imm = 0x800
jne 0xb6c44
pushq $0x44
jmp 0xb6c41
pushq $0x30
jmp 0xb6c41
pushq $0x28
popq %rax
jmp 0xb6c54
cmpl $0x1000, %eax           # imm = 0x1000
pushq $0x6c
popq %rcx
movl $0x90, %eax
cmovel %ecx, %eax
movl %eax, 0x282c(%rdi)
retq
pushq %rax
leaq 0x1a6f6(%rip), %rdi     # 0xd1359
leaq 0x2a769(%rip), %rsi     # 0xe13d3
leaq 0x2a76e(%rip), %rcx     # 0xe13df
pushq $0x44
popq %rdx
callq 0xb210
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
cmpb $0x0, 0x3a(%rdi)
je 0xba041
movq (%r14), %rax
movq (%rax), %rcx
cmpb $0x0, 0x58(%rcx)
jne 0xba04d
xorl %ecx, %ecx
movl %ecx, %r15d
movq 0x8(%r14), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %r15, %rcx
jbe 0xba04d
movq (%rax,%r15,8), %rax
movq 0x80(%rax), %rax
movq (%rax), %rdi
movq %rbx, %rsi
callq 0x9b5be
leal 0x1(%r15), %ecx
movq (%r14), %rax
jmp 0xba00f
leaq 0x60(%r14), %rdi
movq %rbx, %rsi
callq 0x9b5be
xorl %eax, %eax
movl %eax, %r15d
movq (%r14), %rax
movq 0x8(%r14), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %r15, %rcx
jbe 0xba077
movq (%rax,%r15,8), %rdi
movq %rbx, %rsi
callq 0xba50c
leal 0x1(%r15), %eax
jmp 0xba04f
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movsd 0x7c0(%rdi), %xmm0
addsd 0x16fe3(%rip), %xmm0    # 0xd1078
movsd %xmm0, 0x7c0(%rdi)
cvttsd2si %xmm0, %esi
movl $0x2faf080, %ecx        # imm = 0x2FAF080
movl %esi, %eax
cltd
idivl %ecx
testl %edx, %edx
jne 0xba0bd
leaq 0x27ae9(%rip), %rdi     # 0xe1b9f
xorl %eax, %eax
callq 0xb050
cmpb $0x1, 0x39(%rbx)
jne 0xba0c9
cmpb $0x0, 0x3a(%rbx)
jne 0xba0d2
movq 0x50(%rbx), %rdi
callq 0x9b770
xorl %eax, %eax
movl %eax, %r14d
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %r14, %rcx
jbe 0xba0f9
movq (%rax,%r14,8), %rdi
callq 0xba102
leal 0x1(%r14), %eax
jmp 0xba0d4
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 0xbb3f4
movq 0x30(%r14), %rcx
cmpq $-0x1, %rcx
je 0xba56e
movq 0x38(%r14), %rax
movq 0x480(%rbx), %rdx
cmpq %rdx, %rax
jle 0xba56e
cmpq %rcx, %rdx
cmovgq %rdx, %rcx
movq %rax, %rdx
subq %rcx, %rdx
cvtsi2sd %rdx, %xmm0
addsd 0x500(%rbx), %xmm0
movsd %xmm0, 0x500(%rbx)
movq %rax, 0x480(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpb $0x0, 0x38(%rdi)
je 0xba5ee
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
movq %rcx, %rdx
subq %rax, %rdx
sarq $0x3, %rdx
xorl %esi, %esi
movl %esi, %esi
cmpq %rsi, %rdx
jbe 0xba652
movq (%rax,%rsi,8), %rdi
incl %esi
cmpb $0x0, 0x47c(%rdi)
jne 0xba596
cmpl $0x0, 0x418(%rdi)
jne 0xba596
xorl %edx, %edx
movl %edx, %r14d
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %r14, %rcx
jbe 0xba656
movq (%rax,%r14,8), %rdi
callq 0xba676
addsd 0x30(%rbx), %xmm0
movsd %xmm0, 0x30(%rbx)
leal 0x1(%r14), %edx
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
jmp 0xba5bb
xorl %r14d, %r14d
xorpd %xmm0, %xmm0
movl %r14d, %r14d
movq (%rbx), %rcx
movq 0x8(%rbx), %rax
subq %rcx, %rax
sarq $0x3, %rax
cmpq %r14, %rax
setbe %al
jbe 0xba658
movq (%rcx,%r14,8), %rdi
cmpb $0x0, 0x47c(%rdi)
jne 0xba658
cmpl $0x0, 0x418(%rdi)
jne 0xba658
movq 0x18(%rbx), %rax
ucomisd (%rax,%r14,8), %xmm0
jbe 0xba64d
callq 0xba676
movq 0x18(%rbx), %rax
movsd %xmm0, (%rax,%r14,8)
addsd 0x30(%rbx), %xmm0
movsd %xmm0, 0x30(%rbx)
xorpd %xmm0, %xmm0
incl %r14d
jmp 0xba5f5
xorl %eax, %eax
jmp 0xba658
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/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), %rax
subq %rcx, %rax
sarq $0x3, %rax
xorl %esi, %esi
movl %esi, %edx
cmpq %rdx, %rax
jbe 0xba6cb
movq (%rcx,%rdx,8), %rdi
leal 0x1(%rdx), %esi
cmpb $0x0, 0x1d8(%rdi)
jne 0xba6b4
cmpq %rdx, %rax
setbe %al
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
sarq $0x3, %rdx
xorl %eax, %eax
xorl %esi, %esi
movl %esi, %esi
cmpq %rsi, %rdx
jbe 0xba707
movq (%rcx,%rsi,8), %rdi
cvttsd2si 0x598(%rdi), %rdi
addq %rdi, %rax
incl %esi
jmp 0xba6ec
retq
// File: /workspace/github_cpp_makefile_star2_O2/CMU-SAFARI[P]ramulator/src/Processor.cpp
// Function: ramulator::Processor::reset_stats()
void Processor::reset_stats() {
    for (unsigned int i = 0 ; i < cores.size(); i++) {
        cores[i]->reset_stats();
    }

    ipc = 0;

    for (unsigned int i = 0; i < ipcs.size(); i++)
        ipcs[i] = -1;
}

// Assembly:
xorl %eax, %eax
xorps %xmm0, %xmm0
movl %eax, %eax
movq (%rdi), %rcx
movq 0x8(%rdi), %rdx
subq %rcx, %rdx
sarq $0x3, %rdx
cmpq %rax, %rdx
jbe 0xba73f
movq (%rcx,%rax,8), %rcx
andq $0x0, 0x598(%rcx)
movups %xmm0, (%rcx)
incl %eax
jmp 0xba717
andq $0x0, 0x30(%rdi)
movq 0x18(%rdi), %rax
movq 0x20(%rdi), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
xorl %esi, %esi
movabsq $-0x4010000000000000, %rdx # imm = 0xBFF0000000000000
movl %esi, %esi
cmpq %rsi, %rcx
jbe 0xba76e
movq %rdx, (%rax,%rsi,8)
incl %esi
jmp 0xba75f
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/CMU-SAFARI[P]ramulator/src/Processor.cpp
// Function: ramulator::Trace::get_unfiltered_request(long&, long&, ramulator::Request::Type&)
bool Trace::get_unfiltered_request(long& bubble_cnt, long& req_addr, Request::Type& req_type)
{
    string line;
    getline(file, line);
    if (file.eof()) {
      file.clear();
      file.seekg(0, file.beg);
      getline(file, line);
      //return false;
    }
    size_t pos, end;
    bubble_cnt = std::stoul(line, &pos, 10);
    pos = line.find_first_not_of(' ', pos+1);
    req_addr = std::stoul(line.substr(pos), &end, 0);

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

    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 %r12
pushq %rbx
subq $0x50, %rsp
movq %rcx, %rbx
movq %rdx, %r14
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movq %rsi, %r15
movq %rdi, %r12
movb $0x0, (%rax)
addq $0x8, %r12
leaq 0x8(%rsp), %rsi
movq %r12, %rdi
callq 0xb0b0
movq (%r12), %rax
movq -0x18(%rax), %rdi
testb $0x2, 0x20(%r12,%rdi)
je 0xbb1ad
addq %r12, %rdi
xorl %esi, %esi
callq 0xb4a0
movq %r12, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0xb360
leaq 0x8(%rsp), %rsi
movq %r12, %rdi
callq 0xb0b0
leaq 0x8(%rsp), %rdi
movq %rsp, %rsi
pushq $0xa
popq %rdx
callq 0xbbb4b
movq %rax, (%r15)
movq (%rsp), %rdx
incq %rdx
leaq 0x8(%rsp), %r15
pushq $0x20
popq %rsi
movq %r15, %rdi
callq 0xb2a0
movq %rax, (%rsp)
leaq 0x28(%rsp), %rdi
pushq $-0x1
popq %rcx
movq %r15, %rsi
movq %rax, %rdx
callq 0xb2f0
leaq 0x28(%rsp), %rdi
leaq 0x48(%rsp), %rsi
xorl %ebp, %ebp
xorl %edx, %edx
callq 0xbbb4b
movq %rax, (%r14)
leaq 0x28(%rsp), %rdi
callq 0xb568
movq 0x48(%rsp), %rdx
addq (%rsp), %rdx
leaq 0x8(%rsp), %rdi
pushq $0x20
popq %rsi
callq 0xb2a0
movq %rax, (%rsp)
cmpq $-0x1, %rax
je 0xbb288
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
pushq $-0x1
popq %rcx
movq %rax, %rdx
callq 0xb2f0
leaq 0x28(%rsp), %rdi
movq (%rdi), %rax
movb (%rax), %r14b
callq 0xb568
cmpb $0x52, %r14b
je 0xbb288
movq (%rsp), %rdx
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
pushq $-0x1
popq %rcx
callq 0xb2f0
leaq 0x28(%rsp), %rdi
movq (%rdi), %rax
movb (%rax), %bpl
callq 0xb568
cmpb $0x57, %bpl
jne 0xbb2a3
pushq $0x1
popq %rbp
movl %ebp, (%rbx)
leaq 0x8(%rsp), %rdi
callq 0xb568
movb $0x1, %al
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x160af(%rip), %rdi     # 0xd1359
leaq 0x26823(%rip), %rsi     # 0xe1ad4
leaq 0x26bde(%rip), %rcx     # 0xe1e96
movl $0x196, %edx            # imm = 0x196
callq 0xb210
jmp 0xbb2d9
jmp 0xbb2d9
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0xb568
jmp 0xbb2dc
jmp 0xbb2d9
jmp 0xbb2d9
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0xb568
movq %rbx, %rdi
callq 0xb4d0
// File: /workspace/github_cpp_makefile_star2_O2/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 %r15
pushq %r14
pushq %rbx
movl 0x8(%rdi), %ecx
cmpl 0x4(%rdi), %ecx
jg 0xbb34b
testl %ecx, %ecx
je 0xbb340
movq %rdi, %r14
leaq 0x18(%rdi), %r15
xorl %ebx, %ebx
testl %ecx, %ecx
jle 0xbb342
cmpl (%r14), %ebx
jge 0xbb342
movslq 0x10(%r14), %rsi
movq %r15, %rdi
callq 0xbbb08
testq %rdx, (%rax)
je 0xbb342
movl 0x8(%r14), %ecx
movl 0x10(%r14), %eax
incl %eax
cltd
idivl 0x4(%r14)
movl %edx, 0x10(%r14)
decl %ecx
movl %ecx, 0x8(%r14)
incq %rbx
jmp 0xbb308
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
leaq 0x26ad9(%rip), %rdi     # 0xe1e2b
leaq 0x2677b(%rip), %rsi     # 0xe1ad4
leaq 0x26b04(%rip), %rcx     # 0xe1e64
movl $0x159, %edx            # imm = 0x159
callq 0xb210
// File: /workspace/github_cpp_makefile_star2_O2/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 0xbb3cc
movq %rdx, %r14
movl %esi, %ebp
movq %rdi, %rbx
addq $0x18, %rdi
movslq 0xc(%rbx), %rsi
callq 0xbbb08
testb %bpl, %bpl
je 0xbb39f
orq (%rax), %rdx
jmp 0xbb3a5
notq %rdx
andq (%rax), %rdx
movq %rdx, (%rax)
leaq 0x40(%rbx), %rdi
movslq 0xc(%rbx), %rsi
callq 0xbbb2a
movq %r14, (%rax)
movl 0xc(%rbx), %eax
incl %eax
cltd
idivl 0x4(%rbx)
movl %edx, 0xc(%rbx)
incl 0x8(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x26a58(%rip), %rdi     # 0xe1e2b
leaq 0x266fa(%rip), %rsi     # 0xe1ad4
leaq 0x26a58(%rip), %rcx     # 0xe1e39
movl $0x14d, %edx            # imm = 0x14D
callq 0xb210
nop
// File: /workspace/github_cpp_makefile_star2_O2/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:
movl 0x8(%rdi), %eax
testl %eax, %eax
je 0xbb46e
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x40(%rdi), %r15
movslq %edx, %rbp
leaq 0x18(%rdi), %rcx
movq %rcx, (%rsp)
xorl %r12d, %r12d
cmpl %eax, %r12d
jge 0xbb460
movl 0x10(%r14), %eax
addl %r12d, %eax
cltd
idivl 0x4(%r14)
movslq %edx, %r13
movq %r15, %rdi
movq %r13, %rsi
callq 0xbbb2a
movq (%rax), %rax
xorq %rbx, %rax
testq %rbp, %rax
jne 0xbb457
movq (%rsp), %rdi
movq %r13, %rsi
callq 0xbbb08
orq %rdx, (%rax)
incl %r12d
movl 0x8(%r14), %eax
jmp 0xbb41e
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 %rbx
subq $0x48, %rsp
movq %rdx, %rbx
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movq %rsi, %r14
movq %rdi, %r15
movb $0x0, (%rax)
addq $0x8, %r15
leaq 0x8(%rsp), %rsi
movq %r15, %rdi
callq 0xb0b0
movq (%r15), %rax
movq -0x18(%rax), %rax
movl 0x20(%r15,%rax), %ebp
testb $0x2, %bpl
jne 0xbb5ed
leaq 0x8(%rsp), %rdi
movq %rsp, %rsi
pushq $0x10
popq %rdx
callq 0xbbb4b
movq %rax, (%r14)
movq (%rsp), %rdx
incq %rdx
leaq 0x8(%rsp), %rdi
pushq $0x20
popq %rsi
callq 0xb2a0
movq %rax, (%rsp)
xorl %r14d, %r14d
cmpq $-0x1, %rax
je 0xbb5ea
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
pushq $-0x1
popq %rcx
movq %rax, %rdx
callq 0xb2f0
leaq 0x28(%rsp), %rdi
movq (%rdi), %rax
movb (%rax), %r15b
callq 0xb568
cmpb $0x52, %r15b
je 0xbb5ea
movq (%rsp), %rdx
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
pushq $-0x1
popq %rcx
callq 0xb2f0
leaq 0x28(%rsp), %rdi
movq (%rdi), %rax
movb (%rax), %r14b
callq 0xb568
cmpb $0x57, %r14b
jne 0xbb60b
pushq $0x1
popq %r14
movl %r14d, (%rbx)
testb $0x2, %bpl
sete %bl
leaq 0x8(%rsp), %rdi
callq 0xb568
movl %ebx, %eax
addq $0x48, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x15d47(%rip), %rdi     # 0xd1359
leaq 0x264bb(%rip), %rsi     # 0xe1ad4
leaq 0x268c5(%rip), %rcx     # 0xe1ee5
movl $0x1d7, %edx            # imm = 0x1D7
callq 0xb210
jmp 0xbb630
jmp 0xbb630
jmp 0xbb630
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0xb568
movq %rbx, %rdi
callq 0xb4d0
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 %rbx
subq $0x30, %rsp
movq %rdi, %rbx
leaq 0x268d2(%rip), %rsi     # 0xe1f2b
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 0xbb6e7
leaq 0x26899(%rip), %rsi     # 0xe1f2b
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x10eea
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x1385e
movq %rax, %rbx
addq $0x40, %rbx
leaq 0x10(%rsp), %rdi
callq 0xb568
leaq 0x2686b(%rip), %rsi     # 0xe1f31
movq %rbx, %rdi
callq 0x110e2
movl %eax, %ecx
movb $0x1, %al
testb %cl, %cl
jne 0xbb6e9
leaq 0x26858(%rip), %rsi     # 0xe1f35
movq %rbx, %rdi
callq 0x110e2
jmp 0xbb6e9
xorl %eax, %eax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq
jmp 0xbb6f7
jmp 0xbb706
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0xb568
jmp 0xbb709
movq %rax, %rbx
movq %rbx, %rdi
callq 0xb4d0
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 %rbx
subq $0x30, %rsp
movq %rdi, %rbx
leaq 0x26806(%rip), %rsi     # 0xe1f2b
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 0xbb7b3
leaq 0x267cd(%rip), %rsi     # 0xe1f2b
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x10eea
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x1385e
movq %rax, %rbx
addq $0x40, %rbx
leaq 0x10(%rsp), %rdi
callq 0xb568
leaq 0x2679f(%rip), %rsi     # 0xe1f31
movq %rbx, %rdi
callq 0x110e2
movl %eax, %ecx
movb $0x1, %al
testb %cl, %cl
jne 0xbb7b5
leaq 0x20c2a(%rip), %rsi     # 0xdc3d3
movq %rbx, %rdi
callq 0x110e2
jmp 0xbb7b5
xorl %eax, %eax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq
jmp 0xbb7c3
jmp 0xbb7d2
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0xb568
jmp 0xbb7d5
movq %rax, %rbx
movq %rbx, %rdi
callq 0xb4d0
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 %rdi, %rbx
movq %rdi, 0x8(%rdi)
movq %rdi, (%rdi)
andq $0x0, 0x10(%rdi)
movq %rsi, %r12
leaq 0x18(%rdi), %r14
movq %r14, 0x20(%rdi)
movq %r14, 0x18(%rdi)
andq $0x0, 0x28(%rdi)
leaq 0x30(%rdi), %r15
movq %r15, %rdi
movq %rdx, %rsi
callq 0xbb7de
andq $0x0, 0x50(%rbx)
movq %r12, %rdi
callq 0xbb646
testb %al, %al
je 0xbb875
andl $0x0, 0x58(%rbx)
jmp 0xbb891
movq %r12, %rdi
callq 0xbb712
testb %al, %al
je 0xbb88a
movl $0x2, 0x58(%rbx)
jmp 0xbb891
movl $0x3, 0x5c(%rbx)
movq %r12, %rdi
callq 0xbb712
testb %al, %al
je 0xbb8a6
movl $0x2, 0x5c(%rbx)
jmp 0xbb8c2
movq %r12, %rdi
callq 0xbb646
testb %al, %al
je 0xbb8bb
movl $0x1, 0x5c(%rbx)
jmp 0xbb8c2
movl $0x3, 0x5c(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %r12
jmp 0xbb8de
movq %rax, %r12
movq %r15, %rdi
callq 0x96b6a
movq %r14, %rdi
callq 0xbbb68
movq %rbx, %rdi
callq 0xbbb68
movq %r12, %rdi
callq 0xb4d0
// File: /workspace/github_cpp_makefile_star2_O2/CMU-SAFARI[P]ramulator/src/Refresh.cpp
// Function: ramulator::Refresh<ramulator::DSARP>::Refresh(ramulator::Controller<ramulator::DSARP>*)
Refresh<DSARP>::Refresh(Controller<DSARP>* ctrl) : ctrl(ctrl) {
  clk = refreshed = 0;
  max_rank_count = ctrl->channel->children.size();
  max_bank_count = ctrl->channel->spec->org_entry.count[(int)DSARP::Level::Bank];
  max_sa_count = ctrl->channel->spec->org_entry.count[(int)DSARP::Level::SubArray];

  // Init refresh counters
  for (int r = 0; r < max_rank_count; r++) {
    bank_ref_counters.push_back(0);
    bank_refresh_backlog.push_back(new vector<int>(max_bank_count, 0));
    vector<int> sa_counters(ctrl->channel->spec->org_entry.count[(int)DSARP::Level::SubArray], 0);
    subarray_ref_counters.push_back(sa_counters);
  }

  level_chan = (int)DSARP::Level::Channel;
  level_rank = (int)DSARP::Level::Rank;
  level_bank = (int)DSARP::Level::Bank;
  level_sa   = (int)DSARP::Level::SubArray;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, %r12
leaq 0x78eb8(%rip), %rax     # 0x1355a0
movq %rax, (%rdi)
movq %rsi, 0x8(%rdi)
leaq 0x20(%rdi), %rax
movq %rax, 0x20(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rdi)
andq $0x0, 0x30(%rdi)
leaq 0x50(%rdi), %rax
movq %rax, 0x18(%rsp)
leaq 0x68(%rdi), %rax
movq %rax, 0x10(%rsp)
movups %xmm0, 0x50(%rdi)
movups %xmm0, 0x60(%rdi)
movups %xmm0, 0x70(%rdi)
andl $0x0, 0x80(%rdi)
movabsq $-0x7fffffff8, %rax     # imm = 0xFFFFFFF800000008
movq %rax, 0x84(%rdi)
movl $0xfffffffa, 0x8c(%rdi) # imm = 0xFFFFFFFA
movb $0x0, 0x90(%rdi)
movups %xmm0, 0x10(%rdi)
movq %rsi, 0x28(%rsp)
movq 0x1098(%rsi), %rcx
movq 0x3b8(%rcx), %rax
subq 0x3b0(%rcx), %rax
shrq $0x3, %rax
movl %eax, 0x38(%rdi)
movq 0x390(%rcx), %rcx
movl 0x30d0(%rcx), %edx
movl %edx, 0x3c(%rdi)
movl 0x30d4(%rcx), %ecx
movl %ecx, 0x80(%rdi)
xorl %r13d, %r13d
leaq 0x30(%rsp), %rbp
leaq 0xc(%rsp), %rbx
leaq 0xb(%rsp), %r14
cmpl %eax, %r13d
jge 0xbc83d
andl $0x0, 0x30(%rsp)
movq 0x20(%rsp), %rdi
movq %rbp, %rsi
callq 0x1bfb0
pushq $0x18
popq %rdi
callq 0xb2d0
movq %rax, %r15
movslq 0x3c(%r12), %rsi
andl $0x0, 0xc(%rsp)
movq %rax, %rdi
movq %rbx, %rdx
movq %r14, %rcx
callq 0x1bea0
movq %r15, 0x30(%rsp)
movq 0x18(%rsp), %rdi
movq %rbp, %rsi
callq 0x1c0ea
movq 0x28(%rsp), %rax
movq 0x1098(%rax), %rax
movq 0x390(%rax), %rax
movslq 0x30d4(%rax), %rsi
andl $0x0, 0xc(%rsp)
movq %rbp, %rdi
movq %rbx, %rdx
movq %r14, %rcx
callq 0x1bea0
movq 0x10(%rsp), %rdi
movq %rbp, %rsi
callq 0x20228
movq %rbp, %rdi
callq 0x1b7dc
incl %r13d
movl 0x38(%r12), %eax
jmp 0xbc79e
movaps 0x25a3c(%rip), %xmm0    # 0xe2280
movups %xmm0, 0x40(%r12)
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xbc87e
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x1b7dc
jmp 0xbc881
jmp 0xbc87e
movq %rax, %rbx
pushq $0x18
popq %rsi
movq %r15, %rdi
callq 0xb2e0
jmp 0xbc881
jmp 0xbc87e
movq %rax, %rbx
movq 0x10(%rsp), %rdi
callq 0x1bef6
movq 0x18(%rsp), %rdi
callq 0x1c316
movq 0x20(%rsp), %rdi
callq 0x1b7dc
movq %rbx, %rdi
callq 0xb4d0
nop
// File: /workspace/github_cpp_makefile_star2_O2/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
movq 0x8(%rdi), %rax
movq 0x10(%rdi), %rcx
incq %rcx
movq %rcx, 0x10(%rdi)
movq 0x1098(%rax), %rdx
movq 0x390(%rdx), %rdx
movzbl 0x31f8(%rdx), %ebp
movl %ebp, %esi
xorl $0x1, %esi
movslq 0x31cc(%rdx,%rsi,4), %r14
movl (%rdx), %edx
cmpl $0x4, %edx
je 0xbcfb8
cmpl $0x2, %edx
jne 0xbcfee
cmpb $0x0, 0x90(%rbx)
jne 0xbcfd6
cmpb $0x1, 0x1190(%rax)
jne 0xbcfd6
movq %rbx, %rdi
callq 0xbccfc
movq 0x8(%rbx), %rax
movb 0x1190(%rax), %al
movb %al, 0x90(%rbx)
movq %rbx, %rdi
callq 0xbc8a8
movq 0x10(%rbx), %rcx
subq 0x18(%rbx), %rcx
cmpq %r14, %rcx
jge 0xbcffc
popq %rbx
popq %r14
popq %rbp
retq
movzbl %bpl, %esi
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0xbcb4a
// File: /workspace/github_cpp_makefile_star2_O2/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 %rbx
subq $0x28, %rsp
cmpl $0x640, 0x2898(%rdi)    # imm = 0x640
jne 0xc306c
movq %rdi, %rbx
movl 0x2724(%rdi), %ebp
movl 0x273c(%rdi), %eax
imull 0x2728(%rdi), %eax
andl $0xffffe000, %eax       # imm = 0xFFFFE000
xorl %ecx, %ecx
cmpl $0x2000, %eax           # imm = 0x2000
sete %cl
movq 0x28e0(%rdi), %xmm0
movd %ecx, %xmm1
pshufd $0x50, %xmm1, %xmm1     # xmm1 = xmm1[0,0,1,1]
pslld $0x1f, %xmm1
psrad $0x1f, %xmm1
movdqa %xmm1, %xmm2
pandn 0x206f6(%rip), %xmm2    # 0xe3690
pand 0x206fe(%rip), %xmm1    # 0xe36a0
por %xmm2, %xmm1
pshufd $0xf5, %xmm1, %xmm2     # xmm2 = xmm1[1,1,3,3]
pmuludq %xmm0, %xmm1
pshufd $0xf5, %xmm0, %xmm0     # xmm0 = xmm0[1,1,3,3]
pmuludq %xmm2, %xmm0
punpckldq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
cvtdq2pd %xmm1, %xmm0
divpd 0x206e8(%rip), %xmm0    # 0xe36b0
movapd %xmm0, (%rsp)
callq 0xb0a0
movapd %xmm0, 0x10(%rsp)
movapd (%rsp), %xmm0
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
callq 0xb0a0
movapd 0x10(%rsp), %xmm1
unpcklpd %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0]
cvttpd2dq %xmm1, %xmm0
movlpd %xmm0, 0x28e0(%rbx)
movl $0x1, 0x28e8(%rbx)
movl 0x2900(%rbx), %eax
cmpl $0x200, %ebp            # imm = 0x200
je 0xc302f
cmpl $0x400, %ebp            # imm = 0x400
je 0xc302b
cmpl $0x800, %ebp            # imm = 0x800
jne 0xc3034
movl $0x88, %ecx
jmp 0xc3047
pushq $0x60
jmp 0xc3031
pushq $0x50
popq %rcx
jmp 0xc3047
cmpl $0x1000, %ebp           # imm = 0x1000
movl $0xd8, %edx
movl $0x120, %ecx            # imm = 0x120
cmovel %edx, %ecx
imull %eax, %ecx
cvtsi2sd %ecx, %xmm0
divsd 0x2066a(%rip), %xmm0    # 0xe36c0
callq 0xb0a0
cvttsd2si %xmm0, %eax
movl %eax, 0x2900(%rbx)
addq $0x28, %rsp
popq %rbx
popq %rbp
retq
leaq 0xe2e6(%rip), %rdi      # 0xd1359
leaq 0x20761(%rip), %rsi     # 0xe37db
leaq 0x2076a(%rip), %rcx     # 0xe37eb
pushq $0x44
popq %rdx
callq 0xb210
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 %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 0x158a(%rip), %rax      # 0xc4864
movq %rax, 0x1450(%rbx)
movaps %xmm0, 0x10(%rdi)
leaq 0x1540(%rip), %rax      # 0xc482c
movq %rax, 0x1458(%rbx)
callq 0x96b6a
addq $0x1460, %rbx           # imm = 0x1460
movq %rbx, %rdi
movq %r14, %rsi
callq 0xc4d18
addq $0x28, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 %rax
movq 0xb0(%rdi), %rcx
movq 0xb8(%rdi), %rsi
subq %rcx, %rsi
shrq $0x3, %rsi
leal 0x1(%rsi), %eax
pushq $0x2
popq %r8
cltd
idivl %r8d
movslq %esi, %rdx
xorl %r8d, %r8d
testl %eax, %eax
movl $0x0, %r9d
cmovgl %eax, %r9d
addl %r9d, %r9d
cmpq %r8, %r9
je 0xc6033
movsd (%rcx,%r8,8), %xmm0
movsd %xmm0, (%rcx,%r8,4)
leaq 0x1(%r8), %r10
cmpq %rdx, %r10
jge 0xc602d
addsd 0x8(%rcx,%r8,8), %xmm0
movsd %xmm0, (%rcx,%r8,4)
addq $0x2, %r8
jmp 0xc6006
leal 0x1(%rsi), %r9d
cmpl %r8d, %esi
setne %sil
cmpl %r8d, %r9d
setne %r8b
testb %r8b, %sil
jne 0xc6071
cltq
cmpq %rdx, %rax
jge 0xc605b
andq $0x0, (%rcx,%rax,8)
incq %rax
jmp 0xc604c
movupd 0x80(%rdi), %xmm0
addpd %xmm0, %xmm0
movupd %xmm0, 0x80(%rdi)
popq %rax
retq
leaq 0x1dfc8(%rip), %rdi     # 0xe4040
leaq 0x1df63(%rip), %rsi     # 0xe3fe2
leaq 0x1dfdb(%rip), %rcx     # 0xe4061
pushq $0x5b
popq %rdx
callq 0xb210