#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__ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stdin;
int strtol(char *, int /*<<< orphan*/ *, int);
int main(int ac, char *av[]) {
  int n, p, d;
  char buf[1024];
  if (ac < 2) {
    printf("usage : brotherprime d\n");
    return (1);
  }
  d = strtol(av[1], NULL, 10);
  p = -1;
  while (fgets(buf, 1024, stdin)) {
    n = strtol(buf, NULL, 10);
    if (p != -1 && n - d == p)
      printf("%d %d\n", p, n);
    p = n;
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    116d <main+0x3d>
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1208 <main+0xd8>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1050 <strtol@plt>
mov    %eax,-0x1c(%rbp)
movl   $0xffffffff,-0x18(%rbp)
lea    -0x420(%rbp),%rdi
mov    0x2e4d(%rip),%rax
mov    (%rax),%edx
mov    $0x400,%esi
call   1040 <fgets@plt>
cmp    $0x0,%rax
je     1201 <main+0xd1>
lea    -0x420(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1050 <strtol@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x18(%rbp)
je     11f6 <main+0xc6>
mov    -0x14(%rbp),%eax
sub    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jne    11f6 <main+0xc6>
mov    -0x18(%rbp),%esi
mov    -0x14(%rbp),%edx
lea    0xe29(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    118d <main+0x5d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x408,%rsp
cmp    $0x1,%edi
jg     116c <main+0x2c>
lea    0xeaa(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%ebx
jmp    11f9 <main+0xb9>
mov    0x8(%rsi),%rdi
xor    %ebx,%ebx
xor    %esi,%esi
mov    $0xa,%edx
call   1060 <strtol@plt>
mov    %eax,%r15d
mov    0x2e60(%rip),%r13
mov    0x0(%r13),%edx
mov    %rsp,%rdi
mov    $0x400,%esi
call   1050 <fgets@plt>
test   %rax,%rax
je     11f9 <main+0xb9>
mov    $0xffffffff,%ebx
mov    %rsp,%r12
lea    0xe53(%rip),%r14
jmp    11c6 <main+0x86>
nop
mov    0x0(%r13),%edx
mov    %r12,%rdi
mov    $0x400,%esi
call   1050 <fgets@plt>
test   %rax,%rax
je     11f7 <main+0xb7>
mov    %ebx,%ebp
mov    %r12,%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1060 <strtol@plt>
mov    %eax,%ebx
cmp    $0xffffffff,%ebp
je     11b0 <main+0x70>
mov    %ebx,%eax
sub    %r15d,%eax
cmp    %ebp,%eax
jne    11b0 <main+0x70>
mov    %r14,%rdi
mov    %ebp,%esi
mov    %ebx,%edx
xor    %eax,%eax
call   1040 <printf@plt>
jmp    11b0 <main+0x70>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x408,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [24 x i8] c"usage : brotherprime d\0A\00"
@stdin = global i32 0
@.str.1 = [7 x i8] c"%d %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 [1024 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = load i32, i32* %4
%11 = icmp slt i32 %10, 2
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %42
14: ; preds = %2
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 1
%17 = load i8*, i8** %16
%18 = call i32 @strtol(i8* %17, i32* null, i32 10)
store i32 %18, i32* %8
store i32 -1, i32* %7
br label %19
19: ; preds = %39, %14
%20 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%21 = load i32, i32* @stdin
%22 = call i64 @fgets(i8* %20, i32 1024, i32 %21)
%23 = icmp ne i64 %22, 0
br i1 %23, label %24, label %41
24: ; preds = %19
%25 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%26 = call i32 @strtol(i8* %25, i32* null, i32 10)
store i32 %26, i32* %6
%27 = load i32, i32* %7
%28 = icmp ne i32 %27, -1
br i1 %28, label %29, label %39
29: ; preds = %24
%30 = load i32, i32* %6
%31 = load i32, i32* %8
%32 = sub nsw i32 %30, %31
%33 = load i32, i32* %7
%34 = icmp eq i32 %32, %33
br i1 %34, label %35, label %39
35: ; preds = %29
%36 = load i32, i32* %7
%37 = load i32, i32* %6
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %36, i32 %37)
br label %39
39: ; preds = %35, %29, %24
%40 = load i32, i32* %6
store i32 %40, i32* %7
br label %19
41: ; preds = %19
store i32 0, i32* %3
br label %42
42: ; preds = %41, %12
%43 = load i32, i32* %3
ret i32 %43
}

LLVM IR (-O2):
@stdin = global i32 0
@.str.1 = [7 x i8] c"%d %d\0A\00"
@str = [23 x i8] c"usage : brotherprime d\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [1024 x i8]
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = icmp slt i32 %0, 2
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
br label %28
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i32 @strtol(i8* nocapture %10, i32* null, i32 10)
%12 = load i32, i32* @stdin
%13 = call i64 @fgets(i8* %4, i32 1024, i32 %12)
%14 = icmp eq i64 %13, 0
br i1 %14, label %28, label %15
15: ; preds = %8, %24
%16 = phi i32 [ %17, %24 ], [ -1, %8 ]
%17 = call i32 @strtol(i8* nocapture %4, i32* null, i32 10)
%18 = icmp ne i32 %16, -1
%19 = sub nsw i32 %17, %11
%20 = icmp eq i32 %19, %16
%21 = select i1 %18, i1 %20, i1 false
br i1 %21, label %22, label %24
22: ; preds = %15
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %16, i32 %17)
br label %24
24: ; preds = %22, %15
%25 = load i32, i32* @stdin
%26 = call i64 @fgets(i8* %4, i32 1024, i32 %25)
%27 = icmp eq i64 %26, 0
br i1 %27, label %28, label %15
28: ; preds = %24, %8, %6
%29 = phi i32 [ 1, %6 ], [ 0, %8 ], [ 0, %24 ]
ret i32 %29
}