// File: MarkCBell[P]twister/./twister/kernel/twister.cpp
// Function: annulus::twist(Sign)
void annulus::twist(Sign whichway)
{
	// There's a much worse way to do this, which for
	// obscenely large values of "length" (>6?)
	// actually uses fewer tetrahedra.
	// (The idea is: retriangulate the annulus so that 
	// it has length 1 and then do the twist(s).  Then
	// undo the retriangulation.  But this is pointless, 
	// SnapPea will totally change the triangulation, 
	// anyway.   A more general notion is to perform a long 
	// twist by conjugating it to a short one...)
	
	// Every speed bump consists of "length" identical layers.
	// Don't peel them apart.  
	// Never look inside a speed bump.  Trust us.
	output_debugging("twist", 2);
	
	manifold *M = sq[0]->home;
	
	for (int i = 0; i < length; i++)
		sq[i]->set_status(false);
	
	std::vector< std::vector<tetra *> > tet;
	int i, j;
	
	// Create a bunch of tetrahedra. We'll refer
	// to tet[i][j] as the new tetrahedron in the
	// i^th row (from the bottom) and j^th column
	// (from the left). 
	
	for( i = 0; i < length; i++ )
	{
		std::vector<tetra *> next_row;
		for( j = 0; j < length; j++ )
			next_row.push_back(new tetra(M, speedbump));
		
		tet.push_back(next_row);
	}
	
	// First thing to do is glue all tetras in a column
	// along their "blue faces".  (For terminology, refer
	// to a certain paper tablecloth in the new Thai
	// restaurant on Bancroft above Telegraph.)
	// Thus loop over j first (sorry 'bout that). 
	// While we're at it we'll attach the last 
	// and first blue face to the ceiling and floor.
	//
	// Keep gluing 'til you're blue in the face.
	
	for( j = 0; j < length; j++ ) 
	{
		for( i = 0; i < length - 1; i++ )
			tet[i][j]->gluesym(tet[i+1][j], 2, perm(0,1,3,2));
		
		// Attach the top of the column to the ceiling and the bottom of the column to the floor.
		sq[j]->topright->subbedby(tet[length-1][j], 2, (upright[j]) ? perm(0,1,2,3) : perm(1,3,2,0));
		sq[j]->topright->gluesym(tet[0][j], 2, (upright[j]) ? perm(0,1,3,2) : perm(1,2,3,0));
	}
	
	// That finishes off the blue faces.  
	// Now to glue neighboring columns together
	// along the "red" faces. While we're at it
	// we'll attach the left-over red faces to the 
	// ceiling and floor. This is a bit tricky, so 
	// watch carefully. Follow the red card...
	
	for( j = 0; j < length; j++ )
	{
		int next = (j+1) % length;
		int begin, end;
		
		// Assuming here that true == 1 and false == 0.
		int offset = whichway*(!upright[j] + upright[next]);
		
		if (whichway == plus)
		{
			begin = offset;
			end = length;
		}
		else
		{
			begin = 0;
			end = length + offset;
		}
		
		// Gluing the columns together.
		for( i = begin; i < end; i++ )
			tet[i][j]->gluesym(tet[i - offset][next], 1, perm(1,0,2,3));
		
		// Now glue the left over red faces on top to the 
		// ceiling using subbedby. Then glue remaining red
		// faces (on the bottom) to the newly available floor.
		
		if ( upright[j] && upright[next] )
		{
			// The offset is whichway*1.
			if (whichway == plus)
			{
				sq[next]->topleft->subbedby(tet[length - 1][next], 1, perm(1,0,3,2));
				sq[next]->topleft->gluesym(tet[0][j], 1, perm(0,1,3,2));
			}
			else
			{
				sq[next]->topleft->subbedby(tet[length - 1][j], 1, perm(0,1,2,3));
				sq[next]->topleft->gluesym(tet[0][next], 1, perm(1,0,2,3));
			}
		}      
		if ( upright[j] && !upright[next] )
		{
			// The offset is zero, so there are 
			// no left-over red faces.  :)
		}      
		
		if ( !upright[j] && upright[next] )
		{
			// The offset is whichway*2.
			if (whichway == plus)
			{
				sq[next]->topleft->subbedby(tet[length - 1][next], 1, perm(1, 0, 3, 2));
				sq[next]->topleft->gluesym(tet[1][j], 1, perm(0,1,3,2));
				
				sq[j]->topleft->subbedby(tet[length - 2][next], 1, perm(2, 0, 1, 3));
				sq[j]->topleft->gluesym(tet[0][j], 1, perm(2,1,0,3));
			}
			else
			{
				sq[j]->topleft->subbedby(tet[length - 1][j], 1, perm(3, 1, 0, 2));
				sq[j]->topleft->gluesym(tet[1][next], 1, perm(3, 0, 1, 2));
				
				sq[next]->topleft->subbedby(tet[length - 2][j], 1, perm(0,1,2,3));
				sq[next]->topleft->gluesym(tet[0][next], 1, perm(1,0,2,3));
			}
		}      
		if ( !upright[j] && !upright[next] )
		{
			// The offset is whichway*1.
			if (whichway == plus)
			{
				sq[j]->topleft->subbedby(tet[length - 1][next], 1, perm(2, 0, 1, 3));
				sq[j]->topleft->gluesym(tet[0][j], 1, perm(2,1,0,3));
			}
			else
			{
				sq[j]->topleft->subbedby(tet[length - 1][j], 1, perm(3, 1, 0, 2));
				sq[j]->topleft->gluesym(tet[0][next], 1, perm(3, 0, 1, 2));
			}
		}      
		// Isn't that all perfectly clear?
		// No?  Well, is my face is red!
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x390, %rsp            # imm = 0x390
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x1f8(%rbp)
leaq -0x31(%rbp), %rdi
movq %rdi, -0x1f0(%rbp)
callq 0x3560
movq -0x1f0(%rbp), %rdx
leaq 0xd31b(%rip), %rsi      # 0x27606
leaq -0x30(%rbp), %rdi
callq 0x4e10
jmp 0x1a2f6
leaq -0x30(%rbp), %rdi
movl $0x2, %esi
callq 0x4c10
jmp 0x1a306
leaq -0x30(%rbp), %rdi
callq 0x35f8
leaq -0x31(%rbp), %rdi
callq 0x3360
movq -0x1f8(%rbp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rax
movq 0x38(%rax), %rax
movq %rax, -0x50(%rbp)
movl $0x0, -0x54(%rbp)
movq -0x1f8(%rbp), %rcx
movl -0x54(%rbp), %eax
cmpl (%rcx), %eax
jge 0x1a399
movq -0x1f8(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x54(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
xorl %esi, %esi
callq 0x9b30
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0x1a335
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x1a38b
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 0x1b27f
leaq -0x70(%rbp), %rdi
callq 0x20fe0
movl $0x0, -0x74(%rbp)
movq -0x1f8(%rbp), %rcx
movl -0x74(%rbp), %eax
cmpl (%rcx), %eax
jge 0x1a4c2
leaq -0x90(%rbp), %rdi
callq 0x21000
movl $0x0, -0x78(%rbp)
movq -0x1f8(%rbp), %rcx
movl -0x78(%rbp), %eax
cmpl (%rcx), %eax
jge 0x1a485
movl $0xc0, %edi
callq 0x3300
movq %rax, -0x200(%rbp)
jmp 0x1a3f3
movq -0x200(%rbp), %rdi
movq -0x50(%rbp), %rsi
movq %rsp, %rax
movq $0x0, (%rax)
movl $0x1, %edx
movl $0x3, %ecx
movl $0x2, %r8d
movl $0xffffffff, %r9d       # imm = 0xFFFFFFFF
callq 0x17070
jmp 0x1a425
movq -0x200(%rbp), %rax
movq %rax, -0x98(%rbp)
leaq -0x90(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x21020
jmp 0x1a448
jmp 0x1a44a
movl -0x78(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x78(%rbp)
jmp 0x1a3ce
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x1a4b1
movq -0x200(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
movl $0xc0, %esi
callq 0x3310
jmp 0x1a4b1
leaq -0x70(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x21050
jmp 0x1a497
leaq -0x90(%rbp), %rdi
callq 0x210c0
movl -0x74(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x74(%rbp)
jmp 0x1a3a9
leaq -0x90(%rbp), %rdi
callq 0x210c0
jmp 0x1b276
movl $0x0, -0x78(%rbp)
movq -0x1f8(%rbp), %rcx
movl -0x78(%rbp), %eax
cmpl (%rcx), %eax
jge 0x1a73f
movl $0x0, -0x74(%rbp)
movq -0x1f8(%rbp), %rcx
movl -0x74(%rbp), %eax
movl (%rcx), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x1a5af
movslq -0x74(%rbp), %rsi
leaq -0x70(%rbp), %rdi
movq %rdi, -0x218(%rbp)
callq 0x21120
movq %rax, %rdi
movslq -0x78(%rbp), %rsi
callq 0x21140
movq -0x218(%rbp), %rdi
movq (%rax), %rax
movq %rax, -0x210(%rbp)
movl -0x74(%rbp), %eax
incl %eax
movslq %eax, %rsi
callq 0x21120
movq %rax, %rdi
movslq -0x78(%rbp), %rsi
callq 0x21140
movq (%rax), %rax
movq %rax, -0x208(%rbp)
leaq -0xa8(%rbp), %rdi
xorl %esi, %esi
movl $0x1, %edx
movl $0x3, %ecx
movl $0x2, %r8d
callq 0x9cc0
jmp 0x1a56d
movq -0x208(%rbp), %rsi
movq -0x210(%rbp), %rdi
movl $0x2, %edx
leaq -0xa8(%rbp), %rcx
callq 0x17390
jmp 0x1a58e
jmp 0x1a590
movl -0x74(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x74(%rbp)
jmp 0x1a4e2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x1b276
movq -0x1f8(%rbp), %rax
movq 0x8(%rax), %rcx
movslq -0x78(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movq 0x18(%rcx), %rcx
movq %rcx, -0x228(%rbp)
movl (%rax), %eax
subl $0x1, %eax
movslq %eax, %rsi
leaq -0x70(%rbp), %rdi
callq 0x21120
movq %rax, %rdi
movslq -0x78(%rbp), %rsi
callq 0x21140
movq %rax, %rcx
movq -0x1f8(%rbp), %rax
movq (%rcx), %rcx
movq %rcx, -0x220(%rbp)
movq 0x10(%rax), %rax
movslq -0x78(%rbp), %rcx
testb $0x1, (%rax,%rcx)
je 0x1a62e
leaq -0xb8(%rbp), %rdi
xorl %esi, %esi
movl $0x1, %edx
movl $0x2, %ecx
movl $0x3, %r8d
callq 0x9cc0
jmp 0x1a62c
jmp 0x1a650
leaq -0xb8(%rbp), %rdi
movl $0x1, %esi
movl $0x3, %edx
movl $0x2, %ecx
xorl %r8d, %r8d
callq 0x9cc0
jmp 0x1a64e
jmp 0x1a650
movq -0x220(%rbp), %rsi
movq -0x228(%rbp), %rdi
movl $0x2, %edx
leaq -0xb8(%rbp), %rcx
callq 0x17650
jmp 0x1a671
movq -0x1f8(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x78(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x18(%rax), %rax
movq %rax, -0x238(%rbp)
leaq -0x70(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x21120
movq %rax, %rdi
movslq -0x78(%rbp), %rsi
callq 0x21140
movq %rax, %rcx
movq -0x1f8(%rbp), %rax
movq (%rcx), %rcx
movq %rcx, -0x230(%rbp)
movq 0x10(%rax), %rax
movslq -0x78(%rbp), %rcx
testb $0x1, (%rax,%rcx)
je 0x1a6ec
leaq -0xc8(%rbp), %rdi
xorl %esi, %esi
movl $0x1, %edx
movl $0x3, %ecx
movl $0x2, %r8d
callq 0x9cc0
jmp 0x1a6ea
jmp 0x1a70e
leaq -0xc8(%rbp), %rdi
movl $0x1, %esi
movl $0x2, %edx
movl $0x3, %ecx
xorl %r8d, %r8d
callq 0x9cc0
jmp 0x1a70c
jmp 0x1a70e
movq -0x230(%rbp), %rsi
movq -0x238(%rbp), %rdi
movl $0x2, %edx
leaq -0xc8(%rbp), %rcx
callq 0x17390
jmp 0x1a72f
jmp 0x1a731
movl -0x78(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x78(%rbp)
jmp 0x1a4c9
movl $0x0, -0x78(%rbp)
movq -0x1f8(%rbp), %rcx
movl -0x78(%rbp), %eax
cmpl (%rcx), %eax
jge 0x1b264
movq -0x1f8(%rbp), %rcx
movl -0x78(%rbp), %eax
addl $0x1, %eax
cltd
idivl (%rcx)
movl %edx, %eax
movq -0x1f8(%rbp), %rdx
movl %eax, -0xcc(%rbp)
movl -0xc(%rbp), %eax
movq 0x10(%rdx), %rcx
movslq -0x78(%rbp), %rsi
movb (%rcx,%rsi), %cl
xorb $-0x1, %cl
andb $0x1, %cl
movzbl %cl, %ecx
movq 0x10(%rdx), %rdx
movslq -0xcc(%rbp), %rsi
movb (%rdx,%rsi), %dl
andb $0x1, %dl
movzbl %dl, %edx
addl %edx, %ecx
imull %ecx, %eax
movl %eax, -0xd8(%rbp)
cmpl $0x1, -0xc(%rbp)
jne 0x1a7d0
movq -0x1f8(%rbp), %rax
movl -0xd8(%rbp), %ecx
movl %ecx, -0xd0(%rbp)
movl (%rax), %eax
movl %eax, -0xd4(%rbp)
jmp 0x1a7ef
movq -0x1f8(%rbp), %rax
movl $0x0, -0xd0(%rbp)
movl (%rax), %eax
addl -0xd8(%rbp), %eax
movl %eax, -0xd4(%rbp)
movl -0xd0(%rbp), %eax
movl %eax, -0x74(%rbp)
movl -0x74(%rbp), %eax
cmpl -0xd4(%rbp), %eax
jge 0x1a8b5
movslq -0x74(%rbp), %rsi
leaq -0x70(%rbp), %rdi
movq %rdi, -0x250(%rbp)
callq 0x21120
movq %rax, %rdi
movslq -0x78(%rbp), %rsi
callq 0x21140
movq -0x250(%rbp), %rdi
movq (%rax), %rax
movq %rax, -0x248(%rbp)
movl -0x74(%rbp), %eax
movl -0xd8(%rbp), %ecx
subl %ecx, %eax
movslq %eax, %rsi
callq 0x21120
movq %rax, %rdi
movslq -0xcc(%rbp), %rsi
callq 0x21140
movq (%rax), %rax
movq %rax, -0x240(%rbp)
leaq -0xe8(%rbp), %rdi
movl $0x1, %esi
xorl %edx, %edx
movl $0x2, %ecx
movl $0x3, %r8d
callq 0x9cc0
jmp 0x1a884
movq -0x240(%rbp), %rsi
movq -0x248(%rbp), %rdi
movl $0x1, %edx
leaq -0xe8(%rbp), %rcx
callq 0x17390
jmp 0x1a8a5
jmp 0x1a8a7
movl -0x74(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x74(%rbp)
jmp 0x1a7f8
movq -0x1f8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x78(%rbp), %rcx
testb $0x1, (%rax,%rcx)
je 0x1ab2d
movq -0x1f8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0xcc(%rbp), %rcx
testb $0x1, (%rax,%rcx)
je 0x1ab2d
cmpl $0x1, -0xc(%rbp)
jne 0x1aa11
movq -0x1f8(%rbp), %rax
movq 0x8(%rax), %rcx
movslq -0xcc(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movq (%rcx), %rcx
movq %rcx, -0x260(%rbp)
movl (%rax), %eax
decl %eax
movslq %eax, %rsi
leaq -0x70(%rbp), %rdi
callq 0x21120
movq %rax, %rdi
movslq -0xcc(%rbp), %rsi
callq 0x21140
movq (%rax), %rax
movq %rax, -0x258(%rbp)
leaq -0xf8(%rbp), %rdi
movl $0x1, %esi
xorl %edx, %edx
movl $0x3, %ecx
movl $0x2, %r8d
callq 0x9cc0
jmp 0x1a95d
movq -0x258(%rbp), %rsi
movq -0x260(%rbp), %rdi
movl $0x1, %edx
leaq -0xf8(%rbp), %rcx
callq 0x17650
jmp 0x1a97e
movq -0x1f8(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0xcc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax), %rax
movq %rax, -0x278(%rbp)
xorl %eax, %eax
movl %eax, -0x26c(%rbp)
movl %eax, %esi
leaq -0x70(%rbp), %rdi
callq 0x21120
movq %rax, %rdi
movslq -0x78(%rbp), %rsi
callq 0x21140
movl -0x26c(%rbp), %esi
movq (%rax), %rax
movq %rax, -0x268(%rbp)
leaq -0x108(%rbp), %rdi
movl $0x1, %edx
movl $0x3, %ecx
movl $0x2, %r8d
callq 0x9cc0
jmp 0x1a9eb
movq -0x268(%rbp), %rsi
movq -0x278(%rbp), %rdi
movl $0x1, %edx
leaq -0x108(%rbp), %rcx
callq 0x17390
jmp 0x1aa0c
jmp 0x1ab2b
movq -0x1f8(%rbp), %rax
movq 0x8(%rax), %rcx
movslq -0xcc(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movq (%rcx), %rcx
movq %rcx, -0x288(%rbp)
movl (%rax), %eax
decl %eax
movslq %eax, %rsi
leaq -0x70(%rbp), %rdi
callq 0x21120
movq %rax, %rdi
movslq -0x78(%rbp), %rsi
callq 0x21140
movq (%rax), %rax
movq %rax, -0x280(%rbp)
leaq -0x118(%rbp), %rdi
xorl %esi, %esi
movl $0x1, %edx
movl $0x2, %ecx
movl $0x3, %r8d
callq 0x9cc0
jmp 0x1aa77
movq -0x280(%rbp), %rsi
movq -0x288(%rbp), %rdi
movl $0x1, %edx
leaq -0x118(%rbp), %rcx
callq 0x17650
jmp 0x1aa98
movq -0x1f8(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0xcc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax), %rax
movq %rax, -0x2a0(%rbp)
xorl %eax, %eax
movl %eax, -0x294(%rbp)
movl %eax, %esi
leaq -0x70(%rbp), %rdi
callq 0x21120
movq %rax, %rdi
movslq -0xcc(%rbp), %rsi
callq 0x21140
movl -0x294(%rbp), %edx
movq (%rax), %rax
movq %rax, -0x290(%rbp)
leaq -0x128(%rbp), %rdi
movl $0x1, %esi
movl $0x2, %ecx
movl $0x3, %r8d
callq 0x9cc0
jmp 0x1ab08
movq -0x290(%rbp), %rsi
movq -0x2a0(%rbp), %rdi
movl $0x1, %edx
leaq -0x128(%rbp), %rcx
callq 0x17390
jmp 0x1ab29
jmp 0x1ab2b
jmp 0x1ab2d
movq -0x1f8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x78(%rbp), %rcx
testb $0x1, (%rax,%rcx)
je 0x1ab5c
movq -0x1f8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0xcc(%rbp), %rcx
testb $0x1, (%rax,%rcx)
jne 0x1ab5c
jmp 0x1ab5c
movq -0x1f8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x78(%rbp), %rcx
testb $0x1, (%rax,%rcx)
jne 0x1afe8
movq -0x1f8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0xcc(%rbp), %rcx
testb $0x1, (%rax,%rcx)
je 0x1afe8
cmpl $0x1, -0xc(%rbp)
jne 0x1adc2
movq -0x1f8(%rbp), %rax
movq 0x8(%rax), %rcx
movslq -0xcc(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movq (%rcx), %rcx
movq %rcx, -0x2b0(%rbp)
movl (%rax), %eax
decl %eax
movslq %eax, %rsi
leaq -0x70(%rbp), %rdi
callq 0x21120
movq %rax, %rdi
movslq -0xcc(%rbp), %rsi
callq 0x21140
movq (%rax), %rax
movq %rax, -0x2a8(%rbp)
leaq -0x138(%rbp), %rdi
movl $0x1, %esi
xorl %edx, %edx
movl $0x3, %ecx
movl $0x2, %r8d
callq 0x9cc0
jmp 0x1ac04
movq -0x2a8(%rbp), %rsi
movq -0x2b0(%rbp), %rdi
movl $0x1, %edx
leaq -0x138(%rbp), %rcx
callq 0x17650
jmp 0x1ac25
movq -0x1f8(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0xcc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax), %rax
movq %rax, -0x2c0(%rbp)
leaq -0x70(%rbp), %rdi
movl $0x1, %esi
callq 0x21120
movq %rax, %rdi
movslq -0x78(%rbp), %rsi
callq 0x21140
movq (%rax), %rax
movq %rax, -0x2b8(%rbp)
leaq -0x148(%rbp), %rdi
xorl %esi, %esi
movl $0x1, %edx
movl $0x3, %ecx
movl $0x2, %r8d
callq 0x9cc0
jmp 0x1ac89
movq -0x2b8(%rbp), %rsi
movq -0x2c0(%rbp), %rdi
movl $0x1, %edx
leaq -0x148(%rbp), %rcx
callq 0x17390
jmp 0x1acaa
movq -0x1f8(%rbp), %rax
movq 0x8(%rax), %rcx
movslq -0x78(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movq (%rcx), %rcx
movq %rcx, -0x2d0(%rbp)
movl (%rax), %eax
addl $-0x2, %eax
movslq %eax, %rsi
leaq -0x70(%rbp), %rdi
callq 0x21120
movq %rax, %rdi
movslq -0xcc(%rbp), %rsi
callq 0x21140
movq (%rax), %rax
movq %rax, -0x2c8(%rbp)
leaq -0x158(%rbp), %rdi
movl $0x2, %esi
xorl %edx, %edx
movl $0x1, %ecx
movl $0x3, %r8d
callq 0x9cc0
jmp 0x1ad11
movq -0x2c8(%rbp), %rsi
movq -0x2d0(%rbp), %rdi
movl $0x1, %edx
leaq -0x158(%rbp), %rcx
callq 0x17650
jmp 0x1ad32
movq -0x1f8(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x78(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax), %rax
movq %rax, -0x2e8(%rbp)
xorl %eax, %eax
movl %eax, -0x2dc(%rbp)
movl %eax, %esi
leaq -0x70(%rbp), %rdi
callq 0x21120
movq %rax, %rdi
movslq -0x78(%rbp), %rsi
callq 0x21140
movl -0x2dc(%rbp), %ecx
movq (%rax), %rax
movq %rax, -0x2d8(%rbp)
leaq -0x168(%rbp), %rdi
movl $0x2, %esi
movl $0x1, %edx
movl $0x3, %r8d
callq 0x9cc0
jmp 0x1ad9c
movq -0x2d8(%rbp), %rsi
movq -0x2e8(%rbp), %rdi
movl $0x1, %edx
leaq -0x168(%rbp), %rcx
callq 0x17390
jmp 0x1adbd
jmp 0x1afe6
movq -0x1f8(%rbp), %rax
movq 0x8(%rax), %rcx
movslq -0x78(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movq (%rcx), %rcx
movq %rcx, -0x2f8(%rbp)
movl (%rax), %eax
decl %eax
movslq %eax, %rsi
leaq -0x70(%rbp), %rdi
callq 0x21120
movq %rax, %rdi
movslq -0x78(%rbp), %rsi
callq 0x21140
movq (%rax), %rax
movq %rax, -0x2f0(%rbp)
leaq -0x178(%rbp), %rdi
movl $0x3, %esi
movl $0x1, %edx
xorl %ecx, %ecx
movl $0x2, %r8d
callq 0x9cc0
jmp 0x1ae25
movq -0x2f0(%rbp), %rsi
movq -0x2f8(%rbp), %rdi
movl $0x1, %edx
leaq -0x178(%rbp), %rcx
callq 0x17650
jmp 0x1ae46
movq -0x1f8(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x78(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax), %rax
movq %rax, -0x308(%rbp)
leaq -0x70(%rbp), %rdi
movl $0x1, %esi
callq 0x21120
movq %rax, %rdi
movslq -0xcc(%rbp), %rsi
callq 0x21140
movq (%rax), %rax
movq %rax, -0x300(%rbp)
leaq -0x188(%rbp), %rdi
movl $0x3, %esi
xorl %edx, %edx
movl $0x1, %ecx
movl $0x2, %r8d
callq 0x9cc0
jmp 0x1aeaa
movq -0x300(%rbp), %rsi
movq -0x308(%rbp), %rdi
movl $0x1, %edx
leaq -0x188(%rbp), %rcx
callq 0x17390
jmp 0x1aecb
movq -0x1f8(%rbp), %rax
movq 0x8(%rax), %rcx
movslq -0xcc(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movq (%rcx), %rcx
movq %rcx, -0x318(%rbp)
movl (%rax), %eax
addl $-0x2, %eax
movslq %eax, %rsi
leaq -0x70(%rbp), %rdi
callq 0x21120
movq %rax, %rdi
movslq -0x78(%rbp), %rsi
callq 0x21140
movq (%rax), %rax
movq %rax, -0x310(%rbp)
leaq -0x198(%rbp), %rdi
xorl %esi, %esi
movl $0x1, %edx
movl $0x2, %ecx
movl $0x3, %r8d
callq 0x9cc0
jmp 0x1af32
movq -0x310(%rbp), %rsi
movq -0x318(%rbp), %rdi
movl $0x1, %edx
leaq -0x198(%rbp), %rcx
callq 0x17650
jmp 0x1af53
movq -0x1f8(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0xcc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax), %rax
movq %rax, -0x330(%rbp)
xorl %eax, %eax
movl %eax, -0x324(%rbp)
movl %eax, %esi
leaq -0x70(%rbp), %rdi
callq 0x21120
movq %rax, %rdi
movslq -0xcc(%rbp), %rsi
callq 0x21140
movl -0x324(%rbp), %edx
movq (%rax), %rax
movq %rax, -0x320(%rbp)
leaq -0x1a8(%rbp), %rdi
movl $0x1, %esi
movl $0x2, %ecx
movl $0x3, %r8d
callq 0x9cc0
jmp 0x1afc3
movq -0x320(%rbp), %rsi
movq -0x330(%rbp), %rdi
movl $0x1, %edx
leaq -0x1a8(%rbp), %rcx
callq 0x17390
jmp 0x1afe4
jmp 0x1afe6
jmp 0x1afe8
movq -0x1f8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x78(%rbp), %rcx
testb $0x1, (%rax,%rcx)
jne 0x1b254
movq -0x1f8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0xcc(%rbp), %rcx
testb $0x1, (%rax,%rcx)
jne 0x1b254
cmpl $0x1, -0xc(%rbp)
jne 0x1b13e
movq -0x1f8(%rbp), %rax
movq 0x8(%rax), %rcx
movslq -0x78(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movq (%rcx), %rcx
movq %rcx, -0x340(%rbp)
movl (%rax), %eax
decl %eax
movslq %eax, %rsi
leaq -0x70(%rbp), %rdi
callq 0x21120
movq %rax, %rdi
movslq -0xcc(%rbp), %rsi
callq 0x21140
movq (%rax), %rax
movq %rax, -0x338(%rbp)
leaq -0x1b8(%rbp), %rdi
movl $0x2, %esi
xorl %edx, %edx
movl $0x1, %ecx
movl $0x3, %r8d
callq 0x9cc0
jmp 0x1b08d
movq -0x338(%rbp), %rsi
movq -0x340(%rbp), %rdi
movl $0x1, %edx
leaq -0x1b8(%rbp), %rcx
callq 0x17650
jmp 0x1b0ae
movq -0x1f8(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x78(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax), %rax
movq %rax, -0x358(%rbp)
xorl %eax, %eax
movl %eax, -0x34c(%rbp)
movl %eax, %esi
leaq -0x70(%rbp), %rdi
callq 0x21120
movq %rax, %rdi
movslq -0x78(%rbp), %rsi
callq 0x21140
movl -0x34c(%rbp), %ecx
movq (%rax), %rax
movq %rax, -0x348(%rbp)
leaq -0x1c8(%rbp), %rdi
movl $0x2, %esi
movl $0x1, %edx
movl $0x3, %r8d
callq 0x9cc0
jmp 0x1b118
movq -0x348(%rbp), %rsi
movq -0x358(%rbp), %rdi
movl $0x1, %edx
leaq -0x1c8(%rbp), %rcx
callq 0x17390
jmp 0x1b139
jmp 0x1b252
movq -0x1f8(%rbp), %rax
movq 0x8(%rax), %rcx
movslq -0x78(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movq (%rcx), %rcx
movq %rcx, -0x368(%rbp)
movl (%rax), %eax
decl %eax
movslq %eax, %rsi
leaq -0x70(%rbp), %rdi
callq 0x21120
movq %rax, %rdi
movslq -0x78(%rbp), %rsi
callq 0x21140
movq (%rax), %rax
movq %rax, -0x360(%rbp)
leaq -0x1d8(%rbp), %rdi
movl $0x3, %esi
movl $0x1, %edx
xorl %ecx, %ecx
movl $0x2, %r8d
callq 0x9cc0
jmp 0x1b1a1
movq -0x360(%rbp), %rsi
movq -0x368(%rbp), %rdi
movl $0x1, %edx
leaq -0x1d8(%rbp), %rcx
callq 0x17650
jmp 0x1b1c2
movq -0x1f8(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x78(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax), %rax
movq %rax, -0x380(%rbp)
xorl %eax, %eax
movl %eax, -0x374(%rbp)
movl %eax, %esi
leaq -0x70(%rbp), %rdi
callq 0x21120
movq %rax, %rdi
movslq -0xcc(%rbp), %rsi
callq 0x21140
movl -0x374(%rbp), %edx
movq (%rax), %rax
movq %rax, -0x370(%rbp)
leaq -0x1e8(%rbp), %rdi
movl $0x3, %esi
movl $0x1, %ecx
movl $0x2, %r8d
callq 0x9cc0
jmp 0x1b22f
movq -0x370(%rbp), %rsi
movq -0x380(%rbp), %rdi
movl $0x1, %edx
leaq -0x1e8(%rbp), %rcx
callq 0x17390
jmp 0x1b250
jmp 0x1b252
jmp 0x1b254
jmp 0x1b256
movl -0x78(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x78(%rbp)
jmp 0x1a746
leaq -0x70(%rbp), %rdi
callq 0x21160
addq $0x390, %rsp            # imm = 0x390
popq %rbp
retq
leaq -0x70(%rbp), %rdi
callq 0x21160
movq -0x40(%rbp), %rdi
callq 0x3550
nopl (%rax,%rax)