#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;
struct tm {
  int tm_sec;
  int tm_min;
  int tm_hour;
  int tm_mday;
  int tm_mon;
  int tm_year;
  int tm_wday;
  int tm_yday;
  int tm_isdst;
};

/* Variables and functions */
unsigned int clock();
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int make_new_seed() {
  time_t tp;
  struct tm *temp;
  unsigned int temp2, temp3;
  static unsigned int temp4 = 0xe0e1;
  time(&tp);
  temp = localtime(&tp);
  temp2 = (temp->tm_sec << 26) + (temp->tm_min << 20) + (temp->tm_hour << 15) +
          (temp->tm_mday << 10) + (temp->tm_mon << 6);
  temp3 = (temp->tm_year << 13) + (temp->tm_wday << 10) + (temp->tm_yday << 1) +
          temp->tm_isdst;
  temp2 ^= clock() ^ temp3;
  temp4 = (temp4 * 0xeeee) % 0xffff;
  temp2 ^= temp4 << 16;
  temp4 = (temp4 * 0xaeee) % 0xffff;
  temp2 ^= temp4;
  temp2 &= 0x7fffffff;
  return temp2;
}


x86 assembly (clang, -O0):
<make_new_seed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x4(%rbp),%rdi
call   1050 <time@plt>
lea    -0x4(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
shl    $0x1a,%eax
mov    -0x10(%rbp),%rcx
mov    0x4(%rcx),%ecx
shl    $0x14,%ecx
add    %ecx,%eax
mov    -0x10(%rbp),%rcx
mov    0x8(%rcx),%ecx
shl    $0xf,%ecx
add    %ecx,%eax
mov    -0x10(%rbp),%rcx
mov    0xc(%rcx),%ecx
shl    $0xa,%ecx
add    %ecx,%eax
mov    -0x10(%rbp),%rcx
mov    0x10(%rcx),%ecx
shl    $0x6,%ecx
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x14(%rax),%eax
shl    $0xd,%eax
mov    -0x10(%rbp),%rcx
mov    0x18(%rcx),%ecx
shl    $0xa,%ecx
add    %ecx,%eax
mov    -0x10(%rbp),%rcx
mov    0x1c(%rcx),%ecx
shl    $0x1,%ecx
add    %ecx,%eax
mov    -0x10(%rbp),%rcx
add    0x20(%rcx),%eax
mov    %eax,-0x18(%rbp)
mov    $0x0,%al
call   1040 <clock@plt>
xor    -0x18(%rbp),%eax
xor    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
imul   $0xeeee,0x2e68(%rip),%eax
mov    $0xffff,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,0x2e59(%rip)
mov    0x2e53(%rip),%eax
shl    $0x10,%eax
xor    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
imul   $0xaeee,0x2e40(%rip),%eax
mov    $0xffff,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,0x2e31(%rip)
mov    0x2e2b(%rip),%eax
xor    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    $0x7fffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_new_seed>:
push   %rbp
push   %rbx
push   %rax
lea    0x4(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <time@plt>
mov    %rbx,%rdi
call   1030 <localtime@plt>
movdqu (%rax),%xmm0
movdqa 0xeac(%rip),%xmm1
pmuludq %xmm0,%xmm1
pshufd $0xf5,%xmm0,%xmm0
pmuludq 0xeab(%rip),%xmm0
pshufd $0xe8,%xmm1,%xmm1
pshufd $0xe8,%xmm0,%xmm0
punpckldq %xmm0,%xmm1
mov    0x10(%rax),%ecx
shl    $0x6,%ecx
pshufd $0xee,%xmm1,%xmm0
paddd  %xmm1,%xmm0
pshufd $0x55,%xmm0,%xmm1
paddd  %xmm0,%xmm1
movd   %xmm1,%ebx
add    %ecx,%ebx
mov    0x14(%rax),%ecx
shl    $0xd,%ecx
mov    0x18(%rax),%edx
shl    $0xa,%edx
add    %ecx,%edx
mov    0x1c(%rax),%ecx
lea    (%rdx,%rcx,2),%ebp
add    0x20(%rax),%ebp
xor    %eax,%eax
call   1040 <clock@plt>
imul   $0xeeee,0x2e7f(%rip),%edx
mov    $0x80008001,%ecx
mov    %rdx,%rsi
imul   %rcx,%rsi
shr    $0x2f,%rsi
mov    %esi,%edi
shl    $0x10,%edi
sub    %edi,%esi
add    %edx,%esi
imul   $0xaeee,%esi,%edx
shl    $0x10,%esi
xor    %ebp,%eax
xor    %esi,%eax
xor    %ebx,%eax
imul   %rdx,%rcx
shr    $0x2f,%rcx
mov    %ecx,%esi
shl    $0x10,%esi
sub    %esi,%ecx
add    %edx,%ecx
mov    %ecx,0x2e40(%rip)
and    $0x7fffffff,%eax
xor    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.tm = type { i32, i32, i32, i32, i32, i32, i32, i32, i32 }
@make_new_seed.temp4 = internal global i32 57569
define i32 @make_new_seed() {
%1 = alloca i32
%2 = alloca %struct.tm*
%3 = alloca i32
%4 = alloca i32
%5 = call i32 @time(i32* %1)
%6 = call %struct.tm* @localtime(i32* %1)
store %struct.tm* %6, %struct.tm** %2
%7 = load %struct.tm*, %struct.tm** %2
%8 = getelementptr inbounds %struct.tm, %struct.tm* %7, i32 0, i32 0
%9 = load i32, i32* %8
%10 = shl i32 %9, 26
%11 = load %struct.tm*, %struct.tm** %2
%12 = getelementptr inbounds %struct.tm, %struct.tm* %11, i32 0, i32 1
%13 = load i32, i32* %12
%14 = shl i32 %13, 20
%15 = add nsw i32 %10, %14
%16 = load %struct.tm*, %struct.tm** %2
%17 = getelementptr inbounds %struct.tm, %struct.tm* %16, i32 0, i32 2
%18 = load i32, i32* %17
%19 = shl i32 %18, 15
%20 = add nsw i32 %15, %19
%21 = load %struct.tm*, %struct.tm** %2
%22 = getelementptr inbounds %struct.tm, %struct.tm* %21, i32 0, i32 3
%23 = load i32, i32* %22
%24 = shl i32 %23, 10
%25 = add nsw i32 %20, %24
%26 = load %struct.tm*, %struct.tm** %2
%27 = getelementptr inbounds %struct.tm, %struct.tm* %26, i32 0, i32 4
%28 = load i32, i32* %27
%29 = shl i32 %28, 6
%30 = add nsw i32 %25, %29
store i32 %30, i32* %3
%31 = load %struct.tm*, %struct.tm** %2
%32 = getelementptr inbounds %struct.tm, %struct.tm* %31, i32 0, i32 5
%33 = load i32, i32* %32
%34 = shl i32 %33, 13
%35 = load %struct.tm*, %struct.tm** %2
%36 = getelementptr inbounds %struct.tm, %struct.tm* %35, i32 0, i32 6
%37 = load i32, i32* %36
%38 = shl i32 %37, 10
%39 = add nsw i32 %34, %38
%40 = load %struct.tm*, %struct.tm** %2
%41 = getelementptr inbounds %struct.tm, %struct.tm* %40, i32 0, i32 7
%42 = load i32, i32* %41
%43 = shl i32 %42, 1
%44 = add nsw i32 %39, %43
%45 = load %struct.tm*, %struct.tm** %2
%46 = getelementptr inbounds %struct.tm, %struct.tm* %45, i32 0, i32 8
%47 = load i32, i32* %46
%48 = add nsw i32 %44, %47
store i32 %48, i32* %4
%49 = call i32 (...) @clock()
%50 = load i32, i32* %4
%51 = xor i32 %49, %50
%52 = load i32, i32* %3
%53 = xor i32 %52, %51
store i32 %53, i32* %3
%54 = load i32, i32* @make_new_seed.temp4
%55 = mul i32 %54, 61166
%56 = urem i32 %55, 65535
store i32 %56, i32* @make_new_seed.temp4
%57 = load i32, i32* @make_new_seed.temp4
%58 = shl i32 %57, 16
%59 = load i32, i32* %3
%60 = xor i32 %59, %58
store i32 %60, i32* %3
%61 = load i32, i32* @make_new_seed.temp4
%62 = mul i32 %61, 44782
%63 = urem i32 %62, 65535
store i32 %63, i32* @make_new_seed.temp4
%64 = load i32, i32* @make_new_seed.temp4
%65 = load i32, i32* %3
%66 = xor i32 %65, %64
store i32 %66, i32* %3
%67 = load i32, i32* %3
%68 = and i32 %67, 2147483647
store i32 %68, i32* %3
%69 = load i32, i32* %3
ret i32 %69
}

LLVM IR (-O2):
%struct.tm = type { i32, i32, i32, i32, i32, i32, i32, i32, i32 }
@make_new_seed.temp4 = internal unnamed_addr global i32 57569
define i32 @make_new_seed() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @time(i32* %1)
%4 = call %struct.tm* @localtime(i32* %1)
%5 = bitcast %struct.tm* %4 to <4 x i32>*
%6 = load <4 x i32>, <4 x i32>* %5
%7 = shl <4 x i32> %6, <i32 26, i32 20, i32 15, i32 10>
%8 = getelementptr inbounds %struct.tm, %struct.tm* %4, i64 0, i32 4
%9 = load i32, i32* %8
%10 = shl i32 %9, 6
%11 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %7)
%12 = add nsw i32 %11, %10
%13 = getelementptr inbounds %struct.tm, %struct.tm* %4, i64 0, i32 5
%14 = load i32, i32* %13
%15 = shl i32 %14, 13
%16 = getelementptr inbounds %struct.tm, %struct.tm* %4, i64 0, i32 6
%17 = load i32, i32* %16
%18 = shl i32 %17, 10
%19 = add nsw i32 %18, %15
%20 = getelementptr inbounds %struct.tm, %struct.tm* %4, i64 0, i32 7
%21 = load i32, i32* %20
%22 = shl i32 %21, 1
%23 = add nsw i32 %19, %22
%24 = getelementptr inbounds %struct.tm, %struct.tm* %4, i64 0, i32 8
%25 = load i32, i32* %24
%26 = add nsw i32 %23, %25
%27 = call i32 (...) @clock()
%28 = load i32, i32* @make_new_seed.temp4
%29 = mul i32 %28, 61166
%30 = urem i32 %29, 65535
%31 = shl nuw i32 %30, 16
%32 = xor i32 %27, %12
%33 = xor i32 %32, %26
%34 = xor i32 %33, %31
%35 = mul nuw i32 %30, 44782
%36 = urem i32 %35, 65535
store i32 %36, i32* @make_new_seed.temp4
%37 = and i32 %34, 2147483647
%38 = xor i32 %37, %36
ret i32 %38
}