#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 */
struct timeval {
  unsigned int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ colcomp_test_bool();
int /*<<< orphan*/ colcomp_test_double();
int /*<<< orphan*/ colcomp_test_float();
int /*<<< orphan*/ colcomp_test_int16();
int /*<<< orphan*/ colcomp_test_int32();
int /*<<< orphan*/ colcomp_test_int64();
int /*<<< orphan*/ colcomp_test_int8();
int /*<<< orphan*/ colcomp_test_string();
int /*<<< orphan*/ colcomp_test_uint16();
int /*<<< orphan*/ colcomp_test_uint32();
int /*<<< orphan*/ colcomp_test_uint64();
int /*<<< orphan*/ colcomp_test_uint8();
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ srand(unsigned int);
unsigned int strtoul(char *, int /*<<< orphan*/ *, int /*<<< orphan*/);
int main(int nb_args, char **args) {
  struct timeval tv;
  (void)gettimeofday(&tv, NULL);
  unsigned seed = tv.tv_usec;
  if (nb_args >= 2)
    seed = strtoul(args[1], NULL, 0);
  printf("random seed: %u\n", seed);
  srand(seed);
  colcomp_test_int8();
  colcomp_test_int16();
  colcomp_test_int32();
  colcomp_test_int64();
  colcomp_test_uint8();
  colcomp_test_uint16();
  colcomp_test_uint32();
  colcomp_test_uint64();
  colcomp_test_float();
  colcomp_test_double();
  colcomp_test_bool();
  colcomp_test_string();
  printf("colcomp_test Ok\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1080 <gettimeofday@plt>
mov    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x2,-0x8(%rbp)
jl     1249 <main+0x49>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1110 <strtoul@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xdad(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x1c(%rbp),%edi
call   10b0 <srand@plt>
mov    $0x0,%al
call   1120 <colcomp_test_int8@plt>
mov    $0x0,%al
call   10e0 <colcomp_test_int16@plt>
mov    $0x0,%al
call   1040 <colcomp_test_int32@plt>
mov    $0x0,%al
call   1100 <colcomp_test_int64@plt>
mov    $0x0,%al
call   10f0 <colcomp_test_uint8@plt>
mov    $0x0,%al
call   10d0 <colcomp_test_uint16@plt>
mov    $0x0,%al
call   10a0 <colcomp_test_uint32@plt>
mov    $0x0,%al
call   1060 <colcomp_test_uint64@plt>
mov    $0x0,%al
call   1090 <colcomp_test_float@plt>
mov    $0x0,%al
call   1030 <colcomp_test_double@plt>
mov    $0x0,%al
call   1050 <colcomp_test_bool@plt>
mov    $0x0,%al
call   10c0 <colcomp_test_string@plt>
lea    0xd54(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsp,%rdi
xor    %esi,%esi
call   1090 <gettimeofday@plt>
cmp    $0x2,%ebp
jl     1238 <main+0x28>
mov    0x8(%rbx),%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1120 <strtoul@plt>
mov    %eax,%ebx
jmp    123b <main+0x2b>
mov    (%rsp),%ebx
lea    0xdbe(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1080 <printf@plt>
mov    %ebx,%edi
call   10c0 <srand@plt>
xor    %eax,%eax
call   1130 <colcomp_test_int8@plt>
xor    %eax,%eax
call   10f0 <colcomp_test_int16@plt>
xor    %eax,%eax
call   1040 <colcomp_test_int32@plt>
xor    %eax,%eax
call   1110 <colcomp_test_int64@plt>
xor    %eax,%eax
call   1100 <colcomp_test_uint8@plt>
xor    %eax,%eax
call   10e0 <colcomp_test_uint16@plt>
xor    %eax,%eax
call   10b0 <colcomp_test_uint32@plt>
xor    %eax,%eax
call   1070 <colcomp_test_uint64@plt>
xor    %eax,%eax
call   10a0 <colcomp_test_float@plt>
xor    %eax,%eax
call   1030 <colcomp_test_double@plt>
xor    %eax,%eax
call   1060 <colcomp_test_bool@plt>
xor    %eax,%eax
call   10d0 <colcomp_test_string@plt>
lea    0xd64(%rip),%rdi
call   1050 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
@.str = [17 x i8] c"random seed: %u\0A\00"
@.str.1 = [17 x i8] c"colcomp_test Ok\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.timeval
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 @gettimeofday(%struct.timeval* %6, i32* null)
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i32 0, i32 0
%10 = load i32, i32* %9
store i32 %10, i32* %7
%11 = load i32, i32* %4
%12 = icmp sge i32 %11, 2
br i1 %12, label %13, label %18
13: ; preds = %2
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = call i32 @strtoul(i8* %16, i32* null, i32 0)
store i32 %17, i32* %7
br label %18
18: ; preds = %13, %2
%19 = load i32, i32* %7
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %19)
%21 = load i32, i32* %7
%22 = call i32 @srand(i32 %21)
%23 = call i32 (...) @colcomp_test_int8()
%24 = call i32 (...) @colcomp_test_int16()
%25 = call i32 (...) @colcomp_test_int32()
%26 = call i32 (...) @colcomp_test_int64()
%27 = call i32 (...) @colcomp_test_uint8()
%28 = call i32 (...) @colcomp_test_uint16()
%29 = call i32 (...) @colcomp_test_uint32()
%30 = call i32 (...) @colcomp_test_uint64()
%31 = call i32 (...) @colcomp_test_float()
%32 = call i32 (...) @colcomp_test_double()
%33 = call i32 (...) @colcomp_test_bool()
%34 = call i32 (...) @colcomp_test_string()
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%36 = load i32, i32* %3
ret i32 %36
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
@.str = [17 x i8] c"random seed: %u\0A\00"
@str = [16 x i8] c"colcomp_test Ok\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.timeval
%4 = bitcast %struct.timeval* %3 to i8*
%5 = call i32 @gettimeofday(%struct.timeval* %3, i32* null)
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i64 0, i32 0
%7 = load i32, i32* %6
%8 = icmp sgt i32 %0, 1
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = load i8*, i8** %10
%12 = tail call i32 @strtoul(i8* nocapture %11, i32* null, i32 0)
br label %13
13: ; preds = %9, %2
%14 = phi i32 [ %12, %9 ], [ %7, %2 ]
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %14)
%16 = tail call i32 @srand(i32 %14)
%17 = tail call i32 (...) @colcomp_test_int8()
%18 = tail call i32 (...) @colcomp_test_int16()
%19 = tail call i32 (...) @colcomp_test_int32()
%20 = tail call i32 (...) @colcomp_test_int64()
%21 = tail call i32 (...) @colcomp_test_uint8()
%22 = tail call i32 (...) @colcomp_test_uint16()
%23 = tail call i32 (...) @colcomp_test_uint32()
%24 = tail call i32 (...) @colcomp_test_uint64()
%25 = tail call i32 (...) @colcomp_test_float()
%26 = tail call i32 (...) @colcomp_test_double()
%27 = tail call i32 (...) @colcomp_test_bool()
%28 = tail call i32 (...) @colcomp_test_string()
%29 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret i32 0
}