#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 */

/* Variables and functions */
int /*<<< orphan*/ LC_ALL;
int /*<<< orphan*/ setlocale(int /*<<< orphan*/, char *);
int /*<<< orphan*/ wprintf(char *, ...);
int main() {
  setlocale(LC_ALL, "zh_CN.UTF-8");
  wprintf(L"Characters: %lc %lc \n", L'a', 65);
  wprintf(L"Decimals: %d %ld\n", 1977, 650000L);
  wprintf(L"Preceding with blanks: %10d \n", 1977);
  wprintf(L"Preceding with zeros: %010d \n", 1977);
  wprintf(L"Some different radixes: %d %x %o %#x %#o \n", 100, 100, 100, 100,
          100);
  wprintf(L"floats: %4.2f %+.0e %E \n", 3.1416, 3.1416, 3.1416);
  wprintf(L"Width trick: %*d \n", 5, 10);
  wprintf(L"%ls \n", L"A wide string");
  wprintf(L"%ls \n", L"测试");
  wprintf(L"%lc \n", L'中');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
lea    0xec9(%rip),%rsi
call   1040 <setlocale@plt>
lea    0xec9(%rip),%rdi
mov    $0x61,%esi
mov    $0x41,%edx
mov    $0x0,%al
call   1030 <wprintf@plt>
lea    0xf09(%rip),%rdi
mov    $0x7b9,%esi
mov    $0x9eb10,%edx
mov    $0x0,%al
call   1030 <wprintf@plt>
lea    0xf39(%rip),%rdi
mov    $0x7b9,%esi
mov    $0x0,%al
call   1030 <wprintf@plt>
lea    0xf9e(%rip),%rdi
mov    $0x7b9,%esi
mov    $0x0,%al
call   1030 <wprintf@plt>
lea    0x1003(%rip),%rdi
mov    $0x64,%r9d
mov    %r9d,%esi
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
mov    $0x0,%al
call   1030 <wprintf@plt>
lea    0x108f(%rip),%rdi
movsd  0xe37(%rip),%xmm2
movaps %xmm2,%xmm0
movaps %xmm2,%xmm1
mov    $0x3,%al
call   1030 <wprintf@plt>
lea    0x10d7(%rip),%rdi
mov    $0x5,%esi
mov    $0xa,%edx
mov    $0x0,%al
call   1030 <wprintf@plt>
lea    0x110b(%rip),%rdi
lea    0x111c(%rip),%rsi
mov    $0x0,%al
call   1030 <wprintf@plt>
lea    0x10f6(%rip),%rdi
lea    0x113f(%rip),%rsi
mov    $0x0,%al
call   1030 <wprintf@plt>
lea    0xe35(%rip),%rdi
mov    $0x4e2d,%esi
mov    $0x0,%al
call   1030 <wprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xed7(%rip),%rsi
call   1040 <setlocale@plt>
lea    0xed7(%rip),%rdi
mov    $0x61,%esi
mov    $0x41,%edx
xor    %eax,%eax
call   1030 <wprintf@plt>
lea    0xf17(%rip),%rdi
mov    $0x9eb10,%edx
mov    $0x7b9,%esi
xor    %eax,%eax
call   1030 <wprintf@plt>
lea    0xf47(%rip),%rdi
mov    $0x7b9,%esi
xor    %eax,%eax
call   1030 <wprintf@plt>
lea    0xfac(%rip),%rdi
mov    $0x7b9,%esi
xor    %eax,%eax
call   1030 <wprintf@plt>
lea    0x1011(%rip),%rdi
mov    $0x64,%esi
mov    $0x64,%edx
mov    $0x64,%ecx
mov    $0x64,%r8d
mov    $0x64,%r9d
xor    %eax,%eax
call   1030 <wprintf@plt>
lea    0x1094(%rip),%rdi
movsd  0xe3c(%rip),%xmm0
movaps %xmm0,%xmm1
movaps %xmm0,%xmm2
mov    $0x3,%al
call   1030 <wprintf@plt>
lea    0x10dc(%rip),%rdi
mov    $0x5,%esi
mov    $0xa,%edx
xor    %eax,%eax
call   1030 <wprintf@plt>
lea    0x1110(%rip),%rbx
lea    0x1121(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <wprintf@plt>
lea    0x1148(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <wprintf@plt>
lea    0xe3b(%rip),%rdi
mov    $0x4e2d,%esi
xor    %eax,%eax
call   1030 <wprintf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@LC_ALL = global i32 0
@.str = [12 x i8] c"zh_CN.UTF-8\00"
@.str.1 = [22 x i32] [i32 67, i32 104, i32 97, i32 114, i32 97, i32 99, i32 116, i32 101, i32 114, i32 115, i32 58, i32 32, i32 37, i32 108, i32 99, i32 32, i32 37, i32 108, i32 99, i32 32, i32 10, i32 0]
@.str.2 = [18 x i32] [i32 68, i32 101, i32 99, i32 105, i32 109, i32 97, i32 108, i32 115, i32 58, i32 32, i32 37, i32 100, i32 32, i32 37, i32 108, i32 100, i32 10, i32 0]
@.str.3 = [30 x i32] [i32 80, i32 114, i32 101, i32 99, i32 101, i32 100, i32 105, i32 110, i32 103, i32 32, i32 119, i32 105, i32 116, i32 104, i32 32, i32 98, i32 108, i32 97, i32 110, i32 107, i32 115, i32 58, i32 32, i32 37, i32 49, i32 48, i32 100, i32 32, i32 10, i32 0]
@.str.4 = [30 x i32] [i32 80, i32 114, i32 101, i32 99, i32 101, i32 100, i32 105, i32 110, i32 103, i32 32, i32 119, i32 105, i32 116, i32 104, i32 32, i32 122, i32 101, i32 114, i32 111, i32 115, i32 58, i32 32, i32 37, i32 48, i32 49, i32 48, i32 100, i32 32, i32 10, i32 0]
@.str.5 = [43 x i32] [i32 83, i32 111, i32 109, i32 101, i32 32, i32 100, i32 105, i32 102, i32 102, i32 101, i32 114, i32 101, i32 110, i32 116, i32 32, i32 114, i32 97, i32 100, i32 105, i32 120, i32 101, i32 115, i32 58, i32 32, i32 37, i32 100, i32 32, i32 37, i32 120, i32 32, i32 37, i32 111, i32 32, i32 37, i32 35, i32 120, i32 32, i32 37, i32 35, i32 111, i32 32, i32 10, i32 0]
@.str.6 = [25 x i32] [i32 102, i32 108, i32 111, i32 97, i32 116, i32 115, i32 58, i32 32, i32 37, i32 52, i32 46, i32 50, i32 102, i32 32, i32 37, i32 43, i32 46, i32 48, i32 101, i32 32, i32 37, i32 69, i32 32, i32 10, i32 0]
@.str.7 = [19 x i32] [i32 87, i32 105, i32 100, i32 116, i32 104, i32 32, i32 116, i32 114, i32 105, i32 99, i32 107, i32 58, i32 32, i32 37, i32 42, i32 100, i32 32, i32 10, i32 0]
@.str.8 = [6 x i32] [i32 37, i32 108, i32 115, i32 32, i32 10, i32 0]
@.str.9 = [14 x i32] [i32 65, i32 32, i32 119, i32 105, i32 100, i32 101, i32 32, i32 115, i32 116, i32 114, i32 105, i32 110, i32 103, i32 0]
@.str.10 = [3 x i32] [i32 27979, i32 35797, i32 0]
@.str.11 = [6 x i32] [i32 37, i32 108, i32 99, i32 32, i32 10, i32 0]
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @LC_ALL
%3 = call i32 @setlocale(i32 %2, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (i8*, ...) @wprintf(i8* bitcast ([22 x i32]* @.str.1 to i8*), i32 97, i32 65)
%5 = call i32 (i8*, ...) @wprintf(i8* bitcast ([18 x i32]* @.str.2 to i8*), i32 1977, i64 650000)
%6 = call i32 (i8*, ...) @wprintf(i8* bitcast ([30 x i32]* @.str.3 to i8*), i32 1977)
%7 = call i32 (i8*, ...) @wprintf(i8* bitcast ([30 x i32]* @.str.4 to i8*), i32 1977)
%8 = call i32 (i8*, ...) @wprintf(i8* bitcast ([43 x i32]* @.str.5 to i8*), i32 100, i32 100, i32 100, i32 100, i32 100)
%9 = call i32 (i8*, ...) @wprintf(i8* bitcast ([25 x i32]* @.str.6 to i8*), double 3.141600e+00, double 3.141600e+00, double 3.141600e+00)
%10 = call i32 (i8*, ...) @wprintf(i8* bitcast ([19 x i32]* @.str.7 to i8*), i32 5, i32 10)
%11 = call i32 (i8*, ...) @wprintf(i8* bitcast ([6 x i32]* @.str.8 to i8*), i32* getelementptr inbounds ([14 x i32], [14 x i32]* @.str.9, i64 0, i64 0))
%12 = call i32 (i8*, ...) @wprintf(i8* bitcast ([6 x i32]* @.str.8 to i8*), i32* getelementptr inbounds ([3 x i32], [3 x i32]* @.str.10, i64 0, i64 0))
%13 = call i32 (i8*, ...) @wprintf(i8* bitcast ([6 x i32]* @.str.11 to i8*), i32 20013)
ret i32 0
}

LLVM IR (-O2):
@LC_ALL = global i32 0
@.str = [12 x i8] c"zh_CN.UTF-8\00"
@.str.1 = [22 x i32] [i32 67, i32 104, i32 97, i32 114, i32 97, i32 99, i32 116, i32 101, i32 114, i32 115, i32 58, i32 32, i32 37, i32 108, i32 99, i32 32, i32 37, i32 108, i32 99, i32 32, i32 10, i32 0]
@.str.2 = [18 x i32] [i32 68, i32 101, i32 99, i32 105, i32 109, i32 97, i32 108, i32 115, i32 58, i32 32, i32 37, i32 100, i32 32, i32 37, i32 108, i32 100, i32 10, i32 0]
@.str.3 = [30 x i32] [i32 80, i32 114, i32 101, i32 99, i32 101, i32 100, i32 105, i32 110, i32 103, i32 32, i32 119, i32 105, i32 116, i32 104, i32 32, i32 98, i32 108, i32 97, i32 110, i32 107, i32 115, i32 58, i32 32, i32 37, i32 49, i32 48, i32 100, i32 32, i32 10, i32 0]
@.str.4 = [30 x i32] [i32 80, i32 114, i32 101, i32 99, i32 101, i32 100, i32 105, i32 110, i32 103, i32 32, i32 119, i32 105, i32 116, i32 104, i32 32, i32 122, i32 101, i32 114, i32 111, i32 115, i32 58, i32 32, i32 37, i32 48, i32 49, i32 48, i32 100, i32 32, i32 10, i32 0]
@.str.5 = [43 x i32] [i32 83, i32 111, i32 109, i32 101, i32 32, i32 100, i32 105, i32 102, i32 102, i32 101, i32 114, i32 101, i32 110, i32 116, i32 32, i32 114, i32 97, i32 100, i32 105, i32 120, i32 101, i32 115, i32 58, i32 32, i32 37, i32 100, i32 32, i32 37, i32 120, i32 32, i32 37, i32 111, i32 32, i32 37, i32 35, i32 120, i32 32, i32 37, i32 35, i32 111, i32 32, i32 10, i32 0]
@.str.6 = [25 x i32] [i32 102, i32 108, i32 111, i32 97, i32 116, i32 115, i32 58, i32 32, i32 37, i32 52, i32 46, i32 50, i32 102, i32 32, i32 37, i32 43, i32 46, i32 48, i32 101, i32 32, i32 37, i32 69, i32 32, i32 10, i32 0]
@.str.7 = [19 x i32] [i32 87, i32 105, i32 100, i32 116, i32 104, i32 32, i32 116, i32 114, i32 105, i32 99, i32 107, i32 58, i32 32, i32 37, i32 42, i32 100, i32 32, i32 10, i32 0]
@.str.8 = [6 x i32] [i32 37, i32 108, i32 115, i32 32, i32 10, i32 0]
@.str.9 = [14 x i32] [i32 65, i32 32, i32 119, i32 105, i32 100, i32 101, i32 32, i32 115, i32 116, i32 114, i32 105, i32 110, i32 103, i32 0]
@.str.10 = [3 x i32] [i32 27979, i32 35797, i32 0]
@.str.11 = [6 x i32] [i32 37, i32 108, i32 99, i32 32, i32 10, i32 0]
define i32 @main() {
%1 = load i32, i32* @LC_ALL
%2 = tail call i32 @setlocale(i32 %1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @wprintf(i8* bitcast ([22 x i32]* @.str.1 to i8*), i32 97, i32 65)
%4 = tail call i32 (i8*, ...) @wprintf(i8* bitcast ([18 x i32]* @.str.2 to i8*), i32 1977, i64 650000)
%5 = tail call i32 (i8*, ...) @wprintf(i8* bitcast ([30 x i32]* @.str.3 to i8*), i32 1977)
%6 = tail call i32 (i8*, ...) @wprintf(i8* bitcast ([30 x i32]* @.str.4 to i8*), i32 1977)
%7 = tail call i32 (i8*, ...) @wprintf(i8* bitcast ([43 x i32]* @.str.5 to i8*), i32 100, i32 100, i32 100, i32 100, i32 100)
%8 = tail call i32 (i8*, ...) @wprintf(i8* bitcast ([25 x i32]* @.str.6 to i8*), double 3.141600e+00, double 3.141600e+00, double 3.141600e+00)
%9 = tail call i32 (i8*, ...) @wprintf(i8* bitcast ([19 x i32]* @.str.7 to i8*), i32 5, i32 10)
%10 = tail call i32 (i8*, ...) @wprintf(i8* bitcast ([6 x i32]* @.str.8 to i8*), i32* getelementptr inbounds ([14 x i32], [14 x i32]* @.str.9, i64 0, i64 0))
%11 = tail call i32 (i8*, ...) @wprintf(i8* bitcast ([6 x i32]* @.str.8 to i8*), i32* getelementptr inbounds ([3 x i32], [3 x i32]* @.str.10, i64 0, i64 0))
%12 = tail call i32 (i8*, ...) @wprintf(i8* bitcast ([6 x i32]* @.str.11 to i8*), i32 20013)
ret i32 0
}