// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x478, %rsp            # imm = 0x478
movq %rsi, 0x8(%rsp)
movzbl 0x1fe9e9(%rip), %r12d   # 0x606153
movl %r12d, %edi
shll $0x3, %edi
callq 0x414190
movq %rax, 0x200e84(%rip)    # 0x608600
movl 0x200e8d(%rip), %r13d   # 0x608610
movq %r13, %r14
shlq $0x3, %r14
xorl %ebp, %ebp
pushq $0x18
popq %r15
cmpq %r12, %rbp
je 0x4077e5
movq %r14, %rdi
callq 0x414190
movq 0x200e5c(%rip), %rcx    # 0x608600
movq %rax, (%rcx,%rbp,8)
xorl %eax, %eax
movzwl %ax, %ebx
cmpl %ebx, %r13d
jbe 0x4077e0
movq %r15, %rdi
callq 0x414190
movq $0x4, (%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
addq $0x8, %rax
movq 0x200e2d(%rip), %rcx    # 0x608600
movq (%rcx,%rbp,8), %rcx
movq %rax, (%rcx,%rbx,8)
leal 0x1(%rbx), %eax
jmp 0x4077aa
incq %rbp
jmp 0x407790
movq 0x8(%rsp), %rax
movq (%rax), %rsi
leaq 0xf0(%rsp), %r14
pushq $0x8
popq %rdx
movq %r14, %rdi
callq 0x45cbc0
movq (%r14), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x110(%rsp,%rax)
jne 0x407a86
leaq 0xe0(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0xb0(%rsp), %r14
leaq 0x90(%rsp), %r15
pushq $0xa
popq %r12
leaq 0xf0(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
callq 0x493470
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x407a4d
leaq 0x2f8(%rsp), %rbx
movq %rbx, %rdi
leaq 0xd0(%rsp), %rsi
pushq $0x8
popq %rdx
callq 0x488420
leaq 0xc0(%rsp), %rax
movq %rax, 0xb0(%rsp)
andq $0x0, 0xb8(%rsp)
xorl %ecx, %ecx
movb %cl, 0xc0(%rsp)
leaq 0xa0(%rsp), %rax
movq %rax, 0x90(%rsp)
andq $0x0, 0x98(%rsp)
movb %cl, 0xa0(%rsp)
leaq 0x80(%rsp), %rax
movq %rax, 0x70(%rsp)
andq $0x0, 0x78(%rsp)
leaq 0x60(%rsp), %rax
movq %rax, 0x50(%rsp)
andq $0x0, 0x58(%rsp)
leaq 0x40(%rsp), %rax
movq %rax, 0x30(%rsp)
andq $0x0, 0x38(%rsp)
movb %cl, 0x80(%rsp)
movb %cl, 0x60(%rsp)
movb %cl, 0x40(%rsp)
leaq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
andq $0x0, 0x18(%rsp)
movb %cl, 0x20(%rsp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x415af0
movq %rax, %rdi
movq %r15, %rsi
callq 0x415af0
movq %rax, %rdi
leaq 0x70(%rsp), %rsi
callq 0x415af0
movq %rax, %rdi
leaq 0x50(%rsp), %rsi
callq 0x415af0
movq %rax, %rdi
leaq 0x30(%rsp), %rsi
callq 0x415af0
movq %rax, %rdi
leaq 0x10(%rsp), %rsi
callq 0x415af0
movq %r14, %rdi
xorl %esi, %esi
movl %r12d, %edx
callq 0x40a485
movq %rax, %r13
movq %r15, %rdi
xorl %esi, %esi
movl %r12d, %edx
callq 0x40a485
movq %rax, %rbp
leaq 0x70(%rsp), %rdi
xorl %esi, %esi
movl %r12d, %edx
callq 0x40a485
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
xorl %esi, %esi
movl %r12d, %edx
callq 0x40a485
movq %rax, %r14
leaq 0x30(%rsp), %rdi
xorl %esi, %esi
movl %r12d, %edx
callq 0x40a485
movl %r12d, %edx
movq %rax, %r15
leaq 0x10(%rsp), %rdi
xorl %esi, %esi
movl %edx, %r12d
callq 0x40a485
movq 0x200c30(%rip), %rcx    # 0x608600
movl $0xff, %esi
andl %esi, %r13d
movq (%rcx,%r13,8), %rcx
movzwl %bp, %edx
movq (%rcx,%rdx,8), %rcx
andl %esi, %ebx
movw %ax, 0x2(%rcx,%rbx,4)
movb %r14b, (%rcx,%rbx,4)
movb %r15b, 0x1(%rcx,%rbx,4)
leaq 0x10(%rsp), %rdi
callq 0x490a30
leaq 0x30(%rsp), %rdi
callq 0x490a30
leaq 0x50(%rsp), %rdi
callq 0x490a30
leaq 0x70(%rsp), %rdi
callq 0x490a30
leaq 0x90(%rsp), %r15
movq %r15, %rdi
callq 0x490a30
leaq 0xb0(%rsp), %r14
movq %r14, %rdi
callq 0x490a30
leaq 0x2f8(%rsp), %rdi
callq 0x485d10
jmp 0x40783d
leaq 0xf0(%rsp), %rdi
callq 0x45d170
leaq 0xd0(%rsp), %rdi
callq 0x490a30
leaq 0xf0(%rsp), %rdi
callq 0x45d520
addq $0x478, %rsp            # imm = 0x478
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq $0x609900, %rdi         # imm = 0x609900
leaq 0x18858c(%rip), %rsi    # 0x590020
callq 0x480750
movq 0x8(%rsp), %rcx
movq (%rcx), %rsi
movq %rax, %rdi
callq 0x480750
movq %rax, %rdi
callq 0x480030
pushq $0x1
popq %rdi
callq 0x4da4e0
movq %rax, %rbx
jmp 0x407b32
jmp 0x407ace
jmp 0x407ad3
jmp 0x407ad3
jmp 0x407ad3
jmp 0x407ad3
jmp 0x407ad3
jmp 0x407ace
jmp 0x407ad3
movq %rax, %rbx
jmp 0x407b25
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x490a30
leaq 0x30(%rsp), %rdi
callq 0x490a30
leaq 0x50(%rsp), %rdi
callq 0x490a30
leaq 0x70(%rsp), %rdi
callq 0x490a30
leaq 0x90(%rsp), %rdi
callq 0x490a30
leaq 0xb0(%rsp), %rdi
callq 0x490a30
leaq 0x2f8(%rsp), %rdi
callq 0x485d10
leaq 0xd0(%rsp), %rdi
callq 0x490a30
leaq 0xf0(%rsp), %rdi
callq 0x45d520
movq %rbx, %rdi
callq 0x4bea70
nop