LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/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 0xb50c(%rip), %rax      # 0x16200
movzbl (%rax), %r8d
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
cmpq %r11, %r8
je 0xad87
movb 0x7c(%r9,%r11), %bl
testb %bl, %bl
je 0xad3a
cmpb (%r10), %bl
je 0xad3f
incq %r11
jmp 0xad27
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
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 0xb540
testl %eax, %eax
jne 0xb0e3
movq 0x9b8(%rbx), %rax
movl %ebp, %ecx
imulq $0x758, %rcx, %rcx      # imm = 0x758
movl $0x2, 0x68(%rax,%rcx)
cmpl $0x0, 0x78(%rax,%rcx)
jne 0xb0e3
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_O2/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 0x45ba
leaq 0x13a38(%rbx), %rdi
callq 0x45ba
leaq 0x23de0(%rbx), %rdi
callq 0x45ba
leaq 0x34188(%rbx), %rdi
callq 0x45ba
leaq 0x44530(%rbx), %rdi
callq 0x45ba
addq $0x548d8, %rbx          # imm = 0x548D8
movq %rbx, %rdi
popq %rbx
jmp 0x45ba
// File: /workspace/github_cpp_makefile_star2_O2/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 0xa64d(%rip), %rax      # 0x16200
movzbl (%rax), %r9d
movq 0x9b8(%rdi), %r10
movl %esi, %eax
imulq $0x758, %rax, %rax      # imm = 0x758
leaq (%r10,%rax), %rsi
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
cmpq %r10, %r9
je 0xbc35
movq 0x5a8(%rsi,%r10,8), %r11
testq %r11, %r11
je 0xbbfe
cmpq (%rcx), %r11
je 0xbc03
incq %r10
jmp 0xbbe7
movb $0x1, %cl
movb %cl, 0x628(%rsi,%rdx)
movq 0x9b8(%rdi), %rdx
movb %cl, 0x56(%rdx,%rax)
movq (%rdx,%rax), %rax
movq 0x9f0(%rdi), %rdx
movl %r8d, %esi
imulq $0x140, %rsi, %rsi      # imm = 0x140
movq %rax, 0x8(%rdx,%rsi)
movb %cl, 0x3c(%rdx,%rsi)
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x53f4
movl $0x1, 0x8(%r14)
movl (%rbx), %eax
movl %eax, 0x330(%r14)
movq 0x9f0(%rbx), %rax
movl %ebp, %ecx
imulq $0x140, %rcx, %r15      # imm = 0x140
movl 0x34(%rax,%r15), %ecx
movl %ecx, 0x334(%r14)
movl %ebp, 0x338(%r14)
movq 0x18(%rax,%r15), %rcx
movq %rcx, %rdx
shrq $0x6, %rdx
movq %rdx, 0x340(%r14)
movq %rcx, 0x348(%r14)
movq (%rax,%r15), %rcx
movq %rcx, 0x368(%r14)
movl 0x30(%rax,%r15), %ecx
movl %ecx, 0x10(%r14)
movq 0x20(%rax,%r15), %rcx
movq %rcx, 0x370(%r14)
movb $0x0, 0x32f(%r14)
movb 0x3e(%rax,%r15), %cl
movb %cl, 0x32d(%r14)
movb 0x3f(%rax,%r15), %cl
movb %cl, 0x32e(%r14)
movq 0x28(%rax,%r15), %rax
movq %rax, 0x378(%r14)
leaq 0x44530(%rbx), %rdi
movq %r14, %rsi
callq 0x477a
cmpl $-0x2, %eax
je 0xc0a8
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_O2/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 0xc107
cmpl $0x0, 0x70(%rcx)
jne 0xc15a
cmpl $0x1, 0x78(%rcx)
jne 0xc15a
movq 0x40(%rcx), %rdx
movl (%rbx), %edi
leaq 0x70dbe(%rip), %r8      # 0x7ceb0
cmpq (%r8,%rdi,8), %rdx
ja 0xc15a
movl $0x2, 0x78(%rcx)
decl 0x924(%rbx)
jmp 0xc12d
cmpl $0x1, 0x78(%rcx)
jne 0xc15a
movq 0x40(%rcx), %rdx
movl (%rbx), %edi
leaq 0x70d96(%rip), %r8      # 0x7ceb0
cmpq (%r8,%rdi,8), %rdx
ja 0xc15a
movl $0x2, 0x78(%rcx)
decl 0x920(%rbx)
incq 0x8b8(%rbx)
cmpb $0x0, 0x58(%rax,%r14)
je 0xc14b
movq %rbx, %rdi
callq 0xc162
movq 0x9b8(%rbx), %rax
cmpb $0x0, 0x4b(%rax,%r14)
je 0xc15a
movb $0x0, 0x3678(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
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
cmpq %rax, %r9
je 0xc22d
cmpb $0x0, 0x84(%r9,%rdx)
je 0xc221
imulq $0x758, %r9, %r10       # imm = 0x758
leaq (%rcx,%r10), %r11
addq $0x74, %r11
addq %rcx, %r10
xorl %ebx, %ebx
cmpq $0x4, %rbx
je 0xc221
cmpb $0x0, (%rsi,%rbx)
je 0xc21c
decl (%r11)
jne 0xc21c
movb $0x1, 0x59(%r10)
cmpb $0x0, 0x49(%r10)
je 0xc1df
movl $0x1, 0x68(%r10)
jmp 0xc21c
movl $0x2, 0x68(%r10)
movl 0x2e44(%rdi), %r14d
cmpl $0xff, 0x2a40(%rdi,%r14,4)
jbe 0xc232
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
jmp 0xc1b8
incq %r9
addq $0x4, %rsi
jmp 0xc190
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x3e2e(%rip), %rdi      # 0x10067
leaq 0x49ae(%rip), %rsi      # 0x10bee
leaq 0x4c1d(%rip), %rcx      # 0x10e64
movl $0x59a, %edx            # imm = 0x59A
callq 0x2160
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 0xc29e
movq 0x11d50(%rbx), %rax
movl 0x11ce4(%rbx), %ecx
imulq $0x380, %rcx, %rcx      # imm = 0x380
movq 0x378(%rax,%rcx), %rax
movl (%rbx), %ecx
leaq 0x70c2a(%rip), %rdx     # 0x7ceb0
cmpq (%rdx,%rcx,8), %rax
ja 0xc29e
leaq 0x11cb8(%rbx), %rsi
pushq $0x1
popq %rdx
movq %rbx, %rdi
callq 0xc3da
cmpl $0x0, 0x427e4(%rbx)
je 0xc2e3
movq 0x42848(%rbx), %rax
movl 0x427dc(%rbx), %ecx
imulq $0x380, %rcx, %rcx      # imm = 0x380
movq 0x378(%rax,%rcx), %rax
movl (%rbx), %ecx
leaq 0x70be4(%rip), %rdx     # 0x7ceb0
cmpq (%rdx,%rcx,8), %rax
ja 0xc2e3
leaq 0x427b0(%rbx), %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0xc3da
cmpl $0x0, 0x22094(%rbx)
je 0xc329
movq 0x220f8(%rbx), %rax
movl 0x2208c(%rbx), %ecx
imulq $0x380, %rcx, %rcx      # imm = 0x380
movq 0x378(%rax,%rcx), %rax
movl (%rbx), %ecx
leaq 0x70b9f(%rip), %rdx     # 0x7ceb0
cmpq (%rdx,%rcx,8), %rax
ja 0xc329
leaq 0x22060(%rbx), %rsi
pushq $0x1
popq %rdx
movq %rbx, %rdi
callq 0xc534
cmpl $0x0, 0x52b8c(%rbx)
je 0xc36e
movq 0x52bf0(%rbx), %rax
movl 0x52b84(%rbx), %ecx
imulq $0x380, %rcx, %rcx      # imm = 0x380
movq 0x378(%rax,%rcx), %rax
movl (%rbx), %ecx
leaq 0x70b59(%rip), %rdx     # 0x7ceb0
cmpq (%rdx,%rcx,8), %rax
ja 0xc36e
leaq 0x52b58(%rbx), %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0xc534
movl 0x924(%rbx), %eax
orl 0x920(%rbx), %eax
jne 0xc383
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movl 0x958(%rbx), %ebp
movl 0x95c(%rbx), %eax
cmpl %eax, %ebp
jae 0xc3ab
cmpl %eax, %ebp
jae 0xc37c
movq %rbx, %rdi
movl %ebp, %esi
callq 0xc0b6
incl %ebp
movl 0x95c(%rbx), %eax
jmp 0xc393
cmpl 0x950(%rbx), %ebp
jae 0xc3c1
movq %rbx, %rdi
movl %ebp, %esi
callq 0xc0b6
incl %ebp
jmp 0xc3ab
xorl %ebp, %ebp
cmpl 0x95c(%rbx), %ebp
jae 0xc37c
movq %rbx, %rdi
movl %ebp, %esi
callq 0xc0b6
incl %ebp
jmp 0xc3c3
nop
// File: /workspace/github_cpp_makefile_star2_O2/NishadSaraf[P]Championship-Simulator/src/ooo_cpu.cc
// Function: O3_CPU::handle_merged_load(PACKET*)
void O3_CPU::handle_merged_load(PACKET *provider)
{
    for (uint32_t merged=0; merged<LQ.SIZE; merged++) {
        if (provider->lq_index_depend_on_me[merged]) {
            uint32_t merged_rob_index = LQ.entry[merged].rob_index;

            LQ.entry[merged].fetched = COMPLETED;
            LQ.entry[merged].event_cycle = current_core_cycle[cpu];
            ROB.entry[merged_rob_index].num_mem_ops--;
            ROB.entry[merged_rob_index].event_cycle = current_core_cycle[cpu];

#ifdef SANITY_CHECK
            if (ROB.entry[merged_rob_index].num_mem_ops < 0) {
                cerr << "instr_id: " << ROB.entry[merged_rob_index].instr_id << " rob_index: " << merged_rob_index << endl;
                assert(0);
            }
#endif

            if (ROB.entry[merged_rob_index].num_mem_ops == 0)
                inflight_mem_executions++;

            DP (if (warmup_complete[cpu]) {
            cout << "[ROB] " << __func__ << " load instr_id: " << LQ.entry[merged].instr_id;
            cout << " L1D_FETCH_DONE translation: " << +LQ.entry[merged].translated << hex << " address: " << (LQ.entry[merged].physical_address>>LOG2_BLOCK_SIZE);
            cout << " full_addr: " << LQ.entry[merged].physical_address << dec << " by instr_id: " << +provider->instr_id;
            cout << " remain_mem_ops: " << ROB.entry[merged_rob_index].num_mem_ops << endl; });

            release_load_queue(merged);
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
pushq $0x3d
popq %r13
xorl %r15d, %r15d
movl 0x9e0(%rbx), %eax
cmpq %rax, %r15
jae 0xc9c0
cmpb $0x0, 0x129(%r14,%r15)
je 0xc9b4
movq 0x9f0(%rbx), %rax
movl -0xd(%rax,%r13), %r12d
movb $0x2, (%rax,%r13)
movl (%rbx), %ecx
leaq 0x7053c(%rip), %rdx     # 0x7ceb0
movq (%rdx,%rcx,8), %rcx
movq %rcx, -0x15(%rax,%r13)
movq 0x9b8(%rbx), %rdx
imulq $0x758, %r12, %rbp      # imm = 0x758
movl 0x70(%rdx,%rbp), %esi
leal -0x1(%rsi), %eax
movl %eax, 0x70(%rdx,%rbp)
movq %rcx, 0x40(%rdx,%rbp)
testl %esi, %esi
jle 0xc9cf
testl %eax, %eax
jne 0xc9a9
incl 0x924(%rbx)
movq %rbx, %rdi
movl %r15d, %esi
callq 0xbc36
incq %r15
addq $0x140, %r13            # imm = 0x140
jmp 0xc944
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x961a(%rip), %rdi      # 0x15ff0
leaq 0x447c(%rip), %rsi      # 0x10e59
callq 0x2230
movq 0x9b8(%rbx), %rcx
movq (%rcx,%rbp), %rsi
movq %rax, %rdi
callq 0x2080
leaq 0x3c61(%rip), %rsi      # 0x1065d
movq %rax, %rdi
callq 0x2230
movq %rax, %rdi
movl %r12d, %esi
callq 0x22a0
movq %rax, %rdi
callq 0x2110
leaq 0x3649(%rip), %rdi      # 0x10067
leaq 0x41c9(%rip), %rsi      # 0x10bee
leaq 0x4505(%rip), %rcx      # 0x10f31
movl $0x70c, %edx            # imm = 0x70C
callq 0x2160
// File: /workspace/github_cpp_makefile_star2_O2/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:
andq $0x0, (%rdi)
andw $0x0, 0x8(%rdi)
pushq $0x4
popq %rax
cmpq $0x8, %rax
je 0xd6a1
movb $0x0, 0x8(%rdi,%rax)
andq $0x0, (%rdi,%rax,8)
incq %rax
jmp 0xd68c
xorl %eax, %eax
cmpq $0x2, %rax
je 0xd6b9
movb $0x0, 0xa(%rdi,%rax)
andq $0x0, 0x10(%rdi,%rax,8)
incq %rax
jmp 0xd6a3
retq
// File: /workspace/github_cpp_makefile_star2_O2/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:
andq $0x0, (%rdi)
andw $0x0, 0x8(%rdi)
pushq $0x7
popq %rax
cmpq $0xb, %rax
je 0xd6db
movb $0x0, 0x7(%rdi,%rax)
andq $0x0, (%rdi,%rax,8)
incq %rax
jmp 0xd6c6
pushq $0x3
popq %rax
cmpq $0x7, %rax
je 0xd6f3
movb $0x0, 0x7(%rdi,%rax)
andq $0x0, (%rdi,%rax,8)
incq %rax
jmp 0xd6de
orw $-0x1, 0x58(%rdi)
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 %r12
pushq %rbx
pushq %rax
movl %edx, %r14d
movq %rdi, %rbx
callq 0x22b0
movl %r14d, 0x20(%rbx)
andq $0x0, 0x28(%rbx)
andl $0x0, 0x30(%rbx)
leal -0x1(%r14), %eax
movl %eax, 0x34(%rbx)
movl %eax, 0x38(%rbx)
andq $0x0, 0x58(%rbx)
pxor %xmm0, %xmm0
movdqu %xmm0, 0x3c(%rbx)
andq $0x0, 0x4c(%rbx)
movl %r14d, %eax
imulq $0x758, %rax, %r15      # imm = 0x758
pcmpeqd %xmm0, %xmm0
movdqu %xmm0, 0x60(%rbx)
movdqu %xmm0, 0x70(%rbx)
orq $-0x1, 0x80(%rbx)
movq %r15, %rdi
callq 0x2030
movq %rax, %r12
testl %r14d, %r14d
je 0xd782
movq %r12, %r14
movq %r14, %rdi
callq 0xd550
addq $0x758, %r14            # imm = 0x758
addq $-0x758, %r15           # imm = 0xF8A8
jne 0xd76a
movq %r12, 0x88(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x2100
movq %r14, %rdi
callq 0x23a0
// File: /workspace/github_cpp_makefile_star2_O2/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 %r12
pushq %rbx
movl %edx, %ebp
movq %rdi, %rbx
callq 0x22b0
movl %ebp, 0x20(%rbx)
andq $0x0, 0x24(%rbx)
andl $0x0, 0x2c(%rbx)
movl %ebp, %eax
imulq $0x140, %rax, %r14      # imm = 0x140
movq %r14, %rdi
callq 0x2030
movq %rax, %r15
testl %ebp, %ebp
je 0xd7f9
movq %r15, %r12
movq %r12, %rdi
callq 0xd644
addq $0x140, %r12            # imm = 0x140
addq $-0x140, %r14           # imm = 0xFEC0
jne 0xd7e1
movq %r15, 0x30(%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x2100
movq %r14, %rdi
callq 0x23a0
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 %r12
pushq %rbx
subq $0x88, %rsp
movq %rdi, %r14
leaq 0x8038(%rip), %rax      # 0x15d00
movq %rax, (%rdi)
leaq 0x32c7(%rip), %rsi      # 0x10f99
leaq 0x68(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x20e0
leaq 0x28(%r14), %rbx
leaq 0x68(%rsp), %rsi
pushq $0x1
popq %rdx
movq %rbx, %rdi
callq 0xde92
leaq 0x68(%rsp), %rdi
callq 0x2100
leaq 0x3293(%rip), %rsi      # 0x10f99
leaq 0x48(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x20e0
leaq 0x1cc8(%r14), %r15
leaq 0x48(%rsp), %rsi
pushq $0x1
popq %rdx
movq %r15, %rdi
callq 0xde92
leaq 0x48(%rsp), %rdi
callq 0x2100
leaq 0x325c(%rip), %rsi      # 0x10f99
leaq 0x28(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x20e0
leaq 0x3968(%r14), %r12
leaq 0x28(%rsp), %rsi
pushq $0x1
popq %rdx
movq %r12, %rdi
callq 0xde92
leaq 0x28(%rsp), %rdi
callq 0x2100
leaq 0x3225(%rip), %rsi      # 0x10f99
leaq 0x8(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x20e0
leaq 0x5608(%r14), %rdi
leaq 0x8(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0xde92
leaq 0x8(%rsp), %rdi
callq 0x2100
pushq $-0x20
popq %rax
testq %rax, %rax
je 0xdddc
andq $0x0, 0x72c8(%r14,%rax)
andq $0x0, 0x72e8(%r14,%rax)
andq $0x0, 0x7308(%r14,%rax)
andq $0x0, 0x7328(%r14,%rax)
andq $0x0, 0x7348(%r14,%rax)
addq $0x8, %rax
jmp 0xdda4
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x2100
jmp 0xddfd
movq %rax, %r14
movq %r12, %rdi
callq 0xdf54
jmp 0xde19
movq %rax, %r14
leaq 0x28(%rsp), %rdi
callq 0x2100
jmp 0xde19
movq %rax, %r14
movq %r15, %rdi
callq 0xdf54
jmp 0xde35
movq %rax, %r14
leaq 0x48(%rsp), %rdi
callq 0x2100
jmp 0xde35
movq %rax, %r14
movq %rbx, %rdi
callq 0xdf54
movq %r14, %rdi
callq 0x23a0
movq %rax, %r14
leaq 0x68(%rsp), %rdi
callq 0x2100
jmp 0xde3d
movq %rax, %r14
jmp 0xde3d
// File: /workspace/github_cpp_makefile_star2_O2/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 %r12
pushq %rbx
movl %edx, %ebp
movq %rdi, %rbx
callq 0x22b0
movl %ebp, 0x20(%rbx)
movl $0xa0, %r14d
leaq (%rbx,%r14), %rdi
callq 0x53f4
addq $0x380, %r14            # imm = 0x380
cmpq $0x1ca0, %r14           # imm = 0x1CA0
jne 0xdead
andw $0x0, 0x24(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%rbx)
movups %xmm0, 0x38(%rbx)
pcmpeqd %xmm1, %xmm1
movdqu %xmm1, 0x48(%rbx)
orq $-0x1, 0x58(%rbx)
movups %xmm0, 0x60(%rbx)
andq $0x0, 0x90(%rbx)
movups %xmm0, 0x70(%rbx)
movups %xmm0, 0x80(%rbx)
movl 0x20(%rbx), %r12d
imulq $0x380, %r12, %r14      # imm = 0x380
movq %r14, %rdi
callq 0x2030
movq %rax, %r15
testq %r12, %r12
je 0xdf31
movq %r15, %r12
movq %r12, %rdi
callq 0x53f4
addq $0x380, %r12            # imm = 0x380
addq $-0x380, %r14           # imm = 0xFC80
jne 0xdf19
movq %r15, 0x98(%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x2100
movq %r14, %rdi
callq 0x23a0
// File: /workspace/github_cpp_makefile_star2_O2/NishadSaraf[P]Championship-Simulator/inc/dram_controller.h
// Function: MEMORY_CONTROLLER::MEMORY_CONTROLLER(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
MEMORY_CONTROLLER(string v1) : NAME (v1) {
        for (uint32_t i=0; i<NUM_TYPES+1; i++) {
            for (uint32_t j=0; j<NUM_TYPES+1; j++) {
                dbus_congested[i][j] = 0;
            }
        }
        do_write = 0;
        processed_writes = 0;
        scheduled_reads = 0;
        scheduled_writes = 0;
        for (uint32_t i=0; i<DRAM_CHANNELS; i++) {
            dbus_cycle_available[i] = 0;
            dbus_cycle_congested[i] = 0;
            write_mode[i] = 0;

            for (uint32_t j=0; j<DRAM_RANKS; j++) {
                for (uint32_t k=0; k<DRAM_BANKS; k++)
                    bank_cycle_available[i][j][k] = 0;
            }
        }

        fill_level = FILL_DRAM;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %r15
movq %rdi, %rbx
callq 0xdcb0
leaq 0x7bd9(%rip), %rax      # 0x15c88
addq $0x10, %rax
movq %rax, (%rbx)
leaq 0x7348(%rbx), %r14
movq %r14, %rdi
movq %r15, %rsi
callq 0x22b0
leaq 0x7368(%rbx), %rdi
xorl %r15d, %r15d
movl $0x200, %edx            # imm = 0x200
xorl %esi, %esi
callq 0x2130
leaq 0x787c(%rbx), %rax
xorps %xmm0, %xmm0
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movups %xmm0, -0x24(%rax,%r15)
andq $0x0, -0x14(%rax,%r15)
movq %rcx, -0xc(%rax,%r15)
andw $0x0, -0x4(%rax,%r15)
orl $-0x1, (%rax,%r15)
addq $0x28, %r15
cmpq $0xa00, %r15            # imm = 0xA00
jne 0xe0ed
leaq 0x2a18(%rip), %rdx      # 0x10b36
leaq 0x28(%rsp), %rdi
movq %r14, %rsi
callq 0xde59
leaq 0x8258(%rbx), %r15
leaq 0x28(%rsp), %rsi
pushq $0x30
popq %rdx
movq %r15, %rdi
callq 0xde92
leaq 0x28(%rsp), %rdi
callq 0x2100
leaq 0x2e2d(%rip), %rdx      # 0x10f80
leaq 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0xde59
leaq 0x9ef8(%rbx), %rdi
leaq 0x8(%rsp), %rsi
pushq $0x30
popq %rdx
callq 0xde92
leaq 0x8(%rsp), %rdi
callq 0x2100
leaq 0x7578(%rbx), %rax
xorl %ecx, %ecx
cmpq $0x5, %rcx
je 0xe1a8
xorl %edx, %edx
cmpq $0x5, %rdx
je 0xe19f
andq $0x0, (%rax,%rdx,8)
incq %rdx
jmp 0xe18f
incq %rcx
addq $0x28, %rax
jmp 0xe187
andw $0x0, 0x7840(%rbx)
andq $0x0, 0x7844(%rbx)
andl $0x0, 0x784c(%rbx)
leaq 0x7640(%rbx), %rax
xorps %xmm0, %xmm0
movups %xmm0, 0x7568(%rbx)
xorl %ecx, %ecx
cmpq $0x8, %rcx
je 0xe1f3
xorl %edx, %edx
cmpq $0x8, %rdx
je 0xe1ea
andq $0x0, (%rax,%rdx,8)
incq %rdx
jmp 0xe1da
incq %rcx
addq $0x40, %rax
jmp 0xe1d2
movl $0x10, 0x7850(%rbx)
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %r12
leaq 0x8(%rsp), %rdi
callq 0x2100
jmp 0xe21b
movq %rax, %r12
movq %r15, %rdi
callq 0xdf54
jmp 0xe237
movq %rax, %r12
leaq 0x28(%rsp), %rdi
callq 0x2100
jmp 0xe237
movq %rax, %r12
movq %r14, %rdi
callq 0x2100
jmp 0xe244
movq %rax, %r12
movq %rbx, %rdi
callq 0xdf72
movq %r12, %rdi
callq 0x23a0
// File: /workspace/github_cpp_makefile_star2_O2/NishadSaraf[P]Championship-Simulator/src/drc_controller.cc
// Function: DRC_MEMORY_CONTROLLER::drc_check_hit(PACKET_QUEUE*, unsigned long, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int)
uint32_t DRC_MEMORY_CONTROLLER::drc_check_hit(PACKET_QUEUE *queue, uint64_t address, uint32_t cpu, uint32_t channel, uint32_t rank, uint32_t bank, uint32_t row)
{
    // determine DRC set index for this row
    // TODO: check if this modulo works okay or not
    uint32_t set = address % DRC_SETS_PER_ROW; 

    if (drc_array[channel][rank][bank][row].block == NULL) { // never accessed this row, dynamically allocate DRC blocks
        drc_array[channel][rank][bank][row].block = new BLOCK* [DRC_SETS_PER_ROW];
        for (uint32_t i=0; i<DRC_SETS_PER_ROW; i++) {
            drc_array[channel][rank][bank][row].block[i] = new BLOCK[DRC_WAY];
            drc_blocks += DRC_WAY;
        }

        return DRC_WAY; // never accessed this row, this is a miss
    }

    for (uint32_t i=0; i<DRC_WAY; i++) {
        if (drc_array[channel][rank][bank][row].block[set][i].tag == address) {
            DP ( if (warmup_complete[cpu]) {
            cout << "[" << queue->NAME << "] " << __func__ << " found matching address: " << hex << address << dec << " set: " << set << " way: " << i << endl; });

            return i;
        }
    }

    return DRC_WAY; // cannot find any matching tag, this is a miss
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %rcx
movl 0x38(%rsp), %eax
movl 0x30(%rsp), %edx
movl %r8d, %esi
shlq $0x14, %rsi
addq %rdi, %rsi
movl %r9d, %edi
shlq $0x13, %rdi
addq %rsi, %rdi
shlq $0xf, %rdx
addq %rdi, %rdx
movq 0x7370(%rdx,%rax,8), %rsi
testq %rsi, %rsi
je 0xf514
pushq $0x1c
popq %rdi
movq %rcx, %rax
xorl %edx, %edx
divq %rdi
movl %edx, %eax
movq (%rsi,%rax,8), %rax
xorl %ebx, %ebx
cmpq %rcx, 0x28(%rax)
setne %bl
movl %ebx, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq (%rdx,%rax,8), %r15
addq $0x7370, %r15           # imm = 0x7370
movl $0xe0, %edi
callq 0x2030
movq %rax, (%r15)
movq 0x898f5(%rip), %r12     # 0x98e28
incq %r12
xorl %r13d, %r13d
pushq $0x1
popq %rbx
pushq $0x50
popq %r14
cmpq $0x1c, %r13
je 0xf508
movq %r14, %rdi
callq 0x2030
andl $0x0, 0x10(%rax)
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movups %xmm0, 0x18(%rax)
movups %xmm0, 0x28(%rax)
movups %xmm0, 0x38(%rax)
andl $0x0, 0x48(%rax)
movq (%r15), %rcx
movq %rax, (%rcx,%r13,8)
leaq (%r12,%r13), %rax
movq %rax, 0x898ae(%rip)     # 0x98e28
incq %r13
jmp 0xf540
nop
// File: /workspace/github_cpp_makefile_star2_O2/NishadSaraf[P]Championship-Simulator/src/drc_controller.cc
// Function: DRC_MEMORY_CONTROLLER::get_occupancy(unsigned char)
uint32_t DRC_MEMORY_CONTROLLER::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;

    return 0;
}

// Assembly:
cmpl $0x2, %esi
je 0xfa54
cmpl $0x1, %esi
je 0xfa4d
xorl %eax, %eax
testl %esi, %esi
jne 0xfa5a
movl 0x4073a4(%rdi), %eax
retq
movl 0x40c544(%rdi), %eax
retq
movl 0x40a8a4(%rdi), %eax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/NishadSaraf[P]Championship-Simulator/src/drc_controller.cc
// Function: DRC_MEMORY_CONTROLLER::get_size(unsigned char)
uint32_t DRC_MEMORY_CONTROLLER::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;

    return 0;
}

// Assembly:
cmpl $0x2, %esi
je 0xfa7a
cmpl $0x1, %esi
je 0xfa73
xorl %eax, %eax
testl %esi, %esi
jne 0xfa80
movl 0x407390(%rdi), %eax
retq
movl 0x40c530(%rdi), %eax
retq
movl 0x40a890(%rdi), %eax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/NishadSaraf[P]Championship-Simulator/replacement/base_replacement.cc
// Function: CACHE::lru_victim(unsigned int, unsigned long, unsigned int, BLOCK const*, unsigned long, unsigned long, unsigned int)
uint32_t CACHE::lru_victim(uint32_t cpu, uint64_t instr_id, uint32_t set, const BLOCK *current_set, uint64_t ip, uint64_t full_addr, uint32_t type)
{
    uint32_t way = 0;

    // fill invalid line first
    for (way=0; way<NUM_WAY; way++) {
        if (block[set][way].valid == false) {

            DP ( if (warmup_complete[cpu]) {
            cout << "[" << NAME << "] " << __func__ << " instr_id: " << instr_id << " invalid set: " << set << " way: " << way;
            cout << hex << " address: " << (full_addr>>LOG2_BLOCK_SIZE) << " victim address: " << block[set][way].address << " data: " << block[set][way].data;
            cout << dec << " lru: " << block[set][way].lru << endl; });

            break;
        }
    }

    // LRU victim
    if (way == NUM_WAY) {
        for (way=0; way<NUM_WAY; way++) {
            if (block[set][way].lru == NUM_WAY-1) {

                DP ( if (warmup_complete[cpu]) {
                cout << "[" << NAME << "] " << __func__ << " instr_id: " << instr_id << " replace set: " << set << " way: " << way;
                cout << hex << " address: " << (full_addr>>LOG2_BLOCK_SIZE) << " victim address: " << block[set][way].address << " data: " << block[set][way].data;
                cout << dec << " lru: " << block[set][way].lru << endl; });

                break;
            }
        }
    }

    if (way == NUM_WAY) {
        cerr << "[" << NAME << "] " << __func__ << " no victim! set: " << set << endl;
        assert(0);
    }

    return way;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %ecx, %ebx
movq %rdi, %r14
movl 0x7374(%rdi), %ecx
movq 0x7390(%rdi), %rdx
movl %ebx, %esi
xorl %edi, %edi
xorl %eax, %eax
cmpq %rax, %rcx
je 0xfb9f
movq (%rdx,%rsi,8), %r8
cmpb $0x0, (%r8,%rdi)
je 0xfb9b
incq %rax
addq $0x50, %rdi
jmp 0xfb82
cmpl %eax, %ecx
jne 0xfbc0
leal -0x1(%rcx), %edi
pushq $0x48
popq %r8
xorl %eax, %eax
cmpq %rax, %rcx
je 0xfbcc
movq (%rdx,%rsi,8), %r9
cmpl %edi, (%r9,%r8)
je 0xfbc0
incq %rax
addq $0x50, %r8
jmp 0xfba8
cmpl %ecx, %eax
je 0xfbcc
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq 0x641d(%rip), %rdi      # 0x15ff0
leaq 0x4b6(%rip), %rsi       # 0x10090
callq 0x2230
addq $0x7350, %r14           # imm = 0x7350
movq %rax, %rdi
movq %r14, %rsi
callq 0x21d0
leaq 0x1224(%rip), %rsi      # 0x10e1c
movq %rax, %rdi
callq 0x2230
leaq 0x14db(%rip), %rsi      # 0x110e2
movq %rax, %rdi
callq 0x2230
leaq 0x14d7(%rip), %rsi      # 0x110ed
movq %rax, %rdi
callq 0x2230
movq %rax, %rdi
movl %ebx, %esi
callq 0x22a0
movq %rax, %rdi
callq 0x2110
leaq 0x430(%rip), %rdi       # 0x10067
leaq 0x14c1(%rip), %rsi      # 0x110ff
leaq 0x14da(%rip), %rcx      # 0x1111f
pushq $0x37
popq %rdx
callq 0x2160
nop
// File: /workspace/github_cpp_makefile_star2_O2/NishadSaraf[P]Championship-Simulator/replacement/base_replacement.cc
// Function: CACHE::lru_update(unsigned int, unsigned int)
void CACHE::lru_update(uint32_t set, uint32_t way)
{
    // update lru replacement state
    for (uint32_t i=0; i<NUM_WAY; i++) {
        if (block[set][i].lru < block[set][way].lru) {
            block[set][i].lru++;
        }
    }
    block[set][way].lru = 0; // promote to the MRU position
}

// Assembly:
movl 0x7374(%rdi), %eax
movq 0x7390(%rdi), %rcx
movl %esi, %esi
movl %edx, %edx
movq (%rcx,%rsi,8), %rcx
imulq $0x50, %rdx, %rdx
leaq (%rcx,%rdx), %rsi
addq $0x48, %rsi
leaq 0x48(%rcx), %rdi
xorl %r8d, %r8d
cmpq %rax, %r8
jae 0xfcb2
movl (%rdi), %r9d
cmpl (%rsi), %r9d
jae 0xfca9
incl %r9d
movl %r9d, (%rdi)
incq %r8
addq $0x50, %rdi
jmp 0xfc96
andl $0x0, 0x48(%rcx,%rdx)
retq
// File: /workspace/github_cpp_makefile_star2_O2/iZhangHui[P]CppPrimer/CH09_SequentialContainers/examples/substr.cc
// Function: main
int main()
{
    try {
        string s("hello world");
        cout << s.substr(0, 5) << endl;  // prints hello
        cout << s.substr(6) << endl;     // prints world
        cout << s.substr(6, 11) << endl; // prints world
        cout << s.substr(12) << endl;    // throws out_of_range
    } catch (out_of_range& e) {
        cout << e.what() << endl;
        // cout << "caught out_of_range" << endl;
    }

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x40, %rsp
leaq 0xdc6(%rip), %rsi       # 0x2004
leaq -0x50(%rbp), %rdi
leaq -0x30(%rbp), %rdx
callq 0x1040
leaq -0x30(%rbp), %rdi
leaq -0x50(%rbp), %rsi
pushq $0x5
popq %rcx
xorl %edx, %edx
callq 0x10b0
movq 0x2d74(%rip), %rdi      # 0x3fd8
leaq -0x30(%rbp), %rsi
callq 0x1090
movq %rax, %rdi
callq 0x1070
leaq -0x30(%rbp), %rdi
callq 0x1060
leaq -0x30(%rbp), %rdi
leaq -0x50(%rbp), %rsi
pushq $0x6
popq %rdx
pushq $-0x1
popq %rcx
callq 0x10b0
movq 0x2d40(%rip), %rdi      # 0x3fd8
leaq -0x30(%rbp), %rsi
callq 0x1090
movq %rax, %rdi
callq 0x1070
leaq -0x30(%rbp), %rdi
callq 0x1060
leaq -0x30(%rbp), %rdi
leaq -0x50(%rbp), %rsi
pushq $0x6
popq %rdx
pushq $0xb
popq %rcx
callq 0x10b0
movq 0x2d0c(%rip), %rdi      # 0x3fd8
leaq -0x30(%rbp), %rsi
callq 0x1090
movq %rax, %rdi
callq 0x1070
leaq -0x30(%rbp), %rdi
callq 0x1060
leaq -0x30(%rbp), %rdi
leaq -0x50(%rbp), %rsi
pushq $0xc
popq %rdx
pushq $-0x1
popq %rcx
callq 0x10b0
movq 0x2cd8(%rip), %rdi      # 0x3fd8
leaq -0x30(%rbp), %rsi
callq 0x1090
movq %rax, %rdi
callq 0x1070
leaq -0x30(%rbp), %rdi
callq 0x1060
leaq -0x50(%rbp), %rdi
callq 0x1060
xorl %eax, %eax
addq $0x40, %rsp
popq %rbx
popq %r14
popq %rbp
retq
jmp 0x1334
jmp 0x1334
jmp 0x1334
movq %rdx, %r14
movq %rax, %rbx
jmp 0x1359
movq %rdx, %r14
movq %rax, %rbx
jmp 0x1362
jmp 0x134a
jmp 0x134a
jmp 0x134a
movq %rdx, %r14
movq %rax, %rbx
leaq -0x30(%rbp), %rdi
callq 0x1060
leaq -0x50(%rbp), %rdi
callq 0x1060
cmpl $0x1, %r14d
jne 0x139f
movq %rbx, %rdi
callq 0x1050
movq (%rax), %rcx
movq %rax, %rdi
callq *0x10(%rcx)
movq 0x2c58(%rip), %rdi      # 0x3fd8
movq %rax, %rsi
callq 0x10a0
movq %rax, %rdi
callq 0x1070
callq 0x10d0
jmp 0x1323
movq %rax, %rbx
callq 0x10d0
movq %rbx, %rdi
callq 0x10e0
movq %rax, %rdi
callq 0x13af
// File: /workspace/github_cpp_makefile_star2_O2/grogers0[P]dots_and_boxes/Board.cpp
// Function: Board::move(int, Edge)
bool Board::move(int player, Edge move)
{
    assert(is_move_valid(move));

    int oldscore = score[player];

    edges[edge_index(move)] = true;

    for_each_adjacent_node(move, [&] (Node node)
            { if (this->degree(node) == 4) ++score[player]; });

    return oldscore != score[player];
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movl %edx, %ebp
movl %esi, %r14d
movq %rdi, %rbx
movl %esi, 0xc(%rsp)
movl %edx, %esi
callq 0x26a4
testb %al, %al
je 0x2687
movslq %r14d, %rax
movl 0x8(%rbx,%rax,4), %r15d
leaq 0x10(%rbx), %r14
movq %rbx, %rdi
movl %ebp, %esi
callq 0x2b26
movslq %eax, %rsi
movq %r14, %rdi
callq 0x2b08
orq %rdx, (%rax)
movq %rbx, 0x10(%rsp)
leaq 0xc(%rsp), %rax
movq %rax, 0x18(%rsp)
testb $0x1, %bpl
jne 0x2624
movswl %bp, %r14d
movl %r14d, %eax
shrl $0x8, %eax
sarl $0x8, %r14d
testw %ax, %ax
jle 0x2615
movsbl %bpl, %eax
shrl %eax
movl $0xffffff00, %ecx       # imm = 0xFFFFFF00
movl %ebp, %edx
andl %ecx, %edx
movzbl %al, %esi
orl %edx, %esi
addl %ecx, %esi
leaq 0x10(%rsp), %rdi
callq 0x2a20
cmpl %r14d, 0x4(%rbx)
jle 0x266d
movsbl %bpl, %r14d
shrl %r14d
jmp 0x2657
movsbl %bpl, %r12d
movl %r12d, %r14d
shrl %r14d
sarl %r12d
testw %r14w, %r14w
jle 0x2652
leal -0x1(%r14), %eax
movl %ebp, %ecx
andl $0xffffff00, %ecx       # imm = 0xFFFFFF00
movzbl %al, %esi
orl %ecx, %esi
leaq 0x10(%rsp), %rdi
callq 0x2a20
cmpl %r12d, (%rbx)
jle 0x266d
andl $0xffffff00, %ebp       # imm = 0xFFFFFF00
movzbl %r14b, %esi
orl %ebp, %esi
leaq 0x10(%rsp), %rdi
callq 0x2a20
movslq 0xc(%rsp), %rax
cmpl 0x8(%rbx,%rax,4), %r15d
setne %al
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x299d(%rip), %rdi      # 0x502b
leaq 0x296f(%rip), %rsi      # 0x5004
leaq 0x2972(%rip), %rcx      # 0x500e
pushq $0x11
popq %rdx
callq 0x2130
// File: /workspace/github_cpp_makefile_star2_O2/grogers0[P]dots_and_boxes/Board.cpp
// Function: Board::is_move_valid(Edge) const
bool Board::is_move_valid(Edge move) const
{
    if (move.dir == HORIZ) {
        if (move.x < 0 || move.x >= width || move.y < 0 || move.y > height)
            return false;
    } else {
        if (move.x < 0 || move.x > width || move.y < 0 || move.y >= height)
            return false;
    }

    return !edges[edge_index(move)];
}

// Assembly:
movsbl %sil, %ecx
movl %ecx, %eax
shrl %eax
testb $0x1, %cl
jne 0x26d2
testw %ax, %ax
js 0x270a
movzwl %ax, %eax
cmpl %eax, (%rdi)
jle 0x270a
movswl %si, %eax
shrl $0x8, %eax
testw %ax, %ax
js 0x270a
movzwl %ax, %eax
cmpl %eax, 0x4(%rdi)
jge 0x26f1
jmp 0x270a
testw %ax, %ax
js 0x270a
movzwl %ax, %eax
cmpl %eax, (%rdi)
jl 0x270a
movswl %si, %eax
shrl $0x8, %eax
testw %ax, %ax
js 0x270a
movzwl %ax, %eax
cmpl %eax, 0x4(%rdi)
jle 0x270a
pushq %rbx
leaq 0x10(%rdi), %rbx
callq 0x2b26
movslq %eax, %rsi
movq %rbx, %rdi
callq 0x2b5e
xorb $0x1, %al
popq %rbx
retq
xorl %eax, %eax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/grogers0[P]dots_and_boxes/Board.cpp
// Function: Board::unmove(int, Edge)
void Board::unmove(int player, Edge move)
{
    assert(!is_move_valid(move));

    edges[edge_index(move)] = false;

    for_each_adjacent_node(move, [&] (Node node)
            { if (this->degree(node) == 3) --score[player]; });
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movl %edx, %ebx
movq %rdi, %r14
movl %esi, 0x4(%rsp)
movl %edx, %esi
callq 0x26a4
testb %al, %al
jne 0x27f3
leaq 0x10(%r14), %r15
movq %r14, %rdi
movl %ebx, %esi
callq 0x2b26
movslq %eax, %rsi
movq %r15, %rdi
callq 0x2b08
notq %rdx
andq %rdx, (%rax)
movq %r14, 0x8(%rsp)
leaq 0x4(%rsp), %rax
movq %rax, 0x10(%rsp)
testb $0x1, %bl
jne 0x27a1
movswl %bx, %ebp
movl %ebp, %eax
shrl $0x8, %eax
sarl $0x8, %ebp
testw %ax, %ax
jle 0x2792
movsbl %bl, %eax
shrl %eax
movl $0xffffff00, %ecx       # imm = 0xFFFFFF00
movl %ebx, %edx
andl %ecx, %edx
movzbl %al, %esi
orl %edx, %esi
addl %ecx, %esi
leaq 0x8(%rsp), %rdi
callq 0x2a4a
cmpl %ebp, 0x4(%r14)
jle 0x27e8
movsbl %bl, %r15d
shrl %r15d
jmp 0x27d2
movsbl %bl, %ebp
movl %ebp, %r15d
shrl %r15d
sarl %ebp
testw %r15w, %r15w
jle 0x27cd
leal -0x1(%r15), %eax
movl %ebx, %ecx
andl $0xffffff00, %ecx       # imm = 0xFFFFFF00
movzbl %al, %esi
orl %ecx, %esi
leaq 0x8(%rsp), %rdi
callq 0x2a4a
cmpl %ebp, (%r14)
jle 0x27e8
andl $0xffffff00, %ebx       # imm = 0xFFFFFF00
movzbl %r15b, %esi
orl %ebx, %esi
leaq 0x8(%rsp), %rdi
callq 0x2a4a
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2830(%rip), %rdi      # 0x502a
leaq 0x2803(%rip), %rsi      # 0x5004
leaq 0x2837(%rip), %rcx      # 0x503f
pushq $0x1f
popq %rdx
callq 0x2130
// File: /workspace/github_cpp_makefile_star2_O2/grogers0[P]dots_and_boxes/Board.cpp
// Function: Board::degree(Node) const
int Board::degree(Node node) const
{
    int sum = 0;
    for_each_adjacent_edge(node, [&] (Edge edge)
            { sum += (int) edges[this->edge_index(edge)]; });
    return sum;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
leaq 0x4(%rsp), %rax
andl $0x0, (%rax)
movsbl %sil, %r12d
movl %esi, %r15d
andl $0xffffff00, %r15d      # imm = 0xFFFFFF00
leaq 0x8(%rsp), %rbx
movq %rax, (%rbx)
movq %rdi, 0x8(%rbx)
leal (%r12,%r12), %r14d
movl $0xff, %ebp
andl %ebp, %r14d
leal (%r14,%r15), %esi
movl $0xffff, %r13d          # imm = 0xFFFF
andl %r13d, %esi
movq %rbx, %rdi
callq 0x2a74
leal (%r14,%r15), %esi
addl $0x100, %esi            # imm = 0x100
andl %r13d, %esi
movq %rbx, %rdi
callq 0x2a74
leal (%r14,%r15), %esi
incl %esi
andl %r13d, %esi
movq %rbx, %rdi
callq 0x2a74
leal 0x2(,%r12,2), %eax
andl %ebp, %eax
leal (%r15,%rax), %esi
incl %esi
andl %r13d, %esi
movq %rbx, %rdi
callq 0x2a74
leaq 0x4(%rsp), %rax
movl (%rax), %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/grogers0[P]dots_and_boxes/Board.cpp
// Function: basename_str(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
std::string basename_str(const std::string &str)
{
    char *cpy = strdup(str.c_str());
    char *base = basename(cpy);
    std::string ret(base);
    free(cpy);
    return ret;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rsi), %rdi
callq 0x2380
movq %rax, %r14
movq %rax, %rdi
callq 0x22b0
leaq 0x7(%rsp), %rdx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x2b7c
movq %r14, %rdi
callq 0x2240
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop