#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 /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *, int *);
main() {
  int n1, n2, i, j, flag;
  printf("Enter two intervals");
  scanf("%d%d", &n1, &n2);
  for (i = n1 + 1; i < n2; i++) {
    flag = 0;
    for (j = 2; j <= i / 2; j++) {
      if (i % j == 0) {
        flag = 1;
        break;
      }
    }
    if (flag == 0)
      printf("%d", i);
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed0(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11f8 <main+0xd8>
movl   $0x0,-0x18(%rbp)
movl   $0x2,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
cmp    %ecx,%eax
jg     11c1 <main+0xa1>
mov    -0x10(%rbp),%eax
cltd
idivl  -0x14(%rbp)
cmp    $0x0,%edx
jne    11ae <main+0x8e>
movl   $0x1,-0x18(%rbp)
jmp    11c1 <main+0xa1>
jmp    11b3 <main+0x93>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1174 <main+0x54>
cmpl   $0x0,-0x18(%rbp)
jne    11dc <main+0xbc>
mov    -0x10(%rbp),%esi
lea    0xe41(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe36(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    115a <main+0x3a>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xecb(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1050 <scanf@plt>
mov    0x4(%rsp),%ebx
add    $0x1,%ebx
cmp    (%rsp),%ebx
jge    11bd <main+0x8d>
lea    0xead(%rip),%r14
jmp    118e <main+0x5e>
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
cmp    (%rsp),%ebx
jge    11bd <main+0x8d>
cmp    $0x4,%ebx
jl     1170 <main+0x40>
mov    %ebx,%ecx
shr    %ecx
neg    %ecx
mov    $0x2,%esi
xchg   %ax,%ax
mov    %ebx,%eax
cltd
idiv   %esi
test   %edx,%edx
je     117c <main+0x4c>
lea    (%rcx,%rsi,1),%eax
add    $0x1,%eax
mov    %esi,%edx
add    $0x1,%edx
mov    %edx,%esi
cmp    $0x1,%eax
jne    11a0 <main+0x70>
jmp    1170 <main+0x40>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Enter two intervals\00"
@.str.1 = [5 x i8] c"%d%d\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %3)
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 1
store i32 %10, i32* %4
br label %11
11: ; preds = %39, %0
%12 = load i32, i32* %4
%13 = load i32, i32* %3
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %42
15: ; preds = %11
store i32 0, i32* %6
store i32 2, i32* %5
br label %16
16: ; preds = %28, %15
%17 = load i32, i32* %5
%18 = load i32, i32* %4
%19 = sdiv i32 %18, 2
%20 = icmp sle i32 %17, %19
br i1 %20, label %21, label %31
21: ; preds = %16
%22 = load i32, i32* %4
%23 = load i32, i32* %5
%24 = srem i32 %22, %23
%25 = icmp eq i32 %24, 0
br i1 %25, label %26, label %27
26: ; preds = %21
store i32 1, i32* %6
br label %31
27: ; preds = %21
br label %28
28: ; preds = %27
%29 = load i32, i32* %5
%30 = add nsw i32 %29, 1
store i32 %30, i32* %5
br label %16
31: ; preds = %26, %16
%32 = load i32, i32* %6
%33 = icmp eq i32 %32, 0
br i1 %33, label %34, label %37
34: ; preds = %31
%35 = load i32, i32* %4
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %35)
br label %37
37: ; preds = %34, %31
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %39
39: ; preds = %37
%40 = load i32, i32* %4
%41 = add nsw i32 %40, 1
store i32 %41, i32* %4
br label %11
42: ; preds = %11
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"Enter two intervals\00"
@.str.1 = [5 x i8] c"%d%d\00"
@.str.2 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = add nsw i32 %7, 1
%9 = load i32, i32* %2
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %30
11: ; preds = %0, %25
%12 = phi i32 [ %27, %25 ], [ %8, %0 ]
%13 = icmp slt i32 %12, 4
br i1 %13, label %23, label %14
14: ; preds = %11
%15 = lshr i32 %12, 1
br label %19
16: ; preds = %19
%17 = add nuw nsw i32 %20, 1
%18 = icmp eq i32 %20, %15
br i1 %18, label %23, label %19
19: ; preds = %14, %16
%20 = phi i32 [ %17, %16 ], [ 2, %14 ]
%21 = srem i32 %12, %20
%22 = icmp eq i32 %21, 0
br i1 %22, label %25, label %16
23: ; preds = %16, %11
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %12)
br label %25
25: ; preds = %19, %23
%26 = call i32 @putchar(i32 10)
%27 = add nsw i32 %12, 1
%28 = load i32, i32* %2
%29 = icmp slt i32 %27, %28
br i1 %29, label %11, label %30
30: ; preds = %25, %0
ret i32 0
}