// File: MPSLab-ASU[P]DiRAC/./src/baseAccelSim.cc
// Function: baseAccelSim::read_file_network_info(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void baseAccelSim::read_file_network_info(string networkInfoFileName)
{
	total_MC = nRows_PE_Array*nCols_PE_Array + nRows_PE_Array;

	size_packetArr = new uint16_t[total_operands]();
	size_config_data_collect_write_back = new uint16_t[outNetworks]();

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

	string line;
 	while (getline(inFile, line)) {
		istringstream tokenStream(line);
		string token1;
		tokenStream >> token1;
		int idx_output_network = it - (total_operands+1);

		if(it == 0)
			PE_trigger_latency = stoul(token1);
		else if(it <= total_operands)
			size_packetArr[it-1] = stoul(token1);
		else if(idx_output_network <= outNetworks)
			size_config_data_collect_write_back[idx_output_network] = stoul(token1);
		it++;
	}
	inFile.close();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x470, %rsp            # imm = 0x470
movq %rsi, -0x408(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movzwl 0x214bab(%rip), %ecx    # 0x61e5ac
movzwl 0x214ba6(%rip), %edx    # 0x61e5ae
movl %ecx, %eax
imull %edx, %eax
addl %ecx, %eax
movl %eax, 0x214bfb(%rip)    # 0x61e610
movzbl 0x214b3a(%rip), %eax    # 0x61e556
movl %eax, %edi
addq %rdi, %rdi
movq %rdi, -0x428(%rbp)
callq 0x425dd0
movq -0x428(%rbp), %rdx
movq %rax, %rdi
movq %rdi, -0x420(%rbp)
xorl %esi, %esi
movl %esi, -0x414(%rbp)
callq 0x401080
movq -0x420(%rbp), %rax
movq %rax, 0x214b8f(%rip)    # 0x61e5e8
movzbl 0x214b84(%rip), %eax    # 0x61e5e4
movl %eax, %edi
addq %rdi, %rdi
movq %rdi, -0x410(%rbp)
callq 0x425dd0
movl -0x414(%rbp), %esi
movq -0x410(%rbp), %rdx
movq %rax, %rdi
movq %rdi, -0x400(%rbp)
callq 0x401080
movq -0x408(%rbp), %rdi
movq -0x400(%rbp), %rax
movq %rax, 0x214b4e(%rip)    # 0x61e5f0
movw $0x0, -0x12(%rbp)
callq 0x4a4170
movq %rax, %rsi
leaq -0x220(%rbp), %rdi
movl $0x8, %edx
callq 0x46e8c0
movq -0x220(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x220(%rbp,%rax), %rdi
callq 0x472d80
movb %al, -0x3f5(%rbp)
jmp 0x409ae1
movb -0x3f5(%rbp), %al
testb $0x1, %al
jne 0x409aed
jmp 0x409b63
movq $0x61f900, %rdi         # imm = 0x61F900
leaq 0x197515(%rip), %rsi    # 0x5a1010
callq 0x492450
movq %rax, -0x430(%rbp)
jmp 0x409b09
movq -0x408(%rbp), %rdi
callq 0x4a4170
movq -0x430(%rbp), %rdi
movq %rax, %rsi
callq 0x492450
movq %rax, -0x438(%rbp)
jmp 0x409b2d
movq -0x438(%rbp), %rdi
movq $0x491d30, %rsi         # imm = 0x491D30
callq 0x490f40
jmp 0x409b42
movl $0x1, %edi
callq 0x4ec1e0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x228(%rbp)
movl %eax, -0x22c(%rbp)
jmp 0x409d91
leaq -0x250(%rbp), %rdi
callq 0x4a2620
leaq -0x220(%rbp), %rdi
leaq -0x250(%rbp), %rsi
callq 0x4a5170
movq %rax, -0x440(%rbp)
jmp 0x409b8b
movq -0x440(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x472d70
movb %al, -0x441(%rbp)
jmp 0x409ba9
movb -0x441(%rbp), %al
testb $0x1, %al
jne 0x409bb8
jmp 0x409d56
leaq -0x3d0(%rbp), %rdi
leaq -0x250(%rbp), %rsi
movl $0x8, %edx
callq 0x49a120
jmp 0x409bd2
leaq -0x3f0(%rbp), %rdi
movq %rdi, -0x450(%rbp)
callq 0x4a2620
movq -0x450(%rbp), %rsi
leaq -0x3d0(%rbp), %rdi
callq 0x4277f0
jmp 0x409bfa
movzwl -0x12(%rbp), %eax
movzbl 0x214951(%rip), %ecx    # 0x61e556
addl $0x1, %ecx
subl %ecx, %eax
movl %eax, -0x3f4(%rbp)
movzwl -0x12(%rbp), %eax
cmpl $0x0, %eax
jne 0x409c90
xorl %eax, %eax
movl %eax, %esi
leaq -0x3f0(%rbp), %rdi
movl $0xa, %edx
callq 0x40f200
movq %rax, -0x458(%rbp)
jmp 0x409c37
movq -0x458(%rbp), %rax
movw %ax, 0x214a93(%rip)     # 0x61e6d8
jmp 0x409d2d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x228(%rbp)
movl %eax, -0x22c(%rbp)
jmp 0x409d85
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x228(%rbp)
movl %eax, -0x22c(%rbp)
leaq -0x3f0(%rbp), %rdi
callq 0x4a2730
leaq -0x3d0(%rbp), %rdi
callq 0x497a10
jmp 0x409d85
movzwl -0x12(%rbp), %eax
movzbl 0x2148bb(%rip), %ecx    # 0x61e556
cmpl %ecx, %eax
jg 0x409cde
xorl %eax, %eax
movl %eax, %esi
leaq -0x3f0(%rbp), %rdi
movl $0xa, %edx
callq 0x40f200
movq %rax, -0x460(%rbp)
jmp 0x409cbd
movq -0x460(%rbp), %rax
movw %ax, %dx
movq 0x21491a(%rip), %rax    # 0x61e5e8
movzwl -0x12(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movw %dx, (%rax,%rcx,2)
jmp 0x409d2b
movl -0x3f4(%rbp), %eax
movzbl 0x2148f9(%rip), %ecx    # 0x61e5e4
cmpl %ecx, %eax
jg 0x409d29
xorl %eax, %eax
movl %eax, %esi
leaq -0x3f0(%rbp), %rdi
movl $0xa, %edx
callq 0x40f200
movq %rax, -0x468(%rbp)
jmp 0x409d0d
movq -0x468(%rbp), %rax
movw %ax, %dx
movq 0x2148d2(%rip), %rax    # 0x61e5f0
movslq -0x3f4(%rbp), %rcx
movw %dx, (%rax,%rcx,2)
jmp 0x409d2b
jmp 0x409d2d
movw -0x12(%rbp), %ax
addw $0x1, %ax
movw %ax, -0x12(%rbp)
leaq -0x3f0(%rbp), %rdi
callq 0x4a2730
leaq -0x3d0(%rbp), %rdi
callq 0x497a10
jmp 0x409b6f
leaq -0x220(%rbp), %rdi
callq 0x46ee70
jmp 0x409d64
leaq -0x250(%rbp), %rdi
callq 0x4a2730
leaq -0x220(%rbp), %rdi
callq 0x46f220
addq $0x470, %rsp            # imm = 0x470
popq %rbp
retq
leaq -0x250(%rbp), %rdi
callq 0x4a2730
leaq -0x220(%rbp), %rdi
callq 0x46f220
movq -0x228(%rbp), %rdi
callq 0x4d0770
nopl (%rax)