#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 check_prime(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int max, min, prime, num;
  scanf("%d %d", &min, &max);
  if (min > max || min < 0 || max < 0) {
    printf("Invalid Input.");
  } else {
    while (min <= max) {
      num = min;
      prime = check_prime(num);
      if (prime != -1) {
        printf("%d ", prime);
      }
      min = min + 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x8(%rbp),%rdx
call   1050 <scanf@plt>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1173 <main+0x43>
cmpl   $0x0,-0xc(%rbp)
jl     1173 <main+0x43>
cmpl   $0x0,-0x8(%rbp)
jge    1186 <main+0x56>
lea    0xe8c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11d6 <main+0xa6>
jmp    118b <main+0x5b>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     11d1 <main+0xa1>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <check_prime@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0xffffffff,-0x10(%rbp)
je     11c3 <main+0x93>
mov    -0x10(%rbp),%esi
lea    0xe59(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    118b <main+0x5b>
jmp    11d6 <main+0xa6>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rdi
lea    0x8(%rsp),%rsi
lea    0xc(%rsp),%rdx
call   1050 <scanf@plt>
mov    0x8(%rsp),%edi
mov    0xc(%rsp),%eax
cmp    %eax,%edi
jg     1199 <main+0x69>
or     %edi,%eax
js     1199 <main+0x69>
lea    0xeb3(%rip),%rbx
jmp    1181 <main+0x51>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    0x8(%rsp),%eax
lea    0x1(%rax),%edi
mov    %edi,0x8(%rsp)
cmp    0xc(%rsp),%eax
jge    11a7 <main+0x77>
call   1030 <check_prime@plt>
cmp    $0xffffffff,%eax
je     1170 <main+0x40>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1170 <main+0x40>
lea    0xe66(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [15 x i8] c"Invalid Input.\00"
@.str.2 = [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 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %1)
%6 = load i32, i32* %2
%7 = load i32, i32* %1
%8 = icmp sgt i32 %6, %7
%9 = or i32 %7, %6
%10 = icmp slt i32 %9, 0
%11 = or i1 %8, %10
br i1 %11, label %12, label %14
12: ; preds = %0
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
br label %25
14: ; preds = %0, %20
%15 = phi i32 [ %22, %20 ], [ %6, %0 ]
%16 = call i32 @check_prime(i32 %15)
%17 = icmp eq i32 %16, -1
br i1 %17, label %20, label %18
18: ; preds = %14
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %16)
br label %20
20: ; preds = %18, %14
%21 = load i32, i32* %2
%22 = add nsw i32 %21, 1
store i32 %22, i32* %2
%23 = load i32, i32* %1
%24 = icmp slt i32 %21, %23
br i1 %24, label %14, label %25
25: ; preds = %20, %12
ret i32 0
}