#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;
float floorf(float);
scalar_t__ rand();
float randomHundredth(float lowerBound, float upperBound) {
  float x;
  x = (float)rand() / (float)(RAND_MAX / (float)(upperBound - lowerBound));
  x += (float)lowerBound;
  x *= 100.0;
  x = floorf(x);
  x /= 100.0;
  return x;
}


x86 assembly (clang, -O0):
<randomHundredth>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
cvtsi2ss %rax,%xmm0
mov    0x2ea3(%rip),%rax
movss  (%rax),%xmm1
movss  -0x8(%rbp),%xmm2
subss  -0x4(%rbp),%xmm2
divss  %xmm2,%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
addss  -0xc(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe80(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
call   1030 <floorf@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe53(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randomHundredth>:
push   %rax
movss  %xmm1,0x4(%rsp)
movss  %xmm0,(%rsp)
xor    %eax,%eax
call   1040 <rand@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
mov    0x2ea6(%rip),%rax
movss  (%rax),%xmm1
movss  (%rsp),%xmm2
movss  0x4(%rsp),%xmm3
subss  %xmm2,%xmm3
divss  %xmm3,%xmm1
divss  %xmm1,%xmm0
addss  %xmm2,%xmm0
mulss  0xe97(%rip),%xmm0
call   1030 <floorf@plt>
divss  0xe8a(%rip),%xmm0
pop    %rax
ret

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

LLVM IR (-O2):
@RAND_MAX = global float 0.000000e+00
define float @randomHundredth(float %0, float %1) {
%3 = tail call i64 (...) @rand()
%4 = sitofp i64 %3 to float
%5 = load float, float* @RAND_MAX
%6 = fsub float %1, %0
%7 = fdiv float %5, %6
%8 = fdiv float %4, %7
%9 = fadd float %8, %0
%10 = fmul float %9, 1.000000e+02
%11 = tail call float @llvm.floor.f32(float %10)
%12 = fdiv float %11, 1.000000e+02
ret float %12
}