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

/* Variables and functions */
int /*<<< orphan*/ time(int /*<<< orphan*/);
size_t timeSeed(void) {
  time_t current = time(0);
  char *timeTPtr = (char *)&current;
  size_t hash, fnv_prime, fnv_offset;
  int index;
  if (sizeof(size_t) == 8) {
    fnv_offset = 14695981039346656037U;
    fnv_prime = 1099511628211U;
  } else {
    fnv_offset = 2166136261;
    fnv_prime = 16777619;
  }
  hash = fnv_offset;
  for (index = 0; index < sizeof(time_t); index++) {
    hash ^= timeTPtr[index];
    hash *= fnv_prime;
  }
  return hash;
}


x86 assembly (clang, -O0):
<timeSeed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
xor    %edi,%edi
call   1030 <time@plt>
mov    %eax,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
movabs $0xcbf29ce484222325,%rax
9c f2 cb
mov    %rax,-0x28(%rbp)
movabs $0x100000001b3,%rax
mov    %rax,-0x20(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x2c(%rbp)
movslq -0x2c(%rbp),%rax
cmp    $0x4,%rax
jae    1193 <timeSeed+0x83>
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsbq (%rax,%rcx,1),%rax
xor    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
imul   -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1155 <timeSeed+0x45>
mov    -0x18(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timeSeed>:
push   %rax
xor    %edi,%edi
call   1030 <time@plt>
mov    %eax,%ecx
mov    %eax,%edx
movsbq %al,%rsi
shr    $0x8,%eax
shr    $0x10,%ecx
shr    $0x18,%edx
movabs $0xcbf29ce484222325,%rdi
9c f2 cb
xor    %rsi,%rdi
movabs $0x100000001b3,%rsi
imul   %rsi,%rdi
movsbq %al,%rax
xor    %rdi,%rax
imul   %rsi,%rax
movsbq %cl,%rcx
xor    %rax,%rcx
imul   %rsi,%rcx
movsbq %dl,%rax
xor    %rcx,%rax
imul   %rsi,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @timeSeed() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i32
%7 = call i32 @time(i32 0)
store i32 %7, i32* %1
%8 = bitcast i32* %1 to i8*
store i8* %8, i8** %2
store i64 -3750763034362895579, i64* %5
store i64 1099511628211, i64* %4
%9 = load i64, i64* %5
store i64 %9, i64* %3
store i32 0, i32* %6
br label %10
10: ; preds = %26, %0
%11 = load i32, i32* %6
%12 = sext i32 %11 to i64
%13 = icmp ult i64 %12, 4
br i1 %13, label %14, label %29
14: ; preds = %10
%15 = load i8*, i8** %2
%16 = load i32, i32* %6
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %15, i64 %17
%19 = load i8, i8* %18
%20 = sext i8 %19 to i64
%21 = load i64, i64* %3
%22 = xor i64 %21, %20
store i64 %22, i64* %3
%23 = load i64, i64* %4
%24 = load i64, i64* %3
%25 = mul i64 %24, %23
store i64 %25, i64* %3
br label %26
26: ; preds = %14
%27 = load i32, i32* %6
%28 = add nsw i32 %27, 1
store i32 %28, i32* %6
br label %10
29: ; preds = %10
%30 = load i64, i64* %3
ret i64 %30
}

LLVM IR (-O2):
define i64 @timeSeed() {
%1 = tail call i32 @time(i32 0)
%2 = zext i32 %1 to i64
%3 = lshr i32 %1, 8
%4 = zext i32 %3 to i64
%5 = lshr i32 %1, 16
%6 = zext i32 %5 to i64
%7 = lshr i32 %1, 24
%8 = zext i32 %7 to i64
%9 = shl i64 %2, 56
%10 = ashr exact i64 %9, 56
%11 = xor i64 %10, -3750763034362895579
%12 = mul i64 %11, 1099511628211
%13 = shl i64 %4, 56
%14 = ashr exact i64 %13, 56
%15 = xor i64 %12, %14
%16 = mul i64 %15, 1099511628211
%17 = shl i64 %6, 56
%18 = ashr exact i64 %17, 56
%19 = xor i64 %16, %18
%20 = mul i64 %19, 1099511628211
%21 = shl nuw i64 %8, 56
%22 = ashr exact i64 %21, 56
%23 = xor i64 %20, %22
%24 = mul i64 %23, 1099511628211
ret i64 %24
}