// File: /workspace/github_cpp_makefile_star2_O3/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 $0x148, %rsp            # imm = 0x148
movq %rdi, %r15
xorps %xmm0, %xmm0
movups %xmm0, 0x898(%rdi)
movups %xmm0, 0x888(%rdi)
movups %xmm0, 0x878(%rdi)
movups %xmm0, 0x868(%rdi)
movups %xmm0, 0x810(%rdi)
movups %xmm0, 0x820(%rdi)
movups %xmm0, 0x830(%rdi)
movups %xmm0, 0x840(%rdi)
movups %xmm0, 0x850(%rdi)
movw $0x0, 0x860(%rdi)
movw $0xffff, 0x8a8(%rdi)    # imm = 0xFFFF
leaq 0x930(%rdi), %r12
leaq 0x138(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x512b(%rip), %rsi      # 0x15053
leaq 0x5127(%rip), %rdx      # 0x15056
leaq 0x128(%rsp), %rbx
movq %rbx, %rdi
callq 0xad78
movq %r12, %rdi
movq %rbx, %rsi
movl $0x100, %edx            # imm = 0x100
callq 0x1062c
movq 0x128(%rsp), %rdi
cmpq %r14, %rdi
je 0xff61
callq 0x3220
leaq 0x118(%rsp), %rbx
movq %rbx, -0x10(%rbx)
leaq 0x50e3(%rip), %rsi      # 0x15057
leaq 0x50de(%rip), %rdx      # 0x15059
leaq 0x108(%rsp), %rdi
movq %r12, 0x20(%rsp)
callq 0xad78
leaq 0x9c0(%r15), %r14
leaq 0x108(%rsp), %rsi
movq %r14, %rdi
movl $0x48, %edx
callq 0x106f8
movq 0x108(%rsp), %rdi
cmpq %rbx, %rdi
je 0xffbb
callq 0x3220
leaq 0xf8(%rsp), %rbx
movq %rbx, -0x10(%rbx)
leaq 0x508c(%rip), %rsi      # 0x1505a
leaq 0x5087(%rip), %rdx      # 0x1505c
leaq 0xe8(%rsp), %rdi
movq %r14, 0x18(%rsp)
callq 0xad78
leaq 0x9f8(%r15), %r13
leaq 0xe8(%rsp), %rsi
movq %r13, %rdi
movl $0x38, %edx
callq 0x106f8
movq 0xe8(%rsp), %rdi
cmpq %rbx, %rdi
je 0x10015
callq 0x3220
leaq 0xd8(%rsp), %rbx
movq %rbx, -0x10(%rbx)
leaq 0x5035(%rip), %rsi      # 0x1505d
leaq 0x5032(%rip), %rdx      # 0x15061
leaq 0xc8(%rsp), %rdi
movq %r13, 0x10(%rsp)
callq 0xad78
leaq 0x3690(%r15), %rdi
subq $0x8, %rsp
leaq 0xd0(%rsp), %rsi
movq %rdi, 0x10(%rsp)
movl $0x10, %edx
movl $0x4, %ecx
movl $0x40, %r8d
movl $0x10, %r9d
pushq $0x8
pushq $0x0
pushq $0x10
callq 0x107d2
addq $0x20, %rsp
movq 0xc8(%rsp), %rdi
cmpq %rbx, %rdi
je 0x10090
callq 0x3220
leaq 0xb8(%rsp), %rbx
movq %rbx, -0x10(%rbx)
leaq 0x4fbf(%rip), %rsi      # 0x15062
leaq 0x4fbc(%rip), %rdx      # 0x15066
leaq 0xa8(%rsp), %rdi
callq 0xad78
leaq 0x13a38(%r15), %rbp
subq $0x8, %rsp
leaq 0xb0(%rsp), %rsi
movq %rbp, %rdi
movl $0x10, %edx
movl $0x4, %ecx
movl $0x40, %r8d
movl $0x10, %r9d
pushq $0x8
pushq $0x0
pushq $0x10
callq 0x107d2
addq $0x20, %rsp
movq 0xa8(%rsp), %rdi
cmpq %rbx, %rdi
je 0x10104
callq 0x3220
leaq 0x98(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x4f50(%rip), %rsi      # 0x15067
leaq 0x4f4d(%rip), %rdx      # 0x1506b
leaq 0x88(%rsp), %rdi
callq 0xad78
leaq 0x23de0(%r15), %rbx
subq $0x8, %rsp
leaq 0x90(%rsp), %rsi
movq %rbx, %rdi
movl $0x80, %edx
movl $0xc, %ecx
movl $0x600, %r8d            # imm = 0x600
movl $0x20, %r9d
pushq $0x10
pushq $0x0
pushq $0x20
callq 0x107d2
addq $0x20, %rsp
movq 0x88(%rsp), %rdi
cmpq %r14, %rdi
je 0x10178
callq 0x3220
leaq 0x78(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x4ee3(%rip), %rsi      # 0x1506c
leaq 0x4edf(%rip), %rdx      # 0x1506f
leaq 0x68(%rsp), %rdi
callq 0xad78
leaq 0x34188(%r15), %r14
subq $0x8, %rsp
movl $0x40, %eax
leaq 0x70(%rsp), %rsi
movq %r14, %rdi
movl $0x40, %edx
movl $0x8, %ecx
movl $0x200, %r8d            # imm = 0x200
movl $0x40, %r9d
pushq $0x8
pushq %rax
pushq %rax
callq 0x107d2
addq $0x20, %rsp
movq 0x68(%rsp), %rdi
cmpq %r12, %rdi
je 0x101e4
callq 0x3220
leaq 0x58(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x4e7c(%rip), %rsi      # 0x15070
leaq 0x4e78(%rip), %rdx      # 0x15073
leaq 0x48(%rsp), %rdi
callq 0xad78
leaq 0x44530(%r15), %r12
subq $0x8, %rsp
movl $0x40, %eax
leaq 0x50(%rsp), %rsi
movq %r12, %rdi
movl $0x40, %edx
movl $0x8, %ecx
movl $0x200, %r8d            # imm = 0x200
movl $0x40, %r9d
pushq $0x8
pushq %rax
pushq %rax
callq 0x107d2
addq $0x20, %rsp
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0x1024f
callq 0x3220
leaq 0x38(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x4e15(%rip), %rsi      # 0x15074
leaq 0x4e11(%rip), %rdx      # 0x15077
leaq 0x28(%rsp), %rdi
callq 0xad78
leaq 0x548d8(%r15), %rdi
subq $0x8, %rsp
movl $0x20, %eax
leaq 0x30(%rsp), %rsi
movl $0x200, %edx            # imm = 0x200
movl $0x8, %ecx
movl $0x1000, %r8d           # imm = 0x1000
movl $0x20, %r9d
pushq $0x10
pushq %rax
pushq %rax
callq 0x107d2
addq $0x20, %rsp
movq 0x28(%rsp), %rdi
cmpq %r13, %rdi
je 0x102b7
callq 0x3220
movl $0x0, (%r15)
xorl %eax, %eax
movq %rax, 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
leaq 0xa30(%r15), %rdi
movups %xmm0, 0x918(%r15)
movq %rax, 0x928(%r15)
movq %rax, 0x3670(%r15)
movb $0x0, 0x3678(%r15)
movups %xmm0, 0x3680(%r15)
movl $0x2000, %edx           # imm = 0x2000
movl $0xff, %esi
callq 0x3130
xorps %xmm0, %xmm0
movups %xmm0, 0x2a30(%r15)
movq $-0x100, %rax
movaps 0x48a9(%rip), %xmm0     # 0x14c00
movups %xmm0, 0x2e40(%r15,%rax,4)
movups %xmm0, 0x3248(%r15,%rax,4)
addq $0x4, %rax
jne 0x10357
xorl %eax, %eax
movq %rax, 0x2e40(%r15)
movq %rax, 0x3248(%r15)
movq $-0x48, %rax
movaps 0x4883(%rip), %xmm0     # 0x14c10
movups %xmm0, 0x3370(%r15,%rax,4)
movups %xmm0, 0x3498(%r15,%rax,4)
addq $0x4, %rax
jne 0x1038d
xorl %eax, %eax
movq %rax, 0x3370(%r15)
movq %rax, 0x3498(%r15)
movq $-0x38, %rax
movaps 0x485d(%rip), %xmm0     # 0x14c20
movups %xmm0, 0x3580(%r15,%rax,4)
movups %xmm0, 0x3668(%r15,%rax,4)
addq $0x4, %rax
jne 0x103c3
xorl %eax, %eax
movq %rax, 0x3580(%r15)
movq %rax, 0x3668(%r15)
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r15
movq 0x28(%rsp), %rdi
cmpq %r13, %rdi
je 0x10414
callq 0x3220
jmp 0x10414
movq %rax, %r15
movq %r12, %rdi
callq 0x10d92
jmp 0x10435
movq %rax, %r15
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0x10435
callq 0x3220
jmp 0x10435
movq %rax, %r15
movq %r14, %rdi
callq 0x10d92
jmp 0x10456
movq %rax, %r15
movq 0x68(%rsp), %rdi
cmpq %r12, %rdi
je 0x10456
callq 0x3220
jmp 0x10456
movq %rax, %r15
movq %rbx, %rdi
callq 0x10d92
movq %rbp, %rdi
callq 0x10d92
movq 0x8(%rsp), %rdi
callq 0x10d92
movq 0x10(%rsp), %rdi
callq 0x10e80
movq 0x18(%rsp), %rdi
callq 0x10e80
movq 0x20(%rsp), %rdi
callq 0x10ea6
movq %r15, %rdi
callq 0x33d0
movq %rax, %r15
movq 0x88(%rsp), %rdi
cmpq %r14, %rdi
je 0x1045e
callq 0x3220
jmp 0x1045e
movq %rax, %r15
jmp 0x1045e
movq %rax, %r15
movq 0xa8(%rsp), %rdi
cmpq %rbx, %rdi
je 0x10466
callq 0x3220
jmp 0x10466
movq %rax, %r15
jmp 0x10466
movq %rax, %r15
movq 0xc8(%rsp), %rdi
cmpq %rbx, %rdi
je 0x10470
callq 0x3220
jmp 0x10470
movq %rax, %r15
jmp 0x10470
movq %rax, %r15
movq 0xe8(%rsp), %rdi
cmpq %rbx, %rdi
je 0x1047a
callq 0x3220
jmp 0x1047a
movq %rax, %r15
jmp 0x1047a
movq %rax, %r15
movq 0x108(%rsp), %rdi
cmpq %rbx, %rdi
je 0x10484
callq 0x3220
jmp 0x10484
movq %rax, %r15
jmp 0x10484
movq %rax, %r15
movq 0x128(%rsp), %rdi
cmpq %r14, %rdi
je 0x1048e
callq 0x3220
jmp 0x1048e