int mus_header_writable(int type, int format) {
  switch (type) {
  case 0:
    if (format == -2)
      return (1);
    switch (format) {
    case 2:
    case 3:
    case 1:
    case 8:
    case 5:
    case 4:
    case 9:
    case 6:
    case 11:
      return (1);
      break;
    default:
      return (0);
      break;
    }
    break;
  case 4:
    if (format == -2)
      return (1);
    switch (format) {
    case 3:
    case 1:
    case 8:
    case 5:
    case 10:
    case 16:
    case 11:
      return (1);
      break;
    default:
      return (0);
      break;
    }
    break;
  case 1:
    if (format == -2)
      return (1);
    switch (format) {
    case 1:
    case 8:
    case 5:
    case 3:
    case 2:
    case 6:
    case 4:
    case 9:
    case 7:
    case 14:
    case 10:
    case 16:
    case 11:
      return (1);
      break;
    default:
      return (0);
      break;
    }
    break;
  case 56:
    if (format == -2)
      return (1);
    switch (format) {
    case 1:
    case 8:
    case 5:
    case 3:
      return (1);
      break;
    default:
      return (0);
      break;
    }
    break;
  case 2:
    if (format == -2)
      return (1);
    switch (format) {
    case 2:
    case 6:
    case 7:
    case 12:
    case 10:
    case 16:
    case 11:
      return (1);
      break;
    default:
      return (0);
      break;
    }
    break;
  case 14:
    if (format == -2)
      return (1);
    switch (format) {
    case 2:
    case 6:
    case 1:
    case 5:
    case 4:
      return (1);
      break;
    default:
      return (0);
      break;
    }
    break;
  case 10:
    return (format != 17);
    break;
  default:
    return (0);
    break;
  }
  return (0);
}


x86 assembly (clang, -O0):
<mus_header_writable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %rax,-0x18(%rbp)
sub    $0x38,%rax
ja     13f7 <mus_header_writable+0x2f7>
mov    -0x18(%rbp),%rax
lea    0xeda(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
cmpl   $0xfffffffe,-0xc(%rbp)
jne    1145 <mus_header_writable+0x45>
movl   $0x1,-0x4(%rbp)
jmp    13fe <mus_header_writable+0x2fe>
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
add    $0xffffffff,%eax
sub    $0x6,%eax
jb     1181 <mus_header_writable+0x81>
jmp    115c <mus_header_writable+0x5c>
mov    -0x1c(%rbp),%eax
add    $0xfffffff8,%eax
sub    $0x2,%eax
jb     1181 <mus_header_writable+0x81>
jmp    1170 <mus_header_writable+0x70>
mov    -0x1c(%rbp),%eax
sub    $0xb,%eax
jne    118d <mus_header_writable+0x8d>
jmp    1181 <mus_header_writable+0x81>
movl   $0x1,-0x4(%rbp)
jmp    13fe <mus_header_writable+0x2fe>
movl   $0x0,-0x4(%rbp)
jmp    13fe <mus_header_writable+0x2fe>
cmpl   $0xfffffffe,-0xc(%rbp)
jne    11af <mus_header_writable+0xaf>
movl   $0x1,-0x4(%rbp)
jmp    13fe <mus_header_writable+0x2fe>
mov    -0xc(%rbp),%eax
mov    %eax,-0x20(%rbp)
sub    $0x1,%eax
je     121b <mus_header_writable+0x11b>
jmp    11c3 <mus_header_writable+0xc3>
mov    -0x20(%rbp),%eax
sub    $0x3,%eax
je     121b <mus_header_writable+0x11b>
jmp    11d4 <mus_header_writable+0xd4>
mov    -0x20(%rbp),%eax
sub    $0x5,%eax
je     121b <mus_header_writable+0x11b>
jmp    11e5 <mus_header_writable+0xe5>
mov    -0x20(%rbp),%eax
sub    $0x8,%eax
je     121b <mus_header_writable+0x11b>
jmp    11f6 <mus_header_writable+0xf6>
mov    -0x20(%rbp),%eax
add    $0xfffffff6,%eax
sub    $0x2,%eax
jb     121b <mus_header_writable+0x11b>
jmp    120a <mus_header_writable+0x10a>
mov    -0x20(%rbp),%eax
sub    $0x10,%eax
jne    1227 <mus_header_writable+0x127>
jmp    121b <mus_header_writable+0x11b>
movl   $0x1,-0x4(%rbp)
jmp    13fe <mus_header_writable+0x2fe>
movl   $0x0,-0x4(%rbp)
jmp    13fe <mus_header_writable+0x2fe>
cmpl   $0xfffffffe,-0xc(%rbp)
jne    1249 <mus_header_writable+0x149>
movl   $0x1,-0x4(%rbp)
jmp    13fe <mus_header_writable+0x2fe>
mov    -0xc(%rbp),%eax
mov    %eax,-0x24(%rbp)
add    $0xffffffff,%eax
sub    $0xb,%eax
jb     1282 <mus_header_writable+0x182>
jmp    1260 <mus_header_writable+0x160>
mov    -0x24(%rbp),%eax
sub    $0xe,%eax
je     1282 <mus_header_writable+0x182>
jmp    1271 <mus_header_writable+0x171>
mov    -0x24(%rbp),%eax
sub    $0x10,%eax
jne    128e <mus_header_writable+0x18e>
jmp    1282 <mus_header_writable+0x182>
movl   $0x1,-0x4(%rbp)
jmp    13fe <mus_header_writable+0x2fe>
movl   $0x0,-0x4(%rbp)
jmp    13fe <mus_header_writable+0x2fe>
cmpl   $0xfffffffe,-0xc(%rbp)
jne    12b0 <mus_header_writable+0x1b0>
movl   $0x1,-0x4(%rbp)
jmp    13fe <mus_header_writable+0x2fe>
mov    -0xc(%rbp),%eax
mov    %eax,-0x28(%rbp)
sub    $0x1,%eax
je     12f7 <mus_header_writable+0x1f7>
jmp    12c4 <mus_header_writable+0x1c4>
mov    -0x28(%rbp),%eax
sub    $0x3,%eax
je     12f7 <mus_header_writable+0x1f7>
jmp    12d5 <mus_header_writable+0x1d5>
mov    -0x28(%rbp),%eax
sub    $0x5,%eax
je     12f7 <mus_header_writable+0x1f7>
jmp    12e6 <mus_header_writable+0x1e6>
mov    -0x28(%rbp),%eax
sub    $0x8,%eax
jne    1303 <mus_header_writable+0x203>
jmp    12f7 <mus_header_writable+0x1f7>
movl   $0x1,-0x4(%rbp)
jmp    13fe <mus_header_writable+0x2fe>
movl   $0x0,-0x4(%rbp)
jmp    13fe <mus_header_writable+0x2fe>
cmpl   $0xfffffffe,-0xc(%rbp)
jne    1325 <mus_header_writable+0x225>
movl   $0x1,-0x4(%rbp)
jmp    13fe <mus_header_writable+0x2fe>
mov    -0xc(%rbp),%eax
mov    %eax,-0x2c(%rbp)
sub    $0x2,%eax
je     1372 <mus_header_writable+0x272>
jmp    1339 <mus_header_writable+0x239>
mov    -0x2c(%rbp),%eax
add    $0xfffffffa,%eax
sub    $0x2,%eax
jb     1372 <mus_header_writable+0x272>
jmp    134d <mus_header_writable+0x24d>
mov    -0x2c(%rbp),%eax
add    $0xfffffff6,%eax
sub    $0x3,%eax
jb     1372 <mus_header_writable+0x272>
jmp    1361 <mus_header_writable+0x261>
mov    -0x2c(%rbp),%eax
sub    $0x10,%eax
jne    137e <mus_header_writable+0x27e>
jmp    1372 <mus_header_writable+0x272>
movl   $0x1,-0x4(%rbp)
jmp    13fe <mus_header_writable+0x2fe>
movl   $0x0,-0x4(%rbp)
jmp    13fe <mus_header_writable+0x2fe>
cmpl   $0xfffffffe,-0xc(%rbp)
jne    13a0 <mus_header_writable+0x2a0>
movl   $0x1,-0x4(%rbp)
jmp    13fe <mus_header_writable+0x2fe>
mov    -0xc(%rbp),%eax
mov    %eax,-0x30(%rbp)
add    $0xffffffff,%eax
sub    $0x2,%eax
jb     13cb <mus_header_writable+0x2cb>
jmp    13b7 <mus_header_writable+0x2b7>
mov    -0x30(%rbp),%eax
add    $0xfffffffc,%eax
sub    $0x2,%eax
ja     13d7 <mus_header_writable+0x2d7>
jmp    13cb <mus_header_writable+0x2cb>
movl   $0x1,-0x4(%rbp)
jmp    13fe <mus_header_writable+0x2fe>
movl   $0x0,-0x4(%rbp)
jmp    13fe <mus_header_writable+0x2fe>
cmpl   $0x11,-0xc(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    13fe <mus_header_writable+0x2fe>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mus_header_writable>:
xor    %eax,%eax
cmp    $0x38,%edi
ja     1196 <mus_header_writable+0x96>
mov    %edi,%ecx
lea    0xeec(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
add    $0x2,%esi
cmp    $0xe,%esi
jae    1196 <mus_header_writable+0x96>
movslq %esi,%rax
lea    0xfb5(%rip),%rcx
jmp    1193 <mus_header_writable+0x93>
add    $0x2,%esi
cmp    $0x13,%esi
jae    1196 <mus_header_writable+0x96>
movslq %esi,%rax
lea    0x1025(%rip),%rcx
jmp    1193 <mus_header_writable+0x93>
add    $0x2,%esi
cmp    $0x13,%esi
jae    1196 <mus_header_writable+0x96>
movslq %esi,%rax
lea    0x1089(%rip),%rcx
jmp    1193 <mus_header_writable+0x93>
add    $0x2,%esi
cmp    $0x9,%esi
jae    1196 <mus_header_writable+0x96>
movslq %esi,%rax
lea    0x10c1(%rip),%rcx
jmp    1193 <mus_header_writable+0x93>
add    $0x2,%esi
cmp    $0xb,%esi
jae    1196 <mus_header_writable+0x96>
movslq %esi,%rax
lea    0x1035(%rip),%rcx
jmp    1193 <mus_header_writable+0x93>
add    $0x2,%esi
cmp    $0x13,%esi
jae    1196 <mus_header_writable+0x96>
movslq %esi,%rax
lea    0xf89(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret
xor    %eax,%eax
cmp    $0x11,%esi
setne  %al
ret

LLVM IR (-O0):
define i32 @mus_header_writable(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
switch i32 %6, label %59 [
i32 0, label %7
i32 4, label %15
i32 1, label %23
i32 56, label %31
i32 2, label %39
i32 14, label %47
i32 10, label %55
]
7: ; preds = %2
%8 = load i32, i32* %5
%9 = icmp eq i32 %8, -2
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 1, i32* %3
br label %60
11: ; preds = %7
%12 = load i32, i32* %5
switch i32 %12, label %14 [
i32 2, label %13
i32 3, label %13
i32 1, label %13
i32 8, label %13
i32 5, label %13
i32 4, label %13
i32 9, label %13
i32 6, label %13
i32 11, label %13
]
13: ; preds = %11, %11, %11, %11, %11, %11, %11, %11, %11
store i32 1, i32* %3
br label %60
14: ; preds = %11
store i32 0, i32* %3
br label %60
15: ; preds = %2
%16 = load i32, i32* %5
%17 = icmp eq i32 %16, -2
br i1 %17, label %18, label %19
18: ; preds = %15
store i32 1, i32* %3
br label %60
19: ; preds = %15
%20 = load i32, i32* %5
switch i32 %20, label %22 [
i32 3, label %21
i32 1, label %21
i32 8, label %21
i32 5, label %21
i32 10, label %21
i32 16, label %21
i32 11, label %21
]
21: ; preds = %19, %19, %19, %19, %19, %19, %19
store i32 1, i32* %3
br label %60
22: ; preds = %19
store i32 0, i32* %3
br label %60
23: ; preds = %2
%24 = load i32, i32* %5
%25 = icmp eq i32 %24, -2
br i1 %25, label %26, label %27
26: ; preds = %23
store i32 1, i32* %3
br label %60
27: ; preds = %23
%28 = load i32, i32* %5
switch i32 %28, label %30 [
i32 1, label %29
i32 8, label %29
i32 5, label %29
i32 3, label %29
i32 2, label %29
i32 6, label %29
i32 4, label %29
i32 9, label %29
i32 7, label %29
i32 14, label %29
i32 10, label %29
i32 16, label %29
i32 11, label %29
]
29: ; preds = %27, %27, %27, %27, %27, %27, %27, %27, %27, %27, %27, %27, %27
store i32 1, i32* %3
br label %60
30: ; preds = %27
store i32 0, i32* %3
br label %60
31: ; preds = %2
%32 = load i32, i32* %5
%33 = icmp eq i32 %32, -2
br i1 %33, label %34, label %35
34: ; preds = %31
store i32 1, i32* %3
br label %60
35: ; preds = %31
%36 = load i32, i32* %5
switch i32 %36, label %38 [
i32 1, label %37
i32 8, label %37
i32 5, label %37
i32 3, label %37
]
37: ; preds = %35, %35, %35, %35
store i32 1, i32* %3
br label %60
38: ; preds = %35
store i32 0, i32* %3
br label %60
39: ; preds = %2
%40 = load i32, i32* %5
%41 = icmp eq i32 %40, -2
br i1 %41, label %42, label %43
42: ; preds = %39
store i32 1, i32* %3
br label %60
43: ; preds = %39
%44 = load i32, i32* %5
switch i32 %44, label %46 [
i32 2, label %45
i32 6, label %45
i32 7, label %45
i32 12, label %45
i32 10, label %45
i32 16, label %45
i32 11, label %45
]
45: ; preds = %43, %43, %43, %43, %43, %43, %43
store i32 1, i32* %3
br label %60
46: ; preds = %43
store i32 0, i32* %3
br label %60
47: ; preds = %2
%48 = load i32, i32* %5
%49 = icmp eq i32 %48, -2
br i1 %49, label %50, label %51
50: ; preds = %47
store i32 1, i32* %3
br label %60
51: ; preds = %47
%52 = load i32, i32* %5
switch i32 %52, label %54 [
i32 2, label %53
i32 6, label %53
i32 1, label %53
i32 5, label %53
i32 4, label %53
]
53: ; preds = %51, %51, %51, %51, %51
store i32 1, i32* %3
br label %60
54: ; preds = %51
store i32 0, i32* %3
br label %60
55: ; preds = %2
%56 = load i32, i32* %5
%57 = icmp ne i32 %56, 17
%58 = zext i1 %57 to i32
store i32 %58, i32* %3
br label %60
59: ; preds = %2
store i32 0, i32* %3
br label %60
60: ; preds = %59, %55, %54, %53, %50, %46, %45, %42, %38, %37, %34, %30, %29, %26, %22, %21, %18, %14, %13, %10
%61 = load i32, i32* %3
ret i32 %61
}

LLVM IR (-O2):
@switch.table.mus_header_writable = [14 x i32] [i32 1, i32 0, i32 0, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 0, i32 1, i32 1, i32 0, i32 1]
@switch.table.mus_header_writable.1 = [19 x i32] [i32 1, i32 0, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 0, i32 1, i32 0, i32 1, i32 1, i32 0, i32 0, i32 0, i32 0, i32 1]
@switch.table.mus_header_writable.2 = [19 x i32] [i32 1, i32 0, i32 0, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 0, i32 0, i32 1, i32 0, i32 1]
@switch.table.mus_header_writable.3 = [11 x i32] [i32 1, i32 0, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 0, i32 1]
@switch.table.mus_header_writable.4 = [19 x i32] [i32 1, i32 0, i32 0, i32 0, i32 1, i32 0, i32 0, i32 0, i32 1, i32 1, i32 0, i32 0, i32 1, i32 1, i32 1, i32 0, i32 0, i32 0, i32 1]
@switch.table.mus_header_writable.5 = [9 x i32] [i32 1, i32 0, i32 0, i32 1, i32 1, i32 0, i32 1, i32 1, i32 1]
define i32 @mus_header_writable(i32 %0, i32 %1) {
switch i32 %0, label %48 [
i32 0, label %3
i32 4, label %6
i32 1, label %9
i32 56, label %12
i32 2, label %15
i32 14, label %18
i32 10, label %21
]
3: ; preds = %2
%4 = add i32 %1, 2
%5 = icmp ult i32 %4, 14
br i1 %5, label %24, label %48
6: ; preds = %2
%7 = add i32 %1, 2
%8 = icmp ult i32 %7, 19
br i1 %8, label %28, label %48
9: ; preds = %2
%10 = add i32 %1, 2
%11 = icmp ult i32 %10, 19
br i1 %11, label %32, label %48
12: ; preds = %2
%13 = add i32 %1, 2
%14 = icmp ult i32 %13, 11
br i1 %14, label %36, label %48
15: ; preds = %2
%16 = add i32 %1, 2
%17 = icmp ult i32 %16, 19
br i1 %17, label %40, label %48
18: ; preds = %2
%19 = add i32 %1, 2
%20 = icmp ult i32 %19, 9
br i1 %20, label %44, label %48
21: ; preds = %2
%22 = icmp ne i32 %1, 17
%23 = zext i1 %22 to i32
br label %48
24: ; preds = %3
%25 = sext i32 %4 to i64
%26 = getelementptr inbounds [14 x i32], [14 x i32]* @switch.table.mus_header_writable, i64 0, i64 %25
%27 = load i32, i32* %26
br label %48
28: ; preds = %6
%29 = sext i32 %7 to i64
%30 = getelementptr inbounds [19 x i32], [19 x i32]* @switch.table.mus_header_writable.1, i64 0, i64 %29
%31 = load i32, i32* %30
br label %48
32: ; preds = %9
%33 = sext i32 %10 to i64
%34 = getelementptr inbounds [19 x i32], [19 x i32]* @switch.table.mus_header_writable.2, i64 0, i64 %33
%35 = load i32, i32* %34
br label %48
36: ; preds = %12
%37 = sext i32 %13 to i64
%38 = getelementptr inbounds [11 x i32], [11 x i32]* @switch.table.mus_header_writable.3, i64 0, i64 %37
%39 = load i32, i32* %38
br label %48
40: ; preds = %15
%41 = sext i32 %16 to i64
%42 = getelementptr inbounds [19 x i32], [19 x i32]* @switch.table.mus_header_writable.4, i64 0, i64 %41
%43 = load i32, i32* %42
br label %48
44: ; preds = %18
%45 = sext i32 %19 to i64
%46 = getelementptr inbounds [9 x i32], [9 x i32]* @switch.table.mus_header_writable.5, i64 0, i64 %45
%47 = load i32, i32* %46
br label %48
48: ; preds = %18, %44, %15, %40, %12, %36, %9, %32, %6, %28, %3, %24, %2, %21
%49 = phi i32 [ %23, %21 ], [ 0, %2 ], [ %27, %24 ], [ 0, %3 ], [ %31, %28 ], [ 0, %6 ], [ %35, %32 ], [ 0, %9 ], [ %39, %36 ], [ 0, %12 ], [ %43, %40 ], [ 0, %15 ], [ %47, %44 ], [ 0, %18 ]
ret i32 %49
}