#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__ strcasecmp(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 (strcasecmp(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   1030 <strcasecmp@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   1040 <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   1040 <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     129a <main+0x17a>
mov    %rsi,%rbx
mov    %edi,%r13d
mov    $0x1,%r12d
lea    0xeb9(%rip),%r14
lea    0xeef(%rip),%r15
xchg   %ax,%ax
mov    (%rbx,%r12,8),%rbp
mov    %rbp,%rdi
mov    %r14,%rsi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     1230 <main+0x110>
mov    %rbp,%rdi
lea    0xe96(%rip),%rsi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     1240 <main+0x120>
mov    %rbp,%rdi
lea    0xe84(%rip),%rsi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     1247 <main+0x127>
mov    %rbp,%rdi
lea    0xe72(%rip),%rsi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     124e <main+0x12e>
mov    %rbp,%rdi
lea    0xe5f(%rip),%rsi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     1255 <main+0x135>
mov    %rbp,%rdi
lea    0xe4f(%rip),%rsi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     125c <main+0x13c>
mov    %rbp,%rdi
lea    0xe3e(%rip),%rsi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     1263 <main+0x143>
mov    %rbp,%rdi
lea    0xe31(%rip),%rsi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     126a <main+0x14a>
mov    %rbp,%rdi
lea    0xe25(%rip),%rsi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     1271 <main+0x151>
lea    0xe2c(%rip),%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    128d <main+0x16d>
nop
mov    $0x1,%edx
jmp    1280 <main+0x160>
nopw   0x0(%rax,%rax,1)
mov    $0x2,%edx
jmp    1280 <main+0x160>
mov    $0x3,%edx
jmp    1280 <main+0x160>
mov    $0x4,%edx
jmp    1280 <main+0x160>
mov    $0x5,%edx
jmp    1280 <main+0x160>
mov    $0x6,%edx
jmp    1280 <main+0x160>
mov    $0x7,%edx
jmp    1280 <main+0x160>
mov    $0x8,%edx
jmp    1280 <main+0x160>
mov    $0x9,%edx
cs nopw 0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%r12
cmp    %r12,%r13
jne    1150 <main+0x30>
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 @strcasecmp(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, %42
%7 = phi i64 [ 1, %4 ], [ %43, %42 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = tail call i64 @strcasecmp(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 %16
12: ; preds = %42, %2
ret i32 0
13: ; preds = %37, %34, %31, %28, %25, %22, %19, %16, %6
%14 = phi i32 [ 1, %6 ], [ 2, %16 ], [ 3, %19 ], [ 4, %22 ], [ 5, %25 ], [ 6, %28 ], [ 7, %31 ], [ 8, %34 ], [ 9, %37 ]
%15 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i64 0, i64 0), i8* %9, i32 %14)
br label %42
16: ; preds = %6
%17 = tail call i64 @strcasecmp(i8* %9, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%18 = icmp eq i64 %17, 0
br i1 %18, label %13, label %19
19: ; preds = %16
%20 = tail call i64 @strcasecmp(i8* %9, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%21 = icmp eq i64 %20, 0
br i1 %21, label %13, label %22
22: ; preds = %19
%23 = tail call i64 @strcasecmp(i8* %9, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%24 = icmp eq i64 %23, 0
br i1 %24, label %13, label %25
25: ; preds = %22
%26 = tail call i64 @strcasecmp(i8* %9, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0))
%27 = icmp eq i64 %26, 0
br i1 %27, label %13, label %28
28: ; preds = %25
%29 = tail call i64 @strcasecmp(i8* %9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
%30 = icmp eq i64 %29, 0
br i1 %30, label %13, label %31
31: ; preds = %28
%32 = tail call i64 @strcasecmp(i8* %9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
%33 = icmp eq i64 %32, 0
br i1 %33, label %13, label %34
34: ; preds = %31
%35 = tail call i64 @strcasecmp(i8* %9, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0))
%36 = icmp eq i64 %35, 0
br i1 %36, label %13, label %37
37: ; preds = %34
%38 = tail call i64 @strcasecmp(i8* %9, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
%39 = icmp eq i64 %38, 0
br i1 %39, label %13, label %40
40: ; preds = %37
%41 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.10, i64 0, i64 0), i8* %9)
br label %42
42: ; preds = %13, %40
%43 = add nuw nsw i64 %7, 1
%44 = icmp eq i64 %43, %5
br i1 %44, label %12, label %6
}