#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*/ assert(int /*<<< orphan*/);
signed char code128_switch_code(char from_mode, char to_mode) {
  switch (from_mode) {
  case 'a':
    switch (to_mode) {
    case 'b':
      return 100;
    case 'c':
      return 99;
    }
  case 'b':
    switch (to_mode) {
    case 'a':
      return 101;
    case 'c':
      return 99;
    }
  case 'c':
    switch (to_mode) {
    case 'b':
      return 100;
    case 'a':
      return 101;
    }
  }
  assert(0);
  return -1;
}


x86 assembly (clang, -O0):
<code128_switch_code>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
movsbl -0x2(%rbp),%eax
mov    %eax,-0x8(%rbp)
sub    $0x61,%eax
je     115b <code128_switch_code+0x4b>
jmp    1139 <code128_switch_code+0x29>
mov    -0x8(%rbp),%eax
sub    $0x62,%eax
je     1198 <code128_switch_code+0x88>
jmp    114a <code128_switch_code+0x3a>
mov    -0x8(%rbp),%eax
sub    $0x63,%eax
je     11d5 <code128_switch_code+0xc5>
jmp    1212 <code128_switch_code+0x102>
movsbl -0x3(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x62,%eax
je     1181 <code128_switch_code+0x71>
jmp    1170 <code128_switch_code+0x60>
mov    -0xc(%rbp),%eax
sub    $0x63,%eax
je     118a <code128_switch_code+0x7a>
jmp    1193 <code128_switch_code+0x83>
movb   $0x64,-0x1(%rbp)
jmp    121d <code128_switch_code+0x10d>
movb   $0x63,-0x1(%rbp)
jmp    121d <code128_switch_code+0x10d>
jmp    1198 <code128_switch_code+0x88>
movsbl -0x3(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x61,%eax
je     11be <code128_switch_code+0xae>
jmp    11ad <code128_switch_code+0x9d>
mov    -0x10(%rbp),%eax
sub    $0x63,%eax
je     11c7 <code128_switch_code+0xb7>
jmp    11d0 <code128_switch_code+0xc0>
movb   $0x65,-0x1(%rbp)
jmp    121d <code128_switch_code+0x10d>
movb   $0x63,-0x1(%rbp)
jmp    121d <code128_switch_code+0x10d>
jmp    11d5 <code128_switch_code+0xc5>
movsbl -0x3(%rbp),%eax
mov    %eax,-0x14(%rbp)
sub    $0x61,%eax
je     1204 <code128_switch_code+0xf4>
jmp    11ea <code128_switch_code+0xda>
mov    -0x14(%rbp),%eax
sub    $0x62,%eax
jne    120d <code128_switch_code+0xfd>
jmp    11fb <code128_switch_code+0xeb>
movb   $0x64,-0x1(%rbp)
jmp    121d <code128_switch_code+0x10d>
movb   $0x65,-0x1(%rbp)
jmp    121d <code128_switch_code+0x10d>
jmp    1212 <code128_switch_code+0x102>
xor    %edi,%edi
call   1030 <assert@plt>
movb   $0xff,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<code128_switch_code>:
cmp    $0x61,%edi
je     1125 <code128_switch_code+0x15>
cmp    $0x63,%edi
je     1140 <code128_switch_code+0x30>
cmp    $0x62,%edi
jne    1151 <code128_switch_code+0x41>
movsbl %sil,%eax
jmp    1133 <code128_switch_code+0x23>
movsbl %sil,%eax
cmp    $0x62,%eax
je     1160 <code128_switch_code+0x50>
cmp    $0x63,%eax
je     113d <code128_switch_code+0x2d>
cmp    $0x61,%eax
je     114e <code128_switch_code+0x3e>
cmp    $0x63,%eax
jne    1144 <code128_switch_code+0x34>
mov    $0x63,%al
ret
movsbl %sil,%eax
cmp    $0x62,%eax
je     1160 <code128_switch_code+0x50>
cmp    $0x61,%eax
jne    1151 <code128_switch_code+0x41>
mov    $0x65,%al
ret
push   %rax
xor    %edi,%edi
call   1030 <assert@plt>
mov    $0xff,%al
add    $0x8,%rsp
ret
mov    $0x64,%al
ret

LLVM IR (-O0):
define signext i8 @code128_switch_code(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
store i8 %0, i8* %4
store i8 %1, i8* %5
%6 = load i8, i8* %4
%7 = sext i8 %6 to i32
switch i32 %7, label %26 [
i32 97, label %8
i32 98, label %14
i32 99, label %20
]
8: ; preds = %2
%9 = load i8, i8* %5
%10 = sext i8 %9 to i32
switch i32 %10, label %13 [
i32 98, label %11
i32 99, label %12
]
11: ; preds = %8
store i8 100, i8* %3
br label %28
12: ; preds = %8
store i8 99, i8* %3
br label %28
13: ; preds = %8
br label %14
14: ; preds = %2, %13
%15 = load i8, i8* %5
%16 = sext i8 %15 to i32
switch i32 %16, label %19 [
i32 97, label %17
i32 99, label %18
]
17: ; preds = %14
store i8 101, i8* %3
br label %28
18: ; preds = %14
store i8 99, i8* %3
br label %28
19: ; preds = %14
br label %20
20: ; preds = %2, %19
%21 = load i8, i8* %5
%22 = sext i8 %21 to i32
switch i32 %22, label %25 [
i32 98, label %23
i32 97, label %24
]
23: ; preds = %20
store i8 100, i8* %3
br label %28
24: ; preds = %20
store i8 101, i8* %3
br label %28
25: ; preds = %20
br label %26
26: ; preds = %25, %2
%27 = call i32 @assert(i32 0)
store i8 -1, i8* %3
br label %28
28: ; preds = %26, %24, %23, %18, %17, %12, %11
%29 = load i8, i8* %3
ret i8 %29
}

LLVM IR (-O2):
define signext i8 @code128_switch_code(i8 signext %0, i8 signext %1) {
%3 = sext i8 %0 to i32
switch i32 %3, label %17 [
i32 97, label %8
i32 98, label %4
i32 99, label %6
]
4: ; preds = %2
%5 = sext i8 %1 to i32
br label %11
6: ; preds = %2
%7 = sext i8 %1 to i32
br label %14
8: ; preds = %2
%9 = sext i8 %1 to i32
switch i32 %9, label %11 [
i32 98, label %19
i32 99, label %10
]
10: ; preds = %8
br label %19
11: ; preds = %4, %8
%12 = phi i32 [ %5, %4 ], [ %9, %8 ]
switch i32 %12, label %14 [
i32 97, label %19
i32 99, label %13
]
13: ; preds = %11
br label %19
14: ; preds = %6, %11
%15 = phi i32 [ %7, %6 ], [ %12, %11 ]
switch i32 %15, label %17 [
i32 98, label %19
i32 97, label %16
]
16: ; preds = %14
br label %19
17: ; preds = %14, %2
%18 = tail call i32 @assert(i32 0)
br label %19
19: ; preds = %14, %11, %8, %17, %16, %13, %10
%20 = phi i8 [ -1, %17 ], [ 101, %16 ], [ 99, %13 ], [ 99, %10 ], [ 100, %8 ], [ 101, %11 ], [ 100, %14 ]
ret i8 %20
}