#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 int32_t;

/* Variables and functions */
int /*<<< orphan*/ dact_bit_buffer_purge();
unsigned int dact_bit_buffer_read(int);
int dact_bit_buffer_size();
int /*<<< orphan*/ dact_bit_buffer_write(unsigned char, int);
int dact_snibble_decompress(unsigned char *curr_block, char *out_block,
                            int blk_size, int bufsize) {
  const unsigned char lookup_table[8] = {0, 0, 1, 0, 0, 0, 2, 3};
  unsigned int freq[4];
  unsigned int x, m = 0;
  unsigned int i, cnt = 0, f = 0, j = 0;
  int32_t g = 0;
  freq[0] = (curr_block[0] & 0xc0) >> 6;
  freq[1] = (curr_block[0] & 0x30) >> 4;
  freq[2] = (curr_block[0] & 0x0c) >> 2;
  for (i = 0; i < 4; i++) {
    if (freq[0] != i && freq[1] != i && freq[2] != i)
      freq[3] = i;
  }
  out_block[0] = 0;
  dact_bit_buffer_purge();
  dact_bit_buffer_write(curr_block[g++] & 0x03, 2);
  while (1) {
    while (((dact_bit_buffer_size() + 8) <= 16) && g <= blk_size)
      dact_bit_buffer_write(curr_block[g++], 8);
    x = dact_bit_buffer_read(1);
    m = (m << 1) + x;
    cnt++;
    if (x == 0 || cnt == 3) {
      out_block[f] |= (freq[lookup_table[m]] << (j));
      j += 2;
      if (j == 8)
        out_block[++f] = (j = 0);
      m = 0;
      cnt = 0;
    }
    if (dact_bit_buffer_size() == 0 || f == bufsize)
      break;
  }
  return (f);
}


x86 assembly (clang, -O0):
<dact_snibble_decompress>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    0xea3(%rip),%rax
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x38(%rbp)
movl   $0x0,-0x40(%rbp)
movl   $0x0,-0x44(%rbp)
movl   $0x0,-0x48(%rbp)
movl   $0x0,-0x4c(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
and    $0xc0,%eax
sar    $0x6,%eax
mov    %eax,-0x30(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
and    $0x30,%eax
sar    $0x4,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
and    $0xc,%eax
sar    $0x2,%eax
mov    %eax,-0x28(%rbp)
movl   $0x0,-0x3c(%rbp)
cmpl   $0x4,-0x3c(%rbp)
jae    1204 <dact_snibble_decompress+0xc4>
mov    -0x30(%rbp),%eax
cmp    -0x3c(%rbp),%eax
je     11f1 <dact_snibble_decompress+0xb1>
mov    -0x2c(%rbp),%eax
cmp    -0x3c(%rbp),%eax
je     11f1 <dact_snibble_decompress+0xb1>
mov    -0x28(%rbp),%eax
cmp    -0x3c(%rbp),%eax
je     11f1 <dact_snibble_decompress+0xb1>
mov    -0x3c(%rbp),%eax
mov    %eax,-0x24(%rbp)
jmp    11f6 <dact_snibble_decompress+0xb6>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    11bd <dact_snibble_decompress+0x7d>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    $0x0,%al
call   1050 <dact_bit_buffer_purge@plt>
mov    -0x8(%rbp),%rax
mov    -0x4c(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x4c(%rbp)
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%eax
and    $0x3,%eax
mov    $0x2,%esi
movzbl %al,%edi
call   1040 <dact_bit_buffer_write@plt>
jmp    123d <dact_snibble_decompress+0xfd>
mov    $0x0,%al
call   1030 <dact_bit_buffer_size@plt>
mov    %eax,%ecx
add    $0x8,%ecx
xor    %eax,%eax
cmp    $0x10,%ecx
mov    %al,-0x4d(%rbp)
jg     1263 <dact_snibble_decompress+0x123>
mov    -0x4c(%rbp),%eax
cmp    -0x14(%rbp),%eax
setle  %al
mov    %al,-0x4d(%rbp)
mov    -0x4d(%rbp),%al
test   $0x1,%al
jne    1273 <dact_snibble_decompress+0x133>
jmp    1298 <dact_snibble_decompress+0x158>
mov    -0x8(%rbp),%rax
mov    -0x4c(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x4c(%rbp)
movslq %ecx,%rcx
mov    $0x8,%esi
movzbl (%rax,%rcx,1),%edi
call   1040 <dact_bit_buffer_write@plt>
jmp    123d <dact_snibble_decompress+0xfd>
mov    $0x1,%edi
call   1060 <dact_bit_buffer_read@plt>
mov    %eax,-0x34(%rbp)
mov    -0x38(%rbp),%eax
shl    $0x1,%eax
add    -0x34(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
cmpl   $0x0,-0x34(%rbp)
je     12ce <dact_snibble_decompress+0x18e>
cmpl   $0x3,-0x40(%rbp)
jne    132a <dact_snibble_decompress+0x1ea>
mov    -0x38(%rbp),%eax
movzbl -0x20(%rbp,%rax,1),%eax
mov    -0x30(%rbp,%rax,4),%esi
mov    -0x48(%rbp),%ecx
shl    %cl,%esi
mov    -0x10(%rbp),%rax
mov    -0x44(%rbp),%ecx
movsbl (%rax,%rcx,1),%edx
or     %esi,%edx
mov    %dl,(%rax,%rcx,1)
mov    -0x48(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x48(%rbp)
cmpl   $0x8,-0x48(%rbp)
jne    131c <dact_snibble_decompress+0x1dc>
movl   $0x0,-0x48(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x44(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x44(%rbp)
mov    %ecx,%ecx
movb   $0x0,(%rax,%rcx,1)
movl   $0x0,-0x38(%rbp)
movl   $0x0,-0x40(%rbp)
mov    $0x0,%al
call   1030 <dact_bit_buffer_size@plt>
cmp    $0x0,%eax
je     1346 <dact_snibble_decompress+0x206>
mov    -0x44(%rbp),%eax
cmp    -0x18(%rbp),%eax
jne    134b <dact_snibble_decompress+0x20b>
jmp    1350 <dact_snibble_decompress+0x210>
jmp    1238 <dact_snibble_decompress+0xf8>
mov    -0x44(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dact_snibble_decompress>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %ecx,0x14(%rsp)
mov    %edx,%r14d
mov    %rdi,%rbp
movzbl (%rdi),%ecx
mov    %ecx,%edi
shr    $0x6,%edi
mov    %edi,0x20(%rsp)
mov    %ecx,%edx
shr    $0x4,%edx
and    $0x3,%edx
shr    $0x2,%ecx
and    $0x3,%ecx
cmp    $0x1,%dil
setne  %al
cmp    $0x1,%dl
setne  %bl
and    %al,%bl
cmp    $0x1,%cl
setne  %al
and    %bl,%al
movzbl %al,%eax
cmp    $0x2,%cl
mov    $0x2,%ebx
cmove  %eax,%ebx
mov    %edx,0x24(%rsp)
cmp    $0x2,%dl
cmove  %eax,%ebx
mov    %ecx,0x28(%rsp)
cmp    $0x2,%dil
cmove  %eax,%ebx
cmp    $0x3,%cl
mov    $0x3,%eax
cmove  %ebx,%eax
cmp    $0x3,%dl
cmove  %ebx,%eax
cmp    $0x3,%dil
cmove  %ebx,%eax
mov    %eax,0x2c(%rsp)
mov    %rsi,0x18(%rsp)
movb   $0x0,(%rsi)
xor    %eax,%eax
call   1050 <dact_bit_buffer_purge@plt>
movzbl 0x0(%rbp),%edi
and    $0x3,%edi
mov    $0x2,%esi
call   1040 <dact_bit_buffer_write@plt>
mov    %r14d,0x10(%rsp)
movslq %r14d,%r14
mov    $0x1,%ebx
xor    %r12d,%r12d
xor    %r13d,%r13d
xor    %eax,%eax
mov    %rax,0x8(%rsp)
movl   $0x0,0x4(%rsp)
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <dact_bit_buffer_size@plt>
cmp    $0x8,%eax
jg     1258 <dact_snibble_decompress+0x118>
cmp    0x10(%rsp),%ebx
jg     1258 <dact_snibble_decompress+0x118>
movslq %ebx,%r15
cs nopw 0x0(%rax,%rax,1)
nop
lea    0x1(%r15),%rbx
movzbl 0x0(%rbp,%r15,1),%edi
mov    $0x8,%esi
call   1040 <dact_bit_buffer_write@plt>
xor    %eax,%eax
call   1030 <dact_bit_buffer_size@plt>
cmp    $0x8,%eax
jg     1258 <dact_snibble_decompress+0x118>
cmp    %r14,%r15
mov    %rbx,%r15
jl     1230 <dact_snibble_decompress+0xf0>
mov    $0x1,%edi
call   1060 <dact_bit_buffer_read@plt>
lea    (%rax,%r12,2),%r12d
test   %eax,%eax
je     1274 <dact_snibble_decompress+0x134>
add    $0x1,%r13d
cmp    $0x3,%r13d
jne    12d0 <dact_snibble_decompress+0x190>
mov    %r12d,%eax
lea    0xd82(%rip),%rcx
movzbl (%rax,%rcx,1),%eax
mov    0x20(%rsp,%rax,4),%eax
mov    0x4(%rsp),%ecx
shl    %cl,%eax
mov    0x8(%rsp),%esi
mov    0x18(%rsp),%rdx
or     %al,(%rdx,%rsi,1)
add    $0x2,%ecx
xor    %r12d,%r12d
cmp    $0x8,%ecx
je     12ac <dact_snibble_decompress+0x16c>
mov    %ecx,0x4(%rsp)
xor    %r13d,%r13d
jmp    12d0 <dact_snibble_decompress+0x190>
mov    0x8(%rsp),%rcx
add    $0x1,%ecx
mov    0x18(%rsp),%rax
mov    %rcx,0x8(%rsp)
movb   $0x0,(%rax,%rcx,1)
xor    %r12d,%r12d
xor    %r13d,%r13d
movl   $0x0,0x4(%rsp)
xor    %eax,%eax
call   1030 <dact_bit_buffer_size@plt>
test   %eax,%eax
je     12ea <dact_snibble_decompress+0x1aa>
mov    0x8(%rsp),%rax
cmp    0x14(%rsp),%eax
jne    1210 <dact_snibble_decompress+0xd0>
mov    0x8(%rsp),%rax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.dact_snibble_decompress.lookup_table = [8 x i8] c"\00\00\01\00\00\00\02\03"
define i32 @dact_snibble_decompress(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca [8 x i8]
%10 = alloca [4 x i32]
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%18 = bitcast [8 x i8]* %9 to i8*
store i32 0, i32* %12
store i32 0, i32* %14
store i32 0, i32* %15
store i32 0, i32* %16
store i32 0, i32* %17
%19 = load i8*, i8** %5
%20 = getelementptr inbounds i8, i8* %19, i64 0
%21 = load i8, i8* %20
%22 = zext i8 %21 to i32
%23 = and i32 %22, 192
%24 = ashr i32 %23, 6
%25 = getelementptr inbounds [4 x i32], [4 x i32]* %10, i64 0, i64 0
store i32 %24, i32* %25
%26 = load i8*, i8** %5
%27 = getelementptr inbounds i8, i8* %26, i64 0
%28 = load i8, i8* %27
%29 = zext i8 %28 to i32
%30 = and i32 %29, 48
%31 = ashr i32 %30, 4
%32 = getelementptr inbounds [4 x i32], [4 x i32]* %10, i64 0, i64 1
store i32 %31, i32* %32
%33 = load i8*, i8** %5
%34 = getelementptr inbounds i8, i8* %33, i64 0
%35 = load i8, i8* %34
%36 = zext i8 %35 to i32
%37 = and i32 %36, 12
%38 = ashr i32 %37, 2
%39 = getelementptr inbounds [4 x i32], [4 x i32]* %10, i64 0, i64 2
store i32 %38, i32* %39
store i32 0, i32* %13
br label %40
40: ; preds = %62, %4
%41 = load i32, i32* %13
%42 = icmp ult i32 %41, 4
br i1 %42, label %43, label %65
43: ; preds = %40
%44 = getelementptr inbounds [4 x i32], [4 x i32]* %10, i64 0, i64 0
%45 = load i32, i32* %44
%46 = load i32, i32* %13
%47 = icmp ne i32 %45, %46
br i1 %47, label %48, label %61
48: ; preds = %43
%49 = getelementptr inbounds [4 x i32], [4 x i32]* %10, i64 0, i64 1
%50 = load i32, i32* %49
%51 = load i32, i32* %13
%52 = icmp ne i32 %50, %51
br i1 %52, label %53, label %61
53: ; preds = %48
%54 = getelementptr inbounds [4 x i32], [4 x i32]* %10, i64 0, i64 2
%55 = load i32, i32* %54
%56 = load i32, i32* %13
%57 = icmp ne i32 %55, %56
br i1 %57, label %58, label %61
58: ; preds = %53
%59 = load i32, i32* %13
%60 = getelementptr inbounds [4 x i32], [4 x i32]* %10, i64 0, i64 3
store i32 %59, i32* %60
br label %61
61: ; preds = %58, %53, %48, %43
br label %62
62: ; preds = %61
%63 = load i32, i32* %13
%64 = add i32 %63, 1
store i32 %64, i32* %13
br label %40
65: ; preds = %40
%66 = load i8*, i8** %6
%67 = getelementptr inbounds i8, i8* %66, i64 0
store i8 0, i8* %67
%68 = call i32 (...) @dact_bit_buffer_purge()
%69 = load i8*, i8** %5
%70 = load i32, i32* %17
%71 = add nsw i32 %70, 1
store i32 %71, i32* %17
%72 = sext i32 %70 to i64
%73 = getelementptr inbounds i8, i8* %69, i64 %72
%74 = load i8, i8* %73
%75 = zext i8 %74 to i32
%76 = and i32 %75, 3
%77 = trunc i32 %76 to i8
%78 = call i32 @dact_bit_buffer_write(i8 zeroext %77, i32 2)
br label %79
79: ; preds = %65, %148
br label %80
80: ; preds = %90, %79
%81 = call i32 (...) @dact_bit_buffer_size()
%82 = add nsw i32 %81, 8
%83 = icmp sle i32 %82, 16
br i1 %83, label %84, label %88
84: ; preds = %80
%85 = load i32, i32* %17
%86 = load i32, i32* %7
%87 = icmp sle i32 %85, %86
br label %88
88: ; preds = %84, %80
%89 = phi i1 [ false, %80 ], [ %87, %84 ]
br i1 %89, label %90, label %98
90: ; preds = %88
%91 = load i8*, i8** %5
%92 = load i32, i32* %17
%93 = add nsw i32 %92, 1
store i32 %93, i32* %17
%94 = sext i32 %92 to i64
%95 = getelementptr inbounds i8, i8* %91, i64 %94
%96 = load i8, i8* %95
%97 = call i32 @dact_bit_buffer_write(i8 zeroext %96, i32 8)
br label %80
98: ; preds = %88
%99 = call i32 @dact_bit_buffer_read(i32 1)
store i32 %99, i32* %11
%100 = load i32, i32* %12
%101 = shl i32 %100, 1
%102 = load i32, i32* %11
%103 = add i32 %101, %102
store i32 %103, i32* %12
%104 = load i32, i32* %14
%105 = add i32 %104, 1
store i32 %105, i32* %14
%106 = load i32, i32* %11
%107 = icmp eq i32 %106, 0
br i1 %107, label %111, label %108
108: ; preds = %98
%109 = load i32, i32* %14
%110 = icmp eq i32 %109, 3
br i1 %110, label %111, label %140
111: ; preds = %108, %98
%112 = load i32, i32* %12
%113 = zext i32 %112 to i64
%114 = getelementptr inbounds [8 x i8], [8 x i8]* %9, i64 0, i64 %113
%115 = load i8, i8* %114
%116 = zext i8 %115 to i64
%117 = getelementptr inbounds [4 x i32], [4 x i32]* %10, i64 0, i64 %116
%118 = load i32, i32* %117
%119 = load i32, i32* %16
%120 = shl i32 %118, %119
%121 = load i8*, i8** %6
%122 = load i32, i32* %15
%123 = zext i32 %122 to i64
%124 = getelementptr inbounds i8, i8* %121, i64 %123
%125 = load i8, i8* %124
%126 = sext i8 %125 to i32
%127 = or i32 %126, %120
%128 = trunc i32 %127 to i8
store i8 %128, i8* %124
%129 = load i32, i32* %16
%130 = add i32 %129, 2
store i32 %130, i32* %16
%131 = load i32, i32* %16
%132 = icmp eq i32 %131, 8
br i1 %132, label %133, label %139
133: ; preds = %111
store i32 0, i32* %16
%134 = load i8*, i8** %6
%135 = load i32, i32* %15
%136 = add i32 %135, 1
store i32 %136, i32* %15
%137 = zext i32 %136 to i64
%138 = getelementptr inbounds i8, i8* %134, i64 %137
store i8 0, i8* %138
br label %139
139: ; preds = %133, %111
store i32 0, i32* %12
store i32 0, i32* %14
br label %140
140: ; preds = %139, %108
%141 = call i32 (...) @dact_bit_buffer_size()
%142 = icmp eq i32 %141, 0
br i1 %142, label %147, label %143
143: ; preds = %140
%144 = load i32, i32* %15
%145 = load i32, i32* %8
%146 = icmp eq i32 %144, %145
br i1 %146, label %147, label %148
147: ; preds = %143, %140
br label %149
148: ; preds = %143
br label %79
149: ; preds = %147
%150 = load i32, i32* %15
ret i32 %150
}

LLVM IR (-O2):
@__const.dact_snibble_decompress.lookup_table = [8 x i8] c"\00\00\01\00\00\00\02\03"
define i32 @dact_snibble_decompress(i8* nocapture %0, i8* nocapture %1, i32 %2, i32 %3) {
%5 = alloca [4 x i32]
%6 = bitcast [4 x i32]* %5 to i8*
%7 = load i8, i8* %0
%8 = lshr i8 %7, 6
%9 = zext i8 %8 to i32
%10 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 0
store i32 %9, i32* %10
%11 = lshr i8 %7, 4
%12 = and i8 %11, 3
%13 = zext i8 %12 to i32
%14 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 1
store i32 %13, i32* %14
%15 = lshr i8 %7, 2
%16 = and i8 %15, 3
%17 = zext i8 %16 to i32
%18 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 2
store i32 %17, i32* %18
%19 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 3
%20 = icmp ne i8 %8, 1
%21 = icmp ne i8 %12, 1
%22 = select i1 %20, i1 %21, i1 false
%23 = icmp ne i8 %16, 1
%24 = select i1 %22, i1 %23, i1 false
%25 = zext i1 %24 to i32
%26 = icmp eq i8 %8, 2
%27 = icmp eq i8 %12, 2
%28 = select i1 %26, i1 true, i1 %27
%29 = icmp eq i8 %16, 2
%30 = select i1 %28, i1 true, i1 %29
%31 = select i1 %30, i32 %25, i32 2
%32 = icmp eq i8 %8, 3
%33 = icmp eq i8 %12, 3
%34 = select i1 %32, i1 true, i1 %33
%35 = icmp eq i8 %16, 3
%36 = select i1 %34, i1 true, i1 %35
%37 = select i1 %36, i32 %31, i32 3
store i32 %37, i32* %19
store i8 0, i8* %1
%38 = tail call i32 (...) @dact_bit_buffer_purge()
%39 = load i8, i8* %0
%40 = and i8 %39, 3
%41 = tail call i32 @dact_bit_buffer_write(i8 zeroext %40, i32 2)
%42 = sext i32 %2 to i64
br label %43
43: ; preds = %95, %4
%44 = phi i32 [ 0, %4 ], [ %96, %95 ]
%45 = phi i32 [ 0, %4 ], [ %97, %95 ]
%46 = phi i32 [ 0, %4 ], [ %98, %95 ]
%47 = phi i32 [ 0, %4 ], [ %99, %95 ]
%48 = phi i32 [ 1, %4 ], [ %68, %95 ]
%49 = tail call i32 (...) @dact_bit_buffer_size()
%50 = icmp slt i32 %49, 9
%51 = icmp sle i32 %48, %2
%52 = select i1 %50, i1 %51, i1 false
br i1 %52, label %53, label %67
53: ; preds = %43
%54 = sext i32 %48 to i64
br label %55
55: ; preds = %53, %55
%56 = phi i64 [ %54, %53 ], [ %57, %55 ]
%57 = add nsw i64 %56, 1
%58 = getelementptr inbounds i8, i8* %0, i64 %56
%59 = load i8, i8* %58
%60 = tail call i32 @dact_bit_buffer_write(i8 zeroext %59, i32 8)
%61 = tail call i32 (...) @dact_bit_buffer_size()
%62 = icmp slt i32 %61, 9
%63 = icmp slt i64 %56, %42
%64 = select i1 %62, i1 %63, i1 false
br i1 %64, label %55, label %65
65: ; preds = %55
%66 = trunc i64 %57 to i32
br label %67
67: ; preds = %65, %43
%68 = phi i32 [ %48, %43 ], [ %66, %65 ]
%69 = tail call i32 @dact_bit_buffer_read(i32 1)
%70 = shl i32 %44, 1
%71 = add i32 %69, %70
%72 = add i32 %45, 1
%73 = icmp eq i32 %69, 0
%74 = icmp eq i32 %72, 3
%75 = select i1 %73, i1 true, i1 %74
br i1 %75, label %76, label %95
76: ; preds = %67
%77 = zext i32 %71 to i64
%78 = getelementptr inbounds [8 x i8], [8 x i8]* @__const.dact_snibble_decompress.lookup_table, i64 0, i64 %77
%79 = load i8, i8* %78
%80 = zext i8 %79 to i64
%81 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 %80
%82 = load i32, i32* %81
%83 = shl i32 %82, %47
%84 = zext i32 %46 to i64
%85 = getelementptr inbounds i8, i8* %1, i64 %84
%86 = load i8, i8* %85
%87 = trunc i32 %83 to i8
%88 = or i8 %86, %87
store i8 %88, i8* %85
%89 = add i32 %47, 2
%90 = icmp eq i32 %89, 8
br i1 %90, label %91, label %95
91: ; preds = %76
%92 = add i32 %46, 1
%93 = zext i32 %92 to i64
%94 = getelementptr inbounds i8, i8* %1, i64 %93
store i8 0, i8* %94
br label %95
95: ; preds = %76, %91, %67
%96 = phi i32 [ %71, %67 ], [ 0, %91 ], [ 0, %76 ]
%97 = phi i32 [ %72, %67 ], [ 0, %91 ], [ 0, %76 ]
%98 = phi i32 [ %46, %67 ], [ %92, %91 ], [ %46, %76 ]
%99 = phi i32 [ %47, %67 ], [ 0, %91 ], [ %89, %76 ]
%100 = tail call i32 (...) @dact_bit_buffer_size()
%101 = icmp eq i32 %100, 0
%102 = icmp eq i32 %98, %3
%103 = select i1 %101, i1 true, i1 %102
br i1 %103, label %104, label %43
104: ; preds = %95
ret i32 %98
}