#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 */
float _randf();
void bot_color_util_rand_color(float f[4], double alpha, double min_intensity) {
  f[3] = alpha;
again:
  f[0] = _randf();
  f[1] = _randf();
  f[2] = _randf();
  float v = f[0] + f[1] + f[2];
  if (v < min_intensity)
    goto again;
}


x86 assembly (clang, -O0):
<bot_color_util_rand_color>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0xc(%rax)
mov    $0x0,%al
call   1030 <_randf@plt>
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    $0x0,%al
call   1030 <_randf@plt>
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    $0x0,%al
call   1030 <_randf@plt>
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
addss  0x4(%rax),%xmm0
mov    -0x8(%rbp),%rax
addss  0x8(%rax),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    11a3 <bot_color_util_rand_color+0x93>
jmp    1138 <bot_color_util_rand_color+0x28>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bot_color_util_rand_color>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm1,0x8(%rsp)
mov    %rdi,%rbx
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0xc(%rdi)
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <_randf@plt>
movss  %xmm0,(%rbx)
xor    %eax,%eax
call   1030 <_randf@plt>
movss  %xmm0,0x4(%rbx)
xor    %eax,%eax
call   1030 <_randf@plt>
movss  %xmm0,0x8(%rbx)
movss  (%rbx),%xmm1
addss  0x4(%rbx),%xmm1
addss  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
movsd  0x8(%rsp),%xmm1
ucomisd %xmm0,%xmm1
ja     1130 <bot_color_util_rand_color+0x20>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @bot_color_util_rand_color(float* %0, double %1, double %2) {
%4 = alloca float*
%5 = alloca double
%6 = alloca double
%7 = alloca float
store float* %0, float** %4
store double %1, double* %5
store double %2, double* %6
%8 = load double, double* %5
%9 = fptrunc double %8 to float
%10 = load float*, float** %4
%11 = getelementptr inbounds float, float* %10, i64 3
store float %9, float* %11
br label %12
12: ; preds = %37, %3
%13 = call float (...) @_randf()
%14 = load float*, float** %4
%15 = getelementptr inbounds float, float* %14, i64 0
store float %13, float* %15
%16 = call float (...) @_randf()
%17 = load float*, float** %4
%18 = getelementptr inbounds float, float* %17, i64 1
store float %16, float* %18
%19 = call float (...) @_randf()
%20 = load float*, float** %4
%21 = getelementptr inbounds float, float* %20, i64 2
store float %19, float* %21
%22 = load float*, float** %4
%23 = getelementptr inbounds float, float* %22, i64 0
%24 = load float, float* %23
%25 = load float*, float** %4
%26 = getelementptr inbounds float, float* %25, i64 1
%27 = load float, float* %26
%28 = fadd float %24, %27
%29 = load float*, float** %4
%30 = getelementptr inbounds float, float* %29, i64 2
%31 = load float, float* %30
%32 = fadd float %28, %31
store float %32, float* %7
%33 = load float, float* %7
%34 = fpext float %33 to double
%35 = load double, double* %6
%36 = fcmp olt double %34, %35
br i1 %36, label %37, label %38
37: ; preds = %12
br label %12
38: ; preds = %12
ret void
}

LLVM IR (-O2):
define void @bot_color_util_rand_color(float* nocapture %0, double %1, double %2) {
%4 = fptrunc double %1 to float
%5 = getelementptr inbounds float, float* %0, i64 3
store float %4, float* %5
%6 = getelementptr inbounds float, float* %0, i64 1
%7 = getelementptr inbounds float, float* %0, i64 2
br label %8
8: ; preds = %8, %3
%9 = tail call float (...) @_randf()
store float %9, float* %0
%10 = tail call float (...) @_randf()
store float %10, float* %6
%11 = tail call float (...) @_randf()
store float %11, float* %7
%12 = load float, float* %0
%13 = load float, float* %6
%14 = fadd float %12, %13
%15 = fadd float %11, %14
%16 = fpext float %15 to double
%17 = fcmp olt double %16, %2
br i1 %17, label %8, label %18
18: ; preds = %8
ret void
}