// File: /workspace/github_c_makefile_star2_O2/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 0x76fd(%rip), %xmm0     # 0x15240
movaps %xmm0, 0x20(%rsp)
movups 0x7701(%rip), %xmm0     # 0x15250
movaps %xmm0, 0x10(%rsp)
movq 0x10ca5(%rip), %rdi     # 0x1e800
xorl %r14d, %r14d
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x67b0
movq %rax, 0x10ce0(%rip)     # 0x1e850
testq %rax, %rax
je 0xde03
leaq 0x3620(%rip), %r14      # 0x111a0
leaq 0x20(%rsp), %rdx
movq %rax, %rdi
movq %r14, %rsi
xorl %ecx, %ecx
xorl %eax, %eax
callq 0x6710
testq %rax, %rax
jne 0xde15
leaq 0x32fc(%rip), %rsi      # 0x10ea0
leaq 0x10cb5(%rip), %rdx     # 0x1e860
xorl %r12d, %r12d
xorl %edi, %edi
xorl %ecx, %ecx
xorl %eax, %eax
callq 0x67d0
movq %rax, 0x10ca8(%rip)     # 0x1e868
movq 0x10c89(%rip), %rdi     # 0x1e850
leaq 0x3662(%rip), %rsi      # 0x11230
leaq 0x40(%rsp), %r15
movq %r15, %rdx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0x61d0
movq (%r15), %rdi
movzwl (%rdi), %ecx
pushq $0x2
popq %rdx
leaq 0x30d1(%rip), %rax      # 0x10cc0
cmpq $0x2, %r12
je 0xdc1b
xorl %esi, %esi
cmpq %rsi, %rcx
je 0xdc13
movq (%rax,%r12,8), %r8
movq 0x8(%rdi), %r9
leaq 0x1(%rsi), %r10
cmpq (%r9,%rsi,8), %r8
movq %r10, %rsi
jne 0xdbf7
jmp 0xdc18
incq %r12
jmp 0xdbef
movl %r12d, %edx
movl $0x408, %r15d           # imm = 0x408
cmpl %ecx, %edx
jae 0xdc2b
movl %edx, %ecx
movq (%rax,%rcx,8), %r15
callq 0x6090
andl $0x0, 0x8(%rsp)
testb $0x4, %r15b
jne 0xdc9d
movq 0x10c0e(%rip), %rdi     # 0x1e850
movq 0x10bc7(%rip), %r8      # 0x1e810
subq $0x30, %rsp
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rsp)
leaq 0x40(%rsp), %rax
movq %rax, 0x10(%rsp)
andq $0x0, 0x28(%rsp)
movq %r14, 0x8(%rsp)
movq %r8, (%rsp)
leaq 0x356b(%rip), %rsi      # 0x111e0
leaq 0x356f(%rip), %rcx      # 0x111eb
leaq 0x3575(%rip), %r9       # 0x111f8
movq %r15, %rdx
xorl %eax, %eax
callq 0x6030
addq $0x30, %rsp
movq %rax, 0x10bc0(%rip)     # 0x1e858
jmp 0xddfa
pushq $0x1
popq %rdi
pushq $0x10
popq %rsi
callq 0x6840
movq %rax, %r12
movl 0x10a27(%rip), %edx     # 0x1e6d8
decl %edx
leaq 0x3586(%rip), %rsi      # 0x11240
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 0xdcfc
callq 0x6810
testq %r13, %r13
jne 0xdd0f
leaq 0x3556(%rip), %rdi      # 0x1125e
xorl %eax, %eax
callq 0x6bf6
movq 0x109b2(%rip), %rax     # 0x1e6c8
movl 0x98a0(%rip), %ecx      # 0x175bc
shlq $0x4, %rcx
movq (%rax,%rcx), %rcx
movl 0x9896(%rip), %edx      # 0x175c0
shlq $0x4, %rdx
movq (%rax,%rdx), %rax
subq $0x20, %rsp
movq %rax, 0x10(%rsp)
leaq 0x2b13(%rip), %rax      # 0x10855
movq %rax, 0x8(%rsp)
andq $0x0, 0x18(%rsp)
movq %rcx, (%rsp)
leaq 0x351d(%rip), %rsi      # 0x11275
leaq 0x3141(%rip), %rcx      # 0x10ea0
leaq 0x2ae4(%rip), %r9       # 0x1084a
leaq 0x28(%rsp), %r8
xorl %edi, %edi
movq %r13, %rdx
xorl %eax, %eax
callq 0x67d0
addq $0x20, %rsp
movq %rax, (%r12)
movq 0x10aca(%rip), %rdi     # 0x1e850
movq 0x10a83(%rip), %r8      # 0x1e810
movq (%r12), %r13
leaq 0x3115(%rip), %r10      # 0x10ead
leaq 0x10(%rsp), %r11
leaq 0x343c(%rip), %rsi      # 0x111e0
leaq 0x3440(%rip), %rcx      # 0x111eb
leaq 0x3446(%rip), %r9       # 0x111f8
movq %r15, %rdx
movl $0x0, %eax
pushq $0x0
pushq %r13
pushq %r10
pushq %r11
pushq %r14
pushq %r8
callq 0x6030
addq $0x30, %rsp
movq %rax, 0x10a82(%rip)     # 0x1e858
movq %r13, %rdi
callq 0x6090
movq 0x8(%r12), %rsi
movq %rbx, %rdi
callq 0x63a0
movq %r12, %rdi
callq 0x63d0
movq 0x10a5e(%rip), %rax     # 0x1e858
pushq $0x1
popq %r14
testq %rax, %rax
je 0xde36
movl %r14d, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x91d4(%rip), %rax      # 0x16ff0
movq (%rax), %rcx
leaq 0x338a(%rip), %rdi      # 0x111b0
pushq $0x2f
popq %rsi
pushq $0x1
popq %rdx
callq 0x6950
jmp 0xdb9d
movq 0x91b3(%rip), %rax      # 0x16ff0
movq (%rax), %rcx
leaq 0x33bd(%rip), %rdi      # 0x11204
pushq $0x2b
popq %rsi
pushq $0x1
popq %rdx
callq 0x6950
jmp 0xde03