#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*/ *EOF;
int /*<<< orphan*/ SEEK_CUR;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
int getw(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  FILE *ptr;
  int a[100], i, even[100];
  ptr = fopen("Divyansh.txt", "r");
  for (i = 0; i < 25 && ptr != EOF; i++) {
    a[i] = getw(ptr);
    printf("%d ", a[i]);
    fseek(ptr, 0, SEEK_CUR);
  }
  fclose(ptr);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x350,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe97(%rip),%rdi
lea    0xe9d(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x1a4(%rbp)
xor    %eax,%eax
cmpl   $0x19,-0x1a4(%rbp)
mov    %al,-0x341(%rbp)
jge    11af <main+0x5f>
mov    -0x10(%rbp),%rax
mov    0x2e3d(%rip),%rcx
cmp    (%rcx),%rax
setne  %al
mov    %al,-0x341(%rbp)
mov    -0x341(%rbp),%al
test   $0x1,%al
jne    11c2 <main+0x72>
jmp    121d <main+0xcd>
mov    -0x10(%rbp),%rdi
call   1060 <getw@plt>
mov    %eax,%ecx
movslq -0x1a4(%rbp),%rax
mov    %ecx,-0x1a0(%rbp,%rax,4)
movslq -0x1a4(%rbp),%rax
mov    -0x1a0(%rbp,%rax,4),%esi
lea    0xe1f(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    0x2de8(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1050 <fseek@plt>
mov    -0x1a4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1a4(%rbp)
jmp    1183 <main+0x33>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x350,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
lea    0xea1(%rip),%rdi
lea    0xea7(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,%rbx
mov    0x2e6b(%rip),%r15
cmp    (%r15),%rax
je     11bd <main+0x6d>
xor    %ebp,%ebp
lea    0xe8c(%rip),%r14
mov    0x2e5e(%rip),%r12
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1060 <getw@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    (%r12),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1050 <fseek@plt>
cmp    $0x17,%ebp
ja     11bd <main+0x6d>
add    $0x1,%ebp
cmp    (%r15),%rbx
jne    1190 <main+0x40>
mov    %rbx,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Divyansh.txt\00"
@.str.1 = [2 x i8] c"r\00"
@EOF = global i32* null
@.str.2 = [4 x i8] c"%d \00"
@SEEK_CUR = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca [100 x i32]
%4 = alloca i32
%5 = alloca [100 x i32]
store i32 0, i32* %1
%6 = call i32* @fopen(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))
store i32* %6, i32** %2
store i32 0, i32* %4
br label %7
7: ; preds = %30, %0
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 25
br i1 %9, label %10, label %14
10: ; preds = %7
%11 = load i32*, i32** %2
%12 = load i32*, i32** @EOF
%13 = icmp ne i32* %11, %12
br label %14
14: ; preds = %10, %7
%15 = phi i1 [ false, %7 ], [ %13, %10 ]
br i1 %15, label %16, label %33
16: ; preds = %14
%17 = load i32*, i32** %2
%18 = call i32 @getw(i32* %17)
%19 = load i32, i32* %4
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 %20
store i32 %18, i32* %21
%22 = load i32, i32* %4
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 %23
%25 = load i32, i32* %24
%26 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %25)
%27 = load i32*, i32** %2
%28 = load i32, i32* @SEEK_CUR
%29 = call i32 @fseek(i32* %27, i32 0, i32 %28)
br label %30
30: ; preds = %16
%31 = load i32, i32* %4
%32 = add nsw i32 %31, 1
store i32 %32, i32* %4
br label %7
33: ; preds = %14
%34 = load i32*, i32** %2
%35 = call i32 @fclose(i32* %34)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"Divyansh.txt\00"
@.str.1 = [2 x i8] c"r\00"
@EOF = global i32* null
@.str.2 = [4 x i8] c"%d \00"
@SEEK_CUR = global i32 0
define i32 @main() {
%1 = tail call i32* @fopen(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))
%2 = load i32*, i32** @EOF
%3 = icmp eq i32* %1, %2
br i1 %3, label %15, label %4
4: ; preds = %0, %4
%5 = phi i32 [ %10, %4 ], [ 0, %0 ]
%6 = tail call i32 @getw(i32* %1)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %6)
%8 = load i32, i32* @SEEK_CUR
%9 = tail call i32 @fseek(i32* %1, i32 0, i32 %8)
%10 = add nuw nsw i32 %5, 1
%11 = icmp ult i32 %5, 24
%12 = load i32*, i32** @EOF
%13 = icmp ne i32* %1, %12
%14 = select i1 %11, i1 %13, i1 false
br i1 %14, label %4, label %15
15: ; preds = %4, %0
%16 = tail call i32 @fclose(i32* %1)
ret i32 0
}