#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 *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int difference, i, n = 0, number = 0;
  int sum_odd_positions = 0, sum_even_positions = 0;
  scanf("%d", &n);
  for (i = 1; i <= n; i++) {
    scanf("%d", &number);
    if (i % 2) {
      sum_odd_positions += number;
    } else {
      sum_even_positions += number;
    }
  }
  difference = sum_even_positions - sum_odd_positions;
  if (difference < 10 && difference > -10) {
    printf("The two sums are close");
  } else {
    printf("The two sums are far");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
lea    0xeae(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     11bc <main+0x9c>
lea    0xe8b(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     11a0 <main+0x80>
mov    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    11a9 <main+0x89>
mov    -0x14(%rbp),%eax
add    -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
jmp    11ae <main+0x8e>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1162 <main+0x42>
mov    -0x1c(%rbp),%eax
sub    -0x18(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    11ea <main+0xca>
cmpl   $0xfffffff6,-0x8(%rbp)
jle    11ea <main+0xca>
lea    0xe23(%rip),%rdi
call   1030 <printf@plt>
jmp    11f6 <main+0xd6>
lea    0xe29(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
movl   $0x0,(%rsp)
movl   $0x0,0x4(%rsp)
lea    0xebf(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
cmpl   $0x0,(%rsp)
jle    11bc <main+0x9c>
xor    %r15d,%r15d
lea    0xea7(%rip),%r14
lea    0x4(%rsp),%r12
xor    %ebp,%ebp
xor    %r13d,%r13d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%ebp
mov    %r14,%rdi
mov    %r12,%rsi
call   1040 <scanf@plt>
mov    %ebp,%eax
and    $0x1,%eax
mov    %eax,%ecx
neg    %ecx
mov    0x4(%rsp),%edx
and    %edx,%ecx
add    %ecx,%ebx
test   %eax,%eax
cmovne %r15d,%edx
add    %edx,%r13d
cmp    (%rsp),%ebp
jl     1170 <main+0x50>
sub    %ebx,%r13d
add    $0x9,%r13d
cmp    $0x13,%r13d
lea    0xe54(%rip),%rax
lea    0xe64(%rip),%rdi
cmovb  %rax,%rdi
jmp    11c3 <main+0xa3>
lea    0xe40(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [23 x i8] c"The two sums are close\00"
@.str.2 = [21 x i8] c"The two sums are far\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = icmp slt i32 %6, 1
br i1 %7, label %28, label %8
8: ; preds = %0, %8
%9 = phi i32 [ %19, %8 ], [ 0, %0 ]
%10 = phi i32 [ %17, %8 ], [ 0, %0 ]
%11 = phi i32 [ %20, %8 ], [ 1, %0 ]
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%13 = and i32 %11, 1
%14 = icmp eq i32 %13, 0
%15 = load i32, i32* %2
%16 = select i1 %14, i32 0, i32 %15
%17 = add nsw i32 %16, %10
%18 = select i1 %14, i32 %15, i32 0
%19 = add nsw i32 %18, %9
%20 = add nuw nsw i32 %11, 1
%21 = load i32, i32* %1
%22 = icmp slt i32 %11, %21
br i1 %22, label %8, label %23
23: ; preds = %8
%24 = sub i32 9, %17
%25 = add i32 %24, %19
%26 = icmp ult i32 %25, 19
%27 = select i1 %26, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0)
br label %28
28: ; preds = %23, %0
%29 = phi i8* [ getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), %0 ], [ %27, %23 ]
%30 = call i32 @printf(i8* dereferenceable(1) %29)
ret i32 0
}