#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*/ memset(char *, int /*<<< orphan*/, int);
int main(int argc, char const *argv[]) {
  static char str[256];
  str[64] = 1;
  memset(str, 0, 64);
  size_t i;
  for (i = 0; i < 64; i++) {
    if (str[i] != 0) {
      return 1;
    }
  }
  return !(str[64] == 1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movb   $0x1,0x2f53(%rip)
lea    0x2f0c(%rip),%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1030 <memset@plt>
movq   $0x0,-0x18(%rbp)
cmpq   $0x40,-0x18(%rbp)
jae    118d <main+0x7d>
mov    -0x18(%rbp),%rcx
lea    0x2ee2(%rip),%rax
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1177 <main+0x67>
movl   $0x1,-0x4(%rbp)
jmp    11a4 <main+0x94>
jmp    117c <main+0x6c>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1148 <main+0x38>
movsbl 0x2eec(%rip),%eax
cmp    $0x1,%eax
sete   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
movb   $0x1,0x2f65(%rip)
lea    0x2f1e(%rip),%r14
xor    %ebx,%ebx
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1030 <memset@plt>
mov    $0x1,%eax
nopl   0x0(%rax,%rax,1)
cmpb   $0x0,(%rbx,%r14,1)
jne    1175 <main+0x65>
cmpb   $0x0,0x1(%rbx,%r14,1)
jne    1175 <main+0x65>
cmpb   $0x0,0x2(%rbx,%r14,1)
jne    1175 <main+0x65>
cmpb   $0x0,0x3(%rbx,%r14,1)
jne    1175 <main+0x65>
add    $0x4,%rbx
cmp    $0x40,%rbx
jne    1140 <main+0x30>
xor    %eax,%eax
cmpb   $0x1,0x2f0e(%rip)
setne  %al
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@main.str = internal global [256 x i8] zeroinitializer
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8 1, i8* getelementptr inbounds ([256 x i8], [256 x i8]* @main.str, i64 0, i64 64)
%7 = call i32 @memset(i8* getelementptr inbounds ([256 x i8], [256 x i8]* @main.str, i64 0, i64 0), i32 0, i32 64)
store i64 0, i64* %6
br label %8
8: ; preds = %19, %2
%9 = load i64, i64* %6
%10 = icmp ult i64 %9, 64
br i1 %10, label %11, label %22
11: ; preds = %8
%12 = load i64, i64* %6
%13 = getelementptr inbounds [256 x i8], [256 x i8]* @main.str, i64 0, i64 %12
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %11
store i32 1, i32* %3
br label %28
18: ; preds = %11
br label %19
19: ; preds = %18
%20 = load i64, i64* %6
%21 = add i64 %20, 1
store i64 %21, i64* %6
br label %8
22: ; preds = %8
%23 = load i8, i8* getelementptr inbounds ([256 x i8], [256 x i8]* @main.str, i64 0, i64 64)
%24 = sext i8 %23 to i32
%25 = icmp eq i32 %24, 1
%26 = xor i1 %25, true
%27 = zext i1 %26 to i32
store i32 %27, i32* %3
br label %28
28: ; preds = %22, %17
%29 = load i32, i32* %3
ret i32 %29
}

LLVM IR (-O2):
@main.str = internal global [256 x i8] zeroinitializer
define i32 @main(i32 %0, i8** nocapture readnone %1) {
store i8 1, i8* getelementptr inbounds ([256 x i8], [256 x i8]* @main.str, i64 0, i64 64)
%3 = tail call i32 @memset(i8* getelementptr inbounds ([256 x i8], [256 x i8]* @main.str, i64 0, i64 0), i32 0, i32 64)
br label %22
4: ; preds = %22
%5 = or i64 %23, 1
%6 = getelementptr inbounds [256 x i8], [256 x i8]* @main.str, i64 0, i64 %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %9, label %31
9: ; preds = %4
%10 = or i64 %23, 2
%11 = getelementptr inbounds [256 x i8], [256 x i8]* @main.str, i64 0, i64 %10
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %31
14: ; preds = %9
%15 = or i64 %23, 3
%16 = getelementptr inbounds [256 x i8], [256 x i8]* @main.str, i64 0, i64 %15
%17 = load i8, i8* %16
%18 = icmp eq i8 %17, 0
br i1 %18, label %19, label %31
19: ; preds = %14
%20 = add nuw nsw i64 %23, 4
%21 = icmp eq i64 %20, 64
br i1 %21, label %27, label %22
22: ; preds = %19, %2
%23 = phi i64 [ 0, %2 ], [ %20, %19 ]
%24 = getelementptr inbounds [256 x i8], [256 x i8]* @main.str, i64 0, i64 %23
%25 = load i8, i8* %24
%26 = icmp eq i8 %25, 0
br i1 %26, label %4, label %31
27: ; preds = %19
%28 = load i8, i8* getelementptr inbounds ([256 x i8], [256 x i8]* @main.str, i64 0, i64 64)
%29 = icmp ne i8 %28, 1
%30 = zext i1 %29 to i32
br label %31
31: ; preds = %22, %4, %9, %14, %27
%32 = phi i32 [ %30, %27 ], [ 1, %14 ], [ 1, %9 ], [ 1, %4 ], [ 1, %22 ]
ret i32 %32
}