#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 *, long *);
int /*<<< orphan*/ varify(long, long);
int main() {
  long int s, f;
  printf("Enter your starting number: ");
  scanf("%ld", &s);
  printf("Enter your finishing number: ");
  scanf("%ld", &f);
  if (s > f)
    printf("Wrong information!\a\nstarting number is bigger.\a\n");
  else if (s < 2 || f < 3)
    printf("\aError!\a");
  else {
    printf("\nThe first prime is: 2\nYour requirements are given bellow:\n\n");
    varify(s, f);
  }
  printf("\n\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    0xecb(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
lea    0xeaf(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jle    1196 <main+0x66>
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
jmp    11db <main+0xab>
cmpq   $0x2,-0x10(%rbp)
jl     11ac <main+0x7c>
cmpq   $0x3,-0x18(%rbp)
jge    11bd <main+0x8d>
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
jmp    11d6 <main+0xa6>
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <varify@plt>
jmp    11db <main+0xab>
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xeb4(%rip),%rdi
call   1040 <printf@plt>
lea    0xec5(%rip),%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
lea    0xeb5(%rip),%rdi
call   1040 <printf@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
mov    0x8(%rsp),%rcx
mov    (%rsp),%rax
cmp    %rax,%rcx
jle    1198 <main+0x58>
lea    0xef3(%rip),%rdi
call   1030 <puts@plt>
jmp    11cc <main+0x8c>
cmp    $0x2,%rcx
jl     11c0 <main+0x80>
cmp    $0x2,%rax
jle    11c0 <main+0x80>
lea    0xe9d(%rip),%rdi
call   1030 <puts@plt>
mov    0x8(%rsp),%rdi
mov    (%rsp),%rsi
call   1050 <varify@plt>
jmp    11cc <main+0x8c>
lea    0xe78(%rip),%rdi
call   1040 <printf@plt>
lea    0xeaf(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"Enter your starting number: \00"
@.str.1 = [4 x i8] c"%ld\00"
@.str.2 = [30 x i8] c"Enter your finishing number: \00"
@.str.3 = [49 x i8] c"Wrong information!\07\0Astarting number is bigger.\07\0A\00"
@.str.4 = [9 x i8] c"\07Error!\07\00"
@.str.5 = [61 x i8] c"\0AThe first prime is: 2\0AYour requirements are given bellow:\0A\0A\00"
@.str.6 = [3 x i8] c"\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
store i32 0, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64* %2)
%6 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64* %3)
%8 = load i64, i64* %2
%9 = load i64, i64* %3
%10 = icmp sgt i64 %8, %9
br i1 %10, label %11, label %13
11: ; preds = %0
%12 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.3, i64 0, i64 0))
br label %27
13: ; preds = %0
%14 = load i64, i64* %2
%15 = icmp slt i64 %14, 2
br i1 %15, label %19, label %16
16: ; preds = %13
%17 = load i64, i64* %3
%18 = icmp slt i64 %17, 3
br i1 %18, label %19, label %21
19: ; preds = %16, %13
%20 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
br label %26
21: ; preds = %16
%22 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.5, i64 0, i64 0))
%23 = load i64, i64* %2
%24 = load i64, i64* %3
%25 = call i32 @varify(i64 %23, i64 %24)
br label %26
26: ; preds = %21, %19
br label %27
27: ; preds = %26, %11
%28 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [29 x i8] c"Enter your starting number: \00"
@.str.1 = [4 x i8] c"%ld\00"
@.str.2 = [30 x i8] c"Enter your finishing number: \00"
@.str.4 = [9 x i8] c"\07Error!\07\00"
@str = [60 x i8] c"\0AThe first prime is: 2\0AYour requirements are given bellow:\0A\00"
@str.7 = [2 x i8] c"\0A\00"
@str.8 = [48 x i8] c"Wrong information!\07\0Astarting number is bigger.\07\00"
define i32 @main() {
%1 = alloca i64
%2 = alloca i64
%3 = bitcast i64* %1 to i8*
%4 = bitcast i64* %2 to i8*
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64* %1)
%7 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64* %2)
%9 = load i64, i64* %1
%10 = load i64, i64* %2
%11 = icmp sgt i64 %9, %10
br i1 %11, label %12, label %14
12: ; preds = %0
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str.8, i64 0, i64 0))
br label %25
14: ; preds = %0
%15 = icmp slt i64 %9, 2
%16 = icmp slt i64 %10, 3
%17 = select i1 %15, i1 true, i1 %16
br i1 %17, label %18, label %20
18: ; preds = %14
%19 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
br label %25
20: ; preds = %14
%21 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str, i64 0, i64 0))
%22 = load i64, i64* %1
%23 = load i64, i64* %2
%24 = call i32 @varify(i64 %22, i64 %23)
br label %25
25: ; preds = %18, %20, %12
%26 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.7, i64 0, i64 0))
ret i32 0
}