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

/* Variables and functions */
int nCr(int, int);
int /*<<< orphan*/ printf(char *, int);
int _Problem053() {
  int n, r;
  int count = 0;
  int val;
  for (n = 1; n < 100; n++) {
    for (r = 1; r < n; r++) {
      val = nCr(n, r);
      if (val > 1000000) {
        count++;
      }
    }
  }
  printf("%30d", count);
  return 0;
}


x86 assembly (clang, -O0):
<_Problem053>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x4(%rbp)
cmpl   $0x64,-0x4(%rbp)
jge    119d <_Problem053+0x7d>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    118a <_Problem053+0x6a>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <nCr@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0xf4240,-0x10(%rbp)
jle    1177 <_Problem053+0x57>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    117c <_Problem053+0x5c>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1147 <_Problem053+0x27>
jmp    118f <_Problem053+0x6f>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1136 <_Problem053+0x16>
mov    -0xc(%rbp),%esi
lea    0xe59(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_Problem053>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    $0x1,%r14d
xor    %r15d,%r15d
xor    %ebx,%ebx
jmp    114e <_Problem053+0x2e>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%r14d
add    $0xffffffff,%r15d
cmp    $0x64,%r14d
je     118b <_Problem053+0x6b>
cmp    $0x2,%r14d
jb     1140 <_Problem053+0x20>
mov    $0x1,%ebp
nopl   0x0(%rax)
mov    %r14d,%edi
mov    %ebp,%esi
call   1040 <nCr@plt>
xor    %ecx,%ecx
cmp    $0xf4241,%eax
setge  %cl
add    %ecx,%ebx
lea    (%r15,%rbp,1),%eax
add    $0x1,%eax
mov    %ebp,%ecx
add    $0x1,%ecx
mov    %ecx,%ebp
cmp    $0x1,%eax
jne    1160 <_Problem053+0x40>
jmp    1140 <_Problem053+0x20>
lea    0xe6e(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%30d\00"
define i32 @_Problem053() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %3
store i32 1, i32* %1
br label %5
5: ; preds = %27, %0
%6 = load i32, i32* %1
%7 = icmp slt i32 %6, 100
br i1 %7, label %8, label %30
8: ; preds = %5
store i32 1, i32* %2
br label %9
9: ; preds = %23, %8
%10 = load i32, i32* %2
%11 = load i32, i32* %1
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %26
13: ; preds = %9
%14 = load i32, i32* %1
%15 = load i32, i32* %2
%16 = call i32 @nCr(i32 %14, i32 %15)
store i32 %16, i32* %4
%17 = load i32, i32* %4
%18 = icmp sgt i32 %17, 1000000
br i1 %18, label %19, label %22
19: ; preds = %13
%20 = load i32, i32* %3
%21 = add nsw i32 %20, 1
store i32 %21, i32* %3
br label %22
22: ; preds = %19, %13
br label %23
23: ; preds = %22
%24 = load i32, i32* %2
%25 = add nsw i32 %24, 1
store i32 %25, i32* %2
br label %9
26: ; preds = %9
br label %27
27: ; preds = %26
%28 = load i32, i32* %1
%29 = add nsw i32 %28, 1
store i32 %29, i32* %1
br label %5
30: ; preds = %5
%31 = load i32, i32* %3
%32 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %31)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%30d\00"
define i32 @_Problem053() {
br label %1
1: ; preds = %0, %14
%2 = phi i32 [ 1, %0 ], [ %16, %14 ]
%3 = phi i32 [ 0, %0 ], [ %15, %14 ]
%4 = icmp ugt i32 %2, 1
br i1 %4, label %5, label %14
5: ; preds = %1, %5
%6 = phi i32 [ %11, %5 ], [ %3, %1 ]
%7 = phi i32 [ %12, %5 ], [ 1, %1 ]
%8 = tail call i32 @nCr(i32 %2, i32 %7)
%9 = icmp sgt i32 %8, 1000000
%10 = zext i1 %9 to i32
%11 = add nsw i32 %6, %10
%12 = add nuw nsw i32 %7, 1
%13 = icmp eq i32 %12, %2
br i1 %13, label %14, label %5
14: ; preds = %5, %1
%15 = phi i32 [ %3, %1 ], [ %11, %5 ]
%16 = add nuw nsw i32 %2, 1
%17 = icmp eq i32 %16, 100
br i1 %17, label %18, label %1
18: ; preds = %14
%19 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %15)
ret i32 0
}