int guesstimate_numeric(const unsigned char cp, int pos) {
  if (cp == 'U')
    return -10;
  else if (cp == '[' || cp == ']')
    return -5;
  else if (cp == ' ' || cp == '.' || cp == '-')
    return -2;
  else if (pos < 10)
    return 5;
  else
    return 0;
}


x86 assembly (clang, -O0):
<guesstimate_numeric>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    %esi,-0xc(%rbp)
movzbl -0x5(%rbp),%eax
cmp    $0x55,%eax
jne    1126 <guesstimate_numeric+0x26>
movl   $0xfffffff6,-0x4(%rbp)
jmp    119c <guesstimate_numeric+0x9c>
movzbl -0x5(%rbp),%eax
cmp    $0x5b,%eax
je     1140 <guesstimate_numeric+0x40>
movzbl -0x5(%rbp),%eax
cmp    $0x5d,%eax
jne    114c <guesstimate_numeric+0x4c>
movl   $0xfffffffb,-0x4(%rbp)
jmp    119c <guesstimate_numeric+0x9c>
movzbl -0x5(%rbp),%eax
cmp    $0x20,%eax
je     1173 <guesstimate_numeric+0x73>
movzbl -0x5(%rbp),%eax
cmp    $0x2e,%eax
je     1173 <guesstimate_numeric+0x73>
movzbl -0x5(%rbp),%eax
cmp    $0x2d,%eax
jne    117f <guesstimate_numeric+0x7f>
movl   $0xfffffffe,-0x4(%rbp)
jmp    119c <guesstimate_numeric+0x9c>
cmpl   $0xa,-0xc(%rbp)
jge    1195 <guesstimate_numeric+0x95>
movl   $0x5,-0x4(%rbp)
jmp    119c <guesstimate_numeric+0x9c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<guesstimate_numeric>:
lea    -0x2d(%rdi),%ecx
cmp    $0x30,%cl
ja     1126 <guesstimate_numeric+0x26>
mov    $0xfffffff6,%eax
movzbl %cl,%ecx
lea    0xee9(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
mov    $0xfffffffb,%eax
ret
cmp    $0x20,%dil
jne    1132 <guesstimate_numeric+0x32>
mov    $0xfffffffe,%eax
ret
xor    %eax,%eax
cmp    $0xa,%esi
setl   %al
lea    (%rax,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @guesstimate_numeric(i8 zeroext %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8
%5 = alloca i32
store i8 %0, i8* %4
store i32 %1, i32* %5
%6 = load i8, i8* %4
%7 = zext i8 %6 to i32
%8 = icmp eq i32 %7, 85
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 -10, i32* %3
br label %37
10: ; preds = %2
%11 = load i8, i8* %4
%12 = zext i8 %11 to i32
%13 = icmp eq i32 %12, 91
br i1 %13, label %18, label %14
14: ; preds = %10
%15 = load i8, i8* %4
%16 = zext i8 %15 to i32
%17 = icmp eq i32 %16, 93
br i1 %17, label %18, label %19
18: ; preds = %14, %10
store i32 -5, i32* %3
br label %37
19: ; preds = %14
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = icmp eq i32 %21, 32
br i1 %22, label %31, label %23
23: ; preds = %19
%24 = load i8, i8* %4
%25 = zext i8 %24 to i32
%26 = icmp eq i32 %25, 46
br i1 %26, label %31, label %27
27: ; preds = %23
%28 = load i8, i8* %4
%29 = zext i8 %28 to i32
%30 = icmp eq i32 %29, 45
br i1 %30, label %31, label %32
31: ; preds = %27, %23, %19
store i32 -2, i32* %3
br label %37
32: ; preds = %27
%33 = load i32, i32* %5
%34 = icmp slt i32 %33, 10
br i1 %34, label %35, label %36
35: ; preds = %32
store i32 5, i32* %3
br label %37
36: ; preds = %32
store i32 0, i32* %3
br label %37
37: ; preds = %36, %35, %31, %18, %9
%38 = load i32, i32* %3
ret i32 %38
}

LLVM IR (-O2):
define i32 @guesstimate_numeric(i8 zeroext %0, i32 %1) {
switch i8 %0, label %3 [
i8 85, label %8
i8 93, label %6
i8 91, label %6
i8 46, label %7
i8 45, label %7
i8 32, label %7
]
3: ; preds = %2
%4 = icmp slt i32 %1, 10
%5 = select i1 %4, i32 5, i32 0
br label %8
6: ; preds = %2, %2
br label %8
7: ; preds = %2, %2, %2
br label %8
8: ; preds = %2, %7, %6, %3
%9 = phi i32 [ -10, %2 ], [ %5, %3 ], [ -5, %6 ], [ -2, %7 ]
ret i32 %9
}