LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/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:
xorq %rcx, %rdx
xorl %eax, %eax
cmpq $0xfff, %rdx            # imm = 0xFFF
ja 0x61cb
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x388, %rsp            # imm = 0x388
movq %rcx, %r14
movq %rdi, %rbx
movl 0xad08(%rdi), %ecx
cmpl %ecx, 0xad1c(%rdi)
jae 0x61ba
movl %r8d, %ebp
movq %rsi, %r15
xorl %r13d, %r13d
leaq 0x20(%rsp), %r12
movl %r13d, -0x15(%r12)
movl %r13d, -0x18(%r12)
movl $0xffff00, 0x314(%r12) # imm = 0xFFFF00
pcmpeqd %xmm0, %xmm0
movdqu %xmm0, -0x10(%r12)
movl $0x314, %edx            # imm = 0x314
movq %r12, %rdi
xorl %esi, %esi
callq 0x3130
movl $0x1, 0x318(%r12)
pxor %xmm0, %xmm0
movdqu %xmm0, 0x31c(%r12)
movdqu %xmm0, 0x32c(%r12)
movl %r13d, 0x33c(%r12)
movdqu %xmm0, 0x348(%r12)
movq $0x0, 0x358(%r12)
movq $-0x1, 0x360(%r12)
movl %ebp, -0x10(%r12)
movl 0x7348(%rbx), %eax
movl %eax, 0x318(%r12)
movq %r14, %rcx
shrq $0x6, %rcx
movq %rcx, 0x328(%r12)
movq %r14, 0x330(%r12)
movq %r15, 0x358(%r12)
movb $0x2, 0x317(%r12)
leaq 0x7ad25(%rip), %rcx     # 0x80ec0
movq (%rcx,%rax,8), %rax
movq %rax, 0x360(%r12)
movq (%rbx), %rax
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq *0x10(%rax)
movl $0x1, %eax
addq $0x388, %rsp            # imm = 0x388
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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:
xorq %rdx, %rsi
xorl %eax, %eax
cmpq $0xfff, %rsi            # imm = 0xFFF
ja 0x631c
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x388, %rsp            # imm = 0x388
movl %ecx, %r12d
movq %rdi, %rbx
movl 0xad08(%rdi), %ecx
cmpl %ecx, 0xad1c(%rdi)
jae 0x630b
movq %rdx, %r15
xorl %ebp, %ebp
leaq 0x20(%rsp), %r13
movl %ebp, -0x15(%r13)
movl %ebp, -0x18(%r13)
movl $0xffff00, 0x314(%r13) # imm = 0xFFFF00
pcmpeqd %xmm0, %xmm0
movdqu %xmm0, -0x10(%r13)
movl $0x314, %edx            # imm = 0x314
movq %r13, %rdi
xorl %esi, %esi
movl %r9d, 0x4(%rsp)
movl %r8d, %r14d
callq 0x3130
movl $0x1, 0x318(%r13)
pxor %xmm0, %xmm0
movdqu %xmm0, 0x31c(%r13)
movdqu %xmm0, 0x32c(%r13)
movl %ebp, 0x33c(%r13)
movdqu %xmm0, 0x348(%r13)
movq %rbp, 0x358(%r13)
movq $-0x1, 0x360(%r13)
movl %r12d, -0x10(%r13)
movl 0x7348(%rbx), %eax
movl %eax, 0x318(%r13)
movq %r15, %rcx
shrq $0x6, %rcx
movq %rcx, 0x328(%r13)
movq %r15, 0x330(%r13)
movq %rbp, 0x358(%r13)
movb $0x2, 0x317(%r13)
movl %r14d, (%r13)
movl 0x4(%rsp), %ecx
movl %ecx, 0x4(%r13)
movl 0x3c0(%rsp), %ecx
movl %ecx, 0x8(%r13)
movl 0x3c8(%rsp), %ecx
movl %ecx, 0xc(%r13)
leaq 0x7abda(%rip), %rcx     # 0x80ec0
movq (%rcx,%rax,8), %rax
movq %rax, 0x360(%r13)
movq (%rbx), %rax
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq *0x10(%rax)
incq 0x102c8(%rbx)
movl $0x1, %eax
addq $0x388, %rsp            # imm = 0x388
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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:
cmpl $0x3, %esi
ja 0x6825
movl %esi, %eax
leaq 0xd840(%rip), %rcx      # 0x14040
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl 0xc9bc(%rdi), %eax
retq
movl 0x73dc(%rdi), %eax
retq
movl 0xad1c(%rdi), %eax
retq
movl 0x907c(%rdi), %eax
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/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:
cmpl $0x3, %esi
ja 0x685b
movl %esi, %eax
leaq 0xd81a(%rip), %rcx      # 0x14050
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl 0xc9a8(%rdi), %eax
retq
movl 0x73c8(%rdi), %eax
retq
movl 0xad08(%rdi), %eax
retq
movl 0x9068(%rdi), %eax
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/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, %eax
shlq $0x5, %rax
addq %rsi, %rax
addq $0x10388, %rax          # imm = 0x10388
movq $-0x4, %rcx
movups -0x80(%rax,%rcx,8), %xmm0
movups -0x60(%rax,%rcx,8), %xmm1
movups -0x40(%rax,%rcx,8), %xmm2
movups %xmm0, -0x20(%rax,%rcx,8)
movups %xmm1, (%rax,%rcx,8)
movups %xmm2, 0x20(%rax,%rcx,8)
addq $0x2, %rcx
jne 0x7522
retq
// File: /workspace/github_cpp_makefile_star2_O1/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:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
leaq 0x72a8(%rsi), %rax
movl %edi, %r14d
shlq $0x5, %r14
xorl %r15d, %r15d
movl $0xa0, %edx
movq %rax, %rdi
xorl %esi, %esi
callq 0x3130
xorps %xmm0, %xmm0
movups %xmm0, 0x102e8(%rbx,%r14)
movups %xmm0, 0x102f8(%rbx,%r14)
movups %xmm0, 0x10308(%rbx,%r14)
movups %xmm0, 0x10318(%rbx,%r14)
movups %xmm0, 0x10328(%rbx,%r14)
movups %xmm0, 0x10338(%rbx,%r14)
movq %r15, 0x90a8(%rbx)
movq %r15, 0x7438(%rbx)
movups %xmm0, 0x7408(%rbx)
movups %xmm0, 0x7418(%rbx)
movups %xmm0, 0x90b8(%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 $0xffffffff, %eax       # imm = 0xFFFFFFFF
testl %edi, %edi
je 0x91b3
movl %edi, %ecx
shrl $0x1f, %ecx
addl %edi, %ecx
sarl %ecx
incl %eax
incl %edi
cmpl $0x2, %edi
movl %ecx, %edi
ja 0x91a1
retq
// File: /workspace/github_cpp_makefile_star2_O1/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:
movl 0x20(%rsi), %eax
testq %rax, %rax
je 0xb885
movq 0x98(%rsi), %rdx
addq $0x2, %rdx
movq $-0x1, %rcx
xorl %r8d, %r8d
movl %eax, %edi
cmpb $0x0, (%rdx)
je 0xb874
movq 0x376(%rdx), %r9
cmpq %rcx, %r9
cmovbq %r9, %rcx
cmovbl %r8d, %edi
incq %r8
addq $0x380, %rdx            # imm = 0x380
cmpq %r8, %rax
jne 0xb85d
jmp 0xb88e
movq $-0x1, %rcx
movl %eax, %edi
movq %rcx, 0x58(%rsi)
movl %edi, 0x44(%rsi)
retq
// File: /workspace/github_cpp_makefile_star2_O1/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:
cmpl $0x2, %esi
je 0xc197
xorl %eax, %eax
cmpl $0x1, %esi
jne 0xc19d
movl 0x9f2c(%rdi), %eax
retq
movl 0x828c(%rdi), %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/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:
cmpl $0x2, %esi
je 0xc1b1
xorl %eax, %eax
cmpl $0x1, %esi
jne 0xc1b7
movl 0x9f18(%rdi), %eax
retq
movl 0x8278(%rdi), %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/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:
pushq %rbx
movq %rdi, %rbx
cmpl $0x0, 0x34(%rdi)
je 0xc388
movl 0x2c(%rbx), %eax
cmpl 0x30(%rbx), %eax
je 0xc3c6
movl 0x30(%rbx), %eax
imulq $0x380, %rax, %rdi      # imm = 0x380
addq 0x98(%rbx), %rdi
movl $0x380, %edx            # imm = 0x380
callq 0x31c0
movq 0x30(%rbx), %xmm0
pcmpeqd %xmm1, %xmm1
psubd %xmm1, %xmm0
movq %xmm0, 0x30(%rbx)
movd %xmm0, %eax
xorl %ecx, %ecx
cmpl 0x20(%rbx), %eax
cmovbl %eax, %ecx
movl %ecx, 0x30(%rbx)
popq %rbx
retq
leaq 0x7c9a(%rip), %rdi      # 0x14067
leaq 0x8780(%rip), %rsi      # 0x14b54
leaq 0x8786(%rip), %rcx      # 0x14b61
movl $0x50, %edx
callq 0x3160
nop
// File: /workspace/github_cpp_makefile_star2_O1/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:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x50, %rsp
movq %rsi, %r14
movq %rdi, %rbx
cmpl $0x0, 0x34(%rdi)
jne 0xc406
movl 0x2c(%rbx), %eax
cmpl 0x30(%rbx), %eax
je 0xc4f6
xorl %ebp, %ebp
movl %ebp, 0x8(%rsp)
movl %ebp, 0xb(%rsp)
pcmpeqd %xmm0, %xmm0
movdqu %xmm0, 0x10(%rsp)
pxor %xmm0, %xmm0
movdqu %xmm0, 0x20(%rsp)
movdqu %xmm0, 0x38(%rsp)
movq $0x0, 0x48(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x20(%r14)
movups 0x18(%rsp), %xmm0
movups %xmm0, 0x10(%r14)
movl 0x8(%rsp), %eax
movl %eax, (%r14)
movzwl 0xc(%rsp), %eax
movw %ax, 0x4(%r14)
movb 0xe(%rsp), %al
movb %al, 0x6(%r14)
movq 0xf(%rsp), %rax
movq %rax, 0x7(%r14)
movb 0x17(%rsp), %al
movb %al, 0xf(%r14)
leaq 0x28(%r14), %rdi
movl $0x305, %edx            # imm = 0x305
xorl %esi, %esi
callq 0x3130
movw $0xffff, 0x32d(%r14)    # imm = 0xFFFF
movb $0x0, 0x32f(%r14)
movl $0x1, 0x330(%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0x334(%r14)
movups %xmm0, 0x344(%r14)
movl %ebp, 0x354(%r14)
movups 0x30(%rsp), %xmm0
movups 0x40(%rsp), %xmm1
movups %xmm0, 0x358(%r14)
movups %xmm1, 0x368(%r14)
movq $-0x1, 0x378(%r14)
decl 0x34(%rbx)
movl 0x2c(%rbx), %eax
incl %eax
cmpl 0x20(%rbx), %eax
cmovael %ebp, %eax
movl %eax, 0x2c(%rbx)
addq $0x50, %rsp
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x7b6a(%rip), %rdi      # 0x14067
leaq 0x8650(%rip), %rsi      # 0x14b54
leaq 0x867d(%rip), %rcx      # 0x14b88
movl $0x65, %edx
callq 0x3160
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O1/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:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x95c(%rdi), %r14d
movq 0x9b8(%rdi), %rdi
imulq $0x758, %r14, %r12      # imm = 0x758
cmpq $0x0, (%rdi,%r12)
jne 0xcda3
addq %r12, %rdi
movl $0x758, %edx            # imm = 0x758
callq 0x31c0
movl (%rbx), %eax
leaq 0x74169(%rip), %rcx     # 0x80ec0
movq (%rcx,%rax,8), %rax
movq 0x9b8(%rbx), %rcx
movq %rax, 0x40(%rcx,%r12)
movq 0x95c(%rbx), %xmm0
pcmpeqd %xmm1, %xmm1
psubd %xmm1, %xmm0
movq %xmm0, 0x95c(%rbx)
movd %xmm0, %eax
xorl %ecx, %ecx
cmpl 0x950(%rbx), %eax
cmovbl %eax, %ecx
movl %ecx, 0x95c(%rbx)
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq 0xd246(%rip), %r15      # 0x19ff0
leaq 0x7f31(%rip), %rsi      # 0x14ce2
movq %r15, %rdi
callq 0x3250
leaq 0x7f2f(%rip), %rsi      # 0x14cef
movq %rax, %rdi
callq 0x3250
leaq 0x7464(%rip), %rsi      # 0x14233
movq %rax, %rdi
callq 0x3250
movq %rax, %rdi
movl %r14d, %esi
callq 0x32d0
leaq 0x8137(%rip), %rsi      # 0x14f20
movq %r15, %rdi
callq 0x3250
movq 0x9b8(%rbx), %rcx
movq (%rcx,%r12), %rsi
movq %rax, %rdi
callq 0x3090
movq %rax, %rdi
callq 0x3110
leaq 0x7254(%rip), %rdi      # 0x14067
leaq 0x7e9c(%rip), %rsi      # 0x14cb6
leaq 0x7ed9(%rip), %rcx      # 0x14cfa
movl $0x12c, %edx            # imm = 0x12C
callq 0x3160
nop
// File: /workspace/github_cpp_makefile_star2_O1/NishadSaraf[P]Championship-Simulator/src/ooo_cpu.cc
// Function: O3_CPU::do_scheduling(unsigned int)
void O3_CPU::do_scheduling(uint32_t rob_index)
{
    ROB.entry[rob_index].reg_ready = 1; // reg_ready will be reset to 0 if there is RAW dependency 

    reg_dependency(rob_index);
    ROB.next_schedule = (rob_index == (ROB.SIZE - 1)) ? 0 : (rob_index + 1);

    if (ROB.entry[rob_index].is_memory)
        ROB.entry[rob_index].scheduled = INFLIGHT;
    else {
        ROB.entry[rob_index].scheduled = COMPLETED;

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

        if (ROB.entry[rob_index].reg_ready) {

#ifdef SANITY_CHECK
            if (RTE1[RTE1_tail] < ROB_SIZE)
                assert(0);
#endif
            // remember this rob_index in the Ready-To-Execute array 1
            RTE1[RTE1_tail] = rob_index;

            DP (if (warmup_complete[cpu]) {
            cout << "[RTE1] " << __func__ << " instr_id: " << ROB.entry[rob_index].instr_id << " rob_index: " << rob_index << " is added to RTE1";
            cout << " head: " << RTE1_head << " tail: " << RTE1_tail << endl; }); 

            RTE1_tail++;
            if (RTE1_tail == ROB_SIZE)
                RTE1_tail = 0;
        }
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %esi, %r14d
movq %rdi, %rbx
movq 0x9b8(%rdi), %rax
movl %esi, %ecx
imulq $0x758, %rcx, %r15      # imm = 0x758
movb $0x1, 0x59(%rax,%r15)
callq 0xd76a
movl 0x950(%rbx), %eax
decl %eax
leal 0x1(%r14), %ecx
xorl %edx, %edx
cmpl %r14d, %eax
cmovnel %ecx, %edx
movl %edx, 0x980(%rbx)
movq 0x9b8(%rbx), %rax
leaq (%rax,%r15), %rcx
cmpb $0x0, 0x49(%rax,%r15)
je 0xd6dc
movl $0x1, 0x68(%rcx)
jmp 0xd745
movl $0x2, 0x68(%rcx)
movq 0x40(%rax,%r15), %rcx
movl (%rbx), %edx
leaq 0x737cf(%rip), %rsi     # 0x80ec0
movq (%rsi,%rdx,8), %rdx
movl 0x737d5(%rip), %esi     # 0x80ed0
cmpq %rdx, %rcx
cmovaq %rcx, %rdx
addq %rsi, %rdx
movq %rdx, 0x40(%rax,%r15)
cmpb $0x0, 0x59(%rax,%r15)
je 0xd745
movl 0x324c(%rbx), %eax
cmpl $0xff, 0x2e48(%rbx,%rax,4)
jbe 0xd74b
movl %r14d, 0x2e48(%rbx,%rax,4)
movl 0x324c(%rbx), %eax
incl %eax
xorl %ecx, %ecx
cmpl $0x100, %eax            # imm = 0x100
cmovnel %eax, %ecx
movl %ecx, 0x324c(%rbx)
popq %rbx
popq %r14
popq %r15
retq
leaq 0x6915(%rip), %rdi      # 0x14067
leaq 0x755d(%rip), %rsi      # 0x14cb6
leaq 0x7670(%rip), %rcx      # 0x14dd0
movl $0x22a, %edx            # imm = 0x22A
callq 0x3160
// File: /workspace/github_cpp_makefile_star2_O1/NishadSaraf[P]Championship-Simulator/src/ooo_cpu.cc
// Function: O3_CPU::reg_RAW_dependency(unsigned int, unsigned int, unsigned int)
void O3_CPU::reg_RAW_dependency(uint32_t prior, uint32_t current, uint32_t source_index)
{
    for (uint32_t i=0; i<MAX_INSTR_DESTINATIONS; i++) {
        if (ROB.entry[prior].destination_registers[i] == 0)
            continue;

        if (ROB.entry[prior].destination_registers[i] == ROB.entry[current].source_registers[source_index]) {

            // we need to mark this dependency in the ROB since the producer might not be added in the store queue yet
            ROB.entry[prior].registers_instrs_depend_on_me[current] = 1;   // this load cannot be executed until the prior store gets executed
            ROB.entry[prior].registers_index_depend_on_me[current][source_index] = 1;   // this load cannot be executed until the prior store gets executed
            ROB.entry[prior].reg_RAW_producer = 1;

            ROB.entry[current].reg_ready = 0;
            ROB.entry[current].producer_id = ROB.entry[prior].instr_id; 
            ROB.entry[current].num_reg_dependent++;
            ROB.entry[current].reg_RAW_checked[source_index] = 1;

            DP (if(warmup_complete[cpu]) {
            cout << "[ROB] " << __func__ << " instr_id: " << ROB.entry[current].instr_id << " is_memory: " << +ROB.entry[current].is_memory;
            cout << " RAW reg_index: " << +ROB.entry[current].source_registers[source_index];
            cout << " producer_id: " << ROB.entry[prior].instr_id << endl; });

            return;
        }
    }
}

// Assembly:
pushq %rbx
leaq 0xc8fc(%rip), %rax      # 0x1a210
movzbl (%rax), %r8d
testq %r8, %r8
je 0xd9b0
movq 0x9b8(%rdi), %r10
movl %esi, %eax
imulq $0x758, %rax, %rax      # imm = 0x758
leaq (%r10,%rax), %r9
movl %edx, %esi
movl %ecx, %ecx
imulq $0x758, %rsi, %rdx      # imm = 0x758
addq %rdx, %r10
addq %rcx, %r10
addq $0x80, %r10
xorl %r11d, %r11d
movb 0x7c(%r9,%r11), %bl
testb %bl, %bl
je 0xd95e
cmpb (%r10), %bl
je 0xd968
incq %r11
cmpq %r11, %r8
jne 0xd950
jmp 0xd9b0
movb $0x1, %r8b
movb %r8b, 0x84(%r9,%rsi)
movq 0x9b8(%rdi), %r9
addq %rax, %r9
leaq (%r9,%rsi,4), %rsi
movb %r8b, 0x184(%rcx,%rsi)
movq 0x9b8(%rdi), %rsi
movb %r8b, 0x58(%rsi,%rax)
leaq (%rsi,%rdx), %rdi
movb $0x0, 0x59(%rsi,%rdx)
movq (%rsi,%rax), %rax
movq %rax, 0x18(%rsi,%rdx)
incl 0x74(%rsi,%rdx)
movb %r8b, 0x5d(%rcx,%rdi)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/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:
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
callq 0xe32a
testl %eax, %eax
jne 0xdd45
movq 0x9b8(%rbx), %rax
movl %ebp, %ecx
imulq $0x758, %rcx, %rcx      # imm = 0x758
movl $0x2, 0x68(%rax,%rcx)
cmpl $0x0, 0x78(%rax,%rcx)
jne 0xdd45
addq %rcx, %rax
addq $0x78, %rax
movl $0x1, (%rax)
incl 0x928(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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:
pushq %rbx
movq %rdi, %rbx
addq $0x3690, %rdi           # imm = 0x3690
callq 0x58ae
leaq 0x13a38(%rbx), %rdi
callq 0x58ae
leaq 0x23de0(%rbx), %rdi
callq 0x58ae
leaq 0x34188(%rbx), %rdi
callq 0x58ae
leaq 0x44530(%rbx), %rdi
callq 0x58ae
addq $0x548d8, %rbx          # imm = 0x548D8
movq %rbx, %rdi
popq %rbx
jmp 0x58ae
// File: /workspace/github_cpp_makefile_star2_O1/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:
leaq 0xb751(%rip), %rax      # 0x1a210
movzbl (%rax), %eax
testq %rax, %rax
je 0xeb11
movq 0x9b8(%rdi), %r10
movl %esi, %esi
imulq $0x758, %rsi, %rsi      # imm = 0x758
leaq (%r10,%rsi), %r9
movl %edx, %edx
movl %ecx, %ecx
imulq $0x758, %rdx, %r11      # imm = 0x758
addq %r10, %r11
leaq (%r11,%rcx,8), %rcx
addq $0x5c8, %rcx            # imm = 0x5C8
xorl %r10d, %r10d
movq 0x5a8(%r9,%r10,8), %r11
testq %r11, %r11
je 0xeb09
cmpq (%rcx), %r11
je 0xeb12
incq %r10
cmpq %r10, %rax
jne 0xeaf7
retq
movb $0x1, %al
movb %al, 0x628(%r9,%rdx)
movq 0x9b8(%rdi), %rcx
movb %al, 0x56(%rcx,%rsi)
movq (%rcx,%rsi), %rcx
movq 0x9f0(%rdi), %rdx
movl %r8d, %esi
leaq (%rsi,%rsi,4), %rsi
shlq $0x6, %rsi
movq %rcx, 0x8(%rdx,%rsi)
movb %al, 0x3c(%rdx,%rsi)
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/NishadSaraf[P]Championship-Simulator/src/ooo_cpu.cc
// Function: O3_CPU::execute_load(unsigned int, unsigned int, unsigned int)
int O3_CPU::execute_load(uint32_t rob_index, uint32_t lq_index, uint32_t data_index)
{
    // add it to L1D
    PACKET data_packet;
    data_packet.fill_level = FILL_L1;
    data_packet.cpu = cpu;
    data_packet.data_index = LQ.entry[lq_index].data_index;
    data_packet.lq_index = lq_index;
    data_packet.address = LQ.entry[lq_index].physical_address >> LOG2_BLOCK_SIZE;
    data_packet.full_addr = LQ.entry[lq_index].physical_address;
    data_packet.instr_id = LQ.entry[lq_index].instr_id;
    data_packet.rob_index = LQ.entry[lq_index].rob_index;
    data_packet.ip = LQ.entry[lq_index].ip;
    data_packet.type = LOAD;
    data_packet.asid[0] = LQ.entry[lq_index].asid[0];
    data_packet.asid[1] = LQ.entry[lq_index].asid[1];
    data_packet.event_cycle = LQ.entry[lq_index].event_cycle;

    int rq_index = L1D.add_rq(&data_packet);

    if (rq_index == -2)
        return rq_index;
    else 
        LQ.entry[lq_index].fetched = INFLIGHT;

    return rq_index;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x388, %rsp            # imm = 0x388
movl %edx, %ebp
movq %rdi, %rbx
xorl %r15d, %r15d
leaq 0x20(%rsp), %r14
movl %r15d, -0x15(%r14)
movl %r15d, -0x18(%r14)
movl $0xffff00, 0x314(%r14) # imm = 0xFFFF00
pcmpeqd %xmm0, %xmm0
movdqu %xmm0, -0x10(%r14)
movl $0x314, %edx            # imm = 0x314
movq %r14, %rdi
xorl %esi, %esi
callq 0x3130
movl $0x1, %eax
movl %eax, 0x318(%r14)
pxor %xmm0, %xmm0
movdqu %xmm0, 0x31c(%r14)
movdqu %xmm0, 0x32c(%r14)
movl %r15d, 0x33c(%r14)
movdqu %xmm0, 0x348(%r14)
movq $0x0, 0x358(%r14)
movq $-0x1, 0x360(%r14)
movl %eax, -0x10(%r14)
movl (%rbx), %eax
movl %eax, 0x318(%r14)
movq 0x9f0(%rbx), %rax
movl %ebp, %ecx
leaq (%rcx,%rcx,4), %r15
shlq $0x6, %r15
movl 0x34(%rax,%r15), %ecx
movl %ecx, 0x31c(%r14)
movl %ebp, 0x320(%r14)
movq 0x18(%rax,%r15), %rcx
movq %rcx, %rdx
shrq $0x6, %rdx
movq %rdx, 0x328(%r14)
movq %rcx, 0x330(%r14)
movq (%rax,%r15), %rcx
movq %rcx, 0x350(%r14)
movl 0x30(%rax,%r15), %ecx
movl %ecx, -0x8(%r14)
movq 0x20(%rax,%r15), %rcx
movq %rcx, 0x358(%r14)
movb $0x0, 0x317(%r14)
movb 0x3e(%rax,%r15), %cl
movb %cl, 0x315(%r14)
movb 0x3f(%rax,%r15), %cl
movb %cl, 0x316(%r14)
movq 0x28(%rax,%r15), %rax
movq %rax, 0x360(%r14)
leaq 0x44530(%rbx), %rdi
leaq 0x8(%rsp), %rsi
callq 0x5a80
cmpl $-0x2, %eax
je 0xf066
movq 0x9f0(%rbx), %rcx
movb $0x1, 0x3d(%rcx,%r15)
addq $0x388, %rsp            # imm = 0x388
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/NishadSaraf[P]Championship-Simulator/src/ooo_cpu.cc
// Function: O3_CPU::complete_execution(unsigned int)
void O3_CPU::complete_execution(uint32_t rob_index)
{
    if (ROB.entry[rob_index].is_memory == 0) {
        if ((ROB.entry[rob_index].executed == INFLIGHT) && (ROB.entry[rob_index].event_cycle <= current_core_cycle[cpu])) {

            ROB.entry[rob_index].executed = COMPLETED; 
            inflight_reg_executions--;
            completed_executions++;

            if (ROB.entry[rob_index].reg_RAW_producer)
                reg_RAW_release(rob_index);

            if (ROB.entry[rob_index].branch_mispredicted) 
                fetch_stall = 0;

            DP(if(warmup_complete[cpu]) {
            cout << "[ROB] " << __func__ << " instr_id: " << ROB.entry[rob_index].instr_id;
            cout << " branch_mispredicted: " << +ROB.entry[rob_index].branch_mispredicted << " fetch_stall: " << +fetch_stall;
            cout << " event: " << ROB.entry[rob_index].event_cycle << endl; });
        }
    }
    else {
        if (ROB.entry[rob_index].num_mem_ops == 0) {
            if ((ROB.entry[rob_index].executed == INFLIGHT) && (ROB.entry[rob_index].event_cycle <= current_core_cycle[cpu])) {
                ROB.entry[rob_index].executed = COMPLETED;
                inflight_mem_executions--;
                completed_executions++;
                
                if (ROB.entry[rob_index].reg_RAW_producer)
                    reg_RAW_release(rob_index);

                if (ROB.entry[rob_index].branch_mispredicted) 
                    fetch_stall = 0;

                DP(if(warmup_complete[cpu]) {
                cout << "[ROB] " << __func__ << " instr_id: " << ROB.entry[rob_index].instr_id;
                cout << " is_memory: " << +ROB.entry[rob_index].is_memory << " branch_mispredicted: " << +ROB.entry[rob_index].branch_mispredicted;
                cout << " fetch_stall: " << +fetch_stall << " event: " << ROB.entry[rob_index].event_cycle << " current: " << current_core_cycle[cpu] << endl; });
            }
        }
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x9b8(%rdi), %rax
movl %esi, %ecx
imulq $0x758, %rcx, %r14      # imm = 0x758
leaq (%rax,%r14), %rcx
cmpb $0x0, 0x49(%rax,%r14)
je 0xf0c5
cmpl $0x0, 0x70(%rcx)
jne 0xf118
cmpl $0x1, 0x78(%rcx)
jne 0xf118
movq 0x40(%rcx), %rdx
movl (%rbx), %edi
leaq 0x71e10(%rip), %r8      # 0x80ec0
cmpq (%r8,%rdi,8), %rdx
ja 0xf118
movl $0x2, 0x78(%rcx)
decl 0x924(%rbx)
jmp 0xf0eb
cmpl $0x1, 0x78(%rcx)
jne 0xf118
movq 0x40(%rcx), %rdx
movl (%rbx), %edi
leaq 0x71de8(%rip), %r8      # 0x80ec0
cmpq (%r8,%rdi,8), %rdx
ja 0xf118
movl $0x2, 0x78(%rcx)
decl 0x920(%rbx)
incq 0x8b8(%rbx)
cmpb $0x0, 0x58(%rax,%r14)
je 0xf102
movq %rbx, %rdi
callq 0xf120
movq 0x9b8(%rbx), %rax
cmpb $0x0, 0x4b(%rax,%r14)
je 0xf118
movb $0x0, 0x3678(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/NishadSaraf[P]Championship-Simulator/src/ooo_cpu.cc
// Function: O3_CPU::reg_RAW_release(unsigned int)
void O3_CPU::reg_RAW_release(uint32_t rob_index)
{
    for (uint32_t i=0; i<ROB.SIZE; i++) {
        if (ROB.entry[rob_index].registers_instrs_depend_on_me[i]) {
            for (uint32_t j=0; j<NUM_INSTR_SOURCES; j++) {
                if (ROB.entry[rob_index].registers_index_depend_on_me[i][j]) {
                    ROB.entry[i].num_reg_dependent--;

                    if (ROB.entry[i].num_reg_dependent == 0) {
                        ROB.entry[i].reg_ready = 1;
                        if (ROB.entry[i].is_memory)
                            ROB.entry[i].scheduled = INFLIGHT;
                        else {
                            ROB.entry[i].scheduled = COMPLETED;

#ifdef SANITY_CHECK
                            if (RTE0[RTE0_tail] < ROB_SIZE)
                                assert(0);
#endif
                            // remember this rob_index in the Ready-To-Execute array 0
                            RTE0[RTE0_tail] = i;

                            DP (if (warmup_complete[cpu]) {
                            cout << "[RTE0] " << __func__ << " instr_id: " << ROB.entry[i].instr_id << " rob_index: " << i << " is added to RTE0";
                            cout << " head: " << RTE0_head << " tail: " << RTE0_tail << endl; }); 

                            RTE0_tail++;
                            if (RTE0_tail == ROB_SIZE)
                                RTE0_tail = 0;

                        }
                    }

                    DP (if (warmup_complete[cpu]) {
                    cout << "[ROB] " << __func__ << " instr_id: " << ROB.entry[rob_index].instr_id << " releases instr_id: ";
                    cout << ROB.entry[i].instr_id << " reg_index: " << +ROB.entry[i].source_registers[j] << " num_reg_dependent: " << ROB.entry[i].num_reg_dependent << " cycle: " << current_core_cycle[cpu] << endl; });
                }
            }
        }
    }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl 0x950(%rdi), %eax
testq %rax, %rax
je 0xf1f6
movq 0x9b8(%rdi), %rcx
movl %esi, %edx
imulq $0x758, %rdx, %rdx      # imm = 0x758
leaq (%rdx,%rcx), %rsi
addq $0x184, %rsi            # imm = 0x184
xorl %r8d, %r8d
addq %rcx, %rdx
xorl %r9d, %r9d
cmpb $0x0, 0x84(%r9,%rdx)
je 0xf1e6
imulq $0x758, %r9, %r10       # imm = 0x758
leaq (%rcx,%r10), %r11
addq $0x74, %r11
addq %rcx, %r10
xorl %ebx, %ebx
cmpb $0x0, (%rsi,%rbx)
je 0xf1dd
decl (%r11)
cmpl $0x0, 0x74(%r10)
jne 0xf1dd
movb $0x1, 0x59(%r10)
cmpb $0x0, 0x49(%r10)
je 0xf1a0
movl $0x1, 0x68(%r10)
jmp 0xf1dd
movl $0x2, 0x68(%r10)
movl 0x2e44(%rdi), %r14d
cmpl $0xff, 0x2a40(%rdi,%r14,4)
jbe 0xf1fb
movl %r9d, 0x2a40(%rdi,%r14,4)
movl 0x2e44(%rdi), %ebp
incl %ebp
cmpl $0x100, %ebp            # imm = 0x100
cmovel %r8d, %ebp
movl %ebp, 0x2e44(%rdi)
incq %rbx
cmpq $0x4, %rbx
jne 0xf17a
incq %r9
addq $0x4, %rsi
cmpq %rax, %r9
jne 0xf157
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x4e65(%rip), %rdi      # 0x14067
leaq 0x5aad(%rip), %rsi      # 0x14cb6
leaq 0x5d1c(%rip), %rcx      # 0x14f2c
movl $0x59a, %edx            # imm = 0x59A
callq 0x3160
// File: /workspace/github_cpp_makefile_star2_O1/NishadSaraf[P]Championship-Simulator/src/ooo_cpu.cc
// Function: O3_CPU::update_rob()
void O3_CPU::update_rob()
{
    if (ITLB.PROCESSED.occupancy && (ITLB.PROCESSED.entry[ITLB.PROCESSED.head].event_cycle <= current_core_cycle[cpu]))
        complete_instr_fetch(&ITLB.PROCESSED, 1);

    if (L1I.PROCESSED.occupancy && (L1I.PROCESSED.entry[L1I.PROCESSED.head].event_cycle <= current_core_cycle[cpu]))
        complete_instr_fetch(&L1I.PROCESSED, 0);

    if (DTLB.PROCESSED.occupancy && (DTLB.PROCESSED.entry[DTLB.PROCESSED.head].event_cycle <= current_core_cycle[cpu]))
        complete_data_fetch(&DTLB.PROCESSED, 1);

    if (L1D.PROCESSED.occupancy && (L1D.PROCESSED.entry[L1D.PROCESSED.head].event_cycle <= current_core_cycle[cpu]))
        complete_data_fetch(&L1D.PROCESSED, 0);

    // update ROB entries with completed executions
    if ((inflight_reg_executions > 0) || (inflight_mem_executions > 0)) {
        if (ROB.head < ROB.tail) {
            for (uint32_t i=ROB.head; i<ROB.tail; i++) 
                complete_execution(i);
        }
        else {
            for (uint32_t i=ROB.head; i<ROB.SIZE; i++)
                complete_execution(i);
            for (uint32_t i=0; i<ROB.tail; i++)
                complete_execution(i);
        }
    }
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpl $0x0, 0x11cec(%rdi)
je 0xf268
movq 0x11d50(%rbx), %rax
movl 0x11ce4(%rbx), %ecx
imulq $0x380, %rcx, %rcx      # imm = 0x380
movq 0x378(%rax,%rcx), %rax
movl (%rbx), %ecx
leaq 0x71c72(%rip), %rdx     # 0x80ec0
cmpq (%rdx,%rcx,8), %rax
ja 0xf268
leaq 0x11cb8(%rbx), %rsi
movq %rbx, %rdi
movl $0x1, %edx
callq 0xf3a8
cmpl $0x0, 0x427e4(%rbx)
je 0xf2ad
movq 0x42848(%rbx), %rax
movl 0x427dc(%rbx), %ecx
imulq $0x380, %rcx, %rcx      # imm = 0x380
movq 0x378(%rax,%rcx), %rax
movl (%rbx), %ecx
leaq 0x71c2a(%rip), %rdx     # 0x80ec0
cmpq (%rdx,%rcx,8), %rax
ja 0xf2ad
leaq 0x427b0(%rbx), %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0xf3a8
cmpl $0x0, 0x22094(%rbx)
je 0xf2f5
movq 0x220f8(%rbx), %rax
movl 0x2208c(%rbx), %ecx
imulq $0x380, %rcx, %rcx      # imm = 0x380
movq 0x378(%rax,%rcx), %rax
movl (%rbx), %ecx
leaq 0x71be5(%rip), %rdx     # 0x80ec0
cmpq (%rdx,%rcx,8), %rax
ja 0xf2f5
leaq 0x22060(%rbx), %rsi
movq %rbx, %rdi
movl $0x1, %edx
callq 0xf50a
cmpl $0x0, 0x52b8c(%rbx)
je 0xf33a
movq 0x52bf0(%rbx), %rax
movl 0x52b84(%rbx), %ecx
imulq $0x380, %rcx, %rcx      # imm = 0x380
movq 0x378(%rax,%rcx), %rax
movl (%rbx), %ecx
leaq 0x71b9d(%rip), %rdx     # 0x80ec0
cmpq (%rdx,%rcx,8), %rax
ja 0xf33a
leaq 0x52b58(%rbx), %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0xf50a
movl 0x924(%rbx), %eax
orl 0x920(%rbx), %eax
je 0xf3a1
movl 0x958(%rbx), %ebp
cmpl 0x95c(%rbx), %ebp
jae 0xf36c
cmpl 0x95c(%rbx), %ebp
jae 0xf3a1
movq %rbx, %rdi
movl %ebp, %esi
callq 0xf074
incl %ebp
jmp 0xf356
cmpl 0x950(%rbx), %ebp
jae 0xf382
movq %rbx, %rdi
movl %ebp, %esi
callq 0xf074
incl %ebp
jmp 0xf36c
cmpl $0x0, 0x95c(%rbx)
je 0xf3a1
xorl %ebp, %ebp
movq %rbx, %rdi
movl %ebp, %esi
callq 0xf074
incl %ebp
cmpl 0x95c(%rbx), %ebp
jb 0xf38d
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl %edx, %r14d
movq %rdi, %rbx
leaq 0x10(%rdi), %r13
movq %r13, (%rdi)
movq (%rsi), %rax
movq 0x8(%rsi), %rdx
addq %rax, %rdx
movq %rax, %rsi
callq 0x110e4
movl %r14d, 0x20(%rbx)
xorl %eax, %eax
movq %rax, 0x28(%rbx)
movl $0x0, 0x30(%rbx)
leal -0x1(%r14), %ecx
movl %ecx, 0x34(%rbx)
movl %ecx, 0x38(%rbx)
movq %rax, 0x58(%rbx)
pxor %xmm0, %xmm0
movdqu %xmm0, 0x3c(%rbx)
movq %rax, 0x4c(%rbx)
movl %r14d, %eax
imulq $0x758, %rax, %r15      # imm = 0x758
pcmpeqd %xmm0, %xmm0
movdqu %xmm0, 0x60(%rbx)
movdqu %xmm0, 0x70(%rbx)
movq $-0x1, 0x80(%rbx)
movq %r15, %rdi
callq 0x3030
movq %rax, %r12
testl %r14d, %r14d
je 0x108f8
movq %r12, %r14
movq %r14, %rdi
callq 0x1077a
addq $0x758, %r14            # imm = 0x758
addq $-0x758, %r15           # imm = 0xF8A8
jne 0x108e0
movq %r12, 0x88(%rbx)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %r14
movq (%rbx), %rdi
cmpq %r13, %rdi
je 0x10919
callq 0x3220
movq %r14, %rdi
callq 0x33d0
nop
// File: /workspace/github_cpp_makefile_star2_O1/NishadSaraf[P]Championship-Simulator/inc/block.h
// Function: LOAD_STORE_QUEUE::LOAD_STORE_QUEUE(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, unsigned int)
LOAD_STORE_QUEUE(string v1, uint32_t v2) : NAME(v1), SIZE(v2) {
        occupancy = 0;
        head = 0;
        tail = 0;

        entry = new LSQ_ENTRY[SIZE];
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rdi, %rbx
leaq 0x10(%rdi), %r15
movq %r15, (%rdi)
movq (%rsi), %rax
movq 0x8(%rsi), %rdx
addq %rax, %rdx
movq %rax, %rsi
callq 0x110e4
movl %ebp, 0x20(%rbx)
movq $0x0, 0x24(%rbx)
movl $0x0, 0x2c(%rbx)
movl %ebp, %r12d
movq %r12, %rax
shlq $0x6, %rax
leaq (%rax,%rax,4), %rdi
callq 0x3030
movq %rax, %r14
testl %ebp, %ebp
je 0x109d0
leaq (%r12,%r12,4), %rax
shlq $0x6, %rax
movq %r14, %r15
addq %rax, %r15
xorl %r12d, %r12d
movabsq $-0xffff00000001, %r13  # imm = 0xFFFF0000FFFFFFFF
movq %r14, %rbp
movq %r12, (%rbp)
movq $-0x1, 0x8(%rbp)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rbp)
movups %xmm0, 0x20(%rbp)
movq %r12, 0x30(%rbp)
movq %r13, 0x38(%rbp)
leaq 0x40(%rbp), %rdi
movl $0x100, %edx            # imm = 0x100
xorl %esi, %esi
callq 0x3130
addq $0x140, %rbp            # imm = 0x140
cmpq %r15, %rbp
jne 0x10995
movq %r14, 0x30(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq (%rbx), %rdi
cmpq %r15, %rdi
je 0x109f3
callq 0x3220
movq %r14, %rdi
callq 0x33d0
nop
// File: /workspace/github_cpp_makefile_star2_O1/NishadSaraf[P]Championship-Simulator/inc/memory_class.h
// Function: MEMORY::MEMORY()
MEMORY() {
        for (uint32_t i=0; i<NUM_TYPES; i++) {
            ACCESS[i] = 0;
            HIT[i] = 0;
            MISS[i] = 0;
            MSHR_MERGED[i] = 0;
            STALL[i] = 0;
        }
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x80, %rsp
movq %rdi, %r14
leaq 0x8b72(%rip), %rax      # 0x19d00
movq %rax, (%rdi)
leaq 0x28(%rdi), %rbx
leaq 0x70(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x3ebb(%rip), %rsi      # 0x15061
leaq 0x3eb9(%rip), %rdx      # 0x15066
leaq 0x60(%rsp), %r15
movq %r15, %rdi
callq 0xad18
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x11350
movq 0x60(%rsp), %rdi
cmpq %r12, %rdi
je 0x111d9
callq 0x3220
leaq 0x50(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x3e77(%rip), %rsi      # 0x15061
leaq 0x3e75(%rip), %rdx      # 0x15066
leaq 0x40(%rsp), %rdi
callq 0xad18
leaq 0x1cc8(%r14), %r15
leaq 0x40(%rsp), %rsi
movq %r15, %rdi
movl $0x1, %edx
callq 0x11350
movq 0x40(%rsp), %rdi
cmpq %r12, %rdi
je 0x11223
callq 0x3220
leaq 0x30(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x3e2e(%rip), %rsi      # 0x15061
leaq 0x3e2c(%rip), %rdx      # 0x15066
leaq 0x20(%rsp), %rdi
callq 0xad18
leaq 0x3968(%r14), %r12
leaq 0x20(%rsp), %rsi
movq %r12, %rdi
movl $0x1, %edx
callq 0x11350
movq 0x20(%rsp), %rdi
cmpq %r13, %rdi
je 0x1126c
callq 0x3220
leaq 0x10(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x3de5(%rip), %rsi      # 0x15061
leaq 0x3de3(%rip), %rdx      # 0x15066
movq %rsp, %rdi
callq 0xad18
leaq 0x5608(%r14), %rdi
movq %rsp, %rsi
movl $0x1, %edx
callq 0x11350
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x112ad
callq 0x3220
addq $0x72a8, %r14           # imm = 0x72A8
movl $0xa0, %edx
movq %r14, %rdi
xorl %esi, %esi
callq 0x3130
addq $0x80, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %r14
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x112ea
callq 0x3220
jmp 0x112ea
movq %rax, %r14
movq %r12, %rdi
callq 0x1152c
jmp 0x1130b
movq %rax, %r14
movq 0x20(%rsp), %rdi
cmpq %r13, %rdi
je 0x1130b
callq 0x3220
jmp 0x1130b
movq %rax, %r14
movq %r15, %rdi
callq 0x1152c
jmp 0x1132c
movq %rax, %r14
movq 0x40(%rsp), %rdi
cmpq %r12, %rdi
je 0x1132c
callq 0x3220
jmp 0x1132c
movq %rax, %r14
movq %rbx, %rdi
callq 0x1152c
movq %r14, %rdi
callq 0x33d0
movq %rax, %r14
movq 0x60(%rsp), %rdi
cmpq %r12, %rdi
je 0x11334
callq 0x3220
jmp 0x11334
// File: /workspace/github_cpp_makefile_star2_O1/NishadSaraf[P]Championship-Simulator/inc/block.h
// Function: PACKET_QUEUE::PACKET_QUEUE(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, unsigned int)
PACKET_QUEUE(string v1, uint32_t v2) : NAME(v1), SIZE(v2) {
        is_RQ = 0;
        is_WQ = 0;

        cpu = 0; 
        head = 0;
        tail = 0;
        occupancy = 0;
        num_returned = 0;
        next_fill_index = 0;
        next_schedule_index = 0;
        next_process_index = 0;

        next_fill_cycle = UINT64_MAX;
        next_schedule_cycle = UINT64_MAX;
        next_process_cycle = UINT64_MAX;

        ACCESS = 0;
        FORWARD = 0;
        MERGED = 0;
        TO_CACHE = 0;
        ROW_BUFFER_HIT = 0;
        ROW_BUFFER_MISS = 0;
        FULL = 0;

        entry = new PACKET[SIZE]; 
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rdi, %rbx
leaq 0x10(%rdi), %r12
movq %r12, (%rdi)
movq (%rsi), %rax
movq 0x8(%rsi), %rdx
addq %rax, %rdx
movq %rax, %rsi
callq 0x110e4
movl %ebp, 0x20(%rbx)
movl $0x418, %r15d           # imm = 0x418
xorl %ebp, %ebp
leaq (%rbx,%r15), %r14
addq $-0x360, %r14           # imm = 0xFCA0
movl %ebp, -0x15(%r14)
movl %ebp, -0x18(%r14)
movl $0xffff00, 0x314(%r14) # imm = 0xFFFF00
pcmpeqd %xmm0, %xmm0
movdqu %xmm0, -0x10(%r14)
movl $0x314, %edx            # imm = 0x314
movq %r14, %rdi
xorl %esi, %esi
callq 0x3130
movl $0x1, 0x318(%r14)
pxor %xmm0, %xmm0
movdqu %xmm0, 0x31c(%r14)
movdqu %xmm0, 0x32c(%r14)
movl %ebp, 0x33c(%r14)
movdqu %xmm0, 0x348(%r14)
movq $0x0, 0x358(%r14)
movq $-0x1, 0x360(%r14)
addq $0x380, %r15            # imm = 0x380
cmpq $0x2018, %r15           # imm = 0x2018
jne 0x11384
movw $0x0, 0x24(%rbx)
movdqu %xmm0, 0x28(%rbx)
movdqu %xmm0, 0x38(%rbx)
pcmpeqd %xmm1, %xmm1
movdqu %xmm1, 0x48(%rbx)
movq $-0x1, 0x58(%rbx)
movdqu %xmm0, 0x60(%rbx)
movdqu %xmm0, 0x70(%rbx)
movdqu %xmm0, 0x80(%rbx)
movq $0x0, 0x90(%rbx)
movl 0x20(%rbx), %r13d
imulq $0x380, %r13, %r15      # imm = 0x380
movq %r15, %rdi
callq 0x3030
movq %rax, %r14
testq %r13, %r13
je 0x114fd
movq %r14, %r12
addq %r15, %r12
xorl %ebp, %ebp
movq %r14, %r15
movl %ebp, 0x3(%r15)
movl %ebp, (%r15)
movl $0xffff00, 0x32c(%r15) # imm = 0xFFFF00
leaq 0x18(%r15), %rdi
pcmpeqd %xmm0, %xmm0
movdqu %xmm0, 0x8(%r15)
movl $0x314, %edx            # imm = 0x314
xorl %esi, %esi
callq 0x3130
movl $0x1, 0x330(%r15)
pxor %xmm0, %xmm0
movdqu %xmm0, 0x334(%r15)
movdqu %xmm0, 0x344(%r15)
movl %ebp, 0x354(%r15)
movdqu %xmm0, 0x360(%r15)
movq $0x0, 0x370(%r15)
movq $-0x1, 0x378(%r15)
addq $0x380, %r15            # imm = 0x380
cmpq %r12, %r15
jne 0x1147e
movq %r14, 0x98(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq (%rbx), %rdi
cmpq %r12, %rdi
je 0x11523
callq 0x3220
movq %r14, %rdi
callq 0x33d0
nop