#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 get_random(float, float);
double rando();
float get_new_value(float parent_a, float parent_b, float min, float max) {
  if (rando() <= 0.6) {
    if (rando() <= 0.5) {
      return parent_a;
    } else {
      return parent_b;
    }
  } else if (rando() <= 0.6) {
    return get_random(min, max);
  } else {
    return parent_a;
  }
}


x86 assembly (clang, -O0):
<get_new_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  %xmm2,-0x10(%rbp)
movss  %xmm3,-0x14(%rbp)
mov    $0x0,%al
call   1040 <rando@plt>
movaps %xmm0,%xmm1
movsd  0xeb2(%rip),%xmm0
ucomisd %xmm1,%xmm0
jb     1192 <get_new_value+0x72>
mov    $0x0,%al
call   1040 <rando@plt>
movaps %xmm0,%xmm1
movsd  0xe9e(%rip),%xmm0
ucomisd %xmm1,%xmm0
jb     1183 <get_new_value+0x63>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    11d1 <get_new_value+0xb1>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    11d1 <get_new_value+0xb1>
mov    $0x0,%al
call   1040 <rando@plt>
movaps %xmm0,%xmm1
movsd  0xe5c(%rip),%xmm0
ucomisd %xmm1,%xmm0
jb     11c7 <get_new_value+0xa7>
movss  -0x10(%rbp),%xmm0
movss  -0x14(%rbp),%xmm1
call   1030 <get_random@plt>
movss  %xmm0,-0x4(%rbp)
jmp    11d1 <get_new_value+0xb1>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_new_value>:
sub    $0x18,%rsp
movss  %xmm3,0x8(%rsp)
movss  %xmm2,0x4(%rsp)
movss  %xmm1,0xc(%rsp)
movss  %xmm0,(%rsp)
xor    %eax,%eax
call   1040 <rando@plt>
movsd  %xmm0,0x10(%rsp)
xor    %eax,%eax
call   1040 <rando@plt>
movsd  0xea9(%rip),%xmm1
ucomisd 0x10(%rsp),%xmm1
jae    117f <get_new_value+0x5f>
ucomisd %xmm0,%xmm1
movss  (%rsp),%xmm0
jb     1198 <get_new_value+0x78>
movss  0x4(%rsp),%xmm0
movss  0x8(%rsp),%xmm1
add    $0x18,%rsp
jmp    1030 <get_random@plt>
movsd  0xe81(%rip),%xmm1
ucomisd %xmm0,%xmm1
movss  0xc(%rsp),%xmm0
jb     1198 <get_new_value+0x78>
movss  (%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define float @get_new_value(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
store float %0, float* %6
store float %1, float* %7
store float %2, float* %8
store float %3, float* %9
%10 = call double (...) @rando()
%11 = fcmp ole double %10, 6.000000e-01
br i1 %11, label %12, label %19
12: ; preds = %4
%13 = call double (...) @rando()
%14 = fcmp ole double %13, 5.000000e-01
br i1 %14, label %15, label %17
15: ; preds = %12
%16 = load float, float* %6
store float %16, float* %5
br label %28
17: ; preds = %12
%18 = load float, float* %7
store float %18, float* %5
br label %28
19: ; preds = %4
%20 = call double (...) @rando()
%21 = fcmp ole double %20, 6.000000e-01
br i1 %21, label %22, label %26
22: ; preds = %19
%23 = load float, float* %8
%24 = load float, float* %9
%25 = call float @get_random(float %23, float %24)
store float %25, float* %5
br label %28
26: ; preds = %19
%27 = load float, float* %6
store float %27, float* %5
br label %28
28: ; preds = %26, %22, %17, %15
%29 = load float, float* %5
ret float %29
}

LLVM IR (-O2):
define float @get_new_value(float %0, float %1, float %2, float %3) {
%5 = tail call double (...) @rando()
%6 = fcmp ugt double %5, 6.000000e-01
%7 = tail call double (...) @rando()
br i1 %6, label %11, label %8
8: ; preds = %4
%9 = fcmp ugt double %7, 5.000000e-01
%10 = select i1 %9, float %1, float %0
br label %15
11: ; preds = %4
%12 = fcmp ugt double %7, 6.000000e-01
br i1 %12, label %15, label %13
13: ; preds = %11
%14 = tail call float @get_random(float %2, float %3)
br label %15
15: ; preds = %11, %8, %13
%16 = phi float [ %14, %13 ], [ %10, %8 ], [ %0, %11 ]
ret float %16
}