#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;
unsigned char fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
scalar_t__ isBitISet(unsigned char, int);
unsigned char setBit(unsigned char, int);
int givemethesizeTree(FILE *f) {
  int i;
  unsigned char ch, sizeTree = NULL, aux = NULL;
  fseek(f, 0, SEEK_SET);
  ch = fgetc(f);
  for (i = 0; i <= 4; i++) {
    if (isBitISet(ch, i) > 0) {
      aux = setBit(aux, i);
    }
  }
  ch = fgetc(f);
  for (i = 0; i <= 7; i++) {
    if (isBitISet(ch, i) > 0) {
      sizeTree = setBit(sizeTree, i);
    }
  }
  return sizeTree;
}


x86 assembly (clang, -O0):
<givemethesizeTree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movb   $0x0,-0xe(%rbp)
movb   $0x0,-0xf(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e81(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1050 <fseek@plt>
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %al,-0xd(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jg     11c1 <givemethesizeTree+0x81>
mov    -0xd(%rbp),%al
mov    -0xc(%rbp),%esi
movzbl %al,%edi
call   1040 <isBitISet@plt>
cmp    $0x0,%rax
jle    11ae <givemethesizeTree+0x6e>
mov    -0xf(%rbp),%al
mov    -0xc(%rbp),%esi
movzbl %al,%edi
call   1060 <setBit@plt>
mov    %al,-0xf(%rbp)
jmp    11b3 <givemethesizeTree+0x73>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    117b <givemethesizeTree+0x3b>
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %al,-0xd(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x7,-0xc(%rbp)
jg     121a <givemethesizeTree+0xda>
mov    -0xd(%rbp),%al
mov    -0xc(%rbp),%esi
movzbl %al,%edi
call   1040 <isBitISet@plt>
cmp    $0x0,%rax
jle    1207 <givemethesizeTree+0xc7>
mov    -0xe(%rbp),%al
mov    -0xc(%rbp),%esi
movzbl %al,%edi
call   1060 <setBit@plt>
mov    %al,-0xe(%rbp)
jmp    120c <givemethesizeTree+0xcc>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11d4 <givemethesizeTree+0x94>
movzbl -0xe(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<givemethesizeTree>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
mov    0x2e92(%rip),%rax
mov    (%rax),%edx
xor    %ebx,%ebx
xor    %esi,%esi
call   1050 <fseek@plt>
mov    %r14,%rdi
call   1030 <fgetc@plt>
movzbl %al,%ebp
mov    %ebp,%edi
xor    %esi,%esi
call   1040 <isBitISet@plt>
test   %rax,%rax
jle    117d <givemethesizeTree+0x3d>
xor    %edi,%edi
xor    %esi,%esi
call   1060 <setBit@plt>
mov    %eax,%ebx
mov    %ebp,%edi
mov    $0x1,%esi
call   1040 <isBitISet@plt>
test   %rax,%rax
jle    119d <givemethesizeTree+0x5d>
movzbl %bl,%edi
mov    $0x1,%esi
call   1060 <setBit@plt>
mov    %eax,%ebx
mov    %ebp,%edi
mov    $0x2,%esi
call   1040 <isBitISet@plt>
test   %rax,%rax
jle    11bd <givemethesizeTree+0x7d>
movzbl %bl,%edi
mov    $0x2,%esi
call   1060 <setBit@plt>
mov    %eax,%ebx
mov    %ebp,%edi
mov    $0x3,%esi
call   1040 <isBitISet@plt>
test   %rax,%rax
jle    11dd <givemethesizeTree+0x9d>
movzbl %bl,%edi
mov    $0x3,%esi
call   1060 <setBit@plt>
mov    %eax,%ebx
mov    %ebp,%edi
mov    $0x4,%esi
call   1040 <isBitISet@plt>
test   %rax,%rax
jle    11fb <givemethesizeTree+0xbb>
movzbl %bl,%edi
mov    $0x4,%esi
call   1060 <setBit@plt>
mov    %r14,%rdi
call   1030 <fgetc@plt>
movzbl %al,%ebx
xor    %ebp,%ebp
mov    %ebx,%edi
xor    %esi,%esi
call   1040 <isBitISet@plt>
test   %rax,%rax
jle    1221 <givemethesizeTree+0xe1>
xor    %edi,%edi
xor    %esi,%esi
call   1060 <setBit@plt>
mov    %eax,%ebp
mov    %ebx,%edi
mov    $0x1,%esi
call   1040 <isBitISet@plt>
test   %rax,%rax
jle    1242 <givemethesizeTree+0x102>
movzbl %bpl,%edi
mov    $0x1,%esi
call   1060 <setBit@plt>
mov    %eax,%ebp
mov    %ebx,%edi
mov    $0x2,%esi
call   1040 <isBitISet@plt>
test   %rax,%rax
jle    1263 <givemethesizeTree+0x123>
movzbl %bpl,%edi
mov    $0x2,%esi
call   1060 <setBit@plt>
mov    %eax,%ebp
mov    %ebx,%edi
mov    $0x3,%esi
call   1040 <isBitISet@plt>
test   %rax,%rax
jle    1284 <givemethesizeTree+0x144>
movzbl %bpl,%edi
mov    $0x3,%esi
call   1060 <setBit@plt>
mov    %eax,%ebp
mov    %ebx,%edi
mov    $0x4,%esi
call   1040 <isBitISet@plt>
test   %rax,%rax
jle    12a5 <givemethesizeTree+0x165>
movzbl %bpl,%edi
mov    $0x4,%esi
call   1060 <setBit@plt>
mov    %eax,%ebp
mov    %ebx,%edi
mov    $0x5,%esi
call   1040 <isBitISet@plt>
test   %rax,%rax
jle    12c6 <givemethesizeTree+0x186>
movzbl %bpl,%edi
mov    $0x5,%esi
call   1060 <setBit@plt>
mov    %eax,%ebp
mov    %ebx,%edi
mov    $0x6,%esi
call   1040 <isBitISet@plt>
test   %rax,%rax
jle    12e7 <givemethesizeTree+0x1a7>
movzbl %bpl,%edi
mov    $0x6,%esi
call   1060 <setBit@plt>
mov    %eax,%ebp
mov    %ebx,%edi
mov    $0x7,%esi
call   1040 <isBitISet@plt>
test   %rax,%rax
jle    1308 <givemethesizeTree+0x1c8>
movzbl %bpl,%edi
mov    $0x7,%esi
call   1060 <setBit@plt>
mov    %eax,%ebp
movzbl %bpl,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@SEEK_SET = global i32 0
define i32 @givemethesizeTree(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
store i32* %0, i32** %2
store i8 0, i8* %5
store i8 0, i8* %6
%7 = load i32*, i32** %2
%8 = load i32, i32* @SEEK_SET
%9 = call i32 @fseek(i32* %7, i32 0, i32 %8)
%10 = load i32*, i32** %2
%11 = call zeroext i8 @fgetc(i32* %10)
store i8 %11, i8* %4
store i32 0, i32* %3
br label %12
12: ; preds = %25, %1
%13 = load i32, i32* %3
%14 = icmp sle i32 %13, 4
br i1 %14, label %15, label %28
15: ; preds = %12
%16 = load i8, i8* %4
%17 = load i32, i32* %3
%18 = call i64 @isBitISet(i8 zeroext %16, i32 %17)
%19 = icmp sgt i64 %18, 0
br i1 %19, label %20, label %24
20: ; preds = %15
%21 = load i8, i8* %6
%22 = load i32, i32* %3
%23 = call zeroext i8 @setBit(i8 zeroext %21, i32 %22)
store i8 %23, i8* %6
br label %24
24: ; preds = %20, %15
br label %25
25: ; preds = %24
%26 = load i32, i32* %3
%27 = add nsw i32 %26, 1
store i32 %27, i32* %3
br label %12
28: ; preds = %12
%29 = load i32*, i32** %2
%30 = call zeroext i8 @fgetc(i32* %29)
store i8 %30, i8* %4
store i32 0, i32* %3
br label %31
31: ; preds = %44, %28
%32 = load i32, i32* %3
%33 = icmp sle i32 %32, 7
br i1 %33, label %34, label %47
34: ; preds = %31
%35 = load i8, i8* %4
%36 = load i32, i32* %3
%37 = call i64 @isBitISet(i8 zeroext %35, i32 %36)
%38 = icmp sgt i64 %37, 0
br i1 %38, label %39, label %43
39: ; preds = %34
%40 = load i8, i8* %5
%41 = load i32, i32* %3
%42 = call zeroext i8 @setBit(i8 zeroext %40, i32 %41)
store i8 %42, i8* %5
br label %43
43: ; preds = %39, %34
br label %44
44: ; preds = %43
%45 = load i32, i32* %3
%46 = add nsw i32 %45, 1
store i32 %46, i32* %3
br label %31
47: ; preds = %31
%48 = load i8, i8* %5
%49 = zext i8 %48 to i32
ret i32 %49
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
define i32 @givemethesizeTree(i32* nocapture %0) {
%2 = load i32, i32* @SEEK_SET
%3 = tail call i32 @fseek(i32* %0, i32 0, i32 %2)
%4 = tail call zeroext i8 @fgetc(i32* %0)
%5 = tail call i64 @isBitISet(i8 zeroext %4, i32 0)
%6 = icmp sgt i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = tail call zeroext i8 @setBit(i8 zeroext 0, i32 0)
br label %9
9: ; preds = %1, %7
%10 = phi i8 [ %8, %7 ], [ 0, %1 ]
%11 = tail call i64 @isBitISet(i8 zeroext %4, i32 1)
%12 = icmp sgt i64 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %9
%14 = tail call zeroext i8 @setBit(i8 zeroext %10, i32 1)
br label %15
15: ; preds = %13, %9
%16 = phi i8 [ %14, %13 ], [ %10, %9 ]
%17 = tail call i64 @isBitISet(i8 zeroext %4, i32 2)
%18 = icmp sgt i64 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %15
%20 = tail call zeroext i8 @setBit(i8 zeroext %16, i32 2)
br label %21
21: ; preds = %19, %15
%22 = phi i8 [ %20, %19 ], [ %16, %15 ]
%23 = tail call i64 @isBitISet(i8 zeroext %4, i32 3)
%24 = icmp sgt i64 %23, 0
br i1 %24, label %25, label %27
25: ; preds = %21
%26 = tail call zeroext i8 @setBit(i8 zeroext %22, i32 3)
br label %27
27: ; preds = %25, %21
%28 = phi i8 [ %26, %25 ], [ %22, %21 ]
%29 = tail call i64 @isBitISet(i8 zeroext %4, i32 4)
%30 = icmp sgt i64 %29, 0
br i1 %30, label %31, label %33
31: ; preds = %27
%32 = tail call zeroext i8 @setBit(i8 zeroext %28, i32 4)
br label %33
33: ; preds = %31, %27
%34 = tail call zeroext i8 @fgetc(i32* %0)
%35 = tail call i64 @isBitISet(i8 zeroext %34, i32 0)
%36 = icmp sgt i64 %35, 0
br i1 %36, label %37, label %39
37: ; preds = %33
%38 = tail call zeroext i8 @setBit(i8 zeroext 0, i32 0)
br label %39
39: ; preds = %33, %37
%40 = phi i8 [ %38, %37 ], [ 0, %33 ]
%41 = tail call i64 @isBitISet(i8 zeroext %34, i32 1)
%42 = icmp sgt i64 %41, 0
br i1 %42, label %43, label %45
43: ; preds = %39
%44 = tail call zeroext i8 @setBit(i8 zeroext %40, i32 1)
br label %45
45: ; preds = %43, %39
%46 = phi i8 [ %44, %43 ], [ %40, %39 ]
%47 = tail call i64 @isBitISet(i8 zeroext %34, i32 2)
%48 = icmp sgt i64 %47, 0
br i1 %48, label %49, label %51
49: ; preds = %45
%50 = tail call zeroext i8 @setBit(i8 zeroext %46, i32 2)
br label %51
51: ; preds = %49, %45
%52 = phi i8 [ %50, %49 ], [ %46, %45 ]
%53 = tail call i64 @isBitISet(i8 zeroext %34, i32 3)
%54 = icmp sgt i64 %53, 0
br i1 %54, label %55, label %57
55: ; preds = %51
%56 = tail call zeroext i8 @setBit(i8 zeroext %52, i32 3)
br label %57
57: ; preds = %55, %51
%58 = phi i8 [ %56, %55 ], [ %52, %51 ]
%59 = tail call i64 @isBitISet(i8 zeroext %34, i32 4)
%60 = icmp sgt i64 %59, 0
br i1 %60, label %61, label %63
61: ; preds = %57
%62 = tail call zeroext i8 @setBit(i8 zeroext %58, i32 4)
br label %63
63: ; preds = %61, %57
%64 = phi i8 [ %62, %61 ], [ %58, %57 ]
%65 = tail call i64 @isBitISet(i8 zeroext %34, i32 5)
%66 = icmp sgt i64 %65, 0
br i1 %66, label %67, label %69
67: ; preds = %63
%68 = tail call zeroext i8 @setBit(i8 zeroext %64, i32 5)
br label %69
69: ; preds = %67, %63
%70 = phi i8 [ %68, %67 ], [ %64, %63 ]
%71 = tail call i64 @isBitISet(i8 zeroext %34, i32 6)
%72 = icmp sgt i64 %71, 0
br i1 %72, label %73, label %75
73: ; preds = %69
%74 = tail call zeroext i8 @setBit(i8 zeroext %70, i32 6)
br label %75
75: ; preds = %73, %69
%76 = phi i8 [ %74, %73 ], [ %70, %69 ]
%77 = tail call i64 @isBitISet(i8 zeroext %34, i32 7)
%78 = icmp sgt i64 %77, 0
br i1 %78, label %79, label %81
79: ; preds = %75
%80 = tail call zeroext i8 @setBit(i8 zeroext %76, i32 7)
br label %81
81: ; preds = %79, %75
%82 = phi i8 [ %80, %79 ], [ %76, %75 ]
%83 = zext i8 %82 to i32
ret i32 %83
}