#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 */

/* Variables and functions */
int /*<<< orphan*/ compress_quantized_vel(int *, int *, int const, int const,
                                          int, int, int, int, int,
                                          unsigned long const,
                                          unsigned long const, int *, char *);
int /*<<< orphan*/ determine_best_vel_coding(int *, int *, int const, int const,
                                             int, unsigned long const,
                                             unsigned long const, int *, int *);
int /*<<< orphan*/ determine_best_vel_initial_coding(int *, int const, int,
                                                     unsigned long const,
                                                     unsigned long const, int *,
                                                     int *);
int /*<<< orphan*/ free(int *);
void *malloc(int const);
int /*<<< orphan*/ quant_inter_differences(int *, int const, int const, int *);
char *tng_compress_vel_int(int *vel, const int natoms, const int nframes,
                           const unsigned long prec_hi,
                           const unsigned long prec_lo, int speed, int *algo,
                           int *nitems) {
  char *data = malloc(natoms * nframes * 14 + 11 * 4);
  int *quant = vel;
  int *quant_inter = malloc(natoms * nframes * 3 * sizeof *quant_inter);
  int initial_coding, initial_coding_parameter;
  int coding, coding_parameter;
  if (speed == 0)
    speed = 2;
  if (speed < 1)
    speed = 1;
  if (speed > 6)
    speed = 6;
  initial_coding = algo[0];
  initial_coding_parameter = algo[1];
  coding = algo[2];
  coding_parameter = algo[3];
  quant_inter_differences(quant, natoms, nframes, quant_inter);
  if (initial_coding == -1) {
    initial_coding_parameter = -1;
    determine_best_vel_initial_coding(quant, natoms, speed, prec_hi, prec_lo,
                                      &initial_coding,
                                      &initial_coding_parameter);
  } else if (initial_coding_parameter == -1) {
    determine_best_vel_initial_coding(quant, natoms, speed, prec_hi, prec_lo,
                                      &initial_coding,
                                      &initial_coding_parameter);
  }
  if (nframes == 1) {
    coding = 0;
    coding_parameter = 0;
  }
  if (nframes > 1) {
    if (coding == -1) {
      coding_parameter = -1;
      determine_best_vel_coding(quant, quant_inter, natoms, nframes, speed,
                                prec_hi, prec_lo, &coding, &coding_parameter);
    } else if (coding_parameter == -1) {
      determine_best_vel_coding(quant, quant_inter, natoms, nframes, speed,
                                prec_hi, prec_lo, &coding, &coding_parameter);
    }
  }
  compress_quantized_vel(quant, quant_inter, natoms, nframes, speed,
                         initial_coding, initial_coding_parameter, coding,
                         coding_parameter, prec_hi, prec_lo, nitems, data);
  free(quant_inter);
  if (algo[0] == -1)
    algo[0] = initial_coding;
  if (algo[1] == -1)
    algo[1] = initial_coding_parameter;
  if (algo[2] == -1)
    algo[2] = coding;
  if (algo[3] == -1)
    algo[3] = coding_parameter;
  return data;
}


x86 assembly (clang, -O0):
<tng_compress_vel_int>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x90,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x28(%rbp)
mov    %esi,-0x2c(%rbp)
mov    %edx,-0x30(%rbp)
mov    %rcx,-0x38(%rbp)
mov    %r8,-0x40(%rbp)
mov    %r9d,-0x44(%rbp)
mov    -0x2c(%rbp),%eax
imul   -0x30(%rbp),%eax
imul   $0xe,%eax,%edi
add    $0x2c,%edi
call   1060 <malloc@plt>
mov    %rax,-0x50(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x2c(%rbp),%eax
imul   -0x30(%rbp),%eax
imul   $0x3,%eax,%eax
cltq
shl    $0x2,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x60(%rbp)
cmpl   $0x0,-0x44(%rbp)
jne    11da <tng_compress_vel_int+0x7a>
movl   $0x2,-0x44(%rbp)
cmpl   $0x1,-0x44(%rbp)
jge    11eb <tng_compress_vel_int+0x8b>
movl   $0x1,-0x44(%rbp)
cmpl   $0x6,-0x44(%rbp)
jle    11fc <tng_compress_vel_int+0x9c>
movl   $0x6,-0x44(%rbp)
mov    0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x64(%rbp)
mov    0x10(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x68(%rbp)
mov    0x10(%rbp),%rax
mov    0x8(%rax),%eax
mov    %eax,-0x6c(%rbp)
mov    0x10(%rbp),%rax
mov    0xc(%rax),%eax
mov    %eax,-0x70(%rbp)
mov    -0x58(%rbp),%rdi
mov    -0x2c(%rbp),%esi
mov    -0x30(%rbp),%edx
mov    -0x60(%rbp),%rcx
call   1050 <quant_inter_differences@plt>
cmpl   $0xffffffff,-0x64(%rbp)
jne    126f <tng_compress_vel_int+0x10f>
movl   $0xffffffff,-0x68(%rbp)
mov    -0x58(%rbp),%rdi
mov    -0x2c(%rbp),%esi
mov    -0x44(%rbp),%edx
mov    -0x38(%rbp),%rcx
mov    -0x40(%rbp),%r8
lea    -0x64(%rbp),%r9
lea    -0x68(%rbp),%rax
mov    %rax,(%rsp)
call   1070 <determine_best_vel_initial_coding@plt>
jmp    12a1 <tng_compress_vel_int+0x141>
cmpl   $0xffffffff,-0x68(%rbp)
jne    129c <tng_compress_vel_int+0x13c>
mov    -0x58(%rbp),%rdi
mov    -0x2c(%rbp),%esi
mov    -0x44(%rbp),%edx
mov    -0x38(%rbp),%rcx
mov    -0x40(%rbp),%r8
lea    -0x64(%rbp),%r9
lea    -0x68(%rbp),%rax
mov    %rax,(%rsp)
call   1070 <determine_best_vel_initial_coding@plt>
jmp    12a1 <tng_compress_vel_int+0x141>
cmpl   $0x1,-0x30(%rbp)
jne    12b9 <tng_compress_vel_int+0x159>
movl   $0x0,-0x6c(%rbp)
movl   $0x0,-0x70(%rbp)
cmpl   $0x1,-0x30(%rbp)
jle    1357 <tng_compress_vel_int+0x1f7>
cmpl   $0xffffffff,-0x6c(%rbp)
jne    130e <tng_compress_vel_int+0x1ae>
movl   $0xffffffff,-0x70(%rbp)
mov    -0x58(%rbp),%rdi
mov    -0x60(%rbp),%rsi
mov    -0x2c(%rbp),%edx
mov    -0x30(%rbp),%ecx
mov    -0x44(%rbp),%r8d
mov    -0x38(%rbp),%r9
mov    -0x40(%rbp),%r11
lea    -0x6c(%rbp),%r10
lea    -0x70(%rbp),%rax
mov    %r11,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1080 <determine_best_vel_coding@plt>
jmp    1352 <tng_compress_vel_int+0x1f2>
cmpl   $0xffffffff,-0x70(%rbp)
jne    134d <tng_compress_vel_int+0x1ed>
mov    -0x58(%rbp),%rdi
mov    -0x60(%rbp),%rsi
mov    -0x2c(%rbp),%edx
mov    -0x30(%rbp),%ecx
mov    -0x44(%rbp),%r8d
mov    -0x38(%rbp),%r9
mov    -0x40(%rbp),%r11
lea    -0x6c(%rbp),%r10
lea    -0x70(%rbp),%rax
mov    %r11,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1080 <determine_best_vel_coding@plt>
jmp    1352 <tng_compress_vel_int+0x1f2>
jmp    1357 <tng_compress_vel_int+0x1f7>
mov    -0x58(%rbp),%rdi
mov    -0x60(%rbp),%rsi
mov    -0x2c(%rbp),%edx
mov    -0x30(%rbp),%ecx
mov    -0x44(%rbp),%r8d
mov    -0x64(%rbp),%r9d
mov    -0x68(%rbp),%r12d
mov    -0x6c(%rbp),%r15d
mov    -0x70(%rbp),%r14d
mov    -0x38(%rbp),%rbx
mov    -0x40(%rbp),%r11
mov    0x18(%rbp),%r10
mov    -0x50(%rbp),%rax
mov    %r12d,(%rsp)
mov    %r15d,0x8(%rsp)
mov    %r14d,0x10(%rsp)
mov    %rbx,0x18(%rsp)
mov    %r11,0x20(%rsp)
mov    %r10,0x28(%rsp)
mov    %rax,0x30(%rsp)
call   1040 <compress_quantized_vel@plt>
mov    -0x60(%rbp),%rdi
call   1030 <free@plt>
mov    0x10(%rbp),%rax
cmpl   $0xffffffff,(%rax)
jne    13cf <tng_compress_vel_int+0x26f>
mov    -0x64(%rbp),%ecx
mov    0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    0x10(%rbp),%rax
cmpl   $0xffffffff,0x4(%rax)
jne    13e7 <tng_compress_vel_int+0x287>
mov    -0x68(%rbp),%ecx
mov    0x10(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    0x10(%rbp),%rax
cmpl   $0xffffffff,0x8(%rax)
jne    13ff <tng_compress_vel_int+0x29f>
mov    -0x6c(%rbp),%ecx
mov    0x10(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    0x10(%rbp),%rax
cmpl   $0xffffffff,0xc(%rax)
jne    1417 <tng_compress_vel_int+0x2b7>
mov    -0x70(%rbp),%ecx
mov    0x10(%rbp),%rax
mov    %ecx,0xc(%rax)
mov    -0x50(%rbp),%rax
add    $0x90,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<tng_compress_vel_int>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    %r9d,%ebx
mov    %r8,0x28(%rsp)
mov    %rcx,0x30(%rsp)
mov    %edx,%r14d
mov    %esi,%r15d
mov    %rdi,0x38(%rsp)
mov    0x80(%rsp),%r12
mov    %edx,%ebp
imul   %esi,%ebp
mov    %ebp,%edi
shl    $0x4,%edi
sub    %ebp,%edi
sub    %ebp,%edi
add    $0x2c,%edi
call   1060 <malloc@plt>
mov    %rax,0x40(%rsp)
shl    $0x2,%ebp
lea    0x0(%rbp,%rbp,2),%edi
call   1060 <malloc@plt>
test   %ebx,%ebx
mov    $0x2,%edx
cmovne %ebx,%edx
test   %edx,%edx
mov    $0x1,%ecx
cmovg  %edx,%ecx
cmp    $0x6,%ecx
mov    $0x6,%edx
cmovb  %ecx,%edx
mov    %edx,0x14(%rsp)
mov    (%r12),%ebp
mov    %ebp,0x1c(%rsp)
mov    0x4(%r12),%r13d
mov    %r13d,0x18(%rsp)
mov    0x8(%r12),%ecx
mov    %ecx,0x24(%rsp)
mov    %ecx,0x10(%rsp)
mov    0xc(%r12),%ecx
mov    %ecx,0x20(%rsp)
mov    %ecx,0x8(%rsp)
mov    0x38(%rsp),%rdi
mov    %rdi,%rbx
mov    %r15d,%r12d
mov    %r15d,%esi
mov    %rax,%r15
mov    %r14d,0xc(%rsp)
mov    %r14d,%edx
mov    %rax,%rcx
call   1050 <quant_inter_differences@plt>
cmp    $0xffffffff,%ebp
je     1242 <tng_compress_vel_int+0xe2>
cmp    $0xffffffff,%r13d
mov    0x30(%rsp),%r10
mov    0x28(%rsp),%r13
mov    %r12d,%r14d
mov    %rbx,%r12
jne    1288 <tng_compress_vel_int+0x128>
jmp    125a <tng_compress_vel_int+0xfa>
movl   $0xffffffff,0x18(%rsp)
ff
mov    0x30(%rsp),%r10
mov    0x28(%rsp),%r13
mov    %r12d,%r14d
mov    %rbx,%r12
sub    $0x8,%rsp
lea    0x20(%rsp),%rax
lea    0x24(%rsp),%r9
mov    %r12,%rdi
mov    %r14d,%esi
mov    0x1c(%rsp),%edx
mov    %r10,%rcx
mov    %r13,%r8
push   %rax
mov    %r10,%rbx
call   1070 <determine_best_vel_initial_coding@plt>
mov    %rbx,%r10
add    $0x10,%rsp
mov    0x88(%rsp),%r11
mov    0xc(%rsp),%ecx
cmp    $0x1,%ecx
jne    12ab <tng_compress_vel_int+0x14b>
movl   $0x0,0x10(%rsp)
movl   $0x0,0x8(%rsp)
jmp    1305 <tng_compress_vel_int+0x1a5>
jle    1305 <tng_compress_vel_int+0x1a5>
cmpl   $0xffffffff,0x24(%rsp)
je     12bd <tng_compress_vel_int+0x15d>
cmpl   $0xffffffff,0x20(%rsp)
jne    1305 <tng_compress_vel_int+0x1a5>
jmp    12c5 <tng_compress_vel_int+0x165>
movl   $0xffffffff,0x8(%rsp)
ff
sub    $0x8,%rsp
lea    0x10(%rsp),%rax
lea    0x18(%rsp),%rbp
mov    %r12,%rdi
mov    %r15,%rsi
mov    %r14d,%edx
mov    0x14(%rsp),%ecx
mov    0x1c(%rsp),%r8d
mov    %r10,%r9
push   %rax
push   %rbp
push   %r13
mov    %r10,%rbx
mov    %r11,%rbp
call   1080 <determine_best_vel_coding@plt>
mov    %rbp,%r11
mov    %rbx,%r10
mov    0x2c(%rsp),%ecx
add    $0x20,%rsp
mov    0x1c(%rsp),%r9d
mov    0x18(%rsp),%eax
mov    0x10(%rsp),%ebp
mov    0x8(%rsp),%ebx
sub    $0x8,%rsp
mov    %r12,%rdi
mov    %r15,%rsi
mov    %r14d,%edx
mov    0x1c(%rsp),%r8d
mov    0x48(%rsp),%r14
push   %r14
push   %r11
push   %r13
push   %r10
push   %rbx
push   %rbp
push   %rax
call   1040 <compress_quantized_vel@plt>
add    $0x40,%rsp
mov    %r15,%rdi
call   1030 <free@plt>
mov    0x80(%rsp),%rcx
cmpl   $0xffffffff,(%rcx)
je     137a <tng_compress_vel_int+0x21a>
cmpl   $0xffffffff,0x4(%rcx)
je     1386 <tng_compress_vel_int+0x226>
cmpl   $0xffffffff,0x8(%rcx)
je     1393 <tng_compress_vel_int+0x233>
cmpl   $0xffffffff,0xc(%rcx)
je     13a0 <tng_compress_vel_int+0x240>
mov    %r14,%rax
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x1c(%rsp),%eax
mov    %eax,(%rcx)
cmpl   $0xffffffff,0x4(%rcx)
jne    135c <tng_compress_vel_int+0x1fc>
mov    0x18(%rsp),%eax
mov    %eax,0x4(%rcx)
cmpl   $0xffffffff,0x8(%rcx)
jne    1362 <tng_compress_vel_int+0x202>
mov    0x10(%rsp),%eax
mov    %eax,0x8(%rcx)
cmpl   $0xffffffff,0xc(%rcx)
jne    1368 <tng_compress_vel_int+0x208>
mov    0x8(%rsp),%eax
mov    %eax,0xc(%rcx)
jmp    1368 <tng_compress_vel_int+0x208>

LLVM IR (-O0):
define i8* @tng_compress_vel_int(i32* %0, i32 %1, i32 %2, i64 %3, i64 %4, i32 %5, i32* %6, i32* %7) {
%9 = alloca i32*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i64
%13 = alloca i64
%14 = alloca i32
%15 = alloca i32*
%16 = alloca i32*
%17 = alloca i8*
%18 = alloca i32*
%19 = alloca i32*
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
store i32* %0, i32** %9
store i32 %1, i32* %10
store i32 %2, i32* %11
store i64 %3, i64* %12
store i64 %4, i64* %13
store i32 %5, i32* %14
store i32* %6, i32** %15
store i32* %7, i32** %16
%24 = load i32, i32* %10
%25 = load i32, i32* %11
%26 = mul nsw i32 %24, %25
%27 = mul nsw i32 %26, 14
%28 = add nsw i32 %27, 44
%29 = call i8* @malloc(i32 %28)
store i8* %29, i8** %17
%30 = load i32*, i32** %9
store i32* %30, i32** %18
%31 = load i32, i32* %10
%32 = load i32, i32* %11
%33 = mul nsw i32 %31, %32
%34 = mul nsw i32 %33, 3
%35 = sext i32 %34 to i64
%36 = mul i64 %35, 4
%37 = trunc i64 %36 to i32
%38 = call i8* @malloc(i32 %37)
%39 = bitcast i8* %38 to i32*
store i32* %39, i32** %19
%40 = load i32, i32* %14
%41 = icmp eq i32 %40, 0
br i1 %41, label %42, label %43
42: ; preds = %8
store i32 2, i32* %14
br label %43
43: ; preds = %42, %8
%44 = load i32, i32* %14
%45 = icmp slt i32 %44, 1
br i1 %45, label %46, label %47
46: ; preds = %43
store i32 1, i32* %14
br label %47
47: ; preds = %46, %43
%48 = load i32, i32* %14
%49 = icmp sgt i32 %48, 6
br i1 %49, label %50, label %51
50: ; preds = %47
store i32 6, i32* %14
br label %51
51: ; preds = %50, %47
%52 = load i32*, i32** %15
%53 = getelementptr inbounds i32, i32* %52, i64 0
%54 = load i32, i32* %53
store i32 %54, i32* %20
%55 = load i32*, i32** %15
%56 = getelementptr inbounds i32, i32* %55, i64 1
%57 = load i32, i32* %56
store i32 %57, i32* %21
%58 = load i32*, i32** %15
%59 = getelementptr inbounds i32, i32* %58, i64 2
%60 = load i32, i32* %59
store i32 %60, i32* %22
%61 = load i32*, i32** %15
%62 = getelementptr inbounds i32, i32* %61, i64 3
%63 = load i32, i32* %62
store i32 %63, i32* %23
%64 = load i32*, i32** %18
%65 = load i32, i32* %10
%66 = load i32, i32* %11
%67 = load i32*, i32** %19
%68 = call i32 @quant_inter_differences(i32* %64, i32 %65, i32 %66, i32* %67)
%69 = load i32, i32* %20
%70 = icmp eq i32 %69, -1
br i1 %70, label %71, label %78
71: ; preds = %51
store i32 -1, i32* %21
%72 = load i32*, i32** %18
%73 = load i32, i32* %10
%74 = load i32, i32* %14
%75 = load i64, i64* %12
%76 = load i64, i64* %13
%77 = call i32 @determine_best_vel_initial_coding(i32* %72, i32 %73, i32 %74, i64 %75, i64 %76, i32* %20, i32* %21)
br label %89
78: ; preds = %51
%79 = load i32, i32* %21
%80 = icmp eq i32 %79, -1
br i1 %80, label %81, label %88
81: ; preds = %78
%82 = load i32*, i32** %18
%83 = load i32, i32* %10
%84 = load i32, i32* %14
%85 = load i64, i64* %12
%86 = load i64, i64* %13
%87 = call i32 @determine_best_vel_initial_coding(i32* %82, i32 %83, i32 %84, i64 %85, i64 %86, i32* %20, i32* %21)
br label %88
88: ; preds = %81, %78
br label %89
89: ; preds = %88, %71
%90 = load i32, i32* %11
%91 = icmp eq i32 %90, 1
br i1 %91, label %92, label %93
92: ; preds = %89
store i32 0, i32* %22
store i32 0, i32* %23
br label %93
93: ; preds = %92, %89
%94 = load i32, i32* %11
%95 = icmp sgt i32 %94, 1
br i1 %95, label %96, label %122
96: ; preds = %93
%97 = load i32, i32* %22
%98 = icmp eq i32 %97, -1
br i1 %98, label %99, label %108
99: ; preds = %96
store i32 -1, i32* %23
%100 = load i32*, i32** %18
%101 = load i32*, i32** %19
%102 = load i32, i32* %10
%103 = load i32, i32* %11
%104 = load i32, i32* %14
%105 = load i64, i64* %12
%106 = load i64, i64* %13
%107 = call i32 @determine_best_vel_coding(i32* %100, i32* %101, i32 %102, i32 %103, i32 %104, i64 %105, i64 %106, i32* %22, i32* %23)
br label %121
108: ; preds = %96
%109 = load i32, i32* %23
%110 = icmp eq i32 %109, -1
br i1 %110, label %111, label %120
111: ; preds = %108
%112 = load i32*, i32** %18
%113 = load i32*, i32** %19
%114 = load i32, i32* %10
%115 = load i32, i32* %11
%116 = load i32, i32* %14
%117 = load i64, i64* %12
%118 = load i64, i64* %13
%119 = call i32 @determine_best_vel_coding(i32* %112, i32* %113, i32 %114, i32 %115, i32 %116, i64 %117, i64 %118, i32* %22, i32* %23)
br label %120
120: ; preds = %111, %108
br label %121
121: ; preds = %120, %99
br label %122
122: ; preds = %121, %93
%123 = load i32*, i32** %18
%124 = load i32*, i32** %19
%125 = load i32, i32* %10
%126 = load i32, i32* %11
%127 = load i32, i32* %14
%128 = load i32, i32* %20
%129 = load i32, i32* %21
%130 = load i32, i32* %22
%131 = load i32, i32* %23
%132 = load i64, i64* %12
%133 = load i64, i64* %13
%134 = load i32*, i32** %16
%135 = load i8*, i8** %17
%136 = call i32 @compress_quantized_vel(i32* %123, i32* %124, i32 %125, i32 %126, i32 %127, i32 %128, i32 %129, i32 %130, i32 %131, i64 %132, i64 %133, i32* %134, i8* %135)
%137 = load i32*, i32** %19
%138 = call i32 @free(i32* %137)
%139 = load i32*, i32** %15
%140 = getelementptr inbounds i32, i32* %139, i64 0
%141 = load i32, i32* %140
%142 = icmp eq i32 %141, -1
br i1 %142, label %143, label %147
143: ; preds = %122
%144 = load i32, i32* %20
%145 = load i32*, i32** %15
%146 = getelementptr inbounds i32, i32* %145, i64 0
store i32 %144, i32* %146
br label %147
147: ; preds = %143, %122
%148 = load i32*, i32** %15
%149 = getelementptr inbounds i32, i32* %148, i64 1
%150 = load i32, i32* %149
%151 = icmp eq i32 %150, -1
br i1 %151, label %152, label %156
152: ; preds = %147
%153 = load i32, i32* %21
%154 = load i32*, i32** %15
%155 = getelementptr inbounds i32, i32* %154, i64 1
store i32 %153, i32* %155
br label %156
156: ; preds = %152, %147
%157 = load i32*, i32** %15
%158 = getelementptr inbounds i32, i32* %157, i64 2
%159 = load i32, i32* %158
%160 = icmp eq i32 %159, -1
br i1 %160, label %161, label %165
161: ; preds = %156
%162 = load i32, i32* %22
%163 = load i32*, i32** %15
%164 = getelementptr inbounds i32, i32* %163, i64 2
store i32 %162, i32* %164
br label %165
165: ; preds = %161, %156
%166 = load i32*, i32** %15
%167 = getelementptr inbounds i32, i32* %166, i64 3
%168 = load i32, i32* %167
%169 = icmp eq i32 %168, -1
br i1 %169, label %170, label %174
170: ; preds = %165
%171 = load i32, i32* %23
%172 = load i32*, i32** %15
%173 = getelementptr inbounds i32, i32* %172, i64 3
store i32 %171, i32* %173
br label %174
174: ; preds = %170, %165
%175 = load i8*, i8** %17
ret i8* %175
}

LLVM IR (-O2):
define i8* @tng_compress_vel_int(i32* %0, i32 %1, i32 %2, i64 %3, i64 %4, i32 %5, i32* nocapture %6, i32* %7) {
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = mul nsw i32 %2, %1
%14 = mul nsw i32 %13, 14
%15 = add nsw i32 %14, 44
%16 = tail call i8* @malloc(i32 %15)
%17 = mul i32 %13, 12
%18 = tail call i8* @malloc(i32 %17)
%19 = bitcast i8* %18 to i32*
%20 = bitcast i32* %9 to i8*
%21 = bitcast i32* %10 to i8*
%22 = bitcast i32* %11 to i8*
%23 = bitcast i32* %12 to i8*
%24 = icmp eq i32 %5, 0
%25 = select i1 %24, i32 2, i32 %5
%26 = icmp sgt i32 %25, 1
%27 = select i1 %26, i32 %25, i32 1
%28 = icmp ult i32 %27, 6
%29 = select i1 %28, i32 %27, i32 6
%30 = load i32, i32* %6
store i32 %30, i32* %9
%31 = getelementptr inbounds i32, i32* %6, i64 1
%32 = load i32, i32* %31
store i32 %32, i32* %10
%33 = getelementptr inbounds i32, i32* %6, i64 2
%34 = load i32, i32* %33
store i32 %34, i32* %11
%35 = getelementptr inbounds i32, i32* %6, i64 3
%36 = load i32, i32* %35
store i32 %36, i32* %12
%37 = tail call i32 @quant_inter_differences(i32* %0, i32 %1, i32 %2, i32* %19)
%38 = icmp eq i32 %30, -1
br i1 %38, label %39, label %40
39: ; preds = %8
store i32 -1, i32* %10
br label %42
40: ; preds = %8
%41 = icmp eq i32 %32, -1
br i1 %41, label %42, label %44
42: ; preds = %40, %39
%43 = call i32 @determine_best_vel_initial_coding(i32* %0, i32 %1, i32 %29, i64 %3, i64 %4, i32* %9, i32* %10)
br label %44
44: ; preds = %42, %40
%45 = icmp eq i32 %2, 1
br i1 %45, label %46, label %47
46: ; preds = %44
store i32 0, i32* %11
store i32 0, i32* %12
br label %57
47: ; preds = %44
%48 = icmp sgt i32 %2, 1
br i1 %48, label %49, label %57
49: ; preds = %47
%50 = icmp eq i32 %34, -1
br i1 %50, label %51, label %53
51: ; preds = %49
store i32 -1, i32* %12
%52 = call i32 @determine_best_vel_coding(i32* %0, i32* %19, i32 %1, i32 %2, i32 %29, i64 %3, i64 %4, i32* %11, i32* %12)
br label %57
53: ; preds = %49
%54 = icmp eq i32 %36, -1
br i1 %54, label %55, label %57
55: ; preds = %53
%56 = call i32 @determine_best_vel_coding(i32* %0, i32* %19, i32 %1, i32 %2, i32 %29, i64 %3, i64 %4, i32* %11, i32* %12)
br label %57
57: ; preds = %46, %51, %55, %53, %47
%58 = load i32, i32* %9
%59 = load i32, i32* %10
%60 = load i32, i32* %11
%61 = load i32, i32* %12
%62 = call i32 @compress_quantized_vel(i32* %0, i32* %19, i32 %1, i32 %2, i32 %29, i32 %58, i32 %59, i32 %60, i32 %61, i64 %3, i64 %4, i32* %7, i8* %16)
%63 = call i32 @free(i32* %19)
%64 = load i32, i32* %6
%65 = icmp eq i32 %64, -1
br i1 %65, label %66, label %68
66: ; preds = %57
%67 = load i32, i32* %9
store i32 %67, i32* %6
br label %68
68: ; preds = %66, %57
%69 = load i32, i32* %31
%70 = icmp eq i32 %69, -1
br i1 %70, label %71, label %73
71: ; preds = %68
%72 = load i32, i32* %10
store i32 %72, i32* %31
br label %73
73: ; preds = %71, %68
%74 = load i32, i32* %33
%75 = icmp eq i32 %74, -1
br i1 %75, label %76, label %78
76: ; preds = %73
%77 = load i32, i32* %11
store i32 %77, i32* %33
br label %78
78: ; preds = %76, %73
%79 = load i32, i32* %35
%80 = icmp eq i32 %79, -1
br i1 %80, label %81, label %83
81: ; preds = %78
%82 = load i32, i32* %12
store i32 %82, i32* %35
br label %83
83: ; preds = %81, %78
ret i8* %16
}