#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_init(int /*<<< orphan*/);
int /*<<< orphan*/ mpz_ui_pow_ui(int /*<<< orphan*/, int, int);
int /*<<< orphan*/ printf(char *, int);
int quick_hash(int /*<<< orphan*/);
int main(void) {
  mpz_t p;
  mpz_init(p);
  int map[(100 * 100)] = {0};
  int index = 0;
  int a, b;
  for (a = 2; a <= 100; ++a) {
    for (b = 2; b <= 100; ++b) {
      mpz_ui_pow_ui(p, a, b);
      int hash = quick_hash(p);
      int i = 0;
      while (i < index) {
        if (map[i] == hash)
          break;
        ++i;
      }
      if (i == index)
        map[index++] = hash;
    }
  }
  printf("%d\n", index);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x9c70,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x8(%rbp),%edi
call   1060 <mpz_init@plt>
lea    -0x9c50(%rbp),%rdi
xor    %esi,%esi
mov    $0x9c40,%edx
call   1050 <memset@plt>
movl   $0x0,-0x9c54(%rbp)
movl   $0x2,-0x9c58(%rbp)
cmpl   $0x64,-0x9c58(%rbp)
jg     128a <main+0x13a>
movl   $0x2,-0x9c5c(%rbp)
cmpl   $0x64,-0x9c5c(%rbp)
jg     1271 <main+0x121>
mov    -0x8(%rbp),%edi
mov    -0x9c58(%rbp),%esi
mov    -0x9c5c(%rbp),%edx
call   1070 <mpz_ui_pow_ui@plt>
mov    -0x8(%rbp),%edi
call   1030 <quick_hash@plt>
mov    %eax,-0x9c60(%rbp)
movl   $0x0,-0x9c64(%rbp)
mov    -0x9c64(%rbp),%eax
cmp    -0x9c54(%rbp),%eax
jge    1226 <main+0xd6>
movslq -0x9c64(%rbp),%rax
mov    -0x9c50(%rbp,%rax,4),%eax
cmp    -0x9c60(%rbp),%eax
jne    1212 <main+0xc2>
jmp    1226 <main+0xd6>
mov    -0x9c64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9c64(%rbp)
jmp    11e1 <main+0x91>
mov    -0x9c64(%rbp),%eax
cmp    -0x9c54(%rbp),%eax
jne    1258 <main+0x108>
mov    -0x9c60(%rbp),%ecx
mov    -0x9c54(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x9c54(%rbp)
cltq
mov    %ecx,-0x9c50(%rbp,%rax,4)
jmp    125d <main+0x10d>
mov    -0x9c5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9c5c(%rbp)
jmp    11a8 <main+0x58>
jmp    1276 <main+0x126>
mov    -0x9c58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9c58(%rbp)
jmp    1191 <main+0x41>
mov    -0x9c54(%rbp),%esi
lea    0xd69(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x9c70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x9c40,%rsp
call   1060 <mpz_init@plt>
mov    %rsp,%rdi
xor    %ebx,%ebx
mov    $0x9c40,%edx
xor    %esi,%esi
call   1050 <memset@plt>
mov    $0x2,%r14d
jmp    118a <main+0x3a>
nopl   0x0(%rax)
add    $0x1,%r14d
cmp    $0x65,%r14d
je     11e8 <main+0x98>
mov    $0x2,%ebp
jmp    11b1 <main+0x61>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movslq %ebx,%rcx
add    $0x1,%ebx
mov    %eax,(%rsp,%rcx,4)
add    $0x1,%ebp
cmp    $0x65,%ebp
je     1180 <main+0x30>
mov    %r14d,%esi
mov    %ebp,%edx
call   1070 <mpz_ui_pow_ui@plt>
call   1030 <quick_hash@plt>
test   %ebx,%ebx
jle    11e0 <main+0x90>
mov    %ebx,%edx
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
cmp    %eax,(%rsp,%rcx,4)
je     11e2 <main+0x92>
add    $0x1,%rcx
cmp    %rcx,%rdx
jne    11d0 <main+0x80>
jmp    11a0 <main+0x50>
xor    %ecx,%ecx
cmp    %ebx,%ecx
je     11a0 <main+0x50>
jmp    11a9 <main+0x59>
lea    0xe11(%rip),%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x9c40,%rsp
pop    %rbx
pop    %r14
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 [10000 x i32]
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %1
%9 = load i32, i32* %2
%10 = call i32 @mpz_init(i32 %9)
%11 = bitcast [10000 x i32]* %3 to i8*
store i32 0, i32* %4
store i32 2, i32* %5
br label %12
12: ; preds = %56, %0
%13 = load i32, i32* %5
%14 = icmp sle i32 %13, 100
br i1 %14, label %15, label %59
15: ; preds = %12
store i32 2, i32* %6
br label %16
16: ; preds = %52, %15
%17 = load i32, i32* %6
%18 = icmp sle i32 %17, 100
br i1 %18, label %19, label %55
19: ; preds = %16
%20 = load i32, i32* %2
%21 = load i32, i32* %5
%22 = load i32, i32* %6
%23 = call i32 @mpz_ui_pow_ui(i32 %20, i32 %21, i32 %22)
%24 = load i32, i32* %2
%25 = call i32 @quick_hash(i32 %24)
store i32 %25, i32* %7
store i32 0, i32* %8
br label %26
26: ; preds = %38, %19
%27 = load i32, i32* %8
%28 = load i32, i32* %4
%29 = icmp slt i32 %27, %28
br i1 %29, label %30, label %41
30: ; preds = %26
%31 = load i32, i32* %8
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds [10000 x i32], [10000 x i32]* %3, i64 0, i64 %32
%34 = load i32, i32* %33
%35 = load i32, i32* %7
%36 = icmp eq i32 %34, %35
br i1 %36, label %37, label %38
37: ; preds = %30
br label %41
38: ; preds = %30
%39 = load i32, i32* %8
%40 = add nsw i32 %39, 1
store i32 %40, i32* %8
br label %26
41: ; preds = %37, %26
%42 = load i32, i32* %8
%43 = load i32, i32* %4
%44 = icmp eq i32 %42, %43
br i1 %44, label %45, label %51
45: ; preds = %41
%46 = load i32, i32* %7
%47 = load i32, i32* %4
%48 = add nsw i32 %47, 1
store i32 %48, i32* %4
%49 = sext i32 %47 to i64
%50 = getelementptr inbounds [10000 x i32], [10000 x i32]* %3, i64 0, i64 %49
store i32 %46, i32* %50
br label %51
51: ; preds = %45, %41
br label %52
52: ; preds = %51
%53 = load i32, i32* %6
%54 = add nsw i32 %53, 1
store i32 %54, i32* %6
br label %16
55: ; preds = %16
br label %56
56: ; preds = %55
%57 = load i32, i32* %5
%58 = add nsw i32 %57, 1
store i32 %58, i32* %5
br label %12
59: ; preds = %12
%60 = load i32, i32* %4
%61 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %60)
ret i32 0
}

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