#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*/ F_OK;
scalar_t__ access(char *, int /*<<< orphan*/);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/);
int /*<<< orphan*/ freopen(char *, char *, int /*<<< orphan*/);
char *labs(long);
int /*<<< orphan*/ printf(char *, char *);
int scanf(char *, long *, long *);
int /*<<< orphan*/ stdin;
int main(int argc, char **argv) {
  long hashmat, opponent;
  if (argc != 2) {
    printf("Usage: %s INPUT_FILE\n\n", argv[0]);
    exit(-1);
  }
  if (access(argv[1], F_OK)) {
    printf("Error: INPUT_FILE %s does not exist\n\n", argv[1]);
    exit(-1);
  }
  freopen(argv[1], "r", stdin);
  while (scanf("%ld %ld", &hashmat, &opponent) == 2) {
    printf("%ld\n", labs(hashmat - opponent));
  }
  fclose(stdin);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     11ad <main+0x3d>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe62(%rip),%rdi
call   1050 <printf@plt>
mov    $0xffffffff,%edi
call   1090 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    0x2e14(%rip),%rax
mov    (%rax),%esi
call   1080 <access@plt>
cmp    $0x0,%rax
je     11eb <main+0x7b>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xe3b(%rip),%rdi
call   1050 <printf@plt>
mov    $0xffffffff,%edi
call   1090 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    0x2dee(%rip),%rax
mov    (%rax),%edx
lea    0xe3a(%rip),%rsi
call   1060 <freopen@plt>
lea    0xe30(%rip),%rdi
lea    -0x18(%rbp),%rsi
lea    -0x20(%rbp),%rdx
call   1070 <scanf@plt>
cmp    $0x2,%eax
jne    1246 <main+0xd6>
mov    -0x18(%rbp),%rdi
sub    -0x20(%rbp),%rdi
call   1030 <labs@plt>
mov    %rax,%rsi
lea    0xe0b(%rip),%rdi
call   1050 <printf@plt>
jmp    1208 <main+0x98>
mov    0x2d9b(%rip),%rax
mov    (%rax),%edi
call   1040 <fclose@plt>
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
mov    %rsi,%rbx
cmp    $0x2,%edi
jne    1245 <main+0xd5>
mov    0x8(%rbx),%rdi
mov    0x2e3c(%rip),%rax
mov    (%rax),%esi
call   1080 <access@plt>
mov    0x8(%rbx),%rcx
test   %rax,%rax
jne    1251 <main+0xe1>
mov    0x2e39(%rip),%r13
mov    0x0(%r13),%edx
lea    0xe83(%rip),%rsi
mov    %rcx,%rdi
call   1060 <freopen@plt>
lea    0xe76(%rip),%rdi
lea    0x8(%rsp),%rsi
mov    %rsp,%rdx
call   1070 <scanf@plt>
cmp    $0x2,%eax
jne    122c <main+0xbc>
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)
mov    0x8(%rsp),%rdi
sub    (%rsp),%rdi
call   1030 <labs@plt>
mov    %r14,%rdi
mov    %rax,%rsi
call   1050 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
call   1070 <scanf@plt>
cmp    $0x2,%eax
je     1200 <main+0x90>
mov    0x0(%r13),%edi
call   1040 <fclose@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret
mov    (%rbx),%rsi
lea    0xdb1(%rip),%rdi
jmp    125b <main+0xeb>
lea    0xdbf(%rip),%rdi
mov    %rcx,%rsi
call   1050 <printf@plt>
mov    $0xffffffff,%edi
call   1090 <exit@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"Usage: %s INPUT_FILE\0A\0A\00"
@F_OK = global i32 0
@.str.1 = [38 x i8] c"Error: INPUT_FILE %s does not exist\0A\0A\00"
@.str.2 = [2 x i8] c"r\00"
@stdin = global i32 0
@.str.3 = [8 x i8] c"%ld %ld\00"
@.str.4 = [5 x i8] c"%ld\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
%7 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 2
br i1 %9, label %10, label %16
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 0
%13 = load i8*, i8** %12
%14 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %13)
%15 = call i32 @exit(i32 -1)
unreachable
16: ; preds = %2
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 1
%19 = load i8*, i8** %18
%20 = load i32, i32* @F_OK
%21 = call i64 @access(i8* %19, i32 %20)
%22 = icmp ne i64 %21, 0
br i1 %22, label %23, label %29
23: ; preds = %16
%24 = load i8**, i8*** %5
%25 = getelementptr inbounds i8*, i8** %24, i64 1
%26 = load i8*, i8** %25
%27 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i8* %26)
%28 = call i32 @exit(i32 -1)
unreachable
29: ; preds = %16
%30 = load i8**, i8*** %5
%31 = getelementptr inbounds i8*, i8** %30, i64 1
%32 = load i8*, i8** %31
%33 = load i32, i32* @stdin
%34 = call i32 @freopen(i8* %32, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i32 %33)
br label %35
35: ; preds = %38, %29
%36 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i64* %6, i64* %7)
%37 = icmp eq i32 %36, 2
br i1 %37, label %38, label %44
38: ; preds = %35
%39 = load i64, i64* %6
%40 = load i64, i64* %7
%41 = sub nsw i64 %39, %40
%42 = call i8* @labs(i64 %41)
%43 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8* %42)
br label %35
44: ; preds = %35
%45 = load i32, i32* @stdin
%46 = call i32 @fclose(i32 %45)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"Usage: %s INPUT_FILE\0A\0A\00"
@F_OK = global i32 0
@.str.1 = [38 x i8] c"Error: INPUT_FILE %s does not exist\0A\0A\00"
@.str.2 = [2 x i8] c"r\00"
@stdin = global i32 0
@.str.3 = [8 x i8] c"%ld %ld\00"
@.str.4 = [5 x i8] c"%ld\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i64
%4 = alloca i64
%5 = bitcast i64* %3 to i8*
%6 = bitcast i64* %4 to i8*
%7 = icmp eq i32 %0, 2
br i1 %7, label %12, label %8
8: ; preds = %2
%9 = load i8*, i8** %1
%10 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = tail call i32 @exit(i32 -1)
unreachable
12: ; preds = %2
%13 = getelementptr inbounds i8*, i8** %1, i64 1
%14 = load i8*, i8** %13
%15 = load i32, i32* @F_OK
%16 = tail call i64 @access(i8* %14, i32 %15)
%17 = icmp eq i64 %16, 0
%18 = load i8*, i8** %13
br i1 %17, label %22, label %19
19: ; preds = %12
%20 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i8* %18)
%21 = tail call i32 @exit(i32 -1)
unreachable
22: ; preds = %12
%23 = load i32, i32* @stdin
%24 = tail call i32 @freopen(i8* %18, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i32 %23)
%25 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i64* %3, i64* %4)
%26 = icmp eq i32 %25, 2
br i1 %26, label %27, label %35
27: ; preds = %22, %27
%28 = load i64, i64* %3
%29 = load i64, i64* %4
%30 = sub nsw i64 %28, %29
%31 = call i8* @labs(i64 %30)
%32 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8* %31)
%33 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i64* %3, i64* %4)
%34 = icmp eq i32 %33, 2
br i1 %34, label %27, label %35
35: ; preds = %27, %22
%36 = load i32, i32* @stdin
%37 = call i32 @fclose(i32 %36)
ret i32 0
}