#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*/ getRandom(unsigned char *, int);
int /*<<< orphan*/ printf(char *, unsigned char *);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ srand(unsigned int);
scalar_t__ time(int /*<<< orphan*/ *);
int main() {
  unsigned char buff[16] = {0x00};
  int i = 0;
  while (i++ < 100) {
    srand((unsigned)time(NULL));
    getRandom(buff, 16);
    printf("%s\n", buff);
    sleep(1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1040 <memset@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x24(%rbp)
cmp    $0x64,%eax
jge    11d7 <main+0x77>
xor    %eax,%eax
mov    %eax,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
lea    -0x20(%rbp),%rdi
mov    $0x10,%esi
call   1070 <getRandom@plt>
lea    -0x20(%rbp),%rsi
lea    0xe3d(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1080 <sleep@plt>
jmp    1186 <main+0x26>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
mov    $0x64,%ebp
mov    %rsp,%rbx
lea    0xe92(%rip),%r14
xchg   %ax,%ax
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
mov    %rbx,%rdi
mov    $0x10,%esi
call   1060 <getRandom@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1070 <sleep@plt>
add    $0xffffffff,%ebp
jne    1170 <main+0x20>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [16 x i8]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [16 x i8]* %2 to i8*
store i32 0, i32* %3
br label %5
5: ; preds = %9, %0
%6 = load i32, i32* %3
%7 = add nsw i32 %6, 1
store i32 %7, i32* %3
%8 = icmp slt i32 %6, 100
br i1 %8, label %9, label %18
9: ; preds = %5
%10 = call i64 @time(i32* null)
%11 = trunc i64 %10 to i32
%12 = call i32 @srand(i32 %11)
%13 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%14 = call i32 @getRandom(i8* %13, i32 16)
%15 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %15)
%17 = call i32 @sleep(i32 1)
br label %5
18: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [16 x i8]
%2 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
br label %3
3: ; preds = %0, %3
%4 = phi i32 [ 0, %0 ], [ %5, %3 ]
%5 = add nuw nsw i32 %4, 1
%6 = call i64 @time(i32* null)
%7 = trunc i64 %6 to i32
%8 = call i32 @srand(i32 %7)
%9 = call i32 @getRandom(i8* %2, i32 16)
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%11 = call i32 @sleep(i32 1)
%12 = icmp eq i32 %5, 100
br i1 %12, label %13, label %3
13: ; preds = %3
ret i32 0
}