#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*/ _rdrand16_step(unsigned short *);
int /*<<< orphan*/ _rdrand32_step(unsigned int *);
int /*<<< orphan*/ _rdrand64_step(unsigned long long *);
int /*<<< orphan*/ printf(char *, unsigned short, unsigned int,
                          unsigned long long);
int main(void) {
  unsigned short r16;
  unsigned int r32;
  unsigned long long r64;
  r16 = 0;
  r32 = 0;
  r64 = 0;
  for (;;) {
    _rdrand16_step(&r16);
    _rdrand32_step(&r32);
    _rdrand64_step(&r64);
    printf("%x %x %llx\n", r16, r32, r64);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movw   $0x0,-0x6(%rbp)
movl   $0x0,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
lea    -0x6(%rbp),%rdi
call   1050 <_rdrand16_step@plt>
lea    -0xc(%rbp),%rdi
call   1060 <_rdrand32_step@plt>
lea    -0x18(%rbp),%rdi
call   1040 <_rdrand64_step@plt>
mov    -0x6(%rbp),%ax
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
lea    0xe6f(%rip),%rdi
movzwl %ax,%esi
call   1030 <printf@plt>
jmp    1164 <main+0x24>

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
movw   $0x0,0xa(%rsp)
movl   $0x0,0xc(%rsp)
movq   $0x0,0x10(%rsp)
lea    0xa(%rsp),%r14
lea    0xc(%rsp),%r15
lea    0x10(%rsp),%r12
lea    0xe87(%rip),%rbx
nopl   0x0(%rax)
mov    %r14,%rdi
call   1050 <_rdrand16_step@plt>
mov    %r15,%rdi
call   1060 <_rdrand32_step@plt>
mov    %r12,%rdi
call   1040 <_rdrand64_step@plt>
movzwl 0xa(%rsp),%esi
mov    0xc(%rsp),%edx
mov    0x10(%rsp),%rcx
mov    %rbx,%rdi
call   1030 <printf@plt>
jmp    1180 <main+0x40>

LLVM IR (-O0):
@.str = [12 x i8] c"%x %x %llx\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i16
%3 = alloca i32
%4 = alloca i64
store i32 0, i32* %1
store i16 0, i16* %2
store i32 0, i32* %3
store i64 0, i64* %4
br label %5
5: ; preds = %5, %0
%6 = call i32 @_rdrand16_step(i16* %2)
%7 = call i32 @_rdrand32_step(i32* %3)
%8 = call i32 @_rdrand64_step(i64* %4)
%9 = load i16, i16* %2
%10 = load i32, i32* %3
%11 = load i64, i64* %4
%12 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i16 zeroext %9, i32 %10, i64 %11)
br label %5
}

LLVM IR (-O2):
@.str = [12 x i8] c"%x %x %llx\0A\00"
define i32 @main() {
%1 = alloca i16
%2 = alloca i32
%3 = alloca i64
%4 = bitcast i16* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i64* %3 to i8*
store i16 0, i16* %1
store i32 0, i32* %2
store i64 0, i64* %3
br label %7
7: ; preds = %7, %0
%8 = call i32 @_rdrand16_step(i16* %1)
%9 = call i32 @_rdrand32_step(i32* %2)
%10 = call i32 @_rdrand64_step(i64* %3)
%11 = load i16, i16* %1
%12 = load i32, i32* %2
%13 = load i64, i64* %3
%14 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i16 zeroext %11, i32 %12, i64 %13)
br label %7
}