#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 int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int /*<<< orphan*/ LC_ALL;
int /*<<< orphan*/ setlocale(int /*<<< orphan*/, char *);
int /*<<< orphan*/ wprintf(char *, ...);
int wscanf(char *, int *, float *, char *, int /*<<< orphan*/ *, char *,
           int /*<<< orphan*/ *);
int main(void) {
  setlocale(LC_ALL, "zh_CN.UTF-8");
  int i, result;
  float fp;
  char c, s[81];
  wchar_t wc, ws[81];
  wprintf(
      L"按以下顺序输入：\"整型\t浮点型\t字符\t宽字符\t字符串\t宽字符串\"\n");
  result = wscanf(L"%d %f %c %C %80s %80S", &i, &fp, &c, &wc, s, ws);
  wprintf(L"The number of fields input is %d\n", result);
  wprintf(L"The contents are: %d %f %c %C %s %S\n", i, fp, c, wc, s, ws);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1d0,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
lea    0xeae(%rip),%rsi
call   1050 <setlocale@plt>
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1040 <wprintf@plt>
lea    -0x70(%rbp),%r9
lea    -0x1c0(%rbp),%rax
lea    0xf1d(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0x10(%rbp),%rdx
lea    -0x11(%rbp),%rcx
lea    -0x74(%rbp),%r8
mov    %rax,(%rsp)
call   1030 <wscanf@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xf4f(%rip),%rdi
mov    $0x0,%al
call   1040 <wprintf@plt>
mov    -0x8(%rbp),%esi
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsbl -0x11(%rbp),%edx
mov    -0x74(%rbp),%ecx
lea    -0x70(%rbp),%r8
lea    -0x1c0(%rbp),%r9
lea    0xfab(%rip),%rdi
mov    $0x1,%al
call   1040 <wprintf@plt>
xor    %eax,%eax
add    $0x1d0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x1c8,%rsp
mov    0x2e9f(%rip),%rax
mov    (%rax),%edi
lea    0xeb6(%rip),%rsi
call   1050 <setlocale@plt>
lea    0xeb6(%rip),%rdi
xor    %eax,%eax
call   1040 <wprintf@plt>
lea    0x80(%rsp),%r14
mov    %r14,(%rsp)
lea    0xf24(%rip),%rdi
lea    0x1c(%rsp),%rsi
lea    0x18(%rsp),%rdx
lea    0x13(%rsp),%rcx
lea    0x14(%rsp),%r8
lea    0x20(%rsp),%rbx
mov    %rbx,%r9
call   1030 <wscanf@plt>
lea    0xf54(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <wprintf@plt>
mov    0x1c(%rsp),%esi
movss  0x18(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movsbl 0x13(%rsp),%edx
mov    0x14(%rsp),%ecx
lea    0xfb5(%rip),%rdi
mov    %rbx,%r8
mov    %r14,%r9
mov    $0x1,%al
call   1040 <wprintf@plt>
xor    %eax,%eax
add    $0x1c8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@LC_ALL = global i32 0
@.str = [12 x i8] c"zh_CN.UTF-8\00"
@.str.1 = [34 x i32] [i32 25353, i32 20197, i32 19979, i32 39034, i32 24207, i32 36755, i32 20837, i32 65306, i32 34, i32 25972, i32 22411, i32 9, i32 28014, i32 28857, i32 22411, i32 9, i32 23383, i32 31526, i32 9, i32 23485, i32 23383, i32 31526, i32 9, i32 23383, i32 31526, i32 20018, i32 9, i32 23485, i32 23383, i32 31526, i32 20018, i32 34, i32 10, i32 0]
@.str.2 = [22 x i32] [i32 37, i32 100, i32 32, i32 37, i32 102, i32 32, i32 37, i32 99, i32 32, i32 37, i32 67, i32 32, i32 37, i32 56, i32 48, i32 115, i32 32, i32 37, i32 56, i32 48, i32 83, i32 0]
@.str.3 = [34 x i32] [i32 84, i32 104, i32 101, i32 32, i32 110, i32 117, i32 109, i32 98, i32 101, i32 114, i32 32, i32 111, i32 102, i32 32, i32 102, i32 105, i32 101, i32 108, i32 100, i32 115, i32 32, i32 105, i32 110, i32 112, i32 117, i32 116, i32 32, i32 105, i32 115, i32 32, i32 37, i32 100, i32 10, i32 0]
@.str.4 = [37 x i32] [i32 84, i32 104, i32 101, i32 32, i32 99, i32 111, i32 110, i32 116, i32 101, i32 110, i32 116, i32 115, i32 32, i32 97, i32 114, i32 101, i32 58, i32 32, i32 37, i32 100, i32 32, i32 37, i32 102, i32 32, i32 37, i32 99, i32 32, i32 37, i32 67, i32 32, i32 37, i32 115, i32 32, i32 37, i32 83, i32 10, i32 0]
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = alloca i8
%6 = alloca [81 x i8]
%7 = alloca i32
%8 = alloca [81 x i32]
store i32 0, i32* %1
%9 = load i32, i32* @LC_ALL
%10 = call i32 @setlocale(i32 %9, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%11 = call i32 (i8*, ...) @wprintf(i8* bitcast ([34 x i32]* @.str.1 to i8*))
%12 = getelementptr inbounds [81 x i8], [81 x i8]* %6, i64 0, i64 0
%13 = getelementptr inbounds [81 x i32], [81 x i32]* %8, i64 0, i64 0
%14 = call i32 @wscanf(i8* bitcast ([22 x i32]* @.str.2 to i8*), i32* %2, float* %4, i8* %5, i32* %7, i8* %12, i32* %13)
store i32 %14, i32* %3
%15 = load i32, i32* %3
%16 = call i32 (i8*, ...) @wprintf(i8* bitcast ([34 x i32]* @.str.3 to i8*), i32 %15)
%17 = load i32, i32* %2
%18 = load float, float* %4
%19 = fpext float %18 to double
%20 = load i8, i8* %5
%21 = sext i8 %20 to i32
%22 = load i32, i32* %7
%23 = getelementptr inbounds [81 x i8], [81 x i8]* %6, i64 0, i64 0
%24 = getelementptr inbounds [81 x i32], [81 x i32]* %8, i64 0, i64 0
%25 = call i32 (i8*, ...) @wprintf(i8* bitcast ([37 x i32]* @.str.4 to i8*), i32 %17, double %19, i32 %21, i32 %22, i8* %23, i32* %24)
ret i32 0
}

LLVM IR (-O2):
@LC_ALL = global i32 0
@.str = [12 x i8] c"zh_CN.UTF-8\00"
@.str.1 = [34 x i32] [i32 25353, i32 20197, i32 19979, i32 39034, i32 24207, i32 36755, i32 20837, i32 65306, i32 34, i32 25972, i32 22411, i32 9, i32 28014, i32 28857, i32 22411, i32 9, i32 23383, i32 31526, i32 9, i32 23485, i32 23383, i32 31526, i32 9, i32 23383, i32 31526, i32 20018, i32 9, i32 23485, i32 23383, i32 31526, i32 20018, i32 34, i32 10, i32 0]
@.str.2 = [22 x i32] [i32 37, i32 100, i32 32, i32 37, i32 102, i32 32, i32 37, i32 99, i32 32, i32 37, i32 67, i32 32, i32 37, i32 56, i32 48, i32 115, i32 32, i32 37, i32 56, i32 48, i32 83, i32 0]
@.str.3 = [34 x i32] [i32 84, i32 104, i32 101, i32 32, i32 110, i32 117, i32 109, i32 98, i32 101, i32 114, i32 32, i32 111, i32 102, i32 32, i32 102, i32 105, i32 101, i32 108, i32 100, i32 115, i32 32, i32 105, i32 110, i32 112, i32 117, i32 116, i32 32, i32 105, i32 115, i32 32, i32 37, i32 100, i32 10, i32 0]
@.str.4 = [37 x i32] [i32 84, i32 104, i32 101, i32 32, i32 99, i32 111, i32 110, i32 116, i32 101, i32 110, i32 116, i32 115, i32 32, i32 97, i32 114, i32 101, i32 58, i32 32, i32 37, i32 100, i32 32, i32 37, i32 102, i32 32, i32 37, i32 99, i32 32, i32 37, i32 67, i32 32, i32 37, i32 115, i32 32, i32 37, i32 83, i32 10, i32 0]
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca i8
%4 = alloca [81 x i8]
%5 = alloca i32
%6 = alloca [81 x i32]
%7 = load i32, i32* @LC_ALL
%8 = tail call i32 @setlocale(i32 %7, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%9 = bitcast i32* %1 to i8*
%10 = bitcast float* %2 to i8*
%11 = getelementptr inbounds [81 x i8], [81 x i8]* %4, i64 0, i64 0
%12 = bitcast i32* %5 to i8*
%13 = bitcast [81 x i32]* %6 to i8*
%14 = tail call i32 (i8*, ...) @wprintf(i8* bitcast ([34 x i32]* @.str.1 to i8*))
%15 = getelementptr inbounds [81 x i32], [81 x i32]* %6, i64 0, i64 0
%16 = call i32 @wscanf(i8* bitcast ([22 x i32]* @.str.2 to i8*), i32* %1, float* %2, i8* %3, i32* %5, i8* %11, i32* %15)
%17 = call i32 (i8*, ...) @wprintf(i8* bitcast ([34 x i32]* @.str.3 to i8*), i32 %16)
%18 = load i32, i32* %1
%19 = load float, float* %2
%20 = fpext float %19 to double
%21 = load i8, i8* %3
%22 = sext i8 %21 to i32
%23 = load i32, i32* %5
%24 = call i32 (i8*, ...) @wprintf(i8* bitcast ([37 x i32]* @.str.4 to i8*), i32 %18, double %20, i32 %22, i32 %23, i8* %11, i32* %15)
ret i32 0
}