#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 strlen(char *);
int main() {
  int rval = 1;
  rval = rval && (strlen("") == 0);
  rval = rval && (strlen("a") == 1);
  rval = rval && (strlen("hello world") == 11);
  rval = rval && (strlen("aaaa\0abc") == 4);
  rval = rval && (strlen("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                         "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") == 92);
  return !rval;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     114a <main+0x3a>
lea    0xf2c(%rip),%rdi
call   1030 <strlen@plt>
cmp    $0x0,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0xa(%rbp)
je     1179 <main+0x69>
lea    0xefc(%rip),%rdi
call   1030 <strlen@plt>
cmp    $0x1,%eax
sete   %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0xb(%rbp)
je     11a8 <main+0x98>
lea    0xe66(%rip),%rdi
call   1030 <strlen@plt>
cmp    $0xb,%eax
sete   %al
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0xc(%rbp)
je     11d7 <main+0xc7>
lea    0xea0(%rip),%rdi
call   1030 <strlen@plt>
cmp    $0x4,%eax
sete   %al
mov    %al,-0xc(%rbp)
mov    -0xc(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0xd(%rbp)
je     1206 <main+0xf6>
lea    0xe14(%rip),%rdi
call   1030 <strlen@plt>
cmp    $0x5c,%eax
sete   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xf50(%rip),%rdi
call   1030 <strlen@plt>
mov    $0x1,%ebx
test   %eax,%eax
jne    116d <main+0x5d>
lea    0xf3a(%rip),%rdi
call   1030 <strlen@plt>
cmp    $0x1,%eax
jne    116d <main+0x5d>
lea    0xec2(%rip),%rdi
call   1030 <strlen@plt>
cmp    $0xb,%eax
jne    116d <main+0x5d>
lea    0xf1a(%rip),%rdi
call   1030 <strlen@plt>
cmp    $0x4,%eax
jne    116d <main+0x5d>
lea    0xeac(%rip),%rdi
call   1030 <strlen@plt>
xor    %ebx,%ebx
cmp    $0x5c,%eax
setne  %bl
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [2 x i8] c"a\00"
@.str.2 = [12 x i8] c"hello world\00"
@.str.3 = [9 x i8] c"aaaa\00abc\00"
@.str.4 = [93 x i8] c"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = call i32 @strlen(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i32 %6, 0
br label %8
8: ; preds = %5, %0
%9 = phi i1 [ false, %0 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
store i32 %10, i32* %2
%11 = load i32, i32* %2
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %8
%14 = call i32 @strlen(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%15 = icmp eq i32 %14, 1
br label %16
16: ; preds = %13, %8
%17 = phi i1 [ false, %8 ], [ %15, %13 ]
%18 = zext i1 %17 to i32
store i32 %18, i32* %2
%19 = load i32, i32* %2
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %24
21: ; preds = %16
%22 = call i32 @strlen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%23 = icmp eq i32 %22, 11
br label %24
24: ; preds = %21, %16
%25 = phi i1 [ false, %16 ], [ %23, %21 ]
%26 = zext i1 %25 to i32
store i32 %26, i32* %2
%27 = load i32, i32* %2
%28 = icmp ne i32 %27, 0
br i1 %28, label %29, label %32
29: ; preds = %24
%30 = call i32 @strlen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
%31 = icmp eq i32 %30, 4
br label %32
32: ; preds = %29, %24
%33 = phi i1 [ false, %24 ], [ %31, %29 ]
%34 = zext i1 %33 to i32
store i32 %34, i32* %2
%35 = load i32, i32* %2
%36 = icmp ne i32 %35, 0
br i1 %36, label %37, label %40
37: ; preds = %32
%38 = call i32 @strlen(i8* getelementptr inbounds ([93 x i8], [93 x i8]* @.str.4, i64 0, i64 0))
%39 = icmp eq i32 %38, 92
br label %40
40: ; preds = %37, %32
%41 = phi i1 [ false, %32 ], [ %39, %37 ]
%42 = zext i1 %41 to i32
store i32 %42, i32* %2
%43 = load i32, i32* %2
%44 = icmp ne i32 %43, 0
%45 = xor i1 %44, true
%46 = zext i1 %45 to i32
ret i32 %46
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [2 x i8] c"a\00"
@.str.2 = [12 x i8] c"hello world\00"
@.str.3 = [9 x i8] c"aaaa\00abc\00"
@.str.4 = [93 x i8] c"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\00"
define i32 @main() {
%1 = tail call i32 @strlen(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %16
3: ; preds = %0
%4 = tail call i32 @strlen(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %16
6: ; preds = %3
%7 = tail call i32 @strlen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%8 = icmp eq i32 %7, 11
br i1 %8, label %9, label %16
9: ; preds = %6
%10 = tail call i32 @strlen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
%11 = icmp eq i32 %10, 4
br i1 %11, label %12, label %16
12: ; preds = %9
%13 = tail call i32 @strlen(i8* getelementptr inbounds ([93 x i8], [93 x i8]* @.str.4, i64 0, i64 0))
%14 = icmp ne i32 %13, 92
%15 = zext i1 %14 to i32
br label %16
16: ; preds = %0, %3, %6, %12, %9
%17 = phi i32 [ 1, %9 ], [ %15, %12 ], [ 1, %6 ], [ 1, %3 ], [ 1, %0 ]
ret i32 %17
}