#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 */
typedef int uint8_t;

/* Variables and functions */
int eps_qos_bit_rate_ext_value(uint8_t br) {
  if ((br > 0b00000000) && (br < 0b01001011)) {
    return (8600 + br * 100);
  } else if ((br > 0b01001010) && (br < 0b10111011)) {
    return (16384 + (br - 0b01001010) * 1024);
  } else if ((br > 0b10111010) && (br < 0b11111011)) {
    return (131072 + (br - 0b10111010) * 2048);
  } else {
    return (-1);
  }
}


x86 assembly (clang, -O0):
<eps_qos_bit_rate_ext_value>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    112c <eps_qos_bit_rate_ext_value+0x2c>
cmpl   $0x4b,-0x8(%rbp)
jge    112c <eps_qos_bit_rate_ext_value+0x2c>
imul   $0x64,-0x8(%rbp),%eax
add    $0x2198,%eax
mov    %eax,-0x4(%rbp)
jmp    1192 <eps_qos_bit_rate_ext_value+0x92>
cmpl   $0x4a,-0x8(%rbp)
jle    1159 <eps_qos_bit_rate_ext_value+0x59>
cmpl   $0xbb,-0x8(%rbp)
jge    1159 <eps_qos_bit_rate_ext_value+0x59>
mov    -0x8(%rbp),%eax
sub    $0x4a,%eax
shl    $0xa,%eax
add    $0x4000,%eax
mov    %eax,-0x4(%rbp)
jmp    1192 <eps_qos_bit_rate_ext_value+0x92>
cmpl   $0xba,-0x8(%rbp)
jle    118b <eps_qos_bit_rate_ext_value+0x8b>
cmpl   $0xfb,-0x8(%rbp)
jge    118b <eps_qos_bit_rate_ext_value+0x8b>
mov    -0x8(%rbp),%eax
sub    $0xba,%eax
shl    $0xb,%eax
add    $0x20000,%eax
mov    %eax,-0x4(%rbp)
jmp    1192 <eps_qos_bit_rate_ext_value+0x92>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<eps_qos_bit_rate_ext_value>:
lea    -0x1(%rdi),%eax
cmp    $0x49,%eax
ja     1111 <eps_qos_bit_rate_ext_value+0x11>
imul   $0x64,%edi,%eax
add    $0x2198,%eax
ret
lea    -0x4b(%rdi),%eax
cmp    $0x6f,%eax
ja     1124 <eps_qos_bit_rate_ext_value+0x24>
shl    $0xa,%edi
add    $0xffff1800,%edi
jmp    113d <eps_qos_bit_rate_ext_value+0x3d>
lea    -0xbb(%rdi),%ecx
mov    $0xffffffff,%eax
cmp    $0x3f,%ecx
ja     113f <eps_qos_bit_rate_ext_value+0x3f>
shl    $0xb,%edi
add    $0xfffc3000,%edi
mov    %edi,%eax
ret

LLVM IR (-O0):
define i32 @eps_qos_bit_rate_ext_value(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %13
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 75
br i1 %8, label %9, label %13
9: ; preds = %6
%10 = load i32, i32* %3
%11 = mul nsw i32 %10, 100
%12 = add nsw i32 8600, %11
store i32 %12, i32* %2
br label %36
13: ; preds = %6, %1
%14 = load i32, i32* %3
%15 = icmp sgt i32 %14, 74
br i1 %15, label %16, label %24
16: ; preds = %13
%17 = load i32, i32* %3
%18 = icmp slt i32 %17, 187
br i1 %18, label %19, label %24
19: ; preds = %16
%20 = load i32, i32* %3
%21 = sub nsw i32 %20, 74
%22 = mul nsw i32 %21, 1024
%23 = add nsw i32 16384, %22
store i32 %23, i32* %2
br label %36
24: ; preds = %16, %13
%25 = load i32, i32* %3
%26 = icmp sgt i32 %25, 186
br i1 %26, label %27, label %35
27: ; preds = %24
%28 = load i32, i32* %3
%29 = icmp slt i32 %28, 251
br i1 %29, label %30, label %35
30: ; preds = %27
%31 = load i32, i32* %3
%32 = sub nsw i32 %31, 186
%33 = mul nsw i32 %32, 2048
%34 = add nsw i32 131072, %33
store i32 %34, i32* %2
br label %36
35: ; preds = %27, %24
store i32 -1, i32* %2
br label %36
36: ; preds = %35, %30, %19, %9
%37 = load i32, i32* %2
ret i32 %37
}

LLVM IR (-O2):
define i32 @eps_qos_bit_rate_ext_value(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 74
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = mul nuw nsw i32 %0, 100
%6 = add nuw nsw i32 %5, 8600
br label %19
7: ; preds = %1
%8 = add i32 %0, -75
%9 = icmp ult i32 %8, 112
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = shl nuw nsw i32 %0, 10
%12 = add nsw i32 %11, -59392
br label %19
13: ; preds = %7
%14 = add i32 %0, -187
%15 = icmp ult i32 %14, 64
br i1 %15, label %16, label %19
16: ; preds = %13
%17 = shl nuw nsw i32 %0, 11
%18 = add nsw i32 %17, -249856
br label %19
19: ; preds = %13, %16, %10, %4
%20 = phi i32 [ %6, %4 ], [ %12, %10 ], [ %18, %16 ], [ -1, %13 ]
ret i32 %20
}