#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 CDec(const char *str, size_t len) {
  unsigned char c;
  float dec, val;
  int dotseen;
  size_t i;
  const float dec2byte[256] = {
      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
      0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
  val = 0.0;
  dec = 10.0;
  dotseen = 0;
  for (i = 0; i < len; i++) {
    if ('.' != (c = (unsigned char)*str++)) {
      if (!dotseen)
        val = val * 10 + dec2byte[c];
      else {
        val += dec2byte[c] / dec;
        dec *= 10.0;
      }
    } else
      dotseen = 1;
  }
  return (val);
}


x86 assembly (clang, -O0):
<CDec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x430,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x430(%rbp),%rdi
lea    0xedf(%rip),%rsi
mov    $0x400,%edx
call   1030 <memcpy@plt>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  0xeb5(%rip),%xmm0
movss  %xmm0,-0x18(%rbp)
movl   $0x0,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1223 <CDec+0x113>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    %al,-0x11(%rbp)
movzbl %al,%ecx
mov    $0x2e,%eax
cmp    %ecx,%eax
je     1206 <CDec+0xf6>
cmpl   $0x0,-0x20(%rbp)
jne    11c7 <CDec+0xb7>
movss  -0x1c(%rbp),%xmm0
movzbl -0x11(%rbp),%eax
movss  -0x430(%rbp,%rax,4),%xmm1
ff ff
movss  0xe4b(%rip),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x1c(%rbp)
jmp    1201 <CDec+0xf1>
movzbl -0x11(%rbp),%eax
movss  -0x430(%rbp,%rax,4),%xmm0
ff ff
divss  -0x18(%rbp),%xmm0
addss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe14(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x18(%rbp)
jmp    120d <CDec+0xfd>
movl   $0x1,-0x20(%rbp)
jmp    1212 <CDec+0x102>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    115f <CDec+0x4f>
movss  -0x1c(%rbp),%xmm0
add    $0x430,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CDec>:
test   %rsi,%rsi
je     1160 <CDec+0x60>
movss  0xef3(%rip),%xmm1
xorps  %xmm0,%xmm0
xor    %eax,%eax
lea    0xef7(%rip),%r8
xor    %edx,%edx
movaps %xmm1,%xmm2
jmp    1138 <CDec+0x38>
divss  %xmm2,%xmm3
addss  %xmm3,%xmm0
mulss  %xmm1,%xmm2
add    $0x1,%rax
mov    %r9d,%edx
cmp    %rax,%rsi
je     115f <CDec+0x5f>
movzbl (%rdi,%rax,1),%ecx
mov    $0x1,%r9d
cmp    $0x2e,%rcx
je     112c <CDec+0x2c>
movss  (%r8,%rcx,4),%xmm3
test   %edx,%edx
jne    1120 <CDec+0x20>
mulss  %xmm1,%xmm0
addss  %xmm3,%xmm0
xor    %r9d,%r9d
jmp    112c <CDec+0x2c>
ret
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
@__const.CDec.dec2byte = <{ [58 x float], [198 x float] }> <{ [58 x float] [float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00, float 8.000000e+00, float 9.000000e+00], [198 x float] zeroinitializer }>
define float @CDec(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8
%6 = alloca float
%7 = alloca float
%8 = alloca i32
%9 = alloca i64
%10 = alloca [256 x float]
store i8* %0, i8** %3
store i64 %1, i64* %4
%11 = bitcast [256 x float]* %10 to i8*
store float 0.000000e+00, float* %7
store float 1.000000e+01, float* %6
store i32 0, i32* %8
store i64 0, i64* %9
br label %12
12: ; preds = %48, %2
%13 = load i64, i64* %9
%14 = load i64, i64* %4
%15 = icmp ult i64 %13, %14
br i1 %15, label %16, label %51
16: ; preds = %12
%17 = load i8*, i8** %3
%18 = getelementptr inbounds i8, i8* %17, i32 1
store i8* %18, i8** %3
%19 = load i8, i8* %17
store i8 %19, i8* %5
%20 = zext i8 %19 to i32
%21 = icmp ne i32 46, %20
br i1 %21, label %22, label %46
22: ; preds = %16
%23 = load i32, i32* %8
%24 = icmp ne i32 %23, 0
br i1 %24, label %32, label %25
25: ; preds = %22
%26 = load float, float* %7
%27 = load i8, i8* %5
%28 = zext i8 %27 to i64
%29 = getelementptr inbounds [256 x float], [256 x float]* %10, i64 0, i64 %28
%30 = load float, float* %29
%31 = call float @llvm.fmuladd.f32(float %26, float 1.000000e+01, float %30)
store float %31, float* %7
br label %45
32: ; preds = %22
%33 = load i8, i8* %5
%34 = zext i8 %33 to i64
%35 = getelementptr inbounds [256 x float], [256 x float]* %10, i64 0, i64 %34
%36 = load float, float* %35
%37 = load float, float* %6
%38 = fdiv float %36, %37
%39 = load float, float* %7
%40 = fadd float %39, %38
store float %40, float* %7
%41 = load float, float* %6
%42 = fpext float %41 to double
%43 = fmul double %42, 1.000000e+01
%44 = fptrunc double %43 to float
store float %44, float* %6
br label %45
45: ; preds = %32, %25
br label %47
46: ; preds = %16
store i32 1, i32* %8
br label %47
47: ; preds = %46, %45
br label %48
48: ; preds = %47
%49 = load i64, i64* %9
%50 = add i64 %49, 1
store i64 %50, i64* %9
br label %12
51: ; preds = %12
%52 = load float, float* %7
ret float %52
}

LLVM IR (-O2):
@__const.CDec.dec2byte = <{ [58 x float], [198 x float] }> <{ [58 x float] [float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00, float 8.000000e+00, float 9.000000e+00], [198 x float] zeroinitializer }>
define float @CDec(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %30, label %4
4: ; preds = %2, %24
%5 = phi i64 [ %28, %24 ], [ 0, %2 ]
%6 = phi i32 [ %27, %24 ], [ 0, %2 ]
%7 = phi float [ %26, %24 ], [ 0.000000e+00, %2 ]
%8 = phi float [ %25, %24 ], [ 1.000000e+01, %2 ]
%9 = phi i8* [ %10, %24 ], [ %0, %2 ]
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 46
br i1 %12, label %24, label %13
13: ; preds = %4
%14 = icmp eq i32 %6, 0
%15 = zext i8 %11 to i64
%16 = getelementptr inbounds [256 x float], [256 x float]* bitcast (<{ [58 x float], [198 x float] }>* @__const.CDec.dec2byte to [256 x float]*), i64 0, i64 %15
%17 = load float, float* %16
br i1 %14, label %18, label %20
18: ; preds = %13
%19 = tail call float @llvm.fmuladd.f32(float %7, float 1.000000e+01, float %17)
br label %24
20: ; preds = %13
%21 = fdiv float %17, %8
%22 = fadd float %7, %21
%23 = fmul float %8, 1.000000e+01
br label %24
24: ; preds = %4, %20, %18
%25 = phi float [ %23, %20 ], [ %8, %18 ], [ %8, %4 ]
%26 = phi float [ %22, %20 ], [ %19, %18 ], [ %7, %4 ]
%27 = phi i32 [ 1, %20 ], [ 0, %18 ], [ 1, %4 ]
%28 = add nuw i64 %5, 1
%29 = icmp eq i64 %28, %1
br i1 %29, label %30, label %4
30: ; preds = %24, %2
%31 = phi float [ 0.000000e+00, %2 ], [ %26, %24 ]
ret float %31
}