// File: MPSLab-ASU[P]DiRAC/./src/pe.cc
// Function: PE::PE()
PE::PE()
{
  RegFile = new data_type[RF_size]();

  buf_in = new FIFO*[inNetworks];
  for(uint8_t i=0; i < inNetworks; i++)
    buf_in[i] = new FIFO;
  buf_out = new FIFO*[outNetworks];
  for(uint8_t i=0; i < outNetworks; i++)
    buf_out[i] = new FIFO;

  in_config   = new bool*[inNetworks];
  in_forward  = new bool*[inNetworks];
  in_data     = new data_type*[inNetworks];
  write_back  = new bool[outNetworks]();
  out_data    = new data_type[outNetworks]();

  // Note that zero initialization of following states is necessary.
  state_multiplier_stages = new bool[multiplier_stages]();
  state_adder_stages      = new bool[adder_stages]();

  temp_reg_multiply       = new data_type[multiplier_stages]();
  temp_reg_idx_write_Op3  = new uint16_t[multiplier_stages + adder_stages + 1]();
  temp_reg_add_Op1        = new data_type[adder_stages]();
  temp_reg_add_Op2        = new data_type[multiplier_stages + adder_stages - 1]();

  // Note that zero initialization of following signals is necessary.
  temp_sel_sig_adder_is_Op2_self = new bool[multiplier_stages + adder_stages]();
  temp_sel_sig_adder_Op2_zero_initialize_current_RF_Pass = new bool[2]();

  insMem = new uint64_t[size_insMem]();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xf0, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
leaq 0x1f2352(%rip), %rcx    # 0x6149f0
addq $0x10, %rcx
movq %rcx, (%rax)
movl $0x0, 0x8(%rax)
movl $0x0, 0xc(%rax)
movw $0x0, 0x20(%rax)
movw $0x0, 0x22(%rax)
movw $0x0, 0x24(%rax)
movw $0x0, 0x26(%rax)
movw $0x0, 0x28(%rax)
movw $0x0, 0x2a(%rax)
movw $0x0, 0x2c(%rax)
movw $0x0, 0x2e(%rax)
movw $0x0, 0x30(%rax)
movw $0x0, 0x32(%rax)
movw $0x2, 0x34(%rax)
movw $0x0, 0x36(%rax)
movw $0x0, 0x38(%rax)
movw $0x0, 0x3a(%rax)
movw $0x0, 0x3c(%rax)
movw $0x0, 0x3e(%rax)
movb $0x0, 0x40(%rax)
movw $0x0, 0x42(%rax)
movb $0x0, 0x80(%rax)
movb $0x0, 0x81(%rax)
movb $0x0, 0x82(%rax)
movb $0x0, 0x98(%rax)
movb $0x0, 0x99(%rax)
movb $0x1, 0x9a(%rax)
movw $0x0, 0x9c(%rax)
movb $0x0, 0x128(%rax)
movb $0x0, 0x138(%rax)
movb $0x0, 0x139(%rax)
movq $0x61e5b0, %rax         # imm = 0x61E5B0
movzwl (%rax), %eax
movl $0x2, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
movq %rdi, -0x38(%rbp)
callq 0x425dd0
movq -0x38(%rbp), %rdx
movq %rax, %rdi
movq %rdi, -0x30(%rbp)
xorl %esi, %esi
callq 0x401080
movq -0x30(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x18(%rax)
movq $0x61c151, %rax         # imm = 0x61C151
movzbl (%rax), %eax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x425dd0
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x48(%rax)
movb $0x0, -0x9(%rbp)
movzbl -0x9(%rbp), %eax
movq $0x61c151, %rcx         # imm = 0x61C151
movzbl (%rcx), %ecx
cmpl %ecx, %eax
jge 0x422856
movl $0x10, %edi
callq 0x425d90
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x40(%rbp)
callq 0x424360
jmp 0x422819
movq -0x40(%rbp), %rdx
movq -0x28(%rbp), %rax
movq 0x48(%rax), %rax
movzbl -0x9(%rbp), %ecx
movq %rdx, (%rax,%rcx,8)
movb -0x9(%rbp), %al
addb $0x1, %al
movb %al, -0x9(%rbp)
jmp 0x4227ec
movq -0x40(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
movl $0x10, %esi
callq 0x424890
jmp 0x422d06
movq $0x61e5e4, %rax         # imm = 0x61E5E4
movzbl (%rax), %eax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x425dd0
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x50(%rax)
movb $0x0, -0x1d(%rbp)
movzbl -0x1d(%rbp), %eax
movq $0x61e5e4, %rcx         # imm = 0x61E5E4
movzbl (%rcx), %ecx
cmpl %ecx, %eax
jge 0x4228fa
movl $0x10, %edi
callq 0x425d90
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x48(%rbp)
callq 0x424360
jmp 0x4228bd
movq -0x48(%rbp), %rdx
movq -0x28(%rbp), %rax
movq 0x50(%rax), %rax
movzbl -0x1d(%rbp), %ecx
movq %rdx, (%rax,%rcx,8)
movb -0x1d(%rbp), %al
addb $0x1, %al
movb %al, -0x1d(%rbp)
jmp 0x422890
movq -0x48(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
movl $0x10, %esi
callq 0x424890
jmp 0x422d06
movq $0x61c151, %rax         # imm = 0x61C151
movzbl (%rax), %eax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x425dd0
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x58(%rax)
movq $0x61c151, %rax         # imm = 0x61C151
movzbl (%rax), %eax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x425dd0
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x60(%rax)
movq $0x61c151, %rax         # imm = 0x61C151
movzbl (%rax), %eax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x425dd0
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x68(%rax)
movq $0x61e5e4, %rax         # imm = 0x61E5E4
movzbl (%rax), %eax
movl %eax, %edi
movq %rdi, -0xf0(%rbp)
callq 0x425dd0
movq -0xf0(%rbp), %rdx
movq %rax, %rdi
movq %rdi, -0xe8(%rbp)
xorl %esi, %esi
callq 0x401080
movq -0xe8(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x70(%rax)
movq $0x61e5e4, %rax         # imm = 0x61E5E4
movzbl (%rax), %eax
movl $0x2, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
movq %rdi, -0xe0(%rbp)
callq 0x425dd0
movq -0xe0(%rbp), %rdx
movq %rax, %rdi
movq %rdi, -0xd8(%rbp)
xorl %esi, %esi
callq 0x401080
movq -0xd8(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x78(%rax)
movq $0x61c154, %rax         # imm = 0x61C154
movzbl (%rax), %eax
movl %eax, %edi
movq %rdi, -0xd0(%rbp)
callq 0x425dd0
movq -0xd0(%rbp), %rdx
movq %rax, %rdi
movq %rdi, -0xc8(%rbp)
xorl %esi, %esi
callq 0x401080
movq -0xc8(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x88(%rax)
movq $0x61c155, %rax         # imm = 0x61C155
movzbl (%rax), %eax
movl %eax, %edi
movq %rdi, -0xc0(%rbp)
callq 0x425dd0
movq -0xc0(%rbp), %rdx
movq %rax, %rdi
movq %rdi, -0xb8(%rbp)
xorl %esi, %esi
callq 0x401080
movq -0xb8(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x90(%rax)
movq $0x61c154, %rax         # imm = 0x61C154
movzbl (%rax), %eax
movl $0x2, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
movq %rdi, -0xb0(%rbp)
callq 0x425dd0
movq -0xb0(%rbp), %rdx
movq %rax, %rdi
movq %rdi, -0xa8(%rbp)
xorl %esi, %esi
callq 0x401080
movq -0xa8(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x108(%rax)
movq $0x61c154, %rax         # imm = 0x61C154
movzbl (%rax), %eax
movq $0x61c155, %rcx         # imm = 0x61C155
movzbl (%rcx), %ecx
addl %ecx, %eax
addl $0x1, %eax
cltq
movl $0x2, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
movq %rdi, -0xa0(%rbp)
callq 0x425dd0
movq -0xa0(%rbp), %rdx
movq %rax, %rdi
movq %rdi, -0x98(%rbp)
xorl %esi, %esi
callq 0x401080
movq -0x98(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x120(%rax)
movq $0x61c155, %rax         # imm = 0x61C155
movzbl (%rax), %eax
movl $0x2, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
movq %rdi, -0x90(%rbp)
callq 0x425dd0
movq -0x90(%rbp), %rdx
movq %rax, %rdi
movq %rdi, -0x88(%rbp)
xorl %esi, %esi
callq 0x401080
movq -0x88(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x110(%rax)
movq $0x61c154, %rax         # imm = 0x61C154
movzbl (%rax), %eax
movq $0x61c155, %rcx         # imm = 0x61C155
movzbl (%rcx), %ecx
addl %ecx, %eax
subl $0x1, %eax
cltq
movl $0x2, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
movq %rdi, -0x80(%rbp)
callq 0x425dd0
movq -0x80(%rbp), %rdx
movq %rax, %rdi
movq %rdi, -0x78(%rbp)
xorl %esi, %esi
callq 0x401080
movq -0x78(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x118(%rax)
movq $0x61c154, %rax         # imm = 0x61C154
movzbl (%rax), %eax
movq $0x61c155, %rcx         # imm = 0x61C155
movzbl (%rcx), %ecx
addl %ecx, %eax
movslq %eax, %rdi
movq %rdi, -0x70(%rbp)
callq 0x425dd0
movq -0x70(%rbp), %rdx
movq %rax, %rdi
movq %rdi, -0x68(%rbp)
xorl %esi, %esi
callq 0x401080
movq -0x68(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x140(%rax)
movl $0x2, %edi
callq 0x425dd0
movq %rax, %rdi
movq %rdi, -0x60(%rbp)
xorl %esi, %esi
movl $0x2, %edx
callq 0x401080
movq -0x60(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x130(%rax)
movq $0x61e5b8, %rax         # imm = 0x61E5B8
movzwl (%rax), %eax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
movq %rdi, -0x58(%rbp)
callq 0x425dd0
movq -0x58(%rbp), %rdx
movq %rax, %rdi
movq %rdi, -0x50(%rbp)
xorl %esi, %esi
callq 0x401080
movq -0x50(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0xe8(%rax)
addq $0xf0, %rsp
popq %rbp
retq
movq -0x18(%rbp), %rdi
callq 0x4d0770
nop