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

/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ randombytes(char *, int);
int main(void) {
  char bits[65];
  randombytes(bits, sizeof(bits));
  for (int i = 0; i < sizeof(bits); i++)
    bits[i] = '0' + (1 & bits[i]);
  bits[sizeof(bits) - 1] = '\0';
  puts(bits);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x50(%rbp),%rdi
mov    $0x41,%esi
call   1040 <randombytes@plt>
movl   $0x0,-0x54(%rbp)
movslq -0x54(%rbp),%rax
cmp    $0x41,%rax
jae    1179 <main+0x59>
movslq -0x54(%rbp),%rax
movsbl -0x50(%rbp,%rax,1),%eax
and    $0x1,%eax
add    $0x30,%eax
mov    %al,%cl
movslq -0x54(%rbp),%rax
mov    %cl,-0x50(%rbp,%rax,1)
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    1144 <main+0x24>
movb   $0x0,-0x10(%rbp)
lea    -0x50(%rbp),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x50,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x41,%esi
call   1040 <randombytes@plt>
movaps 0xec4(%rip),%xmm0
movaps (%rsp),%xmm1
andps  %xmm0,%xmm1
movaps 0xec6(%rip),%xmm2
orps   %xmm2,%xmm1
movaps %xmm1,(%rsp)
movaps 0x10(%rsp),%xmm1
andps  %xmm0,%xmm1
orps   %xmm2,%xmm1
movaps %xmm1,0x10(%rsp)
movaps 0x20(%rsp),%xmm1
andps  %xmm0,%xmm1
orps   %xmm2,%xmm1
movaps %xmm1,0x20(%rsp)
andps  0x30(%rsp),%xmm0
orps   %xmm2,%xmm0
movaps %xmm0,0x30(%rsp)
movb   $0x0,0x40(%rsp)
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [65 x i8]
%3 = alloca i32
store i32 0, i32* %1
%4 = getelementptr inbounds [65 x i8], [65 x i8]* %2, i64 0, i64 0
%5 = call i32 @randombytes(i8* %4, i32 65)
store i32 0, i32* %3
br label %6
6: ; preds = %22, %0
%7 = load i32, i32* %3
%8 = sext i32 %7 to i64
%9 = icmp ult i64 %8, 65
br i1 %9, label %10, label %25
10: ; preds = %6
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [65 x i8], [65 x i8]* %2, i64 0, i64 %12
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = and i32 1, %15
%17 = add nsw i32 48, %16
%18 = trunc i32 %17 to i8
%19 = load i32, i32* %3
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [65 x i8], [65 x i8]* %2, i64 0, i64 %20
store i8 %18, i8* %21
br label %22
22: ; preds = %10
%23 = load i32, i32* %3
%24 = add nsw i32 %23, 1
store i32 %24, i32* %3
br label %6
25: ; preds = %6
%26 = getelementptr inbounds [65 x i8], [65 x i8]* %2, i64 0, i64 64
store i8 0, i8* %26
%27 = getelementptr inbounds [65 x i8], [65 x i8]* %2, i64 0, i64 0
%28 = call i32 @puts(i8* %27)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [65 x i8]
%2 = getelementptr inbounds [65 x i8], [65 x i8]* %1, i64 0, i64 0
%3 = call i32 @randombytes(i8* %2, i32 65)
%4 = bitcast [65 x i8]* %1 to <16 x i8>*
%5 = load <16 x i8>, <16 x i8>* %4
%6 = and <16 x i8> %5, <i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1>
%7 = or <16 x i8> %6, <i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48>
%8 = bitcast [65 x i8]* %1 to <16 x i8>*
store <16 x i8> %7, <16 x i8>* %8
%9 = getelementptr inbounds [65 x i8], [65 x i8]* %1, i64 0, i64 16
%10 = bitcast i8* %9 to <16 x i8>*
%11 = load <16 x i8>, <16 x i8>* %10
%12 = and <16 x i8> %11, <i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1>
%13 = or <16 x i8> %12, <i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48>
%14 = bitcast i8* %9 to <16 x i8>*
store <16 x i8> %13, <16 x i8>* %14
%15 = getelementptr inbounds [65 x i8], [65 x i8]* %1, i64 0, i64 32
%16 = bitcast i8* %15 to <16 x i8>*
%17 = load <16 x i8>, <16 x i8>* %16
%18 = and <16 x i8> %17, <i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1>
%19 = or <16 x i8> %18, <i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48>
%20 = bitcast i8* %15 to <16 x i8>*
store <16 x i8> %19, <16 x i8>* %20
%21 = getelementptr inbounds [65 x i8], [65 x i8]* %1, i64 0, i64 48
%22 = bitcast i8* %21 to <16 x i8>*
%23 = load <16 x i8>, <16 x i8>* %22
%24 = and <16 x i8> %23, <i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1>
%25 = or <16 x i8> %24, <i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48>
%26 = bitcast i8* %21 to <16 x i8>*
store <16 x i8> %25, <16 x i8>* %26
%27 = getelementptr inbounds [65 x i8], [65 x i8]* %1, i64 0, i64 64
store i8 0, i8* %27
%28 = call i32 @puts(i8* %2)
ret i32 0
}