#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 */
scalar_t__ is_num_pld(int);
int *prime(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main(int argc, const char *argv[]) {
  int a, b, i, *p;
  scanf("%d%d", &a, &b);
  p = prime(b);
  for (i = 0; p[i] != 0; i++) {
    if (p[i] >= a && is_num_pld(p[i]))
      printf("%d\n", p[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xea3(%rip),%rdi
lea    -0x14(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1050 <scanf@plt>
mov    -0x18(%rbp),%edi
call   1060 <prime@plt>
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x28(%rbp),%rax
movslq -0x1c(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     11e7 <main+0xa7>
mov    -0x28(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x14(%rbp),%eax
jl     11d4 <main+0x94>
mov    -0x28(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   1030 <is_num_pld@plt>
cmp    $0x0,%rax
je     11d4 <main+0x94>
mov    -0x28(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe36(%rip),%rdi
call   1040 <printf@plt>
jmp    11d9 <main+0x99>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    117d <main+0x3d>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xeb5(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1050 <scanf@plt>
mov    (%rsp),%edi
call   1060 <prime@plt>
mov    (%rax),%edi
test   %edi,%edi
je     11a7 <main+0x67>
mov    %rax,%rbx
add    $0x4,%rbx
lea    0xe91(%rip),%r14
jmp    118a <main+0x4a>
cs nopw 0x0(%rax,%rax,1)
mov    (%rbx),%edi
add    $0x4,%rbx
test   %edi,%edi
je     11a7 <main+0x67>
cmp    0x4(%rsp),%edi
jl     1180 <main+0x40>
call   1030 <is_num_pld@plt>
test   %rax,%rax
je     1180 <main+0x40>
mov    -0x4(%rbx),%esi
mov    %r14,%rdi
call   1040 <printf@plt>
jmp    1180 <main+0x40>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

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