#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*/ printf(char *, long long);
int /*<<< orphan*/ scanf(char *, long long *);
int main() {
  long long dist(long long, long long);
  long long n;
  long long a[10000], b[10000];
  long long i, j;
  scanf("%Ld", &n);
  for (i = 0; i < n; i++) {
    scanf("%Ld", &a[i]);
    scanf("%Ld", &b[i]);
  }
  for (i = 0; i < n; i++) {
    printf("%Ld\n", dist(a[i], b[i]));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x27120,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeb7(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <scanf@plt>
movq   $0x0,-0x27118(%rbp)
mov    -0x27118(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    11c7 <main+0x97>
mov    -0x27118(%rbp),%rax
lea    -0x13890(%rbp),%rsi
shl    $0x3,%rax
add    %rax,%rsi
lea    0xe76(%rip),%rdi
call   1050 <scanf@plt>
mov    -0x27118(%rbp),%rax
lea    -0x27110(%rbp),%rsi
shl    $0x3,%rax
add    %rax,%rsi
lea    0xe55(%rip),%rdi
call   1050 <scanf@plt>
mov    -0x27118(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x27118(%rbp)
jmp    115d <main+0x2d>
movq   $0x0,-0x27118(%rbp)
mov    -0x27118(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    122c <main+0xfc>
mov    -0x27118(%rbp),%rax
mov    -0x13890(%rbp,%rax,8),%rdi
ff
mov    -0x27118(%rbp),%rax
mov    -0x27110(%rbp,%rax,8),%rsi
call   1040 <dist@plt>
mov    %rax,%rsi
lea    0xdf4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x27118(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x27118(%rbp)
jmp    11d2 <main+0xa2>
xor    %eax,%eax
add    $0x27120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x27118,%rsp
lea    0xebb(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1050 <scanf@plt>
cmpq   $0x0,0x8(%rsp)
jle    11e8 <main+0xb8>
lea    0x10(%rsp),%r14
lea    0x13890(%rsp),%r12
xor    %ebx,%ebx
lea    0xe8f(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    %r12,%rsi
call   1050 <scanf@plt>
mov    %r15,%rdi
mov    %r14,%rsi
call   1050 <scanf@plt>
add    $0x1,%rbx
mov    0x8(%rsp),%rax
add    $0x8,%r14
add    $0x8,%r12
cmp    %rax,%rbx
jl     1180 <main+0x50>
test   %rax,%rax
jle    11e8 <main+0xb8>
xor    %ebx,%ebx
lea    0xe4a(%rip),%r14
nopw   0x0(%rax,%rax,1)
mov    0x13890(%rsp,%rbx,8),%rdi
mov    0x10(%rsp,%rbx,8),%rsi
call   1040 <dist@plt>
mov    %r14,%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    0x8(%rsp),%rbx
jl     11c0 <main+0x90>
xor    %eax,%eax
add    $0x27118,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%Ld\00"
@.str.1 = [5 x i8] c"%Ld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca [10000 x i64]
%4 = alloca [10000 x i64]
%5 = alloca i64
%6 = alloca i64
store i32 0, i32* %1
%7 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64* %2)
store i64 0, i64* %5
br label %8
8: ; preds = %19, %0
%9 = load i64, i64* %5
%10 = load i64, i64* %2
%11 = icmp slt i64 %9, %10
br i1 %11, label %12, label %22
12: ; preds = %8
%13 = load i64, i64* %5
%14 = getelementptr inbounds [10000 x i64], [10000 x i64]* %3, i64 0, i64 %13
%15 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64* %14)
%16 = load i64, i64* %5
%17 = getelementptr inbounds [10000 x i64], [10000 x i64]* %4, i64 0, i64 %16
%18 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64* %17)
br label %19
19: ; preds = %12
%20 = load i64, i64* %5
%21 = add nsw i64 %20, 1
store i64 %21, i64* %5
br label %8
22: ; preds = %8
store i64 0, i64* %5
br label %23
23: ; preds = %36, %22
%24 = load i64, i64* %5
%25 = load i64, i64* %2
%26 = icmp slt i64 %24, %25
br i1 %26, label %27, label %39
27: ; preds = %23
%28 = load i64, i64* %5
%29 = getelementptr inbounds [10000 x i64], [10000 x i64]* %3, i64 0, i64 %28
%30 = load i64, i64* %29
%31 = load i64, i64* %5
%32 = getelementptr inbounds [10000 x i64], [10000 x i64]* %4, i64 0, i64 %31
%33 = load i64, i64* %32
%34 = call i64 @dist(i64 %30, i64 %33)
%35 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 %34)
br label %36
36: ; preds = %27
%37 = load i64, i64* %5
%38 = add nsw i64 %37, 1
store i64 %38, i64* %5
br label %23
39: ; preds = %23
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%Ld\00"
@.str.1 = [5 x i8] c"%Ld\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = alloca [10000 x i64]
%3 = alloca [10000 x i64]
%4 = bitcast i64* %1 to i8*
%5 = bitcast [10000 x i64]* %2 to i8*
%6 = bitcast [10000 x i64]* %3 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64* %1)
%8 = load i64, i64* %1
%9 = icmp sgt i64 %8, 0
br i1 %9, label %12, label %32
10: ; preds = %12
%11 = icmp sgt i64 %19, 0
br i1 %11, label %21, label %32
12: ; preds = %0, %12
%13 = phi i64 [ %18, %12 ], [ 0, %0 ]
%14 = getelementptr inbounds [10000 x i64], [10000 x i64]* %2, i64 0, i64 %13
%15 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64* %14)
%16 = getelementptr inbounds [10000 x i64], [10000 x i64]* %3, i64 0, i64 %13
%17 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64* %16)
%18 = add nuw nsw i64 %13, 1
%19 = load i64, i64* %1
%20 = icmp slt i64 %18, %19
br i1 %20, label %12, label %10
21: ; preds = %10, %21
%22 = phi i64 [ %29, %21 ], [ 0, %10 ]
%23 = getelementptr inbounds [10000 x i64], [10000 x i64]* %2, i64 0, i64 %22
%24 = load i64, i64* %23
%25 = getelementptr inbounds [10000 x i64], [10000 x i64]* %3, i64 0, i64 %22
%26 = load i64, i64* %25
%27 = call i64 @dist(i64 %24, i64 %26)
%28 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 %27)
%29 = add nuw nsw i64 %22, 1
%30 = load i64, i64* %1
%31 = icmp slt i64 %29, %30
br i1 %31, label %21, label %32
32: ; preds = %21, %0, %10
ret i32 0
}