#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, int);
int /*<<< orphan*/ stdin;
int strtol(char *, int /*<<< orphan*/ *, int);
int main(int ac, char *av[]) {
  int n, p;
  char buf[1024];
  p = -1;
  while (fgets(buf, 1024, stdin)) {
    n = strtol(buf, NULL, 10);
    if (p != -1 && n - 2 == 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)
movl   $0xffffffff,-0x18(%rbp)
lea    -0x420(%rbp),%rdi
mov    0x2e8a(%rip),%rax
mov    (%rax),%edx
mov    $0x400,%esi
call   1040 <fgets@plt>
cmp    $0x0,%rax
je     11c2 <main+0x92>
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     11b7 <main+0x87>
mov    -0x14(%rbp),%eax
sub    $0x2,%eax
cmp    -0x18(%rbp),%eax
jne    11b7 <main+0x87>
mov    -0x18(%rbp),%esi
mov    -0x14(%rbp),%edx
lea    0xe4e(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    1150 <main+0x20>
xor    %eax,%eax
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x400,%rsp
mov    0x2ea2(%rip),%r12
mov    (%r12),%edx
mov    %rsp,%rdi
mov    $0x400,%esi
call   1040 <fgets@plt>
test   %rax,%rax
je     11b5 <main+0x85>
mov    $0xffffffff,%ebx
mov    %rsp,%r15
lea    0xe95(%rip),%r14
jmp    1186 <main+0x56>
nopl   (%rax)
mov    (%r12),%edx
mov    %r15,%rdi
mov    $0x400,%esi
call   1040 <fgets@plt>
test   %rax,%rax
je     11b5 <main+0x85>
mov    %ebx,%ebp
mov    %r15,%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1050 <strtol@plt>
mov    %eax,%ebx
cmp    $0xffffffff,%ebp
je     1170 <main+0x40>
mov    %ebx,%eax
add    $0xfffffffe,%eax
cmp    %ebp,%eax
jne    1170 <main+0x40>
mov    %r14,%rdi
mov    %ebp,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
jmp    1170 <main+0x40>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stdin = global i32 0
@.str = [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 [1024 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 -1, i32* %7
br label %9
9: ; preds = %28, %2
%10 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%11 = load i32, i32* @stdin
%12 = call i64 @fgets(i8* %10, i32 1024, i32 %11)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %30
14: ; preds = %9
%15 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%16 = call i32 @strtol(i8* %15, i32* null, i32 10)
store i32 %16, i32* %6
%17 = load i32, i32* %7
%18 = icmp ne i32 %17, -1
br i1 %18, label %19, label %28
19: ; preds = %14
%20 = load i32, i32* %6
%21 = sub nsw i32 %20, 2
%22 = load i32, i32* %7
%23 = icmp eq i32 %21, %22
br i1 %23, label %24, label %28
24: ; preds = %19
%25 = load i32, i32* %7
%26 = load i32, i32* %6
%27 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %25, i32 %26)
br label %28
28: ; preds = %24, %19, %14
%29 = load i32, i32* %6
store i32 %29, i32* %7
br label %9
30: ; preds = %9
ret i32 0
}

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