#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 C(int, int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int i, j;
  int count = 0;
  for (i = 100; i >= 1; --i) {
    for (j = 1; j <= i; ++j) {
      int v = C(i, j);
      if (v > 1000000)
        count++;
    }
  }
  printf("%d\n", count);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x64,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
jl     11ab <main+0x8b>
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     1198 <main+0x78>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1040 <C@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0xf4240,-0x20(%rbp)
jle    1185 <main+0x65>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    118a <main+0x6a>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1155 <main+0x35>
jmp    119d <main+0x7d>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    1144 <main+0x24>
mov    -0x1c(%rbp),%esi
lea    0xe4b(%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   %rbx
push   %rax
xor    %ebp,%ebp
mov    $0x64,%r14d
mov    $0xffffff9c,%r15d
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14d,%edi
mov    %ebx,%esi
call   1040 <C@plt>
xor    %ecx,%ecx
cmp    $0xf4241,%eax
setge  %cl
add    %ecx,%ebp
lea    (%r15,%rbx,1),%eax
add    $0x1,%eax
mov    %ebx,%ecx
add    $0x1,%ecx
mov    %ecx,%ebx
cmp    $0x1,%eax
jne    1150 <main+0x30>
lea    -0x1(%r14),%eax
add    $0x1,%r15d
cmp    $0x1,%r14d
mov    %eax,%r14d
ja     1140 <main+0x20>
lea    0xe6f(%rip),%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
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
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %8
store i32 100, i32* %6
br label %10
10: ; preds = %32, %2
%11 = load i32, i32* %6
%12 = icmp sge i32 %11, 1
br i1 %12, label %13, label %35
13: ; preds = %10
store i32 1, i32* %7
br label %14
14: ; preds = %28, %13
%15 = load i32, i32* %7
%16 = load i32, i32* %6
%17 = icmp sle i32 %15, %16
br i1 %17, label %18, label %31
18: ; preds = %14
%19 = load i32, i32* %6
%20 = load i32, i32* %7
%21 = call i32 @C(i32 %19, i32 %20)
store i32 %21, i32* %9
%22 = load i32, i32* %9
%23 = icmp sgt i32 %22, 1000000
br i1 %23, label %24, label %27
24: ; preds = %18
%25 = load i32, i32* %8
%26 = add nsw i32 %25, 1
store i32 %26, i32* %8
br label %27
27: ; preds = %24, %18
br label %28
28: ; preds = %27
%29 = load i32, i32* %7
%30 = add nsw i32 %29, 1
store i32 %30, i32* %7
br label %14
31: ; preds = %14
br label %32
32: ; preds = %31
%33 = load i32, i32* %6
%34 = add nsw i32 %33, -1
store i32 %34, i32* %6
br label %10
35: ; preds = %10
%36 = load i32, i32* %8
%37 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %36)
ret i32 0
}

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