#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 */
int floorf(int);
float powf(int, int);
float compute_precision_for_length(int length) {
  if (length <= (int)10u) {
    return powf(20, floorf((length / -2) + 2));
  }
  return powf(20, -3) / powf(5, length - (int)10u);
}


x86 assembly (clang, -O0):
<compute_precision_for_length>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jg     1160 <compute_precision_for_length+0x40>
mov    -0x8(%rbp),%eax
mov    $0xfffffffe,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
add    $0x2,%edi
call   1040 <floorf@plt>
mov    %eax,%esi
mov    $0x14,%edi
call   1030 <powf@plt>
movss  %xmm0,-0x4(%rbp)
jmp    1195 <compute_precision_for_length+0x75>
mov    $0x14,%edi
mov    $0xfffffffd,%esi
call   1030 <powf@plt>
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%esi
sub    $0xa,%esi
mov    $0x5,%edi
call   1030 <powf@plt>
movaps %xmm0,%xmm1
movss  -0xc(%rbp),%xmm0
divss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compute_precision_for_length>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
cmp    $0xa,%edi
jg     1152 <compute_precision_for_length+0x32>
mov    %ebx,%eax
shr    $0x1f,%eax
add    %ebx,%eax
sar    %eax
mov    $0x2,%edi
sub    %eax,%edi
call   1040 <floorf@plt>
mov    $0x14,%edi
mov    %eax,%esi
add    $0x10,%rsp
pop    %rbx
jmp    1030 <powf@plt>
mov    $0x14,%edi
mov    $0xfffffffd,%esi
call   1030 <powf@plt>
movss  %xmm0,0xc(%rsp)
add    $0xfffffff6,%ebx
mov    $0x5,%edi
mov    %ebx,%esi
call   1030 <powf@plt>
movss  0xc(%rsp),%xmm1
divss  %xmm0,%xmm1
movaps %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define float @compute_precision_for_length(i32 %0) {
%2 = alloca float
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sle i32 %4, 10
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i32, i32* %3
%8 = sdiv i32 %7, -2
%9 = add nsw i32 %8, 2
%10 = call i32 @floorf(i32 %9)
%11 = call float @powf(i32 20, i32 %10)
store float %11, float* %2
br label %18
12: ; preds = %1
%13 = call float @powf(i32 20, i32 -3)
%14 = load i32, i32* %3
%15 = sub nsw i32 %14, 10
%16 = call float @powf(i32 5, i32 %15)
%17 = fdiv float %13, %16
store float %17, float* %2
br label %18
18: ; preds = %12, %6
%19 = load float, float* %2
ret float %19
}

LLVM IR (-O2):
define float @compute_precision_for_length(i32 %0) {
%2 = icmp slt i32 %0, 11
br i1 %2, label %3, label %8
3: ; preds = %1
%4 = sdiv i32 %0, -2
%5 = add nsw i32 %4, 2
%6 = tail call i32 @floorf(i32 %5)
%7 = tail call float @powf(i32 20, i32 %6)
br label %13
8: ; preds = %1
%9 = tail call float @powf(i32 20, i32 -3)
%10 = add nsw i32 %0, -10
%11 = tail call float @powf(i32 5, i32 %10)
%12 = fdiv float %9, %11
br label %13
13: ; preds = %8, %3
%14 = phi float [ %7, %3 ], [ %12, %8 ]
ret float %14
}