#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 uint64_t;
struct covert_tracker {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ addNBitToBuffer(struct covert_tracker *, unsigned char, int);
int extractBits(uint64_t block, uint64_t block_type,
                struct covert_tracker *rx_covert) {
  unsigned char tmpData = 0;
  int numBits = 0;
  switch (block_type) {
  case 0x33:
    tmpData = (block >>= 36) & 0xf;
    addNBitToBuffer(rx_covert, tmpData, 4);
    numBits = 4;
    break;
  case 0x78:
    break;
  case 0xff:
    break;
  case 0xe1:
    tmpData = (block >>= 56) & 0x1;
    addNBitToBuffer(rx_covert, tmpData, 1);
    numBits = 1;
    break;
  case 0xd2:
    tmpData = (block >>= 48) & 0x3;
    addNBitToBuffer(rx_covert, tmpData, 2);
    numBits = 2;
    break;
  case 0xcc:
    tmpData = (block >>= 40) & 0x7;
    addNBitToBuffer(rx_covert, tmpData, 3);
    numBits = 3;
    break;
  case 0xb4:
    tmpData = (block >>= 32) & 0xF;
    addNBitToBuffer(rx_covert, tmpData, 4);
    numBits = 4;
    break;
  case 0xaa:
    tmpData = (block >>= 24) & 0x1F;
    addNBitToBuffer(rx_covert, tmpData, 5);
    numBits = 5;
    break;
  case 0x99:
    tmpData = (block >>= 16) & 0x3F;
    addNBitToBuffer(rx_covert, tmpData, 6);
    numBits = 6;
    break;
  case 0x87:
    tmpData = (block >>= 8) & 0x7F;
    addNBitToBuffer(rx_covert, tmpData, 7);
    numBits = 7;
    break;
  case 0x1e:
    break;
  default:
    break;
  }
  return numBits;
}


x86 assembly (clang, -O0):
<extractBits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
movb   $0x0,-0x11(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
sub    $0x1e,%eax
je     1381 <extractBits+0x271>
jmp    1141 <extractBits+0x31>
mov    -0x1c(%rbp),%eax
sub    $0x33,%eax
je     11fb <extractBits+0xeb>
jmp    1152 <extractBits+0x42>
mov    -0x1c(%rbp),%eax
sub    $0x78,%eax
je     122c <extractBits+0x11c>
jmp    1163 <extractBits+0x53>
mov    -0x1c(%rbp),%eax
sub    $0x87,%eax
je     1354 <extractBits+0x244>
jmp    1176 <extractBits+0x66>
mov    -0x1c(%rbp),%eax
sub    $0x99,%eax
je     1327 <extractBits+0x217>
jmp    1189 <extractBits+0x79>
mov    -0x1c(%rbp),%eax
sub    $0xaa,%eax
je     12fa <extractBits+0x1ea>
jmp    119c <extractBits+0x8c>
mov    -0x1c(%rbp),%eax
sub    $0xb4,%eax
je     12c9 <extractBits+0x1b9>
jmp    11af <extractBits+0x9f>
mov    -0x1c(%rbp),%eax
sub    $0xcc,%eax
je     1298 <extractBits+0x188>
jmp    11c2 <extractBits+0xb2>
mov    -0x1c(%rbp),%eax
sub    $0xd2,%eax
je     1267 <extractBits+0x157>
jmp    11d5 <extractBits+0xc5>
mov    -0x1c(%rbp),%eax
sub    $0xe1,%eax
je     1236 <extractBits+0x126>
jmp    11e8 <extractBits+0xd8>
mov    -0x1c(%rbp),%eax
sub    $0xff,%eax
je     1231 <extractBits+0x121>
jmp    1386 <extractBits+0x276>
mov    -0x4(%rbp),%eax
mov    $0x24,%ecx
sar    %cl,%eax
mov    %eax,-0x4(%rbp)
and    $0xf,%eax
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x4,%edx
movzbl -0x11(%rbp),%esi
call   1030 <addNBitToBuffer@plt>
movl   $0x4,-0x18(%rbp)
jmp    138b <extractBits+0x27b>
jmp    138b <extractBits+0x27b>
jmp    138b <extractBits+0x27b>
mov    -0x4(%rbp),%eax
mov    $0x38,%ecx
sar    %cl,%eax
mov    %eax,-0x4(%rbp)
and    $0x1,%eax
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x1,%edx
movzbl -0x11(%rbp),%esi
call   1030 <addNBitToBuffer@plt>
movl   $0x1,-0x18(%rbp)
jmp    138b <extractBits+0x27b>
mov    -0x4(%rbp),%eax
mov    $0x30,%ecx
sar    %cl,%eax
mov    %eax,-0x4(%rbp)
and    $0x3,%eax
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2,%edx
movzbl -0x11(%rbp),%esi
call   1030 <addNBitToBuffer@plt>
movl   $0x2,-0x18(%rbp)
jmp    138b <extractBits+0x27b>
mov    -0x4(%rbp),%eax
mov    $0x28,%ecx
sar    %cl,%eax
mov    %eax,-0x4(%rbp)
and    $0x7,%eax
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x3,%edx
movzbl -0x11(%rbp),%esi
call   1030 <addNBitToBuffer@plt>
movl   $0x3,-0x18(%rbp)
jmp    138b <extractBits+0x27b>
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
sar    %cl,%eax
mov    %eax,-0x4(%rbp)
and    $0xf,%eax
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x4,%edx
movzbl -0x11(%rbp),%esi
call   1030 <addNBitToBuffer@plt>
movl   $0x4,-0x18(%rbp)
jmp    138b <extractBits+0x27b>
mov    -0x4(%rbp),%eax
sar    $0x18,%eax
mov    %eax,-0x4(%rbp)
and    $0x1f,%eax
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x5,%edx
movzbl -0x11(%rbp),%esi
call   1030 <addNBitToBuffer@plt>
movl   $0x5,-0x18(%rbp)
jmp    138b <extractBits+0x27b>
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
mov    %eax,-0x4(%rbp)
and    $0x3f,%eax
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x6,%edx
movzbl -0x11(%rbp),%esi
call   1030 <addNBitToBuffer@plt>
movl   $0x6,-0x18(%rbp)
jmp    138b <extractBits+0x27b>
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
mov    %eax,-0x4(%rbp)
and    $0x7f,%eax
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x7,%edx
movzbl -0x11(%rbp),%esi
call   1030 <addNBitToBuffer@plt>
movl   $0x7,-0x18(%rbp)
jmp    138b <extractBits+0x27b>
jmp    138b <extractBits+0x27b>
jmp    138b <extractBits+0x27b>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<extractBits>:
push   %rbx
xor    %ebx,%ebx
cmp    $0xb3,%esi
jg     1154 <extractBits+0x44>
mov    %edi,%eax
cmp    $0x98,%esi
jg     1181 <extractBits+0x71>
cmp    $0x33,%esi
je     11c9 <extractBits+0xb9>
cmp    $0x87,%esi
jne    1205 <extractBits+0xf5>
shr    $0x8,%eax
and    $0x7f,%eax
mov    $0x7,%ebx
mov    %rdx,%rdi
mov    %eax,%esi
mov    $0x7,%edx
jmp    1200 <extractBits+0xf0>
cmp    $0xd1,%esi
jg     11a8 <extractBits+0x98>
cmp    $0xb4,%esi
je     11c9 <extractBits+0xb9>
cmp    $0xcc,%esi
jne    1205 <extractBits+0xf5>
mov    $0x3,%ebx
mov    %rdx,%rdi
xor    %esi,%esi
mov    $0x3,%edx
jmp    1200 <extractBits+0xf0>
cmp    $0x99,%esi
je     11da <extractBits+0xca>
cmp    $0xaa,%esi
jne    1205 <extractBits+0xf5>
shr    $0x18,%eax
and    $0x1f,%eax
mov    $0x5,%ebx
mov    %rdx,%rdi
mov    %eax,%esi
mov    $0x5,%edx
jmp    1200 <extractBits+0xf0>
cmp    $0xd2,%esi
je     11f1 <extractBits+0xe1>
cmp    $0xe1,%esi
jne    1205 <extractBits+0xf5>
mov    $0x1,%ebx
mov    %rdx,%rdi
xor    %esi,%esi
mov    $0x1,%edx
jmp    1200 <extractBits+0xf0>
mov    $0x4,%ebx
mov    %rdx,%rdi
xor    %esi,%esi
mov    $0x4,%edx
jmp    1200 <extractBits+0xf0>
shr    $0x10,%eax
and    $0x3f,%eax
mov    $0x6,%ebx
mov    %rdx,%rdi
mov    %eax,%esi
mov    $0x6,%edx
jmp    1200 <extractBits+0xf0>
mov    $0x2,%ebx
mov    %rdx,%rdi
xor    %esi,%esi
mov    $0x2,%edx
call   1030 <addNBitToBuffer@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.covert_tracker = type { i32 }
define i32 @extractBits(i32 %0, i32 %1, %struct.covert_tracker* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca %struct.covert_tracker*
%7 = alloca i8
%8 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store %struct.covert_tracker* %2, %struct.covert_tracker** %6
store i8 0, i8* %7
store i32 0, i32* %8
%9 = load i32, i32* %5
switch i32 %9, label %77 [
i32 51, label %10
i32 120, label %18
i32 255, label %19
i32 225, label %20
i32 210, label %28
i32 204, label %36
i32 180, label %44
i32 170, label %52
i32 153, label %60
i32 135, label %68
i32 30, label %76
]
10: ; preds = %3
%11 = load i32, i32* %4
%12 = ashr i32 %11, 36
store i32 %12, i32* %4
%13 = and i32 %12, 15
%14 = trunc i32 %13 to i8
store i8 %14, i8* %7
%15 = load %struct.covert_tracker*, %struct.covert_tracker** %6
%16 = load i8, i8* %7
%17 = call i32 @addNBitToBuffer(%struct.covert_tracker* %15, i8 zeroext %16, i32 4)
store i32 4, i32* %8
br label %78
18: ; preds = %3
br label %78
19: ; preds = %3
br label %78
20: ; preds = %3
%21 = load i32, i32* %4
%22 = ashr i32 %21, 56
store i32 %22, i32* %4
%23 = and i32 %22, 1
%24 = trunc i32 %23 to i8
store i8 %24, i8* %7
%25 = load %struct.covert_tracker*, %struct.covert_tracker** %6
%26 = load i8, i8* %7
%27 = call i32 @addNBitToBuffer(%struct.covert_tracker* %25, i8 zeroext %26, i32 1)
store i32 1, i32* %8
br label %78
28: ; preds = %3
%29 = load i32, i32* %4
%30 = ashr i32 %29, 48
store i32 %30, i32* %4
%31 = and i32 %30, 3
%32 = trunc i32 %31 to i8
store i8 %32, i8* %7
%33 = load %struct.covert_tracker*, %struct.covert_tracker** %6
%34 = load i8, i8* %7
%35 = call i32 @addNBitToBuffer(%struct.covert_tracker* %33, i8 zeroext %34, i32 2)
store i32 2, i32* %8
br label %78
36: ; preds = %3
%37 = load i32, i32* %4
%38 = ashr i32 %37, 40
store i32 %38, i32* %4
%39 = and i32 %38, 7
%40 = trunc i32 %39 to i8
store i8 %40, i8* %7
%41 = load %struct.covert_tracker*, %struct.covert_tracker** %6
%42 = load i8, i8* %7
%43 = call i32 @addNBitToBuffer(%struct.covert_tracker* %41, i8 zeroext %42, i32 3)
store i32 3, i32* %8
br label %78
44: ; preds = %3
%45 = load i32, i32* %4
%46 = ashr i32 %45, 32
store i32 %46, i32* %4
%47 = and i32 %46, 15
%48 = trunc i32 %47 to i8
store i8 %48, i8* %7
%49 = load %struct.covert_tracker*, %struct.covert_tracker** %6
%50 = load i8, i8* %7
%51 = call i32 @addNBitToBuffer(%struct.covert_tracker* %49, i8 zeroext %50, i32 4)
store i32 4, i32* %8
br label %78
52: ; preds = %3
%53 = load i32, i32* %4
%54 = ashr i32 %53, 24
store i32 %54, i32* %4
%55 = and i32 %54, 31
%56 = trunc i32 %55 to i8
store i8 %56, i8* %7
%57 = load %struct.covert_tracker*, %struct.covert_tracker** %6
%58 = load i8, i8* %7
%59 = call i32 @addNBitToBuffer(%struct.covert_tracker* %57, i8 zeroext %58, i32 5)
store i32 5, i32* %8
br label %78
60: ; preds = %3
%61 = load i32, i32* %4
%62 = ashr i32 %61, 16
store i32 %62, i32* %4
%63 = and i32 %62, 63
%64 = trunc i32 %63 to i8
store i8 %64, i8* %7
%65 = load %struct.covert_tracker*, %struct.covert_tracker** %6
%66 = load i8, i8* %7
%67 = call i32 @addNBitToBuffer(%struct.covert_tracker* %65, i8 zeroext %66, i32 6)
store i32 6, i32* %8
br label %78
68: ; preds = %3
%69 = load i32, i32* %4
%70 = ashr i32 %69, 8
store i32 %70, i32* %4
%71 = and i32 %70, 127
%72 = trunc i32 %71 to i8
store i8 %72, i8* %7
%73 = load %struct.covert_tracker*, %struct.covert_tracker** %6
%74 = load i8, i8* %7
%75 = call i32 @addNBitToBuffer(%struct.covert_tracker* %73, i8 zeroext %74, i32 7)
store i32 7, i32* %8
br label %78
76: ; preds = %3
br label %78
77: ; preds = %3
br label %78
78: ; preds = %77, %76, %68, %60, %52, %44, %36, %28, %20, %19, %18, %10
%79 = load i32, i32* %8
ret i32 %79
}

LLVM IR (-O2):
%struct.covert_tracker = type { i32 }
define i32 @extractBits(i32 %0, i32 %1, %struct.covert_tracker* %2) {
switch i32 %1, label %29 [
i32 51, label %4
i32 135, label %24
i32 153, label %19
i32 225, label %6
i32 210, label %8
i32 204, label %10
i32 180, label %12
i32 170, label %14
]
4: ; preds = %3
%5 = tail call i32 @addNBitToBuffer(%struct.covert_tracker* %2, i8 zeroext poison, i32 4)
br label %29
6: ; preds = %3
%7 = tail call i32 @addNBitToBuffer(%struct.covert_tracker* %2, i8 zeroext poison, i32 1)
br label %29
8: ; preds = %3
%9 = tail call i32 @addNBitToBuffer(%struct.covert_tracker* %2, i8 zeroext poison, i32 2)
br label %29
10: ; preds = %3
%11 = tail call i32 @addNBitToBuffer(%struct.covert_tracker* %2, i8 zeroext poison, i32 3)
br label %29
12: ; preds = %3
%13 = tail call i32 @addNBitToBuffer(%struct.covert_tracker* %2, i8 zeroext poison, i32 4)
br label %29
14: ; preds = %3
%15 = lshr i32 %0, 24
%16 = trunc i32 %15 to i8
%17 = and i8 %16, 31
%18 = tail call i32 @addNBitToBuffer(%struct.covert_tracker* %2, i8 zeroext %17, i32 5)
br label %29
19: ; preds = %3
%20 = lshr i32 %0, 16
%21 = trunc i32 %20 to i8
%22 = and i8 %21, 63
%23 = tail call i32 @addNBitToBuffer(%struct.covert_tracker* %2, i8 zeroext %22, i32 6)
br label %29
24: ; preds = %3
%25 = lshr i32 %0, 8
%26 = trunc i32 %25 to i8
%27 = and i8 %26, 127
%28 = tail call i32 @addNBitToBuffer(%struct.covert_tracker* %2, i8 zeroext %27, i32 7)
br label %29
29: ; preds = %3, %24, %19, %14, %12, %10, %8, %6, %4
%30 = phi i32 [ 0, %3 ], [ 5, %14 ], [ 4, %12 ], [ 3, %10 ], [ 2, %8 ], [ 1, %6 ], [ 6, %19 ], [ 7, %24 ], [ 4, %4 ]
ret i32 %30
}