#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*/ eval_get_current_sine_val(char const *);
int /*<<< orphan*/ eval_new_pattern_message(char const *);
int /*<<< orphan*/ eval_set_servo_coeff_message(char const *);
int /*<<< orphan*/ eval_set_servo_small_coeff_message(char const *);
int /*<<< orphan*/ eval_set_time_message(char const *);
int /*<<< orphan*/ eval_use_pattern_message(char const *);
int /*<<< orphan*/ eval_use_pattern_message_with_end(char const *);
int /*<<< orphan*/ eval_use_short_pattern_message(char const *);
void eval_seq(const char in[]) {
  switch (in[0]) {
  case 'P':
    switch (in[1]) {
    case 'N':
      eval_new_pattern_message(&in[2]);
      break;
    case 'S':
      eval_set_servo_coeff_message(&in[2]);
      break;
    case 'I':
      eval_set_servo_small_coeff_message(&in[2]);
      break;
    case 'U':
      eval_use_pattern_message(&in[2]);
      break;
    case 'P':
      eval_use_short_pattern_message(&in[2]);
      break;
    case 'Y':
      eval_use_pattern_message_with_end(&in[2]);
      break;
    }
    break;
  case 'T':
    switch (in[1]) {
    case 'S':
      eval_set_time_message(&in[2]);
      break;
    }
    break;
  case '?':
    switch (in[1]) {
    case 'S':
      eval_get_current_sine_val(&in[2]);
      break;
    }
    break;
  }
}


x86 assembly (clang, -O0):
<eval_seq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0xc(%rbp)
sub    $0x3f,%eax
je     1286 <eval_seq+0x106>
jmp    11a4 <eval_seq+0x24>
mov    -0xc(%rbp),%eax
sub    $0x50,%eax
je     11c6 <eval_seq+0x46>
jmp    11b5 <eval_seq+0x35>
mov    -0xc(%rbp),%eax
sub    $0x54,%eax
je     1260 <eval_seq+0xe0>
jmp    12ac <eval_seq+0x12c>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%eax
add    $0xffffffb7,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x10,%eax
ja     125b <eval_seq+0xdb>
mov    -0x18(%rbp),%rax
lea    0xe15(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x8(%rbp),%rdi
add    $0x2,%rdi
call   1040 <eval_new_pattern_message@plt>
jmp    125b <eval_seq+0xdb>
mov    -0x8(%rbp),%rdi
add    $0x2,%rdi
call   1070 <eval_set_servo_coeff_message@plt>
jmp    125b <eval_seq+0xdb>
mov    -0x8(%rbp),%rdi
add    $0x2,%rdi
call   1060 <eval_set_servo_small_coeff_message@plt>
jmp    125b <eval_seq+0xdb>
mov    -0x8(%rbp),%rdi
add    $0x2,%rdi
call   1050 <eval_use_pattern_message@plt>
jmp    125b <eval_seq+0xdb>
mov    -0x8(%rbp),%rdi
add    $0x2,%rdi
call   1030 <eval_use_short_pattern_message@plt>
jmp    125b <eval_seq+0xdb>
mov    -0x8(%rbp),%rdi
add    $0x2,%rdi
call   10a0 <eval_use_pattern_message_with_end@plt>
jmp    12ac <eval_seq+0x12c>
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%al
sub    $0x53,%al
jne    1281 <eval_seq+0x101>
jmp    1274 <eval_seq+0xf4>
mov    -0x8(%rbp),%rdi
add    $0x2,%rdi
call   1090 <eval_set_time_message@plt>
jmp    12ac <eval_seq+0x12c>
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%al
sub    $0x53,%al
jne    12a7 <eval_seq+0x127>
jmp    129a <eval_seq+0x11a>
mov    -0x8(%rbp),%rdi
add    $0x2,%rdi
call   1080 <eval_get_current_sine_val@plt>
jmp    12ac <eval_seq+0x12c>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eval_seq>:
movsbl (%rdi),%eax
cmp    $0x3f,%eax
je     11b7 <eval_seq+0x37>
cmp    $0x54,%eax
je     11c6 <eval_seq+0x46>
cmp    $0x50,%eax
jne    11d5 <eval_seq+0x55>
movsbl 0x1(%rdi),%eax
add    $0xffffffb7,%eax
cmp    $0x10,%eax
ja     11d5 <eval_seq+0x55>
lea    0xe5b(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
add    $0x2,%rdi
jmp    1060 <eval_set_servo_small_coeff_message@plt>
cmpb   $0x53,0x1(%rdi)
jne    11d5 <eval_seq+0x55>
add    $0x2,%rdi
jmp    1080 <eval_get_current_sine_val@plt>
cmpb   $0x53,0x1(%rdi)
jne    11d5 <eval_seq+0x55>
add    $0x2,%rdi
jmp    1090 <eval_set_time_message@plt>
ret
add    $0x2,%rdi
jmp    1040 <eval_new_pattern_message@plt>
add    $0x2,%rdi
jmp    1030 <eval_use_short_pattern_message@plt>
add    $0x2,%rdi
jmp    1070 <eval_set_servo_coeff_message@plt>
add    $0x2,%rdi
jmp    1050 <eval_use_pattern_message@plt>
add    $0x2,%rdi
jmp    10a0 <eval_use_pattern_message_with_end@plt>

LLVM IR (-O0):
define void @eval_seq(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
switch i32 %6, label %57 [
i32 80, label %7
i32 84, label %37
i32 63, label %47
]
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
switch i32 %11, label %36 [
i32 78, label %12
i32 83, label %16
i32 73, label %20
i32 85, label %24
i32 80, label %28
i32 89, label %32
]
12: ; preds = %7
%13 = load i8*, i8** %2
%14 = getelementptr inbounds i8, i8* %13, i64 2
%15 = call i32 @eval_new_pattern_message(i8* %14)
br label %36
16: ; preds = %7
%17 = load i8*, i8** %2
%18 = getelementptr inbounds i8, i8* %17, i64 2
%19 = call i32 @eval_set_servo_coeff_message(i8* %18)
br label %36
20: ; preds = %7
%21 = load i8*, i8** %2
%22 = getelementptr inbounds i8, i8* %21, i64 2
%23 = call i32 @eval_set_servo_small_coeff_message(i8* %22)
br label %36
24: ; preds = %7
%25 = load i8*, i8** %2
%26 = getelementptr inbounds i8, i8* %25, i64 2
%27 = call i32 @eval_use_pattern_message(i8* %26)
br label %36
28: ; preds = %7
%29 = load i8*, i8** %2
%30 = getelementptr inbounds i8, i8* %29, i64 2
%31 = call i32 @eval_use_short_pattern_message(i8* %30)
br label %36
32: ; preds = %7
%33 = load i8*, i8** %2
%34 = getelementptr inbounds i8, i8* %33, i64 2
%35 = call i32 @eval_use_pattern_message_with_end(i8* %34)
br label %36
36: ; preds = %7, %32, %28, %24, %20, %16, %12
br label %57
37: ; preds = %1
%38 = load i8*, i8** %2
%39 = getelementptr inbounds i8, i8* %38, i64 1
%40 = load i8, i8* %39
%41 = sext i8 %40 to i32
switch i32 %41, label %46 [
i32 83, label %42
]
42: ; preds = %37
%43 = load i8*, i8** %2
%44 = getelementptr inbounds i8, i8* %43, i64 2
%45 = call i32 @eval_set_time_message(i8* %44)
br label %46
46: ; preds = %37, %42
br label %57
47: ; preds = %1
%48 = load i8*, i8** %2
%49 = getelementptr inbounds i8, i8* %48, i64 1
%50 = load i8, i8* %49
%51 = sext i8 %50 to i32
switch i32 %51, label %56 [
i32 83, label %52
]
52: ; preds = %47
%53 = load i8*, i8** %2
%54 = getelementptr inbounds i8, i8* %53, i64 2
%55 = call i32 @eval_get_current_sine_val(i8* %54)
br label %56
56: ; preds = %47, %52
br label %57
57: ; preds = %1, %56, %46, %36
ret void
}

LLVM IR (-O2):
define void @eval_seq(i8* %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
switch i32 %3, label %40 [
i32 80, label %4
i32 84, label %26
i32 63, label %33
]
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
switch i32 %7, label %40 [
i32 78, label %8
i32 83, label %11
i32 73, label %14
i32 85, label %17
i32 80, label %20
i32 89, label %23
]
8: ; preds = %4
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = tail call i32 @eval_new_pattern_message(i8* %9)
br label %40
11: ; preds = %4
%12 = getelementptr inbounds i8, i8* %0, i64 2
%13 = tail call i32 @eval_set_servo_coeff_message(i8* %12)
br label %40
14: ; preds = %4
%15 = getelementptr inbounds i8, i8* %0, i64 2
%16 = tail call i32 @eval_set_servo_small_coeff_message(i8* %15)
br label %40
17: ; preds = %4
%18 = getelementptr inbounds i8, i8* %0, i64 2
%19 = tail call i32 @eval_use_pattern_message(i8* %18)
br label %40
20: ; preds = %4
%21 = getelementptr inbounds i8, i8* %0, i64 2
%22 = tail call i32 @eval_use_short_pattern_message(i8* %21)
br label %40
23: ; preds = %4
%24 = getelementptr inbounds i8, i8* %0, i64 2
%25 = tail call i32 @eval_use_pattern_message_with_end(i8* %24)
br label %40
26: ; preds = %1
%27 = getelementptr inbounds i8, i8* %0, i64 1
%28 = load i8, i8* %27
%29 = icmp eq i8 %28, 83
br i1 %29, label %30, label %40
30: ; preds = %26
%31 = getelementptr inbounds i8, i8* %0, i64 2
%32 = tail call i32 @eval_set_time_message(i8* %31)
br label %40
33: ; preds = %1
%34 = getelementptr inbounds i8, i8* %0, i64 1
%35 = load i8, i8* %34
%36 = icmp eq i8 %35, 83
br i1 %36, label %37, label %40
37: ; preds = %33
%38 = getelementptr inbounds i8, i8* %0, i64 2
%39 = tail call i32 @eval_get_current_sine_val(i8* %38)
br label %40
40: ; preds = %37, %33, %30, %26, %8, %11, %14, %17, %20, %23, %4, %1
ret void
}