Two clamps, one running value
A two-sided clamp squeezes a value between a floor and a ceiling. Two ifs, each testing against a constant and overwriting when the value steps out of line. Since the candidate stays in f1 from start to finish, there's no store or reload between checks — it just rides in the register.
Take clampPct(v), holding a value inside [0, 100]:
lfs f0, ... # load 0.0f
fcmpo cr0, f1, f0 # v < 0 ?
bge- .lo_ok # skip when v >= 0 (inverted test)
fmr f1, f0 # v = 0
.lo_ok:
lfs f0, ... # load 100.0f
fcmpo cr0, f1, f0 # v > 100 ?
blelr- # if v <= 100, return v as-is
fmr f1, f0 # else v = 100
blr
A couple of habits from earlier compares resurface. Each forward branch carries the inverted condition of its if, which is why bge- skips the body of if (v < 0). The branch jumps when the test is false. The final clamp gets a shortcut too: rather than hopping over an fmr, it folds the skip into a conditional return, blelr-. The bounds are the lfs constants. Two loads, two numbers — that's your range.
Same two-clamp skeleton in the target, only the bounds differ. Read each lfs constant and each branch condition to pin down the floor, ceiling, and order.
Your task
Write func_800db020 to reproduce the assembly above. Use two plain if statements that overwrite the value.