// File: MarkCBell[P]twister/./twister/kernel/twister.cpp
// Function: manifold::snap_print(std::ostream&)
void manifold::snap_print(std::ostream &o)
{
	output_debugging("print", 2);
	
	// Watch out - blank names will kill snappea.
	if (name == "")
		name = "Blank name disallowed";
	
	// Print basic information.
	o << "% Triangulation" << std::endl;
	o << name << std::endl;
	o << "not_attempted  0.00000000" << std::endl;
	o << "oriented_manifold" << std::endl;  // All manifolds we build are orientable, as all face gluings are odd. 
	o << "CS_unknown" << std::endl;
	o << std::endl;
	
	// As our manifold is orientable we must only have torus cusps, so we write them down.
	o << num_cusps << " 0" << std::endl;
	for (int i = 0; i < num_cusps; i++)
		o << "    torus  0.00000000  0.00000000" << std::endl;
	
	o << std::endl;
	
	// First assign each tetra a snap_index
	int i = 0; 
	for (tetra *current = first_tetra; current != NULL; current = current->get_next())
		current->snap_index = i++;
	
	// Print the number of tetrahedra.
	o << i << std::endl;
	
	// Finally, print the face gluings for each tetrahedron and the cusp data, if any.
	for (tetra *current = first_tetra; current != NULL; current = current->get_next())
		current->print_wrt(o);
	
	o << std::endl;
	return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x70(%rbp)
leaq -0x31(%rbp), %rdi
movq %rdi, -0x68(%rbp)
callq 0x3560
movq -0x68(%rbp), %rdx
leaq 0x7313(%rip), %rsi      # 0x277b3
leaq -0x30(%rbp), %rdi
callq 0x4e10
jmp 0x204ab
leaq -0x30(%rbp), %rdi
movl $0x2, %esi
callq 0x4c10
jmp 0x204bb
leaq -0x30(%rbp), %rdi
callq 0x35f8
leaq -0x31(%rbp), %rdi
callq 0x3360
movq -0x70(%rbp), %rdi
addq $0x18, %rdi
leaq 0x6e16(%rip), %rsi      # 0x272f2
callq 0x8ca0
testb $0x1, %al
jne 0x204e7
jmp 0x2052e
movq -0x70(%rbp), %rdi
addq $0x18, %rdi
leaq 0x72c3(%rip), %rsi      # 0x277b9
callq 0x3420
jmp 0x2052e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x20520
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x35f8
leaq -0x31(%rbp), %rdi
callq 0x3360
jmp 0x206f1
movq -0x10(%rbp), %rdi
leaq 0x7296(%rip), %rsi      # 0x277cf
callq 0x32f0
movq %rax, %rdi
movq 0x14a70(%rip), %rsi     # 0x34fb8
callq 0x3340
movq -0x70(%rbp), %rsi
movq -0x10(%rbp), %rdi
addq $0x18, %rsi
callq 0x32a0
movq %rax, %rdi
movq 0x14a50(%rip), %rsi     # 0x34fb8
callq 0x3340
movq -0x10(%rbp), %rdi
leaq 0x7267(%rip), %rsi      # 0x277df
callq 0x32f0
movq %rax, %rdi
movq 0x14a31(%rip), %rsi     # 0x34fb8
callq 0x3340
movq -0x10(%rbp), %rdi
leaq 0x7262(%rip), %rsi      # 0x277f9
callq 0x32f0
movq %rax, %rdi
movq 0x14a12(%rip), %rsi     # 0x34fb8
callq 0x3340
movq -0x10(%rbp), %rdi
leaq 0x7255(%rip), %rsi      # 0x2780b
callq 0x32f0
movq %rax, %rdi
movq 0x149f3(%rip), %rsi     # 0x34fb8
callq 0x3340
movq -0x10(%rbp), %rdi
movq 0x149e3(%rip), %rsi     # 0x34fb8
callq 0x3340
movq -0x70(%rbp), %rax
movq -0x10(%rbp), %rdi
movl 0x3c(%rax), %esi
callq 0x3540
movq %rax, %rdi
leaq 0x72ab(%rip), %rsi      # 0x2789f
callq 0x32f0
movq %rax, %rdi
movq 0x149b5(%rip), %rsi     # 0x34fb8
callq 0x3340
movl $0x0, -0x48(%rbp)
movq -0x70(%rbp), %rcx
movl -0x48(%rbp), %eax
cmpl 0x3c(%rcx), %eax
jge 0x20645
movq -0x10(%rbp), %rdi
leaq 0x71f0(%rip), %rsi      # 0x27816
callq 0x32f0
movq %rax, %rdi
movq 0x14983(%rip), %rsi     # 0x34fb8
callq 0x3340
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0x2060f
movq -0x10(%rbp), %rdi
movq 0x14968(%rip), %rsi     # 0x34fb8
callq 0x3340
movq -0x70(%rbp), %rax
movl $0x0, -0x4c(%rbp)
movq (%rax), %rax
movq %rax, -0x58(%rbp)
cmpq $0x0, -0x58(%rbp)
je 0x20692
movl -0x4c(%rbp), %ecx
movl %ecx, %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
movq -0x58(%rbp), %rax
movl %ecx, 0xbc(%rax)
movq -0x58(%rbp), %rdi
callq 0x21300
movq %rax, -0x58(%rbp)
jmp 0x20667
movq -0x10(%rbp), %rdi
movl -0x4c(%rbp), %esi
callq 0x3540
movq %rax, %rdi
movq 0x14910(%rip), %rsi     # 0x34fb8
callq 0x3340
movq -0x70(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x60(%rbp)
cmpq $0x0, -0x60(%rbp)
je 0x206db
movq -0x60(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x20750
movq -0x60(%rbp), %rdi
callq 0x21300
movq %rax, -0x60(%rbp)
jmp 0x206b8
movq -0x10(%rbp), %rdi
movq 0x148d2(%rip), %rsi     # 0x34fb8
callq 0x3340
addq $0x70, %rsp
popq %rbp
retq
movq -0x40(%rbp), %rdi
callq 0x3550
nopw (%rax,%rax)