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

/* Variables and functions */
int /*<<< orphan*/ memset(unsigned char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ setBits(unsigned char *, int, int, unsigned char *);
void setTreeAddress(unsigned char *adrs, const unsigned long long int bits) {
  unsigned char address[8];
  memset(address, 0, sizeof(address));
  address[7] = (unsigned char)(bits & 0xFF);
  address[6] = (unsigned char)((bits >> 8) & 0xFF);
  address[5] = (unsigned char)((bits >> 16) & 0xFF);
  address[4] = (unsigned char)((bits >> 24) & 0xFF);
  address[3] = (unsigned char)((bits >> 32) & 0xFF);
  address[2] = (unsigned char)((bits >> 40) & 0xFF);
  address[1] = (unsigned char)((bits >> 48) & 0xFF);
  address[0] = (unsigned char)((bits >> 56) & 0xFF);
  setBits(adrs, 33, 64, address);
}


x86 assembly (clang, -O0):
<setTreeAddress>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
and    $0xff,%rax
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
shr    $0x8,%rax
and    $0xff,%rax
mov    %al,-0x12(%rbp)
mov    -0x10(%rbp),%rax
shr    $0x10,%rax
and    $0xff,%rax
mov    %al,-0x13(%rbp)
mov    -0x10(%rbp),%rax
shr    $0x18,%rax
and    $0xff,%rax
mov    %al,-0x14(%rbp)
mov    -0x10(%rbp),%rax
shr    $0x20,%rax
and    $0xff,%rax
mov    %al,-0x15(%rbp)
mov    -0x10(%rbp),%rax
shr    $0x28,%rax
and    $0xff,%rax
mov    %al,-0x16(%rbp)
mov    -0x10(%rbp),%rax
shr    $0x30,%rax
and    $0xff,%rax
mov    %al,-0x17(%rbp)
mov    -0x10(%rbp),%rax
shr    $0x38,%rax
and    $0xff,%rax
mov    %al,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x18(%rbp),%rcx
mov    $0x21,%esi
mov    $0x40,%edx
call   1040 <setBits@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setTreeAddress>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0x8(%rsp),%r15
mov    %r15,%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1030 <memset@plt>
bswap  %rbx
mov    %rbx,0x8(%rsp)
mov    %r14,%rdi
mov    $0x21,%esi
mov    $0x40,%edx
mov    %r15,%rcx
call   1040 <setBits@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @setTreeAddress(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca [8 x i8]
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = getelementptr inbounds [8 x i8], [8 x i8]* %5, i64 0, i64 0
%7 = call i32 @memset(i8* %6, i32 0, i32 8)
%8 = load i64, i64* %4
%9 = and i64 %8, 255
%10 = trunc i64 %9 to i8
%11 = getelementptr inbounds [8 x i8], [8 x i8]* %5, i64 0, i64 7
store i8 %10, i8* %11
%12 = load i64, i64* %4
%13 = lshr i64 %12, 8
%14 = and i64 %13, 255
%15 = trunc i64 %14 to i8
%16 = getelementptr inbounds [8 x i8], [8 x i8]* %5, i64 0, i64 6
store i8 %15, i8* %16
%17 = load i64, i64* %4
%18 = lshr i64 %17, 16
%19 = and i64 %18, 255
%20 = trunc i64 %19 to i8
%21 = getelementptr inbounds [8 x i8], [8 x i8]* %5, i64 0, i64 5
store i8 %20, i8* %21
%22 = load i64, i64* %4
%23 = lshr i64 %22, 24
%24 = and i64 %23, 255
%25 = trunc i64 %24 to i8
%26 = getelementptr inbounds [8 x i8], [8 x i8]* %5, i64 0, i64 4
store i8 %25, i8* %26
%27 = load i64, i64* %4
%28 = lshr i64 %27, 32
%29 = and i64 %28, 255
%30 = trunc i64 %29 to i8
%31 = getelementptr inbounds [8 x i8], [8 x i8]* %5, i64 0, i64 3
store i8 %30, i8* %31
%32 = load i64, i64* %4
%33 = lshr i64 %32, 40
%34 = and i64 %33, 255
%35 = trunc i64 %34 to i8
%36 = getelementptr inbounds [8 x i8], [8 x i8]* %5, i64 0, i64 2
store i8 %35, i8* %36
%37 = load i64, i64* %4
%38 = lshr i64 %37, 48
%39 = and i64 %38, 255
%40 = trunc i64 %39 to i8
%41 = getelementptr inbounds [8 x i8], [8 x i8]* %5, i64 0, i64 1
store i8 %40, i8* %41
%42 = load i64, i64* %4
%43 = lshr i64 %42, 56
%44 = and i64 %43, 255
%45 = trunc i64 %44 to i8
%46 = getelementptr inbounds [8 x i8], [8 x i8]* %5, i64 0, i64 0
store i8 %45, i8* %46
%47 = load i8*, i8** %3
%48 = getelementptr inbounds [8 x i8], [8 x i8]* %5, i64 0, i64 0
%49 = call i32 @setBits(i8* %47, i32 33, i32 64, i8* %48)
ret void
}

LLVM IR (-O2):
define void @setTreeAddress(i8* %0, i64 %1) {
%3 = alloca [8 x i8]
%4 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 0
%5 = call i32 @memset(i8* %4, i32 0, i32 8)
%6 = trunc i64 %1 to i8
%7 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 7
store i8 %6, i8* %7
%8 = lshr i64 %1, 8
%9 = trunc i64 %8 to i8
%10 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 6
store i8 %9, i8* %10
%11 = lshr i64 %1, 16
%12 = trunc i64 %11 to i8
%13 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 5
store i8 %12, i8* %13
%14 = lshr i64 %1, 24
%15 = trunc i64 %14 to i8
%16 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 4
store i8 %15, i8* %16
%17 = lshr i64 %1, 32
%18 = trunc i64 %17 to i8
%19 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 3
store i8 %18, i8* %19
%20 = lshr i64 %1, 40
%21 = trunc i64 %20 to i8
%22 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 2
store i8 %21, i8* %22
%23 = lshr i64 %1, 48
%24 = trunc i64 %23 to i8
%25 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 1
store i8 %24, i8* %25
%26 = lshr i64 %1, 56
%27 = trunc i64 %26 to i8
store i8 %27, i8* %4
%28 = call i32 @setBits(i8* %0, i32 33, i32 64, i8* %4)
ret void
}