// File: /workspace/github_cpp_makefile_star2_O2/MPSLab-ASU[P]DiRAC/./src/baseAccelSim.cc
// Function: baseAccelSim::read_file_config_trigger_PEs(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void baseAccelSim::read_file_config_trigger_PEs(string configTriggerPEsFileName)
{
	trigger_exec_pass_PEs_exec				= new bool*[SPM_passes + WB_delay_SPM_pass];
	trigger_exec_pass_zero_init				= new bool*[SPM_passes + WB_delay_SPM_pass];
	trigger_exec_pass_writeback				= new bool*[SPM_passes + WB_delay_SPM_pass];
	trigger_exec_pass_spatial_reduce	= new bool*[SPM_passes + WB_delay_SPM_pass];

	trigger_exec_pass_update_buf_num_Op1	= new bool*[SPM_passes + WB_delay_SPM_pass];
	trigger_exec_pass_update_buf_num_Op2	= new bool*[SPM_passes + WB_delay_SPM_pass];
	trigger_exec_pass_update_buf_num_Op3	= new bool*[SPM_passes + WB_delay_SPM_pass];

	for(uint8_t it=0; it < RF_passes + WB_delay_RF_pass; it++)
	{
		trigger_exec_pass_PEs_exec[it]				= new bool[RF_passes + WB_delay_RF_pass]();
		trigger_exec_pass_zero_init[it]				= new bool[RF_passes + WB_delay_RF_pass]();
		trigger_exec_pass_writeback[it]				= new bool[RF_passes + WB_delay_RF_pass]();
		trigger_exec_pass_spatial_reduce[it]	= new bool[RF_passes + WB_delay_RF_pass]();
		trigger_exec_pass_update_buf_num_Op1[it]	= new bool[RF_passes + WB_delay_RF_pass]();
		trigger_exec_pass_update_buf_num_Op2[it]	= new bool[RF_passes + WB_delay_RF_pass]();
		trigger_exec_pass_update_buf_num_Op3[it]	= new bool[RF_passes + WB_delay_RF_pass]();
	}

	uint16_t RF_pass_number, SPM_pass_number;
	bool PEs_exec, zero_init, write_back, spatial_reduce;
	bool update_buf_num_Op1, update_buf_num_Op2, update_buf_num_Op3;
	uint16_t it=0;
	ifstream inFile(configTriggerPEsFileName.c_str());

	if(!inFile)
	{
		cout << "Cannot open and read file: " << configTriggerPEsFileName.c_str() << endl;
		exit (EXIT_FAILURE);
	}

	string line;
 	while (getline(inFile, line)) {
		// skip reading first two lines of the file
		if(it < 2) {
			it++; continue;
		}
		istringstream tokenStream(line);
		string token1, token2, token3, token4, token5, token6, token7, token8, token9;
		tokenStream >> token1 >> token2 >> token3 >> token4 >> token5 >> token6
			>> token7 >> token8 >> token9;

		SPM_pass_number = stoul(token1);
		RF_pass_number	= stoul(token2);
		PEs_exec				= stoul(token3);
		zero_init 			= stoul(token4);
		write_back 			= stoul(token5);
		spatial_reduce	= stoul(token6);
		update_buf_num_Op1 = stoul(token7);
		update_buf_num_Op2 = stoul(token8);
		update_buf_num_Op3 = stoul(token9);

		assert((SPM_pass_number >= 1 && SPM_pass_number < (SPM_passes+1)) && "invalid number for an SPM pass!");
		assert((RF_pass_number >= 1 && RF_pass_number <= (RF_passes+1)) && "invalid number for an RF pass!");

		trigger_exec_pass_PEs_exec[SPM_pass_number][RF_pass_number] = PEs_exec;
		trigger_exec_pass_zero_init[SPM_pass_number][RF_pass_number] = zero_init;
		trigger_exec_pass_writeback[SPM_pass_number][RF_pass_number] 	= write_back;
		trigger_exec_pass_spatial_reduce[SPM_pass_number][RF_pass_number] = spatial_reduce;
		trigger_exec_pass_update_buf_num_Op1[SPM_pass_number][RF_pass_number] = update_buf_num_Op1;
		trigger_exec_pass_update_buf_num_Op2[SPM_pass_number][RF_pass_number] = update_buf_num_Op2;
		trigger_exec_pass_update_buf_num_Op3[SPM_pass_number][RF_pass_number] = update_buf_num_Op3;
		it++;
	}
	inFile.close();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x4d8, %rsp            # imm = 0x4D8
movq %rsi, %rbx
movzwl 0x1ff5cd(%rip), %eax    # 0x608554
leaq 0x10(,%rax,8), %r14
movq %r14, %rdi
callq 0x414190
movq %rax, 0x1ff742(%rip)    # 0x6086e0
movq %r14, %rdi
callq 0x414190
movq %rax, 0x1ff73b(%rip)    # 0x6086e8
movq %r14, %rdi
callq 0x414190
movq %rax, 0x1ff734(%rip)    # 0x6086f0
movq %r14, %rdi
callq 0x414190
movq %rax, 0x1ff72d(%rip)    # 0x6086f8
movq %r14, %rdi
callq 0x414190
movq %rax, 0x1ff726(%rip)    # 0x608700
movq %r14, %rdi
callq 0x414190
movq %rax, 0x1ff71f(%rip)    # 0x608708
movq %r14, %rdi
callq 0x414190
movq %rax, 0x1ff718(%rip)    # 0x608710
movzwl 0x1ff552(%rip), %r14d   # 0x608552
addq $0x2, %r14
xorl %r12d, %r12d
movzbl %r12b, %r12d
cmpl %r12d, %r14d
jbe 0x409119
movq %r14, %rdi
callq 0x414190
movq %rax, %r15
movq %rax, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x401080
movq 0x1ff6ad(%rip), %rax    # 0x6086e0
leal (,%r12,8), %r13d
movq %r15, (%rax,%r13)
movq %r14, %rdi
callq 0x414190
movq %rax, %r15
movq %rax, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x401080
movq 0x1ff68a(%rip), %rax    # 0x6086e8
movq %r15, (%rax,%r13)
movq %r14, %rdi
callq 0x414190
movq %rax, %r15
movq %rax, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x401080
movq 0x1ff66f(%rip), %rax    # 0x6086f0
movq %r15, (%rax,%r13)
movq %r14, %rdi
callq 0x414190
movq %rax, %r15
movq %rax, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x401080
movq 0x1ff654(%rip), %rax    # 0x6086f8
movq %r15, (%rax,%r13)
movq %r14, %rdi
callq 0x414190
movq %rax, %r15
movq %rax, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x401080
movq 0x1ff639(%rip), %rax    # 0x608700
movq %r15, (%rax,%r13)
movq %r14, %rdi
callq 0x414190
movq %rax, %r15
movq %rax, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x401080
movq 0x1ff61e(%rip), %rax    # 0x608708
movq %r15, (%rax,%r13)
movq %r14, %rdi
callq 0x414190
movq %rax, %r15
movq %rax, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x401080
movq 0x1ff603(%rip), %rax    # 0x608710
movq %r15, (%rax,%r13)
incb %r12b
jmp 0x409007
movq (%rbx), %rsi
leaq 0x150(%rsp), %r14
pushq $0x8
popq %rdx
movq %r14, %rdi
callq 0x45cbc0
movq (%r14), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x170(%rsp,%rax)
jne 0x4095b0
leaq 0x140(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x150(%rsp), %rbx
leaq 0x130(%rsp), %r14
leaq 0x358(%rsp), %r15
xorl %ebp, %ebp
movq %rbx, %rdi
movq %r14, %rsi
callq 0x493470
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x409539
cmpw $0x1, %bp
jbe 0x409532
movl %ebp, 0xc(%rsp)
movq %r15, %rdi
movq %r14, %rsi
pushq $0x8
popq %rdx
callq 0x488420
leaq 0x120(%rsp), %rax
movq %rax, 0x110(%rsp)
andq $0x0, 0x118(%rsp)
xorl %ecx, %ecx
movb %cl, 0x120(%rsp)
leaq 0x100(%rsp), %rax
movq %rax, 0xf0(%rsp)
andq $0x0, 0xf8(%rsp)
leaq 0xe0(%rsp), %rax
movq %rax, 0xd0(%rsp)
andq $0x0, 0xd8(%rsp)
leaq 0xc0(%rsp), %rax
movq %rax, 0xb0(%rsp)
andq $0x0, 0xb8(%rsp)
movb %cl, 0x100(%rsp)
movb %cl, 0xe0(%rsp)
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 %r15, %rdi
leaq 0x110(%rsp), %rsi
callq 0x415af0
movq %rax, %rdi
leaq 0xf0(%rsp), %rsi
callq 0x415af0
movq %rax, %rdi
leaq 0xd0(%rsp), %rsi
callq 0x415af0
movq %rax, %rdi
leaq 0xb0(%rsp), %rsi
callq 0x415af0
movq %rax, %rdi
leaq 0x90(%rsp), %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
leaq 0x110(%rsp), %rdi
xorl %esi, %esi
pushq $0xa
popq %rdx
callq 0x40a485
movq %rax, %r12
leaq 0xf0(%rsp), %rdi
xorl %esi, %esi
pushq $0xa
popq %rdx
callq 0x40a485
movq %rax, %r14
leaq 0xd0(%rsp), %rdi
xorl %esi, %esi
pushq $0xa
popq %rdx
callq 0x40a485
testq %rax, %rax
setne 0xb(%rsp)
leaq 0xb0(%rsp), %rdi
xorl %esi, %esi
pushq $0xa
popq %rdx
callq 0x40a485
testq %rax, %rax
setne 0xa(%rsp)
leaq 0x90(%rsp), %rdi
xorl %esi, %esi
pushq $0xa
popq %rdx
callq 0x40a485
testq %rax, %rax
setne %r15b
leaq 0x70(%rsp), %rdi
xorl %esi, %esi
pushq $0xa
popq %rdx
callq 0x40a485
testq %rax, %rax
setne %bpl
leaq 0x50(%rsp), %rdi
xorl %esi, %esi
pushq $0xa
popq %rdx
callq 0x40a485
testq %rax, %rax
setne %bl
leaq 0x30(%rsp), %rdi
xorl %esi, %esi
pushq $0xa
popq %rdx
callq 0x40a485
testq %rax, %rax
setne %r13b
leaq 0x10(%rsp), %rdi
xorl %esi, %esi
pushq $0xa
popq %rdx
callq 0x40a485
testq %rax, %rax
setne %al
movzwl %r12w, %ecx
movzwl 0x1ff155(%rip), %edx    # 0x608554
decl %ecx
cmpl %edx, %ecx
jae 0x409591
movl %r14d, %ecx
andl $0xffff, %ecx           # imm = 0xFFFF
je 0x409572
movzwl 0x1ff133(%rip), %edx    # 0x608552
incl %edx
cmpl %edx, %ecx
ja 0x409572
movq 0x1ff2b0(%rip), %rcx    # 0x6086e0
movzwl %r12w, %edx
shll $0x3, %edx
movq (%rcx,%rdx), %rcx
movzwl %r14w, %esi
movb 0xb(%rsp), %dil
movb %dil, (%rcx,%rsi)
movq 0x1ff299(%rip), %rcx    # 0x6086e8
movq (%rcx,%rdx), %rcx
movb 0xa(%rsp), %dil
movb %dil, (%rcx,%rsi)
movq 0x1ff28d(%rip), %rcx    # 0x6086f0
movq (%rcx,%rdx), %rcx
movb %r15b, (%rcx,%rsi)
movq 0x1ff286(%rip), %rcx    # 0x6086f8
movq (%rcx,%rdx), %rcx
movb %bpl, (%rcx,%rsi)
movq 0x1ff27f(%rip), %rcx    # 0x608700
movq (%rcx,%rdx), %rcx
movb %bl, (%rcx,%rsi)
movq 0x1ff279(%rip), %rcx    # 0x608708
movq (%rcx,%rdx), %rcx
movb %r13b, (%rcx,%rsi)
movq 0x1ff272(%rip), %rcx    # 0x608710
movq (%rcx,%rdx), %rcx
movb %al, (%rcx,%rsi)
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 0xd0(%rsp), %rdi
callq 0x490a30
leaq 0xf0(%rsp), %rdi
callq 0x490a30
leaq 0x110(%rsp), %rdi
callq 0x490a30
leaq 0x358(%rsp), %r15
movq %r15, %rdi
callq 0x485d10
leaq 0x150(%rsp), %rbx
leaq 0x130(%rsp), %r14
movl 0xc(%rsp), %ebp
incl %ebp
jmp 0x409172
leaq 0x150(%rsp), %rdi
callq 0x45d170
leaq 0x130(%rsp), %rdi
callq 0x490a30
leaq 0x150(%rsp), %rdi
callq 0x45d520
addq $0x4d8, %rsp            # imm = 0x4D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1883d3(%rip), %rdi    # 0x59194c
leaq 0x186af9(%rip), %rsi    # 0x590079
leaq 0x18838d(%rip), %rcx    # 0x591914
movl $0x340, %edx            # imm = 0x340
callq 0x4d36d0
leaq 0x18831c(%rip), %rdi    # 0x5918b4
leaq 0x186ada(%rip), %rsi    # 0x590079
leaq 0x18836e(%rip), %rcx    # 0x591914
movl $0x33f, %edx            # imm = 0x33F
callq 0x4d36d0
movq $0x609900, %rdi         # imm = 0x609900
leaq 0x186a62(%rip), %rsi    # 0x590020
callq 0x480750
movq (%rbx), %rsi
movq %rax, %rdi
callq 0x480750
movq %rax, %rdi
callq 0x480030
pushq $0x1
popq %rdi
callq 0x4da4e0
movq %rax, %rbx
jmp 0x409675
jmp 0x4095ea
jmp 0x4095ea
movq %rax, %rbx
jmp 0x409668
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 0xd0(%rsp), %rdi
callq 0x490a30
leaq 0xf0(%rsp), %rdi
callq 0x490a30
leaq 0x110(%rsp), %rdi
callq 0x490a30
leaq 0x358(%rsp), %rdi
callq 0x485d10
leaq 0x130(%rsp), %rdi
callq 0x490a30
leaq 0x150(%rsp), %rdi
callq 0x45d520
movq %rbx, %rdi
callq 0x4bea70