generate_random_hyperplane(array_name, length, max_value) float *array_name,
    max_value;
int length;
{
  int i;
  float myrandom();
  for (i = 1; i <= length; i++)
    array_name[i] = myrandom(-1.0 * max_value, max_value);
}


x86 assembly (clang, -O0):
<generate_random_hyperplane>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
cvtsd2ss %xmm0,%xmm0
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movss  %xmm0,-0x18(%rbp)
movl   $0x1,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     117b <generate_random_hyperplane+0x6b>
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xeb4(%rip),%xmm0
mulsd  %xmm1,%xmm0
movss  -0x18(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mov    $0x2,%al
call   1030 <myrandom@plt>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    112f <generate_random_hyperplane+0x1f>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generate_random_hyperplane>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
test   %esi,%esi
jle    116f <generate_random_hyperplane+0x5f>
mov    %esi,%r15d
mov    %rdi,%r14
cvtsd2ss %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
movaps 0xece(%rip),%xmm1
movaps %xmm0,0x10(%rsp)
xorps  %xmm0,%xmm1
movaps %xmm1,(%rsp)
add    $0x1,%r15d
mov    $0x1,%ebx
nopw   0x0(%rax,%rax,1)
movaps (%rsp),%xmm0
movaps 0x10(%rsp),%xmm1
mov    $0x2,%al
call   1030 <myrandom@plt>
movss  %xmm0,(%r14,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1150 <generate_random_hyperplane+0x40>
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @generate_random_hyperplane(float* %0, i32 %1, double %2) {
%4 = alloca i32
%5 = alloca float*
%6 = alloca i32
%7 = alloca float
%8 = alloca i32
%9 = fptrunc double %2 to float
store float* %0, float** %5
store i32 %1, i32* %6
store float %9, float* %7
store i32 1, i32* %8
br label %10
10: ; preds = %25, %3
%11 = load i32, i32* %8
%12 = load i32, i32* %6
%13 = icmp sle i32 %11, %12
br i1 %13, label %14, label %28
14: ; preds = %10
%15 = load float, float* %7
%16 = fpext float %15 to double
%17 = fmul double -1.000000e+00, %16
%18 = load float, float* %7
%19 = fpext float %18 to double
%20 = call float (double, double, ...) bitcast (float (...)* @myrandom to float (double, double, ...)*)(double %17, double %19)
%21 = load float*, float** %5
%22 = load i32, i32* %8
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds float, float* %21, i64 %23
store float %20, float* %24
br label %25
25: ; preds = %14
%26 = load i32, i32* %8
%27 = add nsw i32 %26, 1
store i32 %27, i32* %8
br label %10
28: ; preds = %10
%29 = load i32, i32* %4
ret i32 %29
}

LLVM IR (-O2):
define i32 @generate_random_hyperplane(float* nocapture writeonly %0, i32 %1, double %2) {
%4 = icmp slt i32 %1, 1
br i1 %4, label %17, label %5
5: ; preds = %3
%6 = fptrunc double %2 to float
%7 = fpext float %6 to double
%8 = fneg double %7
%9 = add nuw i32 %1, 1
%10 = zext i32 %9 to i64
br label %11
11: ; preds = %5, %11
%12 = phi i64 [ 1, %5 ], [ %15, %11 ]
%13 = tail call float (double, double, ...) bitcast (float (...)* @myrandom to float (double, double, ...)*)(double %8, double %7)
%14 = getelementptr inbounds float, float* %0, i64 %12
store float %13, float* %14
%15 = add nuw nsw i64 %12, 1
%16 = icmp eq i64 %15, %10
br i1 %16, label %17, label %11
17: ; preds = %11, %3
ret i32 undef
}