// File: NishadSaraf[P]Championship-Simulator/inc/instruction.h
// Function: ooo_model_instr::ooo_model_instr()
ooo_model_instr() {
        instr_id = 0;
        ip = 0;
        fetch_producer = 0;
        producer_id = 0;
        translated_cycle = 0;
        fetched_cycle = 0;
        execute_begin_cycle = 0;
        retired_cycle = 0;
        event_cycle = 0;

        is_branch = 0;
        is_memory = 0;
        branch_taken = 0;
        branch_mispredicted = 0;
        translated = 0;
        data_translated = 0;
        is_producer = 0;
        is_consumer = 0;
        reg_RAW_producer = 0;
        fetched = 0;
        scheduled = 0;
        executed = 0;
        reg_ready = 0;
        mem_ready = 0;
        asid[0] = UINT8_MAX;
        asid[1] = UINT8_MAX;

        instruction_pa = 0;
        data_pa = 0;
        virtual_address = 0;
        physical_address = 0;

        num_reg_ops = 0;
        num_mem_ops = 0;
        num_reg_dependent = 0;

        for (uint32_t i=0; i<NUM_INSTR_SOURCES; i++) {
            source_registers[i] = 0;
            source_memory[i] = 0;
            source_virtual_address[i] = 0;
            source_added[i] = 0;
            lq_index[i] = UINT32_MAX;
            reg_RAW_checked[i] = 0;
        }

        for (uint32_t i=0; i<NUM_INSTR_DESTINATIONS_SPARC; i++) {
            destination_memory[i] = 0;
            destination_registers[i] = 0;
            destination_virtual_address[i] = 0;
            destination_added[i] = 0;
            sq_index[i] = UINT32_MAX;
            forwarding_index[i] = 0;
        }

        for (uint32_t i=0; i<ROB_SIZE; i++) {
            registers_instrs_depend_on_me[i] = 0;
            memory_instrs_depend_on_me[i] = 0;

            for (uint32_t j=0; j<NUM_INSTR_SOURCES; j++)
                registers_index_depend_on_me[i][j] = 0;
        }
    }

// Assembly:
movq %rdi, -0x8(%rsp)
movq -0x8(%rsp), %rax
movq %rax, -0x20(%rsp)
movq $0x0, (%rax)
movq $0x0, 0x8(%rax)
movq $0x0, 0x10(%rax)
movq $0x0, 0x18(%rax)
movq $0x0, 0x20(%rax)
movq $0x0, 0x28(%rax)
movq $0x0, 0x30(%rax)
movq $0x0, 0x38(%rax)
movq $0x0, 0x40(%rax)
movb $0x0, 0x48(%rax)
movb $0x0, 0x49(%rax)
movb $0x0, 0x4a(%rax)
movb $0x0, 0x4b(%rax)
movb $0x0, 0x4c(%rax)
movb $0x0, 0x4d(%rax)
movb $0x0, 0x56(%rax)
movb $0x0, 0x57(%rax)
movb $0x0, 0x58(%rax)
movl $0x0, 0x64(%rax)
movl $0x0, 0x68(%rax)
movl $0x0, 0x78(%rax)
movb $0x0, 0x59(%rax)
movb $0x0, 0x5a(%rax)
movb $-0x1, 0x5b(%rax)
movb $-0x1, 0x5c(%rax)
movq $0x0, 0x588(%rax)
movq $0x0, 0x590(%rax)
movq $0x0, 0x598(%rax)
movq $0x0, 0x5a0(%rax)
movl $0x0, 0x6c(%rax)
movl $0x0, 0x70(%rax)
movl $0x0, 0x74(%rax)
movl $0x0, -0xc(%rsp)
cmpl $0x4, -0xc(%rsp)
jae 0x1c57e
movq -0x20(%rsp), %rax
movl -0xc(%rsp), %ecx
movb $0x0, 0x80(%rax,%rcx)
movl -0xc(%rsp), %ecx
movq $0x0, 0x5c8(%rax,%rcx,8)
movl -0xc(%rsp), %ecx
movq $0x0, 0x608(%rax,%rcx,8)
movl -0xc(%rsp), %ecx
movb $0x0, 0x4e(%rax,%rcx)
movl -0xc(%rsp), %ecx
movl $0xffffffff, 0x728(%rax,%rcx,4) # imm = 0xFFFFFFFF
movl -0xc(%rsp), %ecx
movb $0x0, 0x5d(%rax,%rcx)
movl -0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rsp)
jmp 0x1c518
movl $0x0, -0x10(%rsp)
cmpl $0x4, -0x10(%rsp)
jae 0x1c5ef
movq -0x20(%rsp), %rax
movl -0x10(%rsp), %ecx
movq $0x0, 0x5a8(%rax,%rcx,8)
movl -0x10(%rsp), %ecx
movb $0x0, 0x7c(%rax,%rcx)
movl -0x10(%rsp), %ecx
movq $0x0, 0x5e8(%rax,%rcx,8)
movl -0x10(%rsp), %ecx
movb $0x0, 0x52(%rax,%rcx)
movl -0x10(%rsp), %ecx
movl $0xffffffff, 0x738(%rax,%rcx,4) # imm = 0xFFFFFFFF
movl -0x10(%rsp), %ecx
movl $0x0, 0x748(%rax,%rcx,4)
movl -0x10(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rsp)
jmp 0x1c586
movl $0x0, -0x14(%rsp)
cmpl $0x100, -0x14(%rsp)     # imm = 0x100
jae 0x1c667
movq -0x20(%rsp), %rax
movl -0x14(%rsp), %ecx
movb $0x0, 0x84(%rax,%rcx)
movl -0x14(%rsp), %ecx
movb $0x0, 0x628(%rax,%rcx)
movl $0x0, -0x18(%rsp)
cmpl $0x4, -0x18(%rsp)
jae 0x1c658
movq -0x20(%rsp), %rax
addq $0x184, %rax            # imm = 0x184
movl -0x14(%rsp), %ecx
shlq $0x2, %rcx
addq %rcx, %rax
movl -0x18(%rsp), %ecx
movb $0x0, (%rax,%rcx)
movl -0x18(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rsp)
jmp 0x1c626
jmp 0x1c65a
movl -0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rsp)
jmp 0x1c5f7
retq
nopl (%rax,%rax)