#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(void) {
  int num1, num2, j, i, count;
  printf("Enter first number: ");
  scanf("%d", &num1);
  printf("Enter second number: ");
  scanf("%d", &num2);
  for (i = num1; i < num2; i++) {
    count = 0;
    for (j = 2; j <= i / 2; j++) {
      if (i % j == 0) {
        count++;
        break;
      }
    }
    if (count == 0 && i != 1) {
      printf("%d ", i);
    }
  }
  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    0xed1(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb3(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1212 <main+0xf2>
movl   $0x0,-0x18(%rbp)
movl   $0x2,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
cmp    %ecx,%eax
jg     11da <main+0xba>
mov    -0x14(%rbp),%eax
cltd
idivl  -0x10(%rbp)
cmp    $0x0,%edx
jne    11c7 <main+0xa7>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11da <main+0xba>
jmp    11cc <main+0xac>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    118b <main+0x6b>
cmpl   $0x0,-0x18(%rbp)
jne    11ff <main+0xdf>
cmpl   $0x1,-0x14(%rbp)
je     11ff <main+0xdf>
mov    -0x14(%rbp),%esi
lea    0xe36(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1204 <main+0xe4>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1171 <main+0x51>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xedc(%rip),%rbx
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xecb(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0x4(%rsp),%ebx
mov    (%rsp),%r8d
cmp    %r8d,%ebx
jge    11e0 <main+0xc0>
lea    0xebb(%rip),%r14
jmp    1188 <main+0x68>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%ebx
cmp    %r8d,%ebx
jge    11e0 <main+0xc0>
mov    $0x1,%al
cmp    $0x4,%ebx
jl     11c5 <main+0xa5>
mov    %ebx,%esi
shr    $0x1f,%esi
add    %ebx,%esi
sar    %esi
cmp    $0x3,%esi
mov    $0x2,%edi
cmovge %esi,%edi
mov    $0x1,%ecx
nopl   0x0(%rax,%rax,1)
add    $0x1,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
test   %edx,%edx
je     1180 <main+0x60>
cmp    %ecx,%edi
jne    11b0 <main+0x90>
cmp    %esi,%ecx
setge  %al
cmp    $0x1,%ebx
je     1180 <main+0x60>
test   %al,%al
je     1180 <main+0x60>
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    (%rsp),%r8d
jmp    1180 <main+0x60>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [21 x i8] c"Enter first number: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [22 x i8] c"Enter second number: \00"
@.str.3 = [4 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 ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %39
12: ; preds = %0, %35
%13 = phi i32 [ %36, %35 ], [ %10, %0 ]
%14 = phi i32 [ %37, %35 ], [ %9, %0 ]
%15 = sdiv i32 %14, 2
%16 = icmp slt i32 %14, 4
br i1 %16, label %28, label %17
17: ; preds = %12
%18 = call i32 @llvm.smax.i32(i32 %15, i32 2)
br label %22
19: ; preds = %22
%20 = add nuw nsw i32 %23, 1
%21 = icmp eq i32 %23, %18
br i1 %21, label %26, label %22
22: ; preds = %17, %19
%23 = phi i32 [ %20, %19 ], [ 2, %17 ]
%24 = srem i32 %14, %23
%25 = icmp eq i32 %24, 0
br i1 %25, label %35, label %19
26: ; preds = %19
%27 = icmp sge i32 %23, %15
br label %28
28: ; preds = %26, %12
%29 = phi i1 [ true, %12 ], [ %27, %26 ]
%30 = icmp ne i32 %14, 1
%31 = and i1 %30, %29
br i1 %31, label %32, label %35
32: ; preds = %28
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %14)
%34 = load i32, i32* %2
br label %35
35: ; preds = %22, %28, %32
%36 = phi i32 [ %13, %28 ], [ %34, %32 ], [ %13, %22 ]
%37 = add nsw i32 %14, 1
%38 = icmp slt i32 %37, %36
br i1 %38, label %12, label %39
39: ; preds = %35, %0
ret i32 0
}