int proper_mersenne_exponent(int p) {
  switch (p) {
  case 521:
  case 607:
  case 1279:
  case 2203:
  case 2281:
  case 3217:
  case 4253:
  case 4423:
  case 9689:
  case 9941:
  case 11213:
  case 19937:
  case 21701:
  case 23209:
  case 44497:
    return 1;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<proper_mersenne_exponent>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x209,%eax
je     1227 <proper_mersenne_exponent+0x127>
jmp    111d <proper_mersenne_exponent+0x1d>
mov    -0xc(%rbp),%eax
sub    $0x25f,%eax
je     1227 <proper_mersenne_exponent+0x127>
jmp    1130 <proper_mersenne_exponent+0x30>
mov    -0xc(%rbp),%eax
sub    $0x4ff,%eax
je     1227 <proper_mersenne_exponent+0x127>
jmp    1143 <proper_mersenne_exponent+0x43>
mov    -0xc(%rbp),%eax
sub    $0x89b,%eax
je     1227 <proper_mersenne_exponent+0x127>
jmp    1156 <proper_mersenne_exponent+0x56>
mov    -0xc(%rbp),%eax
sub    $0x8e9,%eax
je     1227 <proper_mersenne_exponent+0x127>
jmp    1169 <proper_mersenne_exponent+0x69>
mov    -0xc(%rbp),%eax
sub    $0xc91,%eax
je     1227 <proper_mersenne_exponent+0x127>
jmp    117c <proper_mersenne_exponent+0x7c>
mov    -0xc(%rbp),%eax
sub    $0x109d,%eax
je     1227 <proper_mersenne_exponent+0x127>
jmp    118f <proper_mersenne_exponent+0x8f>
mov    -0xc(%rbp),%eax
sub    $0x1147,%eax
je     1227 <proper_mersenne_exponent+0x127>
jmp    11a2 <proper_mersenne_exponent+0xa2>
mov    -0xc(%rbp),%eax
sub    $0x25d9,%eax
je     1227 <proper_mersenne_exponent+0x127>
jmp    11b5 <proper_mersenne_exponent+0xb5>
mov    -0xc(%rbp),%eax
sub    $0x26d5,%eax
je     1227 <proper_mersenne_exponent+0x127>
jmp    11c8 <proper_mersenne_exponent+0xc8>
mov    -0xc(%rbp),%eax
sub    $0x2bcd,%eax
je     1227 <proper_mersenne_exponent+0x127>
jmp    11db <proper_mersenne_exponent+0xdb>
mov    -0xc(%rbp),%eax
sub    $0x4de1,%eax
je     1227 <proper_mersenne_exponent+0x127>
jmp    11ee <proper_mersenne_exponent+0xee>
mov    -0xc(%rbp),%eax
sub    $0x54c5,%eax
je     1227 <proper_mersenne_exponent+0x127>
jmp    1201 <proper_mersenne_exponent+0x101>
mov    -0xc(%rbp),%eax
sub    $0x5aa9,%eax
je     1227 <proper_mersenne_exponent+0x127>
jmp    1214 <proper_mersenne_exponent+0x114>
mov    -0xc(%rbp),%eax
sub    $0xadd1,%eax
jne    1233 <proper_mersenne_exponent+0x133>
jmp    1227 <proper_mersenne_exponent+0x127>
movl   $0x1,-0x4(%rbp)
jmp    123a <proper_mersenne_exponent+0x13a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<proper_mersenne_exponent>:
mov    $0x1,%eax
cmp    $0x1146,%edi
jle    1132 <proper_mersenne_exponent+0x32>
cmp    $0x4de0,%edi
jg     1154 <proper_mersenne_exponent+0x54>
cmp    $0x26d4,%edi
jg     1188 <proper_mersenne_exponent+0x88>
cmp    $0x1147,%edi
je     1131 <proper_mersenne_exponent+0x31>
cmp    $0x25d9,%edi
jne    11c4 <proper_mersenne_exponent+0xc4>
ret
cmp    $0x89a,%edi
jle    116e <proper_mersenne_exponent+0x6e>
cmp    $0xc90,%edi
jg     119a <proper_mersenne_exponent+0x9a>
cmp    $0x89b,%edi
je     1131 <proper_mersenne_exponent+0x31>
cmp    $0x8e9,%edi
je     1131 <proper_mersenne_exponent+0x31>
jmp    11c4 <proper_mersenne_exponent+0xc4>
cmp    $0x5aa8,%edi
jg     11ac <proper_mersenne_exponent+0xac>
cmp    $0x4de1,%edi
je     1131 <proper_mersenne_exponent+0x31>
cmp    $0x54c5,%edi
je     1131 <proper_mersenne_exponent+0x31>
jmp    11c4 <proper_mersenne_exponent+0xc4>
cmp    $0x209,%edi
je     1131 <proper_mersenne_exponent+0x31>
cmp    $0x25f,%edi
je     1131 <proper_mersenne_exponent+0x31>
cmp    $0x4ff,%edi
je     1131 <proper_mersenne_exponent+0x31>
jmp    11c4 <proper_mersenne_exponent+0xc4>
cmp    $0x26d5,%edi
je     1131 <proper_mersenne_exponent+0x31>
cmp    $0x2bcd,%edi
je     1131 <proper_mersenne_exponent+0x31>
jmp    11c4 <proper_mersenne_exponent+0xc4>
cmp    $0xc91,%edi
je     1131 <proper_mersenne_exponent+0x31>
cmp    $0x109d,%edi
je     1131 <proper_mersenne_exponent+0x31>
jmp    11c4 <proper_mersenne_exponent+0xc4>
cmp    $0x5aa9,%edi
je     1131 <proper_mersenne_exponent+0x31>
cmp    $0xadd1,%edi
je     1131 <proper_mersenne_exponent+0x31>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @proper_mersenne_exponent(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 521, label %5
i32 607, label %5
i32 1279, label %5
i32 2203, label %5
i32 2281, label %5
i32 3217, label %5
i32 4253, label %5
i32 4423, label %5
i32 9689, label %5
i32 9941, label %5
i32 11213, label %5
i32 19937, label %5
i32 21701, label %5
i32 23209, label %5
i32 44497, label %5
]
5: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1
store i32 1, i32* %2
br label %7
6: ; preds = %1
store i32 0, i32* %2
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @proper_mersenne_exponent(i32 %0) {
switch i32 %0, label %2 [
i32 521, label %3
i32 607, label %3
i32 1279, label %3
i32 2203, label %3
i32 2281, label %3
i32 3217, label %3
i32 4253, label %3
i32 4423, label %3
i32 9689, label %3
i32 9941, label %3
i32 11213, label %3
i32 19937, label %3
i32 21701, label %3
i32 23209, label %3
i32 44497, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}