#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*/ displayMain();
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ handleVector();
int /*<<< orphan*/ printf(char *);
char *readFromStdin(int);
scalar_t__ strcmp(char *, char *);
int main(void) {
  bool run = true;
  while (run) {
    displayMain();
    char *ch = readFromStdin(1);
    if (strcmp(ch, "V") == 0) {
      handleVector();
    } else if (strcmp(ch, "X") == 0) {
      printf("\nexiting...\n");
      run = false;
    } else {
      printf("\that's not something I know about\n");
    }
    free(ch);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     120c <main+0xac>
mov    $0x0,%al
call   1070 <displayMain@plt>
mov    $0x1,%edi
call   1080 <readFromStdin@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe60(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    11bb <main+0x5b>
mov    $0x0,%al
call   1060 <handleVector@plt>
jmp    11fe <main+0x9e>
mov    -0x10(%rbp),%rdi
lea    0xe3c(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    11ed <main+0x8d>
lea    0xe28(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x8(%rbp)
jmp    11f9 <main+0x99>
lea    0xe1d(%rip),%rdi
call   1040 <printf@plt>
jmp    11fe <main+0x9e>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
jmp    1176 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xe91(%rip),%r12
lea    0xe8c(%rip),%r14
lea    0xe87(%rip),%r15
jmp    118f <main+0x2f>
nop
xor    %eax,%eax
call   1060 <handleVector@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
call   1070 <displayMain@plt>
mov    $0x1,%edi
call   1080 <readFromStdin@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r12,%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     1180 <main+0x20>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     11cd <main+0x6d>
mov    %r15,%rdi
call   1040 <puts@plt>
jmp    1187 <main+0x27>
lea    0xe52(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [2 x i8] c"V\00"
@.str.1 = [2 x i8] c"X\00"
@.str.2 = [13 x i8] c"\0Aexiting...\0A\00"
@.str.3 = [35 x i8] c"\09hat's not something I know about\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
store i32 0, i32* %1
store i32 1, i32* %2
br label %4
4: ; preds = %24, %0
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %27
7: ; preds = %4
%8 = call i32 (...) @displayMain()
%9 = call i8* @readFromStdin(i32 1)
store i8* %9, i8** %3
%10 = load i8*, i8** %3
%11 = call i64 @strcmp(i8* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %7
%14 = call i32 (...) @handleVector()
br label %24
15: ; preds = %7
%16 = load i8*, i8** %3
%17 = call i64 @strcmp(i8* %16, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %15
%20 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %2
br label %23
21: ; preds = %15
%22 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0))
br label %23
23: ; preds = %21, %19
br label %24
24: ; preds = %23, %13
%25 = load i8*, i8** %3
%26 = call i32 @free(i8* %25)
br label %4
27: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@.str = [2 x i8] c"V\00"
@.str.1 = [2 x i8] c"X\00"
@str = [34 x i8] c"\09hat's not something I know about\00"
@str.4 = [12 x i8] c"\0Aexiting...\00"
define i32 @main() {
br label %1
1: ; preds = %13, %0
%2 = tail call i32 (...) @displayMain()
%3 = tail call i8* @readFromStdin(i32 1)
%4 = tail call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 (...) @handleVector()
br label %13
8: ; preds = %1
%9 = tail call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%10 = icmp eq i64 %9, 0
br i1 %10, label %15, label %11
11: ; preds = %8
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
br label %13
13: ; preds = %11, %6
%14 = tail call i32 @free(i8* %3)
br label %1
15: ; preds = %8
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.4, i64 0, i64 0))
%17 = tail call i32 @free(i8* %3)
ret i32 0
}