#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*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ sscanf(char const *, char const *, int /*<<< orphan*/ *);
int /*<<< orphan*/ stdout;
scalar_t__ wcscmp(int /*<<< orphan*/ *, char *);
int main(void) {
  const char cnv[] = "%l[abc]";
  const char str[] = "abbcXab";
  wchar_t wcs[256];
  int result = 0;
  sscanf(str, cnv, wcs);
  printf("wcs = \"%ls\"\n", wcs);
  fflush(stdout);
  result = wcscmp(wcs, L"abbc") != 0;
  return result;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x430,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xea7(%rip),%rax
mov    %rax,-0xc(%rbp)
mov    0xea4(%rip),%rax
mov    %rax,-0x14(%rbp)
movl   $0x0,-0x424(%rbp)
lea    -0x14(%rbp),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x420(%rbp),%rdx
call   1060 <sscanf@plt>
lea    -0x420(%rbp),%rsi
lea    0xe7c(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e40(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
lea    -0x420(%rbp),%rdi
lea    0xe6b(%rip),%rsi
call   1030 <wcscmp@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x424(%rbp)
mov    -0x424(%rbp),%eax
add    $0x430,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x410,%rsp
movabs $0x5d6362615b6c25,%rax
mov    %rax,0x8(%rsp)
movabs $0x62615863626261,%rax
mov    %rax,(%rsp)
mov    %rsp,%rdi
lea    0x8(%rsp),%rsi
lea    0x10(%rsp),%rbx
mov    %rbx,%rdx
call   1060 <sscanf@plt>
lea    0xe7f(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    0x2e50(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
lea    0xe72(%rip),%rsi
mov    %rbx,%rdi
call   1030 <wcscmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
add    $0x410,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.cnv = [8 x i8] c"%l[abc]\00"
@__const.main.str = [8 x i8] c"abbcXab\00"
@.str = [13 x i8] c"wcs = \22%ls\22\0A\00"
@stdout = global i32 0
@.str.1 = [5 x i32] [i32 97, i32 98, i32 98, i32 99, i32 0]
define i32 @main() {
%1 = alloca i32
%2 = alloca [8 x i8]
%3 = alloca [8 x i8]
%4 = alloca [256 x i32]
%5 = alloca i32
store i32 0, i32* %1
%6 = bitcast [8 x i8]* %2 to i8*
%7 = bitcast [8 x i8]* %3 to i8*
store i32 0, i32* %5
%8 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 0
%9 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%10 = getelementptr inbounds [256 x i32], [256 x i32]* %4, i64 0, i64 0
%11 = call i32 @sscanf(i8* %8, i8* %9, i32* %10)
%12 = getelementptr inbounds [256 x i32], [256 x i32]* %4, i64 0, i64 0
%13 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32* %12)
%14 = load i32, i32* @stdout
%15 = call i32 @fflush(i32 %14)
%16 = getelementptr inbounds [256 x i32], [256 x i32]* %4, i64 0, i64 0
%17 = call i64 @wcscmp(i32* %16, i8* bitcast ([5 x i32]* @.str.1 to i8*))
%18 = icmp ne i64 %17, 0
%19 = zext i1 %18 to i32
store i32 %19, i32* %5
%20 = load i32, i32* %5
ret i32 %20
}

LLVM IR (-O2):
@.str = [13 x i8] c"wcs = \22%ls\22\0A\00"
@stdout = global i32 0
@.str.1 = [5 x i32] [i32 97, i32 98, i32 98, i32 99, i32 0]
define i32 @main() {
%1 = alloca i64
%2 = alloca i64
%3 = alloca [256 x i32]
%4 = bitcast i64* %1 to i8*
store i64 26286447025417253, i64* %1
%5 = bitcast i64* %2 to i8*
store i64 27691579970052705, i64* %2
%6 = bitcast [256 x i32]* %3 to i8*
%7 = getelementptr inbounds [256 x i32], [256 x i32]* %3, i64 0, i64 0
%8 = call i32 @sscanf(i8* %5, i8* %4, i32* %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32* %7)
%10 = load i32, i32* @stdout
%11 = call i32 @fflush(i32 %10)
%12 = call i64 @wcscmp(i32* %7, i8* bitcast ([5 x i32]* @.str.1 to i8*))
%13 = icmp ne i64 %12, 0
%14 = zext i1 %13 to i32
ret i32 %14
}