#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*/ disableIRQ();
int /*<<< orphan*/ enableIRQ();
int /*<<< orphan*/ eval_get_jname(char const *);
int /*<<< orphan*/ eval_get_pos_message(char const *);
int /*<<< orphan*/ eval_get_pos_set_message(char const *);
int /*<<< orphan*/ eval_send_gen_message(char const *);
int /*<<< orphan*/ eval_set_echo_on_off(char const *);
int /*<<< orphan*/ eval_set_gain_message(char const *);
int /*<<< orphan*/ eval_set_min_max_message(char const *);
int /*<<< orphan*/ eval_set_position_message(char const *);
int /*<<< orphan*/ eval_set_servo_on_off(char const *);
int /*<<< orphan*/ eval_set_state_message(char const *);
int /*<<< orphan*/ eval_set_time(char const *);
int /*<<< orphan*/ send_servo_list();
int /*<<< orphan*/ send_time();
int /*<<< orphan*/ send_zero_pos();
int /*<<< orphan*/ set_current_servo_pos_as_zero();
int eval_seq_base(const char in[]) {
  int found_command = 0;
  found_command = -1;
  switch (in[0]) {
  case '>':
    disableIRQ();
    switch (in[1]) {
    case '$':
      eval_send_gen_message(&in[2]);
    case 'S':
      eval_set_state_message(&in[2]);
      break;
    case 'P':
      eval_set_position_message(&in[2]);
      break;
    case 'G':
      eval_set_gain_message(&in[2]);
      break;
    case 'O':
      eval_set_servo_on_off(&in[2]);
      break;
    case 'M':
      eval_set_min_max_message(&in[2]);
      break;
    case 'T':
      eval_set_time(&in[2]);
      break;
    case 'E':
      eval_set_echo_on_off(&in[2]);
      break;
    case 'Z':
      set_current_servo_pos_as_zero();
      break;
    }
    enableIRQ();
    break;
  case '<':
    switch (in[1]) {
    case 'N':
      disableIRQ();
      eval_get_jname(&in[2]);
      break;
    case 'P':
      disableIRQ();
      eval_get_pos_message(&in[2]);
      break;
    case 'R':
      disableIRQ();
      eval_get_pos_set_message(&in[2]);
      break;
    case 'L':
      disableIRQ();
      send_servo_list();
      break;
    case 'T':
      disableIRQ();
      send_time();
      break;
    case 'Z':
      send_zero_pos();
      break;
    }
    enableIRQ();
  default:
    found_command = -1;
    break;
  }
  return found_command;
}


x86 assembly (clang, -O0):
<eval_seq_base>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0xffffffff,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x10(%rbp)
sub    $0x3c,%eax
je     1326 <eval_seq_base+0x116>
jmp    1242 <eval_seq_base+0x32>
mov    -0x10(%rbp),%eax
sub    $0x3e,%eax
jne    13d3 <eval_seq_base+0x1c3>
jmp    1253 <eval_seq_base+0x43>
xor    %eax,%eax
call   1080 <disableIRQ@plt>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%eax
add    $0xffffffdc,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x36,%eax
ja     131a <eval_seq_base+0x10a>
mov    -0x18(%rbp),%rax
lea    0xdbd(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x8(%rbp),%rdi
add    $0x2,%rdi
call   10f0 <eval_send_gen_message@plt>
mov    -0x8(%rbp),%rdi
add    $0x2,%rdi
call   1060 <eval_set_state_message@plt>
jmp    131a <eval_seq_base+0x10a>
mov    -0x8(%rbp),%rdi
add    $0x2,%rdi
call   10d0 <eval_set_position_message@plt>
jmp    131a <eval_seq_base+0x10a>
mov    -0x8(%rbp),%rdi
add    $0x2,%rdi
call   1030 <eval_set_gain_message@plt>
jmp    131a <eval_seq_base+0x10a>
mov    -0x8(%rbp),%rdi
add    $0x2,%rdi
call   10a0 <eval_set_servo_on_off@plt>
jmp    131a <eval_seq_base+0x10a>
mov    -0x8(%rbp),%rdi
add    $0x2,%rdi
call   1120 <eval_set_min_max_message@plt>
jmp    131a <eval_seq_base+0x10a>
mov    -0x8(%rbp),%rdi
add    $0x2,%rdi
call   1130 <eval_set_time@plt>
jmp    131a <eval_seq_base+0x10a>
mov    -0x8(%rbp),%rdi
add    $0x2,%rdi
call   10c0 <eval_set_echo_on_off@plt>
jmp    131a <eval_seq_base+0x10a>
mov    $0x0,%al
call   1070 <set_current_servo_pos_as_zero@plt>
mov    $0x0,%al
call   1040 <enableIRQ@plt>
jmp    13da <eval_seq_base+0x1ca>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%eax
add    $0xffffffb4,%eax
mov    %eax,%ecx
mov    %rcx,-0x20(%rbp)
sub    $0xe,%eax
ja     13cc <eval_seq_base+0x1bc>
mov    -0x20(%rbp),%rax
lea    0xcb5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x0,%al
call   1080 <disableIRQ@plt>
mov    -0x8(%rbp),%rdi
add    $0x2,%rdi
call   1090 <eval_get_jname@plt>
jmp    13cc <eval_seq_base+0x1bc>
mov    $0x0,%al
call   1080 <disableIRQ@plt>
mov    -0x8(%rbp),%rdi
add    $0x2,%rdi
call   10b0 <eval_get_pos_message@plt>
jmp    13cc <eval_seq_base+0x1bc>
mov    $0x0,%al
call   1080 <disableIRQ@plt>
mov    -0x8(%rbp),%rdi
add    $0x2,%rdi
call   1100 <eval_get_pos_set_message@plt>
jmp    13cc <eval_seq_base+0x1bc>
mov    $0x0,%al
call   1080 <disableIRQ@plt>
mov    $0x0,%al
call   1050 <send_servo_list@plt>
jmp    13cc <eval_seq_base+0x1bc>
mov    $0x0,%al
call   1080 <disableIRQ@plt>
mov    $0x0,%al
call   10e0 <send_time@plt>
jmp    13cc <eval_seq_base+0x1bc>
mov    $0x0,%al
call   1110 <send_zero_pos@plt>
mov    $0x0,%al
call   1040 <enableIRQ@plt>
movl   $0xffffffff,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eval_seq_base>:
push   %rbx
mov    %rdi,%rbx
movsbl (%rdi),%eax
cmp    $0x3c,%eax
je     1266 <eval_seq_base+0x56>
cmp    $0x3e,%eax
jne    1359 <eval_seq_base+0x149>
xor    %eax,%eax
call   1080 <disableIRQ@plt>
movsbl 0x1(%rbx),%eax
add    $0xffffffdc,%eax
cmp    $0x36,%eax
ja     1352 <eval_seq_base+0x142>
lea    0xdf9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0x2(%rbx),%rdi
call   10f0 <eval_send_gen_message@plt>
add    $0x2,%rbx
mov    %rbx,%rdi
call   1060 <eval_set_state_message@plt>
jmp    1352 <eval_seq_base+0x142>
movsbl 0x1(%rbx),%eax
add    $0xffffffb4,%eax
cmp    $0xe,%eax
ja     1352 <eval_seq_base+0x142>
lea    0xd83(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
xor    %eax,%eax
call   1080 <disableIRQ@plt>
xor    %eax,%eax
call   1050 <send_servo_list@plt>
jmp    1352 <eval_seq_base+0x142>
xor    %eax,%eax
call   1080 <disableIRQ@plt>
add    $0x2,%rbx
mov    %rbx,%rdi
call   1090 <eval_get_jname@plt>
jmp    1352 <eval_seq_base+0x142>
xor    %eax,%eax
call   1080 <disableIRQ@plt>
add    $0x2,%rbx
mov    %rbx,%rdi
call   10b0 <eval_get_pos_message@plt>
jmp    1352 <eval_seq_base+0x142>
xor    %eax,%eax
call   1080 <disableIRQ@plt>
add    $0x2,%rbx
mov    %rbx,%rdi
call   1100 <eval_get_pos_set_message@plt>
jmp    1352 <eval_seq_base+0x142>
xor    %eax,%eax
call   1080 <disableIRQ@plt>
xor    %eax,%eax
call   10e0 <send_time@plt>
jmp    1352 <eval_seq_base+0x142>
xor    %eax,%eax
call   1110 <send_zero_pos@plt>
jmp    1352 <eval_seq_base+0x142>
add    $0x2,%rbx
mov    %rbx,%rdi
call   10c0 <eval_set_echo_on_off@plt>
jmp    1352 <eval_seq_base+0x142>
add    $0x2,%rbx
mov    %rbx,%rdi
call   1030 <eval_set_gain_message@plt>
jmp    1352 <eval_seq_base+0x142>
add    $0x2,%rbx
mov    %rbx,%rdi
call   1120 <eval_set_min_max_message@plt>
jmp    1352 <eval_seq_base+0x142>
add    $0x2,%rbx
mov    %rbx,%rdi
call   10a0 <eval_set_servo_on_off@plt>
jmp    1352 <eval_seq_base+0x142>
add    $0x2,%rbx
mov    %rbx,%rdi
call   10d0 <eval_set_position_message@plt>
jmp    1352 <eval_seq_base+0x142>
add    $0x2,%rbx
mov    %rbx,%rdi
call   1130 <eval_set_time@plt>
jmp    1352 <eval_seq_base+0x142>
xor    %eax,%eax
call   1070 <set_current_servo_pos_as_zero@plt>
xor    %eax,%eax
call   1040 <enableIRQ@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @eval_seq_base(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
store i32 -1, i32* %3
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
switch i32 %7, label %80 [
i32 62, label %8
i32 60, label %50
]
8: ; preds = %1
%9 = call i32 (...) @disableIRQ()
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
switch i32 %13, label %48 [
i32 36, label %14
i32 83, label %18
i32 80, label %22
i32 71, label %26
i32 79, label %30
i32 77, label %34
i32 84, label %38
i32 69, label %42
i32 90, label %46
]
14: ; preds = %8
%15 = load i8*, i8** %2
%16 = getelementptr inbounds i8, i8* %15, i64 2
%17 = call i32 @eval_send_gen_message(i8* %16)
br label %18
18: ; preds = %8, %14
%19 = load i8*, i8** %2
%20 = getelementptr inbounds i8, i8* %19, i64 2
%21 = call i32 @eval_set_state_message(i8* %20)
br label %48
22: ; preds = %8
%23 = load i8*, i8** %2
%24 = getelementptr inbounds i8, i8* %23, i64 2
%25 = call i32 @eval_set_position_message(i8* %24)
br label %48
26: ; preds = %8
%27 = load i8*, i8** %2
%28 = getelementptr inbounds i8, i8* %27, i64 2
%29 = call i32 @eval_set_gain_message(i8* %28)
br label %48
30: ; preds = %8
%31 = load i8*, i8** %2
%32 = getelementptr inbounds i8, i8* %31, i64 2
%33 = call i32 @eval_set_servo_on_off(i8* %32)
br label %48
34: ; preds = %8
%35 = load i8*, i8** %2
%36 = getelementptr inbounds i8, i8* %35, i64 2
%37 = call i32 @eval_set_min_max_message(i8* %36)
br label %48
38: ; preds = %8
%39 = load i8*, i8** %2
%40 = getelementptr inbounds i8, i8* %39, i64 2
%41 = call i32 @eval_set_time(i8* %40)
br label %48
42: ; preds = %8
%43 = load i8*, i8** %2
%44 = getelementptr inbounds i8, i8* %43, i64 2
%45 = call i32 @eval_set_echo_on_off(i8* %44)
br label %48
46: ; preds = %8
%47 = call i32 (...) @set_current_servo_pos_as_zero()
br label %48
48: ; preds = %8, %46, %42, %38, %34, %30, %26, %22, %18
%49 = call i32 (...) @enableIRQ()
br label %81
50: ; preds = %1
%51 = load i8*, i8** %2
%52 = getelementptr inbounds i8, i8* %51, i64 1
%53 = load i8, i8* %52
%54 = sext i8 %53 to i32
switch i32 %54, label %78 [
i32 78, label %55
i32 80, label %60
i32 82, label %65
i32 76, label %70
i32 84, label %73
i32 90, label %76
]
55: ; preds = %50
%56 = call i32 (...) @disableIRQ()
%57 = load i8*, i8** %2
%58 = getelementptr inbounds i8, i8* %57, i64 2
%59 = call i32 @eval_get_jname(i8* %58)
br label %78
60: ; preds = %50
%61 = call i32 (...) @disableIRQ()
%62 = load i8*, i8** %2
%63 = getelementptr inbounds i8, i8* %62, i64 2
%64 = call i32 @eval_get_pos_message(i8* %63)
br label %78
65: ; preds = %50
%66 = call i32 (...) @disableIRQ()
%67 = load i8*, i8** %2
%68 = getelementptr inbounds i8, i8* %67, i64 2
%69 = call i32 @eval_get_pos_set_message(i8* %68)
br label %78
70: ; preds = %50
%71 = call i32 (...) @disableIRQ()
%72 = call i32 (...) @send_servo_list()
br label %78
73: ; preds = %50
%74 = call i32 (...) @disableIRQ()
%75 = call i32 (...) @send_time()
br label %78
76: ; preds = %50
%77 = call i32 (...) @send_zero_pos()
br label %78
78: ; preds = %50, %76, %73, %70, %65, %60, %55
%79 = call i32 (...) @enableIRQ()
br label %80
80: ; preds = %1, %78
store i32 -1, i32* %3
br label %81
81: ; preds = %80, %48
%82 = load i32, i32* %3
ret i32 %82
}

LLVM IR (-O2):
define i32 @eval_seq_base(i8* %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
switch i32 %3, label %61 [
i32 62, label %4
i32 60, label %35
]
4: ; preds = %1
%5 = tail call i32 (...) @disableIRQ()
%6 = getelementptr inbounds i8, i8* %0, i64 1
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
switch i32 %8, label %59 [
i32 36, label %9
i32 83, label %12
i32 80, label %15
i32 71, label %18
i32 79, label %21
i32 77, label %24
i32 84, label %27
i32 69, label %30
i32 90, label %33
]
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = tail call i32 @eval_send_gen_message(i8* %10)
br label %12
12: ; preds = %4, %9
%13 = getelementptr inbounds i8, i8* %0, i64 2
%14 = tail call i32 @eval_set_state_message(i8* %13)
br label %59
15: ; preds = %4
%16 = getelementptr inbounds i8, i8* %0, i64 2
%17 = tail call i32 @eval_set_position_message(i8* %16)
br label %59
18: ; preds = %4
%19 = getelementptr inbounds i8, i8* %0, i64 2
%20 = tail call i32 @eval_set_gain_message(i8* %19)
br label %59
21: ; preds = %4
%22 = getelementptr inbounds i8, i8* %0, i64 2
%23 = tail call i32 @eval_set_servo_on_off(i8* %22)
br label %59
24: ; preds = %4
%25 = getelementptr inbounds i8, i8* %0, i64 2
%26 = tail call i32 @eval_set_min_max_message(i8* %25)
br label %59
27: ; preds = %4
%28 = getelementptr inbounds i8, i8* %0, i64 2
%29 = tail call i32 @eval_set_time(i8* %28)
br label %59
30: ; preds = %4
%31 = getelementptr inbounds i8, i8* %0, i64 2
%32 = tail call i32 @eval_set_echo_on_off(i8* %31)
br label %59
33: ; preds = %4
%34 = tail call i32 (...) @set_current_servo_pos_as_zero()
br label %59
35: ; preds = %1
%36 = getelementptr inbounds i8, i8* %0, i64 1
%37 = load i8, i8* %36
%38 = sext i8 %37 to i32
switch i32 %38, label %59 [
i32 78, label %39
i32 80, label %43
i32 82, label %47
i32 76, label %51
i32 84, label %54
i32 90, label %57
]
39: ; preds = %35
%40 = tail call i32 (...) @disableIRQ()
%41 = getelementptr inbounds i8, i8* %0, i64 2
%42 = tail call i32 @eval_get_jname(i8* %41)
br label %59
43: ; preds = %35
%44 = tail call i32 (...) @disableIRQ()
%45 = getelementptr inbounds i8, i8* %0, i64 2
%46 = tail call i32 @eval_get_pos_message(i8* %45)
br label %59
47: ; preds = %35
%48 = tail call i32 (...) @disableIRQ()
%49 = getelementptr inbounds i8, i8* %0, i64 2
%50 = tail call i32 @eval_get_pos_set_message(i8* %49)
br label %59
51: ; preds = %35
%52 = tail call i32 (...) @disableIRQ()
%53 = tail call i32 (...) @send_servo_list()
br label %59
54: ; preds = %35
%55 = tail call i32 (...) @disableIRQ()
%56 = tail call i32 (...) @send_time()
br label %59
57: ; preds = %35
%58 = tail call i32 (...) @send_zero_pos()
br label %59
59: ; preds = %39, %43, %47, %51, %54, %57, %35, %12, %15, %18, %21, %24, %27, %30, %33, %4
%60 = tail call i32 (...) @enableIRQ()
br label %61
61: ; preds = %59, %1
ret i32 -1
}