// File: MPSLab-ASU[P]DiRAC/./src/baseAccelSim.cc
// Function: baseAccelSim::read_file_kernels(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void baseAccelSim::read_file_kernels(string kernelFileName) {
	string key, value;
	uint16_t it=0;

	ifstream inFile(kernelFileName.c_str());
	if(!inFile)
	{
		cout << "Cannot open and read file: " << kernelFileName.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);
		tokenStream >> key >> value;
		kernels.push_back(value);
		nameOfKernels.push_back(key);
		it++;
	}
	inFile.close();

	assert(kernels.size() > 0 && "No bytes of the kernels in the file ");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x450, %rsp            # imm = 0x450
movq %rsi, -0x418(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x4a2620
leaq -0x50(%rbp), %rdi
callq 0x4a2620
movq -0x418(%rbp), %rdi
movw $0x0, -0x52(%rbp)
callq 0x4a4170
movq %rax, %rsi
leaq -0x260(%rbp), %rdi
movl $0x8, %edx
callq 0x46e8c0
jmp 0x404e94
movq -0x260(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x260(%rbp,%rax), %rdi
callq 0x472d80
movb %al, -0x419(%rbp)
jmp 0x404eb4
movb -0x419(%rbp), %al
testb $0x1, %al
jne 0x404ec3
jmp 0x404f50
movq $0x61f900, %rdi         # imm = 0x61F900
leaq 0x19c13f(%rip), %rsi    # 0x5a1010
callq 0x492450
movq %rax, -0x428(%rbp)
jmp 0x404edf
movq -0x418(%rbp), %rdi
callq 0x4a4170
movq -0x428(%rbp), %rdi
movq %rax, %rsi
callq 0x492450
movq %rax, -0x430(%rbp)
jmp 0x404f03
movq -0x430(%rbp), %rdi
movq $0x491d30, %rsi         # imm = 0x491D30
callq 0x490f40
jmp 0x404f18
movl $0x1, %edi
callq 0x4ec1e0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x268(%rbp)
movl %eax, -0x26c(%rbp)
jmp 0x405129
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x268(%rbp)
movl %eax, -0x26c(%rbp)
jmp 0x40511d
leaq -0x290(%rbp), %rdi
callq 0x4a2620
leaq -0x260(%rbp), %rdi
leaq -0x290(%rbp), %rsi
callq 0x4a5170
movq %rax, -0x438(%rbp)
jmp 0x404f78
movq -0x438(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x472d70
movb %al, -0x439(%rbp)
jmp 0x404f96
movb -0x439(%rbp), %al
testb $0x1, %al
jne 0x404fa5
jmp 0x40507c
movzwl -0x52(%rbp), %eax
cmpl $0x2, %eax
jge 0x404fd3
movw -0x52(%rbp), %ax
addw $0x1, %ax
movw %ax, -0x52(%rbp)
jmp 0x404f5c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x268(%rbp)
movl %eax, -0x26c(%rbp)
jmp 0x405111
leaq -0x410(%rbp), %rdi
leaq -0x290(%rbp), %rsi
movl $0x8, %edx
callq 0x49a120
jmp 0x404fed
leaq -0x410(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x4277f0
movq %rax, -0x448(%rbp)
jmp 0x405006
movq -0x448(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x4277f0
jmp 0x405018
leaq 0x219571(%rip), %rdi    # 0x61e590
leaq -0x50(%rbp), %rsi
callq 0x40ecb0
jmp 0x40502a
leaq 0x219547(%rip), %rdi    # 0x61e578
leaq -0x30(%rbp), %rsi
callq 0x40ecb0
jmp 0x40503c
movw -0x52(%rbp), %ax
addw $0x1, %ax
movw %ax, -0x52(%rbp)
leaq -0x410(%rbp), %rdi
callq 0x497a10
jmp 0x404f5c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x268(%rbp)
movl %eax, -0x26c(%rbp)
leaq -0x410(%rbp), %rdi
callq 0x497a10
jmp 0x405111
leaq -0x260(%rbp), %rdi
callq 0x46ee70
jmp 0x40508a
leaq 0x2194ff(%rip), %rdi    # 0x61e590
callq 0x40ed20
movq %rax, %rcx
xorl %eax, %eax
cmpq $0x0, %rcx
movb %al, -0x449(%rbp)
jbe 0x4050b1
movb $0x1, %al
movb %al, -0x449(%rbp)
jmp 0x4050b1
movb -0x449(%rbp), %al
testb $0x1, %al
jne 0x4050bd
jmp 0x4050bf
jmp 0x4050de
leaq 0x19bf8b(%rip), %rdi    # 0x5a1051
leaq 0x19bfc1(%rip), %rsi    # 0x5a108e
movl $0x35, %edx
leaq 0x19bfcb(%rip), %rcx    # 0x5a10a4
callq 0x4e53d0
leaq -0x290(%rbp), %rdi
callq 0x4a2730
leaq -0x260(%rbp), %rdi
callq 0x46f220
leaq -0x50(%rbp), %rdi
callq 0x4a2730
leaq -0x30(%rbp), %rdi
callq 0x4a2730
addq $0x450, %rsp            # imm = 0x450
popq %rbp
retq
leaq -0x290(%rbp), %rdi
callq 0x4a2730
leaq -0x260(%rbp), %rdi
callq 0x46f220
leaq -0x50(%rbp), %rdi
callq 0x4a2730
leaq -0x30(%rbp), %rdi
callq 0x4a2730
movq -0x268(%rbp), %rdi
callq 0x4d0770
nopw (%rax,%rax)