#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 char uint8_t;
typedef int uint32_t;
typedef scalar_t__ time_t;

/* Variables and functions */
int hashlittle(char *, int, int);
int /*<<< orphan*/ printf(char *, scalar_t__, int);
int /*<<< orphan*/ time(scalar_t__ *);
void driver1() {
  uint8_t buf[256];
  uint32_t i;
  uint32_t h = 0;
  time_t a, z;
  time(&a);
  for (i = 0; i < 256; ++i)
    buf[i] = 'x';
  for (i = 0; i < 1; ++i) {
    h = hashlittle(&buf[0], 1, h);
  }
  time(&z);
  if (z - a > 0)
    printf("time %d %.8x\n", z - a, h);
}


x86 assembly (clang, -O0):
<driver1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
movl   $0x0,-0x108(%rbp)
lea    -0x110(%rbp),%rdi
call   1050 <time@plt>
movl   $0x0,-0x104(%rbp)
cmpl   $0x100,-0x104(%rbp)
jge    118e <driver1+0x5e>
movslq -0x104(%rbp),%rax
movb   $0x78,-0x100(%rbp,%rax,1)
78
mov    -0x104(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x104(%rbp)
jmp    115b <driver1+0x2b>
movl   $0x0,-0x104(%rbp)
cmpl   $0x1,-0x104(%rbp)
jge    11d6 <driver1+0xa6>
lea    -0x100(%rbp),%rdi
mov    -0x108(%rbp),%edx
mov    $0x1,%esi
call   1030 <hashlittle@plt>
mov    %eax,-0x108(%rbp)
mov    -0x104(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x104(%rbp)
jmp    1198 <driver1+0x68>
lea    -0x118(%rbp),%rdi
call   1050 <time@plt>
mov    -0x118(%rbp),%rax
sub    -0x110(%rbp),%rax
cmp    $0x0,%rax
jle    121a <driver1+0xea>
mov    -0x118(%rbp),%rsi
sub    -0x110(%rbp),%rsi
mov    -0x108(%rbp),%edx
lea    0xdeb(%rip),%rdi
call   1040 <printf@plt>
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<driver1>:
push   %rbx
sub    $0x110,%rsp
lea    0x8(%rsp),%rdi
call   1050 <time@plt>
movaps 0xeb7(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0xd0(%rsp)
movaps %xmm0,0xe0(%rsp)
movaps %xmm0,0xf0(%rsp)
movaps %xmm0,0x100(%rsp)
lea    0x10(%rsp),%rdi
mov    $0x1,%esi
xor    %edx,%edx
call   1030 <hashlittle@plt>
mov    %eax,%ebx
mov    %rsp,%rdi
call   1050 <time@plt>
mov    (%rsp),%rsi
sub    0x8(%rsp),%rsi
jle    11e8 <driver1+0xb8>
lea    0xe2f(%rip),%rdi
mov    %ebx,%edx
call   1040 <printf@plt>
add    $0x110,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"time %d %.8x\0A\00"
define void @driver1() {
%1 = alloca [256 x i8]
%2 = alloca i32
%3 = alloca i32
%4 = alloca i64
%5 = alloca i64
store i32 0, i32* %3
%6 = call i32 @time(i64* %4)
store i32 0, i32* %2
br label %7
7: ; preds = %14, %0
%8 = load i32, i32* %2
%9 = icmp slt i32 %8, 256
br i1 %9, label %10, label %17
10: ; preds = %7
%11 = load i32, i32* %2
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 %12
store i8 120, i8* %13
br label %14
14: ; preds = %10
%15 = load i32, i32* %2
%16 = add nsw i32 %15, 1
store i32 %16, i32* %2
br label %7
17: ; preds = %7
store i32 0, i32* %2
br label %18
18: ; preds = %25, %17
%19 = load i32, i32* %2
%20 = icmp slt i32 %19, 1
br i1 %20, label %21, label %28
21: ; preds = %18
%22 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%23 = load i32, i32* %3
%24 = call i32 @hashlittle(i8* %22, i32 1, i32 %23)
store i32 %24, i32* %3
br label %25
25: ; preds = %21
%26 = load i32, i32* %2
%27 = add nsw i32 %26, 1
store i32 %27, i32* %2
br label %18
28: ; preds = %18
%29 = call i32 @time(i64* %5)
%30 = load i64, i64* %5
%31 = load i64, i64* %4
%32 = sub nsw i64 %30, %31
%33 = icmp sgt i64 %32, 0
br i1 %33, label %34, label %40
34: ; preds = %28
%35 = load i64, i64* %5
%36 = load i64, i64* %4
%37 = sub nsw i64 %35, %36
%38 = load i32, i32* %3
%39 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i64 %37, i32 %38)
br label %40
40: ; preds = %34, %28
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"time %d %.8x\0A\00"
define void @driver1() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = alloca i64
%4 = alloca i64
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%6 = bitcast i64* %3 to i8*
%7 = bitcast i64* %4 to i8*
%8 = call i32 @time(i64* %3)
%9 = call i32 @hashlittle(i8* %5, i32 1, i32 0)
%10 = call i32 @time(i64* %4)
%11 = load i64, i64* %4
%12 = load i64, i64* %3
%13 = sub nsw i64 %11, %12
%14 = icmp sgt i64 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %0
%16 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i64 %13, i32 %9)
br label %17
17: ; preds = %15, %0
ret void
}