void main() {
  unsigned Mersenne[500], S[500], T[500], quot[500], res[500];
  int a[500];
  int p, j, k, t, d, r;
  p = 5;
  while (p < 525) {
    Initialize(Mersenne);
    Mersenne[0] = 1;
    LongLeftShift(Mersenne, p);
    Initialize(a);
    a[0] = 1;
    Sub(Mersenne, a);
    printf("p = %d  \n", p);
    Initialize(S);
    S[0] = 4;
    for (j = 1; j < p - 1; j++) {
      Copy(S, a);
      LongMul(S, a);
      Initialize(a);
      a[0] = 2;
      Sub(S, a);
      LongDiv(S, Mersenne, quot, res);
      if (DivCheck(S, Mersenne, quot, res) == 0) {
        printf("DivCheck Failed\n");
        return;
      }
      Copy(S, T);
      LongRightShift(T, p);
      t = p / 16;
      r = p - 16 * t;
      d = Degree(S);
      for (k = d; k > t; k--) {
        S[k] = 0;
      }
      S[t] = (S[t] << (32 - r)) >> (32 - r);
      Add(S, T);
      k = Compare(S, Mersenne);
      if (k == 1 || k == 0) {
        Sub(S, Mersenne);
      }
      k = Compare(res, S);
      if (k != 0) {
        printf("Something is wrong\n");
        return;
      }
    }
    if (ZeroCheck(S) == 0)
      printf("mersenne,   p = %d\n", p);
    p = p + 2;
    p = NextPrime(p);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2f00,%rsp
movl   $0x5,-0x2ee4(%rbp)
cmpl   $0x20d,-0x2ee4(%rbp)
jge    154d <main+0x36d>
lea    -0x7d0(%rbp),%rdi
mov    $0x0,%al
call   10d0 <Initialize@plt>
movl   $0x1,-0x7d0(%rbp)
lea    -0x7d0(%rbp),%rdi
mov    -0x2ee4(%rbp),%esi
mov    $0x0,%al
call   1070 <LongLeftShift@plt>
lea    -0x2ee0(%rbp),%rdi
mov    $0x0,%al
call   10d0 <Initialize@plt>
movl   $0x1,-0x2ee0(%rbp)
lea    -0x7d0(%rbp),%rdi
lea    -0x2ee0(%rbp),%rsi
mov    $0x0,%al
call   10e0 <Sub@plt>
mov    -0x2ee4(%rbp),%esi
lea    0xd95(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0xfa0(%rbp),%rdi
mov    $0x0,%al
call   10d0 <Initialize@plt>
movl   $0x4,-0xfa0(%rbp)
movl   $0x1,-0x2ee8(%rbp)
mov    -0x2ee8(%rbp),%eax
mov    -0x2ee4(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    14fb <main+0x31b>
lea    -0xfa0(%rbp),%rdi
lea    -0x2ee0(%rbp),%rsi
mov    $0x0,%al
call   1040 <Copy@plt>
lea    -0xfa0(%rbp),%rdi
lea    -0x2ee0(%rbp),%rsi
mov    $0x0,%al
call   1090 <LongMul@plt>
lea    -0x2ee0(%rbp),%rdi
mov    $0x0,%al
call   10d0 <Initialize@plt>
movl   $0x2,-0x2ee0(%rbp)
lea    -0xfa0(%rbp),%rdi
lea    -0x2ee0(%rbp),%rsi
mov    $0x0,%al
call   10e0 <Sub@plt>
lea    -0xfa0(%rbp),%rdi
lea    -0x7d0(%rbp),%rsi
lea    -0x1f40(%rbp),%rdx
lea    -0x2710(%rbp),%rcx
mov    $0x0,%al
call   1030 <LongDiv@plt>
lea    -0xfa0(%rbp),%rdi
lea    -0x7d0(%rbp),%rsi
lea    -0x1f40(%rbp),%rdx
lea    -0x2710(%rbp),%rcx
mov    $0x0,%al
call   10a0 <DivCheck@plt>
cmp    $0x0,%eax
jne    1364 <main+0x184>
lea    0xcb2(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    154d <main+0x36d>
lea    -0xfa0(%rbp),%rdi
lea    -0x1770(%rbp),%rsi
mov    $0x0,%al
call   1040 <Copy@plt>
lea    -0x1770(%rbp),%rdi
mov    -0x2ee4(%rbp),%esi
mov    $0x0,%al
call   1080 <LongRightShift@plt>
mov    -0x2ee4(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
mov    %eax,-0x2ef0(%rbp)
mov    -0x2ee4(%rbp),%eax
mov    -0x2ef0(%rbp),%ecx
shl    $0x4,%ecx
sub    %ecx,%eax
mov    %eax,-0x2ef8(%rbp)
lea    -0xfa0(%rbp),%rdi
mov    $0x0,%al
call   10f0 <Degree@plt>
mov    %eax,-0x2ef4(%rbp)
mov    -0x2ef4(%rbp),%eax
mov    %eax,-0x2eec(%rbp)
mov    -0x2eec(%rbp),%eax
cmp    -0x2ef0(%rbp),%eax
jle    1410 <main+0x230>
movslq -0x2eec(%rbp),%rax
movl   $0x0,-0xfa0(%rbp,%rax,4)
mov    -0x2eec(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x2eec(%rbp)
jmp    13d8 <main+0x1f8>
movslq -0x2ef0(%rbp),%rax
mov    -0xfa0(%rbp,%rax,4),%eax
mov    $0x20,%ecx
sub    -0x2ef8(%rbp),%ecx
shl    %cl,%eax
mov    $0x20,%ecx
sub    -0x2ef8(%rbp),%ecx
shr    %cl,%eax
mov    %eax,%ecx
movslq -0x2ef0(%rbp),%rax
mov    %ecx,-0xfa0(%rbp,%rax,4)
lea    -0xfa0(%rbp),%rdi
lea    -0x1770(%rbp),%rsi
mov    $0x0,%al
call   1100 <Add@plt>
lea    -0xfa0(%rbp),%rdi
lea    -0x7d0(%rbp),%rsi
mov    $0x0,%al
call   10b0 <Compare@plt>
mov    %eax,-0x2eec(%rbp)
cmpl   $0x1,-0x2eec(%rbp)
je     1492 <main+0x2b2>
cmpl   $0x0,-0x2eec(%rbp)
jne    14a7 <main+0x2c7>
lea    -0xfa0(%rbp),%rdi
lea    -0x7d0(%rbp),%rsi
mov    $0x0,%al
call   10e0 <Sub@plt>
lea    -0x2710(%rbp),%rdi
lea    -0xfa0(%rbp),%rsi
mov    $0x0,%al
call   10b0 <Compare@plt>
mov    %eax,-0x2eec(%rbp)
cmpl   $0x0,-0x2eec(%rbp)
je     14e2 <main+0x302>
lea    0xb45(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    154d <main+0x36d>
jmp    14e7 <main+0x307>
mov    -0x2ee8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2ee8(%rbp)
jmp    1294 <main+0xb4>
lea    -0xfa0(%rbp),%rdi
mov    $0x0,%al
call   1050 <ZeroCheck@plt>
cmp    $0x0,%eax
jne    1526 <main+0x346>
mov    -0x2ee4(%rbp),%esi
lea    0xb10(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x2ee4(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x2ee4(%rbp)
mov    -0x2ee4(%rbp),%edi
mov    $0x0,%al
call   10c0 <NextPrime@plt>
mov    %eax,-0x2ee4(%rbp)
jmp    11f5 <main+0x15>
add    $0x2f00,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x2f08,%rsp
mov    $0x5,%r15d
lea    0x1790(%rsp),%r12
lea    0x20(%rsp),%rbp
lea    0xdd5(%rip),%r14
lea    0x7f0(%rsp),%r13
jmp    1275 <main+0x75>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r13,%rdi
xor    %eax,%eax
call   1060 <ZeroCheck@plt>
test   %eax,%eax
je     1470 <main+0x270>
add    $0x2,%r15d
mov    %r15d,%edi
xor    %eax,%eax
call   10e0 <NextPrime@plt>
mov    %eax,%r15d
cmp    $0x20d,%eax
lea    0xd91(%rip),%r14
jge    149b <main+0x29b>
mov    %r12,%rdi
xor    %eax,%eax
call   10f0 <Initialize@plt>
movl   $0x1,0x1790(%rsp)
mov    %r12,%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1090 <LongLeftShift@plt>
mov    %rbp,%rdi
xor    %eax,%eax
call   10f0 <Initialize@plt>
movl   $0x1,0x20(%rsp)
mov    %r12,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1100 <Sub@plt>
mov    %r14,%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r13,%rdi
xor    %eax,%eax
call   10f0 <Initialize@plt>
movl   $0x4,0x7f0(%rsp)
cmp    $0x3,%r15d
jl     1240 <main+0x40>
mov    %r15d,%ebx
shr    $0x4,%ebx
and    $0xfff,%ebx
mov    %ebx,%ecx
shl    $0x4,%ecx
sub    %r15d,%ecx
mov    $0xffffffff,%eax
shr    %cl,%eax
mov    %eax,0x10(%rsp)
mov    %ebx,%eax
not    %eax
mov    %eax,0xc(%rsp)
mov    $0x2,%eax
mov    %rbx,0x18(%rsp)
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %eax,0x14(%rsp)
mov    %r15d,%ebx
mov    %r13,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1050 <Copy@plt>
mov    %r13,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   10b0 <LongMul@plt>
mov    %rbp,%rdi
xor    %eax,%eax
call   10f0 <Initialize@plt>
movl   $0x2,0x20(%rsp)
mov    %r13,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1100 <Sub@plt>
mov    %r13,%rdi
mov    %r12,%rsi
mov    %r12,%rbp
lea    0x1f60(%rsp),%r15
mov    %r15,%rdx
lea    0xfc0(%rsp),%r14
mov    %r14,%rcx
xor    %eax,%eax
call   1030 <LongDiv@plt>
mov    %r13,%rdi
mov    %r12,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
xor    %eax,%eax
call   10c0 <DivCheck@plt>
test   %eax,%eax
je     1486 <main+0x286>
mov    %r13,%rdi
lea    0x2730(%rsp),%rbp
mov    %rbp,%rsi
xor    %eax,%eax
call   1050 <Copy@plt>
mov    %rbp,%rdi
mov    %ebx,%r15d
mov    %ebx,%esi
xor    %eax,%eax
call   10a0 <LongRightShift@plt>
mov    %r13,%rdi
xor    %eax,%eax
call   1110 <Degree@plt>
mov    0x18(%rsp),%rbx
cmp    %ebx,%eax
jle    13fc <main+0x1fc>
movslq %eax,%rcx
add    0xc(%rsp),%eax
sub    %rax,%rcx
lea    (%rsp,%rcx,4),%rdi
add    $0x7f0,%rdi
lea    0x4(,%rax,4),%rdx
xor    %esi,%esi
call   1080 <memset@plt>
mov    0x10(%rsp),%eax
and    %eax,0x7f0(%rsp,%rbx,4)
mov    %r13,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1120 <Add@plt>
mov    %r13,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   10d0 <Compare@plt>
cmp    $0x1,%eax
lea    0x20(%rsp),%rbp
ja     1438 <main+0x238>
mov    %r13,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1100 <Sub@plt>
lea    0xfc0(%rsp),%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   10d0 <Compare@plt>
test   %eax,%eax
jne    148f <main+0x28f>
mov    0x14(%rsp),%eax
add    $0x1,%eax
cmp    %eax,%r15d
jne    1320 <main+0x120>
jmp    1240 <main+0x40>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    0xb93(%rip),%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1070 <printf@plt>
jmp    1252 <main+0x52>
lea    0xba4(%rip),%rdi
jmp    1496 <main+0x296>
lea    0xb88(%rip),%rdi
call   1040 <puts@plt>
add    $0x2f08,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"p = %d \0A\00"
@.str.1 = [17 x i8] c"DivCheck Failed\0A\00"
@.str.2 = [20 x i8] c"Something is wrong\0A\00"
@.str.3 = [20 x i8] c"mersenne, p = %d\0A\00"
define void @main() {
%1 = alloca [500 x i32]
%2 = alloca [500 x i32]
%3 = alloca [500 x i32]
%4 = alloca [500 x i32]
%5 = alloca [500 x i32]
%6 = alloca [500 x i32]
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 5, i32* %7
br label %13
13: ; preds = %140, %0
%14 = load i32, i32* %7
%15 = icmp slt i32 %14, 525
br i1 %15, label %16, label %145
16: ; preds = %13
%17 = getelementptr inbounds [500 x i32], [500 x i32]* %1, i64 0, i64 0
%18 = call i32 (i32*, ...) bitcast (i32 (...)* @Initialize to i32 (i32*, ...)*)(i32* %17)
%19 = getelementptr inbounds [500 x i32], [500 x i32]* %1, i64 0, i64 0
store i32 1, i32* %19
%20 = getelementptr inbounds [500 x i32], [500 x i32]* %1, i64 0, i64 0
%21 = load i32, i32* %7
%22 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @LongLeftShift to i32 (i32*, i32, ...)*)(i32* %20, i32 %21)
%23 = getelementptr inbounds [500 x i32], [500 x i32]* %6, i64 0, i64 0
%24 = call i32 (i32*, ...) bitcast (i32 (...)* @Initialize to i32 (i32*, ...)*)(i32* %23)
%25 = getelementptr inbounds [500 x i32], [500 x i32]* %6, i64 0, i64 0
store i32 1, i32* %25
%26 = getelementptr inbounds [500 x i32], [500 x i32]* %1, i64 0, i64 0
%27 = getelementptr inbounds [500 x i32], [500 x i32]* %6, i64 0, i64 0
%28 = call i32 (i32*, i32*, ...) bitcast (i32 (...)* @Sub to i32 (i32*, i32*, ...)*)(i32* %26, i32* %27)
%29 = load i32, i32* %7
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %29)
%31 = getelementptr inbounds [500 x i32], [500 x i32]* %2, i64 0, i64 0
%32 = call i32 (i32*, ...) bitcast (i32 (...)* @Initialize to i32 (i32*, ...)*)(i32* %31)
%33 = getelementptr inbounds [500 x i32], [500 x i32]* %2, i64 0, i64 0
store i32 4, i32* %33
store i32 1, i32* %8
br label %34
34: ; preds = %130, %16
%35 = load i32, i32* %8
%36 = load i32, i32* %7
%37 = sub nsw i32 %36, 1
%38 = icmp slt i32 %35, %37
br i1 %38, label %39, label %133
39: ; preds = %34
%40 = getelementptr inbounds [500 x i32], [500 x i32]* %2, i64 0, i64 0
%41 = getelementptr inbounds [500 x i32], [500 x i32]* %6, i64 0, i64 0
%42 = call i32 (i32*, i32*, ...) bitcast (i32 (...)* @Copy to i32 (i32*, i32*, ...)*)(i32* %40, i32* %41)
%43 = getelementptr inbounds [500 x i32], [500 x i32]* %2, i64 0, i64 0
%44 = getelementptr inbounds [500 x i32], [500 x i32]* %6, i64 0, i64 0
%45 = call i32 (i32*, i32*, ...) bitcast (i32 (...)* @LongMul to i32 (i32*, i32*, ...)*)(i32* %43, i32* %44)
%46 = getelementptr inbounds [500 x i32], [500 x i32]* %6, i64 0, i64 0
%47 = call i32 (i32*, ...) bitcast (i32 (...)* @Initialize to i32 (i32*, ...)*)(i32* %46)
%48 = getelementptr inbounds [500 x i32], [500 x i32]* %6, i64 0, i64 0
store i32 2, i32* %48
%49 = getelementptr inbounds [500 x i32], [500 x i32]* %2, i64 0, i64 0
%50 = getelementptr inbounds [500 x i32], [500 x i32]* %6, i64 0, i64 0
%51 = call i32 (i32*, i32*, ...) bitcast (i32 (...)* @Sub to i32 (i32*, i32*, ...)*)(i32* %49, i32* %50)
%52 = getelementptr inbounds [500 x i32], [500 x i32]* %2, i64 0, i64 0
%53 = getelementptr inbounds [500 x i32], [500 x i32]* %1, i64 0, i64 0
%54 = getelementptr inbounds [500 x i32], [500 x i32]* %4, i64 0, i64 0
%55 = getelementptr inbounds [500 x i32], [500 x i32]* %5, i64 0, i64 0
%56 = call i32 (i32*, i32*, i32*, i32*, ...) bitcast (i32 (...)* @LongDiv to i32 (i32*, i32*, i32*, i32*, ...)*)(i32* %52, i32* %53, i32* %54, i32* %55)
%57 = getelementptr inbounds [500 x i32], [500 x i32]* %2, i64 0, i64 0
%58 = getelementptr inbounds [500 x i32], [500 x i32]* %1, i64 0, i64 0
%59 = getelementptr inbounds [500 x i32], [500 x i32]* %4, i64 0, i64 0
%60 = getelementptr inbounds [500 x i32], [500 x i32]* %5, i64 0, i64 0
%61 = call i32 (i32*, i32*, i32*, i32*, ...) bitcast (i32 (...)* @DivCheck to i32 (i32*, i32*, i32*, i32*, ...)*)(i32* %57, i32* %58, i32* %59, i32* %60)
%62 = icmp eq i32 %61, 0
br i1 %62, label %63, label %65
63: ; preds = %39
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
br label %145
65: ; preds = %39
%66 = getelementptr inbounds [500 x i32], [500 x i32]* %2, i64 0, i64 0
%67 = getelementptr inbounds [500 x i32], [500 x i32]* %3, i64 0, i64 0
%68 = call i32 (i32*, i32*, ...) bitcast (i32 (...)* @Copy to i32 (i32*, i32*, ...)*)(i32* %66, i32* %67)
%69 = getelementptr inbounds [500 x i32], [500 x i32]* %3, i64 0, i64 0
%70 = load i32, i32* %7
%71 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @LongRightShift to i32 (i32*, i32, ...)*)(i32* %69, i32 %70)
%72 = load i32, i32* %7
%73 = sdiv i32 %72, 16
store i32 %73, i32* %10
%74 = load i32, i32* %7
%75 = load i32, i32* %10
%76 = mul nsw i32 16, %75
%77 = sub nsw i32 %74, %76
store i32 %77, i32* %12
%78 = getelementptr inbounds [500 x i32], [500 x i32]* %2, i64 0, i64 0
%79 = call i32 (i32*, ...) bitcast (i32 (...)* @Degree to i32 (i32*, ...)*)(i32* %78)
store i32 %79, i32* %11
%80 = load i32, i32* %11
store i32 %80, i32* %9
br label %81
81: ; preds = %89, %65
%82 = load i32, i32* %9
%83 = load i32, i32* %10
%84 = icmp sgt i32 %82, %83
br i1 %84, label %85, label %92
85: ; preds = %81
%86 = load i32, i32* %9
%87 = sext i32 %86 to i64
%88 = getelementptr inbounds [500 x i32], [500 x i32]* %2, i64 0, i64 %87
store i32 0, i32* %88
br label %89
89: ; preds = %85
%90 = load i32, i32* %9
%91 = add nsw i32 %90, -1
store i32 %91, i32* %9
br label %81
92: ; preds = %81
%93 = load i32, i32* %10
%94 = sext i32 %93 to i64
%95 = getelementptr inbounds [500 x i32], [500 x i32]* %2, i64 0, i64 %94
%96 = load i32, i32* %95
%97 = load i32, i32* %12
%98 = sub nsw i32 32, %97
%99 = shl i32 %96, %98
%100 = load i32, i32* %12
%101 = sub nsw i32 32, %100
%102 = lshr i32 %99, %101
%103 = load i32, i32* %10
%104 = sext i32 %103 to i64
%105 = getelementptr inbounds [500 x i32], [500 x i32]* %2, i64 0, i64 %104
store i32 %102, i32* %105
%106 = getelementptr inbounds [500 x i32], [500 x i32]* %2, i64 0, i64 0
%107 = getelementptr inbounds [500 x i32], [500 x i32]* %3, i64 0, i64 0
%108 = call i32 (i32*, i32*, ...) bitcast (i32 (...)* @Add to i32 (i32*, i32*, ...)*)(i32* %106, i32* %107)
%109 = getelementptr inbounds [500 x i32], [500 x i32]* %2, i64 0, i64 0
%110 = getelementptr inbounds [500 x i32], [500 x i32]* %1, i64 0, i64 0
%111 = call i32 (i32*, i32*, ...) bitcast (i32 (...)* @Compare to i32 (i32*, i32*, ...)*)(i32* %109, i32* %110)
store i32 %111, i32* %9
%112 = load i32, i32* %9
%113 = icmp eq i32 %112, 1
br i1 %113, label %117, label %114
114: ; preds = %92
%115 = load i32, i32* %9
%116 = icmp eq i32 %115, 0
br i1 %116, label %117, label %121
117: ; preds = %114, %92
%118 = getelementptr inbounds [500 x i32], [500 x i32]* %2, i64 0, i64 0
%119 = getelementptr inbounds [500 x i32], [500 x i32]* %1, i64 0, i64 0
%120 = call i32 (i32*, i32*, ...) bitcast (i32 (...)* @Sub to i32 (i32*, i32*, ...)*)(i32* %118, i32* %119)
br label %121
121: ; preds = %117, %114
%122 = getelementptr inbounds [500 x i32], [500 x i32]* %5, i64 0, i64 0
%123 = getelementptr inbounds [500 x i32], [500 x i32]* %2, i64 0, i64 0
%124 = call i32 (i32*, i32*, ...) bitcast (i32 (...)* @Compare to i32 (i32*, i32*, ...)*)(i32* %122, i32* %123)
store i32 %124, i32* %9
%125 = load i32, i32* %9
%126 = icmp ne i32 %125, 0
br i1 %126, label %127, label %129
127: ; preds = %121
%128 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
br label %145
129: ; preds = %121
br label %130
130: ; preds = %129
%131 = load i32, i32* %8
%132 = add nsw i32 %131, 1
store i32 %132, i32* %8
br label %34
133: ; preds = %34
%134 = getelementptr inbounds [500 x i32], [500 x i32]* %2, i64 0, i64 0
%135 = call i32 (i32*, ...) bitcast (i32 (...)* @ZeroCheck to i32 (i32*, ...)*)(i32* %134)
%136 = icmp eq i32 %135, 0
br i1 %136, label %137, label %140
137: ; preds = %133
%138 = load i32, i32* %7
%139 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i32 %138)
br label %140
140: ; preds = %137, %133
%141 = load i32, i32* %7
%142 = add nsw i32 %141, 2
store i32 %142, i32* %7
%143 = load i32, i32* %7
%144 = call i32 (i32, ...) bitcast (i32 (...)* @NextPrime to i32 (i32, ...)*)(i32 %143)
store i32 %144, i32* %7
br label %13
145: ; preds = %63, %127, %13
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"p = %d \0A\00"
@.str.3 = [20 x i8] c"mersenne, p = %d\0A\00"
@str = [19 x i8] c"Something is wrong\00"
@str.4 = [16 x i8] c"DivCheck Failed\00"
define void @main() {
%1 = alloca [500 x i32]
%2 = alloca [500 x i32]
%3 = alloca [500 x i32]
%4 = alloca [500 x i32]
%5 = alloca [500 x i32]
%6 = alloca [500 x i32]
%7 = bitcast [500 x i32]* %1 to i8*
%8 = bitcast [500 x i32]* %2 to i8*
%9 = bitcast [500 x i32]* %3 to i8*
%10 = bitcast [500 x i32]* %4 to i8*
%11 = bitcast [500 x i32]* %5 to i8*
%12 = bitcast [500 x i32]* %6 to i8*
%13 = getelementptr inbounds [500 x i32], [500 x i32]* %1, i64 0, i64 0
%14 = getelementptr inbounds [500 x i32], [500 x i32]* %6, i64 0, i64 0
%15 = getelementptr inbounds [500 x i32], [500 x i32]* %2, i64 0, i64 0
%16 = getelementptr inbounds [500 x i32], [500 x i32]* %4, i64 0, i64 0
%17 = getelementptr inbounds [500 x i32], [500 x i32]* %5, i64 0, i64 0
%18 = getelementptr inbounds [500 x i32], [500 x i32]* %3, i64 0, i64 0
br label %19
19: ; preds = %0, %81
%20 = phi i32 [ 5, %0 ], [ %83, %81 ]
%21 = call i32 (i32*, ...) bitcast (i32 (...)* @Initialize to i32 (i32*, ...)*)(i32* %13)
store i32 1, i32* %13
%22 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @LongLeftShift to i32 (i32*, i32, ...)*)(i32* %13, i32 %20)
%23 = call i32 (i32*, ...) bitcast (i32 (...)* @Initialize to i32 (i32*, ...)*)(i32* %14)
store i32 1, i32* %14
%24 = call i32 (i32*, i32*, ...) bitcast (i32 (...)* @Sub to i32 (i32*, i32*, ...)*)(i32* %13, i32* %14)
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %20)
%26 = call i32 (i32*, ...) bitcast (i32 (...)* @Initialize to i32 (i32*, ...)*)(i32* %15)
store i32 4, i32* %15
%27 = add i32 %20, -1
%28 = icmp sgt i32 %20, 2
br i1 %28, label %29, label %76
29: ; preds = %19
%30 = lshr i32 %20, 4
%31 = and i32 %30, 4095
%32 = zext i32 %31 to i64
%33 = getelementptr inbounds [500 x i32], [500 x i32]* %2, i64 0, i64 %32
%34 = shl nuw nsw i32 %31, 4
%35 = sub nsw i32 32, %20
%36 = add nsw i32 %35, %34
%37 = lshr i32 -1, %36
%38 = xor i32 %31, -1
br label %41
39: ; preds = %72
%40 = icmp eq i32 %75, %27
br i1 %40, label %76, label %41
41: ; preds = %29, %39
%42 = phi i32 [ 1, %29 ], [ %75, %39 ]
%43 = call i32 (i32*, i32*, ...) bitcast (i32 (...)* @Copy to i32 (i32*, i32*, ...)*)(i32* %15, i32* %14)
%44 = call i32 (i32*, i32*, ...) bitcast (i32 (...)* @LongMul to i32 (i32*, i32*, ...)*)(i32* %15, i32* %14)
%45 = call i32 (i32*, ...) bitcast (i32 (...)* @Initialize to i32 (i32*, ...)*)(i32* %14)
store i32 2, i32* %14
%46 = call i32 (i32*, i32*, ...) bitcast (i32 (...)* @Sub to i32 (i32*, i32*, ...)*)(i32* %15, i32* %14)
%47 = call i32 (i32*, i32*, i32*, i32*, ...) bitcast (i32 (...)* @LongDiv to i32 (i32*, i32*, i32*, i32*, ...)*)(i32* %15, i32* %13, i32* %16, i32* %17)
%48 = call i32 (i32*, i32*, i32*, i32*, ...) bitcast (i32 (...)* @DivCheck to i32 (i32*, i32*, i32*, i32*, ...)*)(i32* %15, i32* %13, i32* %16, i32* %17)
%49 = icmp eq i32 %48, 0
br i1 %49, label %85, label %50
50: ; preds = %41
%51 = call i32 (i32*, i32*, ...) bitcast (i32 (...)* @Copy to i32 (i32*, i32*, ...)*)(i32* %15, i32* %18)
%52 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @LongRightShift to i32 (i32*, i32, ...)*)(i32* %18, i32 %20)
%53 = call i32 (i32*, ...) bitcast (i32 (...)* @Degree to i32 (i32*, ...)*)(i32* %15)
%54 = icmp sgt i32 %53, %31
br i1 %54, label %55, label %64
55: ; preds = %50
%56 = sext i32 %53 to i64
%57 = add i32 %53, %38
%58 = zext i32 %57 to i64
%59 = sub nsw i64 %56, %58
%60 = getelementptr [500 x i32], [500 x i32]* %2, i64 0, i64 %59
%61 = bitcast i32* %60 to i8*
%62 = shl nuw nsw i64 %58, 2
%63 = add nuw nsw i64 %62, 4
br label %64
64: ; preds = %55, %50
%65 = load i32, i32* %33
%66 = and i32 %65, %37
store i32 %66, i32* %33
%67 = call i32 (i32*, i32*, ...) bitcast (i32 (...)* @Add to i32 (i32*, i32*, ...)*)(i32* %15, i32* %18)
%68 = call i32 (i32*, i32*, ...) bitcast (i32 (...)* @Compare to i32 (i32*, i32*, ...)*)(i32* %15, i32* %13)
%69 = icmp ult i32 %68, 2
br i1 %69, label %70, label %72
70: ; preds = %64
%71 = call i32 (i32*, i32*, ...) bitcast (i32 (...)* @Sub to i32 (i32*, i32*, ...)*)(i32* %15, i32* %13)
br label %72
72: ; preds = %64, %70
%73 = call i32 (i32*, i32*, ...) bitcast (i32 (...)* @Compare to i32 (i32*, i32*, ...)*)(i32* %17, i32* %15)
%74 = icmp eq i32 %73, 0
%75 = add nuw nsw i32 %42, 1
br i1 %74, label %39, label %85
76: ; preds = %39, %19
%77 = call i32 (i32*, ...) bitcast (i32 (...)* @ZeroCheck to i32 (i32*, ...)*)(i32* %15)
%78 = icmp eq i32 %77, 0
br i1 %78, label %79, label %81
79: ; preds = %76
%80 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i32 %20)
br label %81
81: ; preds = %79, %76
%82 = add nsw i32 %20, 2
%83 = call i32 (i32, ...) bitcast (i32 (...)* @NextPrime to i32 (i32, ...)*)(i32 %82)
%84 = icmp slt i32 %83, 525
br i1 %84, label %19, label %88
85: ; preds = %72, %41
%86 = phi i8* [ getelementptr inbounds ([16 x i8], [16 x i8]* @str.4, i64 0, i64 0), %41 ], [ getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0), %72 ]
%87 = call i32 @puts(i8* dereferenceable(1) %86)
br label %88
88: ; preds = %81, %85
ret void
}