LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: NishadSaraf[P]Championship-Simulator/src/cache.cc
// Function: CACHE::operate()
void CACHE::operate()
{
    handle_fill();
    handle_writeback();
    handle_read();

    if (PQ.occupancy && (RQ.occupancy == 0))
        handle_prefetch();
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0x3b00
movq 0x8(%rsp), %rdi
callq 0x4ee0
movq 0x8(%rsp), %rdi
callq 0x64e0
movq 0x8(%rsp), %rax
cmpl $0x0, 0xad1c(%rax)
je 0x7f42
movq 0x8(%rsp), %rax
cmpl $0x0, 0x907c(%rax)
jne 0x7f42
movq 0x8(%rsp), %rdi
callq 0x7710
addq $0x18, %rsp
retq
nopw (%rax,%rax)
// File: NishadSaraf[P]Championship-Simulator/src/cache.cc
// Function: CACHE::get_way(unsigned long, unsigned int)
uint32_t CACHE::get_way(uint64_t address, uint32_t set)
{
    for (uint32_t way=0; way<NUM_WAY; way++) {
        if (block[set][way].valid && (block[set][way].tag == address)) 
            return way;
    }

    return NUM_WAY;
}

// Assembly:
movq %rdi, -0x10(%rsp)
movq %rsi, -0x18(%rsp)
movl %edx, -0x1c(%rsp)
movq -0x10(%rsp), %rax
movq %rax, -0x28(%rsp)
movl $0x0, -0x20(%rsp)
movq -0x28(%rsp), %rcx
movl -0x20(%rsp), %eax
cmpl 0x7374(%rcx), %eax
jae 0x7fe8
movq -0x28(%rsp), %rax
movq 0x7390(%rax), %rax
movl -0x1c(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movl -0x20(%rsp), %ecx
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
cmpb $0x0, (%rax)
je 0x7fd9
movq -0x28(%rsp), %rax
movq 0x7390(%rax), %rax
movl -0x1c(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movl -0x20(%rsp), %ecx
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movq 0x28(%rax), %rax
cmpq -0x18(%rsp), %rax
jne 0x7fd9
movl -0x20(%rsp), %eax
movl %eax, -0x4(%rsp)
jmp 0x7ff7
jmp 0x7fdb
movl -0x20(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rsp)
jmp 0x7f70
movq -0x28(%rsp), %rax
movl 0x7374(%rax), %eax
movl %eax, -0x4(%rsp)
movl -0x4(%rsp), %eax
retq
nopl (%rax)
// File: NishadSaraf[P]Championship-Simulator/src/cache.cc
// Function: CACHE::prefetch_line(unsigned long, unsigned long, unsigned long, int)
int CACHE::prefetch_line(uint64_t ip, uint64_t base_addr, uint64_t pf_addr, int fill_level)
{
    if (PQ.occupancy < PQ.SIZE) {
        if ((base_addr>>PAGE_SHIFT) == (pf_addr>>PAGE_SHIFT)) {
            
            PACKET pf_packet;
            pf_packet.fill_level = fill_level;
            pf_packet.cpu = cpu;
            //pf_packet.data_index = LQ.entry[lq_index].data_index;
            //pf_packet.lq_index = lq_index;
            pf_packet.address = pf_addr >> LOG2_BLOCK_SIZE;
            pf_packet.full_addr = pf_addr;
            //pf_packet.instr_id = LQ.entry[lq_index].instr_id;
            //pf_packet.rob_index = LQ.entry[lq_index].rob_index;
            pf_packet.ip = ip;
            pf_packet.type = PREFETCH;
            pf_packet.event_cycle = current_core_cycle[cpu];

            // give a dummy 0 as the IP of a prefetch
            add_pq(&pf_packet);

            return 1;
        }
    }

    return 0;
}

// Assembly:
subq $0x3b8, %rsp            # imm = 0x3B8
movq %rdi, 0x3a8(%rsp)
movq %rsi, 0x3a0(%rsp)
movq %rdx, 0x398(%rsp)
movq %rcx, 0x390(%rsp)
movl %r8d, 0x38c(%rsp)
movq 0x3a8(%rsp), %rcx
movq %rcx, (%rsp)
movl 0xad1c(%rcx), %eax
cmpl 0xad08(%rcx), %eax
jae 0x8cb5
movq 0x398(%rsp), %rax
shrq $0xc, %rax
movq 0x390(%rsp), %rcx
shrq $0xc, %rcx
cmpq %rcx, %rax
jne 0x8cb3
leaq 0x8(%rsp), %rdi
callq 0x9750
movq (%rsp), %rdi
movl 0x38c(%rsp), %eax
movl %eax, 0x10(%rsp)
movl 0x7348(%rdi), %eax
movl %eax, 0x338(%rsp)
movq 0x390(%rsp), %rax
shrq $0x6, %rax
movq %rax, 0x348(%rsp)
movq 0x390(%rsp), %rax
movq %rax, 0x350(%rsp)
movq 0x3a0(%rsp), %rax
movq %rax, 0x378(%rsp)
movb $0x2, 0x337(%rsp)
movl 0x7348(%rdi), %eax
movl %eax, %ecx
leaq 0x87231(%rip), %rax     # 0x8fec0
movq (%rax,%rcx,8), %rax
movq %rax, 0x380(%rsp)
movq (%rdi), %rax
leaq 0x8(%rsp), %rsi
callq *0x10(%rax)
movl $0x1, 0x3b4(%rsp)
jmp 0x8cc0
jmp 0x8cb5
movl $0x0, 0x3b4(%rsp)
movl 0x3b4(%rsp), %eax
addq $0x3b8, %rsp            # imm = 0x3B8
retq
nop
// File: NishadSaraf[P]Championship-Simulator/src/cache.cc
// Function: CACHE::kpc_prefetch_line(unsigned long, unsigned long, int, int, int, int, int)
int CACHE::kpc_prefetch_line(uint64_t base_addr, uint64_t pf_addr, int fill_level, int delta, int depth, int signature, int confidence)
{
    if (PQ.occupancy < PQ.SIZE) {
        if ((base_addr>>PAGE_SHIFT) == (pf_addr>>PAGE_SHIFT)) {
            
            PACKET pf_packet;
            pf_packet.fill_level = fill_level;
            pf_packet.cpu = cpu;
            //pf_packet.data_index = LQ.entry[lq_index].data_index;
            //pf_packet.lq_index = lq_index;
            pf_packet.address = pf_addr >> LOG2_BLOCK_SIZE;
            pf_packet.full_addr = pf_addr;
            //pf_packet.instr_id = LQ.entry[lq_index].instr_id;
            //pf_packet.rob_index = LQ.entry[lq_index].rob_index;
            pf_packet.ip = 0;
            pf_packet.type = PREFETCH;
            pf_packet.delta = delta;
            pf_packet.depth = depth;
            pf_packet.signature = signature;
            pf_packet.confidence = confidence;
            pf_packet.event_cycle = current_core_cycle[cpu];

            // give a dummy 0 as the IP of a prefetch
            add_pq(&pf_packet);

            STATS.pf_issued++;

            return 1;
        }
    }

    return 0;
}

// Assembly:
subq $0x3b8, %rsp            # imm = 0x3B8
movl 0x3c8(%rsp), %eax
movl 0x3c0(%rsp), %eax
movq %rdi, 0x3a8(%rsp)
movq %rsi, 0x3a0(%rsp)
movq %rdx, 0x398(%rsp)
movl %ecx, 0x394(%rsp)
movl %r8d, 0x390(%rsp)
movl %r9d, 0x38c(%rsp)
movq 0x3a8(%rsp), %rcx
movq %rcx, (%rsp)
movl 0xad1c(%rcx), %eax
cmpl 0xad08(%rcx), %eax
jae 0x8e28
movq 0x3a0(%rsp), %rax
shrq $0xc, %rax
movq 0x398(%rsp), %rcx
shrq $0xc, %rcx
cmpq %rcx, %rax
jne 0x8e26
leaq 0x8(%rsp), %rdi
callq 0x9750
movq (%rsp), %rdi
movl 0x394(%rsp), %eax
movl %eax, 0x10(%rsp)
movl 0x7348(%rdi), %eax
movl %eax, 0x338(%rsp)
movq 0x398(%rsp), %rax
shrq $0x6, %rax
movq %rax, 0x348(%rsp)
movq 0x398(%rsp), %rax
movq %rax, 0x350(%rsp)
movq $0x0, 0x378(%rsp)
movb $0x2, 0x337(%rsp)
movl 0x390(%rsp), %eax
movl %eax, 0x20(%rsp)
movl 0x38c(%rsp), %eax
movl %eax, 0x24(%rsp)
movl 0x3c0(%rsp), %eax
movl %eax, 0x28(%rsp)
movl 0x3c8(%rsp), %eax
movl %eax, 0x2c(%rsp)
movl 0x7348(%rdi), %eax
movl %eax, %ecx
leaq 0x870d4(%rip), %rax     # 0x8fec0
movq (%rax,%rcx,8), %rax
movq %rax, 0x380(%rsp)
movq (%rdi), %rax
leaq 0x8(%rsp), %rsi
callq *0x10(%rax)
movq (%rsp), %rax
movq 0x102c8(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x102c8(%rax)
movl $0x1, 0x3b4(%rsp)
jmp 0x8e33
jmp 0x8e28
movl $0x0, 0x3b4(%rsp)
movl 0x3b4(%rsp), %eax
addq $0x3b8, %rsp            # imm = 0x3B8
retq
nopw %cs:(%rax,%rax)
// File: NishadSaraf[P]Championship-Simulator/src/cache.cc
// Function: CACHE::get_occupancy(unsigned char)
uint32_t CACHE::get_occupancy(uint8_t queue_type)
{
    if (queue_type == 0)
        return MSHR.occupancy;
    else if (queue_type == 1)
        return RQ.occupancy;
    else if (queue_type == 2)
        return WQ.occupancy;
    else if (queue_type == 3)
        return PQ.occupancy;

    return 0;
}

// Assembly:
movb %sil, %al
movq %rdi, -0x10(%rsp)
movb %al, -0x11(%rsp)
movq -0x10(%rsp), %rax
movq %rax, -0x20(%rsp)
movzbl -0x11(%rsp), %eax
cmpl $0x0, %eax
jne 0x9621
movq -0x20(%rsp), %rax
movl 0xc9bc(%rax), %eax
movl %eax, -0x4(%rsp)
jmp 0x9680
movzbl -0x11(%rsp), %eax
cmpl $0x1, %eax
jne 0x963c
movq -0x20(%rsp), %rax
movl 0x907c(%rax), %eax
movl %eax, -0x4(%rsp)
jmp 0x9680
movzbl -0x11(%rsp), %eax
cmpl $0x2, %eax
jne 0x9657
movq -0x20(%rsp), %rax
movl 0x73dc(%rax), %eax
movl %eax, -0x4(%rsp)
jmp 0x9680
movzbl -0x11(%rsp), %eax
cmpl $0x3, %eax
jne 0x9672
movq -0x20(%rsp), %rax
movl 0xad1c(%rax), %eax
movl %eax, -0x4(%rsp)
jmp 0x9680
jmp 0x9674
jmp 0x9676
jmp 0x9678
movl $0x0, -0x4(%rsp)
movl -0x4(%rsp), %eax
retq
nopw %cs:(%rax,%rax)
// File: NishadSaraf[P]Championship-Simulator/src/cache.cc
// Function: CACHE::get_size(unsigned char)
uint32_t CACHE::get_size(uint8_t queue_type)
{
    if (queue_type == 0)
        return MSHR.SIZE;
    else if (queue_type == 1)
        return RQ.SIZE;
    else if (queue_type == 2)
        return WQ.SIZE;
    else if (queue_type == 3)
        return PQ.SIZE;

    return 0;
}

// Assembly:
movb %sil, %al
movq %rdi, -0x10(%rsp)
movb %al, -0x11(%rsp)
movq -0x10(%rsp), %rax
movq %rax, -0x20(%rsp)
movzbl -0x11(%rsp), %eax
cmpl $0x0, %eax
jne 0x96c1
movq -0x20(%rsp), %rax
movl 0xc9a8(%rax), %eax
movl %eax, -0x4(%rsp)
jmp 0x9720
movzbl -0x11(%rsp), %eax
cmpl $0x1, %eax
jne 0x96dc
movq -0x20(%rsp), %rax
movl 0x9068(%rax), %eax
movl %eax, -0x4(%rsp)
jmp 0x9720
movzbl -0x11(%rsp), %eax
cmpl $0x2, %eax
jne 0x96f7
movq -0x20(%rsp), %rax
movl 0x73c8(%rax), %eax
movl %eax, -0x4(%rsp)
jmp 0x9720
movzbl -0x11(%rsp), %eax
cmpl $0x3, %eax
jne 0x9712
movq -0x20(%rsp), %rax
movl 0xad08(%rax), %eax
movl %eax, -0x4(%rsp)
jmp 0x9720
jmp 0x9714
jmp 0x9716
jmp 0x9718
movl $0x0, -0x4(%rsp)
movl -0x4(%rsp), %eax
retq
nopw %cs:(%rax,%rax)
// File: NishadSaraf[P]Championship-Simulator/inc/block.h
// Function: PACKET::PACKET()
PACKET() {
        instruction = 0;
        tlb_access = 0;
        scheduled = 0;
        translated = 0;
        fetched = 0;
        prefetched = 0;
        drc_tag_read = 0;

        returned = 0;
        asid[0] = UINT8_MAX;
        asid[1] = UINT8_MAX;
        type = 0;

        fill_level = -1; // FIXME: grep for -1 initialization and we need to manually set these values when packet (or other varilables) get reset
        rob_signal = -1;
        rob_index = -1;
        producer = -1;
        delta = 0;
        depth = 0;
        signature = 0;
        confidence = 0;

        for (uint32_t i=0; i<ROB_SIZE; i++) {
            rob_index_depend_on_me[i] = 0;
            lq_index_depend_on_me[i] = 0;
            sq_index_depend_on_me[i] = 0;
        }
        is_producer = 0;
        instr_merged = 0;
        load_merged = 0;
        store_merged = 0;

        cpu = NUM_CPUS;
        data_index = 0;
        lq_index = 0;
        sq_index = 0;

        address = 0;
        full_addr = 0;
        instruction_pa = 0;
        data = 0;
        instr_id = 0;
        ip = 0;
        event_cycle = UINT64_MAX;
    }

// Assembly:
movq %rdi, -0x8(%rsp)
movq -0x8(%rsp), %rax
movq %rax, -0x18(%rsp)
movb $0x0, (%rax)
movb $0x0, 0x1(%rax)
movb $0x0, 0x2(%rax)
movb $0x0, 0x3(%rax)
movb $0x0, 0x4(%rax)
movb $0x0, 0x5(%rax)
movb $0x0, 0x6(%rax)
movb $0x0, 0x32c(%rax)
movb $-0x1, 0x32d(%rax)
movb $-0x1, 0x32e(%rax)
movb $0x0, 0x32f(%rax)
movl $0xffffffff, 0x8(%rax)  # imm = 0xFFFFFFFF
movl $0xffffffff, 0xc(%rax)  # imm = 0xFFFFFFFF
movl $0xffffffff, 0x10(%rax) # imm = 0xFFFFFFFF
movl $0xffffffff, 0x14(%rax) # imm = 0xFFFFFFFF
movl $0x0, 0x18(%rax)
movl $0x0, 0x1c(%rax)
movl $0x0, 0x20(%rax)
movl $0x0, 0x24(%rax)
movl $0x0, -0xc(%rsp)
cmpl $0x100, -0xc(%rsp)      # imm = 0x100
jae 0x9813
movq -0x18(%rsp), %rax
movl -0xc(%rsp), %ecx
movb $0x0, 0x29(%rax,%rcx)
movl -0xc(%rsp), %ecx
movb $0x0, 0x129(%rax,%rcx)
movl -0xc(%rsp), %ecx
movb $0x0, 0x229(%rax,%rcx)
movl -0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rsp)
jmp 0x97d6
movq -0x18(%rsp), %rax
movb $0x0, 0x28(%rax)
movb $0x0, 0x329(%rax)
movb $0x0, 0x32a(%rax)
movb $0x0, 0x32b(%rax)
movl $0x1, 0x330(%rax)
movl $0x0, 0x334(%rax)
movl $0x0, 0x338(%rax)
movl $0x0, 0x33c(%rax)
movq $0x0, 0x340(%rax)
movq $0x0, 0x348(%rax)
movq $0x0, 0x350(%rax)
movq $0x0, 0x360(%rax)
movq $0x0, 0x368(%rax)
movq $0x0, 0x370(%rax)
movq $-0x1, 0x378(%rax)
retq
nopw (%rax,%rax)
// File: NishadSaraf[P]Championship-Simulator/src/main.cc
// Function: record_roi_stats(unsigned int, CACHE*)
void record_roi_stats(uint32_t cpu, CACHE *cache)
{
    for (uint32_t i=0; i<NUM_TYPES; i++) {
        cache->roi_access[cpu][i] = cache->sim_access[cpu][i];
        cache->roi_hit[cpu][i] = cache->sim_hit[cpu][i];
        cache->roi_miss[cpu][i] = cache->sim_miss[cpu][i];
    }
}

// Assembly:
movl %edi, -0x4(%rsp)
movq %rsi, -0x10(%rsp)
movl $0x0, -0x14(%rsp)
cmpl $0x4, -0x14(%rsp)
jae 0xad20
movq -0x10(%rsp), %rax
addq $0x102e8, %rax          # imm = 0x102E8
movl -0x4(%rsp), %ecx
shlq $0x5, %rcx
addq %rcx, %rax
movl -0x14(%rsp), %ecx
movq (%rax,%rcx,8), %rdx
movq -0x10(%rsp), %rax
addq $0x10348, %rax          # imm = 0x10348
movl -0x4(%rsp), %ecx
shlq $0x5, %rcx
addq %rcx, %rax
movl -0x14(%rsp), %ecx
movq %rdx, (%rax,%rcx,8)
movq -0x10(%rsp), %rax
addq $0x10308, %rax          # imm = 0x10308
movl -0x4(%rsp), %ecx
shlq $0x5, %rcx
addq %rcx, %rax
movl -0x14(%rsp), %ecx
movq (%rax,%rcx,8), %rdx
movq -0x10(%rsp), %rax
addq $0x10368, %rax          # imm = 0x10368
movl -0x4(%rsp), %ecx
shlq $0x5, %rcx
addq %rcx, %rax
movl -0x14(%rsp), %ecx
movq %rdx, (%rax,%rcx,8)
movq -0x10(%rsp), %rax
addq $0x10328, %rax          # imm = 0x10328
movl -0x4(%rsp), %ecx
shlq $0x5, %rcx
addq %rcx, %rax
movl -0x14(%rsp), %ecx
movq (%rax,%rcx,8), %rdx
movq -0x10(%rsp), %rax
addq $0x10388, %rax          # imm = 0x10388
movl -0x4(%rsp), %ecx
shlq $0x5, %rcx
addq %rcx, %rax
movl -0x14(%rsp), %ecx
movq %rdx, (%rax,%rcx,8)
movl -0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rsp)
jmp 0xac51
retq
nopw %cs:(%rax,%rax)
// File: NishadSaraf[P]Championship-Simulator/src/main.cc
// Function: print_branch_stats()
void print_branch_stats()
{
    for (uint32_t i=0; i<NUM_CPUS; i++) {
        cout << endl << "CPU " << i << " Branch Prediction Accuracy: ";
        cout << (100.0*(ooo_cpu[i].num_branch - ooo_cpu[i].branch_mispredictions)) / ooo_cpu[i].num_branch;
        cout << "% MPKI: " << (1000.0*ooo_cpu[i].branch_mispredictions)/(ooo_cpu[i].num_retired - ooo_cpu[i].warmup_instructions) << endl;
    }
}

// Assembly:
subq $0x48, %rsp
movl $0x0, 0x44(%rsp)
cmpl $0x1, 0x44(%rsp)
jae 0xbd42
movq 0x1d402(%rip), %rdi     # 0x28fd0
movq %rdi, 0x8(%rsp)
movq 0x1d3de(%rip), %rsi     # 0x28fb8
callq 0x3250
movq %rax, %rdi
leaq 0x1799b(%rip), %rsi     # 0x23584
callq 0x3220
movq %rax, %rdi
movl 0x44(%rsp), %esi
callq 0x32c0
movq %rax, %rdi
leaq 0x17851(%rip), %rsi     # 0x23455
callq 0x3220
movq 0x8(%rsp), %rdi
movl 0x44(%rsp), %eax
imulq $0x64c80, %rax, %rdx    # imm = 0x64C80
leaq 0x1f620(%rip), %rcx     # 0x2b240
movq %rcx, 0x38(%rsp)
movq 0x3680(%rcx,%rdx), %rax
movq 0x3688(%rcx,%rdx), %rdx
movq %rax, %rcx
subq %rdx, %rcx
movq %rcx, %xmm0
movaps 0x17679(%rip), %xmm3    # 0x232c0
movaps %xmm3, 0x10(%rsp)
punpckldq %xmm3, %xmm0    # xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
movapd 0x17678(%rip), %xmm2    # 0x232d0
movaps %xmm2, 0x20(%rsp)
subpd %xmm2, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movsd 0x17674(%rip), %xmm1    # 0x232e8
mulsd %xmm1, %xmm0
movq %rax, %xmm1
punpckldq %xmm3, %xmm1    # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
callq 0x33e0
movq 0x8(%rsp), %rdi
leaq 0x177ce(%rip), %rsi     # 0x23473
callq 0x3220
movaps 0x10(%rsp), %xmm3
movaps 0x20(%rsp), %xmm2
movq %rax, %rdi
movq 0x38(%rsp), %rax
movl 0x44(%rsp), %ecx
imulq $0x64c80, %rcx, %rdx    # imm = 0x64C80
movq 0x3688(%rax,%rdx), %xmm0
punpckldq %xmm3, %xmm0    # xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
subpd %xmm2, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movsd 0x175f5(%rip), %xmm1    # 0x232e0
mulsd %xmm1, %xmm0
movq 0x8f0(%rax,%rdx), %rcx
movq 0x918(%rax,%rdx), %rax
subq %rcx, %rax
movq %rax, %xmm1
punpckldq %xmm3, %xmm1    # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
callq 0x33e0
movq %rax, %rdi
movq 0x1d28b(%rip), %rsi     # 0x28fb8
callq 0x3250
movl 0x44(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x44(%rsp)
jmp 0xbbbc
addq $0x48, %rsp
retq
nopw (%rax,%rax)
// File: NishadSaraf[P]Championship-Simulator/src/main.cc
// Function: reset_cache_stats(unsigned int, CACHE*)
void reset_cache_stats(uint32_t cpu, CACHE *cache)
{
    for (uint32_t i=0; i<NUM_TYPES; i++) {
        cache->ACCESS[i] = 0;
        cache->HIT[i] = 0;
        cache->MISS[i] = 0;
        cache->MSHR_MERGED[i] = 0;
        cache->STALL[i] = 0;

        cache->sim_access[cpu][i] = 0;
        cache->sim_hit[cpu][i] = 0;
        cache->sim_miss[cpu][i] = 0;
    }

    cache->RQ.ACCESS = 0;
    cache->RQ.MERGED = 0;
    cache->RQ.TO_CACHE = 0;

    cache->WQ.ACCESS = 0;
    cache->WQ.MERGED = 0;
    cache->WQ.TO_CACHE = 0;
    cache->WQ.FORWARD = 0;
    cache->WQ.FULL = 0;
}

// Assembly:
movl %edi, -0x4(%rsp)
movq %rsi, -0x10(%rsp)
movl $0x0, -0x14(%rsp)
cmpl $0x4, -0x14(%rsp)
jae 0xc1db
movq -0x10(%rsp), %rax
movl -0x14(%rsp), %ecx
movq $0x0, 0x72a8(%rax,%rcx,8)
movq -0x10(%rsp), %rax
movl -0x14(%rsp), %ecx
movq $0x0, 0x72c8(%rax,%rcx,8)
movq -0x10(%rsp), %rax
movl -0x14(%rsp), %ecx
movq $0x0, 0x72e8(%rax,%rcx,8)
movq -0x10(%rsp), %rax
movl -0x14(%rsp), %ecx
movq $0x0, 0x7308(%rax,%rcx,8)
movq -0x10(%rsp), %rax
movl -0x14(%rsp), %ecx
movq $0x0, 0x7328(%rax,%rcx,8)
movq -0x10(%rsp), %rax
addq $0x102e8, %rax          # imm = 0x102E8
movl -0x4(%rsp), %ecx
shlq $0x5, %rcx
addq %rcx, %rax
movl -0x14(%rsp), %ecx
movq $0x0, (%rax,%rcx,8)
movq -0x10(%rsp), %rax
addq $0x10308, %rax          # imm = 0x10308
movl -0x4(%rsp), %ecx
shlq $0x5, %rcx
addq %rcx, %rax
movl -0x14(%rsp), %ecx
movq $0x0, (%rax,%rcx,8)
movq -0x10(%rsp), %rax
addq $0x10328, %rax          # imm = 0x10328
movl -0x4(%rsp), %ecx
shlq $0x5, %rcx
addq %rcx, %rax
movl -0x14(%rsp), %ecx
movq $0x0, (%rax,%rcx,8)
movl -0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rsp)
jmp 0xc0f1
movq -0x10(%rsp), %rax
movq $0x0, 0x90a8(%rax)
movq -0x10(%rsp), %rax
movq $0x0, 0x90b8(%rax)
movq -0x10(%rsp), %rax
movq $0x0, 0x90c0(%rax)
movq -0x10(%rsp), %rax
movq $0x0, 0x7408(%rax)
movq -0x10(%rsp), %rax
movq $0x0, 0x7418(%rax)
movq -0x10(%rsp), %rax
movq $0x0, 0x7420(%rax)
movq -0x10(%rsp), %rax
movq $0x0, 0x7410(%rax)
movq -0x10(%rsp), %rax
movq $0x0, 0x7438(%rax)
retq
nopl (%rax)
// File: NishadSaraf[P]Championship-Simulator/src/main.cc
// Function: lg2(int)
int lg2(int n)
{
    int i, m = n, c = -1;
    for (i=0; m; i++) {
        m /= 2;
        c++;
    }
    return c;
}

// Assembly:
movl %edi, -0x4(%rsp)
movl -0x4(%rsp), %eax
movl %eax, -0xc(%rsp)
movl $0xffffffff, -0x10(%rsp) # imm = 0xFFFFFFFF
movl $0x0, -0x8(%rsp)
cmpl $0x0, -0xc(%rsp)
je 0xd10b
movl -0xc(%rsp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, -0xc(%rsp)
movl -0x10(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rsp)
movl -0x8(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rsp)
jmp 0xd0dc
movl -0x10(%rsp), %eax
retq
// File: NishadSaraf[P]Championship-Simulator/src/main.cc
// Function: rotl64(unsigned long, unsigned int)
uint64_t rotl64 (uint64_t n, unsigned int c)
{
    const unsigned int mask = (CHAR_BIT*sizeof(n)-1);

    assert ( (c<=mask) &&"rotate by type width or more");
    c &= mask;  // avoid undef behaviour with NDEBUG.  0 overhead for most types / compilers
    return (n<<c) | (n>>( (-c)&mask ));
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movl %esi, 0xc(%rsp)
movl $0x3f, 0x8(%rsp)
xorl %eax, %eax
cmpl $0x3f, 0xc(%rsp)
movb %al, 0x7(%rsp)
ja 0xd13a
movb $0x1, %al
movb %al, 0x7(%rsp)
jmp 0xd13a
movb 0x7(%rsp), %al
testb $0x1, %al
jne 0xd144
jmp 0xd146
jmp 0xd165
leaq 0x1656d(%rip), %rdi     # 0x236ba
leaq 0x1650f(%rip), %rsi     # 0x23663
movl $0x13f, %edx            # imm = 0x13F
leaq 0x16585(%rip), %rcx     # 0x236e5
callq 0x3160
movl 0xc(%rsp), %eax
andl $0x3f, %eax
movl %eax, 0xc(%rsp)
movq 0x10(%rsp), %rax
movl 0xc(%rsp), %ecx
shlq %cl, %rax
movq 0x10(%rsp), %rdx
xorl %ecx, %ecx
subl 0xc(%rsp), %ecx
andl $0x3f, %ecx
movl %ecx, %ecx
shrq %cl, %rdx
movq %rdx, %rcx
orq %rcx, %rax
addq $0x18, %rsp
retq
nopw (%rax,%rax)
// File: NishadSaraf[P]Championship-Simulator/src/dram_controller.cc
// Function: MEMORY_CONTROLLER::update_schedule_cycle(PACKET_QUEUE*)
void MEMORY_CONTROLLER::update_schedule_cycle(PACKET_QUEUE *queue)
{
    // update next_schedule_cycle
    uint64_t min_cycle = UINT64_MAX;
    uint32_t min_index = queue->SIZE;
    for (uint32_t i=0; i<queue->SIZE; i++) {
        /*
        DP (if (warmup_complete[queue->entry[min_index].cpu]) {
        cout << "[" << queue->NAME << "] " <<  __func__ << " instr_id: " << queue->entry[i].instr_id;
        cout << " index: " << i << " address: " << hex << queue->entry[i].address << dec << " scheduled: " << +queue->entry[i].scheduled;
        cout << " event: " << queue->entry[i].event_cycle << " min_cycle: " << min_cycle << endl;
        });
        */

        if (queue->entry[i].address && (queue->entry[i].scheduled == 0) && (queue->entry[i].event_cycle < min_cycle)) {
            min_cycle = queue->entry[i].event_cycle;
            min_index = i;
        }
    }
    
    queue->next_schedule_cycle = min_cycle;
    queue->next_schedule_index = min_index;
    if (min_index < queue->SIZE) {

        DP (if (warmup_complete[queue->entry[min_index].cpu]) {
        cout << "[" << queue->NAME << "] " <<  __func__ << " instr_id: " << queue->entry[min_index].instr_id;
        cout << " address: " << hex << queue->entry[min_index].address << " full_addr: " << queue->entry[min_index].full_addr;
        cout << " data: " << queue->entry[min_index].data << dec;
        cout << " event: " << queue->entry[min_index].event_cycle << " current: " << current_core_cycle[queue->entry[min_index].cpu] << " next: " << queue->next_schedule_cycle << endl; });
    }
}

// Assembly:
movq %rdi, -0x8(%rsp)
movq %rsi, -0x10(%rsp)
movq $-0x1, -0x18(%rsp)
movq -0x10(%rsp), %rax
movl 0x20(%rax), %eax
movl %eax, -0x1c(%rsp)
movl $0x0, -0x20(%rsp)
movl -0x20(%rsp), %eax
movq -0x10(%rsp), %rcx
cmpl 0x20(%rcx), %eax
jae 0x13618
movq -0x10(%rsp), %rax
movq 0x98(%rax), %rax
movl -0x20(%rsp), %ecx
imulq $0x380, %rcx, %rcx      # imm = 0x380
addq %rcx, %rax
cmpq $0x0, 0x340(%rax)
je 0x13606
movq -0x10(%rsp), %rax
movq 0x98(%rax), %rax
movl -0x20(%rsp), %ecx
imulq $0x380, %rcx, %rcx      # imm = 0x380
addq %rcx, %rax
movzbl 0x2(%rax), %eax
cmpl $0x0, %eax
jne 0x13606
movq -0x10(%rsp), %rax
movq 0x98(%rax), %rax
movl -0x20(%rsp), %ecx
imulq $0x380, %rcx, %rcx      # imm = 0x380
addq %rcx, %rax
movq 0x378(%rax), %rax
cmpq -0x18(%rsp), %rax
jae 0x13606
movq -0x10(%rsp), %rax
movq 0x98(%rax), %rax
movl -0x20(%rsp), %ecx
imulq $0x380, %rcx, %rcx      # imm = 0x380
addq %rcx, %rax
movq 0x378(%rax), %rax
movq %rax, -0x18(%rsp)
movl -0x20(%rsp), %eax
movl %eax, -0x1c(%rsp)
jmp 0x13608
movl -0x20(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rsp)
jmp 0x13557
movq -0x18(%rsp), %rcx
movq -0x10(%rsp), %rax
movq %rcx, 0x50(%rax)
movl -0x1c(%rsp), %ecx
movq -0x10(%rsp), %rax
movl %ecx, 0x40(%rax)
movl -0x1c(%rsp), %eax
movq -0x10(%rsp), %rcx
cmpl 0x20(%rcx), %eax
jae 0x13642
jmp 0x13642
retq
nopw %cs:(%rax,%rax)
// File: NishadSaraf[P]Championship-Simulator/src/dram_controller.cc
// Function: MEMORY_CONTROLLER::update_process_cycle(PACKET_QUEUE*)
void MEMORY_CONTROLLER::update_process_cycle(PACKET_QUEUE *queue)
{
    // update next_process_cycle
    uint64_t min_cycle = UINT64_MAX;
    uint32_t min_index = queue->SIZE;
    for (uint32_t i=0; i<queue->SIZE; i++) {
        if (queue->entry[i].scheduled && (queue->entry[i].event_cycle < min_cycle)) {
            min_cycle = queue->entry[i].event_cycle;
            min_index = i;
        }
    }
    
    queue->next_process_cycle = min_cycle;
    queue->next_process_index = min_index;
    if (min_index < queue->SIZE) {

        DP (if (warmup_complete[queue->entry[min_index].cpu]) {
        cout << "[" << queue->NAME << "] " <<  __func__ << " instr_id: " << queue->entry[min_index].instr_id;
        cout << " address: " << hex << queue->entry[min_index].address << " full_addr: " << queue->entry[min_index].full_addr;
        cout << " data: " << queue->entry[min_index].data << dec << " num_returned: " << queue->num_returned;
        cout << " event: " << queue->entry[min_index].event_cycle << " current: " << current_core_cycle[queue->entry[min_index].cpu] << " next: " << queue->next_process_cycle << endl; });
    }
}

// Assembly:
movq %rdi, -0x8(%rsp)
movq %rsi, -0x10(%rsp)
movq $-0x1, -0x18(%rsp)
movq -0x10(%rsp), %rax
movl 0x20(%rax), %eax
movl %eax, -0x1c(%rsp)
movl $0x0, -0x20(%rsp)
movl -0x20(%rsp), %eax
movq -0x10(%rsp), %rcx
cmpl 0x20(%rcx), %eax
jae 0x13711
movq -0x10(%rsp), %rax
movq 0x98(%rax), %rax
movl -0x20(%rsp), %ecx
imulq $0x380, %rcx, %rcx      # imm = 0x380
addq %rcx, %rax
cmpb $0x0, 0x2(%rax)
je 0x136ff
movq -0x10(%rsp), %rax
movq 0x98(%rax), %rax
movl -0x20(%rsp), %ecx
imulq $0x380, %rcx, %rcx      # imm = 0x380
addq %rcx, %rax
movq 0x378(%rax), %rax
cmpq -0x18(%rsp), %rax
jae 0x136ff
movq -0x10(%rsp), %rax
movq 0x98(%rax), %rax
movl -0x20(%rsp), %ecx
imulq $0x380, %rcx, %rcx      # imm = 0x380
addq %rcx, %rax
movq 0x378(%rax), %rax
movq %rax, -0x18(%rsp)
movl -0x20(%rsp), %eax
movl %eax, -0x1c(%rsp)
jmp 0x13701
movl -0x20(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rsp)
jmp 0x13677
movq -0x18(%rsp), %rcx
movq -0x10(%rsp), %rax
movq %rcx, 0x58(%rax)
movl -0x1c(%rsp), %ecx
movq -0x10(%rsp), %rax
movl %ecx, 0x44(%rax)
movl -0x1c(%rsp), %eax
movq -0x10(%rsp), %rcx
cmpl 0x20(%rcx), %eax
jae 0x1373b
jmp 0x1373b
retq
nopl (%rax)
// File: NishadSaraf[P]Championship-Simulator/src/dram_controller.cc
// Function: MEMORY_CONTROLLER::check_dram_queue(PACKET_QUEUE*, PACKET*)
int MEMORY_CONTROLLER::check_dram_queue(PACKET_QUEUE *queue, PACKET *packet)
{
    // search write queue
    for (uint32_t index=0; index<queue->SIZE; index++) {
        if (queue->entry[index].address == packet->address) {
            
            DP ( if (warmup_complete[packet->cpu]) {
            cout << "[" << queue->NAME << "] " << __func__ << " same entry instr_id: " << packet->instr_id << " prior_id: " << queue->entry[index].instr_id;
            cout << " address: " << hex << packet->address << " full_addr: " << packet->full_addr << dec << endl; });

            return index;
        }
    }

    DP ( if (warmup_complete[packet->cpu]) {
    cout << "[" << queue->NAME << "] " << __func__ << " new address: " << hex << packet->address;
    cout << " full_addr: " << packet->full_addr << dec << endl; });

    DP ( if (warmup_complete[packet->cpu] && (queue->occupancy == queue->SIZE)) {
    cout << "[" << queue->NAME << "] " << __func__ << " mshr is full";
    cout << " instr_id: " << packet->instr_id << " mshr occupancy: " << queue->occupancy;
    cout << " address: " << hex << packet->address;
    cout << " full_addr: " << packet->full_addr << dec;
    cout << " cycle: " << current_core_cycle[packet->cpu] << endl; });

    return -1;
}

// Assembly:
movq %rdi, -0x10(%rsp)
movq %rsi, -0x18(%rsp)
movq %rdx, -0x20(%rsp)
movl $0x0, -0x24(%rsp)
movl -0x24(%rsp), %eax
movq -0x18(%rsp), %rcx
cmpl 0x20(%rcx), %eax
jae 0x14b4d
movq -0x18(%rsp), %rax
movq 0x98(%rax), %rax
movl -0x24(%rsp), %ecx
imulq $0x380, %rcx, %rcx      # imm = 0x380
addq %rcx, %rax
movq 0x340(%rax), %rax
movq -0x20(%rsp), %rcx
cmpq 0x340(%rcx), %rax
jne 0x14b3e
movl -0x24(%rsp), %eax
movl %eax, -0x4(%rsp)
jmp 0x14b55
jmp 0x14b40
movl -0x24(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rsp)
jmp 0x14af7
movl $0xffffffff, -0x4(%rsp) # imm = 0xFFFFFFFF
movl -0x4(%rsp), %eax
retq
nopw (%rax,%rax)
// File: NishadSaraf[P]Championship-Simulator/src/dram_controller.cc
// Function: MEMORY_CONTROLLER::get_occupancy(unsigned char)
uint32_t MEMORY_CONTROLLER::get_occupancy(uint8_t queue_type)
{
    if (queue_type == 1)
        return RQ.occupancy;
    else if (queue_type == 2)
        return WQ.occupancy;

    return 0;
}

// Assembly:
movb %sil, %al
movq %rdi, -0x10(%rsp)
movb %al, -0x11(%rsp)
movq -0x10(%rsp), %rax
movq %rax, -0x20(%rsp)
movzbl -0x11(%rsp), %eax
cmpl $0x1, %eax
jne 0x14cf1
movq -0x20(%rsp), %rax
movl 0x9f2c(%rax), %eax
movl %eax, -0x4(%rsp)
jmp 0x14d16
movzbl -0x11(%rsp), %eax
cmpl $0x2, %eax
jne 0x14d0c
movq -0x20(%rsp), %rax
movl 0x828c(%rax), %eax
movl %eax, -0x4(%rsp)
jmp 0x14d16
jmp 0x14d0e
movl $0x0, -0x4(%rsp)
movl -0x4(%rsp), %eax
retq
nopl (%rax,%rax)
// File: NishadSaraf[P]Championship-Simulator/src/dram_controller.cc
// Function: MEMORY_CONTROLLER::get_size(unsigned char)
uint32_t MEMORY_CONTROLLER::get_size(uint8_t queue_type)
{
    if (queue_type == 1)
        return RQ.SIZE;
    else if (queue_type == 2)
        return WQ.SIZE;

    return 0;
}

// Assembly:
movb %sil, %al
movq %rdi, -0x10(%rsp)
movb %al, -0x11(%rsp)
movq -0x10(%rsp), %rax
movq %rax, -0x20(%rsp)
movzbl -0x11(%rsp), %eax
cmpl $0x1, %eax
jne 0x14d51
movq -0x20(%rsp), %rax
movl 0x9f18(%rax), %eax
movl %eax, -0x4(%rsp)
jmp 0x14d76
movzbl -0x11(%rsp), %eax
cmpl $0x2, %eax
jne 0x14d6c
movq -0x20(%rsp), %rax
movl 0x8278(%rax), %eax
movl %eax, -0x4(%rsp)
jmp 0x14d76
jmp 0x14d6e
movl $0x0, -0x4(%rsp)
movl -0x4(%rsp), %eax
retq
nopl (%rax,%rax)
// File: NishadSaraf[P]Championship-Simulator/src/block.cc
// Function: PACKET_QUEUE::add_queue(PACKET*)
void PACKET_QUEUE::add_queue(PACKET *packet)
{
#ifdef SANITY_CHECK
    if (occupancy && (head == tail))
        assert(0);
#endif

    // add entry
    memcpy(&entry[tail], packet, sizeof(PACKET));

    DP ( if (warmup_complete[packet->cpu]) {
    cout << "[" << NAME << "] " << __func__ << " cpu: " << packet->cpu << " instr_id: " << packet->instr_id;
    cout << " address: " << hex << entry[tail].address << " full_addr: " << entry[tail].full_addr << dec;
    cout << " head: " << head << " tail: " << tail << " occupancy: " << occupancy << " event_cycle: " << entry[tail].event_cycle << endl; });

    occupancy++;
    tail++;
    if (tail >= SIZE)
        tail = 0;
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movq 0x10(%rsp), %rax
movq %rax, (%rsp)
cmpl $0x0, 0x34(%rax)
je 0x15088
movq (%rsp), %rcx
movl 0x2c(%rcx), %eax
cmpl 0x30(%rcx), %eax
jne 0x15088
leaq 0xdf94(%rip), %rdi      # 0x23004
leaq 0xea8a(%rip), %rsi      # 0x23b01
movl $0x50, %edx
leaq 0xea8b(%rip), %rcx      # 0x23b0e
callq 0x3160
movq (%rsp), %rax
movq 0x98(%rax), %rdi
movl 0x30(%rax), %eax
imulq $0x380, %rax, %rax      # imm = 0x380
addq %rax, %rdi
movq 0x8(%rsp), %rsi
movl $0x380, %edx            # imm = 0x380
callq 0x31a0
movq (%rsp), %rcx
movl 0x34(%rcx), %eax
addl $0x1, %eax
movl %eax, 0x34(%rcx)
movl 0x30(%rcx), %eax
addl $0x1, %eax
movl %eax, 0x30(%rcx)
movl 0x30(%rcx), %eax
cmpl 0x20(%rcx), %eax
jb 0x150d8
movq (%rsp), %rax
movl $0x0, 0x30(%rax)
addq $0x18, %rsp
retq
nopl (%rax)
// File: NishadSaraf[P]Championship-Simulator/src/block.cc
// Function: PACKET_QUEUE::remove_queue(PACKET*)
void PACKET_QUEUE::remove_queue(PACKET *packet)
{
#ifdef SANITY_CHECK
    if ((occupancy == 0) && (head == tail))
        assert(0);
#endif

    DP ( if (warmup_complete[packet->cpu]) {
    cout << "[" << NAME << "] " << __func__ << " cpu: " << packet->cpu << " instr_id: " << packet->instr_id;
    cout << " address: " << hex << packet->address << " full_addr: " << packet->full_addr << dec << " fill_level: " << packet->fill_level;
    cout << " head: " << head << " tail: " << tail << " occupancy: " << occupancy << " event_cycle: " << packet->event_cycle << endl; });

    // reset entry
    PACKET empty_packet;
    memcpy(packet, &empty_packet, sizeof(PACKET));

    occupancy--;
    head++;
    if (head >= SIZE)
        head = 0;
}

// Assembly:
subq $0x398, %rsp            # imm = 0x398
movq %rdi, 0x390(%rsp)
movq %rsi, 0x388(%rsp)
movq 0x390(%rsp), %rax
movq %rax, (%rsp)
cmpl $0x0, 0x34(%rax)
jne 0x15134
movq (%rsp), %rcx
movl 0x2c(%rcx), %eax
cmpl 0x30(%rcx), %eax
jne 0x15134
leaq 0xdee8(%rip), %rdi      # 0x23004
leaq 0xe9de(%rip), %rsi      # 0x23b01
movl $0x65, %edx
leaq 0xea06(%rip), %rcx      # 0x23b35
callq 0x3160
leaq 0x8(%rsp), %rdi
callq 0x9750
movq 0x388(%rsp), %rdi
leaq 0x8(%rsp), %rsi
movl $0x380, %edx            # imm = 0x380
callq 0x31a0
movq (%rsp), %rcx
movl 0x34(%rcx), %eax
addl $-0x1, %eax
movl %eax, 0x34(%rcx)
movl 0x2c(%rcx), %eax
addl $0x1, %eax
movl %eax, 0x2c(%rcx)
movl 0x2c(%rcx), %eax
cmpl 0x20(%rcx), %eax
jb 0x1517e
movq (%rsp), %rax
movl $0x0, 0x2c(%rax)
addq $0x398, %rsp            # imm = 0x398
retq
nopw %cs:(%rax,%rax)
// File: NishadSaraf[P]Championship-Simulator/src/ooo_cpu.cc
// Function: O3_CPU::add_to_rob(ooo_model_instr*)
uint32_t O3_CPU::add_to_rob(ooo_model_instr *arch_instr)
{
    uint32_t index = ROB.tail;

    // sanity check
    if (ROB.entry[index].instr_id != 0) {
        cerr << "[ROB_ERROR] " << __func__ << " is not empty index: " << index;
        cerr << " instr_id: " << ROB.entry[index].instr_id << endl;
        assert(0);
    }

    memcpy (&ROB.entry[index], arch_instr, sizeof(ooo_model_instr));
    ROB.entry[index].event_cycle = current_core_cycle[cpu];

    ROB.occupancy++;
    ROB.tail++;
    if (ROB.tail >= ROB.SIZE)
        ROB.tail = 0;

    DP ( if (warmup_complete[cpu]) {
    cout << "[ROB] " <<  __func__ << " instr_id: " << ROB.entry[index].instr_id;
    cout << " ip: " << hex << ROB.entry[index].ip << dec;
    cout << " head: " << ROB.head << " tail: " << ROB.tail << " occupancy: " << ROB.occupancy;
    cout << " event: " << ROB.entry[index].event_cycle << " current: " << current_core_cycle[cpu] << endl; });

    return index;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x8(%rsp)
movl 0x95c(%rax), %ecx
movl %ecx, 0x14(%rsp)
movq 0x9b8(%rax), %rax
movl 0x14(%rsp), %ecx
imulq $0x758, %rcx, %rcx      # imm = 0x758
addq %rcx, %rax
cmpq $0x0, (%rax)
je 0x15dc4
movq 0x132c8(%rip), %rdi     # 0x28ff0
leaq 0xdeb2(%rip), %rsi      # 0x23be1
callq 0x3220
movq %rax, %rdi
leaq 0xdeb0(%rip), %rsi      # 0x23bee
callq 0x3220
movq %rax, %rdi
leaq 0xd483(%rip), %rsi      # 0x231d0
callq 0x3220
movq %rax, %rdi
movl 0x14(%rsp), %esi
callq 0x32c0
movq 0x1328b(%rip), %rdi     # 0x28ff0
leaq 0xe0b3(%rip), %rsi      # 0x23e1f
callq 0x3220
movq %rax, %rdi
movq 0x8(%rsp), %rax
movq 0x9b8(%rax), %rax
movl 0x14(%rsp), %ecx
imulq $0x758, %rcx, %rcx      # imm = 0x758
addq %rcx, %rax
movq (%rax), %rsi
callq 0x3080
movq %rax, %rdi
movq 0x13218(%rip), %rsi     # 0x28fb8
callq 0x3250
leaq 0xd258(%rip), %rdi      # 0x23004
leaq 0xde02(%rip), %rsi      # 0x23bb5
movl $0x12c, %edx            # imm = 0x12C
leaq 0xde3a(%rip), %rcx      # 0x23bf9
callq 0x3160
movq 0x8(%rsp), %rax
movq 0x9b8(%rax), %rdi
movl 0x14(%rsp), %eax
imulq $0x758, %rax, %rax      # imm = 0x758
addq %rax, %rdi
movq 0x18(%rsp), %rsi
movl $0x758, %edx            # imm = 0x758
callq 0x31a0
movq 0x8(%rsp), %rcx
movl (%rcx), %eax
movl %eax, %edx
leaq 0x7a0c3(%rip), %rax     # 0x8fec0
movq (%rax,%rdx,8), %rdx
movq 0x9b8(%rcx), %rax
movl 0x14(%rsp), %esi
imulq $0x758, %rsi, %rsi      # imm = 0x758
addq %rsi, %rax
movq %rdx, 0x40(%rax)
movl 0x960(%rcx), %eax
addl $0x1, %eax
movl %eax, 0x960(%rcx)
movl 0x95c(%rcx), %eax
addl $0x1, %eax
movl %eax, 0x95c(%rcx)
movl 0x95c(%rcx), %eax
cmpl 0x950(%rcx), %eax
jb 0x15e55
movq 0x8(%rsp), %rax
movl $0x0, 0x95c(%rax)
movl 0x14(%rsp), %eax
addq $0x28, %rsp
retq
nop
// File: NishadSaraf[P]Championship-Simulator/src/ooo_cpu.cc
// Function: O3_CPU::do_execution(unsigned int)
void O3_CPU::do_execution(uint32_t rob_index)
{
    //if (ROB.entry[rob_index].reg_ready && (ROB.entry[rob_index].scheduled == COMPLETED) && (ROB.entry[rob_index].event_cycle <= current_core_cycle[cpu])) {

        ROB.entry[rob_index].executed = INFLIGHT;

        // ADD LATENCY
        if (ROB.entry[rob_index].event_cycle < current_core_cycle[cpu])
            ROB.entry[rob_index].event_cycle = current_core_cycle[cpu] + EXEC_LATENCY;
        else
            ROB.entry[rob_index].event_cycle += EXEC_LATENCY;

        inflight_reg_executions++;

        DP (if (warmup_complete[cpu]) {
        cout << "[ROB] " << __func__ << " non-memory instr_id: " << ROB.entry[rob_index].instr_id; 
        cout << " event_cycle: " << ROB.entry[rob_index].event_cycle << endl;});
    //}
}

// Assembly:
movq %rdi, -0x8(%rsp)
movl %esi, -0xc(%rsp)
movq -0x8(%rsp), %rcx
movq %rcx, -0x18(%rsp)
movq 0x9b8(%rcx), %rax
movl -0xc(%rsp), %edx
imulq $0x758, %rdx, %rdx      # imm = 0x758
addq %rdx, %rax
movl $0x1, 0x78(%rax)
movq 0x9b8(%rcx), %rax
movl -0xc(%rsp), %edx
imulq $0x758, %rdx, %rdx      # imm = 0x758
addq %rdx, %rax
movq 0x40(%rax), %rax
movl (%rcx), %ecx
movl %ecx, %edx
leaq 0x78add(%rip), %rcx     # 0x8fec0
cmpq (%rcx,%rdx,8), %rax
jae 0x17421
movq -0x18(%rsp), %rax
movl (%rax), %ecx
movl %ecx, %edx
leaq 0x78ac7(%rip), %rcx     # 0x8fec0
movq (%rcx,%rdx,8), %rcx
movl 0x78ad1(%rip), %edx     # 0x8fed4
addq %rdx, %rcx
movq 0x9b8(%rax), %rax
movl -0xc(%rsp), %edx
imulq $0x758, %rdx, %rdx      # imm = 0x758
addq %rdx, %rax
movq %rcx, 0x40(%rax)
jmp 0x17449
movq -0x18(%rsp), %rax
movl 0x78aa8(%rip), %ecx     # 0x8fed4
movq 0x9b8(%rax), %rax
movl -0xc(%rsp), %edx
imulq $0x758, %rdx, %rdx      # imm = 0x758
addq %rdx, %rax
addq 0x40(%rax), %rcx
movq %rcx, 0x40(%rax)
movq -0x18(%rsp), %rax
movl 0x920(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x920(%rax)
retq
nop
// File: NishadSaraf[P]Championship-Simulator/src/ooo_cpu.cc
// Function: O3_CPU::do_memory_scheduling(unsigned int)
void O3_CPU::do_memory_scheduling(uint32_t rob_index)
{
    uint32_t not_available = check_and_add_lsq(rob_index);
    if (not_available == 0) {
        ROB.entry[rob_index].scheduled = COMPLETED;
        if (ROB.entry[rob_index].executed == 0) // it could be already set to COMPLETED due to store-to-load forwarding
            ROB.entry[rob_index].executed  = INFLIGHT;

        DP (if (warmup_complete[cpu]) {
        cout << "[ROB] " << __func__ << " instr_id: " << ROB.entry[rob_index].instr_id << " rob_index: " << rob_index;
        cout << " scheduled all num_mem_ops: " << ROB.entry[rob_index].num_mem_ops << endl; });
    }

    num_searched++;
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movl %esi, 0xc(%rsp)
movq 0x10(%rsp), %rdi
movq %rdi, (%rsp)
movl 0xc(%rsp), %esi
callq 0x18270
movl %eax, 0x8(%rsp)
cmpl $0x0, 0x8(%rsp)
jne 0x178c7
movq (%rsp), %rax
movq 0x9b8(%rax), %rcx
movl 0xc(%rsp), %edx
imulq $0x758, %rdx, %rdx      # imm = 0x758
addq %rdx, %rcx
movl $0x2, 0x68(%rcx)
movq 0x9b8(%rax), %rax
movl 0xc(%rsp), %ecx
imulq $0x758, %rcx, %rcx      # imm = 0x758
addq %rcx, %rax
cmpl $0x0, 0x78(%rax)
jne 0x178c5
movq (%rsp), %rax
movq 0x9b8(%rax), %rax
movl 0xc(%rsp), %ecx
imulq $0x758, %rcx, %rcx      # imm = 0x758
addq %rcx, %rax
movl $0x1, 0x78(%rax)
jmp 0x178c7
movq (%rsp), %rax
movl 0x928(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x928(%rax)
addq $0x18, %rsp
retq
nop
// File: NishadSaraf[P]Championship-Simulator/src/ooo_cpu.cc
// Function: O3_CPU::operate_cache()
void O3_CPU::operate_cache()
{
    ITLB.operate();
    DTLB.operate();
    STLB.operate();
    L1I.operate();
    L1D.operate();
    L2C.operate();
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rdi
movq %rdi, 0x8(%rsp)
addq $0x3690, %rdi           # imm = 0x3690
callq 0x7ef0
movq 0x8(%rsp), %rdi
addq $0x13a38, %rdi          # imm = 0x13A38
callq 0x7ef0
movq 0x8(%rsp), %rdi
addq $0x23de0, %rdi          # imm = 0x23DE0
callq 0x7ef0
movq 0x8(%rsp), %rdi
addq $0x34188, %rdi          # imm = 0x34188
callq 0x7ef0
movq 0x8(%rsp), %rdi
addq $0x44530, %rdi          # imm = 0x44530
callq 0x7ef0
movq 0x8(%rsp), %rdi
addq $0x548d8, %rdi          # imm = 0x548D8
callq 0x7ef0
addq $0x18, %rsp
retq
nopl (%rax)
// File: NishadSaraf[P]Championship-Simulator/src/ooo_cpu.cc
// Function: O3_CPU::mem_RAW_dependency(unsigned int, unsigned int, unsigned int, unsigned int)
void O3_CPU::mem_RAW_dependency(uint32_t prior, uint32_t current, uint32_t data_index, uint32_t lq_index)
{
    for (uint32_t i=0; i<MAX_INSTR_DESTINATIONS; i++) {
        if (ROB.entry[prior].destination_memory[i] == 0)
            continue;

        if (ROB.entry[prior].destination_memory[i] == ROB.entry[current].source_memory[data_index]) { //  store-to-load forwarding check

            // we need to mark this dependency in the ROB since the producer might not be added in the store queue yet
            ROB.entry[prior].memory_instrs_depend_on_me[current] = 1;   // this load cannot be executed until the prior store gets executed
            ROB.entry[prior].is_producer = 1;
            LQ.entry[lq_index].producer_id = ROB.entry[prior].instr_id; 
            LQ.entry[lq_index].translated = INFLIGHT;

            DP (if(warmup_complete[cpu]) {
            cout << "[LQ] " << __func__ << " RAW producer instr_id: " << ROB.entry[prior].instr_id << " consumer_id: " << ROB.entry[current].instr_id << " lq_index: " << lq_index;
            cout << hex << " address: " << ROB.entry[prior].destination_memory[i] << dec << endl; });

            return;
        }
    }
}

// Assembly:
movq %rdi, -0x8(%rsp)
movl %esi, -0xc(%rsp)
movl %edx, -0x10(%rsp)
movl %ecx, -0x14(%rsp)
movl %r8d, -0x18(%rsp)
movq -0x8(%rsp), %rax
movq %rax, -0x28(%rsp)
movl $0x0, -0x1c(%rsp)
movl -0x1c(%rsp), %eax
leaq 0x1017d(%rip), %rcx     # 0x29210
movzbl (%rcx), %ecx
cmpl %ecx, %eax
jae 0x191b6
movq -0x28(%rsp), %rax
movq 0x9b8(%rax), %rax
movl -0xc(%rsp), %ecx
imulq $0x758, %rcx, %rcx      # imm = 0x758
addq %rcx, %rax
movl -0x1c(%rsp), %ecx
cmpq $0x0, 0x5a8(%rax,%rcx,8)
jne 0x190cc
jmp 0x191a6
movq -0x28(%rsp), %rcx
movq 0x9b8(%rcx), %rax
movl -0xc(%rsp), %edx
imulq $0x758, %rdx, %rdx      # imm = 0x758
addq %rdx, %rax
movl -0x1c(%rsp), %edx
movq 0x5a8(%rax,%rdx,8), %rax
movq 0x9b8(%rcx), %rcx
movl -0x10(%rsp), %edx
imulq $0x758, %rdx, %rdx      # imm = 0x758
addq %rdx, %rcx
movl -0x14(%rsp), %edx
cmpq 0x5c8(%rcx,%rdx,8), %rax
jne 0x191a4
movq -0x28(%rsp), %rax
movq 0x9b8(%rax), %rcx
movl -0xc(%rsp), %edx
imulq $0x758, %rdx, %rdx      # imm = 0x758
addq %rdx, %rcx
movl -0x10(%rsp), %edx
movb $0x1, 0x628(%rcx,%rdx)
movq 0x9b8(%rax), %rcx
movl -0xc(%rsp), %edx
imulq $0x758, %rdx, %rdx      # imm = 0x758
addq %rdx, %rcx
movb $0x1, 0x56(%rcx)
movq 0x9b8(%rax), %rcx
movl -0xc(%rsp), %edx
imulq $0x758, %rdx, %rdx      # imm = 0x758
addq %rdx, %rcx
movq (%rcx), %rdx
movq 0x9f0(%rax), %rcx
movl -0x18(%rsp), %esi
imulq $0x140, %rsi, %rsi      # imm = 0x140
addq %rsi, %rcx
movq %rdx, 0x8(%rcx)
movq 0x9f0(%rax), %rax
movl -0x18(%rsp), %ecx
imulq $0x140, %rcx, %rcx      # imm = 0x140
addq %rcx, %rax
movb $0x1, 0x3c(%rax)
jmp 0x191b6
jmp 0x191a6
movl -0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rsp)
jmp 0x19088
retq
nopw (%rax,%rax)
// File: NishadSaraf[P]Championship-Simulator/inc/block.h
// Function: LSQ_ENTRY::LSQ_ENTRY()
LSQ_ENTRY() {
        instr_id = 0;
        producer_id = UINT64_MAX;
        virtual_address = 0;
        physical_address = 0;
        ip = 0;
        event_cycle = 0;

        rob_index = 0;
        data_index = 0;
        sq_index = UINT32_MAX;

        translated = 0;
        fetched = 0;
        asid[0] = UINT8_MAX;
        asid[1] = UINT8_MAX;

        for (uint32_t i=0; i<ROB_SIZE; i++)
            forwarding_depend_on_me[i] = 0;
    }

// Assembly:
movq %rdi, -0x8(%rsp)
movq -0x8(%rsp), %rax
movq %rax, -0x18(%rsp)
movq $0x0, (%rax)
movq $-0x1, 0x8(%rax)
movq $0x0, 0x10(%rax)
movq $0x0, 0x18(%rax)
movq $0x0, 0x20(%rax)
movq $0x0, 0x28(%rax)
movl $0x0, 0x30(%rax)
movl $0x0, 0x34(%rax)
movl $0xffffffff, 0x38(%rax) # imm = 0xFFFFFFFF
movb $0x0, 0x3c(%rax)
movb $0x0, 0x3d(%rax)
movb $-0x1, 0x3e(%rax)
movb $-0x1, 0x3f(%rax)
movl $0x0, -0xc(%rsp)
cmpl $0x100, -0xc(%rsp)      # imm = 0x100
jae 0x1c700
movq -0x18(%rsp), %rax
movl -0xc(%rsp), %ecx
movb $0x0, 0x40(%rax,%rcx)
movl -0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rsp)
jmp 0x1c6db
retq
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)
// File: NishadSaraf[P]Championship-Simulator/inc/instruction.h
// Function: input_instr::input_instr()
input_instr() {
        ip = 0;
        is_branch = 0;
        branch_taken = 0;

        for (uint32_t i=0; i<NUM_INSTR_SOURCES; i++) {
            source_registers[i] = 0;
            source_memory[i] = 0;
        }

        for (uint32_t i=0; i<NUM_INSTR_DESTINATIONS; i++) {
            destination_registers[i] = 0;
            destination_memory[i] = 0;
        }
    }

// Assembly:
movq %rdi, -0x8(%rsp)
movq -0x8(%rsp), %rax
movq %rax, -0x18(%rsp)
movq $0x0, (%rax)
movb $0x0, 0x8(%rax)
movb $0x0, 0x9(%rax)
movl $0x0, -0xc(%rsp)
cmpl $0x4, -0xc(%rsp)
jae 0x1c765
movq -0x18(%rsp), %rax
movl -0xc(%rsp), %ecx
movb $0x0, 0xc(%rax,%rcx)
movl -0xc(%rsp), %ecx
movq $0x0, 0x20(%rax,%rcx,8)
movl -0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rsp)
jmp 0x1c736
movl $0x0, -0x10(%rsp)
cmpl $0x2, -0x10(%rsp)
jae 0x1c79c
movq -0x18(%rsp), %rax
movl -0x10(%rsp), %ecx
movb $0x0, 0xa(%rax,%rcx)
movl -0x10(%rsp), %ecx
movq $0x0, 0x10(%rax,%rcx,8)
movl -0x10(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rsp)
jmp 0x1c76d
retq
nopl (%rax)
// File: NishadSaraf[P]Championship-Simulator/inc/instruction.h
// Function: cloudsuite_instr::cloudsuite_instr()
cloudsuite_instr() {
        ip = 0;
        is_branch = 0;
        branch_taken = 0;

        for (uint32_t i=0; i<NUM_INSTR_SOURCES; i++) {
            source_registers[i] = 0;
            source_memory[i] = 0;
        }

        for (uint32_t i=0; i<NUM_INSTR_DESTINATIONS_SPARC; i++) {
            destination_registers[i] = 0;
            destination_memory[i] = 0;
        }

        asid[0] = UINT8_MAX;
        asid[1] = UINT8_MAX;
    }

// Assembly:
movq %rdi, -0x8(%rsp)
movq -0x8(%rsp), %rax
movq %rax, -0x18(%rsp)
movq $0x0, (%rax)
movb $0x0, 0x8(%rax)
movb $0x0, 0x9(%rax)
movl $0x0, -0xc(%rsp)
cmpl $0x4, -0xc(%rsp)
jae 0x1c7f5
movq -0x18(%rsp), %rax
movl -0xc(%rsp), %ecx
movb $0x0, 0xe(%rax,%rcx)
movl -0xc(%rsp), %ecx
movq $0x0, 0x38(%rax,%rcx,8)
movl -0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rsp)
jmp 0x1c7c6
movl $0x0, -0x10(%rsp)
cmpl $0x4, -0x10(%rsp)
jae 0x1c82c
movq -0x18(%rsp), %rax
movl -0x10(%rsp), %ecx
movb $0x0, 0xa(%rax,%rcx)
movl -0x10(%rsp), %ecx
movq $0x0, 0x18(%rax,%rcx,8)
movl -0x10(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rsp)
jmp 0x1c7fd
movq -0x18(%rsp), %rax
movb $-0x1, 0x58(%rax)
movb $-0x1, 0x59(%rax)
retq
nopw (%rax,%rax)
// File: NishadSaraf[P]Championship-Simulator/inc/block.h
// Function: CORE_BUFFER::CORE_BUFFER(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, unsigned int)
CORE_BUFFER(string v1, uint32_t v2) : NAME(v1), SIZE(v2) {
        head = 0;
        tail = 0;
        occupancy = 0;

        last_read = SIZE-1;
        last_fetch = SIZE-1;
        last_scheduled = 0;

        inorder_fetch[0] = 0;
        inorder_fetch[1] = 0;
        next_fetch[0] = 0;
        next_fetch[1] = 0;
        next_schedule = 0;

        event_cycle = 0;
        fetch_event_cycle = UINT64_MAX;
        schedule_event_cycle = UINT64_MAX;
        execute_event_cycle = UINT64_MAX;
        lsq_event_cycle = UINT64_MAX;
        retire_event_cycle = UINT64_MAX;

        entry = new ooo_model_instr[SIZE];
    }

// Assembly:
subq $0x68, %rsp
movq %rdi, 0x60(%rsp)
movq %rsi, 0x58(%rsp)
movl %edx, 0x54(%rsp)
movq 0x60(%rsp), %rdi
movq %rdi, 0x28(%rsp)
movq %rdi, %rax
movq %rax, 0x20(%rsp)
callq 0x3100
movq 0x28(%rsp), %rax
movl 0x54(%rsp), %ecx
movl %ecx, 0x20(%rax)
movl $0x0, 0x28(%rax)
movl $0x0, 0x2c(%rax)
movl $0x0, 0x30(%rax)
movl 0x20(%rax), %ecx
decl %ecx
movl %ecx, 0x34(%rax)
movl 0x20(%rax), %ecx
decl %ecx
movl %ecx, 0x38(%rax)
movl $0x0, 0x3c(%rax)
movl $0x0, 0x40(%rax)
movl $0x0, 0x44(%rax)
movl $0x0, 0x48(%rax)
movl $0x0, 0x4c(%rax)
movl $0x0, 0x50(%rax)
movq $0x0, 0x58(%rax)
movq $-0x1, 0x60(%rax)
movq $-0x1, 0x68(%rax)
movq $-0x1, 0x70(%rax)
movq $-0x1, 0x78(%rax)
movq $-0x1, 0x80(%rax)
movl 0x20(%rax), %eax
movq %rax, 0x30(%rsp)
imulq $0x758, %rax, %rdi      # imm = 0x758
callq 0x3030
movq %rax, 0x38(%rsp)
jmp 0x1c912
movq 0x30(%rsp), %rax
cmpq $0x0, %rax
je 0x1c969
movq 0x38(%rsp), %rax
movq 0x30(%rsp), %rcx
imulq $0x758, %rcx, %rdx      # imm = 0x758
movq %rax, %rcx
addq %rdx, %rcx
movq %rcx, 0x10(%rsp)
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0x1c430
jmp 0x1c94f
movq 0x10(%rsp), %rcx
movq 0x8(%rsp), %rax
addq $0x758, %rax            # imm = 0x758
cmpq %rcx, %rax
movq %rax, 0x18(%rsp)
jne 0x1c93e
movq 0x20(%rsp), %rax
movq 0x38(%rsp), %rcx
movq %rcx, 0x88(%rax)
addq $0x68, %rsp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x48(%rsp)
movl %eax, 0x44(%rsp)
jmp 0x1c9a7
movq 0x38(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x48(%rsp)
movl %eax, 0x44(%rsp)
callq 0x32b0
movq 0x28(%rsp), %rdi
callq 0x3150
movq 0x48(%rsp), %rdi
callq 0x33c0
nopl (%rax,%rax)