#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*/ flushall();
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int strcmp(char *, char *);
main() {
  int i;
  char str1[6];
  char *str2[12] = {
      "john",  "mark", "april", "mary", "paul", "bill",
      "chris", "cian", "sarah", "jill", "ryan", "mike",
  };
  printf("Please enter your name:\n");
  scanf("%s", str1);
  flushall();
  int same = 1;
  int found = 1;
  for (i = 0; i < 12; i++) {
    same = strcmp(str1, *(str2 + i));
    *str2[i]++;
    if (same == 0) {
      printf("Hello there, %s!\n", str1);
      found = 0;
    }
  }
  if (found == 1) {
    printf("Name not found");
  }
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rdi
lea    0x2c43(%rip),%rsi
mov    $0x60,%edx
call   1070 <memcpy@plt>
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0xe(%rbp),%rsi
lea    0xeb8(%rip),%rdi
call   1080 <scanf@plt>
mov    $0x0,%al
call   1040 <flushall@plt>
movl   $0x1,-0x74(%rbp)
movl   $0x1,-0x78(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xc,-0x8(%rbp)
jge    1228 <main+0xc8>
lea    -0xe(%rbp),%rdi
movslq -0x8(%rbp),%rax
mov    -0x70(%rbp,%rax,8),%rsi
call   1050 <strcmp@plt>
mov    %eax,-0x74(%rbp)
movslq -0x8(%rbp),%rax
mov    -0x70(%rbp,%rax,8),%rcx
add    $0x1,%rcx
mov    %rcx,-0x70(%rbp,%rax,8)
cmpl   $0x0,-0x74(%rbp)
jne    1215 <main+0xb5>
lea    -0xe(%rbp),%rsi
lea    0xe54(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x78(%rbp)
jmp    121a <main+0xba>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11c1 <main+0x61>
cmpl   $0x1,-0x78(%rbp)
jne    1240 <main+0xe0>
lea    0xe34(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1060 <getchar@plt>
mov    -0x4(%rbp),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xf07(%rip),%rdi
call   1030 <puts@plt>
lea    0xed7(%rip),%rdi
lea    0xa(%rsp),%rsi
call   1070 <scanf@plt>
xor    %eax,%eax
call   1050 <flushall@plt>
mov    $0x6e686f6a,%eax
xor    0xa(%rsp),%eax
movzbl 0xe(%rsp),%ecx
or     %eax,%ecx
mov    $0x1,%ebx
jne    11a5 <main+0x55>
lea    0xeab(%rip),%rdi
lea    0xa(%rsp),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %ebx,%ebx
mov    $0x6b72616d,%eax
xor    0xa(%rsp),%eax
movzbl 0xe(%rsp),%ecx
or     %eax,%ecx
jne    11cc <main+0x7c>
lea    0xe84(%rip),%rdi
xor    %ebx,%ebx
lea    0xa(%rsp),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x69727061,%eax
xor    0xa(%rsp),%eax
movzwl 0xe(%rsp),%ecx
xor    $0x6c,%ecx
or     %eax,%ecx
jne    11f6 <main+0xa6>
lea    0xe5a(%rip),%rdi
xor    %ebx,%ebx
lea    0xa(%rsp),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x7972616d,%eax
xor    0xa(%rsp),%eax
movzbl 0xe(%rsp),%ecx
or     %eax,%ecx
jne    121d <main+0xcd>
lea    0xe33(%rip),%rdi
xor    %ebx,%ebx
lea    0xa(%rsp),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x6c756170,%eax
xor    0xa(%rsp),%eax
movzbl 0xe(%rsp),%ecx
or     %eax,%ecx
jne    1244 <main+0xf4>
lea    0xe0c(%rip),%rdi
xor    %ebx,%ebx
lea    0xa(%rsp),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x6c6c6962,%eax
xor    0xa(%rsp),%eax
movzbl 0xe(%rsp),%ecx
or     %eax,%ecx
jne    126b <main+0x11b>
lea    0xde5(%rip),%rdi
xor    %ebx,%ebx
lea    0xa(%rsp),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x69726863,%eax
xor    0xa(%rsp),%eax
movzwl 0xe(%rsp),%ecx
xor    $0x73,%ecx
or     %eax,%ecx
jne    1295 <main+0x145>
lea    0xdbb(%rip),%rdi
xor    %ebx,%ebx
lea    0xa(%rsp),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x6e616963,%eax
xor    0xa(%rsp),%eax
movzbl 0xe(%rsp),%ecx
or     %eax,%ecx
jne    12bc <main+0x16c>
lea    0xd94(%rip),%rdi
xor    %ebx,%ebx
lea    0xa(%rsp),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x61726173,%eax
xor    0xa(%rsp),%eax
movzwl 0xe(%rsp),%ecx
xor    $0x68,%ecx
or     %eax,%ecx
jne    12e6 <main+0x196>
lea    0xd6a(%rip),%rdi
xor    %ebx,%ebx
lea    0xa(%rsp),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x6c6c696a,%eax
xor    0xa(%rsp),%eax
movzbl 0xe(%rsp),%ecx
or     %eax,%ecx
jne    130d <main+0x1bd>
lea    0xd43(%rip),%rdi
xor    %ebx,%ebx
lea    0xa(%rsp),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x6e617972,%eax
xor    0xa(%rsp),%eax
movzbl 0xe(%rsp),%ecx
or     %eax,%ecx
jne    1334 <main+0x1e4>
lea    0xd1c(%rip),%rdi
xor    %ebx,%ebx
lea    0xa(%rsp),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x656b696d,%eax
xor    0xa(%rsp),%eax
movzbl 0xe(%rsp),%ecx
or     %eax,%ecx
je     135a <main+0x20a>
test   %ebx,%ebx
je     136d <main+0x21d>
lea    0xd03(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    136d <main+0x21d>
lea    0xce1(%rip),%rdi
lea    0xa(%rsp),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"john\00"
@.str.1 = [5 x i8] c"mark\00"
@.str.2 = [6 x i8] c"april\00"
@.str.3 = [5 x i8] c"mary\00"
@.str.4 = [5 x i8] c"paul\00"
@.str.5 = [5 x i8] c"bill\00"
@.str.6 = [6 x i8] c"chris\00"
@.str.7 = [5 x i8] c"cian\00"
@.str.8 = [6 x i8] c"sarah\00"
@.str.9 = [5 x i8] c"jill\00"
@.str.10 = [5 x i8] c"ryan\00"
@.str.11 = [5 x i8] c"mike\00"
@__const.main.str2 = [12 x i8*] [i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 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 ([5 x i8], [5 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i32 0, i32 0)]
@.str.12 = [25 x i8] c"Please enter your name:\0A\00"
@.str.13 = [3 x i8] c"%s\00"
@.str.14 = [18 x i8] c"Hello there, %s!\0A\00"
@.str.15 = [15 x i8] c"Name not found\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [6 x i8]
%4 = alloca [12 x i8*]
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
%7 = bitcast [12 x i8*]* %4 to i8*
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.12, i64 0, i64 0))
%9 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0), i8* %9)
%11 = call i32 (...) @flushall()
store i32 1, i32* %5
store i32 1, i32* %6
store i32 0, i32* %2
br label %12
12: ; preds = %35, %0
%13 = load i32, i32* %2
%14 = icmp slt i32 %13, 12
br i1 %14, label %15, label %38
15: ; preds = %12
%16 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
%17 = getelementptr inbounds [12 x i8*], [12 x i8*]* %4, i64 0, i64 0
%18 = load i32, i32* %2
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8*, i8** %17, i64 %19
%21 = load i8*, i8** %20
%22 = call i32 @strcmp(i8* %16, i8* %21)
store i32 %22, i32* %5
%23 = load i32, i32* %2
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [12 x i8*], [12 x i8*]* %4, i64 0, i64 %24
%26 = load i8*, i8** %25
%27 = getelementptr inbounds i8, i8* %26, i32 1
store i8* %27, i8** %25
%28 = load i8, i8* %26
%29 = load i32, i32* %5
%30 = icmp eq i32 %29, 0
br i1 %30, label %31, label %34
31: ; preds = %15
%32 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.14, i64 0, i64 0), i8* %32)
store i32 0, i32* %6
br label %34
34: ; preds = %31, %15
br label %35
35: ; preds = %34
%36 = load i32, i32* %2
%37 = add nsw i32 %36, 1
store i32 %37, i32* %2
br label %12
38: ; preds = %12
%39 = load i32, i32* %6
%40 = icmp eq i32 %39, 1
br i1 %40, label %41, label %43
41: ; preds = %38
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.15, i64 0, i64 0))
br label %43
43: ; preds = %41, %38
%44 = call i32 (...) @getchar()
%45 = load i32, i32* %1
ret i32 %45
}

LLVM IR (-O2):
@.str = [5 x i8] c"john\00"
@.str.1 = [5 x i8] c"mark\00"
@.str.2 = [6 x i8] c"april\00"
@.str.3 = [5 x i8] c"mary\00"
@.str.4 = [5 x i8] c"paul\00"
@.str.5 = [5 x i8] c"bill\00"
@.str.6 = [6 x i8] c"chris\00"
@.str.7 = [5 x i8] c"cian\00"
@.str.8 = [6 x i8] c"sarah\00"
@.str.9 = [5 x i8] c"jill\00"
@.str.10 = [5 x i8] c"ryan\00"
@.str.11 = [5 x i8] c"mike\00"
@.str.13 = [3 x i8] c"%s\00"
@.str.14 = [18 x i8] c"Hello there, %s!\0A\00"
@.str.15 = [15 x i8] c"Name not found\00"
@str = [24 x i8] c"Please enter your name:\00"
define i32 @main() {
%1 = alloca [6 x i8]
%2 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0), i8* %2)
%5 = call i32 (...) @flushall()
%6 = call i32 @bcmp(i8* dereferenceable(5) %2, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 5)
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.14, i64 0, i64 0), i8* %2)
br label %10
10: ; preds = %0, %8
%11 = phi i32 [ 0, %8 ], [ 1, %0 ]
%12 = call i32 @bcmp(i8* dereferenceable(5) %2, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 5)
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %10
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.14, i64 0, i64 0), i8* %2)
br label %16
16: ; preds = %14, %10
%17 = phi i32 [ 0, %14 ], [ %11, %10 ]
%18 = call i32 @bcmp(i8* dereferenceable(6) %2, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i64 6)
%19 = icmp eq i32 %18, 0
br i1 %19, label %20, label %22
20: ; preds = %16
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.14, i64 0, i64 0), i8* %2)
br label %22
22: ; preds = %20, %16
%23 = phi i32 [ 0, %20 ], [ %17, %16 ]
%24 = call i32 @bcmp(i8* dereferenceable(5) %2, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i64 5)
%25 = icmp eq i32 %24, 0
br i1 %25, label %26, label %28
26: ; preds = %22
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.14, i64 0, i64 0), i8* %2)
br label %28
28: ; preds = %26, %22
%29 = phi i32 [ 0, %26 ], [ %23, %22 ]
%30 = call i32 @bcmp(i8* dereferenceable(5) %2, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i64 5)
%31 = icmp eq i32 %30, 0
br i1 %31, label %32, label %34
32: ; preds = %28
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.14, i64 0, i64 0), i8* %2)
br label %34
34: ; preds = %32, %28
%35 = phi i32 [ 0, %32 ], [ %29, %28 ]
%36 = call i32 @bcmp(i8* dereferenceable(5) %2, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i64 5)
%37 = icmp eq i32 %36, 0
br i1 %37, label %38, label %40
38: ; preds = %34
%39 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.14, i64 0, i64 0), i8* %2)
br label %40
40: ; preds = %38, %34
%41 = phi i32 [ 0, %38 ], [ %35, %34 ]
%42 = call i32 @bcmp(i8* dereferenceable(6) %2, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), i64 6)
%43 = icmp eq i32 %42, 0
br i1 %43, label %44, label %46
44: ; preds = %40
%45 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.14, i64 0, i64 0), i8* %2)
br label %46
46: ; preds = %44, %40
%47 = phi i32 [ 0, %44 ], [ %41, %40 ]
%48 = call i32 @bcmp(i8* dereferenceable(5) %2, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i64 5)
%49 = icmp eq i32 %48, 0
br i1 %49, label %50, label %52
50: ; preds = %46
%51 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.14, i64 0, i64 0), i8* %2)
br label %52
52: ; preds = %50, %46
%53 = phi i32 [ 0, %50 ], [ %47, %46 ]
%54 = call i32 @bcmp(i8* dereferenceable(6) %2, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0), i64 6)
%55 = icmp eq i32 %54, 0
br i1 %55, label %56, label %58
56: ; preds = %52
%57 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.14, i64 0, i64 0), i8* %2)
br label %58
58: ; preds = %56, %52
%59 = phi i32 [ 0, %56 ], [ %53, %52 ]
%60 = call i32 @bcmp(i8* dereferenceable(5) %2, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0), i64 5)
%61 = icmp eq i32 %60, 0
br i1 %61, label %62, label %64
62: ; preds = %58
%63 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.14, i64 0, i64 0), i8* %2)
br label %64
64: ; preds = %62, %58
%65 = phi i32 [ 0, %62 ], [ %59, %58 ]
%66 = call i32 @bcmp(i8* dereferenceable(5) %2, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), i64 5)
%67 = icmp eq i32 %66, 0
br i1 %67, label %68, label %70
68: ; preds = %64
%69 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.14, i64 0, i64 0), i8* %2)
br label %70
70: ; preds = %68, %64
%71 = phi i32 [ 0, %68 ], [ %65, %64 ]
%72 = call i32 @bcmp(i8* dereferenceable(5) %2, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0), i64 5)
%73 = icmp eq i32 %72, 0
br i1 %73, label %74, label %76
74: ; preds = %70
%75 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.14, i64 0, i64 0), i8* %2)
br label %80
76: ; preds = %70
%77 = icmp eq i32 %71, 1
br i1 %77, label %78, label %80
78: ; preds = %76
%79 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.15, i64 0, i64 0))
br label %80
80: ; preds = %74, %78, %76
%81 = call i32 (...) @getchar()
ret i32 0
}