#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*/ abort();
int /*<<< orphan*/ printf(char *, int, char *);
int sscanf(char *, char *, char *);
scalar_t__ strcmp(char *, char *);
int main(int argc, char *argv[]) {
  int ret;
  char buf[1024] = "Ooops";
  ret = sscanf("static char Term_bits[] = {", "static char %s = {", buf);
  printf("ret: %d, name: %s\n", ret, buf);
  if (ret != 1 || strcmp(buf, "Term_bits[]") != 0)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x420(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1050 <memset@plt>
movb   $0x4f,-0x420(%rbp)
movb   $0x6f,-0x41f(%rbp)
movb   $0x6f,-0x41e(%rbp)
movb   $0x70,-0x41d(%rbp)
movb   $0x73,-0x41c(%rbp)
lea    -0x420(%rbp),%rdx
lea    0xe53(%rip),%rdi
lea    0xe68(%rip),%rsi
call   1070 <sscanf@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    -0x420(%rbp),%rdx
lea    0xe62(%rip),%rdi
call   1040 <printf@plt>
cmpl   $0x1,-0x14(%rbp)
jne    11f9 <main+0xa9>
lea    -0x420(%rbp),%rdi
lea    0xe58(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     1200 <main+0xb0>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x408,%rsp
mov    %rsp,%rbx
mov    $0x400,%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1050 <memset@plt>
movl   $0x706f6f4f,(%rsp)
movb   $0x73,0x4(%rsp)
lea    0xe82(%rip),%rdi
lea    0xe97(%rip),%rsi
mov    %rbx,%rdx
call   1070 <sscanf@plt>
mov    %eax,%ebp
lea    0xe99(%rip),%rdi
mov    %eax,%esi
mov    %rbx,%rdx
call   1040 <printf@plt>
cmp    $0x1,%ebp
jne    11c5 <main+0x75>
lea    0xe96(%rip),%rsi
mov    %rsp,%rdi
call   1060 <strcmp@plt>
test   %rax,%rax
jne    11c5 <main+0x75>
xor    %eax,%eax
add    $0x408,%rsp
pop    %rbx
pop    %rbp
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"static char Term_bits[] = {\00"
@.str.1 = [19 x i8] c"static char %s = {\00"
@.str.2 = [19 x i8] c"ret: %d, name: %s\0A\00"
@.str.3 = [12 x i8] c"Term_bits[]\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [1024 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = bitcast [1024 x i8]* %7 to i8*
%9 = bitcast i8* %8 to [1024 x i8]*
%10 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i32 0, i32 0
store i8 79, i8* %10
%11 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i32 0, i32 1
store i8 111, i8* %11
%12 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i32 0, i32 2
store i8 111, i8* %12
%13 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i32 0, i32 3
store i8 112, i8* %13
%14 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i32 0, i32 4
store i8 115, i8* %14
%15 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%16 = call i32 @sscanf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %15)
store i32 %16, i32* %6
%17 = load i32, i32* %6
%18 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%19 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 %17, i8* %18)
%20 = load i32, i32* %6
%21 = icmp ne i32 %20, 1
br i1 %21, label %26, label %22
22: ; preds = %2
%23 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%24 = call i64 @strcmp(i8* %23, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%25 = icmp ne i64 %24, 0
br i1 %25, label %26, label %28
26: ; preds = %22, %2
%27 = call i32 (...) @abort()
unreachable
28: ; preds = %22
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"static char Term_bits[] = {\00"
@.str.1 = [19 x i8] c"static char %s = {\00"
@.str.2 = [19 x i8] c"ret: %d, name: %s\0A\00"
@.str.3 = [12 x i8] c"Term_bits[]\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [1024 x i8]
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
store i8 79, i8* %4
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 1
store i8 111, i8* %5
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 2
store i8 111, i8* %6
%7 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 3
store i8 112, i8* %7
%8 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 4
store i8 115, i8* %8
%9 = call i32 @sscanf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%10 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 %9, i8* %4)
%11 = icmp eq i32 %9, 1
br i1 %11, label %12, label %15
12: ; preds = %2
%13 = call i64 @strcmp(i8* %4, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%14 = icmp eq i64 %13, 0
br i1 %14, label %17, label %15
15: ; preds = %12, %2
%16 = call i32 (...) @abort()
unreachable
17: ; preds = %12
ret i32 0
}