// File: 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
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x10(%rbp), %rdi
callq 0x9b10
movq %rax, %rcx
movq -0x68(%rbp), %rax
movl %ecx, (%rax)
movslq (%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x3030
movq %rax, %rcx
movq -0x68(%rbp), %rax
movq %rcx, 0x8(%rax)
movslq (%rax), %rdi
callq 0x3030
movq %rax, %rcx
movq -0x68(%rbp), %rax
movq %rcx, 0x10(%rax)
movl $0x0, -0x1c(%rbp)
movq -0x68(%rbp), %rcx
movl -0x1c(%rbp), %eax
cmpl (%rcx), %eax
jge 0x19724
movq -0x10(%rbp), %rdi
movslq -0x1c(%rbp), %rsi
callq 0x20f70
movq %rax, %rcx
movq -0x68(%rbp), %rax
movq (%rcx), %rdx
movq 0x8(%rax), %rax
movslq -0x1c(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x18(%rbp), %rdi
movslq -0x1c(%rbp), %rsi
callq 0x20f90
movb %al, %dl
movq -0x68(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x1c(%rbp), %rcx
andb $0x1, %dl
movb %dl, (%rax,%rcx)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x196ca
movl $0x0, -0x20(%rbp)
movq -0x68(%rbp), %rcx
movl -0x20(%rbp), %eax
cmpl (%rcx), %eax
jge 0x19803
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
movq -0x68(%rbp), %rcx
movl -0x24(%rbp), %eax
cmpl (%rcx), %eax
jge 0x197f3
movq -0x68(%rbp), %rcx
movq 0x8(%rcx), %rax
movslq -0x20(%rbp), %rdx
movq (%rax,%rdx,8), %rax
movq 0x8(%rcx), %rcx
movslq -0x24(%rbp), %rdx
cmpq (%rcx,%rdx,8), %rax
jne 0x197e3
leaq -0x49(%rbp), %rdi
movq %rdi, -0x70(%rbp)
callq 0x3560
movq -0x70(%rbp), %rdx
leaq 0xddb7(%rip), %rsi      # 0x2753f
leaq -0x48(%rbp), %rdi
callq 0x4e10
jmp 0x19793
leaq -0x48(%rbp), %rdi
callq 0x4d40
jmp 0x1979e
leaq -0x48(%rbp), %rdi
callq 0x35f8
leaq -0x49(%rbp), %rdi
callq 0x3360
jmp 0x197e3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x197d5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x35f8
leaq -0x49(%rbp), %rdi
callq 0x3360
jmp 0x1988d
jmp 0x197e5
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x19743
jmp 0x197f5
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x1972b
movl $0x0, -0x60(%rbp)
movq -0x68(%rbp), %rcx
movl -0x60(%rbp), %eax
cmpl (%rcx), %eax
jge 0x19884
movq -0x68(%rbp), %r8
movq 0x8(%r8), %rax
movslq -0x60(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movq 0x8(%r8), %rax
movq %rax, -0x80(%rbp)
movl -0x60(%rbp), %eax
addl $0x1, %eax
cltd
idivl (%r8)
movq -0x80(%rbp), %rax
movslq %edx, %rcx
movq (%rax,%rcx,8), %rsi
movq 0x10(%r8), %rax
movslq -0x60(%rbp), %rcx
movb (%rax,%rcx), %cl
movq 0x10(%r8), %rax
movq %rax, -0x78(%rbp)
movl -0x60(%rbp), %eax
addl $0x1, %eax
cltd
idivl (%r8)
movq -0x78(%rbp), %rax
movslq %edx, %rdx
movb (%rax,%rdx), %al
andb $0x1, %cl
andb $0x1, %al
movzbl %cl, %edx
movzbl %al, %ecx
callq 0x18150
movl -0x60(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x60(%rbp)
jmp 0x1980a
addq $0x80, %rsp
popq %rbp
retq
movq -0x58(%rbp), %rdi
callq 0x3550
nopw %cs:(%rax,%rax)