#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[] = {"Mecury", "Vernus", "Earth",   "Mars", "Jupiter",
                     "Saturn", "Uranus", "Neptune", "Pluto"};
  int i, j;
  for (i = 1; i < argc; i++) {
    for (j = 0; j < 9; j++)
      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    0xe56(%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    0xeb3(%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    0xe12(%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 = [7 x i8] c"Mecury\00"
@.str.1 = [7 x i8] c"Vernus\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 ([7 x i8], [7 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 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 = [17 x i8] c"%s is planet %d\0A\00"
@.str.10 = [20 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 ([17 x i8], [17 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 ([20 x i8], [20 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 = [7 x i8] c"Mecury\00"
@.str.1 = [7 x i8] c"Vernus\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 = [17 x i8] c"%s is planet %d\0A\00"
@.str.10 = [20 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 %54
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %51
%7 = phi i64 [ 1, %4 ], [ %52, %51 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = tail call i64 @strcmp(i8* %9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %16
12: ; preds = %44, %40, %36, %32, %28, %24, %20, %16, %6
%13 = phi i32 [ 1, %6 ], [ 2, %16 ], [ 3, %20 ], [ 4, %24 ], [ 5, %28 ], [ 6, %32 ], [ 7, %36 ], [ 8, %40 ], [ 9, %44 ]
%14 = load i8*, i8** %8
%15 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.9, i64 0, i64 0), i8* %14, i32 %13)
br label %51
16: ; preds = %6
%17 = load i8*, i8** %8
%18 = tail call i64 @strcmp(i8* %17, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%19 = icmp eq i64 %18, 0
br i1 %19, label %12, label %20
20: ; preds = %16
%21 = load i8*, i8** %8
%22 = tail call i64 @strcmp(i8* %21, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%23 = icmp eq i64 %22, 0
br i1 %23, label %12, label %24
24: ; preds = %20
%25 = load i8*, i8** %8
%26 = tail call i64 @strcmp(i8* %25, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%27 = icmp eq i64 %26, 0
br i1 %27, label %12, label %28
28: ; preds = %24
%29 = load i8*, i8** %8
%30 = tail call i64 @strcmp(i8* %29, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0))
%31 = icmp eq i64 %30, 0
br i1 %31, label %12, label %32
32: ; preds = %28
%33 = load i8*, i8** %8
%34 = tail call i64 @strcmp(i8* %33, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
%35 = icmp eq i64 %34, 0
br i1 %35, label %12, label %36
36: ; preds = %32
%37 = load i8*, i8** %8
%38 = tail call i64 @strcmp(i8* %37, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
%39 = icmp eq i64 %38, 0
br i1 %39, label %12, label %40
40: ; preds = %36
%41 = load i8*, i8** %8
%42 = tail call i64 @strcmp(i8* %41, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0))
%43 = icmp eq i64 %42, 0
br i1 %43, label %12, label %44
44: ; preds = %40
%45 = load i8*, i8** %8
%46 = tail call i64 @strcmp(i8* %45, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
%47 = icmp eq i64 %46, 0
br i1 %47, label %12, label %48
48: ; preds = %44
%49 = load i8*, i8** %8
%50 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.10, i64 0, i64 0), i8* %49)
br label %51
51: ; preds = %12, %48
%52 = add nuw nsw i64 %7, 1
%53 = icmp eq i64 %52, %5
br i1 %53, label %54, label %6
54: ; preds = %51, %2
ret i32 0
}