#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*/ scanf(char *, char *);
int main(int argc, char *argv[]) {
  char letters[20];
  int i = 0;
  char letter;
  printf("Enter a word\n");
  scanf("%s", letters);
  for (i = 0; i < 20; i++) {
    letter = letters[i];
    if (letter == 'a') {
      printf(".- ");
    }
    if (letter == 'b') {
      printf("-... ");
    }
    if (letter == 'e') {
      printf(". ");
    }
    if (letter == 'k') {
      printf("-.- ");
    }
    if (letter == 'm') {
      printf("-- ");
    }
    if (letter == 'o') {
      printf("--- ");
    }
    if (letter == 'r') {
      printf(".-. ");
    }
    if (letter == 's') {
      printf("... ");
    }
    if (letter == 'z') {
      printf("--.. ");
    }
    if (letters[i] == '\0') {
      printf("Finish");
      break;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x34(%rbp)
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
lea    -0x30(%rbp),%rsi
lea    0xeba(%rip),%rdi
call   1040 <scanf@plt>
movl   $0x0,-0x34(%rbp)
cmpl   $0x14,-0x34(%rbp)
jge    128c <main+0x16c>
movslq -0x34(%rbp),%rax
mov    -0x30(%rbp,%rax,1),%al
mov    %al,-0x35(%rbp)
movsbl -0x35(%rbp),%eax
cmp    $0x61,%eax
jne    118e <main+0x6e>
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
movsbl -0x35(%rbp),%eax
cmp    $0x62,%eax
jne    11a7 <main+0x87>
lea    0xe6f(%rip),%rdi
call   1030 <printf@plt>
movsbl -0x35(%rbp),%eax
cmp    $0x65,%eax
jne    11c0 <main+0xa0>
lea    0xe68(%rip),%rdi
call   1030 <printf@plt>
movsbl -0x35(%rbp),%eax
cmp    $0x6b,%eax
jne    11d9 <main+0xb9>
lea    0xe43(%rip),%rdi
call   1030 <printf@plt>
movsbl -0x35(%rbp),%eax
cmp    $0x6d,%eax
jne    11f2 <main+0xd2>
lea    0xe30(%rip),%rdi
call   1030 <printf@plt>
movsbl -0x35(%rbp),%eax
cmp    $0x6f,%eax
jne    120b <main+0xeb>
lea    0xe16(%rip),%rdi
call   1030 <printf@plt>
movsbl -0x35(%rbp),%eax
cmp    $0x72,%eax
jne    1224 <main+0x104>
lea    0xe02(%rip),%rdi
call   1030 <printf@plt>
movsbl -0x35(%rbp),%eax
cmp    $0x73,%eax
jne    123d <main+0x11d>
lea    0xdda(%rip),%rdi
call   1030 <printf@plt>
movsbl -0x35(%rbp),%eax
cmp    $0x7a,%eax
jne    1256 <main+0x136>
lea    0xdd5(%rip),%rdi
call   1030 <printf@plt>
movslq -0x34(%rbp),%rax
movsbl -0x30(%rbp,%rax,1),%eax
cmp    $0x0,%eax
jne    1279 <main+0x159>
lea    0xdbd(%rip),%rdi
call   1030 <printf@plt>
jmp    128c <main+0x16c>
jmp    127e <main+0x15e>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1160 <main+0x40>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xf48(%rip),%rdi
call   1030 <puts@plt>
lea    0xf17(%rip),%rdi
mov    %rsp,%rsi
call   1050 <scanf@plt>
xor    %ebx,%ebx
lea    0xf10(%rip),%r14
lea    0xe97(%rip),%r15
lea    0xf0b(%rip),%rbp
lea    0xef5(%rip),%r12
lea    0xf02(%rip),%r13
xchg   %ax,%ax
movzbl (%rsp,%rbx,1),%eax
lea    -0x61(%rax),%ecx
cmp    $0x19,%cl
ja     11e9 <main+0xb9>
movzbl %cl,%ecx
movslq (%r15,%rcx,4),%rcx
add    %r15,%rcx
mov    %r14,%rdi
jmp    *%rcx
lea    0xec9(%rip),%rdi
jmp    11e0 <main+0xb0>
lea    0xed2(%rip),%rdi
jmp    11e0 <main+0xb0>
lea    0xebd(%rip),%rdi
jmp    11e0 <main+0xb0>
lea    0xeba(%rip),%rdi
jmp    11e0 <main+0xb0>
lea    0xeb0(%rip),%rdi
jmp    11e0 <main+0xb0>
mov    %rbp,%rdi
jmp    11e0 <main+0xb0>
mov    %r12,%rdi
jmp    11e0 <main+0xb0>
mov    %r13,%rdi
cs nopw 0x0(%rax,%rax,1)
nop
call   1040 <printf@plt>
movzbl (%rsp,%rbx,1),%eax
test   %al,%al
je     11f9 <main+0xc9>
add    $0x1,%rbx
cmp    $0x14,%rbx
jne    1180 <main+0x50>
jmp    1205 <main+0xd5>
lea    0xe86(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Enter a word\0A\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [4 x i8] c".- \00"
@.str.3 = [6 x i8] c"-... \00"
@.str.4 = [3 x i8] c". \00"
@.str.5 = [5 x i8] c"-.- \00"
@.str.6 = [4 x i8] c"-- \00"
@.str.7 = [5 x i8] c"--- \00"
@.str.8 = [5 x i8] c".-. \00"
@.str.9 = [5 x i8] c"... \00"
@.str.10 = [6 x i8] c"--.. \00"
@.str.11 = [7 x i8] c"Finish\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [20 x i8]
%7 = alloca i32
%8 = alloca i8
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %7
%9 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%10 = getelementptr inbounds [20 x i8], [20 x i8]* %6, i64 0, i64 0
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %10)
store i32 0, i32* %7
br label %12
12: ; preds = %83, %2
%13 = load i32, i32* %7
%14 = icmp slt i32 %13, 20
br i1 %14, label %15, label %86
15: ; preds = %12
%16 = load i32, i32* %7
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [20 x i8], [20 x i8]* %6, i64 0, i64 %17
%19 = load i8, i8* %18
store i8 %19, i8* %8
%20 = load i8, i8* %8
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 97
br i1 %22, label %23, label %25
23: ; preds = %15
%24 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
br label %25
25: ; preds = %23, %15
%26 = load i8, i8* %8
%27 = sext i8 %26 to i32
%28 = icmp eq i32 %27, 98
br i1 %28, label %29, label %31
29: ; preds = %25
%30 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
br label %31
31: ; preds = %29, %25
%32 = load i8, i8* %8
%33 = sext i8 %32 to i32
%34 = icmp eq i32 %33, 101
br i1 %34, label %35, label %37
35: ; preds = %31
%36 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
br label %37
37: ; preds = %35, %31
%38 = load i8, i8* %8
%39 = sext i8 %38 to i32
%40 = icmp eq i32 %39, 107
br i1 %40, label %41, label %43
41: ; preds = %37
%42 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
br label %43
43: ; preds = %41, %37
%44 = load i8, i8* %8
%45 = sext i8 %44 to i32
%46 = icmp eq i32 %45, 109
br i1 %46, label %47, label %49
47: ; preds = %43
%48 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
br label %49
49: ; preds = %47, %43
%50 = load i8, i8* %8
%51 = sext i8 %50 to i32
%52 = icmp eq i32 %51, 111
br i1 %52, label %53, label %55
53: ; preds = %49
%54 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
br label %55
55: ; preds = %53, %49
%56 = load i8, i8* %8
%57 = sext i8 %56 to i32
%58 = icmp eq i32 %57, 114
br i1 %58, label %59, label %61
59: ; preds = %55
%60 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
br label %61
61: ; preds = %59, %55
%62 = load i8, i8* %8
%63 = sext i8 %62 to i32
%64 = icmp eq i32 %63, 115
br i1 %64, label %65, label %67
65: ; preds = %61
%66 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
br label %67
67: ; preds = %65, %61
%68 = load i8, i8* %8
%69 = sext i8 %68 to i32
%70 = icmp eq i32 %69, 122
br i1 %70, label %71, label %73
71: ; preds = %67
%72 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0))
br label %73
73: ; preds = %71, %67
%74 = load i32, i32* %7
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds [20 x i8], [20 x i8]* %6, i64 0, i64 %75
%77 = load i8, i8* %76
%78 = sext i8 %77 to i32
%79 = icmp eq i32 %78, 0
br i1 %79, label %80, label %82
80: ; preds = %73
%81 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0))
br label %86
82: ; preds = %73
br label %83
83: ; preds = %82
%84 = load i32, i32* %7
%85 = add nsw i32 %84, 1
store i32 %85, i32* %7
br label %12
86: ; preds = %80, %12
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [4 x i8] c".- \00"
@.str.3 = [6 x i8] c"-... \00"
@.str.4 = [3 x i8] c". \00"
@.str.5 = [5 x i8] c"-.- \00"
@.str.6 = [4 x i8] c"-- \00"
@.str.7 = [5 x i8] c"--- \00"
@.str.8 = [5 x i8] c".-. \00"
@.str.9 = [5 x i8] c"... \00"
@.str.10 = [6 x i8] c"--.. \00"
@.str.11 = [7 x i8] c"Finish\00"
@str = [13 x i8] c"Enter a word\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [20 x i8]
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
br label %10
7: ; preds = %26
%8 = add nuw nsw i64 %11, 1
%9 = icmp eq i64 %8, 20
br i1 %9, label %31, label %10
10: ; preds = %2, %7
%11 = phi i64 [ 0, %2 ], [ %8, %7 ]
%12 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 %11
%13 = load i8, i8* %12
switch i8 %13, label %26 [
i8 97, label %22
i8 98, label %14
i8 101, label %15
i8 107, label %16
i8 109, label %17
i8 111, label %18
i8 114, label %19
i8 115, label %20
i8 122, label %21
]
14: ; preds = %10
br label %22
15: ; preds = %10
br label %22
16: ; preds = %10
br label %22
17: ; preds = %10
br label %22
18: ; preds = %10
br label %22
19: ; preds = %10
br label %22
20: ; preds = %10
br label %22
21: ; preds = %10
br label %22
22: ; preds = %10, %21, %14, %15, %16, %17, %18, %19, %20
%23 = phi i8* [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0), %21 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), %14 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), %15 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), %16 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), %17 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), %18 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), %19 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0), %20 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), %10 ]
%24 = call i32 @printf(i8* dereferenceable(1) %23)
%25 = load i8, i8* %12
br label %26
26: ; preds = %22, %10
%27 = phi i8 [ %25, %22 ], [ %13, %10 ]
%28 = icmp eq i8 %27, 0
br i1 %28, label %29, label %7
29: ; preds = %26
%30 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0))
br label %31
31: ; preds = %7, %29
ret i32 0
}