#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 clock_t;

/* Variables and functions */
int clock();
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, ...);
long long sqrt(long long);
int main() {
  clock_t start, finish;
  long long int a, b;
  printf("Enter your starting number: ");
  scanf("%lld", &a);
  printf("Enter your finishing number: ");
  scanf("%lld", &b);
  int k, s;
  printf("Enter your number of primes: ");
  scanf("%d", &k);
  printf("Enter the distance: ");
  scanf("%d", &s);
  printf("\n");
  if (a > b)
    exit(1);
  long long int tup[k];
  start = clock();
  int i;
  for (i = 0; i < k - 1; i++)
    tup[i] = -100;
  tup[k - 1] = 2;
  if (a % 2 == 0)
    a = (a + 1);
  long long int x;
  long long int y, x2;
  char fl;
  int ans = 0;
  for (x = a; x <= b; x = x + 2) {
    x2 = sqrt(x);
    fl = 1;
    for (y = 3; y <= x2; y = y + 2)
      if (x % y == 0) {
        fl = 0;
        break;
      }
    if (fl == 1) {
      for (i = 0; i < (k - 1); i++)
        tup[i] = tup[i + 1];
      tup[k - 1] = x;
      if ((tup[k - 1] - tup[0]) == s) {
        int j;
        for (j = 0; j < k; j++)
          printf("%7d", tup[j]);
        printf("\n");
        ans++;
      }
    }
  }
  printf("\nNumber of tuples: %d\n", ans);
  finish = clock();
  printf("Time: %d.%.3d sec \n\n", (finish - start) / 1000,
         (finish - start) % 1000);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xea9(%rip),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe89(%rip),%rdi
lea    -0x20(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeaa(%rip),%rdi
lea    -0x24(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
lea    0xe9b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe8a(%rip),%rdi
lea    -0x28(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
jle    1205 <main+0xb5>
mov    $0x1,%edi
call   1070 <exit@plt>
mov    -0x24(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x30(%rbp)
lea    0xf(,%rax,8),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x70(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x38(%rbp)
mov    $0x0,%al
call   1030 <clock@plt>
mov    %eax,-0x8(%rbp)
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    126c <main+0x11c>
mov    -0x70(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movq   $0xffffffffffffff9c,(%rax,%rcx,8)
ff
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    123d <main+0xed>
mov    -0x70(%rbp),%rax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movq   $0x2,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
cmp    $0x0,%rdx
jne    12a5 <main+0x155>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x60(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
cmp    -0x20(%rbp),%rax
jg     1405 <main+0x2b5>
mov    -0x48(%rbp),%rdi
call   1060 <sqrt@plt>
mov    %rax,-0x58(%rbp)
movb   $0x1,-0x59(%rbp)
movq   $0x3,-0x50(%rbp)
mov    -0x50(%rbp),%rax
cmp    -0x58(%rbp),%rax
jg     131c <main+0x1cc>
mov    -0x48(%rbp),%rax
cqto
idivq  -0x50(%rbp)
cmp    $0x0,%rdx
jne    1306 <main+0x1b6>
movb   $0x0,-0x59(%rbp)
jmp    131c <main+0x1cc>
jmp    130b <main+0x1bb>
mov    -0x50(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x50(%rbp)
jmp    12db <main+0x18b>
movsbl -0x59(%rbp),%eax
cmp    $0x1,%eax
jne    13ef <main+0x29f>
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1368 <main+0x218>
mov    -0x70(%rbp),%rax
mov    -0x3c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdx
movslq -0x3c(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1330 <main+0x1e0>
mov    -0x70(%rbp),%rcx
mov    -0x48(%rbp),%rdx
mov    -0x24(%rbp),%eax
sub    $0x1,%eax
cltq
mov    %rdx,(%rcx,%rax,8)
mov    -0x24(%rbp),%eax
sub    $0x1,%eax
cltq
mov    (%rcx,%rax,8),%rax
sub    (%rcx),%rax
movslq -0x28(%rbp),%rcx
cmp    %rcx,%rax
jne    13ea <main+0x29a>
movl   $0x0,-0x64(%rbp)
mov    -0x64(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    13d3 <main+0x283>
mov    -0x70(%rbp),%rax
movslq -0x64(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xcb8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    139f <main+0x24f>
lea    0xcca(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x60(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x60(%rbp)
jmp    13ef <main+0x29f>
jmp    13f4 <main+0x2a4>
mov    -0x48(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x48(%rbp)
jmp    12b4 <main+0x164>
mov    -0x60(%rbp),%esi
lea    0xc6b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <clock@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
mov    -0xc(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
lea    0xc4c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
lea    0xe88(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe97(%rip),%rbx
lea    -0x40(%rbp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0xe87(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    -0x38(%rbp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0xe89(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe99(%rip),%rbx
lea    -0x2c(%rbp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0xe87(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    -0x48(%rbp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <scanf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x40(%rbp),%rax
cmp    -0x38(%rbp),%rax
jg     1510 <main+0x3a0>
mov    %rsp,%r14
mov    -0x2c(%rbp),%eax
mov    %rsp,%r15
lea    0xf(,%rax,8),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r15
mov    %r15,%rsp
xor    %eax,%eax
call   1040 <clock@plt>
mov    %eax,-0x44(%rbp)
mov    -0x2c(%rbp),%ecx
lea    -0x1(%rcx),%eax
cmp    $0x2,%ecx
jl     1361 <main+0x1f1>
mov    %eax,%ecx
cmp    $0x4,%eax
jae    1259 <main+0xe9>
xor    %edx,%edx
jmp    1350 <main+0x1e0>
mov    %ecx,%edx
and    $0xfffffffc,%edx
lea    -0x4(%rdx),%rbx
mov    %rbx,%rdi
shr    $0x2,%rdi
add    $0x1,%rdi
mov    %edi,%esi
and    $0x7,%esi
cmp    $0x1c,%rbx
jae    127f <main+0x10f>
xor    %ebx,%ebx
jmp    1315 <main+0x1a5>
and    $0xfffffffffffffff8,%rdi
xor    %ebx,%ebx
movaps 0xd74(%rip),%xmm0
nopl   0x0(%rax)
movaps %xmm0,(%r15,%rbx,8)
movaps %xmm0,0x10(%r15,%rbx,8)
movaps %xmm0,0x20(%r15,%rbx,8)
movaps %xmm0,0x30(%r15,%rbx,8)
movaps %xmm0,0x40(%r15,%rbx,8)
movaps %xmm0,0x50(%r15,%rbx,8)
movaps %xmm0,0x60(%r15,%rbx,8)
movaps %xmm0,0x70(%r15,%rbx,8)
movaps %xmm0,0x80(%r15,%rbx,8)
movaps %xmm0,0x90(%r15,%rbx,8)
movaps %xmm0,0xa0(%r15,%rbx,8)
movaps %xmm0,0xb0(%r15,%rbx,8)
movaps %xmm0,0xc0(%r15,%rbx,8)
movaps %xmm0,0xd0(%r15,%rbx,8)
movaps %xmm0,0xe0(%r15,%rbx,8)
movaps %xmm0,0xf0(%r15,%rbx,8)
add    $0x20,%rbx
add    $0xfffffffffffffff8,%rdi
jne    1290 <main+0x120>
test   %rsi,%rsi
je     1342 <main+0x1d2>
lea    (%r15,%rbx,8),%rdi
add    $0x10,%rdi
shl    $0x5,%rsi
xor    %ebx,%ebx
movaps 0xcd1(%rip),%xmm0
nop
movaps %xmm0,-0x10(%rdi,%rbx,1)
movaps %xmm0,(%rdi,%rbx,1)
add    $0x20,%rbx
cmp    %rbx,%rsi
jne    1330 <main+0x1c0>
cmp    %rcx,%rdx
je     1361 <main+0x1f1>
nopw   0x0(%rax,%rax,1)
movq   $0xffffffffffffff9c,(%r15,%rdx,8)
ff
add    $0x1,%rdx
cmp    %rdx,%rcx
jne    1350 <main+0x1e0>
cltq
movq   $0x2,(%r15,%rax,8)
mov    -0x40(%rbp),%r12
test   $0x1,%r12b
mov    %r14,-0x50(%rbp)
jne    1381 <main+0x211>
add    $0x1,%r12
mov    %r12,-0x40(%rbp)
movl   $0x0,-0x30(%rbp)
cmp    -0x38(%rbp),%r12
jle    13eb <main+0x27b>
lea    0xcf5(%rip),%rdi
mov    -0x30(%rbp),%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   1040 <clock@plt>
sub    -0x44(%rbp),%eax
movslq %eax,%rdx
imul   $0x10624dd3,%rdx,%rsi
mov    %rsi,%rax
shr    $0x3f,%rax
sar    $0x26,%rsi
add    %eax,%esi
imul   $0x3e8,%esi,%eax
sub    %eax,%edx
lea    0xcd2(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    -0x50(%rbp),%rsp
xor    %eax,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0x8(%r15),%rax
mov    %rax,-0x58(%rbp)
lea    0xc8c(%rip),%r14
movl   $0x0,-0x30(%rbp)
jmp    142c <main+0x2bc>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
addl   $0x1,-0x30(%rbp)
add    $0x2,%r12
cmp    -0x38(%rbp),%r12
jg     138e <main+0x21e>
mov    %r12,%rdi
call   1080 <sqrt@plt>
cmp    $0x3,%rax
jl     1485 <main+0x315>
mov    %rax,%rcx
mov    $0x3,%esi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r12,%rax
or     %rsi,%rax
shr    $0x20,%rax
je     1470 <main+0x300>
mov    %r12,%rax
cqto
idiv   %rsi
test   %rdx,%rdx
jne    147c <main+0x30c>
jmp    141e <main+0x2ae>
nopl   0x0(%rax,%rax,1)
mov    %r12d,%eax
xor    %edx,%edx
div    %esi
test   %rdx,%rdx
je     141e <main+0x2ae>
add    $0x2,%rsi
cmp    %rcx,%rsi
jle    1450 <main+0x2e0>
mov    -0x2c(%rbp),%r13d
lea    -0x1(%r13),%ebx
cmp    $0x2,%r13d
jl     14a5 <main+0x335>
mov    %ebx,%edx
shl    $0x3,%rdx
mov    %r15,%rdi
mov    -0x58(%rbp),%rsi
call   1070 <memmove@plt>
movslq %ebx,%rax
mov    %r12,(%r15,%rax,8)
mov    (%r15),%rsi
mov    %r12,%rax
sub    %rsi,%rax
movslq -0x48(%rbp),%rcx
cmp    %rcx,%rax
jne    141e <main+0x2ae>
test   %r13d,%r13d
jle    1410 <main+0x2a0>
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
cmpl   $0x2,-0x2c(%rbp)
jl     1410 <main+0x2a0>
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    (%r15,%rbx,8),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%rbx
movslq -0x2c(%rbp),%rax
cmp    %rax,%rbx
jl     14f0 <main+0x380>
jmp    1410 <main+0x2a0>
mov    $0x1,%edi
call   1090 <exit@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"Enter your starting number: \00"
@.str.1 = [5 x i8] c"%lld\00"
@.str.2 = [30 x i8] c"Enter your finishing number: \00"
@.str.3 = [30 x i8] c"Enter your number of primes: \00"
@.str.4 = [3 x i8] c"%d\00"
@.str.5 = [21 x i8] c"Enter the distance: \00"
@.str.6 = [2 x i8] c"\0A\00"
@.str.7 = [4 x i8] c"%7d\00"
@.str.8 = [23 x i8] c"\0ANumber of tuples: %d\0A\00"
@.str.9 = [21 x i8] c"Time: %d.%.3d sec \0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i64
%5 = alloca i64
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i32
%11 = alloca i64
%12 = alloca i64
%13 = alloca i64
%14 = alloca i8
%15 = alloca i32
%16 = alloca i32
store i32 0, i32* %1
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%18 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64* %4)
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
%20 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64* %5)
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0))
%22 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %6)
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0))
%24 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %7)
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%26 = load i64, i64* %4
%27 = load i64, i64* %5
%28 = icmp sgt i64 %26, %27
br i1 %28, label %29, label %31
29: ; preds = %0
%30 = call i32 @exit(i32 1)
unreachable
31: ; preds = %0
%32 = load i32, i32* %6
%33 = zext i32 %32 to i64
%34 = call i8* @llvm.stacksave()
store i8* %34, i8** %8
%35 = alloca i64, i64 %33
store i64 %33, i64* %9
%36 = call i32 (...) @clock()
store i32 %36, i32* %2
store i32 0, i32* %10
br label %37
37: ; preds = %46, %31
%38 = load i32, i32* %10
%39 = load i32, i32* %6
%40 = sub nsw i32 %39, 1
%41 = icmp slt i32 %38, %40
br i1 %41, label %42, label %49
42: ; preds = %37
%43 = load i32, i32* %10
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds i64, i64* %35, i64 %44
store i64 -100, i64* %45
br label %46
46: ; preds = %42
%47 = load i32, i32* %10
%48 = add nsw i32 %47, 1
store i32 %48, i32* %10
br label %37
49: ; preds = %37
%50 = load i32, i32* %6
%51 = sub nsw i32 %50, 1
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds i64, i64* %35, i64 %52
store i64 2, i64* %53
%54 = load i64, i64* %4
%55 = srem i64 %54, 2
%56 = icmp eq i64 %55, 0
br i1 %56, label %57, label %60
57: ; preds = %49
%58 = load i64, i64* %4
%59 = add nsw i64 %58, 1
store i64 %59, i64* %4
br label %60
60: ; preds = %57, %49
store i32 0, i32* %15
%61 = load i64, i64* %4
store i64 %61, i64* %11
br label %62
62: ; preds = %142, %60
%63 = load i64, i64* %11
%64 = load i64, i64* %5
%65 = icmp sle i64 %63, %64
br i1 %65, label %66, label %145
66: ; preds = %62
%67 = load i64, i64* %11
%68 = call i64 @sqrt(i64 %67)
store i64 %68, i64* %13
store i8 1, i8* %14
store i64 3, i64* %12
br label %69
69: ; preds = %80, %66
%70 = load i64, i64* %12
%71 = load i64, i64* %13
%72 = icmp sle i64 %70, %71
br i1 %72, label %73, label %83
73: ; preds = %69
%74 = load i64, i64* %11
%75 = load i64, i64* %12
%76 = srem i64 %74, %75
%77 = icmp eq i64 %76, 0
br i1 %77, label %78, label %79
78: ; preds = %73
store i8 0, i8* %14
br label %83
79: ; preds = %73
br label %80
80: ; preds = %79
%81 = load i64, i64* %12
%82 = add nsw i64 %81, 2
store i64 %82, i64* %12
br label %69
83: ; preds = %78, %69
%84 = load i8, i8* %14
%85 = sext i8 %84 to i32
%86 = icmp eq i32 %85, 1
br i1 %86, label %87, label %141
87: ; preds = %83
store i32 0, i32* %10
br label %88
88: ; preds = %102, %87
%89 = load i32, i32* %10
%90 = load i32, i32* %6
%91 = sub nsw i32 %90, 1
%92 = icmp slt i32 %89, %91
br i1 %92, label %93, label %105
93: ; preds = %88
%94 = load i32, i32* %10
%95 = add nsw i32 %94, 1
%96 = sext i32 %95 to i64
%97 = getelementptr inbounds i64, i64* %35, i64 %96
%98 = load i64, i64* %97
%99 = load i32, i32* %10
%100 = sext i32 %99 to i64
%101 = getelementptr inbounds i64, i64* %35, i64 %100
store i64 %98, i64* %101
br label %102
102: ; preds = %93
%103 = load i32, i32* %10
%104 = add nsw i32 %103, 1
store i32 %104, i32* %10
br label %88
105: ; preds = %88
%106 = load i64, i64* %11
%107 = load i32, i32* %6
%108 = sub nsw i32 %107, 1
%109 = sext i32 %108 to i64
%110 = getelementptr inbounds i64, i64* %35, i64 %109
store i64 %106, i64* %110
%111 = load i32, i32* %6
%112 = sub nsw i32 %111, 1
%113 = sext i32 %112 to i64
%114 = getelementptr inbounds i64, i64* %35, i64 %113
%115 = load i64, i64* %114
%116 = getelementptr inbounds i64, i64* %35, i64 0
%117 = load i64, i64* %116
%118 = sub nsw i64 %115, %117
%119 = load i32, i32* %7
%120 = sext i32 %119 to i64
%121 = icmp eq i64 %118, %120
br i1 %121, label %122, label %140
122: ; preds = %105
store i32 0, i32* %16
br label %123
123: ; preds = %133, %122
%124 = load i32, i32* %16
%125 = load i32, i32* %6
%126 = icmp slt i32 %124, %125
br i1 %126, label %127, label %136
127: ; preds = %123
%128 = load i32, i32* %16
%129 = sext i32 %128 to i64
%130 = getelementptr inbounds i64, i64* %35, i64 %129
%131 = load i64, i64* %130
%132 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i64 %131)
br label %133
133: ; preds = %127
%134 = load i32, i32* %16
%135 = add nsw i32 %134, 1
store i32 %135, i32* %16
br label %123
136: ; preds = %123
%137 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%138 = load i32, i32* %15
%139 = add nsw i32 %138, 1
store i32 %139, i32* %15
br label %140
140: ; preds = %136, %105
br label %141
141: ; preds = %140, %83
br label %142
142: ; preds = %141
%143 = load i64, i64* %11
%144 = add nsw i64 %143, 2
store i64 %144, i64* %11
br label %62
145: ; preds = %62
%146 = load i32, i32* %15
%147 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.8, i64 0, i64 0), i32 %146)
%148 = call i32 (...) @clock()
store i32 %148, i32* %3
%149 = load i32, i32* %3
%150 = load i32, i32* %2
%151 = sub nsw i32 %149, %150
%152 = sdiv i32 %151, 1000
%153 = load i32, i32* %3
%154 = load i32, i32* %2
%155 = sub nsw i32 %153, %154
%156 = srem i32 %155, 1000
%157 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.9, i64 0, i64 0), i32 %152, i32 %156)
store i32 0, i32* %1
%158 = load i8*, i8** %8
%159 = load i32, i32* %1
ret i32 %159
}

LLVM IR (-O2):
@.str = [29 x i8] c"Enter your starting number: \00"
@.str.1 = [5 x i8] c"%lld\00"
@.str.2 = [30 x i8] c"Enter your finishing number: \00"
@.str.3 = [30 x i8] c"Enter your number of primes: \00"
@.str.4 = [3 x i8] c"%d\00"
@.str.5 = [21 x i8] c"Enter the distance: \00"
@.str.7 = [4 x i8] c"%7d\00"
@.str.8 = [23 x i8] c"\0ANumber of tuples: %d\0A\00"
@.str.9 = [21 x i8] c"Time: %d.%.3d sec \0A\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = alloca i64
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i64* %1 to i8*
%6 = bitcast i64* %2 to i8*
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64* %1)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64* %2)
%11 = bitcast i32* %3 to i8*
%12 = bitcast i32* %4 to i8*
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0))
%14 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %3)
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0))
%16 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %4)
%17 = call i32 @putchar(i32 10)
%18 = load i64, i64* %1
%19 = load i64, i64* %2
%20 = icmp sgt i64 %18, %19
br i1 %20, label %21, label %23
21: ; preds = %0
%22 = call i32 @exit(i32 1)
unreachable
23: ; preds = %0
%24 = load i32, i32* %3
%25 = zext i32 %24 to i64
%26 = call i8* @llvm.stacksave()
%27 = alloca i64, i64 %25
%28 = bitcast i64* %27 to i8*
%29 = call i32 (...) @clock()
%30 = load i32, i32* %3
%31 = add i32 %30, -1
%32 = icmp sgt i32 %30, 1
br i1 %32, label %33, label %112
33: ; preds = %23
%34 = zext i32 %31 to i64
%35 = icmp ult i32 %31, 4
br i1 %35, label %105, label %36
36: ; preds = %33
%37 = and i64 %34, 4294967292
%38 = add nsw i64 %37, -4
%39 = lshr exact i64 %38, 2
%40 = add nuw nsw i64 %39, 1
%41 = and i64 %40, 7
%42 = icmp ult i64 %38, 28
br i1 %42, label %90, label %43
43: ; preds = %36
%44 = and i64 %40, 9223372036854775800
br label %45
45: ; preds = %45, %43
%46 = phi i64 [ 0, %43 ], [ %87, %45 ]
%47 = phi i64 [ 0, %43 ], [ %88, %45 ]
%48 = getelementptr inbounds i64, i64* %27, i64 %46
%49 = bitcast i64* %48 to <2 x i64>*
store <2 x i64> <i64 -100, i64 -100>, <2 x i64>* %49
%50 = getelementptr inbounds i64, i64* %48, i64 2
%51 = bitcast i64* %50 to <2 x i64>*
store <2 x i64> <i64 -100, i64 -100>, <2 x i64>* %51
%52 = or i64 %46, 4
%53 = getelementptr inbounds i64, i64* %27, i64 %52
%54 = bitcast i64* %53 to <2 x i64>*
store <2 x i64> <i64 -100, i64 -100>, <2 x i64>* %54
%55 = getelementptr inbounds i64, i64* %53, i64 2
%56 = bitcast i64* %55 to <2 x i64>*
store <2 x i64> <i64 -100, i64 -100>, <2 x i64>* %56
%57 = or i64 %46, 8
%58 = getelementptr inbounds i64, i64* %27, i64 %57
%59 = bitcast i64* %58 to <2 x i64>*
store <2 x i64> <i64 -100, i64 -100>, <2 x i64>* %59
%60 = getelementptr inbounds i64, i64* %58, i64 2
%61 = bitcast i64* %60 to <2 x i64>*
store <2 x i64> <i64 -100, i64 -100>, <2 x i64>* %61
%62 = or i64 %46, 12
%63 = getelementptr inbounds i64, i64* %27, i64 %62
%64 = bitcast i64* %63 to <2 x i64>*
store <2 x i64> <i64 -100, i64 -100>, <2 x i64>* %64
%65 = getelementptr inbounds i64, i64* %63, i64 2
%66 = bitcast i64* %65 to <2 x i64>*
store <2 x i64> <i64 -100, i64 -100>, <2 x i64>* %66
%67 = or i64 %46, 16
%68 = getelementptr inbounds i64, i64* %27, i64 %67
%69 = bitcast i64* %68 to <2 x i64>*
store <2 x i64> <i64 -100, i64 -100>, <2 x i64>* %69
%70 = getelementptr inbounds i64, i64* %68, i64 2
%71 = bitcast i64* %70 to <2 x i64>*
store <2 x i64> <i64 -100, i64 -100>, <2 x i64>* %71
%72 = or i64 %46, 20
%73 = getelementptr inbounds i64, i64* %27, i64 %72
%74 = bitcast i64* %73 to <2 x i64>*
store <2 x i64> <i64 -100, i64 -100>, <2 x i64>* %74
%75 = getelementptr inbounds i64, i64* %73, i64 2
%76 = bitcast i64* %75 to <2 x i64>*
store <2 x i64> <i64 -100, i64 -100>, <2 x i64>* %76
%77 = or i64 %46, 24
%78 = getelementptr inbounds i64, i64* %27, i64 %77
%79 = bitcast i64* %78 to <2 x i64>*
store <2 x i64> <i64 -100, i64 -100>, <2 x i64>* %79
%80 = getelementptr inbounds i64, i64* %78, i64 2
%81 = bitcast i64* %80 to <2 x i64>*
store <2 x i64> <i64 -100, i64 -100>, <2 x i64>* %81
%82 = or i64 %46, 28
%83 = getelementptr inbounds i64, i64* %27, i64 %82
%84 = bitcast i64* %83 to <2 x i64>*
store <2 x i64> <i64 -100, i64 -100>, <2 x i64>* %84
%85 = getelementptr inbounds i64, i64* %83, i64 2
%86 = bitcast i64* %85 to <2 x i64>*
store <2 x i64> <i64 -100, i64 -100>, <2 x i64>* %86
%87 = add nuw i64 %46, 32
%88 = add i64 %47, 8
%89 = icmp eq i64 %88, %44
br i1 %89, label %90, label %45
90: ; preds = %45, %36
%91 = phi i64 [ 0, %36 ], [ %87, %45 ]
%92 = icmp eq i64 %41, 0
br i1 %92, label %103, label %93
93: ; preds = %90, %93
%94 = phi i64 [ %100, %93 ], [ %91, %90 ]
%95 = phi i64 [ %101, %93 ], [ 0, %90 ]
%96 = getelementptr inbounds i64, i64* %27, i64 %94
%97 = bitcast i64* %96 to <2 x i64>*
store <2 x i64> <i64 -100, i64 -100>, <2 x i64>* %97
%98 = getelementptr inbounds i64, i64* %96, i64 2
%99 = bitcast i64* %98 to <2 x i64>*
store <2 x i64> <i64 -100, i64 -100>, <2 x i64>* %99
%100 = add nuw i64 %94, 4
%101 = add i64 %95, 1
%102 = icmp eq i64 %101, %41
br i1 %102, label %103, label %93
103: ; preds = %93, %90
%104 = icmp eq i64 %37, %34
br i1 %104, label %112, label %105
105: ; preds = %33, %103
%106 = phi i64 [ 0, %33 ], [ %37, %103 ]
br label %107
107: ; preds = %105, %107
%108 = phi i64 [ %110, %107 ], [ %106, %105 ]
%109 = getelementptr inbounds i64, i64* %27, i64 %108
store i64 -100, i64* %109
%110 = add nuw nsw i64 %108, 1
%111 = icmp eq i64 %110, %34
br i1 %111, label %112, label %107
112: ; preds = %107, %103, %23
%113 = sext i32 %31 to i64
%114 = getelementptr inbounds i64, i64* %27, i64 %113
store i64 2, i64* %114
%115 = load i64, i64* %1
%116 = and i64 %115, 1
%117 = icmp eq i64 %116, 0
br i1 %117, label %118, label %120
118: ; preds = %112
%119 = add nuw nsw i64 %115, 1
store i64 %119, i64* %1
br label %120
120: ; preds = %118, %112
%121 = phi i64 [ %119, %118 ], [ %115, %112 ]
%122 = load i64, i64* %2
%123 = icmp sgt i64 %121, %122
br i1 %123, label %177, label %124
124: ; preds = %120
%125 = getelementptr inbounds i64, i64* %27, i64 1
%126 = bitcast i64* %125 to i8*
br label %127
127: ; preds = %124, %172
%128 = phi i32 [ %173, %172 ], [ 0, %124 ]
%129 = phi i64 [ %174, %172 ], [ %121, %124 ]
%130 = call i64 @sqrt(i64 %129)
%131 = icmp slt i64 %130, 3
br i1 %131, label %134, label %141
132: ; preds = %141
%133 = icmp sgt i64 %145, %130
br i1 %133, label %134, label %141
134: ; preds = %132, %127
%135 = load i32, i32* %3
%136 = add i32 %135, -1
%137 = icmp sgt i32 %135, 1
br i1 %137, label %138, label %146
138: ; preds = %134
%139 = zext i32 %136 to i64
%140 = shl nuw nsw i64 %139, 3
br label %146
141: ; preds = %127, %132
%142 = phi i64 [ %145, %132 ], [ 3, %127 ]
%143 = srem i64 %129, %142
%144 = icmp eq i64 %143, 0
%145 = add nuw nsw i64 %142, 2
br i1 %144, label %172, label %132
146: ; preds = %138, %134
%147 = sext i32 %136 to i64
%148 = getelementptr inbounds i64, i64* %27, i64 %147
store i64 %129, i64* %148
%149 = load i64, i64* %27
%150 = sub nsw i64 %129, %149
%151 = load i32, i32* %4
%152 = sext i32 %151 to i64
%153 = icmp eq i64 %150, %152
br i1 %153, label %154, label %172
154: ; preds = %146
%155 = icmp sgt i32 %135, 0
br i1 %155, label %156, label %169
156: ; preds = %154
%157 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i64 %149)
%158 = load i32, i32* %3
%159 = icmp sgt i32 %158, 1
br i1 %159, label %160, label %169
160: ; preds = %156, %160
%161 = phi i64 [ %165, %160 ], [ 1, %156 ]
%162 = getelementptr inbounds i64, i64* %27, i64 %161
%163 = load i64, i64* %162
%164 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i64 %163)
%165 = add nuw nsw i64 %161, 1
%166 = load i32, i32* %3
%167 = sext i32 %166 to i64
%168 = icmp slt i64 %165, %167
br i1 %168, label %160, label %169
169: ; preds = %160, %156, %154
%170 = call i32 @putchar(i32 10)
%171 = add nsw i32 %128, 1
br label %172
172: ; preds = %141, %169, %146
%173 = phi i32 [ %171, %169 ], [ %128, %146 ], [ %128, %141 ]
%174 = add nsw i64 %129, 2
%175 = load i64, i64* %2
%176 = icmp sgt i64 %174, %175
br i1 %176, label %177, label %127
177: ; preds = %172, %120
%178 = phi i32 [ 0, %120 ], [ %173, %172 ]
%179 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.8, i64 0, i64 0), i32 %178)
%180 = call i32 (...) @clock()
%181 = sub nsw i32 %180, %29
%182 = sdiv i32 %181, 1000
%183 = srem i32 %181, 1000
%184 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.9, i64 0, i64 0), i32 %182, i32 %183)
ret i32 0
}