#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 */
int /*<<< orphan*/ printf(char *);
void binaryArray(int n, int array[], int size) {
  int i = 0;
  int c, k, l;
  for (c = 31; c >= 0; c--) {
    k = n >> c;
    array[i] = k;
    {
      if (1 & k) {
        int x = 1;
        array[i] = x;
      } else {
        int x = 0;
        array[i] = x;
      }
      i++;
    }
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<binaryArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x1f,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jl     11a8 <binaryArray+0x98>
mov    -0x4(%rbp),%eax
mov    -0x1c(%rbp),%ecx
sar    %cl,%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%edx
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x20(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     117c <binaryArray+0x6c>
movl   $0x1,-0x28(%rbp)
mov    -0x28(%rbp),%edx
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
jmp    1191 <binaryArray+0x81>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%edx
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
jmp    1130 <binaryArray+0x20>
lea    0xe51(%rip),%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<binaryArray>:
movd   %edi,%xmm0
pshufd $0x0,%xmm0,%xmm0
movdqa %xmm0,%xmm1
psrld  $0x1c,%xmm1
movdqa %xmm0,%xmm2
psrld  $0x1d,%xmm2
punpckhqdq %xmm1,%xmm2
movdqa %xmm0,%xmm1
psrld  $0x1e,%xmm1
movdqa %xmm0,%xmm3
psrld  $0x1f,%xmm3
punpcklqdq %xmm1,%xmm3
shufps $0xcc,%xmm2,%xmm3
movaps 0xeb0(%rip),%xmm1
andps  %xmm1,%xmm3
movups %xmm3,(%rsi)
movdqa %xmm0,%xmm2
psrld  $0x18,%xmm2
movdqa %xmm0,%xmm3
psrld  $0x19,%xmm3
punpckhqdq %xmm2,%xmm3
movdqa %xmm0,%xmm2
psrld  $0x1a,%xmm2
movdqa %xmm0,%xmm4
psrld  $0x1b,%xmm4
punpcklqdq %xmm2,%xmm4
shufps $0xcc,%xmm3,%xmm4
andps  %xmm1,%xmm4
movups %xmm4,0x10(%rsi)
movdqa %xmm0,%xmm2
psrld  $0x14,%xmm2
movdqa %xmm0,%xmm3
psrld  $0x15,%xmm3
punpckhqdq %xmm2,%xmm3
movdqa %xmm0,%xmm2
psrld  $0x16,%xmm2
movdqa %xmm0,%xmm4
psrld  $0x17,%xmm4
punpcklqdq %xmm2,%xmm4
shufps $0xcc,%xmm3,%xmm4
andps  %xmm1,%xmm4
movups %xmm4,0x20(%rsi)
movdqa %xmm0,%xmm2
psrld  $0x10,%xmm2
movdqa %xmm0,%xmm3
psrld  $0x11,%xmm3
punpckhqdq %xmm2,%xmm3
movdqa %xmm0,%xmm2
psrld  $0x12,%xmm2
movdqa %xmm0,%xmm4
psrld  $0x13,%xmm4
punpcklqdq %xmm2,%xmm4
shufps $0xcc,%xmm3,%xmm4
andps  %xmm1,%xmm4
movups %xmm4,0x30(%rsi)
movdqa %xmm0,%xmm2
psrld  $0xc,%xmm2
movdqa %xmm0,%xmm3
psrld  $0xd,%xmm3
punpckhqdq %xmm2,%xmm3
movdqa %xmm0,%xmm2
psrld  $0xe,%xmm2
movdqa %xmm0,%xmm4
psrld  $0xf,%xmm4
punpcklqdq %xmm2,%xmm4
shufps $0xcc,%xmm3,%xmm4
andps  %xmm1,%xmm4
movups %xmm4,0x40(%rsi)
movdqa %xmm0,%xmm2
psrld  $0x8,%xmm2
movdqa %xmm0,%xmm3
psrld  $0x9,%xmm3
punpckhqdq %xmm2,%xmm3
movdqa %xmm0,%xmm2
psrld  $0xa,%xmm2
movdqa %xmm0,%xmm4
psrld  $0xb,%xmm4
punpcklqdq %xmm2,%xmm4
shufps $0xcc,%xmm3,%xmm4
andps  %xmm1,%xmm4
movups %xmm4,0x50(%rsi)
movdqa %xmm0,%xmm2
psrld  $0x4,%xmm2
movdqa %xmm0,%xmm3
psrld  $0x5,%xmm3
punpckhqdq %xmm2,%xmm3
movdqa %xmm0,%xmm2
psrld  $0x6,%xmm2
movdqa %xmm0,%xmm4
psrld  $0x7,%xmm4
punpcklqdq %xmm2,%xmm4
shufps $0xcc,%xmm3,%xmm4
andps  %xmm1,%xmm4
movups %xmm4,0x60(%rsi)
movdqa %xmm0,%xmm2
psrld  $0x1,%xmm2
punpckhqdq %xmm0,%xmm2
movdqa %xmm0,%xmm3
psrld  $0x2,%xmm3
psrld  $0x3,%xmm0
punpcklqdq %xmm3,%xmm0
shufps $0xcc,%xmm2,%xmm0
andps  %xmm1,%xmm0
movups %xmm0,0x70(%rsi)
mov    $0xa,%edi
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define void @binaryArray(i32 %0, i32* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32 %2, i32* %6
store i32 0, i32* %7
store i32 31, i32* %8
br label %13
13: ; preds = %43, %3
%14 = load i32, i32* %8
%15 = icmp sge i32 %14, 0
br i1 %15, label %16, label %46
16: ; preds = %13
%17 = load i32, i32* %4
%18 = load i32, i32* %8
%19 = ashr i32 %17, %18
store i32 %19, i32* %9
%20 = load i32, i32* %9
%21 = load i32*, i32** %5
%22 = load i32, i32* %7
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i32, i32* %21, i64 %23
store i32 %20, i32* %24
%25 = load i32, i32* %9
%26 = and i32 1, %25
%27 = icmp ne i32 %26, 0
br i1 %27, label %28, label %34
28: ; preds = %16
store i32 1, i32* %11
%29 = load i32, i32* %11
%30 = load i32*, i32** %5
%31 = load i32, i32* %7
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds i32, i32* %30, i64 %32
store i32 %29, i32* %33
br label %40
34: ; preds = %16
store i32 0, i32* %12
%35 = load i32, i32* %12
%36 = load i32*, i32** %5
%37 = load i32, i32* %7
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds i32, i32* %36, i64 %38
store i32 %35, i32* %39
br label %40
40: ; preds = %34, %28
%41 = load i32, i32* %7
%42 = add nsw i32 %41, 1
store i32 %42, i32* %7
br label %43
43: ; preds = %40
%44 = load i32, i32* %8
%45 = add nsw i32 %44, -1
store i32 %45, i32* %8
br label %13
46: ; preds = %13
%47 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
define void @binaryArray(i32 %0, i32* nocapture writeonly %1, i32 %2) {
%4 = insertelement <4 x i32> poison, i32 %0, i64 0
%5 = shufflevector <4 x i32> %4, <4 x i32> poison, <4 x i32> zeroinitializer
%6 = lshr <4 x i32> %5, <i32 31, i32 30, i32 29, i32 28>
%7 = and <4 x i32> %6, <i32 1, i32 1, i32 1, i32 1>
%8 = bitcast i32* %1 to <4 x i32>*
store <4 x i32> %7, <4 x i32>* %8
%9 = getelementptr inbounds i32, i32* %1, i64 4
%10 = lshr <4 x i32> %5, <i32 27, i32 26, i32 25, i32 24>
%11 = and <4 x i32> %10, <i32 1, i32 1, i32 1, i32 1>
%12 = bitcast i32* %9 to <4 x i32>*
store <4 x i32> %11, <4 x i32>* %12
%13 = getelementptr inbounds i32, i32* %1, i64 8
%14 = lshr <4 x i32> %5, <i32 23, i32 22, i32 21, i32 20>
%15 = and <4 x i32> %14, <i32 1, i32 1, i32 1, i32 1>
%16 = bitcast i32* %13 to <4 x i32>*
store <4 x i32> %15, <4 x i32>* %16
%17 = getelementptr inbounds i32, i32* %1, i64 12
%18 = lshr <4 x i32> %5, <i32 19, i32 18, i32 17, i32 16>
%19 = and <4 x i32> %18, <i32 1, i32 1, i32 1, i32 1>
%20 = bitcast i32* %17 to <4 x i32>*
store <4 x i32> %19, <4 x i32>* %20
%21 = getelementptr inbounds i32, i32* %1, i64 16
%22 = lshr <4 x i32> %5, <i32 15, i32 14, i32 13, i32 12>
%23 = and <4 x i32> %22, <i32 1, i32 1, i32 1, i32 1>
%24 = bitcast i32* %21 to <4 x i32>*
store <4 x i32> %23, <4 x i32>* %24
%25 = getelementptr inbounds i32, i32* %1, i64 20
%26 = lshr <4 x i32> %5, <i32 11, i32 10, i32 9, i32 8>
%27 = and <4 x i32> %26, <i32 1, i32 1, i32 1, i32 1>
%28 = bitcast i32* %25 to <4 x i32>*
store <4 x i32> %27, <4 x i32>* %28
%29 = getelementptr inbounds i32, i32* %1, i64 24
%30 = lshr <4 x i32> %5, <i32 7, i32 6, i32 5, i32 4>
%31 = and <4 x i32> %30, <i32 1, i32 1, i32 1, i32 1>
%32 = bitcast i32* %29 to <4 x i32>*
store <4 x i32> %31, <4 x i32>* %32
%33 = getelementptr inbounds i32, i32* %1, i64 28
%34 = lshr <4 x i32> %5, <i32 3, i32 2, i32 1, i32 0>
%35 = and <4 x i32> %34, <i32 1, i32 1, i32 1, i32 1>
%36 = bitcast i32* %33 to <4 x i32>*
store <4 x i32> %35, <4 x i32>* %36
%37 = tail call i32 @putchar(i32 10)
ret void
}