// File: /workspace/github_c_makefile_star2_O1/enzo1982[P]smooth/classes/gui/widgets/special/cursor.cpp
// Function: smooth::GUI::Cursor::OnSpecialKey(int)
S::Bool S::GUI::Cursor::OnSpecialKey(Int keyCode)
{
	/* Called when a special key such as
	 * return or an arrow key is hit.
	 */
	if (!focussed) return False;

#if defined __APPLE__
	Input::Keyboard::Key	 commandKey = Input::Keyboard::KeyCommand;
#elif defined __HAIKU__
	Input::Keyboard::Key	 commandKey = Input::Keyboard::KeyAlt;
#else
	Input::Keyboard::Key	 commandKey = Input::Keyboard::KeyControl;
#endif

	/* Make sure no other modifiers are pressed along with command key.
	 */
	if (Input::Keyboard::GetKeyState(commandKey) && !(Input::Keyboard::GetKeyState(Input::Keyboard::KeyCommand) ^
							  Input::Keyboard::GetKeyState(Input::Keyboard::KeyControl) ^
							  Input::Keyboard::GetKeyState(Input::Keyboard::KeyAlt))) return False;

	/* Evaluate key code.
	 */
	Int	 newPos	 = 0;
	Int	 linePos = 0;

	Int	 i	 = 0;

	switch (keyCode)
	{
		case Input::Keyboard::KeyLeft:
		case Input::Keyboard::KeyRight:
			if (!Input::Keyboard::GetKeyState(Input::Keyboard::KeyShift)) MarkText(-1, -1);

			/* Calculate new cursor pos.
			 */
			if (Input::Keyboard::GetKeyState(commandKey))
			{
				Bool	 isLeft = ((keyCode == Input::Keyboard::KeyLeft  && !IsRightToLeft()) || (keyCode == Input::Keyboard::KeyRight && IsRightToLeft()));

				if (isLeft)
				{
					newPos = 0;

					for (Int i = promptPos - 2; i >= 0; i--)
					{
						if ( (						   text[i + 1] == '\n') ||
						    ((text[i    ] == ' ' || text[i    ] == '\t' || text[i    ] == '\n') &&
						     (text[i + 1] != ' ' && text[i + 1] != '\t' && text[i + 1] != '\n'))) { newPos = i + 1; break; }
					}
				}
				else
				{
					newPos = text.Length();

					for (Int i = promptPos; i < text.Length(); i++)
					{
						if ( (						   text[i + 1] == '\n') ||
						    ((text[i    ] == ' ' || text[i    ] == '\t' || text[i    ] == '\n') &&
						     (text[i + 1] != ' ' && text[i + 1] != '\t' && text[i + 1] != '\n'))) { newPos = i + 1; break; }
					}
				}
			}
			else
			{
				Bool	 isLeft = ((keyCode == Input::Keyboard::KeyLeft  && !IsRightToLeft()) || (keyCode == Input::Keyboard::KeyRight && IsRightToLeft()));

				if (isLeft) { if (promptPos == 0)	      break; newPos = promptPos - 1; }
				else	    { if (promptPos >= text.Length()) break; newPos = promptPos + 1; }
			}

			/* Set mark region and cursor.
			 */
			if (Input::Keyboard::GetKeyState(Input::Keyboard::KeyShift))
			{
				if (markStart == -1) markStart = promptPos;

				MarkText(markStart, newPos);
			}

			SetCursorPos(newPos);

			break;
		case Input::Keyboard::KeyHome:
		case Input::Keyboard::KeyEnd:
			if (!Input::Keyboard::GetKeyState(Input::Keyboard::KeyShift)) MarkText(-1, -1);

			/* Calculate new cursor pos.
			 */
			if (Input::Keyboard::GetKeyState(commandKey))
			{
				if	(keyCode == Input::Keyboard::KeyHome)	{ if (promptPos == 0)		  break; newPos = 0;		 }
				else if (keyCode == Input::Keyboard::KeyEnd)	{ if (promptPos >= text.Length()) break; newPos = text.Length(); }
			}
			else
			{
				if (keyCode == Input::Keyboard::KeyHome)
				{
					newPos = 0;

					for (Int i = promptPos - 1; i >= 0; i--)
					{
						if (text[i] == '\n') { newPos = i + 1; break; }
					}
				}
				else
				{
					newPos = text.Length();

					for (Int i = promptPos; i < text.Length(); i++)
					{
						if (text[i] == '\n') { newPos = i; break; }
					}
				}
			}

			/* Set mark region and cursor.
			 */
			if (Input::Keyboard::GetKeyState(Input::Keyboard::KeyShift))
			{
				if (markStart == -1) markStart = promptPos;

				MarkText(markStart, newPos);
			}

			SetCursorPos(newPos);

			break;
		case Input::Keyboard::KeyUp:
		case Input::Keyboard::KeyDown:
			if (!Binary::IsFlagSet(GetFlags(), CF_MULTILINE)) break;

			if (!Input::Keyboard::GetKeyState(Input::Keyboard::KeyShift)) MarkText(-1, -1);

			/* Calculate new cursor pos.
			 */
			linePos	= promptPos;
			newPos	= promptPos;

			for (i = promptPos - 1; i >= 0; i--)
			{
				if (text[i] == '\n') { linePos -= (i + 1); break; }
			}

			if (keyCode == Input::Keyboard::KeyUp)
			{
				if (i == 0) newPos = 0;

				for (Int j = i - 1; j >= 0; j--)
				{
					if (text[j] == '\n' || j == 0) { newPos = Math::Min(i, j + linePos + (j == 0 ? 0 : 1)); break; }
				}
			}
			else
			{
				for (Int j = promptPos; j < text.Length(); j++)
				{
					if (text[j] == '\n')
					{
						for (Int k = j + 1; k <= j + 1 + linePos; k++)
						{
							newPos = k;

							if (text[k] == '\n' || text[k] == 0) break;
						}

						break;
					}
				}
			}

			/* Set mark region and cursor.
			 */
			if (Input::Keyboard::GetKeyState(Input::Keyboard::KeyShift))
			{
				if (markStart == -1) markStart = promptPos;

				MarkText(markStart, newPos);
			}

			SetCursorPos(newPos);

			break;
		case Input::Keyboard::KeyReturn:
			if (!IsActive()) break;

			if (Binary::IsFlagSet(GetFlags(), CF_MULTILINE))
			{
				Bool	 selected = (markStart != markEnd && markStart >= 0 && markEnd >= 0);

				flags |= CF_NOINPUT;

				DeleteSelectedText();

				flags ^= CF_NOINPUT;

				if (selected) RemoveHistoryEntry();

				String	 insertText;

				insertText[0] = '\n';

				InsertText(insertText);

				onInput.Emit(text);
			}
			else
			{
				focussed = False;

				onLoseFocus.Emit();

				onEnter.Emit(text);
			}

			break;
		case Input::Keyboard::KeyEscape:
			if (!IsActive()) break;

			focussed = False;

			onLoseFocus.Emit();

			return True;
		case Input::Keyboard::KeyInsert:
#ifndef __APPLE__
			if (		   Input::Keyboard::GetKeyState(commandKey) && !Input::Keyboard::GetKeyState(Input::Keyboard::KeyShift)) CopyToClipboard();
			if (IsActive() && !Input::Keyboard::GetKeyState(commandKey) &&  Input::Keyboard::GetKeyState(Input::Keyboard::KeyShift)) InsertFromClipboard();
#endif
			break;
		case Input::Keyboard::KeyBack:
			if (!IsActive() || Input::Keyboard::GetKeyState(commandKey) || Input::Keyboard::GetKeyState(Input::Keyboard::KeyShift)) break;

			if (markStart != markEnd) { DeleteSelectedText(); break; }

			if (promptPos == 0) break;

			markStart = promptPos - 1;
			markEnd	  = promptPos;

			DeleteSelectedText();

			break;
		case Input::Keyboard::KeyDelete:
			if (!IsActive() || Input::Keyboard::GetKeyState(commandKey)) break;
#ifdef __APPLE__
			if (Input::Keyboard::GetKeyState(Input::Keyboard::KeyShift)) break;
#endif
			if (markStart != markEnd)
			{
				if (Input::Keyboard::GetKeyState(Input::Keyboard::KeyShift)) CopyToClipboard();

				DeleteSelectedText();

				break;
			}

			if (Input::Keyboard::GetKeyState(Input::Keyboard::KeyShift)) break;

			if (promptPos == text.Length()) break;

			markStart = promptPos;
			markEnd	  = promptPos + 1;

			DeleteSelectedText();

			break;
		case Input::Keyboard::KeyA:
			if (		  Input::Keyboard::GetKeyState(commandKey))   MarkAll();

			break;
		case Input::Keyboard::KeyC:
			if (		  Input::Keyboard::GetKeyState(commandKey))   CopyToClipboard();

			break;
		case Input::Keyboard::KeyX:
			if (IsActive() && Input::Keyboard::GetKeyState(commandKey)) { CopyToClipboard(); DeleteSelectedText(); }

			break;
		case Input::Keyboard::KeyV:
			if (IsActive() && Input::Keyboard::GetKeyState(commandKey))   InsertFromClipboard();

			break;
		case Input::Keyboard::KeyZ:

			if (IsActive() && Input::Keyboard::GetKeyState(commandKey))   Undo();

			break;
		case Input::Keyboard::KeyY:
			if (IsActive() && Input::Keyboard::GetKeyState(commandKey))   Redo();

			break;
	}

	return False;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
cmpb $0x1, 0xcd(%rdi)
jne 0x94072
movl %esi, %r14d
movq %rdi, %r13
movl $0x11, %edi
callq 0x57510
testb %al, %al
je 0x93666
movl $0x5b, %edi
callq 0x57510
movl %eax, %ebp
movl $0x11, %edi
callq 0x57510
movl %eax, %r15d
xorb %bpl, %r15b
movl $0x12, %edi
callq 0x57510
cmpb %al, %r15b
je 0x94072
xorl %ebp, %ebp
cmpl $0x40, %r14d
jg 0x936e6
leal -0x1b(%r14), %eax
cmpl $0x13, %eax
ja 0x93722
leaq 0x6456e(%rip), %rcx     # 0xf7bf0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x10, %edi
callq 0x57510
testb %al, %al
jne 0x936ab
movq %r13, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x56ae0
movl $0x11, %edi
callq 0x57510
testb %al, %al
je 0x93a92
cmpl $0x23, %r14d
je 0x93e78
cmpl $0x24, %r14d
jne 0x93d65
xorl %ebp, %ebp
cmpl $0x0, 0x5c0(%r13)
jne 0x93f7c
jmp 0x94074
leal -0x56(%r14), %eax
cmpl $0x4, %eax
ja 0x937a8
leaq 0x64546(%rip), %rcx     # 0xf7c40
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq (%r13), %rax
movq %r13, %rdi
callq *0x98(%rax)
testb %al, %al
je 0x94072
movl $0x11, %edi
jmp 0x93b1a
cmpl $0x8, %r14d
je 0x93bee
cmpl $0xd, %r14d
jne 0x94074
movq (%r13), %rax
movq %r13, %rdi
callq *0x98(%rax)
testb %al, %al
je 0x94072
movl 0x30(%r13), %edi
movl $0x1, %esi
callq 0x583f0
testb %al, %al
je 0x93eaf
movl 0x5c8(%r13), %eax
movl 0x5cc(%r13), %ebx
cmpl %ebx, %eax
sete %cl
testl %eax, %eax
sets %al
orb %cl, %al
jne 0x93fca
orb $0x40, 0x33(%r13)
movq %r13, %rdi
callq 0x591d8
xorb $0x40, 0x33(%r13)
testl %ebx, %ebx
js 0x93fdc
movq %r13, %rdi
callq 0x56870
jmp 0x93fdc
cmpl $0x41, %r14d
je 0x93c60
cmpl $0x43, %r14d
jne 0x94074
movl $0x11, %edi
callq 0x57510
testb %al, %al
je 0x94072
movq %r13, %rdi
callq 0x591d0
jmp 0x94072
movl 0x30(%r13), %edi
movl $0x1, %esi
callq 0x583f0
testb %al, %al
je 0x94072
movl $0x10, %edi
callq 0x57510
testb %al, %al
jne 0x93811
movq %r13, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x56ae0
movl 0x5c0(%r13), %eax
movq %r13, 0x18(%rsp)
leaq 0xf0(%r13), %rcx
movq %rcx, 0x10(%rsp)
leal -0x1(%rax), %r15d
xorl %ebx, %ebx
movq %rax, 0x8(%rsp)
movl %eax, %ecx
movl %ecx, %ebp
movl %ebx, %r13d
movq 0x8(%rsp), %rax
leal (%rax,%r13), %r12d
testl %r12d, %r12d
jle 0x93d6c
leal (%r15,%r13), %esi
movq 0x10(%rsp), %rdi
callq 0x58990
leal -0x1(%r13), %ebx
leal -0x1(%rbp), %ecx
cmpl $0xa, (%rax)
jne 0x93836
notl %ebx
jmp 0x93d73
movl $0x10, %edi
callq 0x57510
testb %al, %al
jne 0x9388e
movq %r13, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x56ae0
movl $0x11, %edi
callq 0x57510
testb %al, %al
je 0x93a36
cmpl $0x27, %r14d
je 0x938cb
cmpl $0x25, %r14d
jne 0x93c7f
movq (%r13), %rax
movq %r13, %rdi
callq *0x160(%rax)
testb %al, %al
je 0x938e0
cmpl $0x27, %r14d
jne 0x93c7f
movq (%r13), %rax
movq %r13, %rdi
callq *0x160(%rax)
testb %al, %al
je 0x93c7f
movl 0x5c0(%r13), %r12d
cmpl $0x2, %r12d
jl 0x9398a
leaq 0xf0(%r13), %r15
leal -0x2(%r12), %ebp
decl %r12d
movl %r12d, %r14d
movq %r15, %rdi
movl %r12d, %esi
callq 0x58990
cmpl $0xa, (%rax)
je 0x9402a
leal -0x1(%r14), %r12d
movq %r15, %rdi
movl %r12d, %esi
callq 0x58990
cmpl $0x20, (%rax)
je 0x9394b
movq %r15, %rdi
movl %r12d, %esi
callq 0x58990
cmpl $0x9, (%rax)
je 0x9394b
movq %r15, %rdi
movl %r12d, %esi
callq 0x58990
cmpl $0xa, (%rax)
jne 0x9397f
movq %r15, %rdi
movl %r14d, %esi
callq 0x58990
cmpl $0x20, (%rax)
je 0x9397f
movq %r15, %rdi
movl %r14d, %esi
callq 0x58990
cmpl $0x9, (%rax)
je 0x9397f
movq %r15, %rdi
movl %r14d, %esi
callq 0x58990
cmpl $0xa, (%rax)
jne 0x9402f
decl %ebp
testl %r12d, %r12d
jg 0x93900
xorl %r14d, %r14d
jmp 0x9402f
movq (%r13), %rax
movq %r13, %rdi
callq *0x98(%rax)
testb %al, %al
je 0x94072
movl $0x11, %edi
callq 0x57510
testb %al, %al
je 0x94072
movq %r13, %rdi
callq 0x59120
jmp 0x94072
movq (%r13), %rax
movq %r13, %rdi
callq *0x98(%rax)
testb %al, %al
je 0x94072
movl $0x11, %edi
callq 0x57510
testb %al, %al
je 0x94072
movq %r13, %rdi
callq 0x591d0
movq %r13, %rdi
callq 0x591d8
jmp 0x94072
movq (%r13), %rax
movq %r13, %rdi
callq *0x98(%rax)
testb %al, %al
je 0x94072
movl $0x11, %edi
callq 0x57510
testb %al, %al
je 0x94072
movq %r13, %rdi
callq 0x57910
jmp 0x94072
cmpl $0x27, %r14d
je 0x93a61
cmpl $0x25, %r14d
jne 0x93d2d
movq (%r13), %rax
movq %r13, %rdi
callq *0x160(%rax)
testb %al, %al
je 0x93a76
cmpl $0x27, %r14d
jne 0x93d2d
movq (%r13), %rax
movq %r13, %rdi
callq *0x160(%rax)
testb %al, %al
je 0x93d2d
movl 0x5c0(%r13), %r14d
testl %r14d, %r14d
setne %cl
xorl %eax, %eax
subl $0x1, %r14d
cmovbl %eax, %r14d
jmp 0x93d58
cmpl $0x24, %r14d
jne 0x93e36
movl 0x5c0(%r13), %ebp
leaq 0xf0(%r13), %r14
testl %ebp, %ebp
jle 0x93d65
decl %ebp
movq %r14, %rdi
movl %ebp, %esi
callq 0x58990
cmpl $0xa, (%rax)
jne 0x93aaa
incl %ebp
jmp 0x93f7c
movl $0x11, %edi
callq 0x57510
testb %al, %al
je 0x93aee
movl $0x10, %edi
callq 0x57510
testb %al, %al
jne 0x93aee
movq %r13, %rdi
callq 0x591d0
movq (%r13), %rax
movq %r13, %rdi
callq *0x98(%rax)
testb %al, %al
je 0x94072
movl $0x11, %edi
callq 0x57510
testb %al, %al
jne 0x94072
movl $0x10, %edi
callq 0x57510
testb %al, %al
je 0x94072
movq %r13, %rdi
callq 0x57a80
jmp 0x94072
movq (%r13), %rax
movq %r13, %rdi
callq *0x98(%rax)
testb %al, %al
je 0x94072
movl $0x11, %edi
callq 0x57510
testb %al, %al
jne 0x94072
movl 0x5c8(%r13), %ebx
movl 0x5cc(%r13), %ebp
movl $0x10, %edi
callq 0x57510
cmpl %ebp, %ebx
jne 0x93fbd
testb %al, %al
jne 0x94072
movl 0x5c0(%r13), %ebx
leaq 0xf0(%r13), %rdi
callq 0x57180
cmpl %eax, %ebx
je 0x94072
movl 0x5c0(%r13), %eax
movl %eax, 0x5c8(%r13)
incl %eax
movl %eax, 0x5cc(%r13)
jmp 0x939f5
movq (%r13), %rax
movq %r13, %rdi
callq *0x98(%rax)
testb %al, %al
je 0x94072
movb $0x0, 0xcd(%r13)
addq $0x518, %r13            # imm = 0x518
movq %r13, %rdi
callq 0x70488
movb $0x1, %bpl
jmp 0x94074
movq (%r13), %rax
movq %r13, %rdi
callq *0x98(%rax)
testb %al, %al
je 0x94072
movl $0x11, %edi
callq 0x57510
testb %al, %al
jne 0x94072
movl $0x10, %edi
callq 0x57510
testb %al, %al
jne 0x94072
movl 0x5c8(%r13), %eax
cmpl 0x5cc(%r13), %eax
jne 0x939f5
movl 0x5c0(%r13), %eax
testl %eax, %eax
je 0x94072
leal -0x1(%rax), %ecx
movl %ecx, 0x5c8(%r13)
movl %eax, 0x5cc(%r13)
jmp 0x939f5
movl $0x11, %edi
callq 0x57510
testb %al, %al
je 0x94072
movq %r13, %rdi
callq 0x591b8
jmp 0x94072
leaq 0xf0(%r13), %r15
movq %r15, %rdi
callq 0x57180
movl %eax, %ebp
movl 0x5c0(%r13), %r14d
movq %r15, %rdi
callq 0x57180
cmpl %eax, %r14d
jge 0x9402c
movl %r14d, %r12d
leal 0x1(%r12), %r14d
movq %r15, %rdi
movl %r14d, %esi
callq 0x58990
cmpl $0xa, (%rax)
je 0x9402f
movq %r15, %rdi
movl %r12d, %esi
callq 0x58990
cmpl $0x20, (%rax)
je 0x93cf4
movq %r15, %rdi
movl %r12d, %esi
callq 0x58990
cmpl $0x9, (%rax)
je 0x93cf4
movq %r15, %rdi
movl %r12d, %esi
callq 0x58990
cmpl $0xa, (%rax)
jne 0x93c97
movq %r15, %rdi
movl %r14d, %esi
callq 0x58990
cmpl $0x20, (%rax)
je 0x93c97
movq %r15, %rdi
movl %r14d, %esi
callq 0x58990
cmpl $0x9, (%rax)
je 0x93c97
movq %r15, %rdi
movl %r14d, %esi
callq 0x58990
cmpl $0xa, (%rax)
je 0x93c97
jmp 0x9402f
movl 0x5c0(%r13), %ebx
leaq 0xf0(%r13), %rdi
callq 0x57180
xorl %r14d, %r14d
movl $0x0, %ecx
cmpl %eax, %ebx
jge 0x93d58
movl 0x5c0(%r13), %r14d
incl %r14d
movb $0x1, %cl
testb %cl, %cl
jne 0x9402f
jmp 0x94072
xorl %ebp, %ebp
jmp 0x93f7c
movq 0x8(%rsp), %rax
movl %eax, %ebx
cmpl $0x26, %r14d
movq 0x10(%rsp), %r15
jne 0x93deb
movq 0x8(%rsp), %rcx
leal (%rcx,%r13), %ebx
decl %ebx
testl %ebx, %ebx
movl %ecx, %r14d
cmovel %ebx, %r14d
cmpl $0x2, %r12d
jl 0x93de3
leal (%rcx,%r13), %ebp
addl $-0x2, %ebp
movl %r12d, %eax
sarl $0x1f, %eax
andl %r12d, %eax
addl %ecx, %eax
movl $0x2, %r12d
subl %eax, %r12d
movl %ebp, %r15d
movq 0x10(%rsp), %rdi
movl %ebp, %esi
callq 0x58990
subl $0x1, %r15d
jb 0x93ede
cmpl $0xa, (%rax)
je 0x93ede
incl %r12d
leal 0x1(%r15), %eax
movl %r15d, %ebp
testl %eax, %eax
jg 0x93db6
movl %r14d, %r12d
jmp 0x93f35
movq 0x18(%rsp), %rax
movl 0x5c0(%rax), %r14d
movq %r15, %rdi
callq 0x57180
cmpl %eax, %r14d
jge 0x93ea5
movq 0x8(%rsp), %r12
movq %r15, %rdi
movl %r14d, %esi
callq 0x58990
cmpl $0xa, (%rax)
je 0x93ef1
incl %r14d
movq %r15, %rdi
callq 0x57180
cmpl %eax, %r14d
jl 0x93e0d
jmp 0x93f35
leaq 0xf0(%r13), %r14
movq %r14, %rdi
callq 0x57180
movl %eax, %ebp
movl 0x5c0(%r13), %r15d
movq %r14, %rdi
callq 0x57180
cmpl %eax, %r15d
jge 0x93f7c
movq %r14, %rdi
movl %r15d, %esi
callq 0x58990
cmpl $0xa, (%rax)
je 0x93f79
incl %r15d
jmp 0x93e4e
movl 0x5c0(%r13), %ebx
leaq 0xf0(%r13), %r14
movq %r14, %rdi
callq 0x57180
cmpl %eax, %ebx
jge 0x94072
movq %r14, %rdi
callq 0x57180
movl %eax, %ebp
jmp 0x93f7c
movq 0x8(%rsp), %r12
jmp 0x93f35
movb $0x0, 0xcd(%r13)
leaq 0x518(%r13), %rdi
callq 0x70488
leaq 0x728(%r13), %rdi
addq $0xf0, %r13
movq %r13, %rsi
callq 0x76a7e
jmp 0x94072
cmpl $0x1, %ebp
adcl $-0x1, %r12d
negl %r12d
cmpl %r12d, %ebx
cmovll %ebx, %r12d
jmp 0x93f35
testl %ebx, %ebx
js 0x93f35
movl %ebp, %eax
sarl $0x1f, %eax
andl %ebp, %eax
subl %r13d, %eax
leal (%r14,%rax), %ebx
incl %ebx
incl %r14d
movl %r14d, %r12d
movq %r15, %rdi
movl %r14d, %esi
callq 0x58990
cmpl $0xa, (%rax)
je 0x93f35
movq %r15, %rdi
movl %r12d, %esi
callq 0x58990
cmpl $0x0, (%rax)
je 0x93f35
leal 0x1(%r12), %r14d
cmpl %ebx, %r12d
jl 0x93f08
movl $0x10, %edi
callq 0x57510
testb %al, %al
movq 0x18(%rsp), %rbx
je 0x93f6e
cmpl $-0x1, 0x5c8(%rbx)
jne 0x93f5d
movl 0x5c0(%rbx), %eax
movl %eax, 0x5c8(%rbx)
movl 0x5c8(%rbx), %esi
movq %rbx, %rdi
movl %r12d, %edx
callq 0x56ae0
movq %rbx, %rdi
movl %r12d, %esi
jmp 0x9406d
movl %r15d, %ebp
movl $0x10, %edi
callq 0x57510
testb %al, %al
je 0x93fb3
cmpl $-0x1, 0x5c8(%r13)
jne 0x93fa2
movl 0x5c0(%r13), %eax
movl %eax, 0x5c8(%r13)
movl 0x5c8(%r13), %esi
movq %r13, %rdi
movl %ebp, %edx
callq 0x56ae0
movq %r13, %rdi
movl %ebp, %esi
jmp 0x9406d
testb %al, %al
jne 0x939ed
jmp 0x939f5
orb $0x40, 0x33(%r13)
movq %r13, %rdi
callq 0x591d8
xorb $0x40, 0x33(%r13)
leaq 0x20(%rsp), %r14
movq %r14, %rdi
xorl %esi, %esi
callq 0x58e20
movq %r14, %rdi
xorl %esi, %esi
callq 0x58990
movl $0xa, (%rax)
leaq 0x20(%rsp), %rsi
movq %r13, %rdi
callq 0x56070
leaq 0x708(%r13), %rdi
addq $0xf0, %r13
movq %r13, %rsi
callq 0x76a7e
leaq 0x20(%rsp), %rdi
callq 0x59200
jmp 0x94072
incl %ebp
movl %ebp, %r14d
movl $0x10, %edi
callq 0x57510
testb %al, %al
je 0x94067
cmpl $-0x1, 0x5c8(%r13)
jne 0x94055
movl 0x5c0(%r13), %eax
movl %eax, 0x5c8(%r13)
movl 0x5c8(%r13), %esi
movq %r13, %rdi
movl %r14d, %edx
callq 0x56ae0
movq %r13, %rdi
movl %r14d, %esi
callq 0x58a30
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x59200
movq %rbx, %rdi
callq 0x57090