#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*/ printf(char *, ...);
void prtype(int type) {
  switch (type & 0x0f) {
  case 0:
    break;
  case 1:
    printf("void ");
    break;
  case 2:
    printf("char ");
    break;
  case 3:
    printf("short ");
    break;
  case 4:
    printf("long ");
    break;
  default:
    printf("?type%d ", type & 0x0f);
    break;
  }
  switch (type & (0x10 | 0x20)) {
  case 0:
    break;
  case 0x10:
    printf("*");
    break;
  case 0x20:
    printf("far *");
    break;
  case 0x10 | 0x20:
    printf("far *");
    break;
  }
}


x86 assembly (clang, -O0):
<prtype>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf,%eax
mov    %rax,-0x10(%rbp)
sub    $0x4,%eax
ja     1193 <prtype+0x83>
mov    -0x10(%rbp),%rax
lea    0xec7(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
jmp    11a7 <prtype+0x97>
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11a7 <prtype+0x97>
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11a7 <prtype+0x97>
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11a7 <prtype+0x97>
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11a7 <prtype+0x97>
mov    -0x4(%rbp),%esi
and    $0xf,%esi
lea    0xe8d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
and    $0x30,%eax
mov    %eax,-0x14(%rbp)
je     11ee <prtype+0xde>
jmp    11bb <prtype+0xab>
mov    -0x14(%rbp),%eax
sub    $0x10,%eax
je     11f3 <prtype+0xe3>
jmp    11cc <prtype+0xbc>
mov    -0x14(%rbp),%eax
sub    $0x20,%eax
je     1206 <prtype+0xf6>
jmp    11dd <prtype+0xcd>
mov    -0x14(%rbp),%eax
sub    $0x30,%eax
je     1219 <prtype+0x109>
jmp    1227 <prtype+0x117>
jmp    1227 <prtype+0x117>
lea    0xe40(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1227 <prtype+0x117>
lea    0xe29(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1227 <prtype+0x117>
lea    0xe16(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prtype>:
push   %rbx
mov    %edi,%ebx
mov    %edi,%esi
and    $0xf,%esi
cmp    $0x4,%esi
ja     1146 <prtype+0x26>
lea    0xecc(%rip),%rax
movslq (%rax,%rsi,4),%rcx
add    %rax,%rcx
jmp    *%rcx
lea    0xed0(%rip),%rdi
jmp    116f <prtype+0x4f>
lea    0xee0(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1176 <prtype+0x56>
lea    0xebd(%rip),%rdi
jmp    116f <prtype+0x4f>
lea    0xeba(%rip),%rdi
jmp    116f <prtype+0x4f>
lea    0xeb8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
and    $0x30,%ebx
cmp    $0x30,%ebx
je     1193 <prtype+0x73>
cmp    $0x20,%ebx
je     1193 <prtype+0x73>
cmp    $0x10,%ebx
jne    11a2 <prtype+0x82>
mov    $0x2a,%edi
pop    %rbx
jmp    1030 <putchar@plt>
lea    0xe9c(%rip),%rdi
xor    %eax,%eax
pop    %rbx
jmp    1040 <printf@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"void \00"
@.str.1 = [6 x i8] c"char \00"
@.str.2 = [7 x i8] c"short \00"
@.str.3 = [6 x i8] c"long \00"
@.str.4 = [9 x i8] c"?type%d \00"
@.str.5 = [2 x i8] c"*\00"
@.str.6 = [6 x i8] c"far *\00"
define void @prtype(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 15
switch i32 %4, label %14 [
i32 0, label %5
i32 1, label %6
i32 2, label %8
i32 3, label %10
i32 4, label %12
]
5: ; preds = %1
br label %18
6: ; preds = %1
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %18
8: ; preds = %1
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %18
10: ; preds = %1
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
br label %18
12: ; preds = %1
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
br label %18
14: ; preds = %1
%15 = load i32, i32* %2
%16 = and i32 %15, 15
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32 %16)
br label %18
18: ; preds = %14, %12, %10, %8, %6, %5
%19 = load i32, i32* %2
%20 = and i32 %19, 48
switch i32 %20, label %28 [
i32 0, label %21
i32 16, label %22
i32 32, label %24
i32 48, label %26
]
21: ; preds = %18
br label %28
22: ; preds = %18
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
br label %28
24: ; preds = %18
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
br label %28
26: ; preds = %18
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
br label %28
28: ; preds = %18, %26, %24, %22, %21
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"void \00"
@.str.1 = [6 x i8] c"char \00"
@.str.2 = [7 x i8] c"short \00"
@.str.3 = [6 x i8] c"long \00"
@.str.4 = [9 x i8] c"?type%d \00"
@.str.6 = [6 x i8] c"far *\00"
define void @prtype(i32 %0) {
%2 = and i32 %0, 15
switch i32 %2, label %11 [
i32 0, label %13
i32 1, label %3
i32 2, label %5
i32 3, label %7
i32 4, label %9
]
3: ; preds = %1
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %13
5: ; preds = %1
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %13
7: ; preds = %1
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
br label %13
9: ; preds = %1
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
br label %13
11: ; preds = %1
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32 %2)
br label %13
13: ; preds = %11, %9, %7, %5, %3, %1
%14 = and i32 %0, 48
switch i32 %14, label %21 [
i32 48, label %19
i32 16, label %15
i32 32, label %17
]
15: ; preds = %13
%16 = tail call i32 @putchar(i32 42)
br label %21
17: ; preds = %13
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
br label %21
19: ; preds = %13
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
br label %21
21: ; preds = %13, %19, %17, %15
ret void
}