#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 */
scalar_t__ mpz_cmp_ui(int /*<<< orphan*/, int);
int /*<<< orphan*/ mpz_divexact(int /*<<< orphan*/, int /*<<< orphan*/,
                                int /*<<< orphan*/);
int /*<<< orphan*/ mpz_fac_ui(int /*<<< orphan*/, int);
int /*<<< orphan*/ mpz_init(int /*<<< orphan*/);
int /*<<< orphan*/ mpz_set(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  int n, r, s = 0;
  mpz_t x, f[100 + 1];
  mpz_init(x);
  for (n = 0; n <= 100; n++) {
    mpz_init(f[n]);
    mpz_fac_ui(f[n], n);
  }
  for (n = 1; n <= 100; n++) {
    for (r = 1; r <= n; r++) {
      mpz_set(x, f[n]);
      mpz_divexact(x, x, f[r]);
      mpz_divexact(x, x, f[n - r]);
      if (mpz_cmp_ui(x, 1000000) > 0)
        s++;
    }
  }
  printf("%d\n", s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1c0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x20(%rbp),%edi
call   1050 <mpz_init@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0x64,-0x14(%rbp)
jg     11ca <main+0x6a>
movslq -0x14(%rbp),%rax
mov    -0x1c0(%rbp,%rax,4),%edi
call   1050 <mpz_init@plt>
movslq -0x14(%rbp),%rax
mov    -0x1c0(%rbp,%rax,4),%edi
mov    -0x14(%rbp),%esi
call   1060 <mpz_fac_ui@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    118f <main+0x2f>
movl   $0x1,-0x14(%rbp)
cmpl   $0x64,-0x14(%rbp)
jg     1277 <main+0x117>
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     1264 <main+0x104>
mov    -0x20(%rbp),%edi
movslq -0x14(%rbp),%rax
mov    -0x1c0(%rbp,%rax,4),%esi
call   1030 <mpz_set@plt>
mov    -0x20(%rbp),%edi
mov    -0x20(%rbp),%esi
movslq -0x18(%rbp),%rax
mov    -0x1c0(%rbp,%rax,4),%edx
call   1080 <mpz_divexact@plt>
mov    -0x20(%rbp),%edi
mov    -0x20(%rbp),%esi
mov    -0x14(%rbp),%eax
sub    -0x18(%rbp),%eax
cltq
mov    -0x1c0(%rbp,%rax,4),%edx
call   1080 <mpz_divexact@plt>
mov    -0x20(%rbp),%edi
mov    $0xf4240,%esi
call   1070 <mpz_cmp_ui@plt>
cmp    $0x0,%rax
jle    1251 <main+0xf1>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1256 <main+0xf6>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11e2 <main+0x82>
jmp    1269 <main+0x109>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11d1 <main+0x71>
mov    -0x1c(%rbp),%esi
lea    0xd7f(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x1c0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x198,%rsp
call   1050 <mpz_init@plt>
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%rsp,%rbx,4),%ebp
mov    %ebp,%edi
call   1050 <mpz_init@plt>
mov    %ebp,%edi
mov    %ebx,%esi
call   1060 <mpz_fac_ui@plt>
add    $0x1,%rbx
cmp    $0x65,%rbx
jne    1180 <main+0x20>
xor    %r13d,%r13d
mov    $0x1,%r14d
mov    %rsp,%r15
nopl   0x0(%rax)
mov    (%rsp,%r14,4),%r12d
xor    %ebp,%ebp
mov    %r15,%rbx
nopl   0x0(%rax)
mov    %r12d,%esi
call   1030 <mpz_set@plt>
mov    0x4(%rsp,%rbp,4),%edx
call   1080 <mpz_divexact@plt>
mov    (%rbx),%edx
call   1080 <mpz_divexact@plt>
mov    $0xf4240,%esi
call   1070 <mpz_cmp_ui@plt>
xor    %ecx,%ecx
test   %rax,%rax
setg   %cl
add    %ecx,%r13d
add    $0xfffffffffffffffc,%rbx
add    $0x1,%rbp
cmp    %rbp,%r14
jne    11c0 <main+0x60>
add    $0x1,%r14
add    $0x4,%r15
cmp    $0x65,%r14
jne    11b0 <main+0x50>
lea    0xdf1(%rip),%rdi
mov    %r13d,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x198,%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(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca [101 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %8
%11 = load i32, i32* %9
%12 = call i32 @mpz_init(i32 %11)
store i32 0, i32* %6
br label %13
13: ; preds = %28, %2
%14 = load i32, i32* %6
%15 = icmp sle i32 %14, 100
br i1 %15, label %16, label %31
16: ; preds = %13
%17 = load i32, i32* %6
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [101 x i32], [101 x i32]* %10, i64 0, i64 %18
%20 = load i32, i32* %19
%21 = call i32 @mpz_init(i32 %20)
%22 = load i32, i32* %6
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [101 x i32], [101 x i32]* %10, i64 0, i64 %23
%25 = load i32, i32* %24
%26 = load i32, i32* %6
%27 = call i32 @mpz_fac_ui(i32 %25, i32 %26)
br label %28
28: ; preds = %16
%29 = load i32, i32* %6
%30 = add nsw i32 %29, 1
store i32 %30, i32* %6
br label %13
31: ; preds = %13
store i32 1, i32* %6
br label %32
32: ; preds = %74, %31
%33 = load i32, i32* %6
%34 = icmp sle i32 %33, 100
br i1 %34, label %35, label %77
35: ; preds = %32
store i32 1, i32* %7
br label %36
36: ; preds = %70, %35
%37 = load i32, i32* %7
%38 = load i32, i32* %6
%39 = icmp sle i32 %37, %38
br i1 %39, label %40, label %73
40: ; preds = %36
%41 = load i32, i32* %9
%42 = load i32, i32* %6
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds [101 x i32], [101 x i32]* %10, i64 0, i64 %43
%45 = load i32, i32* %44
%46 = call i32 @mpz_set(i32 %41, i32 %45)
%47 = load i32, i32* %9
%48 = load i32, i32* %9
%49 = load i32, i32* %7
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds [101 x i32], [101 x i32]* %10, i64 0, i64 %50
%52 = load i32, i32* %51
%53 = call i32 @mpz_divexact(i32 %47, i32 %48, i32 %52)
%54 = load i32, i32* %9
%55 = load i32, i32* %9
%56 = load i32, i32* %6
%57 = load i32, i32* %7
%58 = sub nsw i32 %56, %57
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds [101 x i32], [101 x i32]* %10, i64 0, i64 %59
%61 = load i32, i32* %60
%62 = call i32 @mpz_divexact(i32 %54, i32 %55, i32 %61)
%63 = load i32, i32* %9
%64 = call i64 @mpz_cmp_ui(i32 %63, i32 1000000)
%65 = icmp sgt i64 %64, 0
br i1 %65, label %66, label %69
66: ; preds = %40
%67 = load i32, i32* %8
%68 = add nsw i32 %67, 1
store i32 %68, i32* %8
br label %69
69: ; preds = %66, %40
br label %70
70: ; preds = %69
%71 = load i32, i32* %7
%72 = add nsw i32 %71, 1
store i32 %72, i32* %7
br label %36
73: ; preds = %36
br label %74
74: ; preds = %73
%75 = load i32, i32* %6
%76 = add nsw i32 %75, 1
store i32 %76, i32* %6
br label %32
77: ; preds = %32
%78 = load i32, i32* %8
%79 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %78)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [101 x i32]
%4 = bitcast [101 x i32]* %3 to i8*
%5 = tail call i32 @mpz_init(i32 undef)
br label %6
6: ; preds = %2, %6
%7 = phi i64 [ 0, %2 ], [ %13, %6 ]
%8 = getelementptr inbounds [101 x i32], [101 x i32]* %3, i64 0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 @mpz_init(i32 %9)
%11 = trunc i64 %7 to i32
%12 = tail call i32 @mpz_fac_ui(i32 %9, i32 %11)
%13 = add nuw nsw i64 %7, 1
%14 = icmp eq i64 %13, 101
br i1 %14, label %15, label %6
15: ; preds = %6, %38
%16 = phi i64 [ %39, %38 ], [ 1, %6 ]
%17 = phi i64 [ %40, %38 ], [ 2, %6 ]
%18 = phi i32 [ %35, %38 ], [ 0, %6 ]
%19 = getelementptr inbounds [101 x i32], [101 x i32]* %3, i64 0, i64 %16
%20 = load i32, i32* %19
br label %21
21: ; preds = %15, %21
%22 = phi i64 [ 1, %15 ], [ %36, %21 ]
%23 = phi i32 [ %18, %15 ], [ %35, %21 ]
%24 = tail call i32 @mpz_set(i32 undef, i32 %20)
%25 = getelementptr inbounds [101 x i32], [101 x i32]* %3, i64 0, i64 %22
%26 = load i32, i32* %25
%27 = tail call i32 @mpz_divexact(i32 undef, i32 undef, i32 %26)
%28 = sub nsw i64 %16, %22
%29 = getelementptr inbounds [101 x i32], [101 x i32]* %3, i64 0, i64 %28
%30 = load i32, i32* %29
%31 = tail call i32 @mpz_divexact(i32 undef, i32 undef, i32 %30)
%32 = tail call i64 @mpz_cmp_ui(i32 undef, i32 1000000)
%33 = icmp sgt i64 %32, 0
%34 = zext i1 %33 to i32
%35 = add nsw i32 %23, %34
%36 = add nuw nsw i64 %22, 1
%37 = icmp eq i64 %36, %17
br i1 %37, label %38, label %21
38: ; preds = %21
%39 = add nuw nsw i64 %16, 1
%40 = add nuw nsw i64 %17, 1
%41 = icmp eq i64 %39, 101
br i1 %41, label %42, label %15
42: ; preds = %38
%43 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %35)
ret i32 0
}