// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/classes/gui/window/backends/xlib/windowxlib.cpp
// Function: smooth::GUI::WindowXLib::SetTitle(smooth::String const&)
S::Int S::GUI::WindowXLib::SetTitle(const String &nTitle)
{
	if (wnd == None) return Error();

	static Atom	 wmNameAtom	= XInternAtom(display, "_NET_WM_NAME", False);
	static Atom	 wmIconNameAtom = XInternAtom(display, "_NET_WM_ICON_NAME", False);

	XTextProperty	 titleProp;
	XTextProperty	 titlePropUTF8;

	const char	*title	   = nTitle.ConvertTo("ISO-8859-1");
	const char	*titleUTF8 = nTitle.ConvertTo("UTF-8");

	/* Set ISO encoded window name.
	 */
	if (XStringListToTextProperty((char **) &title, 1, &titleProp) != 0)
	{
		XSetWMName(display, wnd, &titleProp);
		XSetWMIconName(display, wnd, &titleProp);

		XFree(titleProp.value);
	}

	/* Set UTF-8 encoded window name.
	 */
	if (Xutf8TextListToTextProperty(display, (char **) &titleUTF8, 1, XUTF8StringStyle, &titlePropUTF8) == 0)
	{
		XSetTextProperty(display, wnd, &titlePropUTF8, wmNameAtom);
		XSetTextProperty(display, wnd, &titlePropUTF8, wmIconNameAtom);

		XFree(titlePropUTF8.value);
	}

	return Success();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0xa0(%rbp)
cmpq $0x0, 0x138(%rax)
jne 0x126172
leaq -0x28(%rbp), %rdi
movq %rdi, -0xb0(%rbp)
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x5a9c0
movq -0xb0(%rbp), %rdi
callq 0x59680
movl %eax, -0xa4(%rbp)
jmp 0x126141
movl -0xa4(%rbp), %eax
movl %eax, -0x4(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x5b5b0
jmp 0x1263c3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x5b5b0
jmp 0x1263cf
cmpb $0x0, 0xee92f(%rip)     # 0x214aa8
jne 0x1261cb
leaq 0xee926(%rip), %rdi     # 0x214aa8
callq 0x5a4e0
cmpl $0x0, %eax
je 0x1261cb
movq -0xa0(%rbp), %rax
movq 0x120(%rax), %rdi
leaq 0x8099f(%rip), %rsi     # 0x1a6b40
xorl %edx, %edx
callq 0x5c7a0
movq %rax, -0xb8(%rbp)
jmp 0x1261b1
movq -0xb8(%rbp), %rax
movq %rax, 0xee8e1(%rip)     # 0x214aa0
leaq 0xee8e2(%rip), %rdi     # 0x214aa8
callq 0x5b0c0
cmpb $0x0, 0xee8e6(%rip)     # 0x214ab8
jne 0x126224
leaq 0xee8dd(%rip), %rdi     # 0x214ab8
callq 0x5a4e0
cmpl $0x0, %eax
je 0x126224
movq -0xa0(%rbp), %rax
movq 0x120(%rax), %rdi
leaq 0x80953(%rip), %rsi     # 0x1a6b4d
xorl %edx, %edx
callq 0x5c7a0
movq %rax, -0xc0(%rbp)
jmp 0x12620a
movq -0xc0(%rbp), %rax
movq %rax, 0xee898(%rip)     # 0x214ab0
leaq 0xee899(%rip), %rdi     # 0x214ab8
callq 0x5b0c0
movq -0x18(%rbp), %rdi
leaq 0x7f86b(%rip), %rsi     # 0x1a5a9a
callq 0x5c120
movq %rax, -0x80(%rbp)
movq -0x18(%rbp), %rdi
leaq 0x7f9a3(%rip), %rsi     # 0x1a5be6
callq 0x5c120
movq %rax, -0x88(%rbp)
leaq -0x80(%rbp), %rdi
movl $0x1, %esi
leaq -0x58(%rbp), %rdx
callq 0x5b3f0
cmpl $0x0, %eax
je 0x1262eb
movq -0xa0(%rbp), %rax
movq 0x120(%rax), %rdi
movq 0x138(%rax), %rsi
leaq -0x58(%rbp), %rdx
callq 0x59920
movq -0xa0(%rbp), %rax
movq 0x120(%rax), %rdi
movq 0x138(%rax), %rsi
leaq -0x58(%rbp), %rdx
callq 0x5b1f0
movq -0x58(%rbp), %rdi
callq 0x5c780
jmp 0x1262eb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq 0xee7e4(%rip), %rdi     # 0x214aa8
callq 0x5a860
jmp 0x1263cf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq 0xee7d7(%rip), %rdi     # 0x214ab8
callq 0x5a860
jmp 0x1263cf
movq -0xa0(%rbp), %rax
movq 0x120(%rax), %rdi
leaq -0x88(%rbp), %rsi
movl $0x1, %edx
movl $0x4, %ecx
leaq -0x78(%rbp), %r8
callq 0x5c4b0
cmpl $0x0, %eax
jne 0x12636b
movq -0xa0(%rbp), %rax
movq 0x120(%rax), %rdi
movq 0x138(%rax), %rsi
movq 0xee76c(%rip), %rcx     # 0x214aa0
leaq -0x78(%rbp), %rdx
callq 0x59550
movq -0xa0(%rbp), %rax
movq 0x120(%rax), %rdi
movq 0x138(%rax), %rsi
movq 0xee757(%rip), %rcx     # 0x214ab0
leaq -0x78(%rbp), %rdx
callq 0x59550
movq -0x78(%rbp), %rdi
callq 0x5c780
leaq -0x98(%rbp), %rdi
movq %rdi, -0xd0(%rbp)
callq 0x5ca80
movq -0xd0(%rbp), %rdi
callq 0x59680
movl %eax, -0xc4(%rbp)
jmp 0x126392
movl -0xc4(%rbp), %eax
movl %eax, -0x4(%rbp)
leaq -0x98(%rbp), %rdi
callq 0x5a410
jmp 0x1263c3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x98(%rbp), %rdi
callq 0x5a410
jmp 0x1263cf
movl -0x4(%rbp), %eax
addq $0xd0, %rsp
popq %rbp
retq
movq -0x30(%rbp), %rdi
callq 0x5b6b0
nopl (%rax,%rax)