#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 unsigned char uint8_t;
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
void *sip_tobin(void *dst, uint64_t u64) {
  (((unsigned char *)dst) + 0)[0] = (uint8_t)(((uint32_t)((u64) >> 0)) >> 0);
  (((unsigned char *)dst) + 0)[1] = (uint8_t)(((uint32_t)((u64) >> 0)) >> 8);
  (((unsigned char *)dst) + 0)[2] = (uint8_t)(((uint32_t)((u64) >> 0)) >> 16);
  (((unsigned char *)dst) + 0)[3] = (uint8_t)(((uint32_t)((u64) >> 0)) >> 24);
  ;
  (((unsigned char *)dst) + 4)[0] = (uint8_t)(((uint32_t)((u64) >> 32)) >> 0);
  (((unsigned char *)dst) + 4)[1] = (uint8_t)(((uint32_t)((u64) >> 32)) >> 8);
  (((unsigned char *)dst) + 4)[2] = (uint8_t)(((uint32_t)((u64) >> 32)) >> 16);
  (((unsigned char *)dst) + 4)[3] = (uint8_t)(((uint32_t)((u64) >> 32)) >> 24);
  ;
  ;
  return dst;
}


x86 assembly (clang, -O0):
<sip_tobin>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x0,%eax
sar    $0x0,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
sar    $0x0,%eax
sar    $0x8,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0xc(%rbp),%eax
sar    $0x0,%eax
sar    $0x10,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0xc(%rbp),%eax
sar    $0x0,%eax
sar    $0x18,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0xc(%rbp),%eax
mov    $0x20,%ecx
sar    %cl,%eax
sar    $0x0,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x4(%rax)
mov    -0xc(%rbp),%eax
mov    $0x20,%ecx
sar    %cl,%eax
sar    $0x8,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x5(%rax)
mov    -0xc(%rbp),%eax
mov    $0x20,%ecx
sar    %cl,%eax
sar    $0x10,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x6(%rax)
mov    -0xc(%rbp),%eax
mov    $0x20,%ecx
sar    %cl,%eax
sar    $0x18,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x7(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sip_tobin>:
mov    %rdi,%rax
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define i8* @sip_tobin(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = ashr i32 %5, 0
%7 = ashr i32 %6, 0
%8 = trunc i32 %7 to i8
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 0
%11 = getelementptr inbounds i8, i8* %10, i64 0
store i8 %8, i8* %11
%12 = load i32, i32* %4
%13 = ashr i32 %12, 0
%14 = ashr i32 %13, 8
%15 = trunc i32 %14 to i8
%16 = load i8*, i8** %3
%17 = getelementptr inbounds i8, i8* %16, i64 0
%18 = getelementptr inbounds i8, i8* %17, i64 1
store i8 %15, i8* %18
%19 = load i32, i32* %4
%20 = ashr i32 %19, 0
%21 = ashr i32 %20, 16
%22 = trunc i32 %21 to i8
%23 = load i8*, i8** %3
%24 = getelementptr inbounds i8, i8* %23, i64 0
%25 = getelementptr inbounds i8, i8* %24, i64 2
store i8 %22, i8* %25
%26 = load i32, i32* %4
%27 = ashr i32 %26, 0
%28 = ashr i32 %27, 24
%29 = trunc i32 %28 to i8
%30 = load i8*, i8** %3
%31 = getelementptr inbounds i8, i8* %30, i64 0
%32 = getelementptr inbounds i8, i8* %31, i64 3
store i8 %29, i8* %32
%33 = load i32, i32* %4
%34 = ashr i32 %33, 32
%35 = ashr i32 %34, 0
%36 = trunc i32 %35 to i8
%37 = load i8*, i8** %3
%38 = getelementptr inbounds i8, i8* %37, i64 4
%39 = getelementptr inbounds i8, i8* %38, i64 0
store i8 %36, i8* %39
%40 = load i32, i32* %4
%41 = ashr i32 %40, 32
%42 = ashr i32 %41, 8
%43 = trunc i32 %42 to i8
%44 = load i8*, i8** %3
%45 = getelementptr inbounds i8, i8* %44, i64 4
%46 = getelementptr inbounds i8, i8* %45, i64 1
store i8 %43, i8* %46
%47 = load i32, i32* %4
%48 = ashr i32 %47, 32
%49 = ashr i32 %48, 16
%50 = trunc i32 %49 to i8
%51 = load i8*, i8** %3
%52 = getelementptr inbounds i8, i8* %51, i64 4
%53 = getelementptr inbounds i8, i8* %52, i64 2
store i8 %50, i8* %53
%54 = load i32, i32* %4
%55 = ashr i32 %54, 32
%56 = ashr i32 %55, 24
%57 = trunc i32 %56 to i8
%58 = load i8*, i8** %3
%59 = getelementptr inbounds i8, i8* %58, i64 4
%60 = getelementptr inbounds i8, i8* %59, i64 3
store i8 %57, i8* %60
%61 = load i8*, i8** %3
ret i8* %61
}

LLVM IR (-O2):
define i8* @sip_tobin(i8* returned writeonly %0, i32 %1) {
%3 = trunc i32 %1 to i8
store i8 %3, i8* %0
%4 = lshr i32 %1, 8
%5 = trunc i32 %4 to i8
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %6
%7 = lshr i32 %1, 16
%8 = trunc i32 %7 to i8
%9 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %8, i8* %9
%10 = lshr i32 %1, 24
%11 = trunc i32 %10 to i8
%12 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %11, i8* %12
ret i8* %0
}