#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 */
unsigned char *createHeader(unsigned int, unsigned int);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, unsigned char *,
                          unsigned char *);
int /*<<< orphan*/ printByte(unsigned char);
int /*<<< orphan*/ printf(char *, unsigned char *);
int /*<<< orphan*/ scanf(char *, unsigned int *, unsigned int *);
int main() {
  unsigned int trashSize, treeSize;
  scanf("%d %d", &trashSize, &treeSize);
  unsigned char trashByte, treeByte;
  trashByte = trashSize << 5 | treeSize >> 8;
  treeByte = treeSize;
  unsigned char *header = createHeader(trashSize, treeSize);
  printf("%s\n", header);
  FILE *pFile = fopen("headOut", "rb");
  fscanf(pFile, "%c%c", &trashByte, &treeByte);
  printByte(trashByte);
  printByte(treeByte);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe8a(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1060 <scanf@plt>
mov    -0x8(%rbp),%eax
shl    $0x5,%eax
mov    -0xc(%rbp),%ecx
shr    $0x8,%ecx
or     %ecx,%eax
mov    %al,-0xd(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,-0xe(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1080 <createHeader@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xe52(%rip),%rdi
call   1030 <printf@plt>
lea    0xe4a(%rip),%rdi
lea    0xe4b(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xe3a(%rip),%rsi
lea    -0xd(%rbp),%rdx
lea    -0xe(%rbp),%rcx
call   1040 <fscanf@plt>
movzbl -0xd(%rbp),%edi
call   1050 <printByte@plt>
movzbl -0xe(%rbp),%edi
call   1050 <printByte@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xe95(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
call   1060 <scanf@plt>
mov    0x14(%rsp),%edi
mov    %edi,%eax
shl    $0x5,%eax
mov    0x10(%rsp),%esi
mov    %esi,%ecx
shr    $0x8,%ecx
or     %eax,%ecx
mov    %cl,0xf(%rsp)
mov    %sil,0xe(%rsp)
call   1080 <createHeader@plt>
lea    0xe63(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
lea    0xe58(%rip),%rdi
lea    0xe59(%rip),%rsi
call   1070 <fopen@plt>
lea    0xe50(%rip),%rsi
lea    0xf(%rsp),%rdx
lea    0xe(%rsp),%rcx
mov    %rax,%rdi
call   1040 <fscanf@plt>
movzbl 0xf(%rsp),%edi
call   1050 <printByte@plt>
movzbl 0xe(%rsp),%edi
call   1050 <printByte@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [8 x i8] c"headOut\00"
@.str.3 = [3 x i8] c"rb\00"
@.str.4 = [5 x i8] c"%c%c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8*
%7 = alloca i32*
store i32 0, i32* %1
%8 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%9 = load i32, i32* %2
%10 = shl i32 %9, 5
%11 = load i32, i32* %3
%12 = lshr i32 %11, 8
%13 = or i32 %10, %12
%14 = trunc i32 %13 to i8
store i8 %14, i8* %4
%15 = load i32, i32* %3
%16 = trunc i32 %15 to i8
store i8 %16, i8* %5
%17 = load i32, i32* %2
%18 = load i32, i32* %3
%19 = call i8* @createHeader(i32 %17, i32 %18)
store i8* %19, i8** %6
%20 = load i8*, i8** %6
%21 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %20)
%22 = call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
store i32* %22, i32** %7
%23 = load i32*, i32** %7
%24 = call i32 @fscanf(i32* %23, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8* %4, i8* %5)
%25 = load i8, i8* %4
%26 = call i32 @printByte(i8 zeroext %25)
%27 = load i8, i8* %5
%28 = call i32 @printByte(i8 zeroext %27)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [8 x i8] c"headOut\00"
@.str.3 = [3 x i8] c"rb\00"
@.str.4 = [5 x i8] c"%c%c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
%4 = alloca i8
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%8 = load i32, i32* %1
%9 = shl i32 %8, 5
%10 = load i32, i32* %2
%11 = lshr i32 %10, 8
%12 = or i32 %11, %9
%13 = trunc i32 %12 to i8
store i8 %13, i8* %3
%14 = trunc i32 %10 to i8
store i8 %14, i8* %4
%15 = call i8* @createHeader(i32 %8, i32 %10)
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %15)
%17 = call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%18 = call i32 @fscanf(i32* %17, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8* %3, i8* %4)
%19 = load i8, i8* %3
%20 = call i32 @printByte(i8 zeroext %19)
%21 = load i8, i8* %4
%22 = call i32 @printByte(i8 zeroext %21)
ret i32 0
}