// File: /workspace/github_c_makefile_star2_O3/odknt[P]st/x.c
// Function: ximopen
int
ximopen(Display *dpy)
{
	XIMPreeditAttrs *attrs;
	XIMStyle ximstyle;
	XIMCallback imdestroy = { .client_data = NULL, .callback = ximdestroy };
	XICCallback icdestroy = { .client_data = NULL, .callback = xicdestroy };

	if (!(xw.ime.xim = XOpenIM(xw.dpy, NULL, NULL, NULL)))
		return 0;

	if (XSetIMValues(xw.ime.xim, XNDestroyCallback, &imdestroy, NULL))
		fprintf(stderr, "XSetIMValues: "
		                "Could not set XNDestroyCallback.\n");

	xw.ime.spotlist = XVaCreateNestedList(0, XNSpotLocation, &xw.ime.spot,
	                                      NULL);
	ximstyle = ximpickupstyle(xw.ime.xim);
	attrs = ximcreatepreeditattrs(dpy, ximstyle);
	xw.ime.xic = XCreateIC(xw.ime.xim, XNInputStyle, ximstyle,
	                       XNClientWindow, xw.win,
	                       XNFocusWindow, xw.win,
	                       XNDestroyCallback, &icdestroy,
	                       attrs ? XNPreeditAttributes : NULL,
	                       attrs ? attrs->list : NULL,
	                       NULL);
	if (attrs)
		ximdestroypreeditattrs(dpy, attrs);
	if (!xw.ime.xic)
		fprintf(stderr, "XCreateIC: Could not create input context.\n");

	return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdi, %rbx
movups 0x75c1(%rip), %xmm0     # 0x16240
movaps %xmm0, 0x20(%rsp)
movups 0x75c5(%rip), %xmm0     # 0x16250
movaps %xmm0, 0x10(%rsp)
movq 0x10b59(%rip), %rdi     # 0x1f7f0
xorl %r14d, %r14d
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x67b0
movq %rax, 0x10b94(%rip)     # 0x1f840
testq %rax, %rax
je 0xef23
leaq 0x3514(%rip), %r14      # 0x121d0
leaq 0x20(%rsp), %rdx
movq %rax, %rdi
movq %r14, %rsi
xorl %ecx, %ecx
xorl %eax, %eax
callq 0x6710
testq %rax, %rax
jne 0xef35
leaq 0x31f0(%rip), %rsi      # 0x11ed0
leaq 0x10b69(%rip), %rdx     # 0x1f850
xorl %r12d, %r12d
xorl %edi, %edi
xorl %ecx, %ecx
xorl %eax, %eax
callq 0x67d0
movq %rax, 0x10b5c(%rip)     # 0x1f858
movq 0x10b3d(%rip), %rdi     # 0x1f840
leaq 0x3556(%rip), %rsi      # 0x12260
leaq 0x40(%rsp), %r15
movq %r15, %rdx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0x61d0
movq (%r15), %rdi
movzwl (%rdi), %ecx
movb $0x1, %dl
leaq 0x2fc6(%rip), %rax      # 0x11cf0
testq %rcx, %rcx
je 0xed48
movq (%rax,%r12,8), %rsi
movq 0x8(%rdi), %r8
xorl %r9d, %r9d
cmpq (%r8,%r9,8), %rsi
je 0xed5e
incq %r9
cmpq %r9, %rcx
jne 0xed3a
movl $0x1, %r12d
testb $0x1, %dl
movl $0x0, %edx
jne 0xed2a
movl $0x2, %r12d
movl $0x408, %r15d           # imm = 0x408
cmpl %ecx, %r12d
jae 0xed70
movl %r12d, %ecx
movq (%rax,%rcx,8), %r15
callq 0x6090
movl $0x0, 0x8(%rsp)
testb $0x4, %r15b
jne 0xede8
movq 0x10ab6(%rip), %rdi     # 0x1f840
movq 0x10a6f(%rip), %r8      # 0x1f800
subq $0x30, %rsp
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rsp)
leaq 0x40(%rsp), %rax
movq %rax, 0x10(%rsp)
movq %r14, 0x8(%rsp)
movq %r8, (%rsp)
movq $0x0, 0x28(%rsp)
leaq 0x3450(%rip), %rsi      # 0x12210
leaq 0x3454(%rip), %rcx      # 0x1221b
leaq 0x345a(%rip), %r9       # 0x12228
movq %r15, %rdx
xorl %eax, %eax
callq 0x6030
addq $0x30, %rsp
movq %rax, 0x10a65(%rip)     # 0x1f848
jmp 0xef18
movl 0x108da(%rip), %edx     # 0x1f6c8
decl %edx
leaq 0x3479(%rip), %rsi      # 0x12270
leaq 0x40(%rsp), %r12
movq %r12, %rdi
xorl %eax, %eax
callq 0x64c0
leaq 0x38(%rsp), %r13
leaq 0xc(%rsp), %rcx
leaq 0x30(%rsp), %r8
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x64a0
movq %rax, %r12
movq (%r13), %rdi
testq %rdi, %rdi
je 0xee34
callq 0x6810
testq %r12, %r12
jne 0xee47
leaq 0x344e(%rip), %rdi      # 0x1228e
xorl %eax, %eax
callq 0x70a6
movq 0x1086a(%rip), %r10     # 0x1f6b8
movl 0x9757(%rip), %r11d     # 0x185ac
shlq $0x4, %r11
movl 0x9750(%rip), %r13d     # 0x185b0
shlq $0x4, %r13
xorl %ebp, %ebp
leaq 0x2a18(%rip), %r14      # 0x11885
leaq 0x3431(%rip), %rsi      # 0x122a5
leaq 0x3055(%rip), %rcx      # 0x11ed0
leaq 0x29f8(%rip), %r9       # 0x1187a
leaq 0x8(%rsp), %r8
xorl %edi, %edi
movq %r12, %rdx
xorl %eax, %eax
pushq %rbp
pushq (%r10,%r13)
pushq %r14
pushq (%r10,%r11)
callq 0x67d0
addq $0x20, %rsp
movq %rax, %r13
movq 0x10994(%rip), %rdi     # 0x1f840
movq 0x1094d(%rip), %r8      # 0x1f800
leaq 0x3023(%rip), %r10      # 0x11edd
leaq 0x10(%rsp), %r11
leaq 0x334a(%rip), %rsi      # 0x12210
leaq 0x334e(%rip), %rcx      # 0x1221b
leaq 0x3354(%rip), %r9       # 0x12228
movq %r15, %rdx
movl $0x0, %eax
pushq %rbp
pushq %r13
pushq %r10
pushq %r11
leaq 0x32e6(%rip), %r10      # 0x121d0
pushq %r10
pushq %r8
callq 0x6030
addq $0x30, %rsp
movq %rax, 0x1094a(%rip)     # 0x1f848
movq %r13, %rdi
callq 0x6090
movq %rbx, %rdi
movq %r12, %rsi
callq 0x63a0
movq 0x10930(%rip), %rax     # 0x1f848
movl $0x1, %r14d
testq %rax, %rax
je 0xef3f
movl %r14d, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x6ebf
jmp 0xecd9
callq 0x6ee1
jmp 0xef23