#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 */
typedef int /*<<< orphan*/ p;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int get_hashtable_size(int n) {
  static const int p[] = {
      1103,      1217,      1361,      1499,      1657,      1823,
      2011,      2213,      2437,      2683,      2953,      3251,
      3581,      3943,      4339,      4783,      5273,      5801,
      6389,      7039,      7753,      8537,      9391,      10331,
      11369,     12511,     13763,     15149,     16673,     18341,
      20177,     22229,     24469,     26921,     29629,     32603,
      35869,     39461,     43411,     47777,     52561,     57829,
      63617,     69991,     76991,     84691,     93169,     102497,
      112757,    124067,    136481,    150131,    165161,    181693,
      199873,    219871,    241861,    266051,    292661,    321947,
      354143,    389561,    428531,    471389,    518533,    570389,
      627433,    690187,    759223,    835207,    918733,    1010617,
      1111687,   1222889,   1345207,   1479733,   1627723,   1790501,
      1969567,   2166529,   2383219,   2621551,   2883733,   3172123,
      3489347,   3838283,   4222117,   4644329,   5108767,   5619667,
      6181639,   6799811,   7479803,   8227787,   9050599,   9955697,
      10951273,  12046403,  13251047,  14576161,  16033799,  17637203,
      19400929,  21341053,  23475161,  25822679,  28404989,  31245491,
      34370053,  37807061,  41587807,  45746593,  50321261,  55353391,
      60888739,  66977621,  73675391,  81042947,  89147249,  98061979,
      107868203, 118655027, 130520531, 143572609, 157929907, 173722907,
      191095213, 210204763, 231225257, 254347801, 279782593, 307760897,
      338536987, 372390691, 409629809, 450592801, 495652109, 545217341,
      599739083, 659713007, 725684317, 798252779, 878078057, 965885863,
      1062474559};
  const int lp = sizeof(p) / sizeof(p[0]);
  int a = -1;
  int b = lp;
  n += n >> 1;
  while (b - a > 1) {
    int c = ((a + b) >> 1);
    if (p[c] <= n) {
      a = c;
    } else {
      b = c;
    }
  }
  if (a < 0) {
    a++;
  }
  assert(a < lp - 1);
  return p[a];
}


x86 assembly (clang, -O0):
<get_hashtable_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x91,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
movl   $0x91,-0x10(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%eax
sub    -0xc(%rbp),%eax
cmp    $0x1,%eax
jle    1184 <get_hashtable_size+0x74>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x14(%rbp)
movslq -0x14(%rbp),%rcx
lea    0xe9e(%rip),%rax
mov    (%rax,%rcx,4),%eax
cmp    -0x4(%rbp),%eax
jg     1179 <get_hashtable_size+0x69>
mov    -0x14(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    117f <get_hashtable_size+0x6f>
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    113c <get_hashtable_size+0x2c>
cmpl   $0x0,-0xc(%rbp)
jge    1197 <get_hashtable_size+0x87>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x90,-0xc(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movslq -0xc(%rbp),%rcx
lea    0xe4a(%rip),%rax
mov    (%rax,%rcx,4),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_hashtable_size>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%eax
sar    %eax
add    %edi,%eax
mov    $0xffffffff,%ecx
mov    $0x91,%edx
lea    0xed6(%rip),%rbx
jmp    113b <get_hashtable_size+0x2b>
nopl   0x0(%rax)
mov    %esi,%ecx
mov    %edx,%esi
sub    %ecx,%esi
cmp    $0x1,%esi
jle    114c <get_hashtable_size+0x3c>
lea    (%rdx,%rcx,1),%esi
sar    %esi
movslq %esi,%rdi
cmp    %eax,(%rbx,%rdi,4)
jle    1130 <get_hashtable_size+0x20>
mov    %esi,%edx
jmp    1132 <get_hashtable_size+0x22>
mov    %ecx,%ebp
shr    $0x1f,%ebp
add    %ecx,%ebp
xor    %edi,%edi
cmp    $0x90,%ebp
setl   %dil
call   1030 <assert@plt>
movslq %ebp,%rax
mov    (%rbx,%rax,4),%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@get_hashtable_size.p = internal constant [145 x i32] [i32 1103, i32 1217, i32 1361, i32 1499, i32 1657, i32 1823, i32 2011, i32 2213, i32 2437, i32 2683, i32 2953, i32 3251, i32 3581, i32 3943, i32 4339, i32 4783, i32 5273, i32 5801, i32 6389, i32 7039, i32 7753, i32 8537, i32 9391, i32 10331, i32 11369, i32 12511, i32 13763, i32 15149, i32 16673, i32 18341, i32 20177, i32 22229, i32 24469, i32 26921, i32 29629, i32 32603, i32 35869, i32 39461, i32 43411, i32 47777, i32 52561, i32 57829, i32 63617, i32 69991, i32 76991, i32 84691, i32 93169, i32 102497, i32 112757, i32 124067, i32 136481, i32 150131, i32 165161, i32 181693, i32 199873, i32 219871, i32 241861, i32 266051, i32 292661, i32 321947, i32 354143, i32 389561, i32 428531, i32 471389, i32 518533, i32 570389, i32 627433, i32 690187, i32 759223, i32 835207, i32 918733, i32 1010617, i32 1111687, i32 1222889, i32 1345207, i32 1479733, i32 1627723, i32 1790501, i32 1969567, i32 2166529, i32 2383219, i32 2621551, i32 2883733, i32 3172123, i32 3489347, i32 3838283, i32 4222117, i32 4644329, i32 5108767, i32 5619667, i32 6181639, i32 6799811, i32 7479803, i32 8227787, i32 9050599, i32 9955697, i32 10951273, i32 12046403, i32 13251047, i32 14576161, i32 16033799, i32 17637203, i32 19400929, i32 21341053, i32 23475161, i32 25822679, i32 28404989, i32 31245491, i32 34370053, i32 37807061, i32 41587807, i32 45746593, i32 50321261, i32 55353391, i32 60888739, i32 66977621, i32 73675391, i32 81042947, i32 89147249, i32 98061979, i32 107868203, i32 118655027, i32 130520531, i32 143572609, i32 157929907, i32 173722907, i32 191095213, i32 210204763, i32 231225257, i32 254347801, i32 279782593, i32 307760897, i32 338536987, i32 372390691, i32 409629809, i32 450592801, i32 495652109, i32 545217341, i32 599739083, i32 659713007, i32 725684317, i32 798252779, i32 878078057, i32 965885863, i32 1062474559]
define i32 @get_hashtable_size(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %2
store i32 145, i32* %3
store i32 -1, i32* %4
store i32 145, i32* %5
%7 = load i32, i32* %2
%8 = ashr i32 %7, 1
%9 = load i32, i32* %2
%10 = add nsw i32 %9, %8
store i32 %10, i32* %2
br label %11
11: ; preds = %31, %1
%12 = load i32, i32* %5
%13 = load i32, i32* %4
%14 = sub nsw i32 %12, %13
%15 = icmp sgt i32 %14, 1
br i1 %15, label %16, label %32
16: ; preds = %11
%17 = load i32, i32* %4
%18 = load i32, i32* %5
%19 = add nsw i32 %17, %18
%20 = ashr i32 %19, 1
store i32 %20, i32* %6
%21 = load i32, i32* %6
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [145 x i32], [145 x i32]* @get_hashtable_size.p, i64 0, i64 %22
%24 = load i32, i32* %23
%25 = load i32, i32* %2
%26 = icmp sle i32 %24, %25
br i1 %26, label %27, label %29
27: ; preds = %16
%28 = load i32, i32* %6
store i32 %28, i32* %4
br label %31
29: ; preds = %16
%30 = load i32, i32* %6
store i32 %30, i32* %5
br label %31
31: ; preds = %29, %27
br label %11
32: ; preds = %11
%33 = load i32, i32* %4
%34 = icmp slt i32 %33, 0
br i1 %34, label %35, label %38
35: ; preds = %32
%36 = load i32, i32* %4
%37 = add nsw i32 %36, 1
store i32 %37, i32* %4
br label %38
38: ; preds = %35, %32
%39 = load i32, i32* %4
%40 = icmp slt i32 %39, 144
%41 = zext i1 %40 to i32
%42 = call i32 @assert(i32 %41)
%43 = load i32, i32* %4
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds [145 x i32], [145 x i32]* @get_hashtable_size.p, i64 0, i64 %44
%46 = load i32, i32* %45
ret i32 %46
}

LLVM IR (-O2):
@get_hashtable_size.p = internal unnamed_addr constant [145 x i32] [i32 1103, i32 1217, i32 1361, i32 1499, i32 1657, i32 1823, i32 2011, i32 2213, i32 2437, i32 2683, i32 2953, i32 3251, i32 3581, i32 3943, i32 4339, i32 4783, i32 5273, i32 5801, i32 6389, i32 7039, i32 7753, i32 8537, i32 9391, i32 10331, i32 11369, i32 12511, i32 13763, i32 15149, i32 16673, i32 18341, i32 20177, i32 22229, i32 24469, i32 26921, i32 29629, i32 32603, i32 35869, i32 39461, i32 43411, i32 47777, i32 52561, i32 57829, i32 63617, i32 69991, i32 76991, i32 84691, i32 93169, i32 102497, i32 112757, i32 124067, i32 136481, i32 150131, i32 165161, i32 181693, i32 199873, i32 219871, i32 241861, i32 266051, i32 292661, i32 321947, i32 354143, i32 389561, i32 428531, i32 471389, i32 518533, i32 570389, i32 627433, i32 690187, i32 759223, i32 835207, i32 918733, i32 1010617, i32 1111687, i32 1222889, i32 1345207, i32 1479733, i32 1627723, i32 1790501, i32 1969567, i32 2166529, i32 2383219, i32 2621551, i32 2883733, i32 3172123, i32 3489347, i32 3838283, i32 4222117, i32 4644329, i32 5108767, i32 5619667, i32 6181639, i32 6799811, i32 7479803, i32 8227787, i32 9050599, i32 9955697, i32 10951273, i32 12046403, i32 13251047, i32 14576161, i32 16033799, i32 17637203, i32 19400929, i32 21341053, i32 23475161, i32 25822679, i32 28404989, i32 31245491, i32 34370053, i32 37807061, i32 41587807, i32 45746593, i32 50321261, i32 55353391, i32 60888739, i32 66977621, i32 73675391, i32 81042947, i32 89147249, i32 98061979, i32 107868203, i32 118655027, i32 130520531, i32 143572609, i32 157929907, i32 173722907, i32 191095213, i32 210204763, i32 231225257, i32 254347801, i32 279782593, i32 307760897, i32 338536987, i32 372390691, i32 409629809, i32 450592801, i32 495652109, i32 545217341, i32 599739083, i32 659713007, i32 725684317, i32 798252779, i32 878078057, i32 965885863, i32 1062474559]
define i32 @get_hashtable_size(i32 %0) {
%2 = ashr i32 %0, 1
%3 = add nsw i32 %2, %0
br label %4
4: ; preds = %1, %4
%5 = phi i32 [ 145, %1 ], [ %14, %4 ]
%6 = phi i32 [ -1, %1 ], [ %13, %4 ]
%7 = add nsw i32 %5, %6
%8 = ashr i32 %7, 1
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [145 x i32], [145 x i32]* @get_hashtable_size.p, i64 0, i64 %9
%11 = load i32, i32* %10
%12 = icmp sgt i32 %11, %3
%13 = select i1 %12, i32 %6, i32 %8
%14 = select i1 %12, i32 %8, i32 %5
%15 = sub nsw i32 %14, %13
%16 = icmp sgt i32 %15, 1
br i1 %16, label %4, label %17
17: ; preds = %4
%18 = lshr i32 %13, 31
%19 = add nsw i32 %18, %13
%20 = icmp slt i32 %19, 144
%21 = zext i1 %20 to i32
%22 = tail call i32 @assert(i32 %21)
%23 = sext i32 %19 to i64
%24 = getelementptr inbounds [145 x i32], [145 x i32]* @get_hashtable_size.p, i64 0, i64 %23
%25 = load i32, i32* %24
ret i32 %25
}