// File: MPSLab-ASU[P]DiRAC/./src/baseAccelSim.cc
// Function: baseAccelSim::read_file_config_interconnect(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void baseAccelSim::read_file_config_interconnect(string interconnectConfigFileName)
{
	configArr = new Packet**[totalNetworks];
	for(uint8_t i=0; i < totalNetworks; i++)
  {
    configArr[i] = new Packet*[total_MC];
    // each Multicast Controller requires 4 parameters for configured
    for(uint16_t j=0; j < total_MC; j++)
      configArr[i][j] = new Packet[network_controller_config_params];
  }

	uint16_t it=0;
	ifstream inFile(interconnectConfigFileName.c_str());
	if(!inFile)
	{
		cout << "Cannot open and read file: " << interconnectConfigFileName.c_str() << endl;
		exit (EXIT_FAILURE);
	}

	string line;
 	while (getline(inFile, line)) {
		istringstream tokenStream(line);
		string token1, token2, token3, token4, token5, token6;
		tokenStream >> token1 >> token2 >> token3 >> token4 >> token5 >> token6;
		uint8_t 	network 	= stoul(token1);
		uint16_t	idx				= stoul(token2);
		uint8_t		val				= stoul(token3);
		uint8_t 	rowTag 		= stoul(token4);
		uint8_t 	colTag 		= stoul(token5);
		data_type configVal	= stoul(token6);

		configArr[network][idx][val].setData(configVal);
		configArr[network][idx][val].setRowTag(rowTag);
		configArr[network][idx][val].setColTag(colTag);
	}
	inFile.close();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x570, %rsp            # imm = 0x570
movq %rsi, -0x4a8(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movzbl 0x212382(%rip), %eax    # 0x61c153
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x425dd0
movq %rax, 0x214807(%rip)    # 0x61e600
movb $0x0, -0x11(%rbp)
movzbl -0x11(%rbp), %eax
movzbl 0x21234b(%rip), %ecx    # 0x61c153
cmpl %ecx, %eax
jge 0x409f73
movl 0x2147fa(%rip), %eax    # 0x61e610
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x425dd0
movq %rax, %rdx
movq 0x2147bf(%rip), %rax    # 0x61e600
movzbl -0x11(%rbp), %ecx
movq %rdx, (%rax,%rcx,8)
movw $0x0, -0x14(%rbp)
movzwl -0x14(%rbp), %eax
cmpl 0x2147b7(%rip), %eax    # 0x61e610
jae 0x409f64
movl $0x18, %edi
callq 0x425dd0
movq %rax, -0x4c8(%rbp)
movq $0x4, (%rax)
addq $0x8, %rax
movq %rax, -0x4c0(%rbp)
movq %rax, %rcx
addq $0x10, %rcx
movq %rcx, -0x4b8(%rbp)
movq %rax, -0x4b0(%rbp)
movq -0x4b0(%rbp), %rdi
movq %rdi, -0x4d0(%rbp)
callq 0x40f580
jmp 0x409eac
movq -0x4b8(%rbp), %rcx
movq -0x4d0(%rbp), %rax
addq $0x4, %rax
cmpq %rcx, %rax
movq %rax, -0x4b0(%rbp)
jne 0x409e97
movq -0x4c0(%rbp), %rdx
movq 0x214728(%rip), %rax    # 0x61e600
movzbl -0x11(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movzwl -0x14(%rbp), %ecx
movq %rdx, (%rax,%rcx,8)
movw -0x14(%rbp), %ax
addw $0x1, %ax
movw %ax, -0x14(%rbp)
jmp 0x409e4f
movq -0x4c0(%rbp), %rcx
movq %rax, %rsi
movq -0x4d0(%rbp), %rax
movq %rsi, -0x20(%rbp)
movl %edx, -0x24(%rbp)
cmpq %rax, %rcx
movq %rax, -0x4d8(%rbp)
je 0x409f4e
movq -0x4d8(%rbp), %rdi
addq $-0x4, %rdi
movq %rdi, -0x4e0(%rbp)
callq 0x40f5a0
movq -0x4c0(%rbp), %rcx
movq -0x4e0(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x4d8(%rbp)
jne 0x409f1d
movq -0x4c8(%rbp), %rdi
movl $0x18, %esi
callq 0x4248b0
jmp 0x40a44d
jmp 0x409f66
movb -0x11(%rbp), %al
addb $0x1, %al
movb %al, -0x11(%rbp)
jmp 0x409dfd
movq -0x4a8(%rbp), %rdi
movw $0x0, -0x26(%rbp)
callq 0x4a4170
movq %rax, %rsi
leaq -0x230(%rbp), %rdi
movl $0x8, %edx
callq 0x46e8c0
movq -0x230(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x230(%rbp,%rax), %rdi
callq 0x472d80
movb %al, -0x4e1(%rbp)
jmp 0x409fb9
movb -0x4e1(%rbp), %al
testb $0x1, %al
jne 0x409fc5
jmp 0x40a035
movq $0x61f900, %rdi         # imm = 0x61F900
leaq 0x19703d(%rip), %rsi    # 0x5a1010
callq 0x492450
movq %rax, -0x4f0(%rbp)
jmp 0x409fe1
movq -0x4a8(%rbp), %rdi
callq 0x4a4170
movq -0x4f0(%rbp), %rdi
movq %rax, %rsi
callq 0x492450
movq %rax, -0x4f8(%rbp)
jmp 0x40a005
movq -0x4f8(%rbp), %rdi
movq $0x491d30, %rsi         # imm = 0x491D30
callq 0x490f40
jmp 0x40a01a
movl $0x1, %edi
callq 0x4ec1e0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x40a441
leaq -0x250(%rbp), %rdi
callq 0x4a2620
leaq -0x230(%rbp), %rdi
leaq -0x250(%rbp), %rsi
callq 0x4a5170
movq %rax, -0x500(%rbp)
jmp 0x40a05d
movq -0x500(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x472d70
movb %al, -0x501(%rbp)
jmp 0x40a07b
movb -0x501(%rbp), %al
testb $0x1, %al
jne 0x40a08a
jmp 0x40a406
leaq -0x3d0(%rbp), %rdi
leaq -0x250(%rbp), %rsi
movl $0x8, %edx
callq 0x49a120
jmp 0x40a0a4
leaq -0x3f0(%rbp), %rdi
movq %rdi, -0x518(%rbp)
callq 0x4a2620
leaq -0x410(%rbp), %rdi
callq 0x4a2620
leaq -0x430(%rbp), %rdi
callq 0x4a2620
leaq -0x450(%rbp), %rdi
callq 0x4a2620
leaq -0x470(%rbp), %rdi
callq 0x4a2620
leaq -0x490(%rbp), %rdi
callq 0x4a2620
movq -0x518(%rbp), %rsi
leaq -0x3d0(%rbp), %rdi
callq 0x4277f0
movq %rax, -0x510(%rbp)
jmp 0x40a10f
movq -0x510(%rbp), %rdi
leaq -0x410(%rbp), %rsi
callq 0x4277f0
movq %rax, -0x520(%rbp)
jmp 0x40a12b
movq -0x520(%rbp), %rdi
leaq -0x430(%rbp), %rsi
callq 0x4277f0
movq %rax, -0x528(%rbp)
jmp 0x40a147
movq -0x528(%rbp), %rdi
leaq -0x450(%rbp), %rsi
callq 0x4277f0
movq %rax, -0x530(%rbp)
jmp 0x40a163
movq -0x530(%rbp), %rdi
leaq -0x470(%rbp), %rsi
callq 0x4277f0
movq %rax, -0x538(%rbp)
jmp 0x40a17f
movq -0x538(%rbp), %rdi
leaq -0x490(%rbp), %rsi
callq 0x4277f0
jmp 0x40a194
xorl %eax, %eax
movl %eax, %esi
leaq -0x3f0(%rbp), %rdi
movl $0xa, %edx
callq 0x40f200
movq %rax, -0x540(%rbp)
jmp 0x40a1b2
movq -0x540(%rbp), %rax
movb %al, -0x491(%rbp)
xorl %eax, %eax
movl %eax, %esi
leaq -0x410(%rbp), %rdi
movl $0xa, %edx
callq 0x40f200
movq %rax, -0x548(%rbp)
jmp 0x40a1dd
movq -0x548(%rbp), %rax
movw %ax, -0x494(%rbp)
xorl %eax, %eax
movl %eax, %esi
leaq -0x430(%rbp), %rdi
movl $0xa, %edx
callq 0x40f200
movq %rax, -0x550(%rbp)
jmp 0x40a209
movq -0x550(%rbp), %rax
movb %al, -0x495(%rbp)
xorl %eax, %eax
movl %eax, %esi
leaq -0x450(%rbp), %rdi
movl $0xa, %edx
callq 0x40f200
movq %rax, -0x558(%rbp)
jmp 0x40a234
movq -0x558(%rbp), %rax
movb %al, -0x496(%rbp)
xorl %eax, %eax
movl %eax, %esi
leaq -0x470(%rbp), %rdi
movl $0xa, %edx
callq 0x40f200
movq %rax, -0x560(%rbp)
jmp 0x40a25f
movq -0x560(%rbp), %rax
movb %al, -0x497(%rbp)
xorl %eax, %eax
movl %eax, %esi
leaq -0x490(%rbp), %rdi
movl $0xa, %edx
callq 0x40f200
movq %rax, -0x568(%rbp)
jmp 0x40a28a
movq -0x568(%rbp), %rax
movw %ax, -0x49a(%rbp)
movq 0x214361(%rip), %rax    # 0x61e600
movzbl -0x491(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movzwl -0x494(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movzbl -0x495(%rbp), %ecx
leaq (%rax,%rcx,4), %rdi
movzwl -0x49a(%rbp), %esi
callq 0x40f5b0
jmp 0x40a2ce
movq 0x21432b(%rip), %rax    # 0x61e600
movzbl -0x491(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movzwl -0x494(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movzbl -0x495(%rbp), %ecx
leaq (%rax,%rcx,4), %rdi
movzbl -0x496(%rbp), %esi
callq 0x40f5d0
jmp 0x40a304
movq 0x2142f5(%rip), %rax    # 0x61e600
movzbl -0x491(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movzwl -0x494(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movzbl -0x495(%rbp), %ecx
leaq (%rax,%rcx,4), %rdi
movzbl -0x497(%rbp), %esi
callq 0x40f5f0
jmp 0x40a33a
leaq -0x490(%rbp), %rdi
callq 0x4a2730
leaq -0x470(%rbp), %rdi
callq 0x4a2730
leaq -0x450(%rbp), %rdi
callq 0x4a2730
leaq -0x430(%rbp), %rdi
callq 0x4a2730
leaq -0x410(%rbp), %rdi
callq 0x4a2730
leaq -0x3f0(%rbp), %rdi
callq 0x4a2730
leaq -0x3d0(%rbp), %rdi
callq 0x497a10
jmp 0x40a041
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x40a435
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x490(%rbp), %rdi
callq 0x4a2730
leaq -0x470(%rbp), %rdi
callq 0x4a2730
leaq -0x450(%rbp), %rdi
callq 0x4a2730
leaq -0x430(%rbp), %rdi
callq 0x4a2730
leaq -0x410(%rbp), %rdi
callq 0x4a2730
leaq -0x3f0(%rbp), %rdi
callq 0x4a2730
leaq -0x3d0(%rbp), %rdi
callq 0x497a10
jmp 0x40a435
leaq -0x230(%rbp), %rdi
callq 0x46ee70
jmp 0x40a414
leaq -0x250(%rbp), %rdi
callq 0x4a2730
leaq -0x230(%rbp), %rdi
callq 0x46f220
addq $0x570, %rsp            # imm = 0x570
popq %rbp
retq
leaq -0x250(%rbp), %rdi
callq 0x4a2730
leaq -0x230(%rbp), %rdi
callq 0x46f220
movq -0x20(%rbp), %rdi
callq 0x4d0770
nopw %cs:(%rax,%rax)