#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*/ print_stack();
int /*<<< orphan*/ push(int /*<<< orphan*/);
int /*<<< orphan*/ rand_r(unsigned int *);
unsigned int time(int /*<<< orphan*/ *);
int main() {
  int i = 0;
  unsigned int seed = time(NULL);
  for (i = 0; i < 16; i++) {
    push(rand_r(&seed));
  }
  print_stack();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x10,-0x8(%rbp)
jge    1191 <main+0x51>
lea    -0xc(%rbp),%rdi
call   1030 <rand_r@plt>
mov    %eax,%edi
call   1060 <push@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1169 <main+0x29>
mov    $0x0,%al
call   1050 <print_stack@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <rand_r@plt>
mov    %eax,%edi
call   1060 <push@plt>
mov    %rbx,%rdi
call   1030 <rand_r@plt>
mov    %eax,%edi
call   1060 <push@plt>
mov    %rbx,%rdi
call   1030 <rand_r@plt>
mov    %eax,%edi
call   1060 <push@plt>
mov    %rbx,%rdi
call   1030 <rand_r@plt>
mov    %eax,%edi
call   1060 <push@plt>
mov    %rbx,%rdi
call   1030 <rand_r@plt>
mov    %eax,%edi
call   1060 <push@plt>
mov    %rbx,%rdi
call   1030 <rand_r@plt>
mov    %eax,%edi
call   1060 <push@plt>
mov    %rbx,%rdi
call   1030 <rand_r@plt>
mov    %eax,%edi
call   1060 <push@plt>
mov    %rbx,%rdi
call   1030 <rand_r@plt>
mov    %eax,%edi
call   1060 <push@plt>
mov    %rbx,%rdi
call   1030 <rand_r@plt>
mov    %eax,%edi
call   1060 <push@plt>
mov    %rbx,%rdi
call   1030 <rand_r@plt>
mov    %eax,%edi
call   1060 <push@plt>
mov    %rbx,%rdi
call   1030 <rand_r@plt>
mov    %eax,%edi
call   1060 <push@plt>
mov    %rbx,%rdi
call   1030 <rand_r@plt>
mov    %eax,%edi
call   1060 <push@plt>
mov    %rbx,%rdi
call   1030 <rand_r@plt>
mov    %eax,%edi
call   1060 <push@plt>
mov    %rbx,%rdi
call   1030 <rand_r@plt>
mov    %eax,%edi
call   1060 <push@plt>
mov    %rbx,%rdi
call   1030 <rand_r@plt>
mov    %eax,%edi
call   1060 <push@plt>
mov    %rbx,%rdi
call   1030 <rand_r@plt>
mov    %eax,%edi
call   1060 <push@plt>
xor    %eax,%eax
call   1050 <print_stack@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%4 = call i32 @time(i32* null)
store i32 %4, i32* %3
store i32 0, i32* %2
br label %5
5: ; preds = %11, %0
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 16
br i1 %7, label %8, label %14
8: ; preds = %5
%9 = call i32 @rand_r(i32* %3)
%10 = call i32 @push(i32 %9)
br label %11
11: ; preds = %8
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 1
store i32 %13, i32* %2
br label %5
14: ; preds = %5
%15 = call i32 (...) @print_stack()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @time(i32* null)
store i32 %3, i32* %1
%4 = call i32 @rand_r(i32* %1)
%5 = call i32 @push(i32 %4)
%6 = call i32 @rand_r(i32* %1)
%7 = call i32 @push(i32 %6)
%8 = call i32 @rand_r(i32* %1)
%9 = call i32 @push(i32 %8)
%10 = call i32 @rand_r(i32* %1)
%11 = call i32 @push(i32 %10)
%12 = call i32 @rand_r(i32* %1)
%13 = call i32 @push(i32 %12)
%14 = call i32 @rand_r(i32* %1)
%15 = call i32 @push(i32 %14)
%16 = call i32 @rand_r(i32* %1)
%17 = call i32 @push(i32 %16)
%18 = call i32 @rand_r(i32* %1)
%19 = call i32 @push(i32 %18)
%20 = call i32 @rand_r(i32* %1)
%21 = call i32 @push(i32 %20)
%22 = call i32 @rand_r(i32* %1)
%23 = call i32 @push(i32 %22)
%24 = call i32 @rand_r(i32* %1)
%25 = call i32 @push(i32 %24)
%26 = call i32 @rand_r(i32* %1)
%27 = call i32 @push(i32 %26)
%28 = call i32 @rand_r(i32* %1)
%29 = call i32 @push(i32 %28)
%30 = call i32 @rand_r(i32* %1)
%31 = call i32 @push(i32 %30)
%32 = call i32 @rand_r(i32* %1)
%33 = call i32 @push(i32 %32)
%34 = call i32 @rand_r(i32* %1)
%35 = call i32 @push(i32 %34)
%36 = call i32 (...) @print_stack()
ret i32 0
}