char *TypeFmt(type)
int type;
{
  char *r;
  if (((type)&0x10))
    if (type == (6 + (((~0)) & 0x10)))
      r = "path or region (from TextPath)";
    else
      r = "path";
  else {
    switch (type) {
    case 0:
      r = "INVALID (previously consumed?)";
      break;
    case 3:
      r = "region";
      break;
    case 5:
      r = "XYspace";
      break;
    case 6:
      r = "linestyle";
      break;
    case 1:
      r = "font";
      break;
    case 4:
      r = "picture";
      break;
    case 8:
      r = "path (from StrokePath)";
      break;
    default:
      r = "UNKNOWN";
      break;
    }
  }
  return (r);
}


x86 assembly (clang, -O0):
<TypeFmt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x10,%eax
cmp    $0x0,%eax
je     1140 <TypeFmt+0x40>
cmpl   $0x16,-0x4(%rbp)
jne    1130 <TypeFmt+0x30>
lea    0xefd(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    113b <TypeFmt+0x3b>
lea    0xf0c(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    11e5 <TypeFmt+0xe5>
mov    -0x4(%rbp),%eax
mov    %rax,-0x18(%rbp)
sub    $0x8,%rax
ja     11d5 <TypeFmt+0xd5>
mov    -0x18(%rbp),%rax
lea    0xea4(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xedc(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    11e0 <TypeFmt+0xe0>
lea    0xeeb(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    11e0 <TypeFmt+0xe0>
lea    0xee2(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    11e0 <TypeFmt+0xe0>
lea    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    11e0 <TypeFmt+0xe0>
lea    0xed4(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    11e0 <TypeFmt+0xe0>
lea    0xec9(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    11e0 <TypeFmt+0xe0>
lea    0xec1(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    11e0 <TypeFmt+0xe0>
lea    0xec8(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    11e5 <TypeFmt+0xe5>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TypeFmt>:
test   $0x10,%dil
jne    111d <TypeFmt+0x1d>
cmp    $0x8,%edi
ja     1133 <TypeFmt+0x33>
movslq %edi,%rax
lea    0xf73(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
ret
cmp    $0x16,%edi
lea    0xed9(%rip),%rcx
lea    0xef1(%rip),%rax
cmove  %rcx,%rax
ret
lea    0xf46(%rip),%rax
ret

LLVM IR (-O0):
@.str = [31 x i8] c"path or region (from TextPath)\00"
@.str.1 = [5 x i8] c"path\00"
@.str.2 = [31 x i8] c"INVALID (previously consumed?)\00"
@.str.3 = [7 x i8] c"region\00"
@.str.4 = [8 x i8] c"XYspace\00"
@.str.5 = [10 x i8] c"linestyle\00"
@.str.6 = [5 x i8] c"font\00"
@.str.7 = [8 x i8] c"picture\00"
@.str.8 = [23 x i8] c"path (from StrokePath)\00"
@.str.9 = [8 x i8] c"UNKNOWN\00"
define i8* @TypeFmt(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = and i32 %4, 16
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %1
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 22
br i1 %9, label %10, label %11
10: ; preds = %7
store i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8** %3
br label %12
11: ; preds = %7
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8** %3
br label %12
12: ; preds = %11, %10
br label %24
13: ; preds = %1
%14 = load i32, i32* %2
switch i32 %14, label %22 [
i32 0, label %15
i32 3, label %16
i32 5, label %17
i32 6, label %18
i32 1, label %19
i32 4, label %20
i32 8, label %21
]
15: ; preds = %13
store i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i8** %3
br label %23
16: ; preds = %13
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8** %3
br label %23
17: ; preds = %13
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8** %3
br label %23
18: ; preds = %13
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), i8** %3
br label %23
19: ; preds = %13
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i8** %3
br label %23
20: ; preds = %13
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0), i8** %3
br label %23
21: ; preds = %13
store i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.8, i64 0, i64 0), i8** %3
br label %23
22: ; preds = %13
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0), i8** %3
br label %23
23: ; preds = %22, %21, %20, %19, %18, %17, %16, %15
br label %24
24: ; preds = %23, %12
%25 = load i8*, i8** %3
ret i8* %25
}

LLVM IR (-O2):
@.str = [31 x i8] c"path or region (from TextPath)\00"
@.str.1 = [5 x i8] c"path\00"
@.str.2 = [31 x i8] c"INVALID (previously consumed?)\00"
@.str.3 = [7 x i8] c"region\00"
@.str.4 = [8 x i8] c"XYspace\00"
@.str.5 = [10 x i8] c"linestyle\00"
@.str.6 = [5 x i8] c"font\00"
@.str.7 = [8 x i8] c"picture\00"
@.str.8 = [23 x i8] c"path (from StrokePath)\00"
@.str.9 = [8 x i8] c"UNKNOWN\00"
@reltable.TypeFmt = [9 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([31 x i8]* @.str.2 to i64), i64 ptrtoint ([9 x i32]* @reltable.TypeFmt to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.6 to i64), i64 ptrtoint ([9 x i32]* @reltable.TypeFmt to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.9 to i64), i64 ptrtoint ([9 x i32]* @reltable.TypeFmt to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.3 to i64), i64 ptrtoint ([9 x i32]* @reltable.TypeFmt to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.7 to i64), i64 ptrtoint ([9 x i32]* @reltable.TypeFmt to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.4 to i64), i64 ptrtoint ([9 x i32]* @reltable.TypeFmt to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([10 x i8]* @.str.5 to i64), i64 ptrtoint ([9 x i32]* @reltable.TypeFmt to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.9 to i64), i64 ptrtoint ([9 x i32]* @reltable.TypeFmt to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([23 x i8]* @.str.8 to i64), i64 ptrtoint ([9 x i32]* @reltable.TypeFmt to i64)) to i32)]
define i8* @TypeFmt(i32 %0) {
%2 = and i32 %0, 16
%3 = icmp eq i32 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = icmp eq i32 %0, 22
%6 = select i1 %5, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0)
br label %13
7: ; preds = %1
%8 = icmp ult i32 %0, 9
br i1 %8, label %9, label %13
9: ; preds = %7
%10 = sext i32 %0 to i64
%11 = shl i64 %10, 2
%12 = call i8* @llvm.load.relative.i64(i8* bitcast ([9 x i32]* @reltable.TypeFmt to i8*), i64 %11)
br label %13
13: ; preds = %7, %9, %4
%14 = phi i8* [ %6, %4 ], [ %12, %9 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0), %7 ]
ret i8* %14
}