// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0xa8, %rsp
movq %rdi, -0x28(%rbp)
movq 0x7685(%rip), %rax      # 0x18d80
movq %rax, -0x48(%rbp)
movq 0x7682(%rip), %rax      # 0x18d88
movq %rax, -0x40(%rbp)
movq 0x767f(%rip), %rax      # 0x18d90
movq %rax, -0x58(%rbp)
movq 0x767c(%rip), %rax      # 0x18d98
movq %rax, -0x50(%rbp)
movq 0x10e69(%rip), %rdi     # 0x22590
xorl %eax, %eax
movl %eax, %ecx
movq %rcx, %rsi
movq %rcx, %rdx
callq 0x67c0
movq %rax, 0x10ea3(%rip)     # 0x225e0
cmpq $0x0, %rax
jne 0x1174f
movl $0x0, -0x1c(%rbp)
jmp 0x118e3
movq 0x10e8a(%rip), %rdi     # 0x225e0
leaq 0x3cdb(%rip), %rsi      # 0x15438
leaq -0x48(%rbp), %rdx
xorl %eax, %eax
movl %eax, %ecx
movb $0x0, %al
callq 0x6710
cmpq $0x0, %rax
je 0x1178a
movq 0x7877(%rip), %rax      # 0x18ff0
movq (%rax), %rdi
leaq 0x3cc5(%rip), %rsi      # 0x15448
movb $0x0, %al
callq 0x69d0
xorl %edi, %edi
leaq 0x39a5(%rip), %rsi      # 0x15138
leaq 0x10df6(%rip), %rdx     # 0x22590
addq $0x50, %rdx
addq $0x10, %rdx
xorl %eax, %eax
movl %eax, %ecx
movb $0x0, %al
callq 0x67e0
movq %rax, 0x10e44(%rip)     # 0x225f8
movq 0x10e25(%rip), %rdi     # 0x225e0
callq 0x12020
movq %rax, -0x38(%rbp)
movq -0x28(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x120f0
movq %rax, -0x30(%rbp)
movq 0x10e04(%rip), %rax     # 0x225e0
movq %rax, -0x80(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x78(%rbp)
movq 0x10db1(%rip), %rax     # 0x225a0
movq %rax, -0x70(%rbp)
movq 0x10da6(%rip), %rax     # 0x225a0
movq %rax, -0x68(%rbp)
movq -0x30(%rbp), %rdx
xorl %eax, %eax
leaq 0x393a(%rip), %rcx      # 0x15145
cmpq $0x0, %rdx
cmovneq %rcx, %rax
movq %rax, -0x60(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x1182e
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x88(%rbp)
jmp 0x11839
xorl %eax, %eax
movq %rax, -0x88(%rbp)
jmp 0x11839
movq -0x60(%rbp), %r10
movq -0x68(%rbp), %r14
movq -0x70(%rbp), %r8
movq -0x78(%rbp), %rdx
movq -0x80(%rbp), %rdi
movq -0x88(%rbp), %rax
leaq 0x3c1d(%rip), %rsi      # 0x15478
leaq 0x3c21(%rip), %rcx      # 0x15483
leaq 0x3c27(%rip), %r9       # 0x15490
leaq 0x3bc8(%rip), %rbx      # 0x15438
leaq -0x58(%rbp), %r11
xorl %r15d, %r15d
movq %r14, (%rsp)
movq %rbx, 0x8(%rsp)
movq %r11, 0x10(%rsp)
movq %r10, 0x18(%rsp)
movq %rax, 0x20(%rsp)
movq $0x0, 0x28(%rsp)
movb $0x0, %al
callq 0x6030
movq %rax, 0x10d42(%rip)     # 0x225e8
cmpq $0x0, -0x30(%rbp)
je 0x118ba
movq -0x28(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x12250
cmpq $0x0, 0x10d26(%rip)     # 0x225e8
jne 0x118dc
movq 0x7725(%rip), %rax      # 0x18ff0
movq (%rax), %rdi
leaq 0x3bc7(%rip), %rsi      # 0x1549c
movb $0x0, %al
callq 0x69d0
movl $0x1, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
addq $0xa8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nopw %cs:(%rax,%rax)