#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 getchar();
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  int message[100];
  int i = 0;
  printf("Enter message: ");
  for (i = 0; (message[i] = getchar()) != '\n'; i += 1) {
    ;
  }
  message[i] = '\0';
  for (i = 0; message[i] != '\0'; i += 1) {
    if (message[i] > 96) {
      message[i] -= 32;
    }
    switch (message[i]) {
    case 65:
      message[i] = '4';
      break;
    case 66:
      message[i] = '8';
      break;
    case 69:
      message[i] = '3';
      break;
    case 73:
      message[i] = '1';
      break;
    case 79:
      message[i] = '0';
      break;
    case 83:
      message[i] = '5';
      break;
    default:
      continue;
    }
  }
  printf("In B1FF-speak: ");
  for (i = 0; message[i] != '\0'; i += 1) {
    printf("%c", message[i]);
  }
  printf("!!!!!!!!!!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1b0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x1a4(%rbp)
lea    0xf09(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x1a4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
movslq -0x1a4(%rbp),%rcx
mov    %eax,-0x1a0(%rbp,%rcx,4)
cmp    $0xa,%eax
je     118b <main+0x6b>
jmp    1177 <main+0x57>
mov    -0x1a4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1a4(%rbp)
jmp    1154 <main+0x34>
movslq -0x1a4(%rbp),%rax
movl   $0x0,-0x1a0(%rbp,%rax,4)
movl   $0x0,-0x1a4(%rbp)
movslq -0x1a4(%rbp),%rax
cmpl   $0x0,-0x1a0(%rbp,%rax,4)
je     12cb <main+0x1ab>
movslq -0x1a4(%rbp),%rax
cmpl   $0x60,-0x1a0(%rbp,%rax,4)
60
jle    11e9 <main+0xc9>
movslq -0x1a4(%rbp),%rax
mov    -0x1a0(%rbp,%rax,4),%ecx
sub    $0x20,%ecx
mov    %ecx,-0x1a0(%rbp,%rax,4)
movslq -0x1a4(%rbp),%rax
mov    -0x1a0(%rbp,%rax,4),%eax
add    $0xffffffbf,%eax
mov    %eax,%ecx
mov    %rcx,-0x1b0(%rbp)
sub    $0x12,%eax
ja     12ad <main+0x18d>
mov    -0x1b0(%rbp),%rax
lea    0xde6(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movslq -0x1a4(%rbp),%rax
movl   $0x34,-0x1a0(%rbp,%rax,4)
jmp    12b2 <main+0x192>
movslq -0x1a4(%rbp),%rax
movl   $0x38,-0x1a0(%rbp,%rax,4)
jmp    12b2 <main+0x192>
movslq -0x1a4(%rbp),%rax
movl   $0x33,-0x1a0(%rbp,%rax,4)
jmp    12b2 <main+0x192>
movslq -0x1a4(%rbp),%rax
movl   $0x31,-0x1a0(%rbp,%rax,4)
jmp    12b2 <main+0x192>
movslq -0x1a4(%rbp),%rax
movl   $0x30,-0x1a0(%rbp,%rax,4)
jmp    12b2 <main+0x192>
movslq -0x1a4(%rbp),%rax
movl   $0x35,-0x1a0(%rbp,%rax,4)
jmp    12b2 <main+0x192>
jmp    12b7 <main+0x197>
jmp    12b7 <main+0x197>
mov    -0x1a4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1a4(%rbp)
jmp    11a7 <main+0x87>
lea    0xd8a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x1a4(%rbp)
movslq -0x1a4(%rbp),%rax
cmpl   $0x0,-0x1a0(%rbp,%rax,4)
je     1328 <main+0x208>
movslq -0x1a4(%rbp),%rax
mov    -0x1a0(%rbp,%rax,4),%esi
lea    0xd5f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1a4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1a4(%rbp)
jmp    12e3 <main+0x1c3>
lea    0xd40(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x1b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x198,%rsp
lea    0xefc(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xffffffffffffffff,%rbx
xchg   %ax,%ax
xor    %eax,%eax
call   1060 <getchar@plt>
mov    %eax,0x4(%rsp,%rbx,4)
add    $0x1,%rbx
cmp    $0xa,%eax
jne    1160 <main+0x20>
mov    %ebx,%eax
movl   $0x0,(%rsp,%rax,4)
mov    (%rsp),%edx
test   %edx,%edx
je     1223 <main+0xe3>
mov    %rsp,%rax
lea    0xe6e(%rip),%rcx
jmp    11ad <main+0x6d>
mov    $0x35,%esi
nopl   0x0(%rax)
mov    %esi,(%rax)
mov    0x4(%rax),%edx
add    $0x4,%rax
test   %edx,%edx
je     11e9 <main+0xa9>
cmp    $0x61,%edx
jl     11b7 <main+0x77>
add    $0xffffffe0,%edx
mov    %edx,(%rax)
add    $0xffffffbf,%edx
cmp    $0x12,%edx
ja     11a2 <main+0x62>
mov    $0x34,%esi
movslq (%rcx,%rdx,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
mov    $0x38,%esi
jmp    11a0 <main+0x60>
mov    $0x33,%esi
jmp    11a0 <main+0x60>
mov    $0x31,%esi
jmp    11a0 <main+0x60>
mov    $0x30,%esi
jmp    11a0 <main+0x60>
mov    (%rsp),%ebp
lea    0xe69(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
test   %ebp,%ebp
je     1231 <main+0xf1>
lea    0x4(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebp,%edi
call   1030 <putchar@plt>
mov    (%rbx),%ebp
add    $0x4,%rbx
test   %ebp,%ebp
jne    1210 <main+0xd0>
jmp    1231 <main+0xf1>
lea    0xe32(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe34(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x198,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [16 x i8] c"Enter message: \00"
@.str.1 = [16 x i8] c"In B1FF-speak: \00"
@str = [11 x i8] c"!!!!!!!!!!\00"
define i32 @main() {
%1 = alloca [100 x i32]
%2 = bitcast [100 x i32]* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %4
4: ; preds = %4, %0
%5 = phi i64 [ %9, %4 ], [ 0, %0 ]
%6 = tail call i32 (...) @getchar()
%7 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 %5
store i32 %6, i32* %7
%8 = icmp eq i32 %6, 10
%9 = add nuw i64 %5, 1
br i1 %8, label %10, label %4
10: ; preds = %4
%11 = and i64 %5, 4294967295
%12 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 %11
store i32 0, i32* %12
%13 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 0
%14 = load i32, i32* %13
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %10
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
br label %51
18: ; preds = %10, %34
%19 = phi i64 [ %35, %34 ], [ 0, %10 ]
%20 = phi i32 [ %37, %34 ], [ %14, %10 ]
%21 = phi i32* [ %36, %34 ], [ %13, %10 ]
%22 = icmp sgt i32 %20, 96
br i1 %22, label %23, label %25
23: ; preds = %18
%24 = add nsw i32 %20, -32
store i32 %24, i32* %21
br label %25
25: ; preds = %23, %18
%26 = phi i32 [ %24, %23 ], [ %20, %18 ]
switch i32 %26, label %34 [
i32 65, label %32
i32 66, label %27
i32 69, label %28
i32 73, label %29
i32 79, label %30
i32 83, label %31
]
27: ; preds = %25
br label %32
28: ; preds = %25
br label %32
29: ; preds = %25
br label %32
30: ; preds = %25
br label %32
31: ; preds = %25
br label %32
32: ; preds = %25, %31, %30, %29, %28, %27
%33 = phi i32 [ 56, %27 ], [ 51, %28 ], [ 49, %29 ], [ 48, %30 ], [ 53, %31 ], [ 52, %25 ]
store i32 %33, i32* %21
br label %34
34: ; preds = %32, %25
%35 = add nuw i64 %19, 1
%36 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 %35
%37 = load i32, i32* %36
%38 = icmp eq i32 %37, 0
br i1 %38, label %39, label %18
39: ; preds = %34
%40 = load i32, i32* %13
%41 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%42 = icmp eq i32 %40, 0
br i1 %42, label %51, label %43
43: ; preds = %39, %43
%44 = phi i64 [ %47, %43 ], [ 0, %39 ]
%45 = phi i32 [ %49, %43 ], [ %40, %39 ]
%46 = tail call i32 @putchar(i32 %45)
%47 = add nuw i64 %44, 1
%48 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 %47
%49 = load i32, i32* %48
%50 = icmp eq i32 %49, 0
br i1 %50, label %51, label %43
51: ; preds = %43, %16, %39
%52 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret i32 0
}