// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/classes/gui/window/backends/xlib/windowxlib.cpp
// Function: smooth::GUI::WindowXLib::OnXIMPreeditDraw(X11::_XIMPreeditDrawCallbackStruct*)
S::Void S::GUI::WindowXLib::OnXIMPreeditDraw(XIMPreeditDrawCallbackStruct *data)
{
	if (activeCursor == NIL) return;

	/* Get preedit string if any.
	 */
	String	 string;

	if (data->text != NIL)
	{
		if (data->text->encoding_is_wchar) string = data->text->string.wide_char;
		else				   string.ImportFrom("UTF-8", data->text->string.multi_byte);
	}

	/* Draw string at cursor position.
	 */
	Rect	 rect = Rect::OverlapRect(Rect(activeCursorPos - Point(1, 1), activeCursor->GetRealSize()), Rect(activeCursor->GetRealPosition(), activeCursor->GetRealSize()));

	activeCursor->SetIMECursor(True);

	drawSurface->StartPaint(rect);
	drawSurface->Box(rect, activeCursor->GetBackgroundColor(), Rect::Filled);

	if (data->text != NIL)
	{
		for (Int i = 0; i < data->text->length; i++)
		{
			Font	 font = activeCursor->GetFont();

			if (data->text->feedback != NIL)
			{
				if (data->text->feedback[i] & XIMUnderline) font.SetStyle(Font::Underline);
			}

			drawSurface->SetText(string.SubString(i, 1), rect + Point(font.GetScaledTextSizeX(string.Head(i)), 0), font);
		}
	}

	drawSurface->EndPaint();

	activeCursor->SetIMEAdvance(activeCursor->GetFont().GetScaledTextSizeX(string.Head(data->caret)));
	activeCursor->SetIMECursor(False);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1d0, %rsp            # imm = 0x1D0
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x140(%rbp)
cmpq $0x0, 0xecea2(%rip)     # 0x214858
jne 0x1279bd
jmp 0x127e8a
leaq -0x28(%rbp), %rdi
xorl %esi, %esi
callq 0x5da90
movq -0x10(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x127a2d
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
cmpl $0x0, 0x10(%rax)
je 0x127a0b
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x18(%rax), %rsi
leaq -0x28(%rbp), %rdi
callq 0x5dbd0
jmp 0x1279f8
jmp 0x127a2b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x127eab
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x18(%rax), %rdx
leaq 0x7e1c8(%rip), %rsi     # 0x1a5be6
leaq -0x28(%rbp), %rdi
callq 0x5ae70
jmp 0x127a29
jmp 0x127a2b
jmp 0x127a2d
leaq -0x64(%rbp), %rdi
movl $0x1, %edx
movl %edx, %esi
callq 0x5c2c0
jmp 0x127a3f
leaq 0xece1a(%rip), %rdi     # 0x214860
leaq -0x64(%rbp), %rsi
callq 0x5cbd0
movq %rax, -0x148(%rbp)
jmp 0x127a58
movq -0x148(%rbp), %rax
movq %rax, -0x5c(%rbp)
movq 0xecdee(%rip), %rdi     # 0x214858
movq (%rdi), %rax
movq 0x50(%rax), %rax
callq *%rax
movq %rax, -0x150(%rbp)
jmp 0x127a7c
movq -0x150(%rbp), %rax
movq %rax, -0x6c(%rbp)
leaq -0x54(%rbp), %rdi
leaq -0x5c(%rbp), %rsi
leaq -0x6c(%rbp), %rdx
callq 0x59ff0
jmp 0x127a9a
movq 0xecdb7(%rip), %rdi     # 0x214858
movq (%rdi), %rax
movq 0x48(%rax), %rax
callq *%rax
movq %rax, -0x158(%rbp)
jmp 0x127ab3
movq -0x158(%rbp), %rax
movq %rax, -0x84(%rbp)
movq 0xecd90(%rip), %rdi     # 0x214858
movq (%rdi), %rax
movq 0x50(%rax), %rax
callq *%rax
movq %rax, -0x160(%rbp)
jmp 0x127ada
movq -0x160(%rbp), %rax
movq %rax, -0x8c(%rbp)
leaq -0x7c(%rbp), %rdi
leaq -0x84(%rbp), %rsi
leaq -0x8c(%rbp), %rdx
callq 0x59ff0
jmp 0x127b01
leaq -0x54(%rbp), %rdi
leaq -0x7c(%rbp), %rsi
callq 0x5d6a0
movq %rdx, -0x170(%rbp)
movq %rax, -0x168(%rbp)
jmp 0x127b1e
movq -0x170(%rbp), %rax
movq -0x168(%rbp), %rcx
movq %rcx, -0x44(%rbp)
movq %rax, -0x3c(%rbp)
movq 0xecd1d(%rip), %rdi     # 0x214858
movl $0x1, %esi
callq 0x5c500
jmp 0x127b47
movq -0x140(%rbp), %rax
movq 0x10(%rax), %rdi
leaq -0x44(%rbp), %rsi
callq 0x591b0
jmp 0x127b5d
movq -0x140(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x180(%rbp)
movq 0xecce2(%rip), %rdi     # 0x214858
movq (%rdi), %rax
movq 0x140(%rax), %rax
callq *%rax
movq %rax, -0x178(%rbp)
jmp 0x127b8b
movq 0xe140e(%rip), %rax     # 0x208fa0
movl (%rax), %eax
movl %eax, -0x184(%rbp)
leaq -0x94(%rbp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x59260
jmp 0x127bac
movl -0x184(%rbp), %ecx
movq -0x178(%rbp), %rdx
movq -0x180(%rbp), %rdi
leaq -0x44(%rbp), %rsi
leaq -0x94(%rbp), %r8
callq 0x5c110
jmp 0x127bd2
movq -0x10(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x127de9
movl $0x0, -0x98(%rbp)
movl -0x98(%rbp), %eax
movq -0x10(%rbp), %rcx
movq 0x10(%rcx), %rcx
movzwl (%rcx), %ecx
cmpl %ecx, %eax
jge 0x127de7
movq 0xecc4d(%rip), %rdi     # 0x214858
movq (%rdi), %rax
movq 0xe8(%rax), %rax
callq *%rax
movq %rax, -0x190(%rbp)
jmp 0x127c20
movq -0x190(%rbp), %rsi
leaq -0xd8(%rbp), %rdi
callq 0x59da0
jmp 0x127c35
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
cmpq $0x0, 0x8(%rax)
je 0x127c92
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rax
movslq -0x98(%rbp), %rcx
movq (%rax,%rcx,8), %rax
andq $0x2, %rax
cmpq $0x0, %rax
je 0x127c90
movq 0xe0d0c(%rip), %rax     # 0x208978
movswl (%rax), %esi
leaq -0xd8(%rbp), %rdi
callq 0x596a0
jmp 0x127c7d
jmp 0x127c90
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x127dd6
jmp 0x127c92
movq -0x140(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x198(%rbp)
movl -0x98(%rbp), %edx
leaq -0xf0(%rbp), %rdi
leaq -0x28(%rbp), %rsi
movl $0x1, %ecx
callq 0x5dc20
jmp 0x127cc1
movl -0x98(%rbp), %edx
leaq -0x120(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x5d6b0
jmp 0x127cd9
leaq -0xd8(%rbp), %rdi
leaq -0x120(%rbp), %rsi
callq 0x5ac00
movl %eax, -0x19c(%rbp)
jmp 0x127cf4
movl -0x19c(%rbp), %esi
leaq -0x108(%rbp), %rdi
xorl %edx, %edx
callq 0x5c2c0
jmp 0x127d0a
leaq -0x44(%rbp), %rdi
leaq -0x108(%rbp), %rsi
callq 0x5be80
movq %rdx, -0x1b0(%rbp)
movq %rax, -0x1a8(%rbp)
jmp 0x127d2a
movq -0x198(%rbp), %rdi
movq -0x1b0(%rbp), %rax
movq -0x1a8(%rbp), %rcx
movq %rcx, -0x100(%rbp)
movq %rax, -0xf8(%rbp)
leaq -0xf0(%rbp), %rsi
leaq -0x100(%rbp), %rdx
leaq -0xd8(%rbp), %rcx
xorl %r8d, %r8d
callq 0x5c3f0
jmp 0x127d6c
leaq -0x120(%rbp), %rdi
callq 0x5df00
leaq -0xf0(%rbp), %rdi
callq 0x5df00
leaq -0xd8(%rbp), %rdi
callq 0x5abf0
movl -0x98(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x98(%rbp)
jmp 0x127beb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x127dca
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x120(%rbp), %rdi
callq 0x5df00
leaq -0xf0(%rbp), %rdi
callq 0x5df00
leaq -0xd8(%rbp), %rdi
callq 0x5abf0
jmp 0x127eab
jmp 0x127de9
movq -0x140(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x5d270
jmp 0x127dfb
movq 0xeca56(%rip), %rdi     # 0x214858
movq %rdi, -0x1c0(%rbp)
movq (%rdi), %rax
movq 0xe8(%rax), %rax
callq *%rax
movq %rax, -0x1b8(%rbp)
jmp 0x127e1e
movq -0x10(%rbp), %rax
movl (%rax), %edx
leaq -0x138(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x5d6b0
jmp 0x127e36
movq -0x1b8(%rbp), %rdi
leaq -0x138(%rbp), %rsi
callq 0x5ac00
movl %eax, -0x1c4(%rbp)
jmp 0x127e51
movl -0x1c4(%rbp), %esi
movq -0x1c0(%rbp), %rdi
callq 0x5a180
jmp 0x127e65
leaq -0x138(%rbp), %rdi
callq 0x5df00
movq 0xec9e0(%rip), %rdi     # 0x214858
xorl %esi, %esi
callq 0x5c500
jmp 0x127e81
leaq -0x28(%rbp), %rdi
callq 0x5df00
addq $0x1d0, %rsp            # imm = 0x1D0
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x138(%rbp), %rdi
callq 0x5df00
leaq -0x28(%rbp), %rdi
callq 0x5df00
movq -0x30(%rbp), %rdi
callq 0x5b6b0
nopl (%rax)