#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*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int printPrompt();
int /*<<< orphan*/ readfile(char const *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ transformer();
int main(int argc, const char *argv[]) {
  while (1) {
    switch (printPrompt()) {
    case '1':
      transformer();
      break;
    case '2':
      readfile(argv[1]);
      break;
    case '3':
      exit(EXIT_SUCCESS);
    default:
      fprintf(stderr, "\nInvalid input! Please enter again.\n");
      break;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
call   1030 <printPrompt@plt>
mov    %eax,%ecx
mov    %ecx,-0x14(%rbp)
sub    $0x31,%eax
je     11a2 <main+0x52>
jmp    1180 <main+0x30>
mov    -0x14(%rbp),%eax
sub    $0x32,%eax
je     11ae <main+0x5e>
jmp    1191 <main+0x41>
mov    -0x14(%rbp),%eax
sub    $0x33,%eax
je     11c0 <main+0x70>
jmp    11ce <main+0x7e>
mov    $0x0,%al
call   1050 <transformer@plt>
jmp    11e3 <main+0x93>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1070 <readfile@plt>
jmp    11e3 <main+0x93>
mov    0x2e11(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>
mov    0x2e0b(%rip),%rax
mov    (%rax),%edi
lea    0xe22(%rip),%rsi
call   1040 <fprintf@plt>
jmp    1166 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    0x2e81(%rip),%r15
lea    0xe9a(%rip),%r14
jmp    1179 <main+0x29>
nopl   0x0(%rax,%rax,1)
mov    0x8(%rbx),%rdi
call   1070 <readfile@plt>
xor    %eax,%eax
call   1030 <printPrompt@plt>
cmp    $0x31,%eax
je     11a0 <main+0x50>
cmp    $0x32,%eax
je     1170 <main+0x20>
cmp    $0x33,%eax
je     11a9 <main+0x59>
mov    (%r15),%edi
mov    %r14,%rsi
call   1040 <fprintf@plt>
jmp    1179 <main+0x29>
nopl   0x0(%rax)
xor    %eax,%eax
call   1050 <transformer@plt>
jmp    1179 <main+0x29>
mov    0x2e28(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
@stderr = global i32 0
@.str = [37 x i8] c"\0AInvalid input! Please enter again.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %6
6: ; preds = %2, %21
%7 = call i32 (...) @printPrompt()
switch i32 %7, label %18 [
i32 49, label %8
i32 50, label %10
i32 51, label %15
]
8: ; preds = %6
%9 = call i32 (...) @transformer()
br label %21
10: ; preds = %6
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @readfile(i8* %13)
br label %21
15: ; preds = %6
%16 = load i32, i32* @EXIT_SUCCESS
%17 = call i32 @exit(i32 %16)
unreachable
18: ; preds = %6
%19 = load i32, i32* @stderr
%20 = call i32 @fprintf(i32 %19, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
br label %21
21: ; preds = %18, %10, %8
br label %6
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@stderr = global i32 0
@.str = [37 x i8] c"\0AInvalid input! Please enter again.\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
br label %4
4: ; preds = %17, %2
%5 = tail call i32 (...) @printPrompt()
switch i32 %5, label %14 [
i32 49, label %6
i32 50, label %8
i32 51, label %11
]
6: ; preds = %4
%7 = tail call i32 (...) @transformer()
br label %17
8: ; preds = %4
%9 = load i8*, i8** %3
%10 = tail call i32 @readfile(i8* %9)
br label %17
11: ; preds = %4
%12 = load i32, i32* @EXIT_SUCCESS
%13 = tail call i32 @exit(i32 %12)
unreachable
14: ; preds = %4
%15 = load i32, i32* @stderr
%16 = tail call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
br label %17
17: ; preds = %14, %8, %6
br label %4
}