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

/* Variables and functions */
int /*<<< orphan*/ mpz_bin_uiui(int /*<<< orphan*/, int, int);
scalar_t__ mpz_cmp_ui(int /*<<< orphan*/, int);
int /*<<< orphan*/ mpz_init(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  mpz_t b;
  mpz_init(b);
  int n, r;
  int tc = 0;
  for (n = 23; n <= 100; ++n) {
    r = n >> 1;
    if (~n & 1) {
      ++tc;
      --r;
    }
    int c = 0;
    mpz_bin_uiui(b, n, r);
    while (mpz_cmp_ui(b, 1000000) >= 0) {
      ++c;
      --r;
      mpz_bin_uiui(b, n, r);
    }
    tc += (c << 1);
  }
  printf("%d\n", tc);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x8(%rbp),%edi
call   1050 <mpz_init@plt>
movl   $0x0,-0x14(%rbp)
movl   $0x17,-0xc(%rbp)
cmpl   $0x64,-0xc(%rbp)
jg     1207 <main+0xc7>
mov    -0xc(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
xor    $0xffffffff,%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     119c <main+0x5c>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1040 <mpz_bin_uiui@plt>
mov    -0x8(%rbp),%edi
mov    $0xf4240,%esi
call   1060 <mpz_cmp_ui@plt>
cmp    $0x0,%rax
jl     11ed <main+0xad>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1040 <mpz_bin_uiui@plt>
jmp    11b1 <main+0x71>
mov    -0x18(%rbp),%eax
shl    $0x1,%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1165 <main+0x25>
mov    -0x14(%rbp),%esi
lea    0xdef(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
call   1050 <mpz_init@plt>
mov    $0x17,%r13d
xor    %esi,%esi
jmp    116e <main+0x2e>
nopw   0x0(%rax,%rax,1)
lea    (%r14,%rbx,2),%esi
add    $0x1,%r13d
cmp    $0x65,%r13d
je     11e4 <main+0xa4>
mov    %r13d,%r15d
shr    %r15d
mov    %r13d,%r12d
and    $0x1,%r12d
lea    (%r15,%r12,1),%edx
add    $0xffffffff,%edx
mov    %r12d,%r14d
xor    $0x1,%r14d
add    %esi,%r14d
mov    %r13d,%esi
call   1040 <mpz_bin_uiui@plt>
mov    $0xf4240,%esi
call   1060 <mpz_cmp_ui@plt>
mov    $0x0,%ebx
test   %rax,%rax
js     1160 <main+0x20>
lea    (%r15,%r12,1),%ebp
add    $0xfffffffe,%ebp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    (%rbx,%rbp,1),%edx
mov    %r13d,%esi
call   1040 <mpz_bin_uiui@plt>
mov    $0xf4240,%esi
call   1060 <mpz_cmp_ui@plt>
add    $0xffffffff,%ebx
test   %rax,%rax
jns    11c0 <main+0x80>
neg    %ebx
jmp    1160 <main+0x20>
lea    0xe15(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
%7 = load i32, i32* %2
%8 = call i32 @mpz_init(i32 %7)
store i32 0, i32* %5
store i32 23, i32* %3
br label %9
9: ; preds = %47, %0
%10 = load i32, i32* %3
%11 = icmp sle i32 %10, 100
br i1 %11, label %12, label %50
12: ; preds = %9
%13 = load i32, i32* %3
%14 = ashr i32 %13, 1
store i32 %14, i32* %4
%15 = load i32, i32* %3
%16 = xor i32 %15, -1
%17 = and i32 %16, 1
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %24
19: ; preds = %12
%20 = load i32, i32* %5
%21 = add nsw i32 %20, 1
store i32 %21, i32* %5
%22 = load i32, i32* %4
%23 = add nsw i32 %22, -1
store i32 %23, i32* %4
br label %24
24: ; preds = %19, %12
store i32 0, i32* %6
%25 = load i32, i32* %2
%26 = load i32, i32* %3
%27 = load i32, i32* %4
%28 = call i32 @mpz_bin_uiui(i32 %25, i32 %26, i32 %27)
br label %29
29: ; preds = %33, %24
%30 = load i32, i32* %2
%31 = call i64 @mpz_cmp_ui(i32 %30, i32 1000000)
%32 = icmp sge i64 %31, 0
br i1 %32, label %33, label %42
33: ; preds = %29
%34 = load i32, i32* %6
%35 = add nsw i32 %34, 1
store i32 %35, i32* %6
%36 = load i32, i32* %4
%37 = add nsw i32 %36, -1
store i32 %37, i32* %4
%38 = load i32, i32* %2
%39 = load i32, i32* %3
%40 = load i32, i32* %4
%41 = call i32 @mpz_bin_uiui(i32 %38, i32 %39, i32 %40)
br label %29
42: ; preds = %29
%43 = load i32, i32* %6
%44 = shl i32 %43, 1
%45 = load i32, i32* %5
%46 = add nsw i32 %45, %44
store i32 %46, i32* %5
br label %47
47: ; preds = %42
%48 = load i32, i32* %3
%49 = add nsw i32 %48, 1
store i32 %49, i32* %3
br label %9
50: ; preds = %9
%51 = load i32, i32* %5
%52 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %51)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @mpz_init(i32 undef)
br label %2
2: ; preds = %0, %22
%3 = phi i32 [ 0, %0 ], [ %25, %22 ]
%4 = phi i32 [ 23, %0 ], [ %26, %22 ]
%5 = lshr i32 %4, 1
%6 = and i32 %4, 1
%7 = add nsw i32 %6, -1
%8 = add nsw i32 %7, %5
%9 = xor i32 %6, 1
%10 = add nsw i32 %9, %3
%11 = tail call i32 @mpz_bin_uiui(i32 undef, i32 %4, i32 %8)
%12 = tail call i64 @mpz_cmp_ui(i32 undef, i32 1000000)
%13 = icmp sgt i64 %12, -1
br i1 %13, label %14, label %22
14: ; preds = %2, %14
%15 = phi i32 [ %17, %14 ], [ 0, %2 ]
%16 = phi i32 [ %18, %14 ], [ %8, %2 ]
%17 = add nuw nsw i32 %15, 1
%18 = add nsw i32 %16, -1
%19 = tail call i32 @mpz_bin_uiui(i32 undef, i32 %4, i32 %18)
%20 = tail call i64 @mpz_cmp_ui(i32 undef, i32 1000000)
%21 = icmp sgt i64 %20, -1
br i1 %21, label %14, label %22
22: ; preds = %14, %2
%23 = phi i32 [ 0, %2 ], [ %17, %14 ]
%24 = shl nuw i32 %23, 1
%25 = add nsw i32 %10, %24
%26 = add nuw nsw i32 %4, 1
%27 = icmp eq i32 %26, 101
br i1 %27, label %28, label %2
28: ; preds = %22
%29 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %25)
ret i32 0
}