int Ten90DecodeMovementField(int movement) {
  int gspeed;
  if (0 == movement || 125 == movement || 126 == movement || 127 == movement) {
    return -1;
  }
  if (movement > 123)
    gspeed = 199;
  else if (movement > 108)
    gspeed = ((movement - 108) * 5) + 100;
  else if (movement > 93)
    gspeed = ((movement - 93) * 2) + 70;
  else if (movement > 38)
    gspeed = ((movement - 38)) + 15;
  else if (movement > 12)
    gspeed = ((movement - 11) >> 1) + 2;
  else if (movement > 8)
    gspeed = ((movement - 6) >> 2) + 1;
  else
    gspeed = 0;
  return (gspeed);
}


x86 assembly (clang, -O0):
<Ten90DecodeMovementField>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%eax
je     113c <Ten90DecodeMovementField+0x3c>
mov    $0x7d,%eax
cmp    -0x8(%rbp),%eax
je     113c <Ten90DecodeMovementField+0x3c>
mov    $0x7e,%eax
cmp    -0x8(%rbp),%eax
je     113c <Ten90DecodeMovementField+0x3c>
mov    $0x7f,%eax
cmp    -0x8(%rbp),%eax
jne    1148 <Ten90DecodeMovementField+0x48>
movl   $0xffffffff,-0x4(%rbp)
jmp    1217 <Ten90DecodeMovementField+0x117>
cmpl   $0x7b,-0x8(%rbp)
jle    115e <Ten90DecodeMovementField+0x5e>
movl   $0xc7,-0xc(%rbp)
jmp    1211 <Ten90DecodeMovementField+0x111>
cmpl   $0x6c,-0x8(%rbp)
jle    117c <Ten90DecodeMovementField+0x7c>
mov    -0x8(%rbp),%eax
sub    $0x6c,%eax
imul   $0x5,%eax,%eax
add    $0x64,%eax
mov    %eax,-0xc(%rbp)
jmp    120c <Ten90DecodeMovementField+0x10c>
cmpl   $0x5d,-0x8(%rbp)
jle    119a <Ten90DecodeMovementField+0x9a>
mov    -0x8(%rbp),%eax
sub    $0x5d,%eax
shl    $0x1,%eax
add    $0x46,%eax
mov    %eax,-0xc(%rbp)
jmp    1207 <Ten90DecodeMovementField+0x107>
cmpl   $0x26,-0x8(%rbp)
jle    11b5 <Ten90DecodeMovementField+0xb5>
mov    -0x8(%rbp),%eax
sub    $0x26,%eax
add    $0xf,%eax
mov    %eax,-0xc(%rbp)
jmp    1202 <Ten90DecodeMovementField+0x102>
cmpl   $0xc,-0x8(%rbp)
jle    11d3 <Ten90DecodeMovementField+0xd3>
mov    -0x8(%rbp),%eax
sub    $0xb,%eax
sar    $0x1,%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
jmp    11fd <Ten90DecodeMovementField+0xfd>
cmpl   $0x8,-0x8(%rbp)
jle    11f1 <Ten90DecodeMovementField+0xf1>
mov    -0x8(%rbp),%eax
sub    $0x6,%eax
sar    $0x2,%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11f8 <Ten90DecodeMovementField+0xf8>
movl   $0x0,-0xc(%rbp)
jmp    11fd <Ten90DecodeMovementField+0xfd>
jmp    1202 <Ten90DecodeMovementField+0x102>
jmp    1207 <Ten90DecodeMovementField+0x107>
jmp    120c <Ten90DecodeMovementField+0x10c>
jmp    1211 <Ten90DecodeMovementField+0x111>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Ten90DecodeMovementField>:
mov    $0xffffffff,%eax
lea    -0x7d(%rdi),%ecx
cmp    $0x3,%ecx
jae    110e <Ten90DecodeMovementField+0xe>
ret
test   %edi,%edi
je     110d <Ten90DecodeMovementField+0xd>
mov    $0xc7,%eax
cmp    $0x7b,%edi
jg     110d <Ten90DecodeMovementField+0xd>
cmp    $0x6d,%edi
jl     112a <Ten90DecodeMovementField+0x2a>
lea    (%rdi,%rdi,4),%eax
add    $0xfffffe48,%eax
ret
cmp    $0x5e,%edi
jl     1136 <Ten90DecodeMovementField+0x36>
lea    (%rdi,%rdi,1),%eax
add    $0xffffff8c,%eax
ret
cmp    $0x27,%edi
jl     1140 <Ten90DecodeMovementField+0x40>
add    $0xffffffe9,%edi
jmp    115f <Ten90DecodeMovementField+0x5f>
cmp    $0xd,%edi
jl     114f <Ten90DecodeMovementField+0x4f>
add    $0xfffffff5,%edi
shr    %edi
add    $0x2,%edi
jmp    115f <Ten90DecodeMovementField+0x5f>
xor    %eax,%eax
cmp    $0x9,%edi
jl     110d <Ten90DecodeMovementField+0xd>
add    $0xfffffffa,%edi
shr    $0x2,%edi
add    $0x1,%edi
mov    %edi,%eax
ret

LLVM IR (-O0):
define i32 @Ten90DecodeMovementField(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = icmp eq i32 0, %5
br i1 %6, label %16, label %7
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp eq i32 125, %8
br i1 %9, label %16, label %10
10: ; preds = %7
%11 = load i32, i32* %3
%12 = icmp eq i32 126, %11
br i1 %12, label %16, label %13
13: ; preds = %10
%14 = load i32, i32* %3
%15 = icmp eq i32 127, %14
br i1 %15, label %16, label %17
16: ; preds = %13, %10, %7, %1
store i32 -1, i32* %2
br label %68
17: ; preds = %13
%18 = load i32, i32* %3
%19 = icmp sgt i32 %18, 123
br i1 %19, label %20, label %21
20: ; preds = %17
store i32 199, i32* %4
br label %66
21: ; preds = %17
%22 = load i32, i32* %3
%23 = icmp sgt i32 %22, 108
br i1 %23, label %24, label %29
24: ; preds = %21
%25 = load i32, i32* %3
%26 = sub nsw i32 %25, 108
%27 = mul nsw i32 %26, 5
%28 = add nsw i32 %27, 100
store i32 %28, i32* %4
br label %65
29: ; preds = %21
%30 = load i32, i32* %3
%31 = icmp sgt i32 %30, 93
br i1 %31, label %32, label %37
32: ; preds = %29
%33 = load i32, i32* %3
%34 = sub nsw i32 %33, 93
%35 = mul nsw i32 %34, 2
%36 = add nsw i32 %35, 70
store i32 %36, i32* %4
br label %64
37: ; preds = %29
%38 = load i32, i32* %3
%39 = icmp sgt i32 %38, 38
br i1 %39, label %40, label %44
40: ; preds = %37
%41 = load i32, i32* %3
%42 = sub nsw i32 %41, 38
%43 = add nsw i32 %42, 15
store i32 %43, i32* %4
br label %63
44: ; preds = %37
%45 = load i32, i32* %3
%46 = icmp sgt i32 %45, 12
br i1 %46, label %47, label %52
47: ; preds = %44
%48 = load i32, i32* %3
%49 = sub nsw i32 %48, 11
%50 = ashr i32 %49, 1
%51 = add nsw i32 %50, 2
store i32 %51, i32* %4
br label %62
52: ; preds = %44
%53 = load i32, i32* %3
%54 = icmp sgt i32 %53, 8
br i1 %54, label %55, label %60
55: ; preds = %52
%56 = load i32, i32* %3
%57 = sub nsw i32 %56, 6
%58 = ashr i32 %57, 2
%59 = add nsw i32 %58, 1
store i32 %59, i32* %4
br label %61
60: ; preds = %52
store i32 0, i32* %4
br label %61
61: ; preds = %60, %55
br label %62
62: ; preds = %61, %47
br label %63
63: ; preds = %62, %40
br label %64
64: ; preds = %63, %32
br label %65
65: ; preds = %64, %24
br label %66
66: ; preds = %65, %20
%67 = load i32, i32* %4
store i32 %67, i32* %2
br label %68
68: ; preds = %66, %16
%69 = load i32, i32* %2
ret i32 %69
}

LLVM IR (-O2):
define i32 @Ten90DecodeMovementField(i32 %0) {
switch i32 %0, label %2 [
i32 127, label %30
i32 126, label %30
i32 125, label %30
i32 0, label %30
]
2: ; preds = %1
%3 = icmp sgt i32 %0, 123
br i1 %3, label %30, label %4
4: ; preds = %2
%5 = icmp sgt i32 %0, 108
br i1 %5, label %6, label %9
6: ; preds = %4
%7 = mul nuw nsw i32 %0, 5
%8 = add nsw i32 %7, -440
br label %30
9: ; preds = %4
%10 = icmp sgt i32 %0, 93
br i1 %10, label %11, label %14
11: ; preds = %9
%12 = shl nuw nsw i32 %0, 1
%13 = add nsw i32 %12, -116
br label %30
14: ; preds = %9
%15 = icmp sgt i32 %0, 38
br i1 %15, label %16, label %18
16: ; preds = %14
%17 = add nsw i32 %0, -23
br label %30
18: ; preds = %14
%19 = icmp sgt i32 %0, 12
br i1 %19, label %20, label %24
20: ; preds = %18
%21 = add nsw i32 %0, -11
%22 = lshr i32 %21, 1
%23 = add nuw nsw i32 %22, 2
br label %30
24: ; preds = %18
%25 = icmp sgt i32 %0, 8
br i1 %25, label %26, label %30
26: ; preds = %24
%27 = add nsw i32 %0, -6
%28 = lshr i32 %27, 2
%29 = add nuw nsw i32 %28, 1
br label %30
30: ; preds = %11, %20, %26, %16, %6, %2, %24, %1, %1, %1, %1
%31 = phi i32 [ -1, %1 ], [ -1, %1 ], [ -1, %1 ], [ -1, %1 ], [ %8, %6 ], [ %13, %11 ], [ %17, %16 ], [ %23, %20 ], [ %29, %26 ], [ 199, %2 ], [ 0, %24 ]
ret i32 %31
}