// File: /workspace/github_cpp_makefile_star2_O1/MarkCBell[P]twister/./twister/kernel/twister_main.cpp
// Function: main
int main(int argc, char **argv)
{
	// Set default values.
	set_globals_to_defaults();
	Manifold_type manifold_type = bundle;
	std::string manifold_name = "", handles = "", gluing = "", surface_file = "", surface_file_contents = "", output_file = "", warning_file = "";
	std::string manifold_contents = "";
	bool error_occured = false;
	
	try
	{
		// Parse the given command, extracting out all the interesting bits.
		parse_input(argc, argv, surface_file, output_file, warning_file, manifold_name, manifold_type, gluing, handles);
		surface_file_contents = load_file_contents(surface_file);
		
		// Build the manifold and get its information.
		manifold M(manifold_name, manifold_type);
		construct_manifold(M, surface_file_contents, gluing, handles);
		manifold_contents = M.to_string();
	}
	catch (...)
	{
		error_occured = true;
	}
	
	// Write out any messages stored in the GLOBAL_message_stream.
	try
	{
		if (GLOBAL_message_stream != "")
		{
			if (warning_file != "")
			{
				std::ofstream myfile(warning_file.c_str());
				if (not myfile.is_open())
					output_error("Unable to write to " + warning_file + ".");
				
				myfile << GLOBAL_message_stream;
				myfile.close();
			}
			else  // Else write it to std::cerr.
			{
				std::cerr << GLOBAL_message_stream << std::endl;
			}
		}
	}
	catch (...)
	{
		error_occured = true;
	}
	
	if (error_occured) exit(1);
	
	try
	{
		if (output_file != "")  // If we were given an output file, write it there.
		{
			std::ofstream myfile(output_file.c_str());
			if (not myfile.is_open())
				output_error("Unable to write to " + output_file + ".");
			
			myfile << manifold_contents;
			myfile.close();
		}
		else  // Else write it to std::cout.
		{
			std::cout << manifold_contents;
		}
	}
	catch (...)
	{
		error_occured = true;
	}
	
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x408, %rsp            # imm = 0x408
movq %rsi, %rbx
movl %edi, %ebp
callq 0x41cc
movl $0x1, 0x4(%rsp)
leaq 0xf8(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x1669(%rip), %r15      # 0x172f9
leaq 0xe8(%rsp), %rdi
movq %r15, %rsi
movq %r15, %rdx
callq 0x86fe
leaq 0x158(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x148(%rsp), %r14
movq %r14, %rdi
movq %r15, %rsi
movq %r15, %rdx
callq 0x86fe
leaq 0xd8(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x1621(%rip), %rdx      # 0x172f9
leaq 0xc8(%rsp), %r15
movq %r15, %rdi
movq %rdx, %rsi
callq 0x86fe
leaq 0xb8(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x15fb(%rip), %rdx      # 0x172f9
leaq 0xa8(%rsp), %rdi
movq %rdx, %rsi
callq 0x86fe
leaq 0x98(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x15d8(%rip), %rdx      # 0x172f9
leaq 0x88(%rsp), %rdi
movq %rdx, %rsi
callq 0x86fe
leaq 0x78(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x15b8(%rip), %rdx      # 0x172f9
leaq 0x68(%rsp), %rdi
movq %rdx, %rsi
callq 0x86fe
leaq 0x58(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x159b(%rip), %rdx      # 0x172f9
leaq 0x48(%rsp), %rdi
movq %rdx, %rsi
callq 0x86fe
leaq 0x38(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x157e(%rip), %rdx      # 0x172f9
leaq 0x28(%rsp), %rdi
movq %rdx, %rsi
callq 0x86fe
subq $0x8, %rsp
leaq 0xc(%rsp), %rax
leaq 0xb0(%rsp), %rdx
leaq 0x70(%rsp), %rcx
leaq 0x50(%rsp), %r8
leaq 0xf0(%rsp), %r9
movl %ebp, %edi
movq %rbx, %rsi
pushq %r14
pushq %r15
pushq %rax
callq 0x14c5b
addq $0x20, %rsp
leaq 0x1f8(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0xa8(%rsp), %rsi
movq 0xb0(%rsp), %rdx
addq %rsi, %rdx
leaq 0x1e8(%rsp), %rdi
callq 0x878e
leaq 0x208(%rsp), %rdi
leaq 0x1e8(%rsp), %rsi
callq 0x9fd8
leaq 0x88(%rsp), %rdi
leaq 0x208(%rsp), %rbx
movq %rbx, %rsi
callq 0x32a0
movq (%rbx), %rdi
leaq 0x218(%rsp), %rax
cmpq %rax, %rdi
je 0x15e37
movq 0x218(%rsp), %rsi
incq %rsi
callq 0x3220
movq 0x1e8(%rsp), %rdi
cmpq %r14, %rdi
je 0x15e54
movq 0x1f8(%rsp), %rsi
incq %rsi
callq 0x3220
leaq 0x1d8(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0xe8(%rsp), %rsi
movq 0xf0(%rsp), %rdx
addq %rsi, %rdx
leaq 0x1c8(%rsp), %rdi
callq 0x878e
movl 0x4(%rsp), %edx
leaq 0x208(%rsp), %rdi
leaq 0x1c8(%rsp), %rsi
callq 0x11664
movq 0x1c8(%rsp), %rdi
cmpq %r14, %rdi
je 0x15eb6
movq 0x1d8(%rsp), %rsi
incq %rsi
callq 0x3220
leaq 0x1b8(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x88(%rsp), %rsi
movq 0x90(%rsp), %rdx
addq %rsi, %rdx
leaq 0x1a8(%rsp), %rdi
callq 0x878e
leaq 0x198(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0xc8(%rsp), %rsi
movq 0xd0(%rsp), %rdx
addq %rsi, %rdx
leaq 0x188(%rsp), %rdi
callq 0x878e
leaq 0x178(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq 0x148(%rsp), %rsi
movq 0x150(%rsp), %rdx
addq %rsi, %rdx
leaq 0x168(%rsp), %rdi
callq 0x878e
leaq 0x208(%rsp), %rdi
leaq 0x1a8(%rsp), %rsi
leaq 0x188(%rsp), %rdx
leaq 0x168(%rsp), %rcx
callq 0x7266
movq 0x168(%rsp), %rdi
cmpq %rbp, %rdi
je 0x15f7c
movq 0x178(%rsp), %rsi
incq %rsi
callq 0x3220
movq 0x188(%rsp), %rdi
cmpq %r15, %rdi
je 0x15f99
movq 0x198(%rsp), %rsi
incq %rsi
callq 0x3220
movq 0x1a8(%rsp), %rdi
cmpq %r14, %rdi
je 0x15fb6
movq 0x1b8(%rsp), %rsi
incq %rsi
callq 0x3220
leaq 0x8(%rsp), %rdi
leaq 0x208(%rsp), %rsi
callq 0x13220
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rbx
movq %rbx, %rsi
callq 0x32a0
movq (%rbx), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x15ff4
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3220
leaq 0x208(%rsp), %rdi
callq 0x11780
xorl %ebp, %ebp
leaq 0x832e(%rip), %rbx      # 0x1e338
leaq 0x12e8(%rip), %rsi      # 0x172f9
movq %rbx, %rdi
callq 0x30c0
testl %eax, %eax
je 0x161bb
leaq 0x12d1(%rip), %rsi      # 0x172f9
leaq 0x48(%rsp), %rdi
callq 0x30c0
testl %eax, %eax
je 0x160bd
movq 0x48(%rsp), %rsi
leaq 0x208(%rsp), %rdi
movl $0x10, %edx
callq 0x3260
leaq 0x278(%rsp), %rdi
callq 0x3090
testb %al, %al
jne 0x16162
leaq 0x227b(%rip), %rsi      # 0x182e8
leaq 0x8(%rsp), %rdi
leaq 0x48(%rsp), %rdx
callq 0x44c2
leaq 0x103f(%rip), %rsi      # 0x170c2
leaq 0x8(%rsp), %rdi
callq 0x3420
leaq 0x138(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x160ff
movq %rdx, 0x128(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x138(%rsp)
jmp 0x16106
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq 0x7f25(%rip), %rdi      # 0x1dff0
callq 0x3280
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3200
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x3170
jmp 0x161bb
movups (%rcx), %xmm0
movups %xmm0, (%r14)
movq 0x8(%rax), %rdx
leaq 0x128(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
callq 0x4397
movq 0x128(%rsp), %rdi
cmpq %r14, %rdi
je 0x16147
movq 0x138(%rsp), %rsi
incq %rsi
callq 0x3220
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x16162
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3220
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
leaq 0x208(%rsp), %rdi
callq 0x3280
leaq 0x208(%rsp), %rdi
callq 0x32f0
movq 0x7e3e(%rip), %rax      # 0x1dfc8
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq 0x210(%rsp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, 0x208(%rsp,%rcx)
callq 0x31e0
leaq 0x300(%rsp), %rdi
callq 0x30e0
testb %bpl, %bpl
jne 0x1644b
leaq 0x112e(%rip), %rsi      # 0x172f9
leaq 0x68(%rsp), %rdi
callq 0x30c0
testl %eax, %eax
je 0x16260
movq 0x68(%rsp), %rsi
leaq 0x208(%rsp), %rdi
movl $0x10, %edx
callq 0x3260
leaq 0x278(%rsp), %rdi
callq 0x3090
testb %al, %al
jne 0x162de
leaq 0x20d8(%rip), %rsi      # 0x182e8
leaq 0x8(%rsp), %rdi
leaq 0x68(%rsp), %rdx
callq 0x44c2
leaq 0xe9c(%rip), %rsi       # 0x170c2
leaq 0x8(%rsp), %rdi
callq 0x3420
leaq 0x118(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x1627b
movq %rdx, 0x108(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x118(%rsp)
jmp 0x16282
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
movq 0x7d5f(%rip), %rdi      # 0x1dfd0
callq 0x3280
jmp 0x1633a
movups (%rcx), %xmm0
movups %xmm0, (%r14)
movq 0x8(%rax), %rdx
leaq 0x108(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
callq 0x4397
movq 0x108(%rsp), %rdi
cmpq %r14, %rdi
je 0x162c3
movq 0x118(%rsp), %rsi
incq %rsi
callq 0x3220
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x162de
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3220
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
leaq 0x208(%rsp), %rdi
callq 0x3280
leaq 0x208(%rsp), %rdi
callq 0x32f0
movq 0x7cbf(%rip), %rax      # 0x1dfc8
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq 0x210(%rsp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, 0x208(%rsp,%rcx)
callq 0x31e0
leaq 0x300(%rsp), %rdi
callq 0x30e0
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x16356
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3220
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x16372
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x3220
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x1638e
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x3220
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x163b3
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x3220
movq 0xa8(%rsp), %rdi
leaq 0xb8(%rsp), %rax
cmpq %rax, %rdi
je 0x163d8
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x3220
movq 0xc8(%rsp), %rdi
leaq 0xd8(%rsp), %rax
cmpq %rax, %rdi
je 0x163fd
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x3220
movq 0x148(%rsp), %rdi
cmpq %r13, %rdi
je 0x1641a
movq 0x158(%rsp), %rsi
incq %rsi
callq 0x3220
movq 0xe8(%rsp), %rdi
cmpq %r12, %rdi
je 0x16437
movq 0xf8(%rsp), %rsi
incq %rsi
callq 0x3220
xorl %eax, %eax
addq $0x408, %rsp            # imm = 0x408
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x1, %edi
callq 0x3290
movq %rax, %rbx
movq 0x128(%rsp), %rdi
cmpq %r14, %rdi
je 0x1647a
movq 0x138(%rsp), %rsi
incq %rsi
callq 0x3220
jmp 0x1647a
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x164f6
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3220
jmp 0x164f6
jmp 0x164f3
movq %rax, %rbx
movq 0x108(%rsp), %rdi
cmpq %r14, %rdi
je 0x164be
movq 0x118(%rsp), %rsi
incq %rsi
callq 0x3220
jmp 0x164be
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x166fc
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3220
jmp 0x166fc
jmp 0x166f9
jmp 0x164eb
jmp 0x16505
movq %rax, %rbx
jmp 0x16709
movq %rax, %rbx
leaq 0x208(%rsp), %rdi
callq 0x3310
jmp 0x16508
movq %rax, %rbx
movq %rbx, %rdi
callq 0x3100
movb $0x1, %bpl
callq 0x3390
jmp 0x161bb
jmp 0x16585
movq %rax, %rbx
movq 0x168(%rsp), %rdi
cmpq %rbp, %rdi
je 0x16544
movq 0x178(%rsp), %rsi
incq %rsi
callq 0x3220
jmp 0x16544
movq %rax, %rbx
movq 0x188(%rsp), %rdi
cmpq %r15, %rdi
je 0x16566
movq 0x198(%rsp), %rsi
incq %rsi
callq 0x3220
jmp 0x16566
movq %rax, %rbx
movq 0x1a8(%rsp), %rdi
cmpq %r14, %rdi
je 0x16588
movq 0x1b8(%rsp), %rsi
incq %rsi
callq 0x3220
jmp 0x16588
movq %rax, %rbx
leaq 0x208(%rsp), %rdi
callq 0x11780
jmp 0x165da
movq %rax, %rbx
movq 0x1c8(%rsp), %rdi
cmpq %r14, %rdi
je 0x165da
movq 0x1d8(%rsp), %rsi
jmp 0x165cb
jmp 0x165d7
movq %rax, %rbx
movq 0x1e8(%rsp), %rdi
cmpq %r14, %rdi
je 0x165da
movq 0x1f8(%rsp), %rsi
incq %rsi
callq 0x3220
jmp 0x165da
jmp 0x165d7
movq %rax, %rbx
movq %rbx, %rdi
callq 0x3100
movb $0x1, %bpl
callq 0x3390
jmp 0x16003
movq %rax, %rbx
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x16613
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x3220
jmp 0x16613
movq %rax, %rbx
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x16634
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x3220
jmp 0x16634
movq %rax, %rbx
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x1665e
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x3220
jmp 0x1665e
movq %rax, %rbx
movq 0xa8(%rsp), %rdi
leaq 0xb8(%rsp), %rax
cmpq %rax, %rdi
je 0x16688
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x3220
jmp 0x16688
movq %rax, %rbx
movq 0xc8(%rsp), %rdi
leaq 0xd8(%rsp), %rax
cmpq %rax, %rdi
je 0x166b2
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x3220
jmp 0x166b2
movq %rax, %rbx
movq 0x148(%rsp), %rdi
cmpq %r13, %rdi
je 0x166d4
movq 0x158(%rsp), %rsi
incq %rsi
callq 0x3220
jmp 0x166d4
movq %rax, %rbx
movq 0xe8(%rsp), %rdi
cmpq %r12, %rdi
je 0x166f1
movq 0xf8(%rsp), %rsi
incq %rsi
callq 0x3220
movq %rbx, %rdi
callq 0x33e0
movq %rax, %rbx
leaq 0x208(%rsp), %rdi
callq 0x3310
movq %rbx, %rdi
callq 0x3100
callq 0x3390
jmp 0x1633a
movq %rax, %rbx
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x165f2
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3220
jmp 0x165f2