#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 v2s(int id) {
  switch (id) {
  case (0x0001):
    printf(" TELETEXT");
    break;
  case (0x1000):
    printf(" CC");
    break;
  case (0x4000):
    printf(" WSS");
    break;
  case (0x0400):
    printf(" VPS");
    break;
  default:
    printf(" UNKNOWN %x", id);
    break;
  }
}


x86 assembly (clang, -O0):
<v2s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
sub    $0x1,%eax
je     1168 <v2s+0x58>
jmp    112f <v2s+0x1f>
mov    -0x8(%rbp),%eax
sub    $0x400,%eax
je     11a1 <v2s+0x91>
jmp    1142 <v2s+0x32>
mov    -0x8(%rbp),%eax
sub    $0x1000,%eax
je     117b <v2s+0x6b>
jmp    1155 <v2s+0x45>
mov    -0x8(%rbp),%eax
sub    $0x4000,%eax
je     118e <v2s+0x7e>
jmp    11b4 <v2s+0xa4>
lea    0xe91(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11c5 <v2s+0xb5>
lea    0xe88(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11c5 <v2s+0xb5>
lea    0xe79(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11c5 <v2s+0xb5>
lea    0xe6b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11c5 <v2s+0xb5>
mov    -0x4(%rbp),%esi
lea    0xe5a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<v2s>:
mov    %edi,%esi
cmp    $0xfff,%edi
jg     1135 <v2s+0x25>
cmp    $0x1,%esi
je     1161 <v2s+0x51>
cmp    $0x400,%esi
jne    1153 <v2s+0x43>
lea    0xee5(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>
cmp    $0x1000,%esi
je     116f <v2s+0x5f>
cmp    $0x4000,%esi
jne    1153 <v2s+0x43>
lea    0xec2(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>
lea    0xebe(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>
lea    0xe98(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>
lea    0xe94(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [10 x i8] c" TELETEXT\00"
@.str.1 = [4 x i8] c" CC\00"
@.str.2 = [5 x i8] c" WSS\00"
@.str.3 = [5 x i8] c" VPS\00"
@.str.4 = [12 x i8] c" UNKNOWN %x\00"
define void @v2s(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %12 [
i32 1, label %4
i32 4096, label %6
i32 16384, label %8
i32 1024, label %10
]
4: ; preds = %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %15
6: ; preds = %1
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %15
8: ; preds = %1
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %15
10: ; preds = %1
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
br label %15
12: ; preds = %1
%13 = load i32, i32* %2
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i32 %13)
br label %15
15: ; preds = %12, %10, %8, %6, %4
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c" TELETEXT\00"
@.str.1 = [4 x i8] c" CC\00"
@.str.2 = [5 x i8] c" WSS\00"
@.str.3 = [5 x i8] c" VPS\00"
@.str.4 = [12 x i8] c" UNKNOWN %x\00"
define void @v2s(i32 %0) {
switch i32 %0, label %10 [
i32 1, label %2
i32 4096, label %4
i32 16384, label %6
i32 1024, label %8
]
2: ; preds = %1
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %12
4: ; preds = %1
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %12
6: ; preds = %1
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %12
8: ; preds = %1
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
br label %12
10: ; preds = %1
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i32 %0)
br label %12
12: ; preds = %10, %8, %6, %4, %2
ret void
}