#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 */
typedef int uint8_t;

/* Variables and functions */
uint8_t completion_code(uint8_t *sense) {
  switch (sense[12]) {
  case 0x00:
    return (0x00);
  case 0x20:
    return (0x01);
  case 0x12:
  case 0x21:
    return (0x02);
  case 0x27:
    return (0x03);
  case 0x14:
  case 0x16:
    return (0x04);
  case 0x10:
  case 0x11:
    return (0x10);
  case 0x17:
  case 0x18:
    return (0x11);
  case 0x01:
  case 0x03:
  case 0x05:
  case 0x06:
  case 0x07:
  case 0x08:
  case 0x09:
  case 0x1B:
  case 0x1C:
  case 0x1D:
  case 0x40:
  case 0x41:
  case 0x42:
  case 0x43:
  case 0x44:
  case 0x45:
  case 0x46:
  case 0x47:
  case 0x48:
  case 0x49:
    return (0x20);
  case 0x15:
  case 0x02:
    return (0x40);
  case 0x04:
  case 0x28:
  case 0x29:
  case 0x2a:
    return (0xaa);
  default:
    break;
  };
  return (0xff);
}


x86 assembly (clang, -O0):
<completion_code>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x30(%rax),%eax
mov    %rax,-0x18(%rbp)
sub    $0x49,%rax
ja     11a9 <completion_code+0xa9>
mov    -0x18(%rbp),%rax
lea    0xed8(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x0,-0x4(%rbp)
jmp    11b5 <completion_code+0xb5>
movl   $0x1,-0x4(%rbp)
jmp    11b5 <completion_code+0xb5>
movl   $0x2,-0x4(%rbp)
jmp    11b5 <completion_code+0xb5>
movl   $0x3,-0x4(%rbp)
jmp    11b5 <completion_code+0xb5>
movl   $0x4,-0x4(%rbp)
jmp    11b5 <completion_code+0xb5>
movl   $0x10,-0x4(%rbp)
jmp    11b5 <completion_code+0xb5>
movl   $0x11,-0x4(%rbp)
jmp    11b5 <completion_code+0xb5>
movl   $0x20,-0x4(%rbp)
jmp    11b5 <completion_code+0xb5>
movl   $0x40,-0x4(%rbp)
jmp    11b5 <completion_code+0xb5>
movl   $0xaa,-0x4(%rbp)
jmp    11b5 <completion_code+0xb5>
jmp    11ae <completion_code+0xae>
movl   $0xff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<completion_code>:
movslq 0x30(%rdi),%rcx
mov    $0xff,%eax
cmp    $0x49,%rcx
ja     1119 <completion_code+0x19>
lea    0xeea(%rip),%rax
mov    (%rax,%rcx,4),%eax
ret

LLVM IR (-O0):
define i32 @completion_code(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
store i32* %0, i32** %3
%4 = load i32*, i32** %3
%5 = getelementptr inbounds i32, i32* %4, i64 12
%6 = load i32, i32* %5
switch i32 %6, label %17 [
i32 0, label %7
i32 32, label %8
i32 18, label %9
i32 33, label %9
i32 39, label %10
i32 20, label %11
i32 22, label %11
i32 16, label %12
i32 17, label %12
i32 23, label %13
i32 24, label %13
i32 1, label %14
i32 3, label %14
i32 5, label %14
i32 6, label %14
i32 7, label %14
i32 8, label %14
i32 9, label %14
i32 27, label %14
i32 28, label %14
i32 29, label %14
i32 64, label %14
i32 65, label %14
i32 66, label %14
i32 67, label %14
i32 68, label %14
i32 69, label %14
i32 70, label %14
i32 71, label %14
i32 72, label %14
i32 73, label %14
i32 21, label %15
i32 2, label %15
i32 4, label %16
i32 40, label %16
i32 41, label %16
i32 42, label %16
]
7: ; preds = %1
store i32 0, i32* %2
br label %19
8: ; preds = %1
store i32 1, i32* %2
br label %19
9: ; preds = %1, %1
store i32 2, i32* %2
br label %19
10: ; preds = %1
store i32 3, i32* %2
br label %19
11: ; preds = %1, %1
store i32 4, i32* %2
br label %19
12: ; preds = %1, %1
store i32 16, i32* %2
br label %19
13: ; preds = %1, %1
store i32 17, i32* %2
br label %19
14: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1
store i32 32, i32* %2
br label %19
15: ; preds = %1, %1
store i32 64, i32* %2
br label %19
16: ; preds = %1, %1, %1, %1
store i32 170, i32* %2
br label %19
17: ; preds = %1
br label %18
18: ; preds = %17
store i32 255, i32* %2
br label %19
19: ; preds = %18, %16, %15, %14, %13, %12, %11, %10, %9, %8, %7
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
@switch.table.completion_code = [74 x i32] [i32 0, i32 32, i32 64, i32 32, i32 170, i32 32, i32 32, i32 32, i32 32, i32 32, i32 255, i32 255, i32 255, i32 255, i32 255, i32 255, i32 16, i32 16, i32 2, i32 255, i32 4, i32 64, i32 4, i32 17, i32 17, i32 255, i32 255, i32 32, i32 32, i32 32, i32 255, i32 255, i32 1, i32 2, i32 255, i32 255, i32 255, i32 255, i32 255, i32 3, i32 170, i32 170, i32 170, i32 255, i32 255, i32 255, i32 255, i32 255, i32 255, i32 255, i32 255, i32 255, i32 255, i32 255, i32 255, i32 255, i32 255, i32 255, i32 255, i32 255, i32 255, i32 255, i32 255, i32 255, i32 32, i32 32, i32 32, i32 32, i32 32, i32 32, i32 32, i32 32, i32 32, i32 32]
define i32 @completion_code(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 12
%3 = load i32, i32* %2
%4 = icmp ult i32 %3, 74
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = sext i32 %3 to i64
%7 = getelementptr inbounds [74 x i32], [74 x i32]* @switch.table.completion_code, i64 0, i64 %6
%8 = load i32, i32* %7
br label %9
9: ; preds = %1, %5
%10 = phi i32 [ %8, %5 ], [ 255, %1 ]
ret i32 %10
}