#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*/ uint32_t;

/* Variables and functions */
int CHAR_BIT;
int EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ assert(int);
size_t calc_max_nkeys(long const, long const);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
size_t graph_nverts(size_t const, long const);
int /*<<< orphan*/ is_fastdiv(size_t, size_t const);
int /*<<< orphan*/ printf(char *, size_t const);
int /*<<< orphan*/ stderr;
int strtol(char *, int /*<<< orphan*/ *, int);
int main(int argc, char *argv[]) {
  const long r = argc > 1 ? strtol(argv[1], NULL, 10) : 2;
  const double c = (r == 2) ? 2.125 : 1.25;
  const long hash_bits = argc > 2 ? strtol(argv[2], NULL, 10) : 128;
  if (hash_bits != 32 && hash_bits != 64 && hash_bits != 96 &&
      hash_bits != 128) {
    fprintf(stderr, "wrong number of hash bits (argument #2)");
    return EXIT_FAILURE;
  }
  if (r < 2 || r > 3) {
    fprintf(stderr, "rank can only be 2 or 3 (argument #1)");
    return EXIT_FAILURE;
  }
  const bool full_range = (hash_bits >= r * 32);
  const size_t div_nbits = sizeof(uint32_t) * CHAR_BIT - !full_range;
  const size_t max_nkeys = calc_max_nkeys(hash_bits, r);
  const size_t max_nverts = graph_nverts(max_nkeys, r);
  size_t nkeys, fastdiv = max_nverts / r;
  assert(max_nverts > max_nkeys && max_nverts == fastdiv * r);
  while (!is_fastdiv(fastdiv, div_nbits))
    fastdiv--;
  nkeys = (fastdiv - 1) * r / c;
  while (nkeys <= max_nkeys && graph_nverts(nkeys, r) <= fastdiv * r)
    nkeys++;
  nkeys--;
  printf("max fastdiv       0x%08zx\n", fastdiv);
  printf("max fastdiv nkeys 0x%08zx\n", nkeys);
  printf("max nkeys         0x%08zx\n", max_nkeys);
  printf("max nverts        0x%08zx\n", max_nverts);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    11b1 <main+0x41>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1080 <strtol@plt>
mov    %eax,-0x5c(%rbp)
jmp    11be <main+0x4e>
mov    $0x2,%eax
mov    %eax,-0x5c(%rbp)
jmp    11be <main+0x4e>
mov    -0x5c(%rbp),%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsd  0xe2d(%rip),%xmm0
movsd  0xe2d(%rip),%xmm1
movsd  %xmm1,-0x70(%rbp)
cmp    $0x2,%rax
movsd  %xmm0,-0x68(%rbp)
je     11f9 <main+0x89>
movsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
cmpl   $0x2,-0x8(%rbp)
jle    122b <main+0xbb>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1080 <strtol@plt>
mov    %eax,-0x74(%rbp)
jmp    1238 <main+0xc8>
mov    $0x80,%eax
mov    %eax,-0x74(%rbp)
jmp    1238 <main+0xc8>
mov    -0x74(%rbp),%eax
cltq
mov    %rax,-0x28(%rbp)
cmpq   $0x20,-0x28(%rbp)
je     1296 <main+0x126>
cmpq   $0x40,-0x28(%rbp)
je     1296 <main+0x126>
cmpq   $0x60,-0x28(%rbp)
je     1296 <main+0x126>
cmpq   $0x80,-0x28(%rbp)
je     1296 <main+0x126>
mov    0x2d61(%rip),%rax
mov    (%rax),%edi
lea    0xdc0(%rip),%rsi
call   1070 <fprintf@plt>
mov    0x2d44(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    14c4 <main+0x354>
cmpq   $0x2,-0x18(%rbp)
jl     12ac <main+0x13c>
cmpq   $0x3,-0x18(%rbp)
jle    12d2 <main+0x162>
mov    0x2d25(%rip),%rax
mov    (%rax),%edi
lea    0xdac(%rip),%rsi
call   1070 <fprintf@plt>
mov    0x2d08(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    14c4 <main+0x354>
mov    -0x28(%rbp),%rax
mov    -0x18(%rbp),%rcx
shl    $0x5,%rcx
cmp    %rcx,%rax
setge  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x2c(%rbp)
mov    0x2ced(%rip),%rax
movslq (%rax),%rax
shl    $0x2,%rax
cmpl   $0x0,-0x2c(%rbp)
setne  %cl
xor    $0xff,%cl
and    $0x1,%cl
movzbl %cl,%ecx
movslq %ecx,%rcx
sub    %rcx,%rax
mov    %rax,-0x38(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <calc_max_nkeys@plt>
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1090 <graph_nverts@plt>
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x18(%rbp)
mov    %rax,-0x58(%rbp)
mov    -0x48(%rbp),%rcx
xor    %eax,%eax
cmp    -0x40(%rbp),%rcx
mov    %al,-0x75(%rbp)
jbe    136f <main+0x1ff>
mov    -0x48(%rbp),%rax
mov    -0x58(%rbp),%rcx
imul   -0x18(%rbp),%rcx
cmp    %rcx,%rax
sete   %al
mov    %al,-0x75(%rbp)
mov    -0x75(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    -0x58(%rbp),%rdi
mov    -0x38(%rbp),%rsi
call   1050 <is_fastdiv@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    139e <main+0x22e>
jmp    13af <main+0x23f>
mov    -0x58(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x58(%rbp)
jmp    137c <main+0x20c>
mov    -0x58(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    -0x18(%rbp),%rcx
imul   %rcx,%rax
movq   %rax,%xmm0
movaps 0xc55(%rip),%xmm1
punpckldq %xmm1,%xmm0
movapd 0xc59(%rip),%xmm1
subpd  %xmm1,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x20(%rbp),%xmm1
divsd  %xmm1,%xmm0
movaps %xmm0,%xmm1
cvttsd2si %xmm1,%rax
mov    %rax,%rdx
sar    $0x3f,%rdx
movsd  0xc0a(%rip),%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rcx
and    %rdx,%rcx
or     %rcx,%rax
mov    %rax,-0x50(%rbp)
mov    -0x50(%rbp),%rcx
xor    %eax,%eax
cmp    -0x40(%rbp),%rcx
mov    %al,-0x76(%rbp)
ja     144b <main+0x2db>
mov    -0x50(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1090 <graph_nverts@plt>
mov    -0x58(%rbp),%rcx
imul   -0x18(%rbp),%rcx
cmp    %rcx,%rax
setbe  %al
mov    %al,-0x76(%rbp)
mov    -0x76(%rbp),%al
test   $0x1,%al
jne    145b <main+0x2eb>
jmp    146c <main+0x2fc>
mov    -0x50(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x50(%rbp)
jmp    1419 <main+0x2a9>
mov    -0x50(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x50(%rbp)
mov    -0x58(%rbp),%rsi
lea    0xc0b(%rip),%rdi
call   1030 <printf@plt>
mov    -0x50(%rbp),%rsi
lea    0xc16(%rip),%rdi
call   1030 <printf@plt>
mov    -0x40(%rbp),%rsi
lea    0xc21(%rip),%rdi
call   1030 <printf@plt>
mov    -0x48(%rbp),%rsi
lea    0xc2c(%rip),%rdi
call   1030 <printf@plt>
mov    0x2b09(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
cmp    $0x2,%edi
jl     119a <main+0x2a>
mov    0x8(%rbx),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1080 <strtol@plt>
cmp    $0x2,%eax
jne    11af <main+0x3f>
movsd  0xe66(%rip),%xmm0
movsd  %xmm0,(%rsp)
mov    $0x2,%r12d
jmp    11bf <main+0x4f>
movslq %eax,%r12
movsd  0xe46(%rip),%xmm0
movsd  %xmm0,(%rsp)
mov    $0x80,%edi
cmp    $0x3,%ebp
jl     11dc <main+0x6c>
mov    0x10(%rbx),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1080 <strtol@plt>
movslq %eax,%rdi
lea    -0x20(%rdi),%rax
rol    $0x3b,%rax
cmp    $0x4,%rax
jae    1207 <main+0x97>
lea    -0x4(%r12),%rax
cmp    $0xfffffffffffffffd,%rax
ja     1228 <main+0xb8>
mov    0x2ddc(%rip),%rax
mov    (%rax),%edi
lea    0xe63(%rip),%rsi
jmp    1217 <main+0xa7>
mov    0x2dca(%rip),%rax
mov    (%rax),%edi
lea    0xe29(%rip),%rsi
call   1070 <fprintf@plt>
mov    0x2dad(%rip),%rax
jmp    1370 <main+0x200>
mov    %r12,%rax
shl    $0x5,%rax
xor    %ebx,%ebx
cmp    %rax,%rdi
setl   %bl
mov    0x2da2(%rip),%rax
movslq (%rax),%r13
shl    $0x2,%r13
mov    %r12,%rsi
call   1040 <calc_max_nkeys@plt>
mov    %rax,%r15
mov    %rax,%rdi
mov    %r12,%rsi
call   1090 <graph_nverts@plt>
mov    %rax,%r14
or     %r12,%rax
shr    $0x20,%rax
je     1274 <main+0x104>
mov    %r14,%rax
xor    %edx,%edx
div    %r12
mov    %rax,%rbp
jmp    127e <main+0x10e>
mov    %r14d,%eax
xor    %edx,%edx
div    %r12d
mov    %eax,%ebp
sub    %rbx,%r13
cmp    %r15,%r14
seta   %al
mov    %rbp,%rcx
imul   %r12,%rcx
cmp    %rcx,%r14
sete   %cl
and    %al,%cl
movzbl %cl,%edi
call   1060 <assert@plt>
xchg   %ax,%ax
mov    %rbp,%rbx
mov    %rbp,%rdi
mov    %r13,%rsi
call   1050 <is_fastdiv@plt>
add    $0xffffffffffffffff,%rbp
test   %eax,%eax
je     12a0 <main+0x130>
imul   %r12,%rbp
movq   %rbp,%xmm0
punpckldq 0xd59(%rip),%xmm0
subpd  0xd61(%rip),%xmm0
movapd %xmm0,%xmm1
unpckhpd %xmm0,%xmm1
addsd  %xmm0,%xmm1
divsd  (%rsp),%xmm1
cvttsd2si %xmm1,%rax
mov    %rax,%rcx
subsd  0xd20(%rip),%xmm1
cvttsd2si %xmm1,%r13
sar    $0x3f,%rcx
and    %rcx,%r13
or     %rax,%r13
cmp    %r13,%r15
jb     1329 <main+0x1b9>
mov    %rbx,%rbp
imul   %r12,%rbp
nopl   0x0(%rax,%rax,1)
mov    %r13,%rdi
mov    %r12,%rsi
call   1090 <graph_nverts@plt>
cmp    %rbp,%rax
ja     1329 <main+0x1b9>
add    $0x1,%r13
cmp    %r15,%r13
jbe    1310 <main+0x1a0>
add    $0xffffffffffffffff,%r13
lea    0xd5a(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
lea    0xd66(%rip),%rdi
mov    %r13,%rsi
call   1030 <printf@plt>
lea    0xd72(%rip),%rdi
mov    %r15,%rsi
call   1030 <printf@plt>
lea    0xd7e(%rip),%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
mov    0x2c58(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [40 x i8] c"wrong number of hash bits (argument)\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [38 x i8] c"rank can only be 2 or 3 (argument)\00"
@CHAR_BIT = global i32 0
@.str.2 = [27 x i8] c"max fastdiv 0x%08zx\0A\00"
@.str.3 = [27 x i8] c"max fastdiv nkeys 0x%08zx\0A\00"
@.str.4 = [27 x i8] c"max nkeys 0x%08zx\0A\00"
@.str.5 = [27 x i8] c"max nverts 0x%08zx\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
%7 = alloca double
%8 = alloca i64
%9 = alloca i32
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
%13 = alloca i64
%14 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%15 = load i32, i32* %4
%16 = icmp sgt i32 %15, 1
br i1 %16, label %17, label %22
17: ; preds = %2
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 1
%20 = load i8*, i8** %19
%21 = call i32 @strtol(i8* %20, i32* null, i32 10)
br label %23
22: ; preds = %2
br label %23
23: ; preds = %22, %17
%24 = phi i32 [ %21, %17 ], [ 2, %22 ]
%25 = sext i32 %24 to i64
store i64 %25, i64* %6
%26 = load i64, i64* %6
%27 = icmp eq i64 %26, 2
%28 = zext i1 %27 to i64
%29 = select i1 %27, double 2.125000e+00, double 1.250000e+00
store double %29, double* %7
%30 = load i32, i32* %4
%31 = icmp sgt i32 %30, 2
br i1 %31, label %32, label %37
32: ; preds = %23
%33 = load i8**, i8*** %5
%34 = getelementptr inbounds i8*, i8** %33, i64 2
%35 = load i8*, i8** %34
%36 = call i32 @strtol(i8* %35, i32* null, i32 10)
br label %38
37: ; preds = %23
br label %38
38: ; preds = %37, %32
%39 = phi i32 [ %36, %32 ], [ 128, %37 ]
%40 = sext i32 %39 to i64
store i64 %40, i64* %8
%41 = load i64, i64* %8
%42 = icmp ne i64 %41, 32
br i1 %42, label %43, label %56
43: ; preds = %38
%44 = load i64, i64* %8
%45 = icmp ne i64 %44, 64
br i1 %45, label %46, label %56
46: ; preds = %43
%47 = load i64, i64* %8
%48 = icmp ne i64 %47, 96
br i1 %48, label %49, label %56
49: ; preds = %46
%50 = load i64, i64* %8
%51 = icmp ne i64 %50, 128
br i1 %51, label %52, label %56
52: ; preds = %49
%53 = load i32, i32* @stderr
%54 = call i32 @fprintf(i32 %53, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%55 = load i32, i32* @EXIT_FAILURE
store i32 %55, i32* %3
br label %150
56: ; preds = %49, %46, %43, %38
%57 = load i64, i64* %6
%58 = icmp slt i64 %57, 2
br i1 %58, label %62, label %59
59: ; preds = %56
%60 = load i64, i64* %6
%61 = icmp sgt i64 %60, 3
br i1 %61, label %62, label %66
62: ; preds = %59, %56
%63 = load i32, i32* @stderr
%64 = call i32 @fprintf(i32 %63, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%65 = load i32, i32* @EXIT_FAILURE
store i32 %65, i32* %3
br label %150
66: ; preds = %59
%67 = load i64, i64* %8
%68 = load i64, i64* %6
%69 = mul nsw i64 %68, 32
%70 = icmp sge i64 %67, %69
%71 = zext i1 %70 to i32
store i32 %71, i32* %9
%72 = load i32, i32* @CHAR_BIT
%73 = sext i32 %72 to i64
%74 = mul i64 4, %73
%75 = load i32, i32* %9
%76 = icmp ne i32 %75, 0
%77 = xor i1 %76, true
%78 = zext i1 %77 to i32
%79 = sext i32 %78 to i64
%80 = sub i64 %74, %79
store i64 %80, i64* %10
%81 = load i64, i64* %8
%82 = load i64, i64* %6
%83 = call i64 @calc_max_nkeys(i64 %81, i64 %82)
store i64 %83, i64* %11
%84 = load i64, i64* %11
%85 = load i64, i64* %6
%86 = call i64 @graph_nverts(i64 %84, i64 %85)
store i64 %86, i64* %12
%87 = load i64, i64* %12
%88 = load i64, i64* %6
%89 = udiv i64 %87, %88
store i64 %89, i64* %14
%90 = load i64, i64* %12
%91 = load i64, i64* %11
%92 = icmp ugt i64 %90, %91
br i1 %92, label %93, label %99
93: ; preds = %66
%94 = load i64, i64* %12
%95 = load i64, i64* %14
%96 = load i64, i64* %6
%97 = mul i64 %95, %96
%98 = icmp eq i64 %94, %97
br label %99
99: ; preds = %93, %66
%100 = phi i1 [ false, %66 ], [ %98, %93 ]
%101 = zext i1 %100 to i32
%102 = call i32 @assert(i32 %101)
br label %103
103: ; preds = %109, %99
%104 = load i64, i64* %14
%105 = load i64, i64* %10
%106 = call i32 @is_fastdiv(i64 %104, i64 %105)
%107 = icmp ne i32 %106, 0
%108 = xor i1 %107, true
br i1 %108, label %109, label %112
109: ; preds = %103
%110 = load i64, i64* %14
%111 = add i64 %110, -1
store i64 %111, i64* %14
br label %103
112: ; preds = %103
%113 = load i64, i64* %14
%114 = sub i64 %113, 1
%115 = load i64, i64* %6
%116 = mul i64 %114, %115
%117 = uitofp i64 %116 to double
%118 = load double, double* %7
%119 = fdiv double %117, %118
%120 = fptoui double %119 to i64
store i64 %120, i64* %13
br label %121
121: ; preds = %135, %112
%122 = load i64, i64* %13
%123 = load i64, i64* %11
%124 = icmp ule i64 %122, %123
br i1 %124, label %125, label %133
125: ; preds = %121
%126 = load i64, i64* %13
%127 = load i64, i64* %6
%128 = call i64 @graph_nverts(i64 %126, i64 %127)
%129 = load i64, i64* %14
%130 = load i64, i64* %6
%131 = mul i64 %129, %130
%132 = icmp ule i64 %128, %131
br label %133
133: ; preds = %125, %121
%134 = phi i1 [ false, %121 ], [ %132, %125 ]
br i1 %134, label %135, label %138
135: ; preds = %133
%136 = load i64, i64* %13
%137 = add i64 %136, 1
store i64 %137, i64* %13
br label %121
138: ; preds = %133
%139 = load i64, i64* %13
%140 = add i64 %139, -1
store i64 %140, i64* %13
%141 = load i64, i64* %14
%142 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i64 %141)
%143 = load i64, i64* %13
%144 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i64 %143)
%145 = load i64, i64* %11
%146 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), i64 %145)
%147 = load i64, i64* %12
%148 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0), i64 %147)
%149 = load i32, i32* @EXIT_SUCCESS
store i32 %149, i32* %3
br label %150
150: ; preds = %138, %62, %52
%151 = load i32, i32* %3
ret i32 %151
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [40 x i8] c"wrong number of hash bits (argument)\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [38 x i8] c"rank can only be 2 or 3 (argument)\00"
@CHAR_BIT = global i32 0
@.str.2 = [27 x i8] c"max fastdiv 0x%08zx\0A\00"
@.str.3 = [27 x i8] c"max fastdiv nkeys 0x%08zx\0A\00"
@.str.4 = [27 x i8] c"max nkeys 0x%08zx\0A\00"
@.str.5 = [27 x i8] c"max nverts 0x%08zx\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %10
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @strtol(i8* nocapture %6, i32* null, i32 10)
%8 = sext i32 %7 to i64
%9 = icmp eq i32 %7, 2
br i1 %9, label %10, label %11
10: ; preds = %2, %4
br label %11
11: ; preds = %4, %10
%12 = phi i64 [ 2, %10 ], [ %8, %4 ]
%13 = phi double [ 2.125000e+00, %10 ], [ 1.250000e+00, %4 ]
%14 = icmp sgt i32 %0, 2
br i1 %14, label %15, label %20
15: ; preds = %11
%16 = getelementptr inbounds i8*, i8** %1, i64 2
%17 = load i8*, i8** %16
%18 = tail call i32 @strtol(i8* nocapture %17, i32* null, i32 10)
%19 = sext i32 %18 to i64
br label %20
20: ; preds = %11, %15
%21 = phi i64 [ %19, %15 ], [ 128, %11 ]
%22 = add nsw i64 %21, -32
%23 = tail call i64 @llvm.fshl.i64(i64 %22, i64 %22, i64 59)
%24 = icmp ult i64 %23, 4
br i1 %24, label %28, label %25
25: ; preds = %20
%26 = load i32, i32* @stderr
%27 = tail call i32 @fprintf(i32 %26, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
br label %78
28: ; preds = %20
%29 = add nsw i64 %12, -4
%30 = icmp ult i64 %29, -2
br i1 %30, label %31, label %34
31: ; preds = %28
%32 = load i32, i32* @stderr
%33 = tail call i32 @fprintf(i32 %32, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
br label %78
34: ; preds = %28
%35 = shl nuw nsw i64 %12, 5
%36 = icmp slt i64 %21, %35
%37 = load i32, i32* @CHAR_BIT
%38 = sext i32 %37 to i64
%39 = shl nsw i64 %38, 2
%40 = sext i1 %36 to i64
%41 = add nsw i64 %39, %40
%42 = tail call i64 @calc_max_nkeys(i64 %21, i64 %12)
%43 = tail call i64 @graph_nverts(i64 %42, i64 %12)
%44 = udiv i64 %43, %12
%45 = icmp ugt i64 %43, %42
%46 = mul i64 %44, %12
%47 = icmp eq i64 %43, %46
%48 = select i1 %45, i1 %47, i1 false
%49 = zext i1 %48 to i32
%50 = tail call i32 @assert(i32 %49)
br label %51
51: ; preds = %51, %34
%52 = phi i64 [ %44, %34 ], [ %55, %51 ]
%53 = tail call i32 @is_fastdiv(i64 %52, i64 %41)
%54 = icmp eq i32 %53, 0
%55 = add i64 %52, -1
br i1 %54, label %51, label %56
56: ; preds = %51
%57 = mul i64 %55, %12
%58 = uitofp i64 %57 to double
%59 = fdiv double %58, %13
%60 = fptoui double %59 to i64
%61 = icmp ult i64 %42, %60
br i1 %61, label %71, label %62
62: ; preds = %56
%63 = mul i64 %52, %12
br label %64
64: ; preds = %62, %68
%65 = phi i64 [ %60, %62 ], [ %69, %68 ]
%66 = tail call i64 @graph_nverts(i64 %65, i64 %12)
%67 = icmp ugt i64 %66, %63
br i1 %67, label %71, label %68
68: ; preds = %64
%69 = add i64 %65, 1
%70 = icmp ugt i64 %69, %42
br i1 %70, label %71, label %64
71: ; preds = %64, %68, %56
%72 = phi i64 [ %60, %56 ], [ %69, %68 ], [ %65, %64 ]
%73 = add i64 %72, -1
%74 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i64 %52)
%75 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i64 %73)
%76 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), i64 %42)
%77 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0), i64 %43)
br label %78
78: ; preds = %71, %31, %25
%79 = phi i32* [ @EXIT_FAILURE, %25 ], [ @EXIT_FAILURE, %31 ], [ @EXIT_SUCCESS, %71 ]
%80 = load i32, i32* %79
ret i32 %80
}