#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*/ GetPosition();
int /*<<< orphan*/ GetStats();
int /*<<< orphan*/ Move();
int /*<<< orphan*/ Reminder();
int /*<<< orphan*/ SetOrigin();
int /*<<< orphan*/ SetVelocity();
char getc(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ vfdRefresh();
int main(void) {
  char str[64];
  int n, dev;
  char c;
  printf("Begin:  Type q to end.\n");
  while (((c = getc(stdin)) != 'q') && (c != 'Q')) {
    switch (c) {
    case 'c':
      GetPosition();
      break;
    case 's':
      GetStats();
      break;
    case 'm':
      Move();
      break;
    case 'v':
      SetVelocity();
      break;
    case 'o':
      SetOrigin();
      break;
    case 'n':
      vfdRefresh();
      break;
    case 03:
    case 04:
      Reminder();
      break;
    default:
      break;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe5a(%rip),%rdi
call   1060 <printf@plt>
mov    0x2e36(%rip),%rax
mov    (%rax),%edi
call   10b0 <getc@plt>
mov    %al,-0x59(%rbp)
movsbl %al,%ecx
xor    %eax,%eax
cmp    $0x71,%ecx
mov    %al,-0x5a(%rbp)
je     11da <main+0x4a>
movsbl -0x59(%rbp),%eax
cmp    $0x51,%eax
setne  %al
mov    %al,-0x5a(%rbp)
mov    -0x5a(%rbp),%al
test   $0x1,%al
jne    11ea <main+0x5a>
jmp    12c6 <main+0x136>
movsbl -0x59(%rbp),%eax
mov    %eax,-0x60(%rbp)
add    $0xfffffffd,%eax
sub    $0x2,%eax
jb     12b0 <main+0x120>
jmp    1202 <main+0x72>
mov    -0x60(%rbp),%eax
sub    $0x63,%eax
je     1268 <main+0xd8>
jmp    1213 <main+0x83>
mov    -0x60(%rbp),%eax
sub    $0x6d,%eax
je     1280 <main+0xf0>
jmp    1224 <main+0x94>
mov    -0x60(%rbp),%eax
sub    $0x6e,%eax
je     12a4 <main+0x114>
jmp    1235 <main+0xa5>
mov    -0x60(%rbp),%eax
sub    $0x6f,%eax
je     1298 <main+0x108>
jmp    1246 <main+0xb6>
mov    -0x60(%rbp),%eax
sub    $0x73,%eax
je     1274 <main+0xe4>
jmp    1257 <main+0xc7>
mov    -0x60(%rbp),%eax
sub    $0x76,%eax
je     128c <main+0xfc>
jmp    12bc <main+0x12c>
mov    $0x0,%al
call   10a0 <GetPosition@plt>
jmp    12c1 <main+0x131>
mov    $0x0,%al
call   1090 <GetStats@plt>
jmp    12c1 <main+0x131>
mov    $0x0,%al
call   1050 <Move@plt>
jmp    12c1 <main+0x131>
mov    $0x0,%al
call   1030 <SetVelocity@plt>
jmp    12c1 <main+0x131>
mov    $0x0,%al
call   1080 <SetOrigin@plt>
jmp    12c1 <main+0x131>
mov    $0x0,%al
call   1070 <vfdRefresh@plt>
jmp    12c1 <main+0x131>
mov    $0x0,%al
call   1040 <Reminder@plt>
jmp    12c1 <main+0x131>
jmp    12c1 <main+0x131>
jmp    11ab <main+0x1b>
mov    $0x1,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xeb5(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e41(%rip),%r14
mov    (%r14),%edi
call   10b0 <getc@plt>
mov    %eax,%ecx
and    $0xdf,%cl
cmp    $0x51,%cl
jne    11c6 <main+0x36>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
lea    0xe33(%rip),%rbx
jmp    11f2 <main+0x62>
xor    %eax,%eax
call   1070 <vfdRefresh@plt>
cs nopw 0x0(%rax,%rax,1)
mov    (%r14),%edi
call   10b0 <getc@plt>
mov    %eax,%ecx
and    $0xdf,%cl
cmp    $0x51,%cl
je     11b9 <main+0x29>
movsbl %al,%eax
lea    -0x63(%rax),%ecx
cmp    $0x13,%ecx
ja     1210 <main+0x80>
movslq (%rbx,%rcx,4),%rax
add    %rbx,%rax
jmp    *%rax
xor    %eax,%eax
call   10a0 <GetPosition@plt>
jmp    11e0 <main+0x50>
nop
add    $0xfffffffd,%eax
cmp    $0x2,%eax
jae    11e0 <main+0x50>
xor    %eax,%eax
call   1050 <Reminder@plt>
jmp    11e0 <main+0x50>
xor    %eax,%eax
call   1060 <Move@plt>
jmp    11e0 <main+0x50>
xor    %eax,%eax
call   1080 <SetOrigin@plt>
jmp    11e0 <main+0x50>
xor    %eax,%eax
call   1090 <GetStats@plt>
jmp    11e0 <main+0x50>
xor    %eax,%eax
call   1040 <SetVelocity@plt>
jmp    11e0 <main+0x50>

LLVM IR (-O0):
@.str = [24 x i8] c"Begin: Type q to end.\0A\00"
@stdin = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [64 x i8]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8
store i32 0, i32* %1
%6 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %36, %0
%8 = load i32, i32* @stdin
%9 = call signext i8 @getc(i32 %8)
store i8 %9, i8* %5
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 113
br i1 %11, label %12, label %16
12: ; preds = %7
%13 = load i8, i8* %5
%14 = sext i8 %13 to i32
%15 = icmp ne i32 %14, 81
br label %16
16: ; preds = %12, %7
%17 = phi i1 [ false, %7 ], [ %15, %12 ]
br i1 %17, label %18, label %37
18: ; preds = %16
%19 = load i8, i8* %5
%20 = sext i8 %19 to i32
switch i32 %20, label %35 [
i32 99, label %21
i32 115, label %23
i32 109, label %25
i32 118, label %27
i32 111, label %29
i32 110, label %31
i32 3, label %33
i32 4, label %33
]
21: ; preds = %18
%22 = call i32 (...) @GetPosition()
br label %36
23: ; preds = %18
%24 = call i32 (...) @GetStats()
br label %36
25: ; preds = %18
%26 = call i32 (...) @Move()
br label %36
27: ; preds = %18
%28 = call i32 (...) @SetVelocity()
br label %36
29: ; preds = %18
%30 = call i32 (...) @SetOrigin()
br label %36
31: ; preds = %18
%32 = call i32 (...) @vfdRefresh()
br label %36
33: ; preds = %18, %18
%34 = call i32 (...) @Reminder()
br label %36
35: ; preds = %18
br label %36
36: ; preds = %35, %33, %31, %29, %27, %25, %23, %21
br label %7
37: ; preds = %16
ret i32 1
}

LLVM IR (-O2):
@stdin = global i32 0
@str = [23 x i8] c"Begin: Type q to end.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @stdin
%3 = tail call signext i8 @getc(i32 %2)
%4 = and i8 %3, -33
%5 = icmp eq i8 %4, 81
br i1 %5, label %28, label %6
6: ; preds = %0, %23
%7 = phi i8 [ %25, %23 ], [ %3, %0 ]
%8 = sext i8 %7 to i32
switch i32 %8, label %23 [
i32 99, label %9
i32 115, label %11
i32 109, label %13
i32 118, label %15
i32 111, label %17
i32 110, label %19
i32 3, label %21
i32 4, label %21
]
9: ; preds = %6
%10 = tail call i32 (...) @GetPosition()
br label %23
11: ; preds = %6
%12 = tail call i32 (...) @GetStats()
br label %23
13: ; preds = %6
%14 = tail call i32 (...) @Move()
br label %23
15: ; preds = %6
%16 = tail call i32 (...) @SetVelocity()
br label %23
17: ; preds = %6
%18 = tail call i32 (...) @SetOrigin()
br label %23
19: ; preds = %6
%20 = tail call i32 (...) @vfdRefresh()
br label %23
21: ; preds = %6, %6
%22 = tail call i32 (...) @Reminder()
br label %23
23: ; preds = %6, %21, %19, %17, %15, %13, %11, %9
%24 = load i32, i32* @stdin
%25 = tail call signext i8 @getc(i32 %24)
%26 = and i8 %25, -33
%27 = icmp eq i8 %26, 81
br i1 %27, label %28, label %6
28: ; preds = %23, %0
ret i32 1
}