// File: /workspace/github_c_makefile_star2_O2/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 $0x28, %rsp
cmpb $0x1, 0xcd(%rdi)
jne 0x9013f
movl %esi, %r14d
movq %rdi, %r13
pushq $0x11
popq %rdi
callq 0x58710
testb %al, %al
je 0x8f8d2
pushq $0x5b
popq %rdi
callq 0x58710
movl %eax, %ebp
pushq $0x11
popq %rdi
callq 0x58710
movl %eax, %r15d
xorb %bpl, %r15b
pushq $0x12
popq %rdi
callq 0x58710
cmpb %al, %r15b
je 0x9013f
xorl %ebp, %ebp
leal -0x1b(%r14), %eax
cmpl $0x13, %eax
ja 0x8f936
leaq 0x573b0(%rip), %rcx     # 0xe6c94
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
pushq $0x10
popq %rdi
callq 0x58710
testb %al, %al
jne 0x8f906
pushq $-0x1
popq %rdx
movq %r13, %rdi
movl %edx, %esi
callq 0x57c50
pushq $0x11
popq %rdi
callq 0x58710
testb %al, %al
je 0x8fc1f
movl 0x5c0(%r13), %ebx
cmpl $0x24, %r14d
jne 0x8feb3
xorl %ebp, %ebp
testl %ebx, %ebx
jne 0x9006a
jmp 0x90141
leal -0x56(%r14), %eax
cmpl $0x4, %eax
jbe 0x8f984
cmpl $0x8, %r14d
je 0x8fdb8
cmpl $0xd, %r14d
je 0x8fe43
cmpl $0x41, %r14d
je 0x8fe26
cmpl $0x43, %r14d
jne 0x90141
pushq $0x11
popq %rdi
callq 0x58710
testb %al, %al
je 0x9013f
movq %r13, %rdi
callq 0x5a558
jmp 0x9013f
leaq 0x57359(%rip), %rcx     # 0xe6ce4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq (%r13), %rax
movq %r13, %rdi
callq *0x98(%rax)
testb %al, %al
je 0x9013f
pushq $0x11
jmp 0x8fd9d
pushq $0x10
popq %rdi
callq 0x58710
testb %al, %al
jne 0x8f9c9
pushq $-0x1
popq %rdx
movq %r13, %rdi
movl %edx, %esi
callq 0x57c50
pushq $0x11
popq %rdi
callq 0x58710
testb %al, %al
je 0x8fc52
cmpl $0x27, %r14d
je 0x8ff9c
cmpl $0x25, %r14d
jne 0x8f9fe
movq (%r13), %rax
movq %r13, %rdi
callq *0x160(%rax)
testb %al, %al
je 0x8ffb1
leaq 0xf0(%r13), %r14
movq %r14, %rdi
callq 0x58370
movl %eax, %r15d
movl 0x5c0(%r13), %r12d
movq %r14, %rdi
callq 0x58370
cmpl %eax, %r12d
jge 0x8ff17
leal 0x1(%r12), %ebp
movq %r14, %rdi
movl %ebp, %esi
callq 0x59cc0
cmpl $0xa, (%rax)
je 0x9006a
movq %r14, %rdi
movl %r12d, %esi
callq 0x59cc0
cmpl $0x20, (%rax)
je 0x8fa73
movq %r14, %rdi
movl %r12d, %esi
callq 0x59cc0
cmpl $0x9, (%rax)
je 0x8fa73
movq %r14, %rdi
movl %r12d, %esi
callq 0x59cc0
cmpl $0xa, (%rax)
movl %ebp, %r12d
jne 0x8fa17
movq %r14, %rdi
movl %ebp, %esi
callq 0x59cc0
cmpl $0x20, (%rax)
movl %ebp, %r12d
je 0x8fa17
movq %r14, %rdi
movl %ebp, %esi
callq 0x59cc0
cmpl $0x9, (%rax)
movl %ebp, %r12d
je 0x8fa17
movq %r14, %rdi
movl %ebp, %esi
callq 0x59cc0
cmpl $0xa, (%rax)
movl %ebp, %r12d
je 0x8fa17
jmp 0x9006a
movl 0x30(%r13), %edi
pushq $0x1
popq %rsi
callq 0x596b0
testb %al, %al
je 0x9013f
pushq $0x10
popq %rdi
callq 0x58710
testb %al, %al
jne 0x8fadf
pushq $-0x1
popq %rdx
movq %r13, %rdi
movl %edx, %esi
callq 0x57c50
movl 0x5c0(%r13), %eax
movq %r13, 0x8(%rsp)
leaq 0xf0(%r13), %r15
leal -0x1(%rax), %ecx
xorl %edx, %edx
movq %rax, (%rsp)
movl %eax, %esi
movl %esi, %ebx
movl %edx, %ebp
movl %ecx, %r13d
leal 0x1(%r13), %r12d
testl %r12d, %r12d
jle 0x8fb27
movq %r15, %rdi
movl %r13d, %esi
callq 0x59cc0
leal 0x1(%rbp), %edx
leal -0x1(%r13), %ecx
leal -0x1(%rbx), %esi
cmpl $0xa, (%rax)
jne 0x8fafd
cmpl $0x26, %r14d
jne 0x8ff1f
xorl %ebp, %ebp
movl %r13d, %r14d
subl $0x1, %r14d
movq (%rsp), %rcx
cmovael %ecx, %ebp
movl %r12d, %eax
sarl $0x1f, %eax
andl %r12d, %eax
addl %ecx, %eax
pushq $0x2
popq %rbx
subl %eax, %ebx
testl %r14d, %r14d
js 0x900a4
movq %r15, %rdi
movl %r14d, %esi
callq 0x59cc0
movl %r14d, %ecx
subl $0x1, %ecx
jb 0x900b7
cmpl $0xa, (%rax)
je 0x900b7
incl %ebx
movl %ecx, %r14d
jmp 0x8fb51
movq (%r13), %rax
movq %r13, %rdi
callq *0x98(%rax)
testb %al, %al
je 0x9013f
pushq $0x11
popq %rdi
callq 0x58710
testb %al, %al
je 0x9013f
movq %r13, %rdi
callq 0x5a4a0
jmp 0x9013f
movq (%r13), %rax
movq %r13, %rdi
callq *0x98(%rax)
testb %al, %al
je 0x9013f
pushq $0x11
popq %rdi
callq 0x58710
testb %al, %al
je 0x9013f
movq %r13, %rdi
callq 0x5a558
movq %r13, %rdi
callq 0x5a560
jmp 0x9013f
movq (%r13), %rax
movq %r13, %rdi
callq *0x98(%rax)
testb %al, %al
je 0x9013f
pushq $0x11
popq %rdi
callq 0x58710
testb %al, %al
je 0x9013f
movq %r13, %rdi
callq 0x58b60
jmp 0x9013f
cmpl $0x24, %r14d
jne 0x8fed9
movl 0x5c0(%r13), %ebp
leaq 0xf0(%r13), %r14
testl %ebp, %ebp
jle 0x90041
decl %ebp
movq %r14, %rdi
movl %ebp, %esi
callq 0x59cc0
cmpl $0xa, (%rax)
jne 0x8fc37
jmp 0x8fc99
cmpl $0x27, %r14d
je 0x90045
cmpl $0x25, %r14d
jne 0x8fc77
movq (%r13), %rax
movq %r13, %rdi
callq *0x160(%rax)
testb %al, %al
je 0x9005a
movl 0x5c0(%r13), %ebx
leaq 0xf0(%r13), %rdi
callq 0x58370
cmpl %eax, %ebx
jge 0x9013f
movl 0x5c0(%r13), %ebp
incl %ebp
jmp 0x9006a
movq (%r13), %rax
movq %r13, %rdi
callq *0x98(%rax)
testb %al, %al
je 0x9013f
movb $0x0, 0xcd(%r13)
addq $0x518, %r13            # imm = 0x518
movq %r13, %rdi
callq 0x70196
movb $0x1, %bpl
jmp 0x90141
movq (%r13), %rax
movq %r13, %rdi
callq *0x98(%rax)
testb %al, %al
je 0x9013f
pushq $0x11
popq %rdi
callq 0x58710
testb %al, %al
jne 0x9013f
movl 0x5c8(%r13), %ebx
movl 0x5cc(%r13), %ebp
pushq $0x10
popq %rdi
callq 0x58710
cmpl %ebp, %ebx
jne 0x90152
testb %al, %al
jne 0x9013f
movl 0x5c0(%r13), %ebx
leaq 0xf0(%r13), %rdi
callq 0x58370
cmpl %eax, %ebx
je 0x9013f
movl 0x5c0(%r13), %eax
movl %eax, 0x5c8(%r13)
incl %eax
movl %eax, 0x5cc(%r13)
jmp 0x8fbe0
pushq $0x11
popq %rdi
callq 0x58710
testb %al, %al
je 0x8fd76
pushq $0x10
popq %rdi
callq 0x58710
testb %al, %al
jne 0x8fd76
movq %r13, %rdi
callq 0x5a558
movq (%r13), %rax
movq %r13, %rdi
callq *0x98(%rax)
testb %al, %al
je 0x9013f
pushq $0x11
popq %rdi
callq 0x58710
testb %al, %al
jne 0x9013f
pushq $0x10
popq %rdi
callq 0x58710
testb %al, %al
je 0x9013f
movq %r13, %rdi
callq 0x58ce0
jmp 0x9013f
movq (%r13), %rax
movq %r13, %rdi
callq *0x98(%rax)
testb %al, %al
je 0x9013f
pushq $0x11
popq %rdi
callq 0x58710
testb %al, %al
jne 0x9013f
pushq $0x10
popq %rdi
callq 0x58710
testb %al, %al
jne 0x9013f
movl 0x5c8(%r13), %eax
cmpl 0x5cc(%r13), %eax
jne 0x8fbe0
movl 0x5c0(%r13), %eax
testl %eax, %eax
je 0x9013f
leal -0x1(%rax), %ecx
movl %ecx, 0x5c8(%r13)
movl %eax, 0x5cc(%r13)
jmp 0x8fbe0
pushq $0x11
popq %rdi
callq 0x58710
testb %al, %al
je 0x9013f
movq %r13, %rdi
callq 0x5a540
jmp 0x9013f
movq (%r13), %rax
movq %r13, %rdi
callq *0x98(%rax)
testb %al, %al
je 0x9013f
movl 0x30(%r13), %edi
pushq $0x1
popq %rsi
callq 0x596b0
testb %al, %al
je 0x900d1
movl 0x5c8(%r13), %eax
movl 0x5cc(%r13), %ebx
cmpl %ebx, %eax
sete %cl
testl %eax, %eax
sets %al
orb %cl, %al
jne 0x9015f
orb $0x40, 0x33(%r13)
movq %r13, %rdi
callq 0x5a560
xorb $0x40, 0x33(%r13)
testl %ebx, %ebx
js 0x90171
movq %r13, %rdi
callq 0x579b0
jmp 0x90171
leaq 0xf0(%r13), %r14
movq %r14, %rdi
callq 0x58370
cmpl %eax, %ebx
jge 0x9013f
movq %r14, %rdi
callq 0x58370
movl %eax, %ebp
jmp 0x9006a
leaq 0xf0(%r13), %r14
movq %r14, %rdi
callq 0x58370
movl %eax, %ebp
movl 0x5c0(%r13), %r15d
movq %r14, %rdi
callq 0x58370
cmpl %eax, %r15d
jge 0x9006a
movq %r14, %rdi
movl %r15d, %esi
callq 0x59cc0
cmpl $0xa, (%rax)
je 0x8ff17
incl %r15d
jmp 0x8fef1
movl %r15d, %ebp
jmp 0x9006a
movq 0x8(%rsp), %r12
movl 0x5c0(%r12), %r14d
movq %r15, %rdi
callq 0x58370
cmpl %eax, %r14d
jge 0x900ae
movq %r15, %rdi
movl %r14d, %esi
callq 0x59cc0
incl %r14d
cmpl $0xa, (%rax)
jne 0x8ff2c
movl %ebx, %eax
sarl $0x1f, %eax
andl %ebx, %eax
addl %r14d, %ebp
addl %eax, %ebp
movq (%rsp), %rbx
movl %ebx, %r13d
cmpl %ebp, %r14d
jg 0x90100
movl %r14d, %ebx
movq %r15, %rdi
movl %r14d, %esi
callq 0x59cc0
cmpl $0xa, (%rax)
je 0x900fd
movq %r15, %rdi
movl %ebx, %esi
callq 0x59cc0
cmpl $0x0, (%rax)
je 0x900fd
leal 0x1(%rbx), %r14d
jmp 0x8ff60
movq (%r13), %rax
movq %r13, %rdi
callq *0x160(%rax)
testb %al, %al
je 0x8f9fe
movl 0x5c0(%r13), %r14d
addl $-0x2, %r14d
leaq 0xf0(%r13), %r15
testl %r14d, %r14d
js 0x90041
leal 0x1(%r14), %ebp
movq %r15, %rdi
movl %ebp, %esi
callq 0x59cc0
cmpl $0xa, (%rax)
je 0x9006a
movq %r15, %rdi
movl %r14d, %esi
callq 0x59cc0
cmpl $0x20, (%rax)
je 0x9000f
movq %r15, %rdi
movl %r14d, %esi
callq 0x59cc0
cmpl $0x9, (%rax)
je 0x9000f
movq %r15, %rdi
movl %r14d, %esi
callq 0x59cc0
cmpl $0xa, (%rax)
jne 0x9003c
movq %r15, %rdi
movl %ebp, %esi
callq 0x59cc0
cmpl $0x20, (%rax)
je 0x9003c
movq %r15, %rdi
movl %ebp, %esi
callq 0x59cc0
cmpl $0x9, (%rax)
je 0x9003c
movq %r15, %rdi
movl %ebp, %esi
callq 0x59cc0
cmpl $0xa, (%rax)
jne 0x9006a
decl %r14d
jmp 0x8ffc3
xorl %ebp, %ebp
jmp 0x9006a
movq (%r13), %rax
movq %r13, %rdi
callq *0x160(%rax)
testb %al, %al
je 0x8fc77
movl 0x5c0(%r13), %ebp
subl $0x1, %ebp
jb 0x9013f
pushq $0x10
popq %rdi
callq 0x58710
testb %al, %al
je 0x9009a
movl 0x5c8(%r13), %esi
cmpl $-0x1, %esi
jne 0x90090
movl 0x5c0(%r13), %esi
movl %esi, 0x5c8(%r13)
movq %r13, %rdi
movl %ebp, %edx
callq 0x57c50
movq %r13, %rdi
movl %ebp, %esi
jmp 0x9013a
movq 0x8(%rsp), %r12
movl %ebp, %r13d
jmp 0x90100
movq (%rsp), %rax
movl %eax, %r13d
jmp 0x90100
cmpl $0x1, %r14d
adcl $-0x1, %ebx
negl %ebx
cmpl %ebx, %r13d
cmovll %r13d, %ebx
movl %ebx, %r13d
movq 0x8(%rsp), %r12
jmp 0x90100
movb $0x0, 0xcd(%r13)
leaq 0x518(%r13), %rdi
callq 0x70196
leaq 0x728(%r13), %rdi
addq $0xf0, %r13
movq %r13, %rsi
callq 0x75b8e
jmp 0x9013f
movl %ebx, %r13d
pushq $0x10
popq %rdi
callq 0x58710
testb %al, %al
je 0x90134
movl 0x5c8(%r12), %esi
cmpl $-0x1, %esi
jne 0x90129
movl 0x5c0(%r12), %esi
movl %esi, 0x5c8(%r12)
movq %r12, %rdi
movl %r13d, %edx
callq 0x57c50
movq %r12, %rdi
movl %r13d, %esi
callq 0x59d70
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testb %al, %al
jne 0x8fbd8
jmp 0x8fbe0
orb $0x40, 0x33(%r13)
movq %r13, %rdi
callq 0x5a560
xorb $0x40, 0x33(%r13)
leaq 0x10(%rsp), %r14
movq %r14, %rdi
xorl %esi, %esi
callq 0x5a180
movq %r14, %rdi
xorl %esi, %esi
callq 0x59cc0
movl $0xa, (%rax)
leaq 0x10(%rsp), %rsi
movq %r13, %rdi
callq 0x57150
leaq 0x708(%r13), %rdi
addq $0xf0, %r13
movq %r13, %rsi
callq 0x75b8e
leaq 0x10(%rsp), %rdi
callq 0x5a588
jmp 0x9013f
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x5a588
movq %rbx, %rdi
callq 0x58260