#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*/ SEEK_END;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, long, int /*<<< orphan*/);
long ftell(int /*<<< orphan*/ *);
int /*<<< orphan*/ getProperties(int /*<<< orphan*/ *, long);
int main() {
  FILE *fp = NULL;
  long bufsize = 0L;
  fp = fopen("./Blocks.art", "r");
  fseek(fp, 0L, SEEK_END);
  bufsize = ftell(fp);
  fseek(fp, 0L, SEEK_SET);
  getProperties(fp, bufsize);
  fclose(fp);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
lea    0xe8a(%rip),%rdi
lea    0xe90(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2e57(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
call   1060 <fseek@plt>
mov    -0x10(%rbp),%rdi
call   1050 <ftell@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2e24(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
call   1060 <fseek@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <getProperties@plt>
mov    -0x10(%rbp),%rdi
call   1040 <fclose@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xea5(%rip),%rdi
lea    0xeab(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,%rbx
mov    0x2e77(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1060 <fseek@plt>
mov    %rbx,%rdi
call   1050 <ftell@plt>
mov    %rax,%r14
mov    0x2e49(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1060 <fseek@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <getProperties@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [13 x i8] c"./Blocks.art\00"
@.str.1 = [2 x i8] c"r\00"
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i64
store i32 0, i32* %1
store i32* null, i32** %2
store i64 0, i64* %3
%4 = 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* %4, i32** %2
%5 = load i32*, i32** %2
%6 = load i32, i32* @SEEK_END
%7 = call i32 @fseek(i32* %5, i64 0, i32 %6)
%8 = load i32*, i32** %2
%9 = call i64 @ftell(i32* %8)
store i64 %9, i64* %3
%10 = load i32*, i32** %2
%11 = load i32, i32* @SEEK_SET
%12 = call i32 @fseek(i32* %10, i64 0, i32 %11)
%13 = load i32*, i32** %2
%14 = load i64, i64* %3
%15 = call i32 @getProperties(i32* %13, i64 %14)
%16 = load i32*, i32** %2
%17 = call i32 @fclose(i32* %16)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"./Blocks.art\00"
@.str.1 = [2 x i8] c"r\00"
@SEEK_END = global i32 0
@SEEK_SET = 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* @SEEK_END
%3 = tail call i32 @fseek(i32* %1, i64 0, i32 %2)
%4 = tail call i64 @ftell(i32* %1)
%5 = load i32, i32* @SEEK_SET
%6 = tail call i32 @fseek(i32* %1, i64 0, i32 %5)
%7 = tail call i32 @getProperties(i32* %1, i64 %4)
%8 = tail call i32 @fclose(i32* %1)
ret i32 0
}