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

/* Variables and functions */
scalar_t__ RAND_MAX;
int getpid();
int /*<<< orphan*/ printf(char *, char *, char *, int, double, double);
int rand();
int /*<<< orphan*/ srand(int);
int time(int /*<<< orphan*/);
int main(void) {
  char *names[] = {"hat", "pan", "eks", "wye", "zee"};
  int num_names = sizeof(names) / sizeof(names[0]);
  srand(time(0) ^ getpid());
  for (int i = 0;; i++) {
    int ai = rand() % num_names;
    int bi = rand() % num_names;
    char *a = names[ai];
    char *b = names[bi];
    double x = (double)rand() / (double)RAND_MAX;
    double y = (double)rand() / (double)RAND_MAX;
    printf("a=%s,b=%s,i=%d,x=%.18lf,y=%.18lf\n", a, b, i, x, y);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1050 <memset@plt>
lea    0xe7a(%rip),%rax
mov    %rax,-0x30(%rbp)
lea    0xe73(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    0xe6c(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    0xe65(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xe5e(%rip),%rax
mov    %rax,-0x10(%rbp)
movl   $0x5,-0x34(%rbp)
xor    %edi,%edi
call   1070 <time@plt>
mov    %eax,-0x64(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    -0x64(%rbp),%edi
xor    %eax,%edi
call   1060 <srand@plt>
movl   $0x0,-0x38(%rbp)
mov    $0x0,%al
call   1080 <rand@plt>
cltd
idivl  -0x34(%rbp)
mov    %edx,-0x3c(%rbp)
mov    $0x0,%al
call   1080 <rand@plt>
cltd
idivl  -0x34(%rbp)
mov    %edx,-0x40(%rbp)
movslq -0x3c(%rbp),%rax
mov    -0x30(%rbp,%rax,8),%rax
mov    %rax,-0x48(%rbp)
movslq -0x40(%rbp),%rax
mov    -0x30(%rbp,%rax,8),%rax
mov    %rax,-0x50(%rbp)
mov    $0x0,%al
call   1080 <rand@plt>
cvtsi2sd %eax,%xmm0
mov    0x2dc1(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    $0x0,%al
call   1080 <rand@plt>
cvtsi2sd %eax,%xmm0
mov    0x2da1(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x48(%rbp),%rsi
mov    -0x50(%rbp),%rdx
mov    -0x38(%rbp),%ecx
movsd  -0x58(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm1
lea    0xda3(%rip),%rdi
call   1040 <printf@plt>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    11df <main+0x7f>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x40,%rsp
lea    0xe9d(%rip),%rax
mov    %rax,0x10(%rsp)
lea    0xe95(%rip),%rax
mov    %rax,0x18(%rsp)
lea    0xe8d(%rip),%rax
mov    %rax,0x20(%rsp)
lea    0xe85(%rip),%rax
mov    %rax,0x28(%rsp)
lea    0xe7d(%rip),%rax
mov    %rax,0x30(%rsp)
xor    %edi,%edi
call   1060 <time@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <getpid@plt>
xor    %eax,%ebx
mov    %ebx,%edi
call   1050 <srand@plt>
mov    0x2e30(%rip),%r12
lea    0xe55(%rip),%r14
xor    %r15d,%r15d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1070 <rand@plt>
movslq %eax,%rbx
imul   $0x66666667,%rbx,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x21,%rax
add    %ecx,%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%ebx
xor    %eax,%eax
call   1070 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x21,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
movslq %ebx,%rcx
mov    0x10(%rsp,%rcx,8),%rbx
cltq
mov    0x10(%rsp,%rax,8),%rbp
xor    %eax,%eax
call   1070 <rand@plt>
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
xorps  %xmm0,%xmm0
cvtsi2sdq (%r12),%xmm0
divsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
xor    %eax,%eax
call   1070 <rand@plt>
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
xorps  %xmm0,%xmm0
cvtsi2sdq (%r12),%xmm0
divsd  %xmm0,%xmm1
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %rbp,%rdx
mov    %r15d,%ecx
movsd  0x8(%rsp),%xmm0
call   1040 <printf@plt>
add    $0x1,%r15d
jmp    11d0 <main+0x80>

LLVM IR (-O0):
@.str = [4 x i8] c"hat\00"
@.str.1 = [4 x i8] c"pan\00"
@.str.2 = [4 x i8] c"eks\00"
@.str.3 = [4 x i8] c"wye\00"
@.str.4 = [4 x i8] c"zee\00"
@RAND_MAX = global i64 0
@.str.5 = [34 x i8] c"a=%s,b=%s,i=%d,x=%.18lf,y=%.18lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i8*]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca double
%10 = alloca double
store i32 0, i32* %1
%11 = bitcast [5 x i8*]* %2 to i8*
%12 = bitcast i8* %11 to [5 x i8*]*
%13 = getelementptr inbounds [5 x i8*], [5 x i8*]* %12, i32 0, i32 0
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i8** %13
%14 = getelementptr inbounds [5 x i8*], [5 x i8*]* %12, i32 0, i32 1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i32 0, i32 0), i8** %14
%15 = getelementptr inbounds [5 x i8*], [5 x i8*]* %12, i32 0, i32 2
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i32 0, i32 0), i8** %15
%16 = getelementptr inbounds [5 x i8*], [5 x i8*]* %12, i32 0, i32 3
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i32 0, i32 0), i8** %16
%17 = getelementptr inbounds [5 x i8*], [5 x i8*]* %12, i32 0, i32 4
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i32 0, i32 0), i8** %17
store i32 5, i32* %3
%18 = call i32 @time(i32 0)
%19 = call i32 (...) @getpid()
%20 = xor i32 %18, %19
%21 = call i32 @srand(i32 %20)
store i32 0, i32* %4
br label %22
22: ; preds = %53, %0
%23 = call i32 (...) @rand()
%24 = load i32, i32* %3
%25 = srem i32 %23, %24
store i32 %25, i32* %5
%26 = call i32 (...) @rand()
%27 = load i32, i32* %3
%28 = srem i32 %26, %27
store i32 %28, i32* %6
%29 = load i32, i32* %5
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [5 x i8*], [5 x i8*]* %2, i64 0, i64 %30
%32 = load i8*, i8** %31
store i8* %32, i8** %7
%33 = load i32, i32* %6
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [5 x i8*], [5 x i8*]* %2, i64 0, i64 %34
%36 = load i8*, i8** %35
store i8* %36, i8** %8
%37 = call i32 (...) @rand()
%38 = sitofp i32 %37 to double
%39 = load i64, i64* @RAND_MAX
%40 = sitofp i64 %39 to double
%41 = fdiv double %38, %40
store double %41, double* %9
%42 = call i32 (...) @rand()
%43 = sitofp i32 %42 to double
%44 = load i64, i64* @RAND_MAX
%45 = sitofp i64 %44 to double
%46 = fdiv double %43, %45
store double %46, double* %10
%47 = load i8*, i8** %7
%48 = load i8*, i8** %8
%49 = load i32, i32* %4
%50 = load double, double* %9
%51 = load double, double* %10
%52 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.5, i64 0, i64 0), i8* %47, i8* %48, i32 %49, double %50, double %51)
br label %53
53: ; preds = %22
%54 = load i32, i32* %4
%55 = add nsw i32 %54, 1
store i32 %55, i32* %4
br label %22
}

LLVM IR (-O2):
@.str = [4 x i8] c"hat\00"
@.str.1 = [4 x i8] c"pan\00"
@.str.2 = [4 x i8] c"eks\00"
@.str.3 = [4 x i8] c"wye\00"
@.str.4 = [4 x i8] c"zee\00"
@RAND_MAX = global i64 0
@.str.5 = [34 x i8] c"a=%s,b=%s,i=%d,x=%.18lf,y=%.18lf\0A\00"
define i32 @main() {
%1 = alloca [5 x i8*]
%2 = bitcast [5 x i8*]* %1 to i8*
%3 = getelementptr inbounds [5 x i8*], [5 x i8*]* %1, i64 0, i64 0
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = getelementptr inbounds [5 x i8*], [5 x i8*]* %1, i64 0, i64 1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8** %4
%5 = getelementptr inbounds [5 x i8*], [5 x i8*]* %1, i64 0, i64 2
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8** %5
%6 = getelementptr inbounds [5 x i8*], [5 x i8*]* %1, i64 0, i64 3
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8** %6
%7 = getelementptr inbounds [5 x i8*], [5 x i8*]* %1, i64 0, i64 4
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8** %7
%8 = tail call i32 @time(i32 0)
%9 = tail call i32 (...) @getpid()
%10 = xor i32 %9, %8
%11 = tail call i32 @srand(i32 %10)
br label %12
12: ; preds = %12, %0
%13 = phi i32 [ 0, %0 ], [ %35, %12 ]
%14 = tail call i32 (...) @rand()
%15 = srem i32 %14, 5
%16 = tail call i32 (...) @rand()
%17 = srem i32 %16, 5
%18 = sext i32 %15 to i64
%19 = getelementptr inbounds [5 x i8*], [5 x i8*]* %1, i64 0, i64 %18
%20 = load i8*, i8** %19
%21 = sext i32 %17 to i64
%22 = getelementptr inbounds [5 x i8*], [5 x i8*]* %1, i64 0, i64 %21
%23 = load i8*, i8** %22
%24 = tail call i32 (...) @rand()
%25 = sitofp i32 %24 to double
%26 = load i64, i64* @RAND_MAX
%27 = sitofp i64 %26 to double
%28 = fdiv double %25, %27
%29 = tail call i32 (...) @rand()
%30 = sitofp i32 %29 to double
%31 = load i64, i64* @RAND_MAX
%32 = sitofp i64 %31 to double
%33 = fdiv double %30, %32
%34 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.5, i64 0, i64 0), i8* %20, i8* %23, i32 %13, double %28, double %33)
%35 = add nuw nsw i32 %13, 1
br label %12
}