#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 *, char *, ...);
scalar_t__ strcmp(char *, char *);
int main(int argc, char *argv[]) {
  char *planets[] = {"Mercury", "Venus",  "Earth",   "Mars", "Jupiter",
                     "Saturn",  "Uranus", "Neptune", "Pluto"};
  for (int i = 1; i < argc; i += 1) {
    int j;
    for (j = 0; j < 9; j += 1) {
      if (strcmp(argv[i], planets[j]) == 0) {
        printf("%s is planet %d.\n", argv[i], j + 1);
        break;
      }
    }
    if (j == 9) {
      printf("%s is not a planet.\n", argv[i]);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x60(%rbp),%rdi
lea    0x2c7f(%rip),%rsi
mov    $0x48,%edx
call   1050 <memcpy@plt>
movl   $0x1,-0x64(%rbp)
mov    -0x64(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1212 <main+0xe2>
movl   $0x0,-0x68(%rbp)
cmpl   $0x9,-0x68(%rbp)
jge    11db <main+0xab>
mov    -0x10(%rbp),%rax
movslq -0x64(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
movslq -0x68(%rbp),%rax
mov    -0x60(%rbp,%rax,8),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11c8 <main+0x98>
mov    -0x10(%rbp),%rax
movslq -0x64(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
mov    -0x68(%rbp),%edx
add    $0x1,%edx
lea    0xe81(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11db <main+0xab>
jmp    11cd <main+0x9d>
mov    -0x68(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x68(%rbp)
jmp    1175 <main+0x45>
cmpl   $0x9,-0x68(%rbp)
jne    11ff <main+0xcf>
mov    -0x10(%rbp),%rax
movslq -0x64(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xe57(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1204 <main+0xd4>
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    1162 <main+0x32>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
cmp    $0x2,%edi
jl     12bb <main+0x19b>
mov    %rsi,%rbx
mov    %edi,%ebp
mov    $0x1,%r13d
lea    0xeba(%rip),%r14
lea    0xef0(%rip),%r15
lea    0xeb4(%rip),%r12
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    (%rbx,%r13,8),%rdi
mov    %r14,%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1250 <main+0x130>
mov    (%rbx,%r13,8),%rdi
mov    %r12,%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1260 <main+0x140>
mov    (%rbx,%r13,8),%rdi
lea    0xe79(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1267 <main+0x147>
mov    (%rbx,%r13,8),%rdi
lea    0xe66(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     126e <main+0x14e>
mov    (%rbx,%r13,8),%rdi
lea    0xe52(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1275 <main+0x155>
mov    (%rbx,%r13,8),%rdi
lea    0xe41(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     127c <main+0x15c>
mov    (%rbx,%r13,8),%rdi
lea    0xe2f(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1283 <main+0x163>
mov    (%rbx,%r13,8),%rdi
lea    0xe1d(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     128a <main+0x16a>
mov    (%rbx,%r13,8),%rdi
lea    0xe10(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1291 <main+0x171>
mov    (%rbx,%r13,8),%rsi
lea    0xe13(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
jmp    12ae <main+0x18e>
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x1,%edx
jmp    12a0 <main+0x180>
nopw   0x0(%rax,%rax,1)
mov    $0x2,%edx
jmp    12a0 <main+0x180>
mov    $0x3,%edx
jmp    12a0 <main+0x180>
mov    $0x4,%edx
jmp    12a0 <main+0x180>
mov    $0x5,%edx
jmp    12a0 <main+0x180>
mov    $0x6,%edx
jmp    12a0 <main+0x180>
mov    $0x7,%edx
jmp    12a0 <main+0x180>
mov    $0x8,%edx
jmp    12a0 <main+0x180>
mov    $0x9,%edx
cs nopw 0x0(%rax,%rax,1)
mov    (%rbx,%r13,8),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x1,%r13
cmp    %r13,%rbp
jne    1160 <main+0x40>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"Mercury\00"
@.str.1 = [6 x i8] c"Venus\00"
@.str.2 = [6 x i8] c"Earth\00"
@.str.3 = [5 x i8] c"Mars\00"
@.str.4 = [8 x i8] c"Jupiter\00"
@.str.5 = [7 x i8] c"Saturn\00"
@.str.6 = [7 x i8] c"Uranus\00"
@.str.7 = [8 x i8] c"Neptune\00"
@.str.8 = [6 x i8] c"Pluto\00"
@__const.main.planets = [9 x i8*] [i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i32 0, i32 0)]
@.str.9 = [18 x i8] c"%s is planet %d.\0A\00"
@.str.10 = [21 x i8] c"%s is not a planet.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [9 x i8*]
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = bitcast [9 x i8*]* %6 to i8*
store i32 1, i32* %7
br label %10
10: ; preds = %54, %2
%11 = load i32, i32* %7
%12 = load i32, i32* %4
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %57
14: ; preds = %10
store i32 0, i32* %8
br label %15
15: ; preds = %40, %14
%16 = load i32, i32* %8
%17 = icmp slt i32 %16, 9
br i1 %17, label %18, label %43
18: ; preds = %15
%19 = load i8**, i8*** %5
%20 = load i32, i32* %7
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i8*, i8** %19, i64 %21
%23 = load i8*, i8** %22
%24 = load i32, i32* %8
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [9 x i8*], [9 x i8*]* %6, i64 0, i64 %25
%27 = load i8*, i8** %26
%28 = call i64 @strcmp(i8* %23, i8* %27)
%29 = icmp eq i64 %28, 0
br i1 %29, label %30, label %39
30: ; preds = %18
%31 = load i8**, i8*** %5
%32 = load i32, i32* %7
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds i8*, i8** %31, i64 %33
%35 = load i8*, i8** %34
%36 = load i32, i32* %8
%37 = add nsw i32 %36, 1
%38 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i64 0, i64 0), i8* %35, i32 %37)
br label %43
39: ; preds = %18
br label %40
40: ; preds = %39
%41 = load i32, i32* %8
%42 = add nsw i32 %41, 1
store i32 %42, i32* %8
br label %15
43: ; preds = %30, %15
%44 = load i32, i32* %8
%45 = icmp eq i32 %44, 9
br i1 %45, label %46, label %53
46: ; preds = %43
%47 = load i8**, i8*** %5
%48 = load i32, i32* %7
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds i8*, i8** %47, i64 %49
%51 = load i8*, i8** %50
%52 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.10, i64 0, i64 0), i8* %51)
br label %53
53: ; preds = %46, %43
br label %54
54: ; preds = %53
%55 = load i32, i32* %7
%56 = add nsw i32 %55, 1
store i32 %56, i32* %7
br label %10
57: ; preds = %10
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"Mercury\00"
@.str.1 = [6 x i8] c"Venus\00"
@.str.2 = [6 x i8] c"Earth\00"
@.str.3 = [5 x i8] c"Mars\00"
@.str.4 = [8 x i8] c"Jupiter\00"
@.str.5 = [7 x i8] c"Saturn\00"
@.str.6 = [7 x i8] c"Uranus\00"
@.str.7 = [8 x i8] c"Neptune\00"
@.str.8 = [6 x i8] c"Pluto\00"
@.str.9 = [18 x i8] c"%s is planet %d.\0A\00"
@.str.10 = [21 x i8] c"%s is not a planet.\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %52
%7 = phi i64 [ 1, %4 ], [ %53, %52 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = tail call i64 @strcmp(i8* %9, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%11 = icmp eq i64 %10, 0
br i1 %11, label %13, label %17
12: ; preds = %52, %2
ret i32 0
13: ; preds = %45, %41, %37, %33, %29, %25, %21, %17, %6
%14 = phi i32 [ 1, %6 ], [ 2, %17 ], [ 3, %21 ], [ 4, %25 ], [ 5, %29 ], [ 6, %33 ], [ 7, %37 ], [ 8, %41 ], [ 9, %45 ]
%15 = load i8*, i8** %8
%16 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i64 0, i64 0), i8* %15, i32 %14)
br label %52
17: ; preds = %6
%18 = load i8*, i8** %8
%19 = tail call i64 @strcmp(i8* %18, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%20 = icmp eq i64 %19, 0
br i1 %20, label %13, label %21
21: ; preds = %17
%22 = load i8*, i8** %8
%23 = tail call i64 @strcmp(i8* %22, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%24 = icmp eq i64 %23, 0
br i1 %24, label %13, label %25
25: ; preds = %21
%26 = load i8*, i8** %8
%27 = tail call i64 @strcmp(i8* %26, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%28 = icmp eq i64 %27, 0
br i1 %28, label %13, label %29
29: ; preds = %25
%30 = load i8*, i8** %8
%31 = tail call i64 @strcmp(i8* %30, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0))
%32 = icmp eq i64 %31, 0
br i1 %32, label %13, label %33
33: ; preds = %29
%34 = load i8*, i8** %8
%35 = tail call i64 @strcmp(i8* %34, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
%36 = icmp eq i64 %35, 0
br i1 %36, label %13, label %37
37: ; preds = %33
%38 = load i8*, i8** %8
%39 = tail call i64 @strcmp(i8* %38, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
%40 = icmp eq i64 %39, 0
br i1 %40, label %13, label %41
41: ; preds = %37
%42 = load i8*, i8** %8
%43 = tail call i64 @strcmp(i8* %42, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0))
%44 = icmp eq i64 %43, 0
br i1 %44, label %13, label %45
45: ; preds = %41
%46 = load i8*, i8** %8
%47 = tail call i64 @strcmp(i8* %46, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
%48 = icmp eq i64 %47, 0
br i1 %48, label %13, label %49
49: ; preds = %45
%50 = load i8*, i8** %8
%51 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.10, i64 0, i64 0), i8* %50)
br label %52
52: ; preds = %13, %49
%53 = add nuw nsw i64 %7, 1
%54 = icmp eq i64 %53, %5
br i1 %54, label %12, label %6
}