#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*/ abort();
int swap_pred(int pred) {
  switch (pred) {
  default:
    abort();
  case 32:
  case 33:
    return pred;
  case 38:
    return 40;
  case 40:
    return 38;
  case 39:
    return 41;
  case 41:
    return 39;
  case 34:
    return 36;
  case 36:
    return 34;
  case 35:
    return 37;
  case 37:
    return 35;
  case 0:
  case 15:
  case 1:
  case 6:
  case 9:
  case 14:
  case 7:
  case 8:
    return pred;
  case 2:
    return 4;
  case 4:
    return 2;
  case 3:
    return 5;
  case 5:
    return 3;
  case 10:
    return 12;
  case 12:
    return 10;
  case 11:
    return 13;
  case 13:
    return 11;
  }
}


x86 assembly (clang, -O0):
<swap_pred>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %rax,-0x10(%rbp)
sub    $0x29,%rax
ja     1140 <swap_pred+0x30>
mov    -0x10(%rbp),%rax
lea    0xec9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1218 <swap_pred+0x108>
movl   $0x28,-0x4(%rbp)
jmp    1218 <swap_pred+0x108>
movl   $0x26,-0x4(%rbp)
jmp    1218 <swap_pred+0x108>
movl   $0x29,-0x4(%rbp)
jmp    1218 <swap_pred+0x108>
movl   $0x27,-0x4(%rbp)
jmp    1218 <swap_pred+0x108>
movl   $0x24,-0x4(%rbp)
jmp    1218 <swap_pred+0x108>
movl   $0x22,-0x4(%rbp)
jmp    1218 <swap_pred+0x108>
movl   $0x25,-0x4(%rbp)
jmp    1218 <swap_pred+0x108>
movl   $0x23,-0x4(%rbp)
jmp    1218 <swap_pred+0x108>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1218 <swap_pred+0x108>
movl   $0x4,-0x4(%rbp)
jmp    1218 <swap_pred+0x108>
movl   $0x2,-0x4(%rbp)
jmp    1218 <swap_pred+0x108>
movl   $0x5,-0x4(%rbp)
jmp    1218 <swap_pred+0x108>
movl   $0x3,-0x4(%rbp)
jmp    1218 <swap_pred+0x108>
movl   $0xc,-0x4(%rbp)
jmp    1218 <swap_pred+0x108>
movl   $0xa,-0x4(%rbp)
jmp    1218 <swap_pred+0x108>
movl   $0xd,-0x4(%rbp)
jmp    1218 <swap_pred+0x108>
movl   $0xb,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_pred>:
push   %rax
cmp    $0x2a,%edi
jae    1135 <swap_pred+0x25>
movabs $0x3ff0000ffff,%rax
bt     %rdi,%rax
jae    1135 <swap_pred+0x25>
movslq %edi,%rax
lea    0xed0(%rip),%rcx
mov    (%rcx,%rax,4),%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @swap_pred(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %5 [
i32 32, label %7
i32 33, label %7
i32 38, label %9
i32 40, label %10
i32 39, label %11
i32 41, label %12
i32 34, label %13
i32 36, label %14
i32 35, label %15
i32 37, label %16
i32 0, label %17
i32 15, label %17
i32 1, label %17
i32 6, label %17
i32 9, label %17
i32 14, label %17
i32 7, label %17
i32 8, label %17
i32 2, label %19
i32 4, label %20
i32 3, label %21
i32 5, label %22
i32 10, label %23
i32 12, label %24
i32 11, label %25
i32 13, label %26
]
5: ; preds = %1
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %1, %1
%8 = load i32, i32* %3
store i32 %8, i32* %2
br label %27
9: ; preds = %1
store i32 40, i32* %2
br label %27
10: ; preds = %1
store i32 38, i32* %2
br label %27
11: ; preds = %1
store i32 41, i32* %2
br label %27
12: ; preds = %1
store i32 39, i32* %2
br label %27
13: ; preds = %1
store i32 36, i32* %2
br label %27
14: ; preds = %1
store i32 34, i32* %2
br label %27
15: ; preds = %1
store i32 37, i32* %2
br label %27
16: ; preds = %1
store i32 35, i32* %2
br label %27
17: ; preds = %1, %1, %1, %1, %1, %1, %1, %1
%18 = load i32, i32* %3
store i32 %18, i32* %2
br label %27
19: ; preds = %1
store i32 4, i32* %2
br label %27
20: ; preds = %1
store i32 2, i32* %2
br label %27
21: ; preds = %1
store i32 5, i32* %2
br label %27
22: ; preds = %1
store i32 3, i32* %2
br label %27
23: ; preds = %1
store i32 12, i32* %2
br label %27
24: ; preds = %1
store i32 10, i32* %2
br label %27
25: ; preds = %1
store i32 13, i32* %2
br label %27
26: ; preds = %1
store i32 11, i32* %2
br label %27
27: ; preds = %26, %25, %24, %23, %22, %21, %20, %19, %17, %16, %15, %14, %13, %12, %11, %10, %9, %7
%28 = load i32, i32* %2
ret i32 %28
}

LLVM IR (-O2):
@switch.table.swap_pred = [42 x i32] [i32 0, i32 1, i32 4, i32 5, i32 2, i32 3, i32 6, i32 7, i32 8, i32 9, i32 12, i32 13, i32 10, i32 11, i32 14, i32 15, i32 32, i32 32, i32 32, i32 32, i32 32, i32 32, i32 32, i32 32, i32 32, i32 32, i32 32, i32 32, i32 32, i32 32, i32 32, i32 32, i32 32, i32 33, i32 36, i32 37, i32 34, i32 35, i32 40, i32 41, i32 38, i32 39]
define i32 @swap_pred(i32 %0) {
%2 = icmp ult i32 %0, 42
br i1 %2, label %5, label %3
3: ; preds = %5, %1
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %1
%6 = zext i32 %0 to i64
%7 = lshr i64 4393751609343, %6
%8 = and i64 %7, 1
%9 = icmp eq i64 %8, 0
br i1 %9, label %3, label %10
10: ; preds = %5
%11 = sext i32 %0 to i64
%12 = getelementptr inbounds [42 x i32], [42 x i32]* @switch.table.swap_pred, i64 0, i64 %11
%13 = load i32, i32* %12
ret i32 %13
}