#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 uint32_t;
typedef int int32_t;
typedef int int16_t;

/* Variables and functions */
int ceil(float);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int get_opt_rice_param(int *, int, int *);
int rice_decode_block(int, int *, int, int *);
int rice_encode_block(int, int *, int, int *);
int /*<<< orphan*/ signed_to_unsigned(int, int *, int *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ unsigned_to_signed(int, int *, int *);
int main(int argc, char **argv) {
  int i, j = 0;
  int16_t opt_param;
  size_t read;
  uint32_t bits = 1, num_elements = 1;
  int32_t buffer[10] = {200, 234, 134, 156, 323, 456, 234, 100, 138, 334};
  uint32_t p_buffer[10];
  for (i = 0; i < 10; i++)
    fprintf(stderr, "Input[%d] = %d\n", i, buffer[i]);
  fprintf(stderr, "\n");
  signed_to_unsigned(10, buffer, p_buffer);
  opt_param = get_opt_rice_param(p_buffer, 10, &bits);
  fprintf(stderr, "Optimum rice parameter : %d\n\n", opt_param);
  fprintf(stderr, "%d bits required.\n\n", bits);
  num_elements = ceil(((float)(bits)) / (sizeof(uint32_t) * 8));
  uint32_t encoded[10];
  bits = rice_encode_block(opt_param, p_buffer, 10, encoded);
  fprintf(stderr, "%d bits written.\n\n", bits);
  for (i = 0; i < num_elements; i++)
    fprintf(stderr, "Encoded[%d] = %d\n", i, encoded[i]);
  fprintf(stderr, "\n");
  uint32_t d_buffer[10];
  int out_elements = rice_decode_block(opt_param, encoded, 10, d_buffer);
  for (i = 0; i < out_elements; i++)
    fprintf(stderr, "Decoded[%d] = %d\n", i, d_buffer[i]);
  int32_t buffer2[10];
  unsigned_to_signed(10, d_buffer, buffer2);
  fprintf(stderr, "\n");
  for (i = 0; i < out_elements; i++)
    fprintf(stderr, "Decompressed[%d] = %d\n", i, buffer2[i]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x1,-0x2c(%rbp)
movl   $0x1,-0x30(%rbp)
lea    -0x60(%rbp),%rdi
lea    0xe57(%rip),%rsi
mov    $0x28,%edx
call   1070 <memcpy@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0xa,-0x14(%rbp)
jge    1204 <main+0x84>
mov    0x2e05(%rip),%rax
mov    (%rax),%edi
mov    -0x14(%rbp),%edx
movslq -0x14(%rbp),%rax
mov    -0x60(%rbp,%rax,4),%ecx
lea    0xe49(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11ca <main+0x4a>
mov    0x2dd5(%rip),%rax
mov    (%rax),%edi
lea    0xe64(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
lea    -0x60(%rbp),%rsi
lea    -0x90(%rbp),%rdx
mov    $0xa,%edi
call   1040 <signed_to_unsigned@plt>
lea    -0x90(%rbp),%rdi
mov    $0xa,%esi
lea    -0x2c(%rbp),%rdx
call   1080 <get_opt_rice_param@plt>
mov    %eax,-0x1c(%rbp)
mov    0x2d91(%rip),%rax
mov    (%rax),%edi
mov    -0x1c(%rbp),%edx
lea    0xded(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    0x2d77(%rip),%rax
mov    (%rax),%edi
mov    -0x2c(%rbp),%edx
lea    0xdf1(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
cvtsi2ssl -0x2c(%rbp),%xmm0
movss  0xd77(%rip),%xmm1
divss  %xmm1,%xmm0
call   1030 <ceil@plt>
mov    %eax,-0x30(%rbp)
mov    -0x1c(%rbp),%edi
lea    -0x90(%rbp),%rsi
lea    -0xc0(%rbp),%rcx
mov    $0xa,%edx
call   1050 <rice_encode_block@plt>
mov    %eax,-0x2c(%rbp)
mov    0x2d26(%rip),%rax
mov    (%rax),%edi
mov    -0x2c(%rbp),%edx
lea    0xdb4(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x30(%rbp),%eax
jge    1313 <main+0x193>
mov    0x2cf9(%rip),%rax
mov    (%rax),%edi
mov    -0x14(%rbp),%edx
movslq -0x14(%rbp),%rax
mov    -0xc0(%rbp,%rax,4),%ecx
lea    0xd8f(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    12d4 <main+0x154>
mov    0x2cc6(%rip),%rax
mov    (%rax),%edi
lea    0xd55(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x1c(%rbp),%edi
lea    -0xc0(%rbp),%rsi
lea    -0xf0(%rbp),%rcx
mov    $0xa,%edx
call   1090 <rice_decode_block@plt>
mov    %eax,-0xf4(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xf4(%rbp),%eax
jge    1394 <main+0x214>
mov    0x2c78(%rip),%rax
mov    (%rax),%edi
mov    -0x14(%rbp),%edx
movslq -0x14(%rbp),%rax
mov    -0xf0(%rbp,%rax,4),%ecx
lea    0xd20(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1352 <main+0x1d2>
lea    -0xf0(%rbp),%rsi
lea    -0x120(%rbp),%rdx
mov    $0xa,%edi
call   10a0 <unsigned_to_signed@plt>
mov    0x2c2d(%rip),%rax
mov    (%rax),%edi
lea    0xcbc(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xf4(%rbp),%eax
jge    140c <main+0x28c>
mov    0x2c00(%rip),%rax
mov    (%rax),%edi
mov    -0x14(%rbp),%edx
movslq -0x14(%rbp),%rax
mov    -0x120(%rbp,%rax,4),%ecx
lea    0xcba(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    13ca <main+0x24a>
xor    %eax,%eax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x100,%rsp
movl   $0x1,0xc(%rsp)
mov    0xea2(%rip),%rax
mov    %rax,0x30(%rsp)
movaps 0xe86(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xe6a(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
mov    0x2e2e(%rip),%r12
mov    (%r12),%edi
lea    0xe7b(%rip),%rbx
mov    %rbx,%rsi
xor    %edx,%edx
mov    $0xc8,%ecx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    (%r12),%edi
mov    %rbx,%rsi
mov    $0x1,%edx
mov    $0xea,%ecx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    (%r12),%edi
mov    %rbx,%rsi
mov    $0x2,%edx
mov    $0x86,%ecx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    (%r12),%edi
mov    %rbx,%rsi
mov    $0x3,%edx
mov    $0x9c,%ecx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    (%r12),%edi
mov    %rbx,%rsi
mov    $0x4,%edx
mov    $0x143,%ecx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    (%r12),%edi
mov    %rbx,%rsi
mov    $0x5,%edx
mov    $0x1c8,%ecx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    (%r12),%edi
mov    %rbx,%rsi
mov    $0x6,%edx
mov    $0xea,%ecx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    (%r12),%edi
mov    %rbx,%rsi
mov    $0x7,%edx
mov    $0x64,%ecx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    (%r12),%edi
mov    %rbx,%rsi
mov    $0x8,%edx
mov    $0x8a,%ecx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    (%r12),%edi
mov    %rbx,%rsi
mov    $0x9,%edx
mov    $0x14e,%ecx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    (%r12),%edi
lea    0xdc7(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
lea    0x10(%rsp),%rsi
lea    0xd0(%rsp),%r14
mov    $0xa,%edi
mov    %r14,%rdx
call   1040 <signed_to_unsigned@plt>
lea    0xc(%rsp),%rdx
mov    %r14,%rdi
mov    $0xa,%esi
call   1070 <get_opt_rice_param@plt>
mov    %eax,%r15d
mov    (%r12),%edi
lea    0xd56(%rip),%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    (%r12),%edi
mov    0xc(%rsp),%edx
lea    0xd5c(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
cvtsi2ssl 0xc(%rsp),%xmm0
mulss  0xce1(%rip),%xmm0
call   1030 <ceil@plt>
mov    %eax,%ebp
lea    0x70(%rsp),%rcx
mov    %r15d,%edi
mov    %r14,%rsi
mov    $0xa,%edx
call   1050 <rice_encode_block@plt>
mov    %eax,0xc(%rsp)
mov    (%r12),%edi
lea    0xd30(%rip),%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1060 <fprintf@plt>
test   %ebp,%ebp
jle    138d <main+0x21d>
mov    %ebp,%ebp
lea    0xd2d(%rip),%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%r12),%edi
mov    0x70(%rsp,%rbx,4),%ecx
mov    %r14,%rsi
mov    %ebx,%edx
xor    %eax,%eax
call   1060 <fprintf@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1370 <main+0x200>
mov    (%r12),%edi
lea    0xce0(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
lea    0x70(%rsp),%rsi
lea    0x40(%rsp),%rcx
mov    %r15d,%edi
mov    $0xa,%edx
call   1080 <rice_decode_block@plt>
mov    %eax,%r14d
mov    %eax,%r15d
test   %eax,%eax
jle    13ed <main+0x27d>
lea    0xcd8(%rip),%rbp
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    (%r12),%edi
mov    0x40(%rsp,%rbx,4),%ecx
mov    %rbp,%rsi
mov    %ebx,%edx
xor    %eax,%eax
call   1060 <fprintf@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    13d0 <main+0x260>
lea    0x40(%rsp),%rsi
lea    0xa0(%rsp),%rdx
mov    $0xa,%edi
call   1090 <unsigned_to_signed@plt>
mov    (%r12),%edi
lea    0xc69(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
test   %r14d,%r14d
jle    1450 <main+0x2e0>
lea    0xc8f(%rip),%rbx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    (%r12),%edi
mov    0xa0(%rsp,%rbp,4),%ecx
mov    %rbx,%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   1060 <fprintf@plt>
add    $0x1,%rbp
cmp    %rbp,%r15
jne    1430 <main+0x2c0>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.main.buffer = [10 x i32] [i32 200, i32 234, i32 134, i32 156, i32 323, i32 456, i32 234, i32 100, i32 138, i32 334]
@stderr = global i32 0
@.str = [16 x i8] c"Input[%d] = %d\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [30 x i8] c"Optimum rice parameter : %d\0A\0A\00"
@.str.3 = [20 x i8] c"%d bits required.\0A\0A\00"
@.str.4 = [19 x i8] c"%d bits written.\0A\0A\00"
@.str.5 = [18 x i8] c"Encoded[%d] = %d\0A\00"
@.str.6 = [18 x i8] c"Decoded[%d] = %d\0A\00"
@.str.7 = [23 x i8] c"Decompressed[%d] = %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i64
%10 = alloca i32
%11 = alloca i32
%12 = alloca [10 x i32]
%13 = alloca [10 x i32]
%14 = alloca [10 x i32]
%15 = alloca [10 x i32]
%16 = alloca i32
%17 = alloca [10 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %7
store i32 1, i32* %10
store i32 1, i32* %11
%18 = bitcast [10 x i32]* %12 to i8*
store i32 0, i32* %6
br label %19
19: ; preds = %30, %2
%20 = load i32, i32* %6
%21 = icmp slt i32 %20, 10
br i1 %21, label %22, label %33
22: ; preds = %19
%23 = load i32, i32* @stderr
%24 = load i32, i32* %6
%25 = load i32, i32* %6
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds [10 x i32], [10 x i32]* %12, i64 0, i64 %26
%28 = load i32, i32* %27
%29 = call i32 (i32, i8*, ...) @fprintf(i32 %23, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %24, i32 %28)
br label %30
30: ; preds = %22
%31 = load i32, i32* %6
%32 = add nsw i32 %31, 1
store i32 %32, i32* %6
br label %19
33: ; preds = %19
%34 = load i32, i32* @stderr
%35 = call i32 (i32, i8*, ...) @fprintf(i32 %34, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%36 = getelementptr inbounds [10 x i32], [10 x i32]* %12, i64 0, i64 0
%37 = getelementptr inbounds [10 x i32], [10 x i32]* %13, i64 0, i64 0
%38 = call i32 @signed_to_unsigned(i32 10, i32* %36, i32* %37)
%39 = getelementptr inbounds [10 x i32], [10 x i32]* %13, i64 0, i64 0
%40 = call i32 @get_opt_rice_param(i32* %39, i32 10, i32* %10)
store i32 %40, i32* %8
%41 = load i32, i32* @stderr
%42 = load i32, i32* %8
%43 = call i32 (i32, i8*, ...) @fprintf(i32 %41, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i32 %42)
%44 = load i32, i32* @stderr
%45 = load i32, i32* %10
%46 = call i32 (i32, i8*, ...) @fprintf(i32 %44, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i32 %45)
%47 = load i32, i32* %10
%48 = sitofp i32 %47 to float
%49 = fdiv float %48, 3.200000e+01
%50 = call i32 @ceil(float %49)
store i32 %50, i32* %11
%51 = load i32, i32* %8
%52 = getelementptr inbounds [10 x i32], [10 x i32]* %13, i64 0, i64 0
%53 = getelementptr inbounds [10 x i32], [10 x i32]* %14, i64 0, i64 0
%54 = call i32 @rice_encode_block(i32 %51, i32* %52, i32 10, i32* %53)
store i32 %54, i32* %10
%55 = load i32, i32* @stderr
%56 = load i32, i32* %10
%57 = call i32 (i32, i8*, ...) @fprintf(i32 %55, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), i32 %56)
store i32 0, i32* %6
br label %58
58: ; preds = %70, %33
%59 = load i32, i32* %6
%60 = load i32, i32* %11
%61 = icmp slt i32 %59, %60
br i1 %61, label %62, label %73
62: ; preds = %58
%63 = load i32, i32* @stderr
%64 = load i32, i32* %6
%65 = load i32, i32* %6
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds [10 x i32], [10 x i32]* %14, i64 0, i64 %66
%68 = load i32, i32* %67
%69 = call i32 (i32, i8*, ...) @fprintf(i32 %63, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i32 %64, i32 %68)
br label %70
70: ; preds = %62
%71 = load i32, i32* %6
%72 = add nsw i32 %71, 1
store i32 %72, i32* %6
br label %58
73: ; preds = %58
%74 = load i32, i32* @stderr
%75 = call i32 (i32, i8*, ...) @fprintf(i32 %74, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%76 = load i32, i32* %8
%77 = getelementptr inbounds [10 x i32], [10 x i32]* %14, i64 0, i64 0
%78 = getelementptr inbounds [10 x i32], [10 x i32]* %15, i64 0, i64 0
%79 = call i32 @rice_decode_block(i32 %76, i32* %77, i32 10, i32* %78)
store i32 %79, i32* %16
store i32 0, i32* %6
br label %80
80: ; preds = %92, %73
%81 = load i32, i32* %6
%82 = load i32, i32* %16
%83 = icmp slt i32 %81, %82
br i1 %83, label %84, label %95
84: ; preds = %80
%85 = load i32, i32* @stderr
%86 = load i32, i32* %6
%87 = load i32, i32* %6
%88 = sext i32 %87 to i64
%89 = getelementptr inbounds [10 x i32], [10 x i32]* %15, i64 0, i64 %88
%90 = load i32, i32* %89
%91 = call i32 (i32, i8*, ...) @fprintf(i32 %85, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0), i32 %86, i32 %90)
br label %92
92: ; preds = %84
%93 = load i32, i32* %6
%94 = add nsw i32 %93, 1
store i32 %94, i32* %6
br label %80
95: ; preds = %80
%96 = getelementptr inbounds [10 x i32], [10 x i32]* %15, i64 0, i64 0
%97 = getelementptr inbounds [10 x i32], [10 x i32]* %17, i64 0, i64 0
%98 = call i32 @unsigned_to_signed(i32 10, i32* %96, i32* %97)
%99 = load i32, i32* @stderr
%100 = call i32 (i32, i8*, ...) @fprintf(i32 %99, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %6
br label %101
101: ; preds = %113, %95
%102 = load i32, i32* %6
%103 = load i32, i32* %16
%104 = icmp slt i32 %102, %103
br i1 %104, label %105, label %116
105: ; preds = %101
%106 = load i32, i32* @stderr
%107 = load i32, i32* %6
%108 = load i32, i32* %6
%109 = sext i32 %108 to i64
%110 = getelementptr inbounds [10 x i32], [10 x i32]* %17, i64 0, i64 %109
%111 = load i32, i32* %110
%112 = call i32 (i32, i8*, ...) @fprintf(i32 %106, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.7, i64 0, i64 0), i32 %107, i32 %111)
br label %113
113: ; preds = %105
%114 = load i32, i32* %6
%115 = add nsw i32 %114, 1
store i32 %115, i32* %6
br label %101
116: ; preds = %101
ret i32 0
}

LLVM IR (-O2):
@__const.main.buffer = [10 x i32] [i32 200, i32 234, i32 134, i32 156, i32 323, i32 456, i32 234, i32 100, i32 138, i32 334]
@stderr = global i32 0
@.str = [16 x i8] c"Input[%d] = %d\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [30 x i8] c"Optimum rice parameter : %d\0A\0A\00"
@.str.3 = [20 x i8] c"%d bits required.\0A\0A\00"
@.str.4 = [19 x i8] c"%d bits written.\0A\0A\00"
@.str.5 = [18 x i8] c"Encoded[%d] = %d\0A\00"
@.str.6 = [18 x i8] c"Decoded[%d] = %d\0A\00"
@.str.7 = [23 x i8] c"Decompressed[%d] = %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca [10 x i32]
%5 = alloca [10 x i32]
%6 = alloca [10 x i32]
%7 = alloca [10 x i32]
%8 = alloca [10 x i32]
%9 = bitcast i32* %3 to i8*
store i32 1, i32* %3
%10 = bitcast [10 x i32]* %4 to i8*
%11 = bitcast [10 x i32]* %5 to i8*
%12 = load i32, i32* @stderr
%13 = getelementptr inbounds [10 x i32], [10 x i32]* %4, i64 0, i64 0
%14 = tail call i32 (i32, i8*, ...) @fprintf(i32 %12, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 0, i32 200)
%15 = load i32, i32* @stderr
%16 = tail call i32 (i32, i8*, ...) @fprintf(i32 %15, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 1, i32 234)
%17 = load i32, i32* @stderr
%18 = tail call i32 (i32, i8*, ...) @fprintf(i32 %17, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 2, i32 134)
%19 = load i32, i32* @stderr
%20 = tail call i32 (i32, i8*, ...) @fprintf(i32 %19, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 3, i32 156)
%21 = load i32, i32* @stderr
%22 = tail call i32 (i32, i8*, ...) @fprintf(i32 %21, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 4, i32 323)
%23 = load i32, i32* @stderr
%24 = tail call i32 (i32, i8*, ...) @fprintf(i32 %23, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 5, i32 456)
%25 = load i32, i32* @stderr
%26 = tail call i32 (i32, i8*, ...) @fprintf(i32 %25, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 6, i32 234)
%27 = load i32, i32* @stderr
%28 = tail call i32 (i32, i8*, ...) @fprintf(i32 %27, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 7, i32 100)
%29 = load i32, i32* @stderr
%30 = tail call i32 (i32, i8*, ...) @fprintf(i32 %29, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 8, i32 138)
%31 = load i32, i32* @stderr
%32 = tail call i32 (i32, i8*, ...) @fprintf(i32 %31, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 9, i32 334)
%33 = load i32, i32* @stderr
%34 = tail call i32 (i32, i8*, ...) @fprintf(i32 %33, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%35 = getelementptr inbounds [10 x i32], [10 x i32]* %5, i64 0, i64 0
%36 = call i32 @signed_to_unsigned(i32 10, i32* %13, i32* %35)
%37 = call i32 @get_opt_rice_param(i32* %35, i32 10, i32* %3)
%38 = load i32, i32* @stderr
%39 = call i32 (i32, i8*, ...) @fprintf(i32 %38, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i32 %37)
%40 = load i32, i32* @stderr
%41 = load i32, i32* %3
%42 = call i32 (i32, i8*, ...) @fprintf(i32 %40, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i32 %41)
%43 = load i32, i32* %3
%44 = sitofp i32 %43 to float
%45 = fmul float %44, 3.125000e-02
%46 = call i32 @ceil(float %45)
%47 = bitcast [10 x i32]* %6 to i8*
%48 = getelementptr inbounds [10 x i32], [10 x i32]* %6, i64 0, i64 0
%49 = call i32 @rice_encode_block(i32 %37, i32* %35, i32 10, i32* %48)
store i32 %49, i32* %3
%50 = load i32, i32* @stderr
%51 = call i32 (i32, i8*, ...) @fprintf(i32 %50, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), i32 %49)
%52 = icmp sgt i32 %46, 0
br i1 %52, label %53, label %64
53: ; preds = %2
%54 = zext i32 %46 to i64
br label %55
55: ; preds = %53, %55
%56 = phi i64 [ 0, %53 ], [ %62, %55 ]
%57 = load i32, i32* @stderr
%58 = getelementptr inbounds [10 x i32], [10 x i32]* %6, i64 0, i64 %56
%59 = load i32, i32* %58
%60 = trunc i64 %56 to i32
%61 = call i32 (i32, i8*, ...) @fprintf(i32 %57, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i32 %60, i32 %59)
%62 = add nuw nsw i64 %56, 1
%63 = icmp eq i64 %62, %54
br i1 %63, label %64, label %55
64: ; preds = %55, %2
%65 = load i32, i32* @stderr
%66 = call i32 (i32, i8*, ...) @fprintf(i32 %65, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%67 = bitcast [10 x i32]* %7 to i8*
%68 = getelementptr inbounds [10 x i32], [10 x i32]* %7, i64 0, i64 0
%69 = call i32 @rice_decode_block(i32 %37, i32* %48, i32 10, i32* %68)
%70 = icmp sgt i32 %69, 0
br i1 %70, label %71, label %82
71: ; preds = %64
%72 = zext i32 %69 to i64
br label %73
73: ; preds = %71, %73
%74 = phi i64 [ 0, %71 ], [ %80, %73 ]
%75 = load i32, i32* @stderr
%76 = getelementptr inbounds [10 x i32], [10 x i32]* %7, i64 0, i64 %74
%77 = load i32, i32* %76
%78 = trunc i64 %74 to i32
%79 = call i32 (i32, i8*, ...) @fprintf(i32 %75, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0), i32 %78, i32 %77)
%80 = add nuw nsw i64 %74, 1
%81 = icmp eq i64 %80, %72
br i1 %81, label %82, label %73
82: ; preds = %73, %64
%83 = bitcast [10 x i32]* %8 to i8*
%84 = getelementptr inbounds [10 x i32], [10 x i32]* %8, i64 0, i64 0
%85 = call i32 @unsigned_to_signed(i32 10, i32* %68, i32* %84)
%86 = load i32, i32* @stderr
%87 = call i32 (i32, i8*, ...) @fprintf(i32 %86, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br i1 %70, label %88, label %99
88: ; preds = %82
%89 = zext i32 %69 to i64
br label %90
90: ; preds = %88, %90
%91 = phi i64 [ 0, %88 ], [ %97, %90 ]
%92 = load i32, i32* @stderr
%93 = getelementptr inbounds [10 x i32], [10 x i32]* %8, i64 0, i64 %91
%94 = load i32, i32* %93
%95 = trunc i64 %91 to i32
%96 = call i32 (i32, i8*, ...) @fprintf(i32 %92, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.7, i64 0, i64 0), i32 %95, i32 %94)
%97 = add nuw nsw i64 %91, 1
%98 = icmp eq i64 %97, %89
br i1 %98, label %99, label %90
99: ; preds = %90, %82
ret i32 0
}