#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*/ printf(char *, ...);
int /*<<< orphan*/ strncmp(char const *, char *, int);
int main(void) {
  const char *list[6] = {"astronomy", "astounding", "astrophysics",
                         "ostracize", "asterism",   "astrophobia"};
  int count = 0;
  int i;
  for (i = 0; i < 6; i++) {
    if (!(strncmp(list[i], "astronaut", 5))) {
      printf("Found: %s\n", list[i]);
      count++;
    }
  }
  printf("The list contained %d words beginning"
         " with \"astro\".\n",
         count);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x30,%edx
call   1050 <memset@plt>
lea    0xeaa(%rip),%rax
mov    %rax,-0x40(%rbp)
lea    0xea9(%rip),%rax
mov    %rax,-0x38(%rbp)
lea    0xea9(%rip),%rax
mov    %rax,-0x30(%rbp)
lea    0xeab(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    0xeaa(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    0xea8(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x44(%rbp)
movl   $0x0,-0x48(%rbp)
cmpl   $0x6,-0x48(%rbp)
jge    11ff <main+0xcf>
movslq -0x48(%rbp),%rax
mov    -0x40(%rbp,%rax,8),%rdi
lea    0xe88(%rip),%rsi
mov    $0x5,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    11ec <main+0xbc>
movslq -0x48(%rbp),%rax
mov    -0x40(%rbp,%rax,8),%rsi
lea    0xe6f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    11f1 <main+0xc1>
mov    -0x48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
jmp    119f <main+0x6f>
mov    -0x44(%rbp),%esi
lea    0xe4d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rdi
lea    0xf12(%rip),%rsi
mov    $0x5,%edx
call   1030 <strncmp@plt>
xor    %ebx,%ebx
test   %eax,%eax
jne    1159 <main+0x39>
lea    0xf05(%rip),%rdi
lea    0xeb3(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%ebx
lea    0xeaa(%rip),%rdi
lea    0xeda(%rip),%rsi
mov    $0x5,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
jne    118d <main+0x6d>
lea    0xecf(%rip),%rdi
lea    0xe87(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%ebx
lea    0xe81(%rip),%rdi
lea    0xea6(%rip),%rsi
mov    $0x5,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
jne    11c1 <main+0xa1>
lea    0xe9b(%rip),%rdi
lea    0xe5e(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%ebx
lea    0xe5a(%rip),%rdi
lea    0xe72(%rip),%rsi
mov    $0x5,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
jne    11f5 <main+0xd5>
lea    0xe67(%rip),%rdi
lea    0xe37(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%ebx
lea    0xe30(%rip),%rdi
lea    0xe3e(%rip),%rsi
mov    $0x5,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
jne    1229 <main+0x109>
lea    0xe33(%rip),%rdi
lea    0xe0d(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%ebx
lea    0xe05(%rip),%rdi
lea    0xe0a(%rip),%rsi
mov    $0x5,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
jne    125d <main+0x13d>
lea    0xdff(%rip),%rdi
lea    0xde2(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%ebx
lea    0xdf2(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"astronomy\00"
@.str.1 = [11 x i8] c"astounding\00"
@.str.2 = [13 x i8] c"astrophysics\00"
@.str.3 = [10 x i8] c"ostracize\00"
@.str.4 = [9 x i8] c"asterism\00"
@.str.5 = [12 x i8] c"astrophobia\00"
@.str.6 = [10 x i8] c"astronaut\00"
@.str.7 = [11 x i8] c"Found: %s\0A\00"
@.str.8 = [53 x i8] c"The list contained %d words beginning with \22astro\22.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x i8*]
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = bitcast [6 x i8*]* %2 to i8*
%6 = bitcast i8* %5 to [6 x i8*]*
%7 = getelementptr inbounds [6 x i8*], [6 x i8*]* %6, i32 0, i32 0
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i32 0, i32 0), i8** %7
%8 = getelementptr inbounds [6 x i8*], [6 x i8*]* %6, i32 0, i32 1
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i32 0, i32 0), i8** %8
%9 = getelementptr inbounds [6 x i8*], [6 x i8*]* %6, i32 0, i32 2
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i32 0, i32 0), i8** %9
%10 = getelementptr inbounds [6 x i8*], [6 x i8*]* %6, i32 0, i32 3
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i32 0, i32 0), i8** %10
%11 = getelementptr inbounds [6 x i8*], [6 x i8*]* %6, i32 0, i32 4
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i32 0, i32 0), i8** %11
%12 = getelementptr inbounds [6 x i8*], [6 x i8*]* %6, i32 0, i32 5
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i32 0, i32 0), i8** %12
store i32 0, i32* %3
store i32 0, i32* %4
br label %13
13: ; preds = %32, %0
%14 = load i32, i32* %4
%15 = icmp slt i32 %14, 6
br i1 %15, label %16, label %35
16: ; preds = %13
%17 = load i32, i32* %4
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [6 x i8*], [6 x i8*]* %2, i64 0, i64 %18
%20 = load i8*, i8** %19
%21 = call i32 @strncmp(i8* %20, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i32 5)
%22 = icmp ne i32 %21, 0
br i1 %22, label %31, label %23
23: ; preds = %16
%24 = load i32, i32* %4
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [6 x i8*], [6 x i8*]* %2, i64 0, i64 %25
%27 = load i8*, i8** %26
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0), i8* %27)
%29 = load i32, i32* %3
%30 = add nsw i32 %29, 1
store i32 %30, i32* %3
br label %31
31: ; preds = %23, %16
br label %32
32: ; preds = %31
%33 = load i32, i32* %4
%34 = add nsw i32 %33, 1
store i32 %34, i32* %4
br label %13
35: ; preds = %13
%36 = load i32, i32* %3
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.8, i64 0, i64 0), i32 %36)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"astronomy\00"
@.str.1 = [11 x i8] c"astounding\00"
@.str.2 = [13 x i8] c"astrophysics\00"
@.str.3 = [10 x i8] c"ostracize\00"
@.str.4 = [9 x i8] c"asterism\00"
@.str.5 = [12 x i8] c"astrophobia\00"
@.str.6 = [10 x i8] c"astronaut\00"
@.str.7 = [11 x i8] c"Found: %s\0A\00"
@.str.8 = [53 x i8] c"The list contained %d words beginning with \22astro\22.\0A\00"
define i32 @main() {
%1 = tail call i32 @strncmp(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i32 5)
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %0, %3
%6 = phi i32 [ 0, %0 ], [ 1, %3 ]
%7 = tail call i32 @strncmp(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i32 5)
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %5
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%11 = add nuw nsw i32 %6, 1
br label %12
12: ; preds = %9, %5
%13 = phi i32 [ %6, %5 ], [ %11, %9 ]
%14 = tail call i32 @strncmp(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i32 5)
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %12
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%18 = add nuw nsw i32 %13, 1
br label %19
19: ; preds = %16, %12
%20 = phi i32 [ %13, %12 ], [ %18, %16 ]
%21 = tail call i32 @strncmp(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i32 5)
%22 = icmp eq i32 %21, 0
br i1 %22, label %23, label %26
23: ; preds = %19
%24 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%25 = add nuw nsw i32 %20, 1
br label %26
26: ; preds = %23, %19
%27 = phi i32 [ %20, %19 ], [ %25, %23 ]
%28 = tail call i32 @strncmp(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i32 5)
%29 = icmp eq i32 %28, 0
br i1 %29, label %30, label %33
30: ; preds = %26
%31 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%32 = add nuw nsw i32 %27, 1
br label %33
33: ; preds = %30, %26
%34 = phi i32 [ %27, %26 ], [ %32, %30 ]
%35 = tail call i32 @strncmp(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i32 5)
%36 = icmp eq i32 %35, 0
br i1 %36, label %37, label %40
37: ; preds = %33
%38 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0))
%39 = add nuw nsw i32 %34, 1
br label %40
40: ; preds = %37, %33
%41 = phi i32 [ %34, %33 ], [ %39, %37 ]
%42 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.8, i64 0, i64 0), i32 %41)
ret i32 0
}