// File: /workspace/github_c_makefile_star2_O1/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 0x6c3c(%rip), %xmm0     # 0x15240
movaps %xmm0, 0x20(%rsp)
movups 0x6c40(%rip), %xmm0     # 0x15250
movaps %xmm0, 0x10(%rsp)
movq 0x101e4(%rip), %rdi     # 0x1e800
xorl %r14d, %r14d
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x67c0
movq %rax, 0x1021f(%rip)     # 0x1e850
testq %rax, %rax
je 0xe8be
leaq 0x2b6f(%rip), %r14      # 0x111b0
leaq 0x20(%rsp), %rdx
movq %rax, %rdi
movq %r14, %rsi
xorl %ecx, %ecx
xorl %eax, %eax
callq 0x6710
testq %rax, %rax
jne 0xe8d0
leaq 0x284b(%rip), %rsi      # 0x10eb0
leaq 0x101f4(%rip), %rdx     # 0x1e860
xorl %r12d, %r12d
xorl %edi, %edi
xorl %ecx, %ecx
xorl %eax, %eax
callq 0x67e0
movq %rax, 0x101e7(%rip)     # 0x1e868
movq 0x101c8(%rip), %rdi     # 0x1e850
leaq 0x2bb1(%rip), %rsi      # 0x11240
leaq 0x40(%rsp), %r15
movq %r15, %rdx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0x61d0
movq (%r15), %rdi
movzwl (%rdi), %ecx
leaq 0x2623(%rip), %rax      # 0x10cd0
testq %rcx, %rcx
je 0xe6cb
movq (%rax,%r12,8), %rdx
movq 0x8(%rdi), %rsi
xorl %r8d, %r8d
cmpq (%rsi,%r8,8), %rdx
je 0xe6de
incq %r8
cmpq %r8, %rcx
jne 0xe6bd
leaq 0x1(%r12), %rdx
testq %r12, %r12
movq %rdx, %r12
je 0xe6ad
movl $0x2, %r12d
movl $0x408, %r15d           # imm = 0x408
cmpl %ecx, %r12d
jae 0xe6f0
movl %r12d, %ecx
movq (%rax,%rcx,8), %r15
callq 0x6090
movl $0x0, 0x8(%rsp)
testb $0x4, %r15b
jne 0xe70b
xorl %r12d, %r12d
jmp 0xe7e5
movl $0x1, %edi
movl $0x10, %esi
callq 0x6850
movq %rax, %r12
movl 0xffb5(%rip), %edx      # 0x1e6d8
decl %edx
leaq 0x2b24(%rip), %rsi      # 0x11250
leaq 0x40(%rsp), %r13
movq %r13, %rdi
xorl %eax, %eax
callq 0x64c0
leaq 0x38(%rsp), %rbp
leaq 0xc(%rsp), %rcx
leaq 0x30(%rsp), %r8
movq %rbx, %rdi
movq %r13, %rsi
movq %rbp, %rdx
callq 0x64a0
movq %rax, %r13
movq %rax, 0x8(%r12)
movq (%rbp), %rdi
testq %rdi, %rdi
je 0xe76e
callq 0x6820
testq %r13, %r13
jne 0xe781
leaq 0x2af4(%rip), %rdi      # 0x1126e
xorl %eax, %eax
callq 0x70c6
movq 0xff40(%rip), %r10      # 0x1e6c8
movl 0x8e2d(%rip), %r11d     # 0x175bc
shlq $0x4, %r11
movl 0x8e27(%rip), %ebp      # 0x175c0
shlq $0x4, %rbp
leaq 0x20b3(%rip), %r14      # 0x10857
leaq 0x2ada(%rip), %rsi      # 0x11285
leaq 0x26fe(%rip), %rcx      # 0x10eb0
leaq 0x2093(%rip), %r9       # 0x1084c
leaq 0x8(%rsp), %r8
xorl %edi, %edi
movq %r13, %rdx
xorl %eax, %eax
pushq $0x0
pushq (%r10,%rbp)
pushq %r14
pushq (%r10,%r11)
callq 0x67e0
addq $0x20, %rsp
movq %rax, (%r12)
leaq 0x29cb(%rip), %r14      # 0x111b0
movq 0x10064(%rip), %rdi     # 0x1e850
movq 0x1001d(%rip), %r8      # 0x1e810
leaq 0x26c3(%rip), %r10      # 0x10ebd
testq %r12, %r12
cmoveq %r12, %r10
je 0xe860
leaq 0x10(%rsp), %r11
leaq 0x29e1(%rip), %rsi      # 0x111f0
leaq 0x29e5(%rip), %rcx      # 0x111fb
leaq 0x29eb(%rip), %r9       # 0x11208
movq %r15, %rdx
xorl %eax, %eax
pushq $0x0
pushq (%r12)
pushq %r10
pushq %r11
pushq %r14
pushq %r8
callq 0x6030
addq $0x30, %rsp
movq %rax, 0x10018(%rip)     # 0x1e858
movq (%r12), %rdi
callq 0x6090
movq 0x8(%r12), %rsi
movq %rbx, %rdi
callq 0x63a0
movq %r12, %rdi
callq 0x63d0
jmp 0xe8ae
subq $0x30, %rsp
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rsp)
movq %r10, 0x18(%rsp)
leaq 0x40(%rsp), %rax
movq %rax, 0x10(%rsp)
movq %r14, 0x8(%rsp)
movq %r8, (%rsp)
leaq 0x2965(%rip), %rsi      # 0x111f0
leaq 0x2969(%rip), %rcx      # 0x111fb
leaq 0x296f(%rip), %r9       # 0x11208
movq %r15, %rdx
xorl %eax, %eax
callq 0x6030
addq $0x30, %rsp
movq %rax, 0xffaa(%rip)      # 0x1e858
movl $0x1, %r14d
cmpq $0x0, 0xff9c(%rip)      # 0x1e858
je 0xe8da
movl %r14d, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x6edf
jmp 0xe65e
callq 0x6f01
jmp 0xe8be