#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_SET;
int /*<<< orphan*/ V_readnode(int /*<<< orphan*/ *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void V_fbxtest() {
  FILE *fp = fopen("../bin/cube.fbx", "r");
  if (!fp) {
    printf("couldn't open cube.fbx\n");
    return;
  }
  fseek(fp, 26, SEEK_SET);
  V_readnode(fp);
  fclose(fp);
}


x86 assembly (clang, -O0):
<V_fbxtest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xea1(%rip),%rdi
lea    0xeaa(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    118b <V_fbxtest+0x3b>
lea    0xe91(%rip),%rdi
call   1040 <printf@plt>
jmp    11b4 <V_fbxtest+0x64>
mov    -0x8(%rbp),%rdi
mov    0x2e4a(%rip),%rax
mov    (%rax),%edx
mov    $0x1a,%esi
call   1050 <fseek@plt>
mov    -0x8(%rbp),%rdi
call   1060 <V_readnode@plt>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<V_fbxtest>:
push   %rbx
lea    0xea8(%rip),%rdi
lea    0xeb1(%rip),%rsi
call   1070 <fopen@plt>
test   %rax,%rax
je     1193 <V_fbxtest+0x43>
mov    %rax,%rbx
mov    0x2e6d(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    $0x1a,%esi
call   1050 <fseek@plt>
mov    %rbx,%rdi
call   1060 <V_readnode@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <fclose@plt>
lea    0xe78(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"../bin/cube.fbx\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [24 x i8] c"couldn't open cube.fbx\0A\00"
@SEEK_SET = global i32 0
define void @V_fbxtest() {
%1 = alloca i32*
%2 = call i32* @fopen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = icmp ne i32* %3, null
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
br label %15
7: ; preds = %0
%8 = load i32*, i32** %1
%9 = load i32, i32* @SEEK_SET
%10 = call i32 @fseek(i32* %8, i32 26, i32 %9)
%11 = load i32*, i32** %1
%12 = call i32 @V_readnode(i32* %11)
%13 = load i32*, i32** %1
%14 = call i32 @fclose(i32* %13)
br label %15
15: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"../bin/cube.fbx\00"
@.str.1 = [2 x i8] c"r\00"
@SEEK_SET = global i32 0
@str = [23 x i8] c"couldn't open cube.fbx\00"
define void @V_fbxtest() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i32* %1, null
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
br label %10
5: ; preds = %0
%6 = load i32, i32* @SEEK_SET
%7 = tail call i32 @fseek(i32* %1, i32 26, i32 %6)
%8 = tail call i32 @V_readnode(i32* %1)
%9 = tail call i32 @fclose(i32* %1)
br label %10
10: ; preds = %5, %3
ret void
}