#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 */

/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ printByte(unsigned char);
int /*<<< orphan*/ printf(char *, unsigned char, unsigned char);
unsigned char *createHeader(int trashSize, int treeSize) {
  unsigned char *bytes = (unsigned char *)malloc(3 * sizeof(unsigned char));
  bytes[0] = trashSize << 5 | treeSize >> 8;
  bytes[1] = treeSize;
  bytes[2] = '\0';
  printf("%c%c", bytes[0], bytes[1]);
  printByte(bytes[0]);
  printByte(bytes[1]);
  return (bytes);
}


x86 assembly (clang, -O0):
<createHeader>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x3,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x5,%eax
mov    -0x8(%rbp),%ecx
sar    $0x8,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x10(%rbp),%rax
movb   $0x0,0x2(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
lea    0xe79(%rip),%rdi
movzbl %cl,%esi
movzbl 0x1(%rax),%edx
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
movzbl (%rax),%edi
call   1050 <printByte@plt>
mov    -0x10(%rbp),%rax
movzbl 0x1(%rax),%edi
call   1050 <printByte@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<createHeader>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %edi,%ebp
mov    $0x3,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
shl    $0x5,%ebp
mov    %r14d,%eax
shr    $0x8,%eax
or     %ebp,%eax
mov    %al,(%rbx)
mov    %r14b,0x1(%rbx)
movb   $0x0,0x2(%rbx)
movzbl %al,%esi
movzbl %r14b,%edx
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
movzbl (%rbx),%edi
call   1050 <printByte@plt>
movzbl 0x1(%rbx),%edi
call   1050 <printByte@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%c%c\00"
define i8* @createHeader(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = call i64 @malloc(i32 3)
%7 = inttoptr i64 %6 to i8*
store i8* %7, i8** %5
%8 = load i32, i32* %3
%9 = shl i32 %8, 5
%10 = load i32, i32* %4
%11 = ashr i32 %10, 8
%12 = or i32 %9, %11
%13 = trunc i32 %12 to i8
%14 = load i8*, i8** %5
%15 = getelementptr inbounds i8, i8* %14, i64 0
store i8 %13, i8* %15
%16 = load i32, i32* %4
%17 = trunc i32 %16 to i8
%18 = load i8*, i8** %5
%19 = getelementptr inbounds i8, i8* %18, i64 1
store i8 %17, i8* %19
%20 = load i8*, i8** %5
%21 = getelementptr inbounds i8, i8* %20, i64 2
store i8 0, i8* %21
%22 = load i8*, i8** %5
%23 = getelementptr inbounds i8, i8* %22, i64 0
%24 = load i8, i8* %23
%25 = load i8*, i8** %5
%26 = getelementptr inbounds i8, i8* %25, i64 1
%27 = load i8, i8* %26
%28 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 zeroext %24, i8 zeroext %27)
%29 = load i8*, i8** %5
%30 = getelementptr inbounds i8, i8* %29, i64 0
%31 = load i8, i8* %30
%32 = call i32 @printByte(i8 zeroext %31)
%33 = load i8*, i8** %5
%34 = getelementptr inbounds i8, i8* %33, i64 1
%35 = load i8, i8* %34
%36 = call i32 @printByte(i8 zeroext %35)
%37 = load i8*, i8** %5
ret i8* %37
}

LLVM IR (-O2):
@.str = [5 x i8] c"%c%c\00"
define i8* @createHeader(i32 %0, i32 %1) {
%3 = tail call i64 @malloc(i32 3)
%4 = inttoptr i64 %3 to i8*
%5 = shl i32 %0, 5
%6 = lshr i32 %1, 8
%7 = or i32 %6, %5
%8 = trunc i32 %7 to i8
store i8 %8, i8* %4
%9 = trunc i32 %1 to i8
%10 = getelementptr inbounds i8, i8* %4, i64 1
store i8 %9, i8* %10
%11 = getelementptr inbounds i8, i8* %4, i64 2
store i8 0, i8* %11
%12 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 zeroext %8, i8 zeroext %9)
%13 = load i8, i8* %4
%14 = tail call i32 @printByte(i8 zeroext %13)
%15 = load i8, i8* %10
%16 = tail call i32 @printByte(i8 zeroext %15)
ret i8* %4
}