#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*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
void *getc(int /*<<< orphan*/ *);
unsigned int get_tree_size(FILE *input_file) {
  unsigned int tree_size;
  unsigned char first_byte;
  unsigned int second_byte;
  fseek(input_file, (0), SEEK_SET);
  first_byte = getc(input_file);
  second_byte = getc(input_file);
  first_byte = (first_byte << 3);
  first_byte = (first_byte >> 3);
  tree_size = ((first_byte << 8) | second_byte);
  return (tree_size);
}


x86 assembly (clang, -O0):
<get_tree_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea9(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1030 <fseek@plt>
mov    -0x8(%rbp),%rdi
call   1040 <getc@plt>
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <getc@plt>
mov    %eax,-0x14(%rbp)
movzbl -0xd(%rbp),%eax
shl    $0x3,%eax
mov    %al,-0xd(%rbp)
movzbl -0xd(%rbp),%eax
sar    $0x3,%eax
mov    %al,-0xd(%rbp)
movzbl -0xd(%rbp),%eax
shl    $0x8,%eax
or     -0x14(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_tree_size>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    0x2eb2(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1030 <fseek@plt>
mov    %r14,%rdi
call   1040 <getc@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1040 <getc@plt>
and    $0x1f,%ebx
shl    $0x8,%ebx
or     %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@SEEK_SET = global i32 0
define i32 @get_tree_size(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i8
%5 = alloca i32
store i32* %0, i32** %2
%6 = load i32*, i32** %2
%7 = load i32, i32* @SEEK_SET
%8 = call i32 @fseek(i32* %6, i32 0, i32 %7)
%9 = load i32*, i32** %2
%10 = call i8* @getc(i32* %9)
%11 = ptrtoint i8* %10 to i8
store i8 %11, i8* %4
%12 = load i32*, i32** %2
%13 = call i8* @getc(i32* %12)
%14 = ptrtoint i8* %13 to i32
store i32 %14, i32* %5
%15 = load i8, i8* %4
%16 = zext i8 %15 to i32
%17 = shl i32 %16, 3
%18 = trunc i32 %17 to i8
store i8 %18, i8* %4
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = ashr i32 %20, 3
%22 = trunc i32 %21 to i8
store i8 %22, i8* %4
%23 = load i8, i8* %4
%24 = zext i8 %23 to i32
%25 = shl i32 %24, 8
%26 = load i32, i32* %5
%27 = or i32 %25, %26
store i32 %27, i32* %3
%28 = load i32, i32* %3
ret i32 %28
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
define i32 @get_tree_size(i32* nocapture %0) {
%2 = load i32, i32* @SEEK_SET
%3 = tail call i32 @fseek(i32* %0, i32 0, i32 %2)
%4 = tail call i8* @getc(i32* %0)
%5 = ptrtoint i8* %4 to i64
%6 = trunc i64 %5 to i32
%7 = tail call i8* @getc(i32* %0)
%8 = ptrtoint i8* %7 to i64
%9 = trunc i64 %8 to i32
%10 = shl i32 %6, 8
%11 = and i32 %10, 7936
%12 = or i32 %11, %9
ret i32 %12
}