#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 time_t;
typedef int /*<<< orphan*/ argv;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int rand();
int /*<<< orphan*/ srand(int);
int /*<<< orphan*/ stdout;
int time(int /*<<< orphan*/ *);
int main(int argc, char *argv[]) {
  time_t startTime = time(NULL);
  srand(time(NULL));
  int scalar = (rand() % 101) + 1;
  int blockSize = argc / (sizeof(argv) / sizeof(argv[0]));
  time_t endTime = time(NULL);
  int elapsedTime = endTime - startTime;
  fprintf(stdout, "TIME: %d\n", elapsedTime);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,-0x14(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x65,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x18(%rbp)
movslq -0x8(%rbp),%rax
shr    $0x0,%rax
mov    %eax,-0x1c(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
sub    -0x14(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    0x2e32(%rip),%rax
mov    (%rax),%edi
mov    -0x24(%rbp),%edx
lea    0xe46(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%ebx
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
xor    %eax,%eax
call   1060 <rand@plt>
xor    %edi,%edi
call   1050 <time@plt>
sub    %ebx,%eax
mov    0x2e71(%rip),%rcx
mov    (%rcx),%edi
lea    0xe88(%rip),%rsi
mov    %eax,%edx
call   1040 <fprintf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [10 x i8] c"TIME: %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%11 = call i32 @time(i32* null)
store i32 %11, i32* %6
%12 = call i32 @time(i32* null)
%13 = call i32 @srand(i32 %12)
%14 = call i32 (...) @rand()
%15 = srem i32 %14, 101
%16 = add nsw i32 %15, 1
store i32 %16, i32* %7
%17 = load i32, i32* %4
%18 = sext i32 %17 to i64
%19 = udiv i64 %18, 1
%20 = trunc i64 %19 to i32
store i32 %20, i32* %8
%21 = call i32 @time(i32* null)
store i32 %21, i32* %9
%22 = load i32, i32* %9
%23 = load i32, i32* %6
%24 = sub nsw i32 %22, %23
store i32 %24, i32* %10
%25 = load i32, i32* @stdout
%26 = load i32, i32* %10
%27 = call i32 @fprintf(i32 %25, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %26)
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [10 x i8] c"TIME: %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @time(i32* null)
%4 = tail call i32 @time(i32* null)
%5 = tail call i32 @srand(i32 %4)
%6 = tail call i32 (...) @rand()
%7 = tail call i32 @time(i32* null)
%8 = sub nsw i32 %7, %3
%9 = load i32, i32* @stdout
%10 = tail call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}