#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*/ getchar();
int /*<<< orphan*/ labs(unsigned long);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
scalar_t__ scanf(char *, unsigned long *, unsigned long *);
int /*<<< orphan*/ stdin;
int main() {
  unsigned long int a, b;
  a = b = 0;
  freopen("./sample.txt", "r", stdin);
  while (scanf("%ld %ld", &a, &b) != EOF) {
    getchar();
    printf("%ld\n", labs(a - b));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x10(%rbp)
mov    0x2e72(%rip),%rax
mov    (%rax),%edx
lea    0xe81(%rip),%rdi
lea    0xe87(%rip),%rsi
call   1050 <freopen@plt>
lea    0xe7d(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1070 <scanf@plt>
mov    0x2e3a(%rip),%rcx
cmp    (%rcx),%rax
je     11d6 <main+0x86>
mov    $0x0,%al
call   1060 <getchar@plt>
mov    -0x10(%rbp),%rdi
sub    -0x18(%rbp),%rdi
call   1030 <labs@plt>
mov    %eax,%esi
lea    0xe4b(%rip),%rdi
call   1040 <printf@plt>
jmp    118b <main+0x3b>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
movq   $0x0,(%rsp)
movq   $0x0,0x8(%rsp)
mov    0x2e73(%rip),%rax
mov    (%rax),%edx
lea    0xe82(%rip),%rdi
lea    0xe88(%rip),%rsi
call   1050 <freopen@plt>
lea    0xe7e(%rip),%rdi
lea    0x8(%rsp),%rsi
mov    %rsp,%rdx
call   1070 <scanf@plt>
mov    0x2e3b(%rip),%r13
cmp    0x0(%r13),%rax
je     1203 <main+0xb3>
lea    0xe65(%rip),%r14
lea    0xe56(%rip),%r15
lea    0x8(%rsp),%r12
mov    %rsp,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1060 <getchar@plt>
mov    0x8(%rsp),%rdi
sub    (%rsp),%rdi
call   1030 <labs@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
call   1070 <scanf@plt>
cmp    0x0(%r13),%rax
jne    11d0 <main+0x80>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [13 x i8] c"./sample.txt\00"
@.str.1 = [2 x i8] c"r\00"
@stdin = global i32 0
@.str.2 = [8 x i8] c"%ld %ld\00"
@EOF = global i64 0
@.str.3 = [5 x i8] c"%ld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
store i32 0, i32* %1
store i64 0, i64* %3
store i64 0, i64* %2
%4 = load i32, i32* @stdin
%5 = call i32 @freopen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %4)
br label %6
6: ; preds = %10, %0
%7 = call i64 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i64* %2, i64* %3)
%8 = load i64, i64* @EOF
%9 = icmp ne i64 %7, %8
br i1 %9, label %10, label %17
10: ; preds = %6
%11 = call i32 (...) @getchar()
%12 = load i64, i64* %2
%13 = load i64, i64* %3
%14 = sub i64 %12, %13
%15 = call i32 @labs(i64 %14)
%16 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 %15)
br label %6
17: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"./sample.txt\00"
@.str.1 = [2 x i8] c"r\00"
@stdin = global i32 0
@.str.2 = [8 x i8] c"%ld %ld\00"
@EOF = global i64 0
@.str.3 = [5 x i8] c"%ld\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = alloca i64
%3 = bitcast i64* %1 to i8*
%4 = bitcast i64* %2 to i8*
store i64 0, i64* %2
store i64 0, i64* %1
%5 = load i32, i32* @stdin
%6 = tail call i32 @freopen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = call i64 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i64* %1, i64* %2)
%8 = load i64, i64* @EOF
%9 = icmp eq i64 %7, %8
br i1 %9, label %20, label %10
10: ; preds = %0, %10
%11 = call i32 (...) @getchar()
%12 = load i64, i64* %1
%13 = load i64, i64* %2
%14 = sub i64 %12, %13
%15 = call i32 @labs(i64 %14)
%16 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 %15)
%17 = call i64 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i64* %1, i64* %2)
%18 = load i64, i64* @EOF
%19 = icmp eq i64 %17, %18
br i1 %19, label %20, label %10
20: ; preds = %10, %0
ret i32 0
}