// File: /workspace/github_cpp_makefile_star2_O1/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, 0x850(%rdi)
movups %xmm0, 0x840(%rdi)
movups %xmm0, 0x830(%rdi)
movups %xmm0, 0x820(%rdi)
movups %xmm0, 0x810(%rdi)
movw $0x0, 0x860(%rdi)
movups %xmm0, 0x868(%rdi)
movups %xmm0, 0x878(%rdi)
movups %xmm0, 0x888(%rdi)
movups %xmm0, 0x898(%rdi)
movw $0xffff, 0x8a8(%rdi)    # imm = 0xFFFF
leaq 0x930(%rdi), %r12
leaq 0x138(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x4ed1(%rip), %rsi      # 0x15023
leaq 0x4ecd(%rip), %rdx      # 0x15026
leaq 0x128(%rsp), %rbx
movq %rbx, %rdi
callq 0xad18
movq %r12, %rdi
movq %rbx, %rsi
movl $0x100, %edx            # imm = 0x100
callq 0x10856
movq 0x128(%rsp), %rdi
cmpq %r14, %rdi
je 0x1018b
callq 0x3220
leaq 0x118(%rsp), %rbx
movq %rbx, -0x10(%rbx)
leaq 0x4e89(%rip), %rsi      # 0x15027
leaq 0x4e84(%rip), %rdx      # 0x15029
leaq 0x108(%rsp), %rdi
movq %r12, 0x20(%rsp)
callq 0xad18
leaq 0x9c0(%r15), %r14
leaq 0x108(%rsp), %rsi
movq %r14, %rdi
movl $0x48, %edx
callq 0x10922
movq 0x108(%rsp), %rdi
cmpq %rbx, %rdi
je 0x101e5
callq 0x3220
leaq 0xf8(%rsp), %rbx
movq %rbx, -0x10(%rbx)
leaq 0x4e32(%rip), %rsi      # 0x1502a
leaq 0x4e2d(%rip), %rdx      # 0x1502c
leaq 0xe8(%rsp), %rdi
movq %r14, 0x18(%rsp)
callq 0xad18
leaq 0x9f8(%r15), %r13
leaq 0xe8(%rsp), %rsi
movq %r13, %rdi
movl $0x38, %edx
callq 0x10922
movq 0xe8(%rsp), %rdi
cmpq %rbx, %rdi
je 0x1023f
callq 0x3220
leaq 0xd8(%rsp), %rbx
movq %rbx, -0x10(%rbx)
leaq 0x4ddb(%rip), %rsi      # 0x1502d
leaq 0x4dd8(%rip), %rdx      # 0x15031
leaq 0xc8(%rsp), %rdi
movq %r13, 0x10(%rsp)
callq 0xad18
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 0x109fc
addq $0x20, %rsp
movq 0xc8(%rsp), %rdi
cmpq %rbx, %rdi
je 0x102ba
callq 0x3220
leaq 0xb8(%rsp), %rbx
movq %rbx, -0x10(%rbx)
leaq 0x4d65(%rip), %rsi      # 0x15032
leaq 0x4d62(%rip), %rdx      # 0x15036
leaq 0xa8(%rsp), %rdi
callq 0xad18
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 0x109fc
addq $0x20, %rsp
movq 0xa8(%rsp), %rdi
cmpq %rbx, %rdi
je 0x1032e
callq 0x3220
leaq 0x98(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x4cf6(%rip), %rsi      # 0x15037
leaq 0x4cf3(%rip), %rdx      # 0x1503b
leaq 0x88(%rsp), %rdi
callq 0xad18
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 0x109fc
addq $0x20, %rsp
movq 0x88(%rsp), %rdi
cmpq %r14, %rdi
je 0x103a2
callq 0x3220
leaq 0x78(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x4c89(%rip), %rsi      # 0x1503c
leaq 0x4c85(%rip), %rdx      # 0x1503f
leaq 0x68(%rsp), %rdi
callq 0xad18
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 0x109fc
addq $0x20, %rsp
movq 0x68(%rsp), %rdi
cmpq %r12, %rdi
je 0x1040e
callq 0x3220
leaq 0x58(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x4c22(%rip), %rsi      # 0x15040
leaq 0x4c1e(%rip), %rdx      # 0x15043
leaq 0x48(%rsp), %rdi
callq 0xad18
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 0x109fc
addq $0x20, %rsp
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0x10479
callq 0x3220
leaq 0x38(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x4bbb(%rip), %rsi      # 0x15044
leaq 0x4bb7(%rip), %rdx      # 0x15047
leaq 0x28(%rsp), %rdi
callq 0xad18
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 0x109fc
addq $0x20, %rsp
movq 0x28(%rsp), %rdi
cmpq %r13, %rdi
je 0x104e1
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 0x463f(%rip), %xmm0     # 0x14bc0
movups %xmm0, 0x2e40(%r15,%rax,4)
movups %xmm0, 0x3248(%r15,%rax,4)
addq $0x4, %rax
jne 0x10581
xorl %eax, %eax
movq %rax, 0x2e40(%r15)
movq %rax, 0x3248(%r15)
movq $-0x48, %rax
movaps 0x4619(%rip), %xmm0     # 0x14bd0
movups %xmm0, 0x3370(%r15,%rax,4)
movups %xmm0, 0x3498(%r15,%rax,4)
addq $0x4, %rax
jne 0x105b7
xorl %eax, %eax
movq %rax, 0x3370(%r15)
movq %rax, 0x3498(%r15)
movq $-0x38, %rax
movaps 0x45f3(%rip), %xmm0     # 0x14be0
movups %xmm0, 0x3580(%r15,%rax,4)
movups %xmm0, 0x3668(%r15,%rax,4)
addq $0x4, %rax
jne 0x105ed
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 0x1063e
callq 0x3220
jmp 0x1063e
movq %rax, %r15
movq %r12, %rdi
callq 0x10faa
jmp 0x1065f
movq %rax, %r15
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0x1065f
callq 0x3220
jmp 0x1065f
movq %rax, %r15
movq %r14, %rdi
callq 0x10faa
jmp 0x10680
movq %rax, %r15
movq 0x68(%rsp), %rdi
cmpq %r12, %rdi
je 0x10680
callq 0x3220
jmp 0x10680
movq %rax, %r15
movq %rbx, %rdi
callq 0x10faa
movq %rbp, %rdi
callq 0x10faa
movq 0x8(%rsp), %rdi
callq 0x10faa
movq 0x10(%rsp), %rdi
callq 0x11094
movq 0x18(%rsp), %rdi
callq 0x11094
movq 0x20(%rsp), %rdi
callq 0x110ba
movq %r15, %rdi
callq 0x33d0
movq %rax, %r15
movq 0x88(%rsp), %rdi
cmpq %r14, %rdi
je 0x10688
callq 0x3220
jmp 0x10688
movq %rax, %r15
jmp 0x10688
movq %rax, %r15
movq 0xa8(%rsp), %rdi
cmpq %rbx, %rdi
je 0x10690
callq 0x3220
jmp 0x10690
movq %rax, %r15
jmp 0x10690
movq %rax, %r15
movq 0xc8(%rsp), %rdi
cmpq %rbx, %rdi
je 0x1069a
callq 0x3220
jmp 0x1069a
movq %rax, %r15
jmp 0x1069a
movq %rax, %r15
movq 0xe8(%rsp), %rdi
cmpq %rbx, %rdi
je 0x106a4
callq 0x3220
jmp 0x106a4
movq %rax, %r15
jmp 0x106a4
movq %rax, %r15
movq 0x108(%rsp), %rdi
cmpq %rbx, %rdi
je 0x106ae
callq 0x3220
jmp 0x106ae
movq %rax, %r15
jmp 0x106ae
movq %rax, %r15
movq 0x128(%rsp), %rdi
cmpq %r14, %rdi
je 0x106b8
callq 0x3220
jmp 0x106b8