#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() {
  int n, m, i, j, count, t;
  printf("Input m: ");
  scanf("%d", &m);
  printf("Input n: ");
  scanf("%d", &n);
  count = 0;
  for (i = m; i <= n; i++) {
    t = i;
    for (j = 2; j <= t / 2; j++)
      if (t % j == 0)
        break;
    if (j > t / 2 && i != 1) {
      printf("%4d", t);
      count++;
      if (count % 6 == 0)
        printf("\n");
    }
  }
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec6(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea8(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x0,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1253 <main+0x133>
mov    -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
movl   $0x2,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x20(%rbp),%eax
cmp    %ecx,%eax
jg     11d7 <main+0xb7>
mov    -0x1c(%rbp),%eax
cltd
idivl  -0x14(%rbp)
cmp    $0x0,%edx
jne    11c4 <main+0xa4>
jmp    11d7 <main+0xb7>
jmp    11c9 <main+0xa9>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1191 <main+0x71>
mov    -0x14(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x1c(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x24(%rbp),%eax
cmp    %ecx,%eax
jle    1240 <main+0x120>
cmpl   $0x1,-0x10(%rbp)
je     1240 <main+0x120>
mov    -0x1c(%rbp),%esi
lea    0xe0e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    $0x6,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    123b <main+0x11b>
lea    0xde7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1240 <main+0x120>
jmp    1245 <main+0x125>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1178 <main+0x58>
lea    0xdc1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xebd(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xeac(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    0xc(%rsp),%ebx
cmp    0x8(%rsp),%ebx
jle    1194 <main+0x64>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret
lea    0xe7c(%rip),%r14
xor    %ebp,%ebp
jmp    11ab <main+0x7b>
nop
lea    0x1(%rbx),%eax
cmp    0x8(%rsp),%ebx
mov    %eax,%ebx
jge    117f <main+0x4f>
mov    $0x1,%al
cmp    $0x4,%ebx
jl     11e5 <main+0xb5>
mov    %ebx,%ecx
shr    $0x1f,%ecx
add    %ebx,%ecx
sar    %ecx
cmp    $0x3,%ecx
mov    $0x2,%esi
cmovge %ecx,%esi
mov    $0x1,%edi
nopl   0x0(%rax,%rax,1)
add    $0x1,%edi
mov    %ebx,%eax
cltd
idiv   %edi
test   %edx,%edx
je     11a0 <main+0x70>
cmp    %edi,%esi
jne    11d0 <main+0xa0>
cmp    %ecx,%edi
setge  %al
cmp    $0x1,%ebx
je     11a0 <main+0x70>
test   %al,%al
je     11a0 <main+0x70>
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%ebp
imul   $0xaaaaaaab,%ebp,%eax
add    $0x2aaaaaaa,%eax
ror    %eax
cmp    $0x2aaaaaaa,%eax
ja     11a0 <main+0x70>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    11a0 <main+0x70>

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

LLVM IR (-O2):
@.str = [10 x i8] c"Input m: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [10 x i8] c"Input n: \00"
@.str.3 = [4 x i8] c"%4d\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 ([10 x i8], [10 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* %2)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 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* %1)
%9 = load i32, i32* %2
%10 = load i32, i32* %1
%11 = icmp sgt i32 %9, %10
br i1 %11, label %44, label %12
12: ; preds = %0, %39
%13 = phi i32 [ %41, %39 ], [ %9, %0 ]
%14 = phi i32 [ %40, %39 ], [ 0, %0 ]
%15 = sdiv i32 %13, 2
%16 = icmp slt i32 %13, 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 %13, %23
%25 = icmp eq i32 %24, 0
br i1 %25, label %39, 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 %13, 1
%31 = and i1 %30, %29
br i1 %31, label %32, label %39
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 %13)
%34 = add nsw i32 %14, 1
%35 = srem i32 %34, 6
%36 = icmp eq i32 %35, 0
br i1 %36, label %37, label %39
37: ; preds = %32
%38 = call i32 @putchar(i32 10)
br label %39
39: ; preds = %22, %28, %37, %32
%40 = phi i32 [ %34, %37 ], [ %34, %32 ], [ %14, %28 ], [ %14, %22 ]
%41 = add nsw i32 %13, 1
%42 = load i32, i32* %1
%43 = icmp slt i32 %13, %42
br i1 %43, label %12, label %44
44: ; preds = %39, %0
%45 = call i32 @putchar(i32 10)
ret i32 0
}