#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_value(uint8_t br) {
  if (br < 0b00000001) {
    return (262144);
  } else if ((br > 0b00000000) && (br < 0b01000000)) {
    return (br);
  } else if ((br > 0b00111111) && (br < 0b10000000)) {
    return (64 + (br - 0b01000000) * 8);
  } else if ((br > 0b01111111) && (br < 0b11111111)) {
    return (576 + (br - 0b10000000) * 64);
  } else {
    return (0);
  }
}


x86 assembly (clang, -O0):
<eps_qos_bit_rate_value>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jge    111d <eps_qos_bit_rate_value+0x1d>
movl   $0x40000,-0x4(%rbp)
jmp    119d <eps_qos_bit_rate_value+0x9d>
cmpl   $0x0,-0x8(%rbp)
jle    113c <eps_qos_bit_rate_value+0x3c>
cmpl   $0x40,-0x8(%rbp)
jge    113c <eps_qos_bit_rate_value+0x3c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    119d <eps_qos_bit_rate_value+0x9d>
cmpl   $0x3f,-0x8(%rbp)
jle    1167 <eps_qos_bit_rate_value+0x67>
cmpl   $0x80,-0x8(%rbp)
jge    1167 <eps_qos_bit_rate_value+0x67>
mov    -0x8(%rbp),%eax
sub    $0x40,%eax
shl    $0x3,%eax
add    $0x40,%eax
mov    %eax,-0x4(%rbp)
jmp    119d <eps_qos_bit_rate_value+0x9d>
cmpl   $0x7f,-0x8(%rbp)
jle    1196 <eps_qos_bit_rate_value+0x96>
cmpl   $0xff,-0x8(%rbp)
jge    1196 <eps_qos_bit_rate_value+0x96>
mov    -0x8(%rbp),%eax
sub    $0x80,%eax
shl    $0x6,%eax
add    $0x240,%eax
mov    %eax,-0x4(%rbp)
jmp    119d <eps_qos_bit_rate_value+0x9d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<eps_qos_bit_rate_value>:
test   %edi,%edi
jle    1116 <eps_qos_bit_rate_value+0x16>
cmp    $0x40,%edi
jb     112f <eps_qos_bit_rate_value+0x2f>
cmp    $0x7f,%edi
ja     111c <eps_qos_bit_rate_value+0x1c>
lea    -0x1c0(,%rdi,8),%eax
ret
mov    $0x40000,%eax
ret
xor    %eax,%eax
cmp    $0xfe,%edi
ja     1131 <eps_qos_bit_rate_value+0x31>
shl    $0x6,%edi
add    $0xffffe240,%edi
mov    %edi,%eax
ret

LLVM IR (-O0):
define i32 @eps_qos_bit_rate_value(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 1
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 262144, i32* %2
br label %38
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %7
%11 = load i32, i32* %3
%12 = icmp slt i32 %11, 64
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = load i32, i32* %3
store i32 %14, i32* %2
br label %38
15: ; preds = %10, %7
%16 = load i32, i32* %3
%17 = icmp sgt i32 %16, 63
br i1 %17, label %18, label %26
18: ; preds = %15
%19 = load i32, i32* %3
%20 = icmp slt i32 %19, 128
br i1 %20, label %21, label %26
21: ; preds = %18
%22 = load i32, i32* %3
%23 = sub nsw i32 %22, 64
%24 = mul nsw i32 %23, 8
%25 = add nsw i32 64, %24
store i32 %25, i32* %2
br label %38
26: ; preds = %18, %15
%27 = load i32, i32* %3
%28 = icmp sgt i32 %27, 127
br i1 %28, label %29, label %37
29: ; preds = %26
%30 = load i32, i32* %3
%31 = icmp slt i32 %30, 255
br i1 %31, label %32, label %37
32: ; preds = %29
%33 = load i32, i32* %3
%34 = sub nsw i32 %33, 128
%35 = mul nsw i32 %34, 64
%36 = add nsw i32 576, %35
store i32 %36, i32* %2
br label %38
37: ; preds = %29, %26
store i32 0, i32* %2
br label %38
38: ; preds = %37, %32, %21, %13, %6
%39 = load i32, i32* %2
ret i32 %39
}

LLVM IR (-O2):
define i32 @eps_qos_bit_rate_value(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %15, label %3
3: ; preds = %1
%4 = icmp ult i32 %0, 64
br i1 %4, label %15, label %5
5: ; preds = %3
%6 = icmp ult i32 %0, 128
br i1 %6, label %7, label %10
7: ; preds = %5
%8 = shl nuw nsw i32 %0, 3
%9 = add nsw i32 %8, -448
br label %15
10: ; preds = %5
%11 = icmp ult i32 %0, 255
br i1 %11, label %12, label %15
12: ; preds = %10
%13 = shl nuw nsw i32 %0, 6
%14 = add nsw i32 %13, -7616
br label %15
15: ; preds = %10, %3, %1, %12, %7
%16 = phi i32 [ %9, %7 ], [ %14, %12 ], [ 262144, %1 ], [ %0, %3 ], [ 0, %10 ]
ret i32 %16
}