#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 */
void dectobin(unsigned long int dec, bool bin[64]) {
  int i;
  for (i = 0; i < 64; i++) {
    bin[i] = (dec & (1ul << (63 - i)));
  }
}


x86 assembly (clang, -O0):
<dectobin>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x40,-0x14(%rbp)
jge    1154 <dectobin+0x54>
mov    -0x8(%rbp),%rax
mov    $0x3f,%ecx
sub    -0x14(%rbp),%ecx
mov    %ecx,%ecx
mov    $0x1,%edx
shl    %cl,%rdx
mov    %rdx,%rcx
and    %rcx,%rax
mov    %eax,%edx
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <dectobin+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<dectobin>:
xorps  %xmm0,%xmm0
movups %xmm0,(%rsi)
movups %xmm0,0x10(%rsi)
movups %xmm0,0x20(%rsi)
movups %xmm0,0x30(%rsi)
movups %xmm0,0x40(%rsi)
movups %xmm0,0x50(%rsi)
movups %xmm0,0x60(%rsi)
movups %xmm0,0x70(%rsi)
movd   %edi,%xmm0
pshufd $0x0,%xmm0,%xmm0
movdqa 0xecd(%rip),%xmm1
pand   %xmm0,%xmm1
movdqu %xmm1,0x80(%rsi)
movdqa 0xec9(%rip),%xmm1
pand   %xmm0,%xmm1
movdqu %xmm1,0x90(%rsi)
movdqa 0xec5(%rip),%xmm1
pand   %xmm0,%xmm1
movdqu %xmm1,0xa0(%rsi)
movdqa 0xec1(%rip),%xmm1
pand   %xmm0,%xmm1
movdqu %xmm1,0xb0(%rsi)
movdqa 0xebd(%rip),%xmm1
pand   %xmm0,%xmm1
movdqu %xmm1,0xc0(%rsi)
movdqa 0xeb9(%rip),%xmm1
pand   %xmm0,%xmm1
movdqu %xmm1,0xd0(%rsi)
movdqa 0xeb5(%rip),%xmm1
pand   %xmm0,%xmm1
movdqu %xmm1,0xe0(%rsi)
pand   0xeb1(%rip),%xmm0
movdqu %xmm0,0xf0(%rsi)
ret

LLVM IR (-O0):
define void @dectobin(i64 %0, i32* %1) {
%3 = alloca i64
%4 = alloca i32*
%5 = alloca i32
store i64 %0, i64* %3
store i32* %1, i32** %4
store i32 0, i32* %5
br label %6
6: ; preds = %21, %2
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 64
br i1 %8, label %9, label %24
9: ; preds = %6
%10 = load i64, i64* %3
%11 = load i32, i32* %5
%12 = sub nsw i32 63, %11
%13 = zext i32 %12 to i64
%14 = shl i64 1, %13
%15 = and i64 %10, %14
%16 = trunc i64 %15 to i32
%17 = load i32*, i32** %4
%18 = load i32, i32* %5
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i32, i32* %17, i64 %19
store i32 %16, i32* %20
br label %21
21: ; preds = %9
%22 = load i32, i32* %5
%23 = add nsw i32 %22, 1
store i32 %23, i32* %5
br label %6
24: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @dectobin(i64 %0, i32* nocapture writeonly %1) {
%3 = insertelement <4 x i64> poison, i64 %0, i64 0
%4 = shufflevector <4 x i64> %3, <4 x i64> poison, <4 x i32> zeroinitializer
%5 = bitcast i32* %1 to <4 x i32>*
store <4 x i32> zeroinitializer, <4 x i32>* %5
%6 = getelementptr inbounds i32, i32* %1, i64 4
%7 = bitcast i32* %6 to <4 x i32>*
store <4 x i32> zeroinitializer, <4 x i32>* %7
%8 = getelementptr inbounds i32, i32* %1, i64 8
%9 = bitcast i32* %8 to <4 x i32>*
store <4 x i32> zeroinitializer, <4 x i32>* %9
%10 = getelementptr inbounds i32, i32* %1, i64 12
%11 = bitcast i32* %10 to <4 x i32>*
store <4 x i32> zeroinitializer, <4 x i32>* %11
%12 = getelementptr inbounds i32, i32* %1, i64 16
%13 = bitcast i32* %12 to <4 x i32>*
store <4 x i32> zeroinitializer, <4 x i32>* %13
%14 = getelementptr inbounds i32, i32* %1, i64 20
%15 = bitcast i32* %14 to <4 x i32>*
store <4 x i32> zeroinitializer, <4 x i32>* %15
%16 = getelementptr inbounds i32, i32* %1, i64 24
%17 = bitcast i32* %16 to <4 x i32>*
store <4 x i32> zeroinitializer, <4 x i32>* %17
%18 = getelementptr inbounds i32, i32* %1, i64 28
%19 = bitcast i32* %18 to <4 x i32>*
store <4 x i32> zeroinitializer, <4 x i32>* %19
%20 = trunc <4 x i64> %4 to <4 x i32>
%21 = and <4 x i32> %20, <i32 -2147483648, i32 1073741824, i32 536870912, i32 268435456>
%22 = getelementptr inbounds i32, i32* %1, i64 32
%23 = bitcast i32* %22 to <4 x i32>*
store <4 x i32> %21, <4 x i32>* %23
%24 = trunc <4 x i64> %4 to <4 x i32>
%25 = and <4 x i32> %24, <i32 134217728, i32 67108864, i32 33554432, i32 16777216>
%26 = getelementptr inbounds i32, i32* %1, i64 36
%27 = bitcast i32* %26 to <4 x i32>*
store <4 x i32> %25, <4 x i32>* %27
%28 = trunc <4 x i64> %4 to <4 x i32>
%29 = and <4 x i32> %28, <i32 8388608, i32 4194304, i32 2097152, i32 1048576>
%30 = getelementptr inbounds i32, i32* %1, i64 40
%31 = bitcast i32* %30 to <4 x i32>*
store <4 x i32> %29, <4 x i32>* %31
%32 = trunc <4 x i64> %4 to <4 x i32>
%33 = and <4 x i32> %32, <i32 524288, i32 262144, i32 131072, i32 65536>
%34 = getelementptr inbounds i32, i32* %1, i64 44
%35 = bitcast i32* %34 to <4 x i32>*
store <4 x i32> %33, <4 x i32>* %35
%36 = trunc <4 x i64> %4 to <4 x i32>
%37 = and <4 x i32> %36, <i32 32768, i32 16384, i32 8192, i32 4096>
%38 = getelementptr inbounds i32, i32* %1, i64 48
%39 = bitcast i32* %38 to <4 x i32>*
store <4 x i32> %37, <4 x i32>* %39
%40 = trunc <4 x i64> %4 to <4 x i32>
%41 = and <4 x i32> %40, <i32 2048, i32 1024, i32 512, i32 256>
%42 = getelementptr inbounds i32, i32* %1, i64 52
%43 = bitcast i32* %42 to <4 x i32>*
store <4 x i32> %41, <4 x i32>* %43
%44 = trunc <4 x i64> %4 to <4 x i32>
%45 = and <4 x i32> %44, <i32 128, i32 64, i32 32, i32 16>
%46 = getelementptr inbounds i32, i32* %1, i64 56
%47 = bitcast i32* %46 to <4 x i32>*
store <4 x i32> %45, <4 x i32>* %47
%48 = trunc <4 x i64> %4 to <4 x i32>
%49 = and <4 x i32> %48, <i32 8, i32 4, i32 2, i32 1>
%50 = getelementptr inbounds i32, i32* %1, i64 60
%51 = bitcast i32* %50 to <4 x i32>*
store <4 x i32> %49, <4 x i32>* %51
ret void
}