// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/classes/gui/window/backends/xlib/windowxlib.cpp
// Function: smooth::GUI::WindowXLib::CreateInputContext()
S::Void S::GUI::WindowXLib::CreateInputContext()
{
	if (im == NIL) return;

	XLockDisplay(display);

	/* Set up callbacks.
	 */
	XIMCallback	 cbPeStart  = { (XPointer) this, (XIMProc) S::GUI::OnXIMPreeditStart };
	XIMCallback	 cbPeDone   = { (XPointer) this, (XIMProc) S::GUI::OnXIMPreeditDone  };
	XIMCallback	 cbPeDraw   = { (XPointer) this, (XIMProc) S::GUI::OnXIMPreeditDraw  };
	XIMCallback	 cbPeCaret  = { (XPointer) this, (XIMProc) S::GUI::OnXIMPreeditCaret };

	XVaNestedList	 preeditCbs = XVaCreateNestedList(0, XNPreeditStartCallback, &cbPeStart,
							     XNPreeditDoneCallback,  &cbPeDone,
							     XNPreeditDrawCallback,  &cbPeDraw,
							     XNPreeditCaretCallback, &cbPeCaret, NULL);

	/* Create input context.
	 */
	ic = XCreateIC(im, XNClientWindow,	wnd,
			   XNInputStyle,	XIMPreeditCallbacks | XIMStatusNothing,
			   XNPreeditAttributes,	preeditCbs, NULL);

	XFree(preeditCbs);

	if (ic == NIL)
	{
		/* Creating an IC for pre-editing can fail if the desktop environment does
		 * not support it. Try creating one without pre-editing in that case.
		 */
		ic = XCreateIC(im, XNClientWindow, wnd,
				   XNInputStyle,   XIMPreeditNothing | XIMStatusNothing, NULL);
	}

	/* Configure input context.
	 */
	if (ic != NIL)
	{
		/* Set focus window.
		 */
		XSetICValues(ic, XNFocusWindow, iwnd, NULL);

		/* Get mask of filter events for IC.
		 */
		long	 filterEvents = 0;

		XGetICValues(ic, XNFilterEvents, &filterEvents, NULL);

		XSelectInput(display, iwnd, filterEvents);
	}

	XUnlockDisplay(display);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x88, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x68(%rbp)
cmpq $0x0, 0x128(%rax)
jne 0x127ef7
jmp 0x1280cf
movq -0x68(%rbp), %rax
movq 0x120(%rax), %rdi
callq 0x5db70
movq -0x68(%rbp), %rax
movq %rax, -0x20(%rbp)
leaq 0x1ca(%rip), %rcx       # 0x1280e0
movq %rcx, -0x18(%rbp)
movq %rax, -0x30(%rbp)
leaq 0x1eb(%rip), %rcx       # 0x128110
movq %rcx, -0x28(%rbp)
movq %rax, -0x40(%rbp)
leaq 0x20c(%rip), %rcx       # 0x128140
movq %rcx, -0x38(%rbp)
movq %rax, -0x50(%rbp)
leaq 0x22d(%rip), %rax       # 0x128170
movq %rax, -0x48(%rbp)
xorl %edi, %edi
leaq 0x7ec27(%rip), %rsi     # 0x1a6b77
leaq -0x20(%rbp), %rdx
leaq 0x7ec31(%rip), %rcx     # 0x1a6b8c
leaq -0x30(%rbp), %r8
leaq 0x7ec3a(%rip), %r9      # 0x1a6ba0
leaq -0x40(%rbp), %r11
leaq 0x7ec43(%rip), %r10     # 0x1a6bb4
leaq -0x50(%rbp), %rax
xorl %ebx, %ebx
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movq %rax, 0x10(%rsp)
movq $0x0, 0x18(%rsp)
movb $0x0, %al
callq 0x5c390
movq %rax, %rcx
movq -0x68(%rbp), %rax
movq %rcx, -0x58(%rbp)
movq 0x128(%rax), %rdi
movq 0x138(%rax), %rdx
movq -0x58(%rbp), %rax
leaq 0x7ec10(%rip), %rsi     # 0x1a6bc9
leaq 0x7ec16(%rip), %rcx     # 0x1a6bd6
movl $0x402, %r8d            # imm = 0x402
leaq 0x7ec14(%rip), %r9      # 0x1a6be1
xorl %r10d, %r10d
movq %rax, (%rsp)
movq $0x0, 0x8(%rsp)
movb $0x0, %al
callq 0x5bbf0
movq %rax, %rcx
movq -0x68(%rbp), %rax
movq %rcx, 0x148(%rax)
movq -0x58(%rbp), %rdi
callq 0x5c780
movq -0x68(%rbp), %rax
cmpq $0x0, 0x148(%rax)
jne 0x128049
movq -0x68(%rbp), %rax
movq 0x128(%rax), %rdi
movq 0x138(%rax), %rdx
leaq 0x7eba7(%rip), %rsi     # 0x1a6bc9
leaq 0x7ebad(%rip), %rcx     # 0x1a6bd6
movl $0x408, %r8d            # imm = 0x408
xorl %eax, %eax
movl %eax, %r9d
movb $0x0, %al
callq 0x5bbf0
movq %rax, %rcx
movq -0x68(%rbp), %rax
movq %rcx, 0x148(%rax)
movq -0x68(%rbp), %rax
cmpq $0x0, 0x148(%rax)
je 0x1280bf
movq -0x68(%rbp), %rax
movq 0x148(%rax), %rdi
movq 0x150(%rax), %rdx
leaq 0x7eb83(%rip), %rsi     # 0x1a6bf3
xorl %eax, %eax
movl %eax, %ecx
movb $0x0, %al
callq 0x5b590
movq -0x68(%rbp), %rax
movq $0x0, -0x60(%rbp)
movq 0x148(%rax), %rdi
leaq 0x7eb6a(%rip), %rsi     # 0x1a6bff
leaq -0x60(%rbp), %rdx
xorl %eax, %eax
movl %eax, %ecx
movb $0x0, %al
callq 0x5cc90
movq -0x68(%rbp), %rax
movq 0x120(%rax), %rdi
movq 0x150(%rax), %rsi
movq -0x60(%rbp), %rdx
callq 0x5d0b0
movq -0x68(%rbp), %rax
movq 0x120(%rax), %rdi
callq 0x5ac40
addq $0x88, %rsp
popq %rbx
popq %rbp
retq
nopl (%rax)