LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/Distrotech[P]stund/server.cxx
// Function: usage()
void 
usage()
{
   cerr << "Usage: " << endl
        << " ./server [-v] [-h] [-h IP_Address] [-a IP_Address] [-p port] [-o port] [-m mediaport]" << endl
        << " " << endl
        << " If the IP addresses of your NIC are 10.0.1.150 and 10.0.1.151, run this program with" << endl
        << "    ./server -v  -h 10.0.1.150 -a 10.0.1.151" << endl
        << " STUN servers need two IP addresses and two ports, these can be specified with:" << endl
        << "  -h sets the primary IP" << endl
        << "  -a sets the secondary IP" << endl
        << "  -p sets the primary port and defaults to 3478" << endl
        << "  -o sets the secondary port and defaults to 3479" << endl
        << "  -b makes the program run in the backgroud" << endl
        << "  -m sets up a STERN server starting at port m" << endl
        << "  -v runs in verbose mode" << endl
      // in makefile too
        << endl;
}

// Assembly:
pushq %rax
movq 0x8bac(%rip), %rdi      # 0xaff0
leaq 0x4bb9(%rip), %rsi      # 0x7004
callq 0x21c0
movq %rax, %rdi
callq 0x20d0
leaq 0x4bad(%rip), %rsi      # 0x700c
movq %rax, %rdi
callq 0x21c0
movq %rax, %rdi
callq 0x20d0
leaq 0x4e23(%rip), %rsi      # 0x7299
movq %rax, %rdi
callq 0x21c0
movq %rax, %rdi
callq 0x20d0
leaq 0x4bd6(%rip), %rsi      # 0x7063
movq %rax, %rdi
callq 0x21c0
movq %rax, %rdi
callq 0x20d0
leaq 0x4c15(%rip), %rsi      # 0x70b9
movq %rax, %rdi
callq 0x21c0
movq %rax, %rdi
callq 0x20d0
leaq 0x4c2b(%rip), %rsi      # 0x70e6
movq %rax, %rdi
callq 0x21c0
movq %rax, %rdi
callq 0x20d0
leaq 0x4c64(%rip), %rsi      # 0x7136
movq %rax, %rdi
callq 0x21c0
movq %rax, %rdi
callq 0x20d0
leaq 0x4c66(%rip), %rsi      # 0x714f
movq %rax, %rdi
callq 0x21c0
movq %rax, %rdi
callq 0x20d0
leaq 0x4c6a(%rip), %rsi      # 0x716a
movq %rax, %rdi
callq 0x21c0
movq %rax, %rdi
callq 0x20d0
leaq 0x4c83(%rip), %rsi      # 0x719a
movq %rax, %rdi
callq 0x21c0
movq %rax, %rdi
callq 0x20d0
leaq 0x4c9e(%rip), %rsi      # 0x71cc
movq %rax, %rdi
callq 0x21c0
movq %rax, %rdi
callq 0x20d0
leaq 0x4cb3(%rip), %rsi      # 0x71f8
movq %rax, %rdi
callq 0x21c0
movq %rax, %rdi
callq 0x20d0
leaq 0x4ccb(%rip), %rsi      # 0x7227
movq %rax, %rdi
callq 0x21c0
movq %rax, %rdi
callq 0x20d0
movq %rax, %rdi
popq %rax
jmp 0x20d0
// File: /workspace/github_cpp_makefile_star2_O2/attractivechaos[P]udb2/c++11/test.cpp
// Function: test_int(unsigned int, unsigned int)
uint32_t test_int(uint32_t n, uint32_t x0)
{
	uint32_t i, x, z = 0;
	std::unordered_map<uint32_t, uint32_t, Hash32> h;
	for (i = 0, x = x0; i < n; ++i) {
		x = hash32(x);
		z += ++h[get_key(n, x)];
	}
	fprintf(stderr, "# unique keys: %ld; checksum: %u\n", h.size(), z);
	return h.size();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %esi, %r14d
movl %edi, %ebp
leaq 0x40(%rsp), %rax
movq %rax, -0x30(%rax)
movq $0x1, -0x28(%rax)
xorps %xmm0, %xmm0
movups %xmm0, -0x20(%rax)
movl $0x3f800000, -0x10(%rax) # imm = 0x3F800000
movups %xmm0, -0x8(%rax)
xorl %ebx, %ebx
leaq 0x10(%rsp), %r15
leaq 0xc(%rsp), %r12
movl %edi, %r13d
subl $0x1, %r13d
jb 0x1566
movl %r14d, %edi
callq 0x127c
movl %eax, %r14d
movl %ebp, %edi
movl %eax, %esi
callq 0x12a7
movl %eax, 0xc(%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0x164e
movl (%rax), %ecx
leal 0x1(%rcx), %edx
movl %edx, (%rax)
addl %ecx, %ebx
incl %ebx
jmp 0x1530
movq 0x2a73(%rip), %rax      # 0x3fe0
movq (%rax), %rdi
leaq 0x10(%rsp), %r14
movq 0x18(%r14), %rdx
leaq 0xaf5(%rip), %rsi       # 0x2075
movl %ebx, %ecx
xorl %eax, %eax
callq 0x10f0
movl 0x18(%r14), %ebx
movq %r14, %rdi
callq 0x15bc
movl %ebx, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x15bc
movq %rbx, %rdi
callq 0x1130
nop
// File: /workspace/github_cpp_makefile_star2_O2/MarkCBell[P]twister/./twister/kernel/global.cpp
// Function: set_globals_to_defaults()
void set_globals_to_defaults()
{
	// Reset the global options to their defaults.
	GLOBAL_debugging_level = 0;
	GLOBAL_warnings = true;
	GLOBAL_optimise = true;
	GLOBAL_calculate_peripheral_curves = true;
	GLOBAL_message_stream = "";
}

// Assembly:
andl $0x0, 0x1564d(%rip)     # 0x19340
movb $0x1, %al
movb %al, 0x1553d(%rip)      # 0x19238
movb %al, 0x15538(%rip)      # 0x19239
movb %al, 0x15533(%rip)      # 0x1923a
leaq 0x1563a(%rip), %rdi     # 0x19348
leaq 0xd5fa(%rip), %rsi      # 0x1130f
jmp 0x3410
// File: /workspace/github_cpp_makefile_star2_O2/MarkCBell[P]twister/./twister/kernel/global.cpp
// Function: output_error(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void output_error(const std::string strn)
{
	if (GLOBAL_warnings)
		GLOBAL_message_stream += "Error: " + strn + "\n";
	
	throw -1;
	return;
}

// Assembly:
pushq %rbx
subq $0x40, %rsp
cmpb $0x1, 0x15440(%rip)     # 0x19238
jne 0x3e44
movq %rdi, %rdx
leaq 0xd25d(%rip), %rsi      # 0x11061
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
callq 0x3ebd
leaq 0xd247(%rip), %rdx      # 0x1105f
movq %rsp, %rdi
movq %rbx, %rsi
callq 0x3f33
leaq 0x1551e(%rip), %rdi     # 0x19348
movq %rsp, %rsi
callq 0x3420
movq %rsp, %rdi
callq 0x3458
leaq 0x20(%rsp), %rdi
callq 0x3458
pushq $0x4
popq %rdi
callq 0x3130
orl $-0x1, (%rax)
movq 0x1515a(%rip), %rsi     # 0x18fb0
movq %rax, %rdi
xorl %edx, %edx
callq 0x33b0
movq %rax, %rbx
movq %rsp, %rdi
callq 0x3458
jmp 0x3e70
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x3458
movq %rbx, %rdi
callq 0x33d0
// File: /workspace/github_cpp_makefile_star2_O2/MarkCBell[P]twister/./twister/kernel/twister.h
// Function: perm::perm(int, int, int, int)
perm(int im0, int im1, int im2, int im3)
	{
		image[0] = im0;
		image[1] = im1;
		image[2] = im2;
		image[3] = im3;
		
		// Make sure the thing that we've just made is a permutation.
		// As users have no direct control over permutations, this is to check hard coded permutations are valid.
		for (int i=0; i<4; i++)
			for (int j=i+1; j<4; j++)
				if (image[i] == image[j]) output_error("Invalid permutation.");
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
movl %esi, (%rdi)
movl %edx, 0x4(%rdi)
movl %ecx, 0x8(%rdi)
movl %r8d, 0xc(%rdi)
pushq $0x1
popq %r13
xorl %ebp, %ebp
leaq 0xaa95(%rip), %r14      # 0x1124f
leaq 0x18(%rsp), %r15
leaq 0x7(%rsp), %r12
cmpq $0x4, %rbp
je 0x6819
leaq 0x1(%rbp), %rax
movq %rax, 0x8(%rsp)
movq %r13, 0x10(%rsp)
cmpq $0x4, %r13
je 0x680a
movl (%rbx,%rbp,4), %eax
cmpl (%rbx,%r13,4), %eax
jne 0x6805
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x3e82
movq %r15, %rdi
callq 0x3dec
movq %r15, %rdi
callq 0x3458
incq %r13
jmp 0x67d8
movq 0x10(%rsp), %r13
incq %r13
movq 0x8(%rsp), %rbp
jmp 0x67c4
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x3458
movq %rbx, %rdi
callq 0x33d0
// File: /workspace/github_cpp_makefile_star2_O2/MarkCBell[P]twister/./twister/kernel/parsing.cpp
// Function: load_file_contents(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
std::string load_file_contents(const std::string file)
{
	std::ifstream myfile(file.c_str());
	if (! myfile.is_open())
		output_error("Unknown file requested.");
	
	std::string line = "";
	std::string contents = "";
	while (myfile.good())
	{
		getline (myfile, line);
		contents += line + "\n";
	}
	myfile.close();
	
	return contents;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x270, %rsp            # imm = 0x270
movq %rdi, %rbx
movq (%rsi), %rsi
leaq 0x68(%rsp), %rdi
pushq $0x8
popq %rdx
callq 0x33f0
leaq 0xe0(%rsp), %rdi
callq 0x3090
testb %al, %al
jne 0x7ff6
leaq 0x9320(%rip), %rsi      # 0x112f3
leaq 0x48(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0x3e82
leaq 0x48(%rsp), %rdi
callq 0x3dec
leaq 0x48(%rsp), %rdi
callq 0x3458
leaq 0x9312(%rip), %rsi      # 0x1130f
leaq 0x8(%rsp), %rdi
leaq 0x28(%rsp), %rdx
callq 0x3e82
leaq 0x92fc(%rip), %rsi      # 0x1130f
leaq 0x28(%rsp), %rdx
movq %rbx, %rdi
callq 0x3e82
leaq 0x68(%rsp), %r14
leaq 0x8(%rsp), %r15
leaq 0x902e(%rip), %r12      # 0x1105f
leaq 0x28(%rsp), %r13
movq 0x68(%rsp), %rax
movq -0x18(%rax), %rax
cmpl $0x0, 0x88(%rsp,%rax)
jne 0x8077
movq %r14, %rdi
movq %r15, %rsi
callq 0x3070
movq %r13, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x658d
movq %rbx, %rdi
movq %r13, %rsi
callq 0x3420
movq %r13, %rdi
callq 0x3458
jmp 0x8036
leaq 0x68(%rsp), %rdi
callq 0x3080
leaq 0x8(%rsp), %rdi
callq 0x3458
leaq 0x68(%rsp), %rdi
callq 0x30a0
movq %rbx, %rax
addq $0x270, %rsp            # imm = 0x270
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %r14
leaq 0x48(%rsp), %rdi
jmp 0x80e2
jmp 0x80bc
jmp 0x80d2
movq %rax, %r14
jmp 0x80dd
movq %rax, %r14
jmp 0x80e7
movq %rax, %r14
leaq 0x28(%rsp), %rdi
callq 0x3458
jmp 0x80d5
jmp 0x80d2
movq %rax, %r14
movq %rbx, %rdi
callq 0x3458
leaq 0x8(%rsp), %rdi
callq 0x3458
leaq 0x68(%rsp), %rdi
callq 0x30a0
movq %r14, %rdi
callq 0x33d0
// File: /workspace/github_cpp_makefile_star2_O2/MarkCBell[P]twister/./twister/kernel/parsing.cpp
// Function: count_substring(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
int count_substring(const std::string inpt, const std::string search_for)
{
	int count = 0;
	for (size_t pos = inpt.find(search_for); pos != std::string::npos; count++)
		pos = inpt.find(search_for, pos + 1);
	
	return count;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
xorl %r15d, %r15d
xorl %edx, %edx
callq 0x3440
cmpq $-0x1, %rax
je 0x812a
incq %rax
movq %r14, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x3440
incl %r15d
jmp 0x810e
movl %r15d, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/MarkCBell[P]twister/./twister/kernel/parsing.cpp
// Function: remove_whitespace(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
std::string remove_whitespace(const std::string inpt)
{
	std::string output = "";
	output.reserve(inpt.size());
	size_t marker = 0, next_marker = 0;
	
	do
	{
		next_marker = inpt.find_first_of(" \t", marker);  // Could filter out more characters here.
		output += inpt.substr(marker, next_marker - marker);
		marker = next_marker + 1;  // Skip over the bad character.
	} while (marker != 0);  // When next_marker == std::string::npos, marker == std::string::npos + 1 == 0.
	
	return output;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x911f(%rip), %rsi      # 0x1130f
leaq 0x8(%rsp), %rdx
callq 0x3e82
movq 0x8(%r14), %rsi
movq %rbx, %rdi
callq 0x3350
xorl %ebp, %ebp
leaq 0x90fe(%rip), %r15      # 0x1130d
leaq 0x8(%rsp), %r12
movq %r14, %rdi
movq %r15, %rsi
movq %rbp, %rdx
callq 0x3140
movq %rax, %r13
movq %rax, %rcx
subq %rbp, %rcx
movq %r12, %rdi
movq %r14, %rsi
movq %rbp, %rdx
callq 0x3260
movq %rbx, %rdi
movq %r12, %rsi
callq 0x3420
movq %r12, %rdi
callq 0x3458
incq %r13
movq %r13, %rbp
jne 0x8214
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x8268
movq %rax, %r14
jmp 0x827a
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x3458
movq %rbx, %rdi
callq 0x3458
movq %r14, %rdi
callq 0x33d0
// File: /workspace/github_cpp_makefile_star2_O2/MarkCBell[P]twister/./twister/kernel/parsing.cpp
// Function: check_valid_names(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>> const&)
void check_valid_names(const std::vector<std::string> &arc_names)
{
	int size = int(arc_names.size());
	
	// Check for blank names.
	for (int i = 0; i < size; i++)
		if (arc_names[i] == "")
			output_error("Empty curve or macro name.");
	
	// Check for names that contain a non-valid character or start with a digit.
	for (int i = 0; i < size; i++)
		if ((arc_names[i].find_first_not_of(valid_arc_name_characters) != std::string::npos) || isdigit(arc_names[i][0]) || arc_names[i][0] == '_')
			output_error("Invalid curve or macro name.");
	
	for (int i = 0; i < size; i++)
		for (int j = i+1; j < size; j++)
			if (arc_names[i]== arc_names[j])
				output_error("Duplicated curve or macro name.");
	
	return;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rdi, %rbx
movq 0x8(%rdi), %rbp
subq (%rdi), %rbp
shrq $0x5, %rbp
xorl %r15d, %r15d
testl %ebp, %ebp
movl $0x0, %r13d
cmovgl %ebp, %r13d
movq %r13, 0x10(%rsp)
shlq $0x5, %r13
leaq 0x9047(%rip), %r14      # 0x1130f
leaq 0x68(%rsp), %r12
cmpq %r15, %r13
je 0x830e
movq (%rbx), %rdi
addq %r15, %rdi
movq %r14, %rsi
callq 0x631c
testb %al, %al
je 0x8308
movq %r12, %rdi
leaq 0x9022(%rip), %rsi      # 0x11310
leaq 0xb(%rsp), %rdx
callq 0x3e82
movq %r12, %rdi
callq 0x3dec
movq %r12, %rdi
callq 0x3458
addq $0x20, %r15
jmp 0x82cd
xorl %r15d, %r15d
leaq 0x111c0(%rip), %r14     # 0x194d8
leaq 0x48(%rsp), %r12
cmpq %r15, %r13
je 0x837f
movq (%rbx), %rdi
addq %r15, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x31f0
cmpq $-0x1, %rax
jne 0x8355
movq (%rbx), %rax
movq (%rax,%r15), %rax
movsbl (%rax), %eax
cmpl $0x5f, %eax
setne %cl
addl $-0x30, %eax
cmpl $0xa, %eax
setae %al
testb %al, %cl
jne 0x8379
movq %r12, %rdi
leaq 0x8fcc(%rip), %rsi      # 0x1132b
leaq 0xb(%rsp), %rdx
callq 0x3e82
movq %r12, %rdi
callq 0x3dec
movq %r12, %rdi
callq 0x3458
addq $0x20, %r15
jmp 0x831d
pushq $0x20
popq %r12
pushq $0x1
popq %r14
xorl %r13d, %r13d
leaq 0x28(%rsp), %r15
cmpq 0x10(%rsp), %r13
je 0x840a
leaq 0x1(%r13), %rax
movq %rax, 0x18(%rsp)
shlq $0x5, %r13
movl %r14d, 0xc(%rsp)
movq %r12, 0x20(%rsp)
cmpl %ebp, %r14d
jge 0x83f2
movq (%rbx), %rsi
leaq (%rsi,%r13), %rdi
addq %r12, %rsi
callq 0x6722
testb %al, %al
je 0x83e9
movq %r15, %rdi
leaq 0x8f79(%rip), %rsi      # 0x11348
leaq 0xb(%rsp), %rdx
callq 0x3e82
movq %r15, %rdi
callq 0x3dec
movq %r15, %rdi
callq 0x3458
addq $0x20, %r12
incl %r14d
jmp 0x83ad
movq 0x20(%rsp), %r12
addq $0x20, %r12
movl 0xc(%rsp), %r14d
incl %r14d
movq 0x18(%rsp), %r13
jmp 0x838f
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x8443
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
jmp 0x843c
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
jmp 0x843c
jmp 0x8443
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x3458
jmp 0x8446
movq %rax, %rbx
movq %rbx, %rdi
callq 0x33d0
// File: /workspace/github_cpp_makefile_star2_O2/MarkCBell[P]twister/./twister/kernel/parsing.cpp
// Function: digit_length(int)
int digit_length(int n)
{
	int c = 0;
	if (n <= 0) c++;
	while (n != 0)
	{
	   n  /= 10;
	   c++;
	}
	return c;
}

// Assembly:
movl %edi, %eax
xorl %ecx, %ecx
testl %edi, %edi
setle %cl
pushq $0xa
popq %rsi
testl %eax, %eax
je 0x84ea
cltd
idivl %esi
incl %ecx
jmp 0x84df
movl %ecx, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O2/MarkCBell[P]twister/./twister/kernel/twister.cpp
// Function: perm::inverse() const
perm perm::inverse() const
{
	perm outp;
	
	for (int i = 0; i < 4; i++)
		outp.image[image[i]] = i;
	
	return outp;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
callq 0xa354
xorl %eax, %eax
cmpq $0x4, %rax
je 0xa3b9
movslq (%r14,%rax,4), %rcx
movl %eax, (%rbx,%rcx,4)
incq %rax
jmp 0xa3a7
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/MarkCBell[P]twister/./twister/kernel/twister.cpp
// Function: perm::of(perm const&) const
perm perm::of(const perm &other) const
{
	perm outp;
	
	for (int i=0; i<4; i++)
		outp.image[i] = image[other.image[i]];
	
	return outp;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
callq 0xa354
xorl %eax, %eax
cmpq $0x4, %rax
je 0xa3f0
movslq (%rbx,%rax,4), %rcx
movl (%r15,%rcx,4), %ecx
movl %ecx, (%r14,%rax,4)
incq %rax
jmp 0xa3d9
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/MarkCBell[P]twister/./twister/kernel/twister.cpp
// Function: tetra::tetra(manifold*, Category, Position, Side, int, tetra*)
tetra::tetra(manifold *M, Category mycategory, Position myposition, Side myside, int mylayer, tetra *my_parent)
{
	output_debugging("tet", 3);
	
	for (int i = 0; i < 4; i++)
		gluedto[i] = NULL;
	
	// There's nothing canonical to put in gluing[],
	// so we put in the identity permutation.
	for (int i = 0; i < 4; i++)
		gluing[i] = perm(1,0,2,3);
	
	next = NULL;
	prev = NULL;
	
	parent = my_parent;
	if (my_parent != NULL) my_parent->child = this;
	child = NULL;
	
	M->onemore(this);  // Add this new tetra to the doubly linked list of tetras.
	
	category = mycategory;
	position = myposition;
	side = myside;
	layer = mylayer;
	
	snap_index = -1;  // Index only determined when snap_print is called.
	cusp_number = -1;  // The cusp number of vertex 3 because vertices 0, 1 and 2 are always material.
	temp = -1;
	for (int i = 0; i < 4; i++)
	{
		peripheral_curves[longitude][i] = 0;
		peripheral_curves[meridian][i] = 0;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %r9d, %ebp
movl %r8d, %r15d
movl %ecx, %r12d
movl %edx, %r13d
movq %rsi, 0x10(%rsp)
movq %rdi, %rbx
pushq $0x30
popq %r14
leaq (%rbx,%r14), %rdi
callq 0xa354
addq $0x10, %r14
cmpq $0x70, %r14
jne 0xa420
leaq 0x7060(%rip), %rsi      # 0x1149a
leaq 0x28(%rsp), %r14
leaq 0x18(%rsp), %rdx
movq %r14, %rdi
callq 0x3e82
pushq $0x3
popq %rsi
movq %r14, %rdi
callq 0x3d1a
leaq 0x28(%rsp), %rdi
callq 0x3458
pushq $0x2
popq %rax
cmpq $0x6, %rax
je 0xa474
andq $0x0, (%rbx,%rax,8)
incq %rax
jmp 0xa464
movl %r13d, (%rsp)
movl %r12d, 0x4(%rsp)
movl %r15d, 0x8(%rsp)
movl %ebp, 0xc(%rsp)
pushq $0x30
popq %r13
leaq 0x18(%rsp), %rbp
pushq $0x1
popq %r14
pushq $0x2
popq %r15
pushq $0x3
popq %r12
cmpq $0x70, %r13
je 0xa4c4
movq %rbp, %rdi
movl %r14d, %esi
xorl %edx, %edx
movl %r15d, %ecx
movl %r12d, %r8d
callq 0x6790
movups 0x18(%rsp), %xmm0
movups %xmm0, (%rbx,%r13)
addq $0x10, %r13
jmp 0xa49b
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movq 0x80(%rsp), %rax
movq %rax, 0x80(%rbx)
testq %rax, %rax
je 0xa4e5
movq %rbx, 0x88(%rax)
andq $0x0, 0x88(%rbx)
movq 0x10(%rsp), %r8
movq 0x8(%r8), %rax
testq %rax, %rax
movl 0xc(%rsp), %ecx
movl 0x8(%rsp), %edx
movl 0x4(%rsp), %esi
movl (%rsp), %edi
je 0xa513
movq %rbx, (%rax)
movq %rax, 0x8(%rbx)
jmp 0xa516
movq %rbx, (%r8)
movq %rbx, 0x8(%r8)
movl %edi, 0x70(%rbx)
movl %esi, 0x74(%rbx)
movl %edx, 0x78(%rbx)
movl %ecx, 0x90(%rbx)
orl $-0x1, 0xbc(%rbx)
orq $-0x1, 0xb4(%rbx)
pushq $-0x10
popq %rax
testq %rax, %rax
je 0xa556
andl $0x0, 0xa4(%rbx,%rax)
andl $0x0, 0xb4(%rbx,%rax)
addq $0x4, %rax
jmp 0xa53b
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x3458
movq %rbx, %rdi
callq 0x33d0
// File: /workspace/github_cpp_makefile_star2_O2/MarkCBell[P]twister/./twister/kernel/twister.cpp
// Function: tetra::gluesym(tetra*, int, perm const&)
void tetra::gluesym(tetra *whereglue, int whichface, const perm &how)
{
	if ( (gluedto[whichface] != NULL) || (whereglue->gluedto[how[whichface]] != NULL) )
		output_error("Invalid gluing. Possible causes; self-intersecting curves, intersecting 2-handles.");
	
	this->set_gluedto(whichface, whereglue);
	this->set_gluing(whichface,how);
	
	whereglue->set_gluedto(how[whichface], this);
	whereglue->set_gluing(how[whichface], how.inverse());
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x50, %rsp
movq %rcx, %r14
movq %rsi, %rbx
movq %rdi, %r15
movslq %edx, %r12
cmpq $0x0, 0x10(%rdi,%r12,8)
jne 0xa5ff
movslq (%r14,%r12,4), %rax
cmpq $0x0, 0x10(%rbx,%rax,8)
je 0xa62a
leaq 0x6e98(%rip), %rsi      # 0x1149e
leaq 0x10(%rsp), %r13
leaq 0xf(%rsp), %rdx
movq %r13, %rdi
callq 0x3e82
movq %r13, %rdi
callq 0x3dec
leaq 0x10(%rsp), %rdi
callq 0x3458
movq %rbx, 0x10(%r15,%r12,8)
leaq 0x40(%rsp), %r13
movq %r13, %rdi
movq %r14, %rsi
callq 0xa366
movq %r15, %rdi
movl %r12d, %esi
movq %r13, %rdx
callq 0xefc4
movslq (%r14,%r12,4), %r12
movq %r15, 0x10(%rbx,%r12,8)
leaq 0x30(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0xa396
movq %rbx, %rdi
movl %r12d, %esi
movq %r15, %rdx
callq 0xefc4
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x3458
movq %rbx, %rdi
callq 0x33d0
nop
// File: /workspace/github_cpp_makefile_star2_O2/MarkCBell[P]twister/./twister/kernel/twister.cpp
// Function: tetra::ungluesym(int)
void tetra::ungluesym(int whichface)
{
	if (gluedto[whichface] == NULL) 
		return;  // This is correct as it simplifies later loops.
	
	if (gluedto[whichface]->get_gluedto(gluing[whichface][whichface]) == NULL)
		output_error("Non-symmetric gluing detected.");
	
	gluedto[whichface]->set_gluedto(gluing[whichface][whichface], NULL);  // Unglue him from me.
	this->set_gluedto(whichface, NULL);  // Then unglue me from him.
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movslq %esi, %r15
movq 0x10(%rdi,%r15,8), %rax
testq %rax, %rax
je 0xa713
movq %rdi, %rbx
movq %r15, %r12
shlq $0x4, %r12
leaq (%rdi,%r12), %rcx
movslq 0x30(%rcx,%r15,4), %rcx
cmpq $0x0, 0x10(%rax,%rcx,8)
jne 0xa707
leaq 0x6e1f(%rip), %rsi      # 0x114f1
leaq 0x8(%rsp), %r14
leaq 0x7(%rsp), %rdx
movq %r14, %rdi
callq 0x3e82
movq %r14, %rdi
callq 0x3dec
leaq (%rbx,%r12), %r14
addq $0x30, %r14
leaq 0x8(%rsp), %rdi
callq 0x3458
movq 0x10(%rbx,%r15,8), %rax
movslq (%r14,%r15,4), %rcx
andq $0x0, 0x10(%rax,%rcx,8)
andq $0x0, 0x10(%rbx,%r15,8)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x3458
movq %rbx, %rdi
callq 0x33d0
// File: /workspace/github_cpp_makefile_star2_O2/MarkCBell[P]twister/./twister/kernel/twister.cpp
// Function: dual_direction(tetra*)
void tetra::subbedby(tetra *whereglue, int whichface, const perm &how)
{
	// before:    A-B   D free
	// after:     A free   D-B
	
	// A: this
	// D: whereglue
	// B: *gluedto[whichface]
	
	// "how" maps vertices of A to vertices of D
	// (Identity means glue D to B just like A was glued)
	// "how" should be an even permutation.
	
	if (gluedto[whichface] == NULL)
		return;
	if (whereglue->gluedto[how[whichface]] != NULL)
		output_error("Invalid subbedby. Attempted to substitute non-free face.");
	
	perm AtoB = gluing[whichface];
	
	tetra *B = gluedto[whichface];
	ungluesym(whichface);  // Separate A & B.
	B->gluesym(whereglue, AtoB[whichface], how.of(AtoB.inverse()));  // Glue B to D.
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq 0x28(%rdi), %rbx
movslq 0x78(%rbx), %rax
leaq (%rax,%rax,2), %rax
movslq 0x74(%rbx), %r15
addq %rax, %r15
leaq 0x60(%rdi), %rsi
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0xa366
movslq 0xc(%r14), %r14
shlq $0x4, %r15
leaq 0x396f(%rip), %rax      # 0x11930
addq %r15, %rax
movslq (%rax,%r14,4), %r12
cmpq $-0x1, %r12
jne 0xdff9
leaq 0x37a5(%rip), %rsi      # 0x1177a
leaq 0x18(%rsp), %r15
leaq 0x8(%rsp), %rdx
movq %r15, %rdi
callq 0x3e82
movq %r15, %rdi
callq 0x3dec
leaq 0x18(%rsp), %rdi
callq 0x3458
leaq 0x8(%rsp), %rdi
movq %rbx, %rsi
movl %r14d, %edx
callq 0xf05e
movl 0x8(%rsp,%r12,4), %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x3458
movq %rbx, %rdi
callq 0x33d0
nop
// File: /workspace/github_cpp_makefile_star2_O2/MarkCBell[P]twister/./twister/kernel/twister.cpp
// Function: tetra::walk_about(int)
void tetra::walk_about(int fromface)
{
	output_debugging("walk", 3);
	
	if (gluedto[fromface] != NULL)
		return;
	
	// Here's how we start.
	tetra *currenttetra = this;
	perm init_how = perm_walk_about_list[fromface];
	perm how = init_how;
	
	// Now walk around the edge.
	while ((currenttetra->gluedto[how[fromface]]) != NULL)
	{
		int dir = how[fromface];
		how = (currenttetra->get_gluing(dir)).of(how.of(init_how));  // Composition of 3 odd permutations is also odd.
		currenttetra = currenttetra->get_gluedto(dir);
	}
	
	// We've found the last tetra next to the edge
	// so glue it to the first one.
	gluesym(currenttetra, fromface, how);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movl %esi, %ebp
movq %rdi, %r13
leaq 0x6d15(%rip), %rsi      # 0x11549
leaq 0x38(%rsp), %rbx
leaq 0x28(%rsp), %rdx
movq %rbx, %rdi
callq 0x3e82
pushq $0x3
popq %rsi
movq %rbx, %rdi
callq 0x3d1a
leaq 0x38(%rsp), %rdi
callq 0x3458
movslq %ebp, %r15
cmpq $0x0, 0x10(%r13,%r15,8)
jne 0xa901
movl %ebp, 0xc(%rsp)
movq %r15, %rax
shlq $0x4, %rax
leaq 0xedb4(%rip), %rsi      # 0x19630
addq %rax, %rsi
leaq 0x28(%rsp), %rbx
movq %rbx, %rdi
callq 0xa366
leaq 0x18(%rsp), %r12
movq %r12, %rdi
movq %rbx, %rsi
callq 0xa366
leaq 0x68(%rsp), %rbp
leaq 0x58(%rsp), %rbx
movq %r13, 0x10(%rsp)
movslq 0x18(%rsp,%r15,4), %r14
cmpq $0x0, 0x10(%r13,%r14,8)
je 0xa8eb
movq %rbp, %rdi
movq %r13, %rsi
movl %r14d, %edx
callq 0xf05e
movq %rbx, %rdi
movq %r12, %rsi
leaq 0x28(%rsp), %rdx
callq 0xa3c4
movq %r12, %rdi
movq %rbp, %rsi
movq %rbx, %rdx
callq 0xa3c4
movq 0x10(%r13,%r14,8), %r13
jmp 0xa8ab
leaq 0x18(%rsp), %rcx
movq 0x10(%rsp), %rdi
movq %r13, %rsi
movl 0xc(%rsp), %edx
callq 0xa5d2
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x3458
movq %rbx, %rdi
callq 0x33d0
nop
// File: /workspace/github_cpp_makefile_star2_O2/MarkCBell[P]twister/./twister/kernel/twister.cpp
// Function: glue_cubes(cube*, cube*, bool, bool)
void glue_cubes(cube *c1, cube *c2, bool u1, bool u2)
{
	// Depending on the orientations of c1 and c2, glue some
	// vertical face of cube c1 to some vertical face of cube c2.
	int toface = u1 ? 1 : 0;
	perm howto = u1 ? perm(0,2,1,3) : perm(2,1,0,3);
	
	if (u1 && u2)
	{
		(c1->get_tetra(low, right))->gluesym(c2->get_tetra(low, left), toface, howto);
		(c1->get_tetra(top, right))->gluesym(c2->get_tetra(top, left), toface, howto);
	}
	else if (u1 && !u2)
	{
		(c1->get_tetra(low, right))->gluesym(c2->get_tetra(low, right), toface, howto);
		(c1->get_tetra(top, right))->gluesym(c2->get_tetra(mid, right), toface, howto);
	}
	else if (!u1 && u2)
	{
		(c1->get_tetra(mid, left))->gluesym(c2->get_tetra(low, left), toface, howto);
		(c1->get_tetra(top, left))->gluesym(c2->get_tetra(top, left), toface, howto);
	}
	else if (!u1 && !u2)
	{
		(c1->get_tetra(mid, left))->gluesym(c2->get_tetra(low, right), toface, howto);
		(c1->get_tetra(top, left))->gluesym(c2->get_tetra(mid, right), toface, howto);
	}
	
	return;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movl %ecx, %ebp
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x8(%rsp), %rdi
testl %edx, %edx
je 0xac7f
pushq $0x2
popq %rdx
pushq $0x1
popq %rcx
pushq $0x3
popq %r8
xorl %esi, %esi
callq 0x6790
movq 0x28(%r15), %rdi
addq $0x18, %r15
jmp 0xac94
pushq $0x2
popq %rsi
pushq $0x1
popq %rdx
pushq $0x3
popq %r8
xorl %ecx, %ecx
callq 0x6790
movq 0x8(%r15), %rdi
testb %bpl, %bpl
je 0xacab
movq 0x10(%r14), %rsi
leaq 0x8(%rsp), %rcx
movl %ebx, %edx
callq 0xa5d2
jmp 0xacbf
movq 0x28(%r14), %rsi
leaq 0x8(%rsp), %rcx
movl %ebx, %edx
callq 0xa5d2
addq $0x20, %r14
movq (%r15), %rdi
movq (%r14), %rsi
leaq 0x8(%rsp), %rcx
movl %ebx, %edx
callq 0xa5d2
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/MarkCBell[P]twister/./twister/kernel/twister.cpp
// Function: annulus::annulus(std::vector<cube*, std::allocator<cube*>> const&, std::vector<bool, std::allocator<bool>> const&)
annulus::annulus(const std::vector<cube*> &sq_in, const std::vector<bool> &upright_in)
{
	length = int(sq_in.size());
	
	sq = new cube*[length];
	upright = new bool[length];
	
	for (int i = 0; i < length; i++)
	{
		sq[i] = sq_in[i];
		upright[i] = upright_in[i];
	}
	
	// Check for self-intersection.
	for (int i = 0; i < length; i++)
		for (int j = i + 1; j < length; j++)
			if (sq[i] == sq[j])
				output_error("An annulus must not intersect itself.");
	
	// Now glue the cubes together.
	for (int i = 0; i < length; i++)
		glue_cubes(sq[i], sq[(i+1) % length], upright[i], upright[(i+1) % length]);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq 0x8(%rsi), %rax
subq (%rsi), %rax
movq %rax, %r13
shrq $0x3, %r13
movl %r13d, (%rdi)
shlq $0x1d, %rax
movq %rax, %rcx
sarq $0x1d, %rcx
testq %rax, %rax
pushq $-0x1
popq %rdi
cmovnsq %rcx, %rdi
callq 0x3030
movq %rax, 0x8(%rbx)
movslq %r13d, %rdi
callq 0x3030
movq %rax, 0x10(%rbx)
xorl %r12d, %r12d
movslq %r13d, %rax
cmpq %rax, %r12
jge 0xb765
movq (%r15), %rax
movq (%rax,%r12,8), %rax
movq 0x8(%rbx), %rcx
movq %rax, (%rcx,%r12,8)
movq %r14, %rdi
movq %r12, %rsi
callq 0xf0b2
movq 0x10(%rbx), %rcx
movb %al, (%rcx,%r12)
incq %r12
movl (%rbx), %r13d
jmp 0xb733
pushq $0x1
popq %r14
xorl %ebp, %ebp
leaq 0x18(%rsp), %r15
leaq 0x7(%rsp), %r12
movslq %r13d, %rax
cmpq %rax, %rbp
jge 0xb7d7
leaq 0x1(%rbp), %rax
movq %rax, 0x8(%rsp)
movq %r14, 0x10(%rsp)
cmpl %r14d, %r13d
jle 0xb7c8
movq 0x8(%rbx), %rax
movq (%rax,%rbp,8), %rcx
cmpq (%rax,%r14,8), %rcx
jne 0xb7c3
movq %r15, %rdi
leaq 0x5db3(%rip), %rsi      # 0x1155b
movq %r12, %rdx
callq 0x3e82
movq %r15, %rdi
callq 0x3dec
movq %r15, %rdi
callq 0x3458
movl (%rbx), %r13d
incq %r14
jmp 0xb78b
movq 0x10(%rsp), %r14
incq %r14
movq 0x8(%rsp), %rbp
jmp 0xb775
xorl %ecx, %ecx
movslq %r13d, %rax
cmpq %rax, %rcx
jge 0xb815
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %r8
movq (%rsi,%rcx,8), %rdi
leaq 0x1(%rcx), %r14
movl %r14d, %eax
cltd
idivl %r13d
movq (%rsi,%rdx,8), %rsi
movzbl (%r8,%rcx), %eax
movzbl (%r8,%rdx), %ecx
movl %eax, %edx
callq 0xac47
movl (%rbx), %r13d
movq %r14, %rcx
jmp 0xb7d9
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x3458
movq %rbx, %rdi
callq 0x33d0
nop
// File: /workspace/github_cpp_makefile_star2_O2/MarkCBell[P]twister/./twister/kernel/twister.cpp
// Function: annulus::annulus(annulus const&)
annulus::annulus(const annulus &a)
{
	length = a.length;
	
	sq = new cube*[length];
	upright = new bool[length];
	
	for (int i = 0; i < length; i++)
	{
		sq[i] = a.sq[i];
		upright[i] = a.upright[i];
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movslq (%rsi), %r15
leaq (,%r15,8), %rax
testq %r15, %r15
movl %r15d, (%rdi)
pushq $-0x1
popq %rdi
cmovnsq %rax, %rdi
callq 0x3030
movq %rax, 0x8(%r14)
movq %r15, %rdi
callq 0x3030
movq %rax, 0x10(%r14)
xorl %eax, %eax
testl %r15d, %r15d
movl $0x0, %ecx
cmovgl %r15d, %ecx
cmpq %rax, %rcx
je 0xb8a8
movq 0x8(%rbx), %rdx
movq (%rdx,%rax,8), %rdx
movq 0x8(%r14), %rsi
movq %rdx, (%rsi,%rax,8)
movq 0x10(%rbx), %rdx
movb (%rdx,%rax), %dl
movq 0x10(%r14), %rsi
movb %dl, (%rsi,%rax)
incq %rax
jmp 0xb880
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/MarkCBell[P]twister/./twister/kernel/twister.cpp
// Function: rectangle::rectangle(std::vector<cube*, std::allocator<cube*>> const&, std::vector<bool, std::allocator<bool>> const&)
rectangle::rectangle(const std::vector<cube*> &sq_in, const std::vector<bool> &upright_in)
{
	front = -1;
	back = -1;
	one_ended = false;
	
	length = int(sq_in.size());
	
	sq = new cube*[length];
	upright = new bool[length];
	
	for (int i = 0; i < length; i++)
	{
		sq[i] = sq_in[i];
		upright[i] = upright_in[i];
	}
	
	// Check for self-intersection.
	for (int i = 0; i < length; i++)
		for (int j = i + 1; j < length; j++)
			if (sq[i] == sq[j])
				output_error("A rectangle must not intersect itself.");
	
	// Now glue the cubes together.
	for (int i = 0; i < length - 1; i++)
		glue_cubes(sq[i], sq[i+1], upright[i], upright[i+1]);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
orq $-0x1, 0x18(%rdi)
movq %rdx, %r14
movq %rsi, %r15
movb $0x0, 0x20(%rdi)
movq 0x8(%rsi), %rax
subq (%rsi), %rax
movq %rax, %r13
shrq $0x3, %r13
movl %r13d, (%rdi)
shlq $0x1d, %rax
movq %rax, %rcx
sarq $0x1d, %rcx
testq %rax, %rax
pushq $-0x1
popq %rdi
cmovnsq %rcx, %rdi
callq 0x3030
movq %rax, 0x8(%rbx)
movslq %r13d, %rdi
callq 0x3030
movq %rax, 0x10(%rbx)
xorl %r12d, %r12d
movslq %r13d, %rax
cmpq %rax, %r12
jge 0xcae6
movq (%r15), %rax
movq (%rax,%r12,8), %rax
movq 0x8(%rbx), %rcx
movq %rax, (%rcx,%r12,8)
movq %r14, %rdi
movq %r12, %rsi
callq 0xf0b2
movq 0x10(%rbx), %rcx
movb %al, (%rcx,%r12)
incq %r12
movl (%rbx), %r13d
jmp 0xcab4
pushq $0x1
popq %r14
xorl %ebp, %ebp
leaq 0x18(%rsp), %r15
leaq 0x7(%rsp), %r12
movslq %r13d, %rax
cmpq %rax, %rbp
jge 0xcb58
leaq 0x1(%rbp), %rax
movq %rax, 0x8(%rsp)
movq %r14, 0x10(%rsp)
cmpl %r14d, %r13d
jle 0xcb49
movq 0x8(%rbx), %rax
movq (%rax,%rbp,8), %rcx
cmpq (%rax,%r14,8), %rcx
jne 0xcb44
movq %r15, %rdi
leaq 0x4acd(%rip), %rsi      # 0x115f6
movq %r12, %rdx
callq 0x3e82
movq %r15, %rdi
callq 0x3dec
movq %r15, %rdi
callq 0x3458
movl (%rbx), %r13d
incq %r14
jmp 0xcb0c
movq 0x10(%rsp), %r14
incq %r14
movq 0x8(%rsp), %rbp
jmp 0xcaf6
xorl %eax, %eax
decl %r13d
movslq %r13d, %rcx
cmpq %rcx, %rax
jge 0xcb92
leaq 0x1(%rax), %r14
movq 0x8(%rbx), %rcx
movq 0x10(%rbx), %r8
movq (%rcx,%rax,8), %rdi
movq 0x8(%rcx,%rax,8), %rsi
movzbl (%rax,%r8), %edx
movzbl 0x1(%rax,%r8), %ecx
callq 0xac47
movl (%rbx), %r13d
movq %r14, %rax
jmp 0xcb5a
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x3458
movq %rbx, %rdi
callq 0x33d0
// File: /workspace/github_cpp_makefile_star2_O2/MarkCBell[P]twister/./twister/kernel/twister.cpp
// Function: rectangle::rectangle(rectangle const&)
rectangle::rectangle(const rectangle &r)
{
	length = r.length;
	
	sq = new cube*[length];
	upright = new bool[length];
	
	for (int i = 0; i < length; i++)
	{
		sq[i] = r.sq[i];
		upright[i] = r.upright[i];
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movslq (%rsi), %r15
leaq (,%r15,8), %rax
testq %r15, %r15
movl %r15d, (%rdi)
pushq $-0x1
popq %rdi
cmovnsq %rax, %rdi
callq 0x3030
movq %rax, 0x8(%r14)
movq %r15, %rdi
callq 0x3030
movq %rax, 0x10(%r14)
xorl %eax, %eax
testl %r15d, %r15d
movl $0x0, %ecx
cmovgl %r15d, %ecx
cmpq %rax, %rcx
je 0xcc24
movq 0x8(%rbx), %rdx
movq (%rdx,%rax,8), %rdx
movq 0x8(%r14), %rsi
movq %rdx, (%rsi,%rax,8)
movq 0x10(%rbx), %rdx
movb (%rdx,%rax), %dl
movq 0x10(%r14), %rsi
movb %dl, (%rsi,%rax)
incq %rax
jmp 0xcbfc
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/MarkCBell[P]twister/./twister/kernel/twister.cpp
// Function: swirl(manifold*, tetra*, int)
tetra *swirl(manifold *M, tetra *current, int layer_number)
{
	for (int i = 0; i < 3; i++)
	{
		if (current->get_gluedto(i) != NULL)
			continue;  // Stop us going backwards.
		
		current->walk_about(i);
		
		if ((current->get_gluedto(i))->get_layer() != layer_number) 
			current->ungluesym(i);  // Nope, don't want to go out of the layer.
		else if (current->get_gluedto(i)->get_category() == gadget_pup)
		{
			tetra *next_tetra = new tetra(M, filler);
			current->subbedby(next_tetra, i, perm_walk_list[i]);
			current->walk_about(i);
			current = next_tetra;
			break;
		}
		else
			current->ungluesym(i);  // Nope, don't want to go that way.
	}
	
	for (int i = 0; i < 3; i++)
	{
		if (current->get_gluedto(i) != NULL)
			continue;  // Stop us going backwards.
		
		current->walk_about(i);
		
		if (current->get_gluedto(i)->get_layer() != layer_number)
			current->ungluesym(i);  // Nope, don't want to go out of the layer.
		else if (current->get_gluedto(i)->get_category() != gadget_pup)
		{
			tetra *next_tetra = new tetra(M, filler);
			current->subbedby(next_tetra, i, perm_walk_list[i]);
			current->walk_about(i);
			current = next_tetra;
			break;
		}
		else
			current->ungluesym(i);  // Nope, don't want to go that way.
	}
	return current;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %r15
movq %rdi, %rbx
leaq 0xc7aa(%rip), %r13      # 0x19660
xorl %r12d, %r12d
cmpq $0x3, %r12
je 0xcef9
cmpq $0x0, 0x10(%r15,%r12,8)
jne 0xcef0
movq %r15, %rdi
movl %r12d, %esi
callq 0xa81a
movq 0x10(%r15,%r12,8), %rax
cmpl %ebp, 0x90(%rax)
jne 0xcee5
cmpl $0x6, 0x70(%rax)
je 0xcf5b
movq %r15, %rdi
movl %r12d, %esi
callq 0xa698
incq %r12
addq $0x10, %r13
jmp 0xceb9
movq %r15, %r14
leaq 0xc75d(%rip), %r12      # 0x19660
xorl %r15d, %r15d
cmpq $0x3, %r15
je 0xcf46
cmpq $0x0, 0x10(%r14,%r15,8)
jne 0xcf3d
movq %r14, %rdi
movl %r15d, %esi
callq 0xa81a
movq 0x10(%r14,%r15,8), %rax
cmpl %ebp, 0x90(%rax)
jne 0xcf32
cmpl $0x6, 0x70(%rax)
jne 0xcfa7
movq %r14, %rdi
movl %r15d, %esi
callq 0xa698
incq %r15
addq $0x10, %r12
jmp 0xcf06
movq %r14, %r13
movq %r13, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0xc0, %edi
callq 0x3240
movq %rax, %r14
andq $0x0, (%rsp)
pushq $0x7
popq %rdx
pushq $0x3
popq %rcx
pushq $0x2
popq %r8
pushq $-0x1
popq %r9
movq %rax, %rdi
movq %rbx, %rsi
callq 0xa3fa
movq %r15, %rdi
movq %r14, %rsi
movl %r12d, %edx
movq %r13, %rcx
callq 0xa734
movq %r15, %rdi
movl %r12d, %esi
callq 0xa81a
jmp 0xcefc
movl $0xc0, %edi
callq 0x3240
movq %rax, %r13
andq $0x0, (%rsp)
pushq $0x7
popq %rdx
pushq $0x3
popq %rcx
pushq $0x2
popq %r8
pushq $-0x1
popq %r9
movq %rax, %rdi
movq %rbx, %rsi
callq 0xa3fa
movq %r14, %rdi
movq %r13, %rsi
movl %r15d, %edx
movq %r12, %rcx
callq 0xa734
movq %r14, %rdi
movl %r15d, %esi
callq 0xa81a
jmp 0xcf49
movq %rax, %rbx
movq %r13, %r14
jmp 0xcffe
movq %rax, %rbx
movl $0xc0, %esi
movq %r14, %rdi
callq 0x3250
movq %rbx, %rdi
callq 0x33d0
// File: /workspace/github_cpp_makefile_star2_O2/MarkCBell[P]twister/./twister/kernel/twister.cpp
// Function: tunnel_walk(manifold*, tetra*, int)
tetra *tunnel_walk(manifold *M, tetra *current, int layer_number)
{
	for (int i = 0; i < 3; i++)
	{
		if (current->get_gluedto(i) != NULL)
			continue;  // Stop us going backwards.
		
		current->walk_about(i);
		
		if (current->get_gluedto(i)->get_layer() != layer_number) 
			current->ungluesym(i);  // Nope, don't want to go out of the layer.
		else if (current->get_gluedto(i)->get_category() == current->get_gluedto(3)->get_category())
		{
			tetra *next_tetra = new tetra(M, filler);
			current->subbedby(next_tetra, i, perm_walk_list[i]);
			current->walk_about(i);
			current = next_tetra;
			break;
		}
		else
			current->ungluesym(i);  // Nope, don't want to go that way.
	}
	return current;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r12
leaq 0xc633(%rip), %r15      # 0x19660
xorl %r14d, %r14d
cmpq $0x3, %r14
je 0xd076
cmpq $0x0, 0x10(%rbx,%r14,8)
jne 0xd06d
movq %rbx, %rdi
movl %r14d, %esi
callq 0xa81a
movq 0x10(%rbx,%r14,8), %rax
cmpl %ebp, 0x90(%rax)
jne 0xd062
movl 0x70(%rax), %eax
movq 0x28(%rbx), %rcx
cmpl 0x70(%rcx), %eax
je 0xd08b
movq %rbx, %rdi
movl %r14d, %esi
callq 0xa698
incq %r14
addq $0x10, %r15
jmp 0xd030
movq %rbx, %r13
movq %r13, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0xc0, %edi
callq 0x3240
movq %rax, %r13
andq $0x0, (%rsp)
pushq $0x7
popq %rdx
pushq $0x3
popq %rcx
pushq $0x2
popq %r8
pushq $-0x1
popq %r9
movq %rax, %rdi
movq %r12, %rsi
callq 0xa3fa
movq %rbx, %rdi
movq %r13, %rsi
movl %r14d, %edx
movq %r15, %rcx
callq 0xa734
movq %rbx, %rdi
movl %r14d, %esi
callq 0xa81a
jmp 0xd079
movq %rax, %rbx
movl $0xc0, %esi
movq %r13, %rdi
callq 0x3250
movq %rbx, %rdi
callq 0x33d0
// File: /workspace/github_cpp_makefile_star2_O2/MarkCBell[P]twister/./twister/kernel/twister.cpp
// Function: boundary_walk(manifold*, tetra*, int)
tetra *boundary_walk(manifold *M, tetra *current, int layer_number)
{
	for (int i = 0; i < 3; i++)
	{
		if (current->get_gluedto(i) != NULL)
			continue;  // Stop us going backwards.
		
		current->walk_about(i);
		
		if (current->get_gluedto(i)->get_category() == marker)  // Good, we hit a marker we put in at the start.
		{
			return current->get_gluedto(i);  // We've already glued current to the marker, so just return it.
		}
		else if (current->get_gluedto(i)->get_layer() != layer_number)
			current->ungluesym(i);  // Nope, don't want to go out of the layer.
		else if (current->get_gluedto(i)->get_category() != gadget_pup)
		{
			tetra *next_tetra = new tetra(M, filler);
			current->subbedby(next_tetra, i, perm_walk_list[i]);
			current->walk_about(i);
			current = next_tetra;
			break;
		}
		else
			current->ungluesym(i);  // Nope, don't want to go that way.
	}
	return current;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r12
leaq 0xc55a(%rip), %r15      # 0x19660
xorl %r14d, %r14d
cmpq $0x3, %r14
je 0xd158
cmpq $0x0, 0x10(%rbx,%r14,8)
jne 0xd14f
movq %rbx, %rdi
movl %r14d, %esi
callq 0xa81a
movq 0x10(%rbx,%r14,8), %r13
movl 0x70(%r13), %eax
cmpl $0x8, %eax
je 0xd1a4
cmpl %ebp, 0x90(%r13)
setne %cl
cmpl $0x6, %eax
sete %al
orb %cl, %al
je 0xd15d
movq %rbx, %rdi
movl %r14d, %esi
callq 0xa698
incq %r14
addq $0x10, %r15
jmp 0xd109
movq %rbx, %r13
jmp 0xd1a4
movl $0xc0, %edi
callq 0x3240
movq %rax, %r13
andq $0x0, (%rsp)
pushq $0x7
popq %rdx
pushq $0x3
popq %rcx
pushq $0x2
popq %r8
pushq $-0x1
popq %r9
movq %rax, %rdi
movq %r12, %rsi
callq 0xa3fa
movq %rbx, %rdi
movq %r13, %rsi
movl %r14d, %edx
movq %r15, %rcx
callq 0xa734
movq %rbx, %rdi
movl %r14d, %esi
callq 0xa81a
movq %r13, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movl $0xc0, %esi
movq %r13, %rdi
callq 0x3250
movq %rbx, %rdi
callq 0x33d0
// File: /workspace/github_cpp_makefile_star2_O2/MarkCBell[P]twister/./twister/kernel/twister.cpp
// Function: manifold::manifold(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, Manifold_type)
manifold::manifold(std::string name_in, Manifold_type mytype)
{
	output_debugging("manifold", 2);
	
	name = name_in;
	manifold_type = mytype;
	num_layers = 0;
	num_cusps = 0;
	
	first_tetra = NULL;
	last_tetra = NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x30, %rsp
movl %edx, %ebp
movq %rsi, %r15
movq %rdi, %r14
leaq 0x18(%rdi), %rbx
leaq 0x28(%rdi), %rax
movq %rax, 0x18(%rdi)
andq $0x0, 0x20(%rdi)
movb $0x0, 0x28(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x40(%rdi)
movups %xmm0, 0x50(%rdi)
movups %xmm0, 0x60(%rdi)
leaq 0x4123(%rip), %rsi      # 0x1181e
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x3e82
leaq 0x10(%rsp), %rdi
pushq $0x2
popq %rsi
callq 0x3d1a
leaq 0x10(%rsp), %rdi
callq 0x3458
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3160
movl %ebp, 0x10(%r14)
andq $0x0, 0x38(%r14)
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0xd75a
movq %rax, %r15
leaq 0x10(%rsp), %rdi
callq 0x3458
jmp 0xd75d
movq %rax, %r15
leaq 0x40(%r14), %r12
addq $0x58, %r14
movq %r14, %rdi
callq 0xf692
movq %r12, %rdi
callq 0x6f9c
movq %rbx, %rdi
callq 0x3458
movq %r15, %rdi
callq 0x33d0
nop
// File: /workspace/github_cpp_makefile_star2_O2/MarkCBell[P]twister/./twister/kernel/twister.cpp
// Function: manifold::~manifold()
manifold::~manifold()
{
	output_debugging("demanifold", 2);
	
	// Repeatedly remove the first tetrahedra until there's nothing left.
	while (first_tetra)
		oneless(first_tetra);
	
	for (int i = 0; i < int(cubes.size()); i++)
		delete cubes[i];
	
	return;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
leaq 0x3e8d(%rip), %rsi      # 0x11628
leaq 0x8(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x3e82
leaq 0x8(%rsp), %rdi
pushq $0x2
popq %rsi
callq 0x3d1a
leaq 0x8(%rsp), %rdi
callq 0x3458
movq (%rbx), %rsi
testq %rsi, %rsi
je 0xd7d3
movq %rbx, %rdi
callq 0xd83a
jmp 0xd7c1
leaq 0x40(%rbx), %r14
xorl %r12d, %r12d
pushq $0x40
popq %r15
movq 0x40(%rbx), %rax
movq 0x48(%rbx), %rcx
subq %rax, %rcx
shrq $0x3, %rcx
movslq %ecx, %rcx
cmpq %rcx, %r12
jge 0xd806
movq (%rax,%r12,8), %rdi
movq %r15, %rsi
callq 0x3250
incq %r12
jmp 0xd7de
leaq 0x58(%rbx), %rdi
callq 0xf692
movq %r14, %rdi
callq 0x6f9c
addq $0x18, %rbx
movq %rbx, %rdi
callq 0x3458
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0xd831
movq %rax, %rdi
callq 0x683d
nop
// File: /workspace/github_cpp_makefile_star2_O2/MarkCBell[P]twister/./twister/kernel/twister.cpp
// Function: manifold::oneless(tetra*)
void manifold::oneless(tetra *oldguy)
{
	// 1) Unglue each face.
	for (int i = 0; i < 4; i++)
		oldguy->ungluesym(i);
	
	// Maintain the doubly linked list.
	// 2a) Go to prev and fix next, go to next and fix prev.
	// 2b) Fix first and last (if needed).
	if (oldguy->get_prev() != NULL) 
		oldguy->get_prev()->set_next(oldguy->get_next()); 
	else 
		first_tetra = oldguy->get_next();
	
	if (oldguy->get_next() != NULL) 
		oldguy->get_next()->set_prev(oldguy->get_prev());
	else 
		last_tetra = oldguy->get_prev();
	
	// 3) Delete the oldguy.
	delete oldguy;
	
	return;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
xorl %ebp, %ebp
cmpl $0x4, %ebp
je 0xd859
movq %rbx, %rdi
movl %ebp, %esi
callq 0xa698
incl %ebp
jmp 0xd846
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
testq %rcx, %rcx
movq %rcx, %rdx
cmoveq %r14, %rdx
movq %rax, (%rdx)
testq %rax, %rax
cmoveq %r14, %rax
movq %rcx, 0x8(%rax)
callq 0xa594
movl $0xc0, %esi
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x3250
// File: /workspace/github_cpp_makefile_star2_O2/MarkCBell[P]twister/./twister/kernel/twister.cpp
// Function: edge_degree(tetra*, int, int)
int edge_degree(tetra *basepoint, int a, int b)
{
	// c and d are the indices of the other two vertices.
	int c = (a+1) % 4;
	if (c == b) c = (c+1) % 4;
	int d = 6 - (a + b + c);
	
	tetra *current = basepoint;
	int current_c = c;
	int current_d = d;
	int count = 0;
	do
	{
		perm p = current->get_gluing(current_c);
		current = current->get_gluedto(current_c);
		int old_d = current_d;
		current_d = p[current_c];
		current_c = p[old_d];
		count++;
	} while (!((current == basepoint) && (current_c == c) && (current_d == d)));
	
	return count;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, %ecx
movq %rdi, %rbx
leal 0x1(%rsi), %eax
pushq $0x4
popq %rdi
cltd
idivl %edi
movl %edx, %ebp
cmpl %ecx, %edx
jne 0xda4b
leal 0x1(%rcx), %eax
cbtw
movb $0x4, %dl
idivb %dl
movsbl %ah, %ebp
addl %ecx, %esi
addl %ebp, %esi
pushq $0x6
popq %rax
subl %esi, %eax
xorl %r14d, %r14d
movq %rbx, %r12
movl %ebp, %r13d
movl %eax, 0x4(%rsp)
movl %eax, %r15d
leaq 0x8(%rsp), %rdi
movq %r12, %rsi
movl %r13d, %edx
callq 0xf05e
movslq %r13d, %rax
movq 0x10(%r12,%rax,8), %r12
movl 0x8(%rsp,%rax,4), %eax
movslq %r15d, %rcx
movl 0x8(%rsp,%rcx,4), %r13d
incl %r14d
cmpq %rbx, %r12
jne 0xda61
cmpl %ebp, %r13d
jne 0xda61
cmpl 0x4(%rsp), %eax
jne 0xda61
movl %r14d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/MarkCBell[P]twister/./twister/kernel/twister.cpp
// Function: manifold::tidy_boundary()
void manifold::tidy_boundary()
{
	if (GLOBAL_calculate_peripheral_curves) insert_layer();  // We'll need an extra layer to find the longitudes in.
	
	tetra *capoff_tetra = capoff();  // Deal with boundary faces with a mandatory capoff().
	identify_cusps(capoff_tetra);  // Compute the cusps and their number.
	if (GLOBAL_calculate_peripheral_curves) canonical_peripheral_curves(capoff_tetra);
	if (GLOBAL_optimise) capoff_tetra = foldoff(capoff_tetra);  // If allowed to optimise, reduce the number of tetrahedra by folding off.
	return;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0xa6cd(%rip), %r15      # 0x1923a
cmpb $0x1, (%r15)
jne 0xeb7b
movq %rbx, %rdi
callq 0xc7d2
movq %rbx, %rdi
callq 0xd88e
movq %rax, %r14
movq %rbx, %rdi
movq %rax, %rsi
callq 0xdaae
cmpb $0x1, (%r15)
jne 0xeba2
movq %rbx, %rdi
movq %r14, %rsi
callq 0xe030
leaq 0xa690(%rip), %rax      # 0x19239
cmpb $0x1, (%rax)
jne 0xebbe
movq %rbx, %rdi
movq %r14, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0xe83c
popq %rbx
popq %r14
popq %r15
retq