#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__ EOF;
int /*<<< orphan*/ freopen(char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ prime(int, int);
int /*<<< orphan*/ printf(char *);
scalar_t__ scanf(char *, int *, int *);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
int main() {
  freopen("inB.txt", "r", stdin);
  freopen("outB.txt", "w", stdout);
  int m, n, r, t = 0;
  while (scanf("%d%d", &m, &n) != EOF) {
    if (t == 0)
      t = 1;
    else
      printf("\n");
    r = m - n;
    prime(m, n);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e92(%rip),%rax
mov    (%rax),%edx
lea    0xea1(%rip),%rdi
lea    0xea2(%rip),%rsi
call   1040 <freopen@plt>
mov    0x2e5e(%rip),%rax
mov    (%rax),%edx
lea    0xe8f(%rip),%rdi
lea    0xe91(%rip),%rsi
call   1040 <freopen@plt>
movl   $0x0,-0x14(%rbp)
lea    0xe80(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1050 <scanf@plt>
mov    0x2e37(%rip),%rcx
cmp    (%rcx),%rax
je     11ed <main+0xad>
cmpl   $0x0,-0x14(%rbp)
jne    11c8 <main+0x88>
movl   $0x1,-0x14(%rbp)
jmp    11d4 <main+0x94>
lea    0xe4b(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1060 <prime@plt>
jmp    118e <main+0x4e>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    0x2e99(%rip),%rax
mov    (%rax),%edx
lea    0xea8(%rip),%rdi
lea    0xea9(%rip),%rsi
call   1040 <freopen@plt>
mov    0x2e65(%rip),%rax
mov    (%rax),%edx
lea    0xe96(%rip),%rdi
lea    0xe98(%rip),%rsi
call   1040 <freopen@plt>
lea    0xe8e(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1050 <scanf@plt>
mov    0x2e45(%rip),%r12
cmp    (%r12),%rax
je     120a <main+0xca>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
call   1060 <prime@plt>
lea    0xe61(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1050 <scanf@plt>
cmp    (%r12),%rax
je     120a <main+0xca>
lea    0xe47(%rip),%r14
lea    0x4(%rsp),%r15
mov    %rsp,%rbx
cs nopw 0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
call   1060 <prime@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1050 <scanf@plt>
cmp    (%r12),%rax
jne    11e0 <main+0xa0>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [8 x i8] c"inB.txt\00"
@.str.1 = [2 x i8] c"r\00"
@stdin = global i32 0
@.str.2 = [9 x i8] c"outB.txt\00"
@.str.3 = [2 x i8] c"w\00"
@stdout = global i32 0
@.str.4 = [5 x i8] c"%d%d\00"
@EOF = global i64 0
@.str.5 = [2 x i8] c"\0A\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 = load i32, i32* @stdin
%7 = call i32 @freopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = load i32, i32* @stdout
%9 = call i32 @freopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i32 %8)
store i32 0, i32* %5
br label %10
10: ; preds = %20, %0
%11 = call i64 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32* %2, i32* %3)
%12 = load i64, i64* @EOF
%13 = icmp ne i64 %11, %12
br i1 %13, label %14, label %27
14: ; preds = %10
%15 = load i32, i32* %5
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %14
store i32 1, i32* %5
br label %20
18: ; preds = %14
%19 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
br label %20
20: ; preds = %18, %17
%21 = load i32, i32* %2
%22 = load i32, i32* %3
%23 = sub nsw i32 %21, %22
store i32 %23, i32* %4
%24 = load i32, i32* %2
%25 = load i32, i32* %3
%26 = call i32 @prime(i32 %24, i32 %25)
br label %10
27: ; preds = %10
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"inB.txt\00"
@.str.1 = [2 x i8] c"r\00"
@stdin = global i32 0
@.str.2 = [9 x i8] c"outB.txt\00"
@.str.3 = [2 x i8] c"w\00"
@stdout = global i32 0
@.str.4 = [5 x i8] c"%d%d\00"
@EOF = global i64 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* @stdin
%4 = tail call i32 @freopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @stdout
%6 = tail call i32 @freopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i32 %5)
%7 = bitcast i32* %1 to i8*
%8 = bitcast i32* %2 to i8*
%9 = call i64 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32* %1, i32* %2)
%10 = load i64, i64* @EOF
%11 = icmp eq i64 %9, %10
br i1 %11, label %27, label %12
12: ; preds = %0
%13 = load i32, i32* %1
%14 = load i32, i32* %2
%15 = call i32 @prime(i32 %13, i32 %14)
%16 = call i64 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32* %1, i32* %2)
%17 = load i64, i64* @EOF
%18 = icmp eq i64 %16, %17
br i1 %18, label %27, label %19
19: ; preds = %12, %19
%20 = call i32 @putchar(i32 10)
%21 = load i32, i32* %1
%22 = load i32, i32* %2
%23 = call i32 @prime(i32 %21, i32 %22)
%24 = call i64 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32* %1, i32* %2)
%25 = load i64, i64* @EOF
%26 = icmp eq i64 %24, %25
br i1 %26, label %27, label %19
27: ; preds = %19, %12, %0
ret i32 0
}