#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_prime(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int m, n;
  scanf("%d %d", &m, &n);
  int count = 0;
  int changeline = 0;
  int flag = 1;
  while (flag) {
    for (int i = 2;; i++) {
      if (is_prime(i)) {
        count++;
        if (count >= m && count <= n) {
          changeline++;
          if (count == n) {
            printf("%d", i);
            flag = 0;
            break;
          } else if (changeline % 10 == 0) {
            printf("%d\n", i);
          } else
            printf("%d ", i);
        }
      }
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1050 <scanf@plt>
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x1,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
je     123a <main+0x10a>
movl   $0x2,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
call   1040 <is_prime@plt>
cmp    $0x0,%rax
je     1222 <main+0xf2>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     121d <main+0xed>
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     121d <main+0xed>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    11dc <main+0xac>
mov    -0x1c(%rbp),%esi
lea    0xe38(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x18(%rbp)
jmp    1235 <main+0x105>
mov    -0x14(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1204 <main+0xd4>
mov    -0x1c(%rbp),%esi
lea    0xe0c(%rip),%rdi
call   1030 <printf@plt>
jmp    1213 <main+0xe3>
mov    -0x1c(%rbp),%esi
lea    0xdfc(%rip),%rdi
call   1030 <printf@plt>
jmp    1218 <main+0xe8>
jmp    121d <main+0xed>
jmp    1222 <main+0xf2>
jmp    1227 <main+0xf7>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1179 <main+0x49>
jmp    1168 <main+0x38>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xebe(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1050 <scanf@plt>
mov    $0x2,%r13d
xor    %ebx,%ebx
lea    0xea8(%rip),%r14
lea    0xea5(%rip),%r15
xor    %r12d,%r12d
jmp    1178 <main+0x48>
nopw   0x0(%rax,%rax,1)
mov    %ebx,%ebp
add    $0x1,%r13d
mov    %ebp,%ebx
mov    %r13d,%edi
call   1040 <is_prime@plt>
test   %rax,%rax
je     1170 <main+0x40>
lea    0x1(%rbx),%ebp
cmp    0x4(%rsp),%ebp
jl     1172 <main+0x42>
mov    (%rsp),%eax
cmp    %eax,%ebx
jge    1172 <main+0x42>
cmp    %eax,%ebp
je     11c2 <main+0x92>
add    $0x1,%r12d
imul   $0xcccccccd,%r12d,%eax
add    $0x19999998,%eax
ror    %eax
mov    %r14,%rdi
cmp    $0x19999999,%eax
jb     11b8 <main+0x88>
mov    %r15,%rdi
mov    %r13d,%esi
call   1030 <printf@plt>
jmp    1172 <main+0x42>
lea    0xe3a(%rip),%rdi
mov    %r13d,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [4 x i8] c"%d\0A\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 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
br label %6
6: ; preds = %0, %29
%7 = phi i32 [ %30, %29 ], [ 0, %0 ]
%8 = phi i32 [ %31, %29 ], [ 0, %0 ]
%9 = phi i32 [ %32, %29 ], [ 2, %0 ]
%10 = call i64 @is_prime(i32 %9)
%11 = icmp eq i64 %10, 0
br i1 %11, label %29, label %12
12: ; preds = %6
%13 = add nsw i32 %7, 1
%14 = load i32, i32* %1
%15 = icmp slt i32 %13, %14
br i1 %15, label %29, label %16
16: ; preds = %12
%17 = load i32, i32* %2
%18 = icmp slt i32 %7, %17
br i1 %18, label %19, label %29
19: ; preds = %16
%20 = add nsw i32 %8, 1
%21 = icmp eq i32 %13, %17
br i1 %21, label %22, label %24
22: ; preds = %19
%23 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %9)
ret i32 0
24: ; preds = %19
%25 = srem i32 %20, 10
%26 = icmp eq i32 %25, 0
%27 = select i1 %26, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0)
%28 = call i32 @printf(i8* %27, i32 %9)
br label %29
29: ; preds = %24, %6, %16, %12
%30 = phi i32 [ %13, %16 ], [ %13, %12 ], [ %7, %6 ], [ %13, %24 ]
%31 = phi i32 [ %8, %16 ], [ %8, %12 ], [ %8, %6 ], [ %20, %24 ]
%32 = add nuw nsw i32 %9, 1
br label %6
}