// File: codebrainz[P]libutfxx/utf/string-demo.cxx
// Function: main
int main()
{
	utf::u8string s = "Hello World";

	s += ", How are you?";
	s += " Not too shabby";
	s += ", if I must say!";

	std::cout << s << std::endl;

	utf::u32string s1 = "Hello World";
	utf::u16string s2 = "Hello World";
	utf::u8string s3 = "Hi";

	std::cout <<s3<<std::endl;

	bool eq = (s1 == s2);
	bool neq = (s1 != s2);

	std::cout << "EQ: " << eq << std::endl;
	std::cout << "NEQ: " << neq << std::endl;

	//std::cout << "to_string(): " << std::to_string(s2) << std::endl;

	s2 += "Foo";

	std::cout << s1 << std::endl;
	std::cout << s2 << std::endl;

	//for (auto ch : s) {
	//	std::cout << ch << ", ";
	//}
	//std::cout << std::endl;

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x140, %rsp            # imm = 0x140
movl $0x0, -0x4(%rbp)
leaq 0x2bfb(%rip), %rsi      # 0x6004
leaq -0x28(%rbp), %rdi
movq %rdi, -0xf0(%rbp)
callq 0x3880
movq -0xf0(%rbp), %rdi
leaq 0x2be9(%rip), %rsi      # 0x6010
callq 0x3940
jmp 0x342e
leaq 0x2bea(%rip), %rsi      # 0x601f
leaq -0x28(%rbp), %rdi
callq 0x3940
jmp 0x3440
leaq 0x2be8(%rip), %rsi      # 0x602f
leaq -0x28(%rbp), %rdi
callq 0x3940
jmp 0x3452
movq 0x5b7f(%rip), %rdi      # 0x8fd8
leaq -0x28(%rbp), %rsi
callq 0x3970
movq %rax, -0xf8(%rbp)
jmp 0x346b
movq -0xf8(%rbp), %rdi
movq 0x5b4f(%rip), %rsi      # 0x8fc8
callq 0x3160
jmp 0x3480
leaq 0x2b7d(%rip), %rsi      # 0x6004
leaq -0x58(%rbp), %rdi
callq 0x3a00
jmp 0x3492
leaq 0x2b6b(%rip), %rsi      # 0x6004
leaq -0x78(%rbp), %rdi
callq 0x3ac0
jmp 0x34a4
leaq 0x2b95(%rip), %rsi      # 0x6040
leaq -0x98(%rbp), %rdi
callq 0x3880
jmp 0x34b9
movq 0x5b18(%rip), %rdi      # 0x8fd8
leaq -0x98(%rbp), %rsi
callq 0x3970
movq %rax, -0x100(%rbp)
jmp 0x34d5
movq -0x100(%rbp), %rdi
movq 0x5ae5(%rip), %rsi      # 0x8fc8
callq 0x3160
jmp 0x34ea
leaq -0xc0(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x3bf0
jmp 0x34fc
leaq -0x58(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x3b80
movb %al, -0x101(%rbp)
jmp 0x3514
leaq -0xc0(%rbp), %rdi
callq 0x3c20
movb -0x101(%rbp), %al
andb $0x1, %al
movb %al, -0x99(%rbp)
leaq -0xe8(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x3bf0
jmp 0x3540
leaq -0x58(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
callq 0x3c40
movb %al, -0x102(%rbp)
jmp 0x3558
leaq -0xe8(%rbp), %rdi
callq 0x3c20
movb -0x102(%rbp), %al
andb $0x1, %al
movb %al, -0xc1(%rbp)
movq 0x5a5f(%rip), %rdi      # 0x8fd8
leaq 0x2ac4(%rip), %rsi      # 0x6044
callq 0x3120
movq %rax, -0x110(%rbp)
jmp 0x358e
movq -0x110(%rbp), %rdi
movzbl -0x99(%rbp), %esi
andl $0x1, %esi
callq 0x3270
movq %rax, -0x118(%rbp)
jmp 0x35ad
movq -0x118(%rbp), %rdi
movq 0x5a0d(%rip), %rsi      # 0x8fc8
callq 0x3160
jmp 0x35c2
movq 0x5a0f(%rip), %rdi      # 0x8fd8
leaq 0x2a73(%rip), %rsi      # 0x6043
callq 0x3120
movq %rax, -0x120(%rbp)
jmp 0x35de
movq -0x120(%rbp), %rdi
movzbl -0xc1(%rbp), %esi
andl $0x1, %esi
callq 0x3270
movq %rax, -0x128(%rbp)
jmp 0x35fd
movq -0x128(%rbp), %rdi
movq 0x59bd(%rip), %rsi      # 0x8fc8
callq 0x3160
jmp 0x3612
leaq 0x2a30(%rip), %rsi      # 0x6049
leaq -0x78(%rbp), %rdi
callq 0x3cc0
jmp 0x3624
movq 0x59ad(%rip), %rdi      # 0x8fd8
leaq -0x58(%rbp), %rsi
callq 0x3cf0
movq %rax, -0x130(%rbp)
jmp 0x363d
movq -0x130(%rbp), %rdi
movq 0x597d(%rip), %rsi      # 0x8fc8
callq 0x3160
jmp 0x3652
movq 0x597f(%rip), %rdi      # 0x8fd8
leaq -0x78(%rbp), %rsi
callq 0x3d80
movq %rax, -0x138(%rbp)
jmp 0x366b
movq -0x138(%rbp), %rdi
movq 0x594f(%rip), %rsi      # 0x8fc8
callq 0x3160
jmp 0x3680
movl $0x0, -0x4(%rbp)
leaq -0x98(%rbp), %rdi
callq 0x3e10
leaq -0x78(%rbp), %rdi
callq 0x3c20
leaq -0x58(%rbp), %rdi
callq 0x3e30
leaq -0x28(%rbp), %rdi
callq 0x3e10
movl -0x4(%rbp), %eax
addq $0x140, %rsp            # imm = 0x140
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x3742
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x3739
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x3730
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x3724
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0x3c20
jmp 0x3724
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0xe8(%rbp), %rdi
callq 0x3c20
leaq -0x98(%rbp), %rdi
callq 0x3e10
leaq -0x78(%rbp), %rdi
callq 0x3c20
leaq -0x58(%rbp), %rdi
callq 0x3e30
leaq -0x28(%rbp), %rdi
callq 0x3e10
movq -0x30(%rbp), %rdi
callq 0x3250
nopw %cs:(%rax,%rax)