unsigned short LGS9X_AnalyseStrength(unsigned char reg_B1) {
  unsigned short scale = 0;
  if (reg_B1 <= 0xFF)
    scale = 100;
  else if (reg_B1 <= 0xFF)
    scale = 90;
  else if (reg_B1 <= 0xFF)
    scale = 80;
  else if (reg_B1 <= 0xFF)
    scale = 70;
  else if (reg_B1 <= 0xFF)
    scale = 60;
  else if (reg_B1 <= 0xFF)
    scale = 50;
  else if (reg_B1 <= 0xFF)
    scale = 40;
  else if (reg_B1 <= 0xFF)
    scale = 30;
  else if (reg_B1 <= 0xFF)
    scale = 20;
  else if (reg_B1 <= 0xFF)
    scale = 10;
  else
    scale = 0;
  return scale;
}


x86 assembly (clang, -O0):
<LGS9X_AnalyseStrength>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movw   $0x0,-0x4(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0xff,%eax
jg     112a <LGS9X_AnalyseStrength+0x2a>
movw   $0x64,-0x4(%rbp)
jmp    1247 <LGS9X_AnalyseStrength+0x147>
movzbl -0x1(%rbp),%eax
cmp    $0xff,%eax
jg     1144 <LGS9X_AnalyseStrength+0x44>
movw   $0x5a,-0x4(%rbp)
jmp    1242 <LGS9X_AnalyseStrength+0x142>
movzbl -0x1(%rbp),%eax
cmp    $0xff,%eax
jg     115e <LGS9X_AnalyseStrength+0x5e>
movw   $0x50,-0x4(%rbp)
jmp    123d <LGS9X_AnalyseStrength+0x13d>
movzbl -0x1(%rbp),%eax
cmp    $0xff,%eax
jg     1178 <LGS9X_AnalyseStrength+0x78>
movw   $0x46,-0x4(%rbp)
jmp    1238 <LGS9X_AnalyseStrength+0x138>
movzbl -0x1(%rbp),%eax
cmp    $0xff,%eax
jg     1192 <LGS9X_AnalyseStrength+0x92>
movw   $0x3c,-0x4(%rbp)
jmp    1233 <LGS9X_AnalyseStrength+0x133>
movzbl -0x1(%rbp),%eax
cmp    $0xff,%eax
jg     11ac <LGS9X_AnalyseStrength+0xac>
movw   $0x32,-0x4(%rbp)
jmp    122e <LGS9X_AnalyseStrength+0x12e>
movzbl -0x1(%rbp),%eax
cmp    $0xff,%eax
jg     11c6 <LGS9X_AnalyseStrength+0xc6>
movw   $0x28,-0x4(%rbp)
jmp    1229 <LGS9X_AnalyseStrength+0x129>
movzbl -0x1(%rbp),%eax
cmp    $0xff,%eax
jg     11e0 <LGS9X_AnalyseStrength+0xe0>
movw   $0x1e,-0x4(%rbp)
jmp    1224 <LGS9X_AnalyseStrength+0x124>
movzbl -0x1(%rbp),%eax
cmp    $0xff,%eax
jg     11fa <LGS9X_AnalyseStrength+0xfa>
movw   $0x14,-0x4(%rbp)
jmp    121f <LGS9X_AnalyseStrength+0x11f>
movzbl -0x1(%rbp),%eax
cmp    $0xff,%eax
jg     1214 <LGS9X_AnalyseStrength+0x114>
movw   $0xa,-0x4(%rbp)
jmp    121a <LGS9X_AnalyseStrength+0x11a>
movw   $0x0,-0x4(%rbp)
jmp    121f <LGS9X_AnalyseStrength+0x11f>
jmp    1224 <LGS9X_AnalyseStrength+0x124>
jmp    1229 <LGS9X_AnalyseStrength+0x129>
jmp    122e <LGS9X_AnalyseStrength+0x12e>
jmp    1233 <LGS9X_AnalyseStrength+0x133>
jmp    1238 <LGS9X_AnalyseStrength+0x138>
jmp    123d <LGS9X_AnalyseStrength+0x13d>
jmp    1242 <LGS9X_AnalyseStrength+0x142>
jmp    1247 <LGS9X_AnalyseStrength+0x147>
movzwl -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<LGS9X_AnalyseStrength>:
mov    $0x64,%ax
ret

LLVM IR (-O0):
define zeroext i16 @LGS9X_AnalyseStrength(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i16
store i8 %0, i8* %2
store i16 0, i16* %3
%4 = load i8, i8* %2
%5 = zext i8 %4 to i32
%6 = icmp sle i32 %5, 255
br i1 %6, label %7, label %8
7: ; preds = %1
store i16 100, i16* %3
br label %63
8: ; preds = %1
%9 = load i8, i8* %2
%10 = zext i8 %9 to i32
%11 = icmp sle i32 %10, 255
br i1 %11, label %12, label %13
12: ; preds = %8
store i16 90, i16* %3
br label %62
13: ; preds = %8
%14 = load i8, i8* %2
%15 = zext i8 %14 to i32
%16 = icmp sle i32 %15, 255
br i1 %16, label %17, label %18
17: ; preds = %13
store i16 80, i16* %3
br label %61
18: ; preds = %13
%19 = load i8, i8* %2
%20 = zext i8 %19 to i32
%21 = icmp sle i32 %20, 255
br i1 %21, label %22, label %23
22: ; preds = %18
store i16 70, i16* %3
br label %60
23: ; preds = %18
%24 = load i8, i8* %2
%25 = zext i8 %24 to i32
%26 = icmp sle i32 %25, 255
br i1 %26, label %27, label %28
27: ; preds = %23
store i16 60, i16* %3
br label %59
28: ; preds = %23
%29 = load i8, i8* %2
%30 = zext i8 %29 to i32
%31 = icmp sle i32 %30, 255
br i1 %31, label %32, label %33
32: ; preds = %28
store i16 50, i16* %3
br label %58
33: ; preds = %28
%34 = load i8, i8* %2
%35 = zext i8 %34 to i32
%36 = icmp sle i32 %35, 255
br i1 %36, label %37, label %38
37: ; preds = %33
store i16 40, i16* %3
br label %57
38: ; preds = %33
%39 = load i8, i8* %2
%40 = zext i8 %39 to i32
%41 = icmp sle i32 %40, 255
br i1 %41, label %42, label %43
42: ; preds = %38
store i16 30, i16* %3
br label %56
43: ; preds = %38
%44 = load i8, i8* %2
%45 = zext i8 %44 to i32
%46 = icmp sle i32 %45, 255
br i1 %46, label %47, label %48
47: ; preds = %43
store i16 20, i16* %3
br label %55
48: ; preds = %43
%49 = load i8, i8* %2
%50 = zext i8 %49 to i32
%51 = icmp sle i32 %50, 255
br i1 %51, label %52, label %53
52: ; preds = %48
store i16 10, i16* %3
br label %54
53: ; preds = %48
store i16 0, i16* %3
br label %54
54: ; preds = %53, %52
br label %55
55: ; preds = %54, %47
br label %56
56: ; preds = %55, %42
br label %57
57: ; preds = %56, %37
br label %58
58: ; preds = %57, %32
br label %59
59: ; preds = %58, %27
br label %60
60: ; preds = %59, %22
br label %61
61: ; preds = %60, %17
br label %62
62: ; preds = %61, %12
br label %63
63: ; preds = %62, %7
%64 = load i16, i16* %3
ret i16 %64
}

LLVM IR (-O2):
define zeroext i16 @LGS9X_AnalyseStrength(i8 zeroext %0) {
ret i16 100
}