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

/* Variables and functions */
double GetHundredToTenThousand();
double GetRandomDouble();
double GetThousandToHundThousand();
double *malloc(int);
double *CreateImmigrant() {
  double *child = malloc(sizeof(double) * 8);
  child[0] = GetRandomDouble();
  child[1] = GetRandomDouble();
  child[2] = GetHundredToTenThousand();
  child[3] = GetHundredToTenThousand();
  child[4] = GetThousandToHundThousand();
  child[5] = GetThousandToHundThousand();
  child[6] = GetHundredToTenThousand();
  child[7] = GetRandomDouble();
  return child;
}


x86 assembly (clang, -O0):
<CreateImmigrant>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x40,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <GetRandomDouble@plt>
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
mov    $0x0,%al
call   1050 <GetRandomDouble@plt>
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    $0x0,%al
call   1060 <GetHundredToTenThousand@plt>
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x10(%rax)
mov    $0x0,%al
call   1060 <GetHundredToTenThousand@plt>
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x18(%rax)
mov    $0x0,%al
call   1040 <GetThousandToHundThousand@plt>
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x20(%rax)
mov    $0x0,%al
call   1040 <GetThousandToHundThousand@plt>
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x28(%rax)
mov    $0x0,%al
call   1060 <GetHundredToTenThousand@plt>
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x30(%rax)
mov    $0x0,%al
call   1050 <GetRandomDouble@plt>
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x38(%rax)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CreateImmigrant>:
push   %rbx
mov    $0x40,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1050 <GetRandomDouble@plt>
movsd  %xmm0,(%rbx)
xor    %eax,%eax
call   1050 <GetRandomDouble@plt>
movsd  %xmm0,0x8(%rbx)
xor    %eax,%eax
call   1060 <GetHundredToTenThousand@plt>
movsd  %xmm0,0x10(%rbx)
xor    %eax,%eax
call   1060 <GetHundredToTenThousand@plt>
movsd  %xmm0,0x18(%rbx)
xor    %eax,%eax
call   1040 <GetThousandToHundThousand@plt>
movsd  %xmm0,0x20(%rbx)
xor    %eax,%eax
call   1040 <GetThousandToHundThousand@plt>
movsd  %xmm0,0x28(%rbx)
xor    %eax,%eax
call   1060 <GetHundredToTenThousand@plt>
movsd  %xmm0,0x30(%rbx)
xor    %eax,%eax
call   1050 <GetRandomDouble@plt>
movsd  %xmm0,0x38(%rbx)
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define double* @CreateImmigrant() {
%1 = alloca double*
%2 = call double* @malloc(i32 64)
store double* %2, double** %1
%3 = call double (...) @GetRandomDouble()
%4 = load double*, double** %1
%5 = getelementptr inbounds double, double* %4, i64 0
store double %3, double* %5
%6 = call double (...) @GetRandomDouble()
%7 = load double*, double** %1
%8 = getelementptr inbounds double, double* %7, i64 1
store double %6, double* %8
%9 = call double (...) @GetHundredToTenThousand()
%10 = load double*, double** %1
%11 = getelementptr inbounds double, double* %10, i64 2
store double %9, double* %11
%12 = call double (...) @GetHundredToTenThousand()
%13 = load double*, double** %1
%14 = getelementptr inbounds double, double* %13, i64 3
store double %12, double* %14
%15 = call double (...) @GetThousandToHundThousand()
%16 = load double*, double** %1
%17 = getelementptr inbounds double, double* %16, i64 4
store double %15, double* %17
%18 = call double (...) @GetThousandToHundThousand()
%19 = load double*, double** %1
%20 = getelementptr inbounds double, double* %19, i64 5
store double %18, double* %20
%21 = call double (...) @GetHundredToTenThousand()
%22 = load double*, double** %1
%23 = getelementptr inbounds double, double* %22, i64 6
store double %21, double* %23
%24 = call double (...) @GetRandomDouble()
%25 = load double*, double** %1
%26 = getelementptr inbounds double, double* %25, i64 7
store double %24, double* %26
%27 = load double*, double** %1
ret double* %27
}

LLVM IR (-O2):
define noalias double* @CreateImmigrant() {
%1 = tail call double* @malloc(i32 64)
%2 = tail call double (...) @GetRandomDouble()
store double %2, double* %1
%3 = tail call double (...) @GetRandomDouble()
%4 = getelementptr inbounds double, double* %1, i64 1
store double %3, double* %4
%5 = tail call double (...) @GetHundredToTenThousand()
%6 = getelementptr inbounds double, double* %1, i64 2
store double %5, double* %6
%7 = tail call double (...) @GetHundredToTenThousand()
%8 = getelementptr inbounds double, double* %1, i64 3
store double %7, double* %8
%9 = tail call double (...) @GetThousandToHundThousand()
%10 = getelementptr inbounds double, double* %1, i64 4
store double %9, double* %10
%11 = tail call double (...) @GetThousandToHundThousand()
%12 = getelementptr inbounds double, double* %1, i64 5
store double %11, double* %12
%13 = tail call double (...) @GetHundredToTenThousand()
%14 = getelementptr inbounds double, double* %1, i64 6
store double %13, double* %14
%15 = tail call double (...) @GetRandomDouble()
%16 = getelementptr inbounds double, double* %1, i64 7
store double %15, double* %16
ret double* %1
}