#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 /*<<< orphan*/ value;

/* Variables and functions */
int TR_bitwidth(size_t value) {
  static const char LogTable256[256] = {
      -1, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4,
      4,  4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
      5,  5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6,
      6,  6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
      6,  6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
      6,  6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
      7,  7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
      7,  7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
      7,  7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
      7,  7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
      7,  7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7};
  int r;
  register size_t t1, t2, t3;
  if (sizeof(value) == 8 && (t3 = value >> 32)) {
    if ((t2 = t3 >> 16)) {
      r = (t1 = t2 >> 8) ? 56 + LogTable256[t1] : 48 + LogTable256[t2];
    } else {
      r = (t1 = t3 >> 8) ? 40 + LogTable256[t1] : 32 + LogTable256[t3];
    }
  } else {
    if ((t2 = value >> 16)) {
      r = (t1 = t2 >> 8) ? 24 + LogTable256[t1] : 16 + LogTable256[t2];
    } else {
      r = (t1 = value >> 8) ? 8 + LogTable256[t1] : LogTable256[value];
    }
  }
  return r;
}


x86 assembly (clang, -O0):
<TR_bitwidth>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x20,%rax
mov    %rax,-0x28(%rbp)
cmp    $0x0,%rax
je     11d4 <TR_bitwidth+0xd4>
mov    -0x28(%rbp),%rax
shr    $0x10,%rax
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
je     1184 <TR_bitwidth+0x84>
mov    -0x20(%rbp),%rax
shr    $0x8,%rax
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     1164 <TR_bitwidth+0x64>
mov    -0x18(%rbp),%rcx
lea    0xeab(%rip),%rax
movsbl (%rax,%rcx,1),%eax
add    $0x38,%eax
mov    %eax,-0x2c(%rbp)
jmp    1179 <TR_bitwidth+0x79>
mov    -0x20(%rbp),%rcx
lea    0xe91(%rip),%rax
movsbl (%rax,%rcx,1),%eax
add    $0x30,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    11cf <TR_bitwidth+0xcf>
mov    -0x28(%rbp),%rax
shr    $0x8,%rax
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     11b4 <TR_bitwidth+0xb4>
mov    -0x18(%rbp),%rcx
lea    0xe5b(%rip),%rax
movsbl (%rax,%rcx,1),%eax
add    $0x28,%eax
mov    %eax,-0x30(%rbp)
jmp    11c9 <TR_bitwidth+0xc9>
mov    -0x28(%rbp),%rcx
lea    0xe41(%rip),%rax
movsbl (%rax,%rcx,1),%eax
add    $0x20,%eax
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1287 <TR_bitwidth+0x187>
mov    -0x8(%rbp),%rax
shr    $0x10,%rax
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
je     123a <TR_bitwidth+0x13a>
mov    -0x20(%rbp),%rax
shr    $0x8,%rax
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     121a <TR_bitwidth+0x11a>
mov    -0x18(%rbp),%rcx
lea    0xdf5(%rip),%rax
movsbl (%rax,%rcx,1),%eax
add    $0x18,%eax
mov    %eax,-0x34(%rbp)
jmp    122f <TR_bitwidth+0x12f>
mov    -0x20(%rbp),%rcx
lea    0xddb(%rip),%rax
movsbl (%rax,%rcx,1),%eax
add    $0x10,%eax
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1282 <TR_bitwidth+0x182>
mov    -0x8(%rbp),%rax
shr    $0x8,%rax
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     126a <TR_bitwidth+0x16a>
mov    -0x18(%rbp),%rcx
lea    0xda5(%rip),%rax
movsbl (%rax,%rcx,1),%eax
add    $0x8,%eax
mov    %eax,-0x38(%rbp)
jmp    127c <TR_bitwidth+0x17c>
mov    -0x8(%rbp),%rcx
lea    0xd8b(%rip),%rax
movsbl (%rax,%rcx,1),%eax
mov    %eax,-0x38(%rbp)
mov    -0x38(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1287 <TR_bitwidth+0x187>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TR_bitwidth>:
mov    %rdi,%rax
shr    $0x20,%rax
jne    1127 <TR_bitwidth+0x27>
cmp    $0x10000,%rdi
jae    1145 <TR_bitwidth+0x45>
cmp    $0x100,%rdi
jae    1176 <TR_bitwidth+0x76>
lea    0xede(%rip),%rax
movsbl (%rdi,%rax,1),%eax
ret
mov    %rdi,%rcx
shr    $0x30,%rcx
jne    1161 <TR_bitwidth+0x61>
shr    $0x28,%rdi
jne    1189 <TR_bitwidth+0x89>
lea    0xec3(%rip),%rcx
movsbl (%rax,%rcx,1),%eax
add    $0x20,%eax
ret
cmp    $0x1000000,%rdi
jae    1198 <TR_bitwidth+0x98>
shr    $0x10,%rdi
lea    0xea7(%rip),%rax
movsbl (%rdi,%rax,1),%eax
add    $0x10,%eax
ret
lea    0xe98(%rip),%rax
shr    $0x38,%rdi
jne    11ab <TR_bitwidth+0xab>
movsbl (%rcx,%rax,1),%eax
add    $0x30,%eax
ret
shr    $0x8,%rdi
lea    0xe7f(%rip),%rax
movsbl (%rdi,%rax,1),%eax
add    $0x8,%eax
ret
lea    0xe70(%rip),%rax
movsbl (%rdi,%rax,1),%eax
add    $0x28,%eax
ret
shr    $0x18,%rdi
lea    0xe5d(%rip),%rax
movsbl (%rdi,%rax,1),%eax
add    $0x18,%eax
ret
movsbl (%rdi,%rax,1),%eax
add    $0x38,%eax
ret

LLVM IR (-O0):
@TR_bitwidth.LogTable256 = internal constant [256 x i8] c"\FF\00\01\01\02\02\02\02\03\03\03\03\03\03\03\03\04\04\04\04\04\04\04\04\04\04\04\04\04\04\04\04\05\05\05\05\05\05\05\05\05\05\05\05\05\05\05\05\05\05\05\05\05\05\05\05\05\05\05\05\05\05\05\05\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07"
define i32 @TR_bitwidth(i64 %0) {
%2 = alloca i64
%3 = alloca i32
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %2
%7 = load i64, i64* %2
%8 = lshr i64 %7, 32
store i64 %8, i64* %6
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %51
10: ; preds = %1
%11 = load i64, i64* %6
%12 = lshr i64 %11, 16
store i64 %12, i64* %5
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %32
14: ; preds = %10
%15 = load i64, i64* %5
%16 = lshr i64 %15, 8
store i64 %16, i64* %4
%17 = icmp ne i64 %16, 0
br i1 %17, label %18, label %24
18: ; preds = %14
%19 = load i64, i64* %4
%20 = getelementptr inbounds [256 x i8], [256 x i8]* @TR_bitwidth.LogTable256, i64 0, i64 %19
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = add nsw i32 56, %22
br label %30
24: ; preds = %14
%25 = load i64, i64* %5
%26 = getelementptr inbounds [256 x i8], [256 x i8]* @TR_bitwidth.LogTable256, i64 0, i64 %25
%27 = load i8, i8* %26
%28 = sext i8 %27 to i32
%29 = add nsw i32 48, %28
br label %30
30: ; preds = %24, %18
%31 = phi i32 [ %23, %18 ], [ %29, %24 ]
store i32 %31, i32* %3
br label %50
32: ; preds = %10
%33 = load i64, i64* %6
%34 = lshr i64 %33, 8
store i64 %34, i64* %4
%35 = icmp ne i64 %34, 0
br i1 %35, label %36, label %42
36: ; preds = %32
%37 = load i64, i64* %4
%38 = getelementptr inbounds [256 x i8], [256 x i8]* @TR_bitwidth.LogTable256, i64 0, i64 %37
%39 = load i8, i8* %38
%40 = sext i8 %39 to i32
%41 = add nsw i32 40, %40
br label %48
42: ; preds = %32
%43 = load i64, i64* %6
%44 = getelementptr inbounds [256 x i8], [256 x i8]* @TR_bitwidth.LogTable256, i64 0, i64 %43
%45 = load i8, i8* %44
%46 = sext i8 %45 to i32
%47 = add nsw i32 32, %46
br label %48
48: ; preds = %42, %36
%49 = phi i32 [ %41, %36 ], [ %47, %42 ]
store i32 %49, i32* %3
br label %50
50: ; preds = %48, %30
br label %91
51: ; preds = %1
%52 = load i64, i64* %2
%53 = lshr i64 %52, 16
store i64 %53, i64* %5
%54 = icmp ne i64 %53, 0
br i1 %54, label %55, label %73
55: ; preds = %51
%56 = load i64, i64* %5
%57 = lshr i64 %56, 8
store i64 %57, i64* %4
%58 = icmp ne i64 %57, 0
br i1 %58, label %59, label %65
59: ; preds = %55
%60 = load i64, i64* %4
%61 = getelementptr inbounds [256 x i8], [256 x i8]* @TR_bitwidth.LogTable256, i64 0, i64 %60
%62 = load i8, i8* %61
%63 = sext i8 %62 to i32
%64 = add nsw i32 24, %63
br label %71
65: ; preds = %55
%66 = load i64, i64* %5
%67 = getelementptr inbounds [256 x i8], [256 x i8]* @TR_bitwidth.LogTable256, i64 0, i64 %66
%68 = load i8, i8* %67
%69 = sext i8 %68 to i32
%70 = add nsw i32 16, %69
br label %71
71: ; preds = %65, %59
%72 = phi i32 [ %64, %59 ], [ %70, %65 ]
store i32 %72, i32* %3
br label %90
73: ; preds = %51
%74 = load i64, i64* %2
%75 = lshr i64 %74, 8
store i64 %75, i64* %4
%76 = icmp ne i64 %75, 0
br i1 %76, label %77, label %83
77: ; preds = %73
%78 = load i64, i64* %4
%79 = getelementptr inbounds [256 x i8], [256 x i8]* @TR_bitwidth.LogTable256, i64 0, i64 %78
%80 = load i8, i8* %79
%81 = sext i8 %80 to i32
%82 = add nsw i32 8, %81
br label %88
83: ; preds = %73
%84 = load i64, i64* %2
%85 = getelementptr inbounds [256 x i8], [256 x i8]* @TR_bitwidth.LogTable256, i64 0, i64 %84
%86 = load i8, i8* %85
%87 = sext i8 %86 to i32
br label %88
88: ; preds = %83, %77
%89 = phi i32 [ %82, %77 ], [ %87, %83 ]
store i32 %89, i32* %3
br label %90
90: ; preds = %88, %71
br label %91
91: ; preds = %90, %50
%92 = load i32, i32* %3
ret i32 %92
}

LLVM IR (-O2):
@TR_bitwidth.LogTable256 = internal unnamed_addr constant [256 x i8] c"\FF\00\01\01\02\02\02\02\03\03\03\03\03\03\03\03\04\04\04\04\04\04\04\04\04\04\04\04\04\04\04\04\05\05\05\05\05\05\05\05\05\05\05\05\05\05\05\05\05\05\05\05\05\05\05\05\05\05\05\05\05\05\05\05\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\06\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07\07"
define i32 @TR_bitwidth(i64 %0) {
%2 = lshr i64 %0, 32
%3 = icmp ult i64 %0, 4294967296
br i1 %3, label %33, label %4
4: ; preds = %1
%5 = lshr i64 %0, 48
%6 = icmp ult i64 %0, 281474976710656
br i1 %6, label %20, label %7
7: ; preds = %4
%8 = icmp ult i64 %0, 72057594037927936
br i1 %8, label %15, label %9
9: ; preds = %7
%10 = lshr i64 %0, 56
%11 = getelementptr inbounds [256 x i8], [256 x i8]* @TR_bitwidth.LogTable256, i64 0, i64 %10
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = add nsw i32 %13, 56
br label %61
15: ; preds = %7
%16 = getelementptr inbounds [256 x i8], [256 x i8]* @TR_bitwidth.LogTable256, i64 0, i64 %5
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = add nsw i32 %18, 48
br label %61
20: ; preds = %4
%21 = icmp ult i64 %0, 1099511627776
br i1 %21, label %28, label %22
22: ; preds = %20
%23 = lshr i64 %0, 40
%24 = getelementptr inbounds [256 x i8], [256 x i8]* @TR_bitwidth.LogTable256, i64 0, i64 %23
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = add nsw i32 %26, 40
br label %61
28: ; preds = %20
%29 = getelementptr inbounds [256 x i8], [256 x i8]* @TR_bitwidth.LogTable256, i64 0, i64 %2
%30 = load i8, i8* %29
%31 = sext i8 %30 to i32
%32 = add nsw i32 %31, 32
br label %61
33: ; preds = %1
%34 = lshr i64 %0, 16
%35 = icmp ult i64 %0, 65536
br i1 %35, label %49, label %36
36: ; preds = %33
%37 = icmp ult i64 %0, 16777216
br i1 %37, label %44, label %38
38: ; preds = %36
%39 = lshr i64 %0, 24
%40 = getelementptr inbounds [256 x i8], [256 x i8]* @TR_bitwidth.LogTable256, i64 0, i64 %39
%41 = load i8, i8* %40
%42 = sext i8 %41 to i32
%43 = add nsw i32 %42, 24
br label %61
44: ; preds = %36
%45 = getelementptr inbounds [256 x i8], [256 x i8]* @TR_bitwidth.LogTable256, i64 0, i64 %34
%46 = load i8, i8* %45
%47 = sext i8 %46 to i32
%48 = add nsw i32 %47, 16
br label %61
49: ; preds = %33
%50 = icmp ult i64 %0, 256
br i1 %50, label %57, label %51
51: ; preds = %49
%52 = lshr i64 %0, 8
%53 = getelementptr inbounds [256 x i8], [256 x i8]* @TR_bitwidth.LogTable256, i64 0, i64 %52
%54 = load i8, i8* %53
%55 = sext i8 %54 to i32
%56 = add nsw i32 %55, 8
br label %61
57: ; preds = %49
%58 = getelementptr inbounds [256 x i8], [256 x i8]* @TR_bitwidth.LogTable256, i64 0, i64 %0
%59 = load i8, i8* %58
%60 = sext i8 %59 to i32
br label %61
61: ; preds = %51, %57, %38, %44, %22, %28, %9, %15
%62 = phi i32 [ %14, %9 ], [ %19, %15 ], [ %27, %22 ], [ %32, %28 ], [ %43, %38 ], [ %48, %44 ], [ %56, %51 ], [ %60, %57 ]
ret i32 %62
}