#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 RAND_MAX;
scalar_t__ rand();
float make_noise(float rr2, float rr1) {
  float new_rr;
  float delta;
  float rrint;
  delta = ((float)rand() / RAND_MAX);
  delta = ((delta * (128 - (2.0 / 128))) + (1.0 / 128)) / 128;
  rrint = rr2 - rr1;
  rrint = delta * rrint;
  new_rr = rr1 + rrint;
  return (new_rr);
}


x86 assembly (clang, -O0):
<make_noise>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2ss %rax,%xmm0
mov    0x2eb3(%rip),%rax
divss  (%rax),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeb9(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeb5(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0xe99(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x10(%rbp),%xmm0
mulss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x8(%rbp),%xmm0
addss  -0x14(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_noise>:
push   %rax
movss  %xmm1,0x4(%rsp)
movss  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
mov    0x2eb6(%rip),%rax
divss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xebe(%rip),%xmm0
movsd  0xebe(%rip),%xmm1
addsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm2
movss  0x4(%rsp),%xmm1
movss  (%rsp),%xmm0
subss  %xmm1,%xmm0
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global float 0.000000e+00
define float @make_noise(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store float %0, float* %3
store float %1, float* %4
%8 = call i64 (...) @rand()
%9 = sitofp i64 %8 to float
%10 = load float, float* @RAND_MAX
%11 = fdiv float %9, %10
store float %11, float* %6
%12 = load float, float* %6
%13 = fpext float %12 to double
%14 = call double @llvm.fmuladd.f64(double %13, double 0x405FFF0000000000, double 7.812500e-03)
%15 = fdiv double %14, 1.280000e+02
%16 = fptrunc double %15 to float
store float %16, float* %6
%17 = load float, float* %3
%18 = load float, float* %4
%19 = fsub float %17, %18
store float %19, float* %7
%20 = load float, float* %6
%21 = load float, float* %7
%22 = fmul float %20, %21
store float %22, float* %7
%23 = load float, float* %4
%24 = load float, float* %7
%25 = fadd float %23, %24
store float %25, float* %5
%26 = load float, float* %5
ret float %26
}

LLVM IR (-O2):
@RAND_MAX = global float 0.000000e+00
define float @make_noise(float %0, float %1) {
%3 = tail call i64 (...) @rand()
%4 = sitofp i64 %3 to float
%5 = load float, float* @RAND_MAX
%6 = fdiv float %4, %5
%7 = fpext float %6 to double
%8 = tail call double @llvm.fmuladd.f64(double %7, double 0x405FFF0000000000, double 7.812500e-03)
%9 = fmul double %8, 7.812500e-03
%10 = fptrunc double %9 to float
%11 = fsub float %0, %1
%12 = fmul float %11, %10
%13 = fadd float %12, %1
ret float %13
}