// File: /workspace/github_cpp_makefile_star2_O2/NishadSaraf[P]Championship-Simulator/inc/ooo_cpu.h
// Function: O3_CPU::O3_CPU()
O3_CPU() {
        cpu = 0;

        // trace
        trace_file = NULL;

        // instruction
        instr_unique_id = 0;
        completed_executions = 0;
        begin_sim_cycle = 0;
        begin_sim_instr = 0;
        last_sim_cycle = 0;
        last_sim_instr = 0;
        finish_sim_cycle = 0;
        finish_sim_instr = 0;
        warmup_instructions = 0;
        simulation_instructions = 0;
        instrs_to_read_this_cycle = 0;
        instrs_to_fetch_this_cycle = 0;

        next_print_instruction = STAT_PRINTING_PERIOD;
        num_retired = 0;

        inflight_reg_executions = 0;
        inflight_mem_executions = 0;
        num_searched = 0;

        next_ITLB_fetch = 0;

        // branch
        branch_mispredict_stall_fetch = 0;
        mispredicted_branch_iw_index = 0;
        fetch_stall = 0;
        num_branch = 0;
        branch_mispredictions = 0;

        for (uint32_t i=0; i<STA_SIZE; i++)
            STA[i] = UINT64_MAX;
        STA_head = 0;
        STA_tail = 0;

        for (uint32_t i=0; i<ROB_SIZE; i++) {
            RTE0[i] = ROB_SIZE;
            RTE1[i] = ROB_SIZE;
        }
        RTE0_head = 0;
        RTE1_head = 0;
        RTE0_tail = 0;
        RTE1_tail = 0;

        for (uint32_t i=0; i<LQ_SIZE; i++) {
            RTL0[i] = LQ_SIZE;
            RTL1[i] = LQ_SIZE;
        }
        RTL0_head = 0;
        RTL1_head = 0;
        RTL0_tail = 0;
        RTL1_tail = 0;

        for (uint32_t i=0; i<SQ_SIZE; i++) {
            RTS0[i] = SQ_SIZE;
            RTS1[i] = SQ_SIZE;
        }
        RTS0_head = 0;
        RTS1_head = 0;
        RTS0_tail = 0;
        RTS1_tail = 0;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x168, %rsp            # imm = 0x168
movq %rdi, %r15
addq $0x810, %rdi            # imm = 0x810
callq 0xd680
leaq 0x850(%r15), %rdi
callq 0xd6ba
leaq 0x3fc2(%rip), %rsi      # 0x10f5b
leaq 0x148(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x20e0
leaq 0x930(%r15), %rdi
leaq 0x148(%rsp), %rsi
movq %rdi, 0x40(%rsp)
movl $0x100, %edx            # imm = 0x100
callq 0xd6fa
leaq 0x148(%rsp), %rdi
callq 0x2100
leaq 0x3f82(%rip), %rsi      # 0x10f5f
leaq 0x128(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x20e0
leaq 0x9c0(%r15), %rdi
leaq 0x128(%rsp), %rsi
pushq $0x48
popq %rbp
movq %rdi, 0x38(%rsp)
movl %ebp, %edx
callq 0xd7a8
leaq 0x128(%rsp), %rdi
callq 0x2100
leaq 0x3f41(%rip), %rsi      # 0x10f62
leaq 0x108(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x20e0
leaq 0x9f8(%r15), %rdi
leaq 0x108(%rsp), %rsi
pushq $0x38
popq %r13
movq %rdi, 0x30(%rsp)
movl %r13d, %edx
callq 0xd7a8
leaq 0x108(%rsp), %rdi
callq 0x2100
leaq 0x3efe(%rip), %rsi      # 0x10f65
leaq 0xe8(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x20e0
leaq 0x3690(%r15), %rdi
subq $0x8, %rsp
leaq 0xf0(%rsp), %rsi
pushq $0x4
popq %rcx
pushq $0x40
popq %r8
pushq $0x10
popq %rdx
movq %rdi, 0x30(%rsp)
movl %edx, %r9d
pushq $0x8
pushq $0x0
pushq $0x10
callq 0xd81a
addq $0x20, %rsp
leaq 0xe8(%rsp), %rdi
callq 0x2100
leaq 0x3ea9(%rip), %rsi      # 0x10f6a
leaq 0xc8(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x20e0
leaq 0x13a38(%r15), %rdi
subq $0x8, %rsp
leaq 0xd0(%rsp), %rsi
pushq $0x4
popq %rcx
pushq $0x40
popq %r14
pushq $0x10
popq %rdx
movq %rdi, 0x28(%rsp)
movl %r14d, %r8d
movl %edx, %r9d
pushq $0x8
pushq $0x0
pushq $0x10
callq 0xd81a
addq $0x20, %rsp
leaq 0xc8(%rsp), %rdi
callq 0x2100
leaq 0x3e51(%rip), %rsi      # 0x10f6f
leaq 0xa8(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x20e0
leaq 0x23de0(%r15), %rdi
subq $0x8, %rsp
leaq 0xb0(%rsp), %rsi
pushq $0xc
popq %rcx
pushq $0x20
popq %r12
movq %rdi, 0x20(%rsp)
movl $0x80, %edx
movl $0x600, %r8d            # imm = 0x600
movl %r12d, %r9d
pushq $0x10
pushq $0x0
pushq $0x20
callq 0xd81a
addq $0x20, %rsp
leaq 0xa8(%rsp), %rdi
callq 0x2100
leaq 0x3df4(%rip), %rsi      # 0x10f74
leaq 0x88(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x20e0
leaq 0x34188(%r15), %rdi
subq $0x8, %rsp
leaq 0x90(%rsp), %rsi
pushq $0x8
popq %rcx
movq %rdi, 0x18(%rsp)
movl %r14d, %edx
movl $0x200, %r8d            # imm = 0x200
movl %r14d, %r9d
pushq $0x8
pushq %r14
pushq %r14
callq 0xd81a
addq $0x20, %rsp
leaq 0x88(%rsp), %rdi
callq 0x2100
leaq 0x3d9c(%rip), %rsi      # 0x10f78
leaq 0x68(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x20e0
leaq 0x44530(%r15), %rbx
subq $0x8, %rsp
leaq 0x70(%rsp), %rsi
pushq $0x8
popq %rcx
movq %rbx, %rdi
movl %r14d, %edx
movl $0x200, %r8d            # imm = 0x200
movl %r14d, %r9d
pushq $0x8
pushq %r14
pushq %r14
callq 0xd81a
addq $0x20, %rsp
leaq 0x68(%rsp), %rdi
callq 0x2100
leaq 0x3d4f(%rip), %rsi      # 0x10f7c
leaq 0x48(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x20e0
leaq 0x548d8(%r15), %rdi
subq $0x8, %rsp
leaq 0x50(%rsp), %rsi
pushq $0x8
popq %rcx
movl $0x200, %edx            # imm = 0x200
movl $0x1000, %r8d           # imm = 0x1000
movl %r12d, %r9d
pushq $0x10
pushq %r12
pushq %r12
callq 0xd81a
addq $0x20, %rsp
leaq 0x48(%rsp), %rdi
callq 0x2100
andl $0x0, (%r15)
andq $0x0, 0x8(%r15)
xorps %xmm0, %xmm0
movups %xmm0, 0x8b0(%r15)
movups %xmm0, 0x8c0(%r15)
movups %xmm0, 0x8d0(%r15)
movups %xmm0, 0x8e0(%r15)
movups %xmm0, 0x8f0(%r15)
movups %xmm0, 0x900(%r15)
movq $0x989680, 0x910(%r15) # imm = 0x989680
andq $0x0, 0x928(%r15)
movups %xmm0, 0x918(%r15)
andq $0x0, 0x3670(%r15)
movb $0x0, 0x3678(%r15)
movups %xmm0, 0x3680(%r15)
xorl %eax, %eax
cmpq $0x400, %rax            # imm = 0x400
je 0xd2fd
orq $-0x1, 0xa30(%r15,%rax,8)
incq %rax
jmp 0xd2e7
xorps %xmm0, %xmm0
movups %xmm0, 0x2a30(%r15)
movq $-0x400, %rax           # imm = 0xFC00
movl $0x100, %ecx            # imm = 0x100
testq %rax, %rax
je 0xd32f
movl %ecx, 0x2e40(%r15,%rax)
movl %ecx, 0x3248(%r15,%rax)
addq $0x4, %rax
jmp 0xd314
andq $0x0, 0x2e40(%r15)
andq $0x0, 0x3248(%r15)
movq $-0x120, %rax           # imm = 0xFEE0
testq %rax, %rax
je 0xd361
movl %ebp, 0x3370(%r15,%rax)
movl %ebp, 0x3498(%r15,%rax)
addq $0x4, %rax
jmp 0xd346
andq $0x0, 0x3370(%r15)
andq $0x0, 0x3498(%r15)
movq $-0xe0, %rax
testq %rax, %rax
je 0xd393
movl %r13d, 0x3580(%r15,%rax)
movl %r13d, 0x3668(%r15,%rax)
addq $0x4, %rax
jmp 0xd378
andq $0x0, 0x3580(%r15)
andq $0x0, 0x3668(%r15)
addq $0x168, %rsp            # imm = 0x168
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r15
leaq 0x48(%rsp), %rdi
callq 0x2100
jmp 0xd3c7
movq %rax, %r15
movq %rbx, %rdi
callq 0xdbd8
jmp 0xd3e3
movq %rax, %r15
leaq 0x68(%rsp), %rdi
callq 0x2100
jmp 0xd3e3
movq %rax, %r15
movq 0x10(%rsp), %rdi
callq 0xdbd8
jmp 0xd404
movq %rax, %r15
leaq 0x88(%rsp), %rdi
callq 0x2100
jmp 0xd404
movq %rax, %r15
movq 0x18(%rsp), %rdi
callq 0xdbd8
movq 0x20(%rsp), %rdi
callq 0xdbd8
movq 0x28(%rsp), %rdi
callq 0xdbd8
movq 0x30(%rsp), %rdi
callq 0xdc76
movq 0x38(%rsp), %rdi
callq 0xdc76
movq 0x40(%rsp), %rdi
callq 0xdc92
movq %r15, %rdi
callq 0x23a0
movq %rax, %r15
leaq 0xa8(%rsp), %rdi
callq 0x2100
jmp 0xd40e
movq %rax, %r15
jmp 0xd40e
movq %rax, %r15
leaq 0xc8(%rsp), %rdi
callq 0x2100
jmp 0xd418
movq %rax, %r15
jmp 0xd418
movq %rax, %r15
leaq 0xe8(%rsp), %rdi
callq 0x2100
jmp 0xd422
movq %rax, %r15
jmp 0xd422
movq %rax, %r15
leaq 0x108(%rsp), %rdi
callq 0x2100
jmp 0xd42c
movq %rax, %r15
jmp 0xd42c
movq %rax, %r15
leaq 0x128(%rsp), %rdi
callq 0x2100
jmp 0xd436
movq %rax, %r15
jmp 0xd436
movq %rax, %r15
leaq 0x148(%rsp), %rdi
callq 0x2100
jmp 0xd440
movq %rax, %r15
jmp 0xd440
nop