// File: /workspace/github_cpp_makefile_star2_O2/JoshCplusplus[P]Chemistry-Atom-Simulator-/main.cc
// Function: main
int main(){
	system("clear");
	for(int i = 0; i < y_size*x_size; i++){
		board[i] = "*";
	}
	//	print_board();
	cout << "Welcome to Chemistry Simulation, Enter your choice: " << endl;
	int choice;
	while(true){
		cout << "1)Simulate atoms" << endl;
		cout << "2)Check list of available atoms/molecules" << endl;
		cout << "3)Quit" << endl;
		cin >> choice;
		if(choice == 1){
			string name1, name2;
			bool check;
			molecule mol_check;
			while(cin){
				while(cin){
					cout << "Enter Atom 1: ";
					cin >> name1;
					for(auto& c: name1) c = toupper(c);
					if(name1 == "Q") die();
					if(name1.size() == 1) check = check_atom(name1);
					else check = check_mol(name1);
					if(check) break;
					else cout << "Invalid Atom/Molecule" << endl;
				}
				while(cin){
					cout << "Enter Atom2: ";
					cin >> name2;
					for(auto & c: name2) c = toupper(c);
					if(name2 == "Q") die();
					if(name2.size() == 1) check = check_atom(name2);
					else check = check_mol(name2);
					if(check) break;
					else cout << "Invalid Atom/Moleculue" << endl;
				}
				mol_check = find_mol(name1,name2);
				if(mol_check.get_name() == "BAD"){
					cout << "Bad pair of atoms/molecules" << endl;
				}
				else break;
			}
			sim_board(name1, name2,mol_check);

		}
		else if(choice ==2){
			//print list of available atoms/moleculues	
			print_atoms();
		}
		else if(choice == 3){
			die();
		}
	}
	/*	for(int i = 0; i <y_size; i++){
		for(int j =0; j < x_size; j++){
		cout << board[i][j];
		}
		cout << endl;
		}*/
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2e8, %rsp            # imm = 0x2E8
leaq 0x294a(%rip), %rdi      # 0x611b
callq 0x2120
xorl %r14d, %r14d
leaq 0x5e50(%rip), %r15      # 0x9630
leaq 0x2977(%rip), %rbx      # 0x615e
cmpq $0x3a20, %r14           # imm = 0x3A20
je 0x3802
leaq (%r15,%r14), %rdi
movq %rbx, %rsi
callq 0x2250
addq $0x20, %r14
jmp 0x37e7
movq 0x57c7(%rip), %rdi      # 0x8fd0
leaq 0x2972(%rip), %rsi      # 0x6182
callq 0x2160
movq %rax, %rdi
callq 0x20b0
movq 0x57bc(%rip), %r13      # 0x8fe0
leaq -0x90(%rbp), %r12
movq 0x579e(%rip), %rbx      # 0x8fd0
movq %rbx, %rdi
leaq 0x297b(%rip), %rsi      # 0x61b7
callq 0x2160
movq %rax, %rdi
callq 0x20b0
movq %rbx, %rdi
leaq 0x2975(%rip), %rsi      # 0x61c8
callq 0x2160
movq %rax, %rdi
callq 0x20b0
movq %rbx, %rdi
leaq 0x2988(%rip), %rsi      # 0x61f2
callq 0x2160
movq %rax, %rdi
callq 0x20b0
movq %r13, %rdi
leaq -0x2c(%rbp), %rsi
callq 0x20f0
movl -0x2c(%rbp), %eax
cmpl $0x1, %eax
je 0x38a1
cmpl $0x2, %eax
je 0x389a
cmpl $0x3, %eax
jne 0x382b
jmp 0x3bf2
callq 0x31a6
jmp 0x382b
leaq -0x60(%rbp), %rax
movq %rax, -0x70(%rbp)
andq $0x0, -0x68(%rbp)
xorl %ecx, %ecx
movb %cl, -0x60(%rbp)
leaq -0x40(%rbp), %rax
movq %rax, -0x50(%rbp)
andq $0x0, -0x48(%rbp)
movb %cl, -0x40(%rbp)
leaq -0x1f8(%rbp), %rdi
callq 0x3e90
movq (%r13), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x20(%r13,%rax)
jne 0x3b60
movq (%r13), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x20(%r13,%rax)
jne 0x39e9
movq 0x56d2(%rip), %rdi      # 0x8fd0
leaq 0x28f4(%rip), %rsi      # 0x61f9
callq 0x2160
movq %r13, %rdi
leaq -0x70(%rbp), %rsi
callq 0x21a0
movq -0x70(%rbp), %r15
movq -0x68(%rbp), %r14
xorl %r12d, %r12d
cmpq %r12, %r14
je 0x3939
movsbl (%r15,%r12), %edi
callq 0x2240
movb %al, (%r15,%r12)
incq %r12
jmp 0x3921
leaq -0x70(%rbp), %rdi
leaq 0x28c4(%rip), %rsi      # 0x6208
callq 0x4010
testb %al, %al
jne 0x3bed
cmpq $0x1, -0x68(%rbp)
jne 0x397c
leaq -0x170(%rbp), %r14
movq %r14, %rdi
leaq -0x70(%rbp), %rsi
callq 0x21d0
leaq -0x90(%rbp), %r12
movq %r14, %rdi
callq 0x35a6
jmp 0x399e
leaq -0x150(%rbp), %r14
movq %r14, %rdi
leaq -0x70(%rbp), %rsi
callq 0x21d0
leaq -0x90(%rbp), %r12
movq %r14, %rdi
callq 0x351d
movl %eax, %r15d
movq %r14, %rdi
callq 0x20a0
testb %r15b, %r15b
jne 0x39e9
movq 0x561b(%rip), %rdi      # 0x8fd0
leaq 0x284e(%rip), %rsi      # 0x620a
callq 0x2160
movq %rax, %rdi
callq 0x20b0
jmp 0x38e3
movq 0x55fb(%rip), %rdi      # 0x8fd0
leaq 0x2852(%rip), %rsi      # 0x622e
callq 0x2160
movq %rax, %rdi
callq 0x20b0
movq (%r13), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x20(%r13,%rax)
jne 0x3ab8
movq 0x55cc(%rip), %rdi      # 0x8fd0
leaq 0x2815(%rip), %rsi      # 0x6220
callq 0x2160
movq %r13, %rdi
leaq -0x50(%rbp), %rsi
callq 0x21a0
movq -0x50(%rbp), %r15
movq -0x48(%rbp), %r14
xorl %r12d, %r12d
cmpq %r12, %r14
je 0x3a3f
movsbl (%r15,%r12), %edi
callq 0x2240
movb %al, (%r15,%r12)
incq %r12
jmp 0x3a27
leaq -0x50(%rbp), %rdi
leaq 0x27be(%rip), %rsi      # 0x6208
callq 0x4010
testb %al, %al
jne 0x3bed
cmpq $0x1, -0x48(%rbp)
jne 0x3a82
leaq -0x130(%rbp), %r14
movq %r14, %rdi
leaq -0x50(%rbp), %rsi
callq 0x21d0
leaq -0x90(%rbp), %r12
movq %r14, %rdi
callq 0x35a6
jmp 0x3aa4
leaq -0x110(%rbp), %r14
movq %r14, %rdi
leaq -0x50(%rbp), %rsi
callq 0x21d0
leaq -0x90(%rbp), %r12
movq %r14, %rdi
callq 0x351d
movl %eax, %r15d
movq %r14, %rdi
callq 0x20a0
testb %r15b, %r15b
je 0x39ce
movq %r12, %rdi
leaq -0x70(%rbp), %rsi
callq 0x21d0
leaq -0xf0(%rbp), %r15
movq %r15, %rdi
leaq -0x50(%rbp), %rsi
callq 0x21d0
leaq -0x308(%rbp), %rbx
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x3426
leaq -0x1f8(%rbp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4020
movq %rbx, %rdi
callq 0x3d98
movq %r15, %rdi
callq 0x20a0
movq %r12, %rdi
callq 0x20a0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x21d0
movq %rbx, %rdi
leaq 0x271a(%rip), %rsi      # 0x6245
callq 0x4010
movl %eax, %r15d
movq %rbx, %rdi
callq 0x20a0
testb %r15b, %r15b
je 0x3b60
movq 0x5489(%rip), %rdi      # 0x8fd0
leaq 0x26fb(%rip), %rsi      # 0x6249
callq 0x2160
movq %rax, %rdi
callq 0x20b0
jmp 0x38cf
leaq -0xd0(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x21d0
leaq -0xb0(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x21d0
leaq -0x280(%rbp), %r15
movq %r15, %rdi
leaq -0x1f8(%rbp), %rsi
callq 0x3f20
leaq -0xd0(%rbp), %rbx
movq %rbx, %rdi
leaq -0xb0(%rbp), %r14
movq %r14, %rsi
movq %r15, %rdx
callq 0x35c1
movq %r15, %rdi
callq 0x3d98
movq %r14, %rdi
callq 0x20a0
movq %rbx, %rdi
callq 0x20a0
leaq -0x1f8(%rbp), %rdi
callq 0x3d98
leaq -0x50(%rbp), %rdi
callq 0x20a0
leaq -0x70(%rbp), %rdi
callq 0x20a0
jmp 0x382b
callq 0x318f
callq 0x318f
movq %rax, %rbx
leaq -0x280(%rbp), %rdi
callq 0x3d98
jmp 0x3c0b
movq %rax, %rbx
leaq -0xb0(%rbp), %rdi
callq 0x20a0
jmp 0x3c1e
jmp 0x3c88
movq %rax, %rbx
leaq -0xd0(%rbp), %rdi
jmp 0x3c7d
movq %rax, %rbx
jmp 0x3c97
movq %rax, %rbx
jmp 0x3c44
jmp 0x3c88
jmp 0x3c88
movq %rax, %rbx
leaq -0xf0(%rbp), %rdi
callq 0x20a0
leaq -0x90(%rbp), %rdi
jmp 0x3c7d
jmp 0x3c88
movq %rax, %rbx
leaq -0x130(%rbp), %rdi
jmp 0x3c7d
movq %rax, %rbx
leaq -0x110(%rbp), %rdi
jmp 0x3c7d
movq %rax, %rbx
leaq -0x170(%rbp), %rdi
jmp 0x3c7d
movq %rax, %rbx
leaq -0x150(%rbp), %rdi
callq 0x20a0
jmp 0x3c8b
jmp 0x3c88
jmp 0x3c88
movq %rax, %rbx
leaq -0x1f8(%rbp), %rdi
callq 0x3d98
leaq -0x50(%rbp), %rdi
callq 0x20a0
leaq -0x70(%rbp), %rdi
callq 0x20a0
movq %rbx, %rdi
callq 0x2230
nop