#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*/ Delay(int);
int /*<<< orphan*/ Put(char, int /*<<< orphan*/);
int Receive(char *, int);
int /*<<< orphan*/ Reply(int, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ console_xy(int /*<<< orphan*/, int);
int /*<<< orphan*/ cprintf(char *);
main() {
  int i;
  int tid;
  char ch;
  char setTrain = 12;
  char speedy = 0;
  char inputted = 0;
  int x;
  int send = 13;
  int reply = 0;
  console_xy(0, 9);
  cprintf("Train Command Srv : ");
  while (1) {
    tid = Receive(&ch, sizeof(char));
    Reply(tid, 0, 0);
    if (ch == 's') {
      Delay(1);
      Put(0x85, 0);
      Delay(1);
    } else if (ch == 'A' || ch == 'a') {
      setTrain = 12;
      inputted = 1;
    } else if (ch == 'B' || ch == 'b') {
      setTrain = 55;
      inputted = 1;
    } else if (ch == 'C' || ch == 'c') {
      setTrain = 57;
      inputted = 1;
    } else if (ch == '1') {
      speedy = 1;
      inputted = 1;
    } else if (ch == '2') {
      speedy = 2;
      inputted = 1;
    } else if (ch == '3') {
      speedy = 3;
      inputted = 1;
    } else if (ch == '4') {
      speedy = 4;
      inputted = 1;
    } else if (ch == '5') {
      speedy = 5;
      inputted = 1;
    } else if (ch == '6') {
      speedy = 6;
      inputted = 1;
    } else if (ch == '7') {
      speedy = 7;
      inputted = 1;
    } else if (ch == '8') {
      speedy = 8;
      inputted = 1;
    } else if (ch == '9') {
      speedy = 9;
      inputted = 1;
    } else if (ch == '0') {
      speedy = 0;
      inputted = 1;
    } else if (ch == '-' || ch == '_') {
      speedy = 10;
      inputted = 1;
    } else if (ch == '=' || ch == '+') {
      speedy = 11;
      inputted = 1;
    } else if (ch == ']' || ch == '}') {
      speedy = 14;
      inputted = 1;
    } else if (ch == 'q' || ch == 'Q') {
      Put(0, 0);
      Delay(1);
      Put(12, 0);
      Delay(1);
    } else if (ch == 'e' || ch == 'E') {
      Put(97, 0);
    } else if (ch == 'r' || ch == 'R') {
      Put(96, 0);
    } else if (ch == ',' || ch == '<') {
      Put(0x22, 0);
      Delay(2);
      Put(6, 0);
      Delay(2);
      Put(0x20, 0);
      Delay(2);
    } else if (ch == '.' || ch == '>') {
      Put(0x21, 0);
      Delay(2);
      Put(6, 0);
      Delay(2);
      Put(0x20, 0);
      Delay(2);
    } else if (ch == 'm' || ch == 'M') {
      Put(0x21, 0);
      Delay(2);
      Put(15, 0);
      Delay(2);
      Put(0x20, 0);
    } else if (ch == 'n' || ch == 'M') {
      Put(0x22, 0);
      Delay(2);
      Put(15, 0);
      Delay(2);
      Put(0x20, 0);
    }
    if (inputted == 1) {
      Put(speedy, 0);
      Delay(1);
      Put(setTrain, 0);
      inputted = 0;
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0xc,-0xe(%rbp)
movb   $0x0,-0xf(%rbp)
movb   $0x0,-0x10(%rbp)
movl   $0xd,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
xor    %edi,%edi
mov    $0x9,%esi
call   1080 <console_xy@plt>
lea    0xe64(%rip),%rdi
call   1070 <cprintf@plt>
lea    -0xd(%rbp),%rdi
mov    $0x1,%esi
call   1050 <Receive@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
xor    %edx,%edx
mov    %edx,%esi
call   1060 <Reply@plt>
movsbl -0xd(%rbp),%eax
cmp    $0x73,%eax
jne    11f0 <main+0x90>
mov    $0x1,%edi
call   1040 <Delay@plt>
mov    $0xffffff85,%edi
xor    %esi,%esi
call   1030 <Put@plt>
mov    $0x1,%edi
call   1040 <Delay@plt>
jmp    165a <main+0x4fa>
movsbl -0xd(%rbp),%eax
cmp    $0x41,%eax
je     120a <main+0xaa>
movsbl -0xd(%rbp),%eax
cmp    $0x61,%eax
jne    1217 <main+0xb7>
movb   $0xc,-0xe(%rbp)
movb   $0x1,-0x10(%rbp)
jmp    1655 <main+0x4f5>
movsbl -0xd(%rbp),%eax
cmp    $0x42,%eax
je     1231 <main+0xd1>
movsbl -0xd(%rbp),%eax
cmp    $0x62,%eax
jne    123e <main+0xde>
movb   $0x37,-0xe(%rbp)
movb   $0x1,-0x10(%rbp)
jmp    1650 <main+0x4f0>
movsbl -0xd(%rbp),%eax
cmp    $0x43,%eax
je     1258 <main+0xf8>
movsbl -0xd(%rbp),%eax
cmp    $0x63,%eax
jne    1265 <main+0x105>
movb   $0x39,-0xe(%rbp)
movb   $0x1,-0x10(%rbp)
jmp    164b <main+0x4eb>
movsbl -0xd(%rbp),%eax
cmp    $0x31,%eax
jne    127f <main+0x11f>
movb   $0x1,-0xf(%rbp)
movb   $0x1,-0x10(%rbp)
jmp    1646 <main+0x4e6>
movsbl -0xd(%rbp),%eax
cmp    $0x32,%eax
jne    1299 <main+0x139>
movb   $0x2,-0xf(%rbp)
movb   $0x1,-0x10(%rbp)
jmp    1641 <main+0x4e1>
movsbl -0xd(%rbp),%eax
cmp    $0x33,%eax
jne    12b3 <main+0x153>
movb   $0x3,-0xf(%rbp)
movb   $0x1,-0x10(%rbp)
jmp    163c <main+0x4dc>
movsbl -0xd(%rbp),%eax
cmp    $0x34,%eax
jne    12cd <main+0x16d>
movb   $0x4,-0xf(%rbp)
movb   $0x1,-0x10(%rbp)
jmp    1637 <main+0x4d7>
movsbl -0xd(%rbp),%eax
cmp    $0x35,%eax
jne    12e7 <main+0x187>
movb   $0x5,-0xf(%rbp)
movb   $0x1,-0x10(%rbp)
jmp    1632 <main+0x4d2>
movsbl -0xd(%rbp),%eax
cmp    $0x36,%eax
jne    1301 <main+0x1a1>
movb   $0x6,-0xf(%rbp)
movb   $0x1,-0x10(%rbp)
jmp    162d <main+0x4cd>
movsbl -0xd(%rbp),%eax
cmp    $0x37,%eax
jne    131b <main+0x1bb>
movb   $0x7,-0xf(%rbp)
movb   $0x1,-0x10(%rbp)
jmp    1628 <main+0x4c8>
movsbl -0xd(%rbp),%eax
cmp    $0x38,%eax
jne    1335 <main+0x1d5>
movb   $0x8,-0xf(%rbp)
movb   $0x1,-0x10(%rbp)
jmp    1623 <main+0x4c3>
movsbl -0xd(%rbp),%eax
cmp    $0x39,%eax
jne    134f <main+0x1ef>
movb   $0x9,-0xf(%rbp)
movb   $0x1,-0x10(%rbp)
jmp    161e <main+0x4be>
movsbl -0xd(%rbp),%eax
cmp    $0x30,%eax
jne    1369 <main+0x209>
movb   $0x0,-0xf(%rbp)
movb   $0x1,-0x10(%rbp)
jmp    1619 <main+0x4b9>
movsbl -0xd(%rbp),%eax
cmp    $0x2d,%eax
je     1383 <main+0x223>
movsbl -0xd(%rbp),%eax
cmp    $0x5f,%eax
jne    1390 <main+0x230>
movb   $0xa,-0xf(%rbp)
movb   $0x1,-0x10(%rbp)
jmp    1614 <main+0x4b4>
movsbl -0xd(%rbp),%eax
cmp    $0x3d,%eax
je     13aa <main+0x24a>
movsbl -0xd(%rbp),%eax
cmp    $0x2b,%eax
jne    13b7 <main+0x257>
movb   $0xb,-0xf(%rbp)
movb   $0x1,-0x10(%rbp)
jmp    160f <main+0x4af>
movsbl -0xd(%rbp),%eax
cmp    $0x5d,%eax
je     13d1 <main+0x271>
movsbl -0xd(%rbp),%eax
cmp    $0x7d,%eax
jne    13de <main+0x27e>
movb   $0xe,-0xf(%rbp)
movb   $0x1,-0x10(%rbp)
jmp    160a <main+0x4aa>
movsbl -0xd(%rbp),%eax
cmp    $0x71,%eax
je     13f8 <main+0x298>
movsbl -0xd(%rbp),%eax
cmp    $0x51,%eax
jne    1426 <main+0x2c6>
xor    %esi,%esi
mov    %esi,%edi
call   1030 <Put@plt>
mov    $0x1,%edi
call   1040 <Delay@plt>
mov    $0xc,%edi
xor    %esi,%esi
call   1030 <Put@plt>
mov    $0x1,%edi
call   1040 <Delay@plt>
jmp    1605 <main+0x4a5>
movsbl -0xd(%rbp),%eax
cmp    $0x65,%eax
je     1440 <main+0x2e0>
movsbl -0xd(%rbp),%eax
cmp    $0x45,%eax
jne    1451 <main+0x2f1>
mov    $0x61,%edi
xor    %esi,%esi
call   1030 <Put@plt>
jmp    1600 <main+0x4a0>
movsbl -0xd(%rbp),%eax
cmp    $0x72,%eax
je     146b <main+0x30b>
movsbl -0xd(%rbp),%eax
cmp    $0x52,%eax
jne    147c <main+0x31c>
mov    $0x60,%edi
xor    %esi,%esi
call   1030 <Put@plt>
jmp    15fb <main+0x49b>
movsbl -0xd(%rbp),%eax
cmp    $0x2c,%eax
je     1496 <main+0x336>
movsbl -0xd(%rbp),%eax
cmp    $0x3c,%eax
jne    14dd <main+0x37d>
mov    $0x22,%edi
xor    %esi,%esi
call   1030 <Put@plt>
mov    $0x2,%edi
call   1040 <Delay@plt>
mov    $0x6,%edi
xor    %esi,%esi
call   1030 <Put@plt>
mov    $0x2,%edi
call   1040 <Delay@plt>
mov    $0x20,%edi
xor    %esi,%esi
call   1030 <Put@plt>
mov    $0x2,%edi
call   1040 <Delay@plt>
jmp    15f6 <main+0x496>
movsbl -0xd(%rbp),%eax
cmp    $0x2e,%eax
je     14f7 <main+0x397>
movsbl -0xd(%rbp),%eax
cmp    $0x3e,%eax
jne    153e <main+0x3de>
mov    $0x21,%edi
xor    %esi,%esi
call   1030 <Put@plt>
mov    $0x2,%edi
call   1040 <Delay@plt>
mov    $0x6,%edi
xor    %esi,%esi
call   1030 <Put@plt>
mov    $0x2,%edi
call   1040 <Delay@plt>
mov    $0x20,%edi
xor    %esi,%esi
call   1030 <Put@plt>
mov    $0x2,%edi
call   1040 <Delay@plt>
jmp    15f1 <main+0x491>
movsbl -0xd(%rbp),%eax
cmp    $0x6d,%eax
je     1558 <main+0x3f8>
movsbl -0xd(%rbp),%eax
cmp    $0x4d,%eax
jne    1595 <main+0x435>
mov    $0x21,%edi
xor    %esi,%esi
call   1030 <Put@plt>
mov    $0x2,%edi
call   1040 <Delay@plt>
mov    $0xf,%edi
xor    %esi,%esi
call   1030 <Put@plt>
mov    $0x2,%edi
call   1040 <Delay@plt>
mov    $0x20,%edi
xor    %esi,%esi
call   1030 <Put@plt>
jmp    15ec <main+0x48c>
movsbl -0xd(%rbp),%eax
cmp    $0x6e,%eax
je     15af <main+0x44f>
movsbl -0xd(%rbp),%eax
cmp    $0x4d,%eax
jne    15e7 <main+0x487>
mov    $0x22,%edi
xor    %esi,%esi
call   1030 <Put@plt>
mov    $0x2,%edi
call   1040 <Delay@plt>
mov    $0xf,%edi
xor    %esi,%esi
call   1030 <Put@plt>
mov    $0x2,%edi
call   1040 <Delay@plt>
mov    $0x20,%edi
xor    %esi,%esi
call   1030 <Put@plt>
jmp    15ec <main+0x48c>
jmp    15f1 <main+0x491>
jmp    15f6 <main+0x496>
jmp    15fb <main+0x49b>
jmp    1600 <main+0x4a0>
jmp    1605 <main+0x4a5>
jmp    160a <main+0x4aa>
jmp    160f <main+0x4af>
jmp    1614 <main+0x4b4>
jmp    1619 <main+0x4b9>
jmp    161e <main+0x4be>
jmp    1623 <main+0x4c3>
jmp    1628 <main+0x4c8>
jmp    162d <main+0x4cd>
jmp    1632 <main+0x4d2>
jmp    1637 <main+0x4d7>
jmp    163c <main+0x4dc>
jmp    1641 <main+0x4e1>
jmp    1646 <main+0x4e6>
jmp    164b <main+0x4eb>
jmp    1650 <main+0x4f0>
jmp    1655 <main+0x4f5>
jmp    165a <main+0x4fa>
movsbl -0x10(%rbp),%eax
cmp    $0x1,%eax
jne    168b <main+0x52b>
xor    %esi,%esi
movsbl -0xf(%rbp),%edi
call   1030 <Put@plt>
mov    $0x1,%edi
call   1040 <Delay@plt>
xor    %esi,%esi
movsbl -0xe(%rbp),%edi
call   1030 <Put@plt>
movb   $0x0,-0x10(%rbp)
jmp    11a1 <main+0x41>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
xor    %ebx,%ebx
xor    %edi,%edi
mov    $0x9,%esi
call   1080 <console_xy@plt>
lea    0xfb8(%rip),%rdi
call   1070 <cprintf@plt>
mov    $0xc,%r13b
lea    0x7(%rsp),%r14
lea    0xf40(%rip),%r15
lea    0xe65(%rip),%r12
jmp    11c4 <main+0x64>
mov    $0x39,%r13b
mov    %ebx,%ebp
movsbl %bpl,%edi
xor    %esi,%esi
call   1030 <Put@plt>
mov    $0x1,%edi
call   1040 <Delay@plt>
movsbl %r13b,%edi
xor    %esi,%esi
call   1030 <Put@plt>
mov    %ebp,%ebx
mov    %r14,%rdi
mov    $0x1,%esi
call   1050 <Receive@plt>
mov    %eax,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1060 <Reply@plt>
movzbl 0x7(%rsp),%eax
cmp    $0x73,%al
jne    1210 <main+0xb0>
mov    $0x1,%edi
call   1040 <Delay@plt>
mov    $0xffffff85,%edi
xor    %esi,%esi
call   1030 <Put@plt>
mov    $0x1,%edi
call   1040 <Delay@plt>
jmp    11c4 <main+0x64>
nopw   0x0(%rax,%rax,1)
mov    %eax,%ecx
and    $0xdf,%cl
cmp    $0x41,%cl
je     1247 <main+0xe7>
cmp    $0x42,%cl
je     124f <main+0xef>
cmp    $0x43,%cl
je     119d <main+0x3d>
lea    -0x2b(%rax),%edx
cmp    $0x34,%dl
ja     125f <main+0xff>
mov    $0x1,%bpl
movzbl %dl,%edx
movslq (%r12,%rdx,4),%rdx
add    %r12,%rdx
jmp    *%rdx
mov    $0xb,%bpl
jmp    11a2 <main+0x42>
mov    $0xc,%r13b
jmp    11a0 <main+0x40>
mov    $0x37,%r13b
jmp    11a0 <main+0x40>
mov    $0xa,%bpl
jmp    11a2 <main+0x42>
lea    -0x45(%rcx),%edx
cmp    $0x18,%dl
ja     12c4 <main+0x164>
mov    $0xe,%bpl
movzbl %dl,%edx
movslq (%r15,%rdx,4),%rdx
add    %r15,%rdx
jmp    *%rdx
mov    $0x61,%edi
jmp    12fc <main+0x19c>
xor    %ebp,%ebp
jmp    11a2 <main+0x42>
mov    $0x2,%bpl
jmp    11a2 <main+0x42>
mov    $0x3,%bpl
jmp    11a2 <main+0x42>
mov    $0x4,%bpl
jmp    11a2 <main+0x42>
mov    $0x5,%bpl
jmp    11a2 <main+0x42>
mov    $0x6,%bpl
jmp    11a2 <main+0x42>
mov    $0x7,%bpl
jmp    11a2 <main+0x42>
mov    $0x8,%bpl
jmp    11a2 <main+0x42>
mov    $0x9,%bpl
jmp    11a2 <main+0x42>
mov    %eax,%edx
and    $0xef,%dl
cmp    $0x2e,%dl
je     1308 <main+0x1a8>
cmp    $0x2c,%dl
jne    134f <main+0x1ef>
mov    $0x22,%edi
jmp    130d <main+0x1ad>
xor    %edi,%edi
xor    %esi,%esi
call   1030 <Put@plt>
mov    $0x1,%edi
call   1040 <Delay@plt>
mov    $0xc,%edi
jmp    11f4 <main+0x94>
mov    $0x60,%edi
xor    %esi,%esi
call   1030 <Put@plt>
jmp    11c4 <main+0x64>
mov    $0x21,%edi
xor    %esi,%esi
call   1030 <Put@plt>
mov    $0x2,%edi
call   1040 <Delay@plt>
mov    $0x6,%edi
xor    %esi,%esi
call   1030 <Put@plt>
mov    $0x2,%edi
call   1040 <Delay@plt>
mov    $0x20,%edi
xor    %esi,%esi
call   1030 <Put@plt>
mov    $0x2,%edi
call   1040 <Delay@plt>
jmp    11c4 <main+0x64>
cmp    $0x4d,%cl
jne    135b <main+0x1fb>
mov    $0x21,%edi
jmp    1368 <main+0x208>
cmp    $0x6e,%al
jne    11c4 <main+0x64>
mov    $0x22,%edi
xor    %esi,%esi
call   1030 <Put@plt>
mov    $0x2,%edi
call   1040 <Delay@plt>
mov    $0xf,%edi
xor    %esi,%esi
call   1030 <Put@plt>
mov    $0x2,%edi
call   1040 <Delay@plt>
mov    $0x20,%edi
jmp    12fc <main+0x19c>

LLVM IR (-O0):
@.str = [21 x i8] c"Train Command Srv : \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 0, i32* %1
store i8 12, i8* %5
store i8 0, i8* %6
store i8 0, i8* %7
store i32 13, i32* %9
store i32 0, i32* %10
%11 = call i32 @console_xy(i32 0, i32 9)
%12 = call i32 @cprintf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %0, %252
%14 = call i32 @Receive(i8* %4, i32 1)
store i32 %14, i32* %3
%15 = load i32, i32* %3
%16 = call i32 @Reply(i32 %15, i32 0, i32 0)
%17 = load i8, i8* %4
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 115
br i1 %19, label %20, label %24
20: ; preds = %13
%21 = call i32 @Delay(i32 1)
%22 = call i32 @Put(i8 signext -123, i32 0)
%23 = call i32 @Delay(i32 1)
br label %242
24: ; preds = %13
%25 = load i8, i8* %4
%26 = sext i8 %25 to i32
%27 = icmp eq i32 %26, 65
br i1 %27, label %32, label %28
28: ; preds = %24
%29 = load i8, i8* %4
%30 = sext i8 %29 to i32
%31 = icmp eq i32 %30, 97
br i1 %31, label %32, label %33
32: ; preds = %28, %24
store i8 12, i8* %5
store i8 1, i8* %7
br label %241
33: ; preds = %28
%34 = load i8, i8* %4
%35 = sext i8 %34 to i32
%36 = icmp eq i32 %35, 66
br i1 %36, label %41, label %37
37: ; preds = %33
%38 = load i8, i8* %4
%39 = sext i8 %38 to i32
%40 = icmp eq i32 %39, 98
br i1 %40, label %41, label %42
41: ; preds = %37, %33
store i8 55, i8* %5
store i8 1, i8* %7
br label %240
42: ; preds = %37
%43 = load i8, i8* %4
%44 = sext i8 %43 to i32
%45 = icmp eq i32 %44, 67
br i1 %45, label %50, label %46
46: ; preds = %42
%47 = load i8, i8* %4
%48 = sext i8 %47 to i32
%49 = icmp eq i32 %48, 99
br i1 %49, label %50, label %51
50: ; preds = %46, %42
store i8 57, i8* %5
store i8 1, i8* %7
br label %239
51: ; preds = %46
%52 = load i8, i8* %4
%53 = sext i8 %52 to i32
%54 = icmp eq i32 %53, 49
br i1 %54, label %55, label %56
55: ; preds = %51
store i8 1, i8* %6
store i8 1, i8* %7
br label %238
56: ; preds = %51
%57 = load i8, i8* %4
%58 = sext i8 %57 to i32
%59 = icmp eq i32 %58, 50
br i1 %59, label %60, label %61
60: ; preds = %56
store i8 2, i8* %6
store i8 1, i8* %7
br label %237
61: ; preds = %56
%62 = load i8, i8* %4
%63 = sext i8 %62 to i32
%64 = icmp eq i32 %63, 51
br i1 %64, label %65, label %66
65: ; preds = %61
store i8 3, i8* %6
store i8 1, i8* %7
br label %236
66: ; preds = %61
%67 = load i8, i8* %4
%68 = sext i8 %67 to i32
%69 = icmp eq i32 %68, 52
br i1 %69, label %70, label %71
70: ; preds = %66
store i8 4, i8* %6
store i8 1, i8* %7
br label %235
71: ; preds = %66
%72 = load i8, i8* %4
%73 = sext i8 %72 to i32
%74 = icmp eq i32 %73, 53
br i1 %74, label %75, label %76
75: ; preds = %71
store i8 5, i8* %6
store i8 1, i8* %7
br label %234
76: ; preds = %71
%77 = load i8, i8* %4
%78 = sext i8 %77 to i32
%79 = icmp eq i32 %78, 54
br i1 %79, label %80, label %81
80: ; preds = %76
store i8 6, i8* %6
store i8 1, i8* %7
br label %233
81: ; preds = %76
%82 = load i8, i8* %4
%83 = sext i8 %82 to i32
%84 = icmp eq i32 %83, 55
br i1 %84, label %85, label %86
85: ; preds = %81
store i8 7, i8* %6
store i8 1, i8* %7
br label %232
86: ; preds = %81
%87 = load i8, i8* %4
%88 = sext i8 %87 to i32
%89 = icmp eq i32 %88, 56
br i1 %89, label %90, label %91
90: ; preds = %86
store i8 8, i8* %6
store i8 1, i8* %7
br label %231
91: ; preds = %86
%92 = load i8, i8* %4
%93 = sext i8 %92 to i32
%94 = icmp eq i32 %93, 57
br i1 %94, label %95, label %96
95: ; preds = %91
store i8 9, i8* %6
store i8 1, i8* %7
br label %230
96: ; preds = %91
%97 = load i8, i8* %4
%98 = sext i8 %97 to i32
%99 = icmp eq i32 %98, 48
br i1 %99, label %100, label %101
100: ; preds = %96
store i8 0, i8* %6
store i8 1, i8* %7
br label %229
101: ; preds = %96
%102 = load i8, i8* %4
%103 = sext i8 %102 to i32
%104 = icmp eq i32 %103, 45
br i1 %104, label %109, label %105
105: ; preds = %101
%106 = load i8, i8* %4
%107 = sext i8 %106 to i32
%108 = icmp eq i32 %107, 95
br i1 %108, label %109, label %110
109: ; preds = %105, %101
store i8 10, i8* %6
store i8 1, i8* %7
br label %228
110: ; preds = %105
%111 = load i8, i8* %4
%112 = sext i8 %111 to i32
%113 = icmp eq i32 %112, 61
br i1 %113, label %118, label %114
114: ; preds = %110
%115 = load i8, i8* %4
%116 = sext i8 %115 to i32
%117 = icmp eq i32 %116, 43
br i1 %117, label %118, label %119
118: ; preds = %114, %110
store i8 11, i8* %6
store i8 1, i8* %7
br label %227
119: ; preds = %114
%120 = load i8, i8* %4
%121 = sext i8 %120 to i32
%122 = icmp eq i32 %121, 93
br i1 %122, label %127, label %123
123: ; preds = %119
%124 = load i8, i8* %4
%125 = sext i8 %124 to i32
%126 = icmp eq i32 %125, 125
br i1 %126, label %127, label %128
127: ; preds = %123, %119
store i8 14, i8* %6
store i8 1, i8* %7
br label %226
128: ; preds = %123
%129 = load i8, i8* %4
%130 = sext i8 %129 to i32
%131 = icmp eq i32 %130, 113
br i1 %131, label %136, label %132
132: ; preds = %128
%133 = load i8, i8* %4
%134 = sext i8 %133 to i32
%135 = icmp eq i32 %134, 81
br i1 %135, label %136, label %141
136: ; preds = %132, %128
%137 = call i32 @Put(i8 signext 0, i32 0)
%138 = call i32 @Delay(i32 1)
%139 = call i32 @Put(i8 signext 12, i32 0)
%140 = call i32 @Delay(i32 1)
br label %225
141: ; preds = %132
%142 = load i8, i8* %4
%143 = sext i8 %142 to i32
%144 = icmp eq i32 %143, 101
br i1 %144, label %149, label %145
145: ; preds = %141
%146 = load i8, i8* %4
%147 = sext i8 %146 to i32
%148 = icmp eq i32 %147, 69
br i1 %148, label %149, label %151
149: ; preds = %145, %141
%150 = call i32 @Put(i8 signext 97, i32 0)
br label %224
151: ; preds = %145
%152 = load i8, i8* %4
%153 = sext i8 %152 to i32
%154 = icmp eq i32 %153, 114
br i1 %154, label %159, label %155
155: ; preds = %151
%156 = load i8, i8* %4
%157 = sext i8 %156 to i32
%158 = icmp eq i32 %157, 82
br i1 %158, label %159, label %161
159: ; preds = %155, %151
%160 = call i32 @Put(i8 signext 96, i32 0)
br label %223
161: ; preds = %155
%162 = load i8, i8* %4
%163 = sext i8 %162 to i32
%164 = icmp eq i32 %163, 44
br i1 %164, label %169, label %165
165: ; preds = %161
%166 = load i8, i8* %4
%167 = sext i8 %166 to i32
%168 = icmp eq i32 %167, 60
br i1 %168, label %169, label %176
169: ; preds = %165, %161
%170 = call i32 @Put(i8 signext 34, i32 0)
%171 = call i32 @Delay(i32 2)
%172 = call i32 @Put(i8 signext 6, i32 0)
%173 = call i32 @Delay(i32 2)
%174 = call i32 @Put(i8 signext 32, i32 0)
%175 = call i32 @Delay(i32 2)
br label %222
176: ; preds = %165
%177 = load i8, i8* %4
%178 = sext i8 %177 to i32
%179 = icmp eq i32 %178, 46
br i1 %179, label %184, label %180
180: ; preds = %176
%181 = load i8, i8* %4
%182 = sext i8 %181 to i32
%183 = icmp eq i32 %182, 62
br i1 %183, label %184, label %191
184: ; preds = %180, %176
%185 = call i32 @Put(i8 signext 33, i32 0)
%186 = call i32 @Delay(i32 2)
%187 = call i32 @Put(i8 signext 6, i32 0)
%188 = call i32 @Delay(i32 2)
%189 = call i32 @Put(i8 signext 32, i32 0)
%190 = call i32 @Delay(i32 2)
br label %221
191: ; preds = %180
%192 = load i8, i8* %4
%193 = sext i8 %192 to i32
%194 = icmp eq i32 %193, 109
br i1 %194, label %199, label %195
195: ; preds = %191
%196 = load i8, i8* %4
%197 = sext i8 %196 to i32
%198 = icmp eq i32 %197, 77
br i1 %198, label %199, label %205
199: ; preds = %195, %191
%200 = call i32 @Put(i8 signext 33, i32 0)
%201 = call i32 @Delay(i32 2)
%202 = call i32 @Put(i8 signext 15, i32 0)
%203 = call i32 @Delay(i32 2)
%204 = call i32 @Put(i8 signext 32, i32 0)
br label %220
205: ; preds = %195
%206 = load i8, i8* %4
%207 = sext i8 %206 to i32
%208 = icmp eq i32 %207, 110
br i1 %208, label %213, label %209
209: ; preds = %205
%210 = load i8, i8* %4
%211 = sext i8 %210 to i32
%212 = icmp eq i32 %211, 77
br i1 %212, label %213, label %219
213: ; preds = %209, %205
%214 = call i32 @Put(i8 signext 34, i32 0)
%215 = call i32 @Delay(i32 2)
%216 = call i32 @Put(i8 signext 15, i32 0)
%217 = call i32 @Delay(i32 2)
%218 = call i32 @Put(i8 signext 32, i32 0)
br label %219
219: ; preds = %213, %209
br label %220
220: ; preds = %219, %199
br label %221
221: ; preds = %220, %184
br label %222
222: ; preds = %221, %169
br label %223
223: ; preds = %222, %159
br label %224
224: ; preds = %223, %149
br label %225
225: ; preds = %224, %136
br label %226
226: ; preds = %225, %127
br label %227
227: ; preds = %226, %118
br label %228
228: ; preds = %227, %109
br label %229
229: ; preds = %228, %100
br label %230
230: ; preds = %229, %95
br label %231
231: ; preds = %230, %90
br label %232
232: ; preds = %231, %85
br label %233
233: ; preds = %232, %80
br label %234
234: ; preds = %233, %75
br label %235
235: ; preds = %234, %70
br label %236
236: ; preds = %235, %65
br label %237
237: ; preds = %236, %60
br label %238
238: ; preds = %237, %55
br label %239
239: ; preds = %238, %50
br label %240
240: ; preds = %239, %41
br label %241
241: ; preds = %240, %32
br label %242
242: ; preds = %241, %20
%243 = load i8, i8* %7
%244 = sext i8 %243 to i32
%245 = icmp eq i32 %244, 1
br i1 %245, label %246, label %252
246: ; preds = %242
%247 = load i8, i8* %6
%248 = call i32 @Put(i8 signext %247, i32 0)
%249 = call i32 @Delay(i32 1)
%250 = load i8, i8* %5
%251 = call i32 @Put(i8 signext %250, i32 0)
store i8 0, i8* %7
br label %252
252: ; preds = %246, %242
br label %13
}

LLVM IR (-O2):
@.str = [21 x i8] c"Train Command Srv : \00"
define i32 @main() {
%1 = alloca i8
%2 = tail call i32 @console_xy(i32 0, i32 9)
%3 = tail call i32 @cprintf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %4
4: ; preds = %15, %0
%5 = phi i8 [ 0, %0 ], [ %16, %15 ]
%6 = phi i8 [ 12, %0 ], [ %17, %15 ]
%7 = call i32 @Receive(i8* %1, i32 1)
%8 = call i32 @Reply(i32 %7, i32 0, i32 0)
%9 = load i8, i8* %1
%10 = icmp eq i8 %9, 115
br i1 %10, label %11, label %18
11: ; preds = %4
%12 = call i32 @Delay(i32 1)
%13 = call i32 @Put(i8 signext -123, i32 0)
%14 = call i32 @Delay(i32 1)
br label %15
15: ; preds = %11, %36, %42, %58, %64, %66, %49, %38, %31, %76
%16 = phi i8 [ %77, %76 ], [ %5, %11 ], [ %5, %31 ], [ %5, %36 ], [ %5, %38 ], [ %5, %42 ], [ %5, %49 ], [ %5, %58 ], [ %5, %66 ], [ %5, %64 ]
%17 = phi i8 [ %78, %76 ], [ %6, %11 ], [ %6, %31 ], [ %6, %36 ], [ %6, %38 ], [ %6, %42 ], [ %6, %49 ], [ %6, %58 ], [ %6, %66 ], [ %6, %64 ]
br label %4
18: ; preds = %4
%19 = and i8 %9, -33
switch i8 %19, label %20 [
i8 65, label %76
i8 66, label %74
i8 67, label %75
]
20: ; preds = %18
switch i8 %9, label %30 [
i8 49, label %76
i8 50, label %21
i8 51, label %22
i8 52, label %23
i8 53, label %24
i8 54, label %25
i8 55, label %26
i8 56, label %27
i8 57, label %28
i8 48, label %29
i8 95, label %72
i8 45, label %72
i8 61, label %73
i8 43, label %73
]
21: ; preds = %20
br label %76
22: ; preds = %20
br label %76
23: ; preds = %20
br label %76
24: ; preds = %20
br label %76
25: ; preds = %20
br label %76
26: ; preds = %20
br label %76
27: ; preds = %20
br label %76
28: ; preds = %20
br label %76
29: ; preds = %20
br label %76
30: ; preds = %20
switch i8 %19, label %40 [
i8 93, label %76
i8 81, label %31
i8 69, label %36
i8 82, label %38
]
31: ; preds = %30
%32 = call i32 @Put(i8 signext 0, i32 0)
%33 = call i32 @Delay(i32 1)
%34 = call i32 @Put(i8 signext 12, i32 0)
%35 = call i32 @Delay(i32 1)
br label %15
36: ; preds = %30
%37 = call i32 @Put(i8 signext 97, i32 0)
br label %15
38: ; preds = %30
%39 = call i32 @Put(i8 signext 96, i32 0)
br label %15
40: ; preds = %30
%41 = and i8 %9, -17
switch i8 %41, label %56 [
i8 44, label %42
i8 46, label %49
]
42: ; preds = %40
%43 = call i32 @Put(i8 signext 34, i32 0)
%44 = call i32 @Delay(i32 2)
%45 = call i32 @Put(i8 signext 6, i32 0)
%46 = call i32 @Delay(i32 2)
%47 = call i32 @Put(i8 signext 32, i32 0)
%48 = call i32 @Delay(i32 2)
br label %15
49: ; preds = %40
%50 = call i32 @Put(i8 signext 33, i32 0)
%51 = call i32 @Delay(i32 2)
%52 = call i32 @Put(i8 signext 6, i32 0)
%53 = call i32 @Delay(i32 2)
%54 = call i32 @Put(i8 signext 32, i32 0)
%55 = call i32 @Delay(i32 2)
br label %15
56: ; preds = %40
%57 = icmp eq i8 %19, 77
br i1 %57, label %58, label %64
58: ; preds = %56
%59 = call i32 @Put(i8 signext 33, i32 0)
%60 = call i32 @Delay(i32 2)
%61 = call i32 @Put(i8 signext 15, i32 0)
%62 = call i32 @Delay(i32 2)
%63 = call i32 @Put(i8 signext 32, i32 0)
br label %15
64: ; preds = %56
%65 = icmp eq i8 %9, 110
br i1 %65, label %66, label %15
66: ; preds = %64
%67 = call i32 @Put(i8 signext 34, i32 0)
%68 = call i32 @Delay(i32 2)
%69 = call i32 @Put(i8 signext 15, i32 0)
%70 = call i32 @Delay(i32 2)
%71 = call i32 @Put(i8 signext 32, i32 0)
br label %15
72: ; preds = %20, %20
br label %76
73: ; preds = %20, %20
br label %76
74: ; preds = %18
br label %76
75: ; preds = %18
br label %76
76: ; preds = %30, %18, %75, %74, %21, %22, %23, %24, %25, %26, %27, %28, %29, %20, %72, %73
%77 = phi i8 [ 11, %73 ], [ 10, %72 ], [ 14, %30 ], [ 1, %20 ], [ %5, %18 ], [ 0, %29 ], [ 9, %28 ], [ 8, %27 ], [ 7, %26 ], [ 6, %25 ], [ 5, %24 ], [ 4, %23 ], [ 3, %22 ], [ 2, %21 ], [ %5, %74 ], [ %5, %75 ]
%78 = phi i8 [ %6, %73 ], [ %6, %72 ], [ %6, %30 ], [ %6, %20 ], [ 12, %18 ], [ %6, %29 ], [ %6, %28 ], [ %6, %27 ], [ %6, %26 ], [ %6, %25 ], [ %6, %24 ], [ %6, %23 ], [ %6, %22 ], [ %6, %21 ], [ 55, %74 ], [ 57, %75 ]
%79 = call i32 @Put(i8 signext %77, i32 0)
%80 = call i32 @Delay(i32 1)
%81 = call i32 @Put(i8 signext %78, i32 0)
br label %15
}