// File: /workspace/github_cpp_makefile_star2_O3/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, %rbx
movzwl 0x201eff(%rip), %eax    # 0x60b5ac
movzwl 0x201efa(%rip), %ecx    # 0x60b5ae
incl %ecx
imull %eax, %ecx
movl %ecx, 0x201f51(%rip)    # 0x60b610
movzbl 0x201e8f(%rip), %r14d   # 0x60b556
addl %r14d, %r14d
movq %r14, %rdi
callq 0x418d20
movq %rax, %r15
movq %rax, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x401088
movq %r15, 0x201eff(%rip)    # 0x60b5e8
movzbl 0x201ef3(%rip), %r14d   # 0x60b5e4
addl %r14d, %r14d
movq %r14, %rdi
callq 0x418d20
movq %rax, %r15
movq %rax, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x401088
movq %r15, 0x201edd(%rip)    # 0x60b5f0
movq (%rbx), %rsi
leaq 0x1d0(%rsp), %r14
movq %r14, %rdi
movl $0x8, %edx
callq 0x461750
movq (%r14), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x1f0(%rsp,%rax)
jne 0x4099ec
leaq 0x40(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq $0x0, -0x8(%rcx)
movb $0x0, (%rcx)
leaq 0x20(%rsp), %r12
xorl %r14d, %r14d
leaq 0x30(%rsp), %rbx
leaq 0x50(%rsp), %r13
leaq (%rsp,%rax), %rdi
addq $0x1d0, %rdi            # imm = 0x1D0
movl $0xa, %esi
callq 0x465f00
movsbl %al, %edx
leaq 0x1d0(%rsp), %rdi
movq %rbx, %rsi
callq 0x41aa00
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x40995c
movq %r13, %rdi
movq %rbx, %rsi
movl $0x8, %edx
callq 0x48cfb0
movq %r12, 0x10(%rsp)
movq $0x0, 0x18(%rsp)
movb $0x0, 0x20(%rsp)
movq %r13, %rdi
leaq 0x10(%rsp), %rsi
callq 0x41a680
testw %r14w, %r14w
je 0x409851
movzwl %r14w, %r12d
movzbl 0x201d74(%rip), %r15d   # 0x60b556
cmpl %r15d, %r12d
jbe 0x409894
notl %r15d
addl %r12d, %r15d
movzbl 0x201dec(%rip), %eax    # 0x60b5e4
cmpl %eax, %r15d
leaq 0x20(%rsp), %r12
jg 0x409915
movq 0x10(%rsp), %r13
callq 0x4c85e0
movq %rax, %rbp
movl (%rax), %ebx
movl $0x0, (%rax)
movq %r13, %rdi
leaq 0x8(%rsp), %rsi
movl $0xa, %edx
callq 0x4df260
cmpq %r13, 0x8(%rsp)
je 0x4099d4
movl (%rbp), %ecx
testl %ecx, %ecx
je 0x4098fa
cmpl $0x22, %ecx
jne 0x4098fd
jmp 0x4099e0
movq 0x10(%rsp), %r13
callq 0x4c85e0
movq %rax, %rbp
movl (%rax), %ebx
movl $0x0, (%rax)
movq %r13, %rdi
leaq 0x8(%rsp), %rsi
movl $0xa, %edx
callq 0x4df260
cmpq %r13, 0x8(%rsp)
je 0x4099a4
movl (%rbp), %ecx
testl %ecx, %ecx
je 0x4098d7
cmpl $0x22, %ecx
jne 0x4098da
jmp 0x4099bc
movq 0x10(%rsp), %r13
callq 0x4c85e0
movq %rax, %rbp
movl (%rax), %ebx
movl $0x0, (%rax)
movq %r13, %rdi
leaq 0x8(%rsp), %rsi
movl $0xa, %edx
callq 0x4df260
cmpq %r13, 0x8(%rsp)
je 0x4099b0
movl (%rbp), %ecx
testl %ecx, %ecx
je 0x4098e3
cmpl $0x22, %ecx
jne 0x4098e6
jmp 0x4099c8
movl %ebx, (%rbp)
movw %ax, 0x201df7(%rip)     # 0x60b6d8
jmp 0x40990b
movl %ebx, (%rbp)
movq 0x201cfb(%rip), %rcx    # 0x60b5e8
movw %ax, -0x2(%rcx,%r12,2)
leaq 0x20(%rsp), %r12
jmp 0x40990b
movl %ebx, (%rbp)
movq 0x201cec(%rip), %rcx    # 0x60b5f0
movslq %r15d, %rdx
movw %ax, (%rcx,%rdx,2)
leaq 0x30(%rsp), %rbx
leaq 0x50(%rsp), %r13
movq 0x10(%rsp), %rdi
cmpq %r12, %rdi
je 0x40992c
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x4177e0
movq %r13, %rdi
movq $0x606328, %rsi         # imm = 0x606328
callq 0x48d260
leaq 0xc8(%rsp), %rdi
callq 0x467320
movq 0x1d0(%rsp), %rax
movq -0x18(%rax), %rax
incl %r14d
jmp 0x409766
leaq 0x1d0(%rsp), %rdi
callq 0x461d00
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x409985
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x4177e0
leaq 0x1d0(%rsp), %rdi
callq 0x4620b0
addq $0x3d8, %rsp            # imm = 0x3D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x18c020(%rip), %rdi    # 0x5959cb
callq 0x402b51
leaq 0x18c014(%rip), %rdi    # 0x5959cb
callq 0x402b51
leaq 0x18c008(%rip), %rdi    # 0x5959cb
callq 0x402c01
leaq 0x18bffc(%rip), %rdi    # 0x5959cb
callq 0x402c01
leaq 0x18bff0(%rip), %rdi    # 0x5959cb
callq 0x402b51
leaq 0x18bfe4(%rip), %rdi    # 0x5959cb
callq 0x402c01
movq $0x60c900, %rdi         # imm = 0x60C900
leaq 0x18a626(%rip), %rsi    # 0x594020
movl $0x1b, %edx
callq 0x484db0
movq (%rbx), %rsi
movq $0x60c900, %rdi         # imm = 0x60C900
callq 0x4852e0
movq %rax, %rdi
callq 0x484bc0
movl $0x1, %edi
callq 0x4def10
movq %rax, %r14
jmp 0x409a9e
jmp 0x409a7f
jmp 0x409a30
jmp 0x409a30
movq %rax, %r14
cmpl $0x0, (%rbp)
jne 0x409a43
movl %ebx, (%rbp)
jmp 0x409a43
jmp 0x409a7f
movq %rax, %r14
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x409a5f
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x4177e0
movq $0x606328, %rsi         # imm = 0x606328
leaq 0x50(%rsp), %rdi
callq 0x48d260
leaq 0xc8(%rsp), %rdi
callq 0x467320
jmp 0x409a82
movq %rax, %r14
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x409a9e
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x4177e0
leaq 0x1d0(%rsp), %rdi
callq 0x4620b0
movq %r14, %rdi
callq 0x4c34a0
nop