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

/* Variables and functions */
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ mpz_clear(int /*<<< orphan*/);
int /*<<< orphan*/ mpz_divexact(int /*<<< orphan*/, int /*<<< orphan*/,
                                int /*<<< orphan*/);
int /*<<< orphan*/ mpz_fac_ui(int /*<<< orphan*/, unsigned long);
int /*<<< orphan*/ mpz_get_str(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ mpz_init(int /*<<< orphan*/);
int /*<<< orphan*/ mpz_mul(int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/);
int /*<<< orphan*/ mpz_out_str(int /*<<< orphan*/, int, int /*<<< orphan*/);
int /*<<< orphan*/ mpz_set_ui(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stdout;
int strlen(char *);
int main(int argc, char *argv[]) {
  unsigned count = 0;
  char str[50] = {0};
  mpz_t n;
  mpz_t r;
  mpz_t n_r;
  mpz_t t_n;
  mpz_t t_r;
  mpz_init(n);
  mpz_init(r);
  mpz_init(n_r);
  mpz_init(t_n);
  mpz_init(t_r);
  for (unsigned long i = 23; i <= 100; i++) {
    mpz_fac_ui(n, i);
    for (unsigned long j = 1; j < i; j++) {
      mpz_fac_ui(r, j);
      mpz_fac_ui(n_r, (i - j));
      mpz_mul(t_r, r, n_r);
      mpz_divexact(t_n, n, t_r);
      printf("%lu %lu %lu\t", i, j, (i - j));
      mpz_out_str(stdout, 10, t_n);
      printf("\n");
      mpz_get_str(str, 10, t_n);
      if (strlen(str) >= 7)
        ++count;
      memset(str, 0, sizeof(str));
      mpz_set_ui(t_r, 0);
      mpz_set_ui(t_n, 0);
    }
  }
  mpz_clear(t_r);
  mpz_clear(t_n);
  mpz_clear(r);
  mpz_clear(n_r);
  mpz_clear(n);
  printf("\nCount: %u\n", count);
  return 0;
}


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)
movl   $0x0,-0x14(%rbp)
lea    -0x50(%rbp),%rdi
xor    %esi,%esi
mov    $0x32,%edx
call   1050 <memset@plt>
mov    -0x54(%rbp),%edi
call   1060 <mpz_init@plt>
mov    -0x58(%rbp),%edi
call   1060 <mpz_init@plt>
mov    -0x5c(%rbp),%edi
call   1060 <mpz_init@plt>
mov    -0x60(%rbp),%edi
call   1060 <mpz_init@plt>
mov    -0x64(%rbp),%edi
call   1060 <mpz_init@plt>
movq   $0x17,-0x70(%rbp)
cmpq   $0x64,-0x70(%rbp)
ja     132e <main+0x17e>
mov    -0x54(%rbp),%edi
mov    -0x70(%rbp),%rsi
call   1090 <mpz_fac_ui@plt>
movq   $0x1,-0x78(%rbp)
mov    -0x78(%rbp),%rax
cmp    -0x70(%rbp),%rax
jae    1318 <main+0x168>
mov    -0x58(%rbp),%edi
mov    -0x78(%rbp),%rsi
call   1090 <mpz_fac_ui@plt>
mov    -0x5c(%rbp),%edi
mov    -0x70(%rbp),%rsi
sub    -0x78(%rbp),%rsi
call   1090 <mpz_fac_ui@plt>
mov    -0x64(%rbp),%edi
mov    -0x58(%rbp),%esi
mov    -0x5c(%rbp),%edx
call   1080 <mpz_mul@plt>
mov    -0x60(%rbp),%edi
mov    -0x54(%rbp),%esi
mov    -0x64(%rbp),%edx
call   10b0 <mpz_divexact@plt>
mov    -0x70(%rbp),%rsi
mov    -0x78(%rbp),%rdx
mov    -0x70(%rbp),%rcx
sub    -0x78(%rbp),%rcx
lea    0xd74(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    0x2d46(%rip),%rax
mov    (%rax),%edi
mov    -0x60(%rbp),%edx
mov    $0xa,%esi
call   10a0 <mpz_out_str@plt>
lea    0xd67(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x50(%rbp),%rdi
mov    -0x60(%rbp),%edx
mov    $0xa,%esi
call   1070 <mpz_get_str@plt>
lea    -0x50(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x7,%eax
jl     12e3 <main+0x133>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
lea    -0x50(%rbp),%rdi
xor    %esi,%esi
mov    $0x32,%edx
call   1050 <memset@plt>
mov    -0x64(%rbp),%edi
xor    %esi,%esi
call   10c0 <mpz_set_ui@plt>
mov    -0x60(%rbp),%edi
xor    %esi,%esi
call   10c0 <mpz_set_ui@plt>
mov    -0x78(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x78(%rbp)
jmp    122f <main+0x7f>
jmp    131d <main+0x16d>
mov    -0x70(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x70(%rbp)
jmp    1210 <main+0x60>
mov    -0x64(%rbp),%edi
call   10d0 <mpz_clear@plt>
mov    -0x60(%rbp),%edi
call   10d0 <mpz_clear@plt>
mov    -0x58(%rbp),%edi
call   10d0 <mpz_clear@plt>
mov    -0x5c(%rbp),%edi
call   10d0 <mpz_clear@plt>
mov    -0x54(%rbp),%edi
call   10d0 <mpz_clear@plt>
mov    -0x14(%rbp),%esi
lea    0xcad(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movw   $0x0,0x40(%rsp)
call   1070 <mpz_init@plt>
call   1070 <mpz_init@plt>
call   1070 <mpz_init@plt>
call   1070 <mpz_init@plt>
call   1070 <mpz_init@plt>
mov    $0x17,%r14d
mov    $0x16,%ebp
lea    0x10(%rsp),%r12
xor    %r13d,%r13d
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14,%rsi
call   10a0 <mpz_fac_ui@plt>
mov    $0x1,%ebx
mov    %rbp,0x8(%rsp)
lea    0xdc7(%rip),%r15
nopl   0x0(%rax)
mov    %rbx,%rsi
call   10a0 <mpz_fac_ui@plt>
mov    %rbp,%rsi
call   10a0 <mpz_fac_ui@plt>
call   1090 <mpz_mul@plt>
call   10c0 <mpz_divexact@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
mov    %rbp,%rcx
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x2d6c(%rip),%rax
mov    (%rax),%edi
mov    $0xa,%esi
call   10b0 <mpz_out_str@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r12,%rdi
mov    $0xa,%esi
call   1080 <mpz_get_str@plt>
mov    %r12,%rdi
call   1040 <strlen@plt>
xor    %ecx,%ecx
cmp    $0x7,%eax
setge  %cl
add    %ecx,%r13d
mov    %r12,%rdi
xor    %esi,%esi
mov    $0x32,%edx
call   1060 <memset@plt>
xor    %esi,%esi
call   10d0 <mpz_set_ui@plt>
xor    %esi,%esi
call   10d0 <mpz_set_ui@plt>
add    $0x1,%rbx
add    $0xffffffffffffffff,%rbp
jne    1240 <main+0x80>
add    $0x1,%r14
mov    0x8(%rsp),%rbp
add    $0x1,%rbp
cmp    $0x65,%r14
jne    1220 <main+0x60>
call   10e0 <mpz_clear@plt>
call   10e0 <mpz_clear@plt>
call   10e0 <mpz_clear@plt>
call   10e0 <mpz_clear@plt>
call   10e0 <mpz_clear@plt>
lea    0xd01(%rip),%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [13 x i8] c"%lu %lu %lu\09\00"
@stdout = global i32 0
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [12 x i8] c"\0ACount: %u\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [50 x i8]
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i64
%14 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%15 = bitcast [50 x i8]* %7 to i8*
%16 = load i32, i32* %8
%17 = call i32 @mpz_init(i32 %16)
%18 = load i32, i32* %9
%19 = call i32 @mpz_init(i32 %18)
%20 = load i32, i32* %10
%21 = call i32 @mpz_init(i32 %20)
%22 = load i32, i32* %11
%23 = call i32 @mpz_init(i32 %22)
%24 = load i32, i32* %12
%25 = call i32 @mpz_init(i32 %24)
store i64 23, i64* %13
br label %26
26: ; preds = %84, %2
%27 = load i64, i64* %13
%28 = icmp ule i64 %27, 100
br i1 %28, label %29, label %87
29: ; preds = %26
%30 = load i32, i32* %8
%31 = load i64, i64* %13
%32 = call i32 @mpz_fac_ui(i32 %30, i64 %31)
store i64 1, i64* %14
br label %33
33: ; preds = %80, %29
%34 = load i64, i64* %14
%35 = load i64, i64* %13
%36 = icmp ult i64 %34, %35
br i1 %36, label %37, label %83
37: ; preds = %33
%38 = load i32, i32* %9
%39 = load i64, i64* %14
%40 = call i32 @mpz_fac_ui(i32 %38, i64 %39)
%41 = load i32, i32* %10
%42 = load i64, i64* %13
%43 = load i64, i64* %14
%44 = sub i64 %42, %43
%45 = call i32 @mpz_fac_ui(i32 %41, i64 %44)
%46 = load i32, i32* %12
%47 = load i32, i32* %9
%48 = load i32, i32* %10
%49 = call i32 @mpz_mul(i32 %46, i32 %47, i32 %48)
%50 = load i32, i32* %11
%51 = load i32, i32* %8
%52 = load i32, i32* %12
%53 = call i32 @mpz_divexact(i32 %50, i32 %51, i32 %52)
%54 = load i64, i64* %13
%55 = load i64, i64* %14
%56 = load i64, i64* %13
%57 = load i64, i64* %14
%58 = sub i64 %56, %57
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i64 %54, i64 %55, i64 %58)
%60 = load i32, i32* @stdout
%61 = load i32, i32* %11
%62 = call i32 @mpz_out_str(i32 %60, i32 10, i32 %61)
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%64 = getelementptr inbounds [50 x i8], [50 x i8]* %7, i64 0, i64 0
%65 = load i32, i32* %11
%66 = call i32 @mpz_get_str(i8* %64, i32 10, i32 %65)
%67 = getelementptr inbounds [50 x i8], [50 x i8]* %7, i64 0, i64 0
%68 = call i32 @strlen(i8* %67)
%69 = icmp sge i32 %68, 7
br i1 %69, label %70, label %73
70: ; preds = %37
%71 = load i32, i32* %6
%72 = add i32 %71, 1
store i32 %72, i32* %6
br label %73
73: ; preds = %70, %37
%74 = getelementptr inbounds [50 x i8], [50 x i8]* %7, i64 0, i64 0
%75 = call i32 @memset(i8* %74, i32 0, i32 50)
%76 = load i32, i32* %12
%77 = call i32 @mpz_set_ui(i32 %76, i32 0)
%78 = load i32, i32* %11
%79 = call i32 @mpz_set_ui(i32 %78, i32 0)
br label %80
80: ; preds = %73
%81 = load i64, i64* %14
%82 = add i64 %81, 1
store i64 %82, i64* %14
br label %33
83: ; preds = %33
br label %84
84: ; preds = %83
%85 = load i64, i64* %13
%86 = add i64 %85, 1
store i64 %86, i64* %13
br label %26
87: ; preds = %26
%88 = load i32, i32* %12
%89 = call i32 @mpz_clear(i32 %88)
%90 = load i32, i32* %11
%91 = call i32 @mpz_clear(i32 %90)
%92 = load i32, i32* %9
%93 = call i32 @mpz_clear(i32 %92)
%94 = load i32, i32* %10
%95 = call i32 @mpz_clear(i32 %94)
%96 = load i32, i32* %8
%97 = call i32 @mpz_clear(i32 %96)
%98 = load i32, i32* %6
%99 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %98)
ret i32 0
}

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