// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x3d8, %rsp            # imm = 0x3D8
movq %rsi, %r14
movzwl 0x201f33(%rip), %eax    # 0x60b5ac
movzwl 0x201f2e(%rip), %ecx    # 0x60b5ae
incl %ecx
imull %eax, %ecx
movl %ecx, 0x201f85(%rip)    # 0x60b610
movzbl 0x201ec4(%rip), %ebx    # 0x60b556
addl %ebx, %ebx
movq %rbx, %rdi
callq 0x4181e0
movq %rax, %r15
movq %rax, %rdi
xorl %esi, %esi
movq %rbx, %rdx
callq 0x401088
movq %r15, 0x201f35(%rip)    # 0x60b5e8
movzbl 0x201f2a(%rip), %ebx    # 0x60b5e4
addl %ebx, %ebx
movq %rbx, %rdi
callq 0x4181e0
movq %rax, %r15
movq %rax, %rdi
xorl %esi, %esi
movq %rbx, %rdx
callq 0x401088
movq %r15, 0x201f15(%rip)    # 0x60b5f0
movq (%r14), %rsi
leaq 0x1d0(%rsp), %rbx
movq %rbx, %rdi
movl $0x8, %edx
callq 0x460c10
movq (%rbx), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x1f0(%rsp,%rax)
jne 0x4099c9
leaq 0x40(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x20(%rsp), %r12
xorl %ebp, %ebp
leaq 0x30(%rsp), %r14
leaq 0x50(%rsp), %r13
movq 0x1d0(%rsp), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x4653c0
movsbl %al, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x419ec0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x409939
movq %r13, %rdi
movq %r14, %rsi
movl $0x8, %edx
callq 0x48c470
movq %r12, 0x10(%rsp)
movq $0x0, 0x18(%rsp)
movb $0x0, 0x20(%rsp)
movq %r13, %rdi
leaq 0x10(%rsp), %rsi
callq 0x419b40
testw %bp, %bp
je 0x40981f
movzwl %bp, %r12d
movzbl 0x201dab(%rip), %r15d   # 0x60b556
cmpl %r15d, %r12d
jbe 0x409867
notl %r15d
addl %r12d, %r15d
movzbl 0x201e23(%rip), %eax    # 0x60b5e4
cmpl %eax, %r15d
leaq 0x20(%rsp), %r12
jg 0x4098ff
movq 0x10(%rsp), %r13
callq 0x4c7aa0
movq %rax, %r14
movl (%rax), %ebx
movl $0x0, (%rax)
movq %r13, %rdi
leaq 0x8(%rsp), %rsi
movl $0xa, %edx
callq 0x4de720
cmpq %r13, 0x8(%rsp)
je 0x4099b1
movl (%r14), %ecx
testl %ecx, %ecx
je 0x4098dc
cmpl $0x22, %ecx
leaq 0x50(%rsp), %r13
jne 0x4098e4
jmp 0x4099bd
movq 0x10(%rsp), %r13
callq 0x4c7aa0
movq %rax, %r14
movl (%rax), %ebx
movl $0x0, (%rax)
movq %r13, %rdi
leaq 0x8(%rsp), %rsi
movl $0xa, %edx
callq 0x4de720
cmpq %r13, 0x8(%rsp)
je 0x409981
movl (%r14), %ecx
testl %ecx, %ecx
je 0x4098af
cmpl $0x22, %ecx
leaq 0x50(%rsp), %r13
jne 0x4098b7
jmp 0x409999
movq 0x10(%rsp), %r13
callq 0x4c7aa0
movq %rax, %r14
movl (%rax), %ebx
movl $0x0, (%rax)
movq %r13, %rdi
leaq 0x8(%rsp), %rsi
movl $0xa, %edx
callq 0x4de720
cmpq %r13, 0x8(%rsp)
je 0x40998d
movl (%r14), %ecx
testl %ecx, %ecx
je 0x4098c0
cmpl $0x22, %ecx
leaq 0x50(%rsp), %r13
jne 0x4098c8
jmp 0x4099a5
movl %ebx, (%r14)
leaq 0x50(%rsp), %r13
movw %ax, 0x201e1a(%rip)     # 0x60b6d8
jmp 0x4098f2
movl %ebx, (%r14)
leaq 0x50(%rsp), %r13
movq 0x201d19(%rip), %rcx    # 0x60b5e8
movw %ax, -0x2(%rcx,%r12,2)
leaq 0x20(%rsp), %r12
jmp 0x4098f2
movl %ebx, (%r14)
leaq 0x50(%rsp), %r13
movq 0x201d05(%rip), %rcx    # 0x60b5f0
movslq %r15d, %rdx
movw %ax, (%rcx,%rdx,2)
leaq 0x1d0(%rsp), %rbx
leaq 0x30(%rsp), %r14
movq 0x10(%rsp), %rdi
cmpq %r12, %rdi
je 0x409916
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x416ca0
movq %r13, %rdi
movq $0x606328, %rsi         # imm = 0x606328
callq 0x48c720
leaq 0xc8(%rsp), %rdi
callq 0x4667e0
incl %ebp
jmp 0x40972d
leaq 0x1d0(%rsp), %rdi
callq 0x4611c0
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x409962
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x416ca0
leaq 0x1d0(%rsp), %rdi
callq 0x461570
addq $0x3d8, %rsp            # imm = 0x3D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x18c043(%rip), %rdi    # 0x5959cb
callq 0x402b8d
leaq 0x18c037(%rip), %rdi    # 0x5959cb
callq 0x402b8d
leaq 0x18c02b(%rip), %rdi    # 0x5959cb
callq 0x402c3d
leaq 0x18c01f(%rip), %rdi    # 0x5959cb
callq 0x402c3d
leaq 0x18c013(%rip), %rdi    # 0x5959cb
callq 0x402b8d
leaq 0x18c007(%rip), %rdi    # 0x5959cb
callq 0x402c3d
movq $0x60c900, %rdi         # imm = 0x60C900
leaq 0x18a649(%rip), %rsi    # 0x594020
movl $0x1b, %edx
callq 0x484270
movq (%r14), %rsi
movq $0x60c900, %rdi         # imm = 0x60C900
callq 0x4847a0
movq %rax, %rdi
callq 0x484080
movl $0x1, %edi
callq 0x4de3d0
movq %rax, %r15
jmp 0x409a7b
jmp 0x409a5c
jmp 0x409a0d
jmp 0x409a0d
movq %rax, %r15
cmpl $0x0, (%r14)
jne 0x409a20
movl %ebx, (%r14)
jmp 0x409a20
jmp 0x409a5c
movq %rax, %r15
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x409a3c
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x416ca0
movq $0x606328, %rsi         # imm = 0x606328
leaq 0x50(%rsp), %rdi
callq 0x48c720
leaq 0xc8(%rsp), %rdi
callq 0x4667e0
jmp 0x409a5f
movq %rax, %r15
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x409a7b
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x416ca0
leaq 0x1d0(%rsp), %rdi
callq 0x461570
movq %r15, %rdi
callq 0x4c2960