#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef char wchar_t;

/* Variables and functions */
int /*<<< orphan*/ LC_CTYPE;
int fwprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ setlocale(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ wprintf(char *, ...);
int main(void) {
  setlocale(LC_CTYPE, "en_US.utf8");
  wchar_t *unicode = L"\u0060abc"
                     L"abcXYZ"
                     L"\u03B1\u03B2\u03B3"
                     L"\u2200\u2205\u2605";
  int n = fwprintf(stdout, L"%ls", unicode);
  wprintf(L"\n%d characters printed\n\n", n);
  wprintf(L"print lambda via universal character name: \u03bb\n");
  wprintf(L"print lambda via unicode in source code: λ\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
lea    0xeb1(%rip),%rsi
call   1040 <setlocale@plt>
lea    0xeb1(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0x2e72(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xedd(%rip),%rsi
call   1050 <fwprintf@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xedb(%rip),%rdi
mov    $0x0,%al
call   1030 <wprintf@plt>
lea    0xf31(%rip),%rdi
mov    $0x0,%al
call   1030 <wprintf@plt>
lea    0xfdb(%rip),%rdi
mov    $0x0,%al
call   1030 <wprintf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xebf(%rip),%rsi
call   1040 <setlocale@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
lea    0xefa(%rip),%rsi
lea    0xeaf(%rip),%rdx
call   1050 <fwprintf@plt>
lea    0xef7(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <wprintf@plt>
lea    0xf4b(%rip),%rdi
xor    %eax,%eax
call   1030 <wprintf@plt>
lea    0xff5(%rip),%rdi
xor    %eax,%eax
call   1030 <wprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@LC_CTYPE = global i32 0
@.str = [11 x i8] c"en_US.utf8\00"
@.str.1 = [17 x i32] [i32 96, i32 97, i32 98, i32 99, i32 97, i32 98, i32 99, i32 88, i32 89, i32 90, i32 945, i32 946, i32 947, i32 8704, i32 8709, i32 9733, i32 0]
@stdout = global i32 0
@.str.2 = [4 x i32] [i32 37, i32 108, i32 115, i32 0]
@.str.3 = [25 x i32] [i32 10, i32 37, i32 100, i32 32, i32 99, i32 104, i32 97, i32 114, i32 97, i32 99, i32 116, i32 101, i32 114, i32 115, i32 32, i32 112, i32 114, i32 105, i32 110, i32 116, i32 101, i32 100, i32 10, i32 10, i32 0]
@.str.4 = [46 x i32] [i32 112, i32 114, i32 105, i32 110, i32 116, i32 32, i32 108, i32 97, i32 109, i32 98, i32 100, i32 97, i32 32, i32 118, i32 105, i32 97, i32 32, i32 117, i32 110, i32 105, i32 118, i32 101, i32 114, i32 115, i32 97, i32 108, i32 32, i32 99, i32 104, i32 97, i32 114, i32 97, i32 99, i32 116, i32 101, i32 114, i32 32, i32 110, i32 97, i32 109, i32 101, i32 58, i32 32, i32 955, i32 10, i32 0]
@.str.5 = [44 x i32] [i32 112, i32 114, i32 105, i32 110, i32 116, i32 32, i32 108, i32 97, i32 109, i32 98, i32 100, i32 97, i32 32, i32 118, i32 105, i32 97, i32 32, i32 117, i32 110, i32 105, i32 99, i32 111, i32 100, i32 101, i32 32, i32 105, i32 110, i32 32, i32 115, i32 111, i32 117, i32 114, i32 99, i32 101, i32 32, i32 99, i32 111, i32 100, i32 101, i32 58, i32 32, i32 955, i32 10, i32 0]
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i32
store i32 0, i32* %1
%4 = load i32, i32* @LC_CTYPE
%5 = call i32 @setlocale(i32 %4, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
store i8* bitcast ([17 x i32]* @.str.1 to i8*), i8** %2
%6 = load i32, i32* @stdout
%7 = load i8*, i8** %2
%8 = call i32 @fwprintf(i32 %6, i8* bitcast ([4 x i32]* @.str.2 to i8*), i8* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = call i32 (i8*, ...) @wprintf(i8* bitcast ([25 x i32]* @.str.3 to i8*), i32 %9)
%11 = call i32 (i8*, ...) @wprintf(i8* bitcast ([46 x i32]* @.str.4 to i8*))
%12 = call i32 (i8*, ...) @wprintf(i8* bitcast ([44 x i32]* @.str.5 to i8*))
ret i32 0
}

LLVM IR (-O2):
@LC_CTYPE = global i32 0
@.str = [11 x i8] c"en_US.utf8\00"
@.str.1 = [17 x i32] [i32 96, i32 97, i32 98, i32 99, i32 97, i32 98, i32 99, i32 88, i32 89, i32 90, i32 945, i32 946, i32 947, i32 8704, i32 8709, i32 9733, i32 0]
@stdout = global i32 0
@.str.2 = [4 x i32] [i32 37, i32 108, i32 115, i32 0]
@.str.3 = [25 x i32] [i32 10, i32 37, i32 100, i32 32, i32 99, i32 104, i32 97, i32 114, i32 97, i32 99, i32 116, i32 101, i32 114, i32 115, i32 32, i32 112, i32 114, i32 105, i32 110, i32 116, i32 101, i32 100, i32 10, i32 10, i32 0]
@.str.4 = [46 x i32] [i32 112, i32 114, i32 105, i32 110, i32 116, i32 32, i32 108, i32 97, i32 109, i32 98, i32 100, i32 97, i32 32, i32 118, i32 105, i32 97, i32 32, i32 117, i32 110, i32 105, i32 118, i32 101, i32 114, i32 115, i32 97, i32 108, i32 32, i32 99, i32 104, i32 97, i32 114, i32 97, i32 99, i32 116, i32 101, i32 114, i32 32, i32 110, i32 97, i32 109, i32 101, i32 58, i32 32, i32 955, i32 10, i32 0]
@.str.5 = [44 x i32] [i32 112, i32 114, i32 105, i32 110, i32 116, i32 32, i32 108, i32 97, i32 109, i32 98, i32 100, i32 97, i32 32, i32 118, i32 105, i32 97, i32 32, i32 117, i32 110, i32 105, i32 99, i32 111, i32 100, i32 101, i32 32, i32 105, i32 110, i32 32, i32 115, i32 111, i32 117, i32 114, i32 99, i32 101, i32 32, i32 99, i32 111, i32 100, i32 101, i32 58, i32 32, i32 955, i32 10, i32 0]
define i32 @main() {
%1 = load i32, i32* @LC_CTYPE
%2 = tail call i32 @setlocale(i32 %1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = tail call i32 @fwprintf(i32 %3, i8* bitcast ([4 x i32]* @.str.2 to i8*), i8* bitcast ([17 x i32]* @.str.1 to i8*))
%5 = tail call i32 (i8*, ...) @wprintf(i8* bitcast ([25 x i32]* @.str.3 to i8*), i32 %4)
%6 = tail call i32 (i8*, ...) @wprintf(i8* bitcast ([46 x i32]* @.str.4 to i8*))
%7 = tail call i32 (i8*, ...) @wprintf(i8* bitcast ([44 x i32]* @.str.5 to i8*))
ret i32 0
}