#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, int *);
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  FILE *ifp = fopen("absolute.in", "r");
  int n;
  fscanf(ifp, "%d", &n);
  int i;
  for (i = 0; i < n; i++) {
    int v;
    fscanf(ifp, "%d", &v);
    if (v < 0)
      printf("Integer #%d: %d\n", i + 1, v);
    else
      printf("Integer #%d: %d\n", i + 1, -v);
  }
  fclose(ifp);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
lea    0xeaf(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe9d(%rip),%rsi
lea    -0x14(%rbp),%rdx
call   1050 <fscanf@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11ef <main+0xaf>
mov    -0x10(%rbp),%rdi
lea    0xe76(%rip),%rsi
lea    -0x1c(%rbp),%rdx
call   1050 <fscanf@plt>
cmpl   $0x0,-0x1c(%rbp)
jge    11c5 <main+0x85>
mov    -0x18(%rbp),%esi
add    $0x1,%esi
mov    -0x1c(%rbp),%edx
lea    0xe56(%rip),%rdi
call   1040 <printf@plt>
jmp    11dc <main+0x9c>
mov    -0x18(%rbp),%esi
add    $0x1,%esi
xor    %edx,%edx
sub    -0x1c(%rbp),%edx
lea    0xe3a(%rip),%rdi
call   1040 <printf@plt>
jmp    11e1 <main+0xa1>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1181 <main+0x41>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xead(%rip),%rdi
lea    0xeb2(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,%rbx
lea    0xea5(%rip),%rsi
lea    0x8(%rsp),%rdx
mov    %rax,%rdi
call   1050 <fscanf@plt>
cmpl   $0x0,0x8(%rsp)
jle    11cc <main+0x8c>
xor    %ebp,%ebp
lea    0xe88(%rip),%r14
lea    0xc(%rsp),%r15
lea    0xe7f(%rip),%r12
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1050 <fscanf@plt>
mov    0xc(%rsp),%eax
add    $0x1,%ebp
mov    %eax,%edx
neg    %edx
cmovns %eax,%edx
mov    %r12,%rdi
mov    %ebp,%esi
call   1040 <printf@plt>
cmp    0x8(%rsp),%ebp
jl     11a0 <main+0x60>
mov    %rbx,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [12 x i8] c"absolute.in\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [17 x i8] c"Integer #%d: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = tail call i32* @fopen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%4 = bitcast i32* %1 to i8*
%5 = call i32 @fscanf(i32* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %20
8: ; preds = %0
%9 = bitcast i32* %2 to i8*
br label %10
10: ; preds = %8, %10
%11 = phi i32 [ 0, %8 ], [ %14, %10 ]
%12 = call i32 @fscanf(i32* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%13 = load i32, i32* %2
%14 = add nuw nsw i32 %11, 1
%15 = call i32 @llvm.abs.i32(i32 %13, i1 false)
%16 = sub i32 0, %15
%17 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i32 %14, i32 %16)
%18 = load i32, i32* %1
%19 = icmp slt i32 %14, %18
br i1 %19, label %10, label %20
20: ; preds = %10, %0
%21 = call i32 @fclose(i32* %3)
ret i32 0
}