#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*/ DoAdd();
int /*<<< orphan*/ DoCall();
int /*<<< orphan*/ DoCmp();
int /*<<< orphan*/ DoDiv();
int /*<<< orphan*/ DoDrop();
int /*<<< orphan*/ DoEnd();
int /*<<< orphan*/ DoGoTo();
int /*<<< orphan*/ DoGoToIfZero();
int /*<<< orphan*/ DoMul();
int /*<<< orphan*/ DoNothing();
int /*<<< orphan*/ DoPeek();
int /*<<< orphan*/ DoPick();
int /*<<< orphan*/ DoPoke();
int /*<<< orphan*/ DoPrintChar();
int /*<<< orphan*/ DoPrintInt();
int /*<<< orphan*/ DoReturn();
int /*<<< orphan*/ DoRoll();
int /*<<< orphan*/ DoSub();
int /*<<< orphan*/ Push(int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char);
void OPS(char c) {
  switch (c) {
  case ' ':
    DoNothing();
    break;
  case '\n':
    DoNothing();
    break;
  case 'p':
    DoPrintInt();
    break;
  case 'P':
    DoPrintChar();
    break;
  case '0':
    Push(0);
    break;
  case '1':
    Push(1);
    break;
  case '2':
    Push(2);
    break;
  case '3':
    Push(3);
    break;
  case '4':
    Push(4);
    break;
  case '5':
    Push(5);
    break;
  case '6':
    Push(6);
    break;
  case '7':
    Push(7);
    break;
  case '8':
    Push(8);
    break;
  case '9':
    Push(9);
    break;
  case '+':
    DoAdd();
    break;
  case '-':
    DoSub();
    break;
  case '*':
    DoMul();
    break;
  case '/':
    DoDiv();
    break;
  case ':':
    DoCmp();
    break;
  case 'g':
    DoGoTo();
    break;
  case '?':
    DoGoToIfZero();
    break;
  case 'c':
    DoCall();
    break;
  case '$':
    DoReturn();
    break;
  case '<':
    DoPeek();
    break;
  case '>':
    DoPoke();
    break;
  case '^':
    DoPick();
    break;
  case 'v':
    DoRoll();
    break;
  case 'd':
    DoDrop();
    break;
  case '!':
    DoEnd();
    break;
  default:
    printf("ERROR: '%c' is not a valid command!\n", c);
    exit(-1);
  }
}


x86 assembly (clang, -O0):
<OPS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0xfffffff6,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x6c,%eax
ja     13ff <OPS+0x1af>
mov    -0x10(%rbp),%rax
lea    0xd81(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x0,%al
call   1170 <DoNothing@plt>
jmp    1419 <OPS+0x1c9>
mov    $0x0,%al
call   1170 <DoNothing@plt>
jmp    1419 <OPS+0x1c9>
mov    $0x0,%al
call   10c0 <DoPrintInt@plt>
jmp    1419 <OPS+0x1c9>
mov    $0x0,%al
call   1090 <DoPrintChar@plt>
jmp    1419 <OPS+0x1c9>
xor    %edi,%edi
call   10d0 <Push@plt>
jmp    1419 <OPS+0x1c9>
mov    $0x1,%edi
call   10d0 <Push@plt>
jmp    1419 <OPS+0x1c9>
mov    $0x2,%edi
call   10d0 <Push@plt>
jmp    1419 <OPS+0x1c9>
mov    $0x3,%edi
call   10d0 <Push@plt>
jmp    1419 <OPS+0x1c9>
mov    $0x4,%edi
call   10d0 <Push@plt>
jmp    1419 <OPS+0x1c9>
mov    $0x5,%edi
call   10d0 <Push@plt>
jmp    1419 <OPS+0x1c9>
mov    $0x6,%edi
call   10d0 <Push@plt>
jmp    1419 <OPS+0x1c9>
mov    $0x7,%edi
call   10d0 <Push@plt>
jmp    1419 <OPS+0x1c9>
mov    $0x8,%edi
call   10d0 <Push@plt>
jmp    1419 <OPS+0x1c9>
mov    $0x9,%edi
call   10d0 <Push@plt>
jmp    1419 <OPS+0x1c9>
mov    $0x0,%al
call   1040 <DoAdd@plt>
jmp    1419 <OPS+0x1c9>
mov    $0x0,%al
call   1080 <DoSub@plt>
jmp    1419 <OPS+0x1c9>
mov    $0x0,%al
call   1050 <DoMul@plt>
jmp    1419 <OPS+0x1c9>
mov    $0x0,%al
call   10a0 <DoDiv@plt>
jmp    1419 <OPS+0x1c9>
mov    $0x0,%al
call   1100 <DoCmp@plt>
jmp    1419 <OPS+0x1c9>
mov    $0x0,%al
call   1150 <DoGoTo@plt>
jmp    1419 <OPS+0x1c9>
mov    $0x0,%al
call   1120 <DoGoToIfZero@plt>
jmp    1419 <OPS+0x1c9>
mov    $0x0,%al
call   1070 <DoCall@plt>
jmp    1419 <OPS+0x1c9>
mov    $0x0,%al
call   10b0 <DoReturn@plt>
jmp    1419 <OPS+0x1c9>
mov    $0x0,%al
call   10e0 <DoPeek@plt>
jmp    1419 <OPS+0x1c9>
mov    $0x0,%al
call   1030 <DoPoke@plt>
jmp    1419 <OPS+0x1c9>
mov    $0x0,%al
call   1140 <DoPick@plt>
jmp    1419 <OPS+0x1c9>
mov    $0x0,%al
call   10f0 <DoRoll@plt>
jmp    1419 <OPS+0x1c9>
mov    $0x0,%al
call   1160 <DoDrop@plt>
jmp    1419 <OPS+0x1c9>
mov    $0x0,%al
call   1110 <DoEnd@plt>
jmp    1419 <OPS+0x1c9>
lea    0xdae(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1060 <printf@plt>
mov    $0xffffffff,%edi
call   1130 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OPS>:
push   %rax
lea    -0xa(%rdi),%eax
cmp    $0x6c,%eax
ja     1368 <OPS+0x118>
lea    0xd9c(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
xor    %eax,%eax
pop    %rcx
jmp    1170 <DoNothing@plt>
xor    %eax,%eax
pop    %rcx
jmp    1110 <DoEnd@plt>
xor    %eax,%eax
pop    %rcx
jmp    10b0 <DoReturn@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <DoMul@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <DoAdd@plt>
xor    %eax,%eax
pop    %rcx
jmp    1080 <DoSub@plt>
xor    %eax,%eax
pop    %rcx
jmp    10a0 <DoDiv@plt>
xor    %edi,%edi
pop    %rax
jmp    10d0 <Push@plt>
mov    $0x1,%edi
pop    %rax
jmp    10d0 <Push@plt>
mov    $0x2,%edi
pop    %rax
jmp    10d0 <Push@plt>
mov    $0x3,%edi
pop    %rax
jmp    10d0 <Push@plt>
mov    $0x4,%edi
pop    %rax
jmp    10d0 <Push@plt>
mov    $0x5,%edi
pop    %rax
jmp    10d0 <Push@plt>
mov    $0x6,%edi
pop    %rax
jmp    10d0 <Push@plt>
mov    $0x7,%edi
pop    %rax
jmp    10d0 <Push@plt>
mov    $0x8,%edi
pop    %rax
jmp    10d0 <Push@plt>
mov    $0x9,%edi
pop    %rax
jmp    10d0 <Push@plt>
xor    %eax,%eax
pop    %rcx
jmp    10e0 <DoPeek@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <DoPoke@plt>
xor    %eax,%eax
pop    %rcx
jmp    1120 <DoGoToIfZero@plt>
xor    %eax,%eax
pop    %rcx
jmp    1140 <DoPick@plt>
xor    %eax,%eax
pop    %rcx
jmp    1150 <DoGoTo@plt>
xor    %eax,%eax
pop    %rcx
jmp    10f0 <DoRoll@plt>
xor    %eax,%eax
pop    %rcx
jmp    1100 <DoCmp@plt>
xor    %eax,%eax
pop    %rcx
jmp    1090 <DoPrintChar@plt>
xor    %eax,%eax
pop    %rcx
jmp    1070 <DoCall@plt>
xor    %eax,%eax
pop    %rcx
jmp    1160 <DoDrop@plt>
xor    %eax,%eax
pop    %rcx
jmp    10c0 <DoPrintInt@plt>
movsbl %dil,%esi
lea    0xe41(%rip),%rdi
call   1060 <printf@plt>
mov    $0xffffffff,%edi
call   1130 <exit@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"ERROR: '%c' is not a valid command!\0A\00"
define void @OPS(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
switch i32 %4, label %63 [
i32 32, label %5
i32 10, label %7
i32 112, label %9
i32 80, label %11
i32 48, label %13
i32 49, label %15
i32 50, label %17
i32 51, label %19
i32 52, label %21
i32 53, label %23
i32 54, label %25
i32 55, label %27
i32 56, label %29
i32 57, label %31
i32 43, label %33
i32 45, label %35
i32 42, label %37
i32 47, label %39
i32 58, label %41
i32 103, label %43
i32 63, label %45
i32 99, label %47
i32 36, label %49
i32 60, label %51
i32 62, label %53
i32 94, label %55
i32 118, label %57
i32 100, label %59
i32 33, label %61
]
5: ; preds = %1
%6 = call i32 (...) @DoNothing()
br label %67
7: ; preds = %1
%8 = call i32 (...) @DoNothing()
br label %67
9: ; preds = %1
%10 = call i32 (...) @DoPrintInt()
br label %67
11: ; preds = %1
%12 = call i32 (...) @DoPrintChar()
br label %67
13: ; preds = %1
%14 = call i32 @Push(i32 0)
br label %67
15: ; preds = %1
%16 = call i32 @Push(i32 1)
br label %67
17: ; preds = %1
%18 = call i32 @Push(i32 2)
br label %67
19: ; preds = %1
%20 = call i32 @Push(i32 3)
br label %67
21: ; preds = %1
%22 = call i32 @Push(i32 4)
br label %67
23: ; preds = %1
%24 = call i32 @Push(i32 5)
br label %67
25: ; preds = %1
%26 = call i32 @Push(i32 6)
br label %67
27: ; preds = %1
%28 = call i32 @Push(i32 7)
br label %67
29: ; preds = %1
%30 = call i32 @Push(i32 8)
br label %67
31: ; preds = %1
%32 = call i32 @Push(i32 9)
br label %67
33: ; preds = %1
%34 = call i32 (...) @DoAdd()
br label %67
35: ; preds = %1
%36 = call i32 (...) @DoSub()
br label %67
37: ; preds = %1
%38 = call i32 (...) @DoMul()
br label %67
39: ; preds = %1
%40 = call i32 (...) @DoDiv()
br label %67
41: ; preds = %1
%42 = call i32 (...) @DoCmp()
br label %67
43: ; preds = %1
%44 = call i32 (...) @DoGoTo()
br label %67
45: ; preds = %1
%46 = call i32 (...) @DoGoToIfZero()
br label %67
47: ; preds = %1
%48 = call i32 (...) @DoCall()
br label %67
49: ; preds = %1
%50 = call i32 (...) @DoReturn()
br label %67
51: ; preds = %1
%52 = call i32 (...) @DoPeek()
br label %67
53: ; preds = %1
%54 = call i32 (...) @DoPoke()
br label %67
55: ; preds = %1
%56 = call i32 (...) @DoPick()
br label %67
57: ; preds = %1
%58 = call i32 (...) @DoRoll()
br label %67
59: ; preds = %1
%60 = call i32 (...) @DoDrop()
br label %67
61: ; preds = %1
%62 = call i32 (...) @DoEnd()
br label %67
63: ; preds = %1
%64 = load i8, i8* %2
%65 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8 signext %64)
%66 = call i32 @exit(i32 -1)
unreachable
67: ; preds = %61, %59, %57, %55, %53, %51, %49, %47, %45, %43, %41, %39, %37, %35, %33, %31, %29, %27, %25, %23, %21, %19, %17, %15, %13, %11, %9, %7, %5
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"ERROR: '%c' is not a valid command!\0A\00"
define void @OPS(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %61 [
i32 32, label %3
i32 10, label %5
i32 112, label %7
i32 80, label %9
i32 48, label %11
i32 49, label %13
i32 50, label %15
i32 51, label %17
i32 52, label %19
i32 53, label %21
i32 54, label %23
i32 55, label %25
i32 56, label %27
i32 57, label %29
i32 43, label %31
i32 45, label %33
i32 42, label %35
i32 47, label %37
i32 58, label %39
i32 103, label %41
i32 63, label %43
i32 99, label %45
i32 36, label %47
i32 60, label %49
i32 62, label %51
i32 94, label %53
i32 118, label %55
i32 100, label %57
i32 33, label %59
]
3: ; preds = %1
%4 = tail call i32 (...) @DoNothing()
br label %64
5: ; preds = %1
%6 = tail call i32 (...) @DoNothing()
br label %64
7: ; preds = %1
%8 = tail call i32 (...) @DoPrintInt()
br label %64
9: ; preds = %1
%10 = tail call i32 (...) @DoPrintChar()
br label %64
11: ; preds = %1
%12 = tail call i32 @Push(i32 0)
br label %64
13: ; preds = %1
%14 = tail call i32 @Push(i32 1)
br label %64
15: ; preds = %1
%16 = tail call i32 @Push(i32 2)
br label %64
17: ; preds = %1
%18 = tail call i32 @Push(i32 3)
br label %64
19: ; preds = %1
%20 = tail call i32 @Push(i32 4)
br label %64
21: ; preds = %1
%22 = tail call i32 @Push(i32 5)
br label %64
23: ; preds = %1
%24 = tail call i32 @Push(i32 6)
br label %64
25: ; preds = %1
%26 = tail call i32 @Push(i32 7)
br label %64
27: ; preds = %1
%28 = tail call i32 @Push(i32 8)
br label %64
29: ; preds = %1
%30 = tail call i32 @Push(i32 9)
br label %64
31: ; preds = %1
%32 = tail call i32 (...) @DoAdd()
br label %64
33: ; preds = %1
%34 = tail call i32 (...) @DoSub()
br label %64
35: ; preds = %1
%36 = tail call i32 (...) @DoMul()
br label %64
37: ; preds = %1
%38 = tail call i32 (...) @DoDiv()
br label %64
39: ; preds = %1
%40 = tail call i32 (...) @DoCmp()
br label %64
41: ; preds = %1
%42 = tail call i32 (...) @DoGoTo()
br label %64
43: ; preds = %1
%44 = tail call i32 (...) @DoGoToIfZero()
br label %64
45: ; preds = %1
%46 = tail call i32 (...) @DoCall()
br label %64
47: ; preds = %1
%48 = tail call i32 (...) @DoReturn()
br label %64
49: ; preds = %1
%50 = tail call i32 (...) @DoPeek()
br label %64
51: ; preds = %1
%52 = tail call i32 (...) @DoPoke()
br label %64
53: ; preds = %1
%54 = tail call i32 (...) @DoPick()
br label %64
55: ; preds = %1
%56 = tail call i32 (...) @DoRoll()
br label %64
57: ; preds = %1
%58 = tail call i32 (...) @DoDrop()
br label %64
59: ; preds = %1
%60 = tail call i32 (...) @DoEnd()
br label %64
61: ; preds = %1
%62 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8 signext %0)
%63 = tail call i32 @exit(i32 -1)
unreachable
64: ; preds = %59, %57, %55, %53, %51, %49, %47, %45, %43, %41, %39, %37, %35, %33, %31, %29, %27, %25, %23, %21, %19, %17, %15, %13, %11, %9, %7, %5, %3
ret void
}