#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_pos(int *, int *, int *, int const,
                                          int const, int, int, int, int, int,
                                          unsigned long const,
                                          unsigned long const, int *, char *);
int /*<<< orphan*/ determine_best_pos_coding(int *, int *, int *, int const,
                                             int const, int,
                                             unsigned long const,
                                             unsigned long const, int *, int *);
int /*<<< orphan*/ determine_best_pos_initial_coding(int *, 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 *);
int /*<<< orphan*/ quant_intra_differences(int *, int const, int const, int *);
char *tng_compress_pos_int(int *pos, 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 = pos;
  int *quant_intra = malloc(natoms * nframes * 3 * sizeof *quant_intra);
  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);
  quant_intra_differences(quant, natoms, nframes, quant_intra);
  if (initial_coding == -1) {
    initial_coding_parameter = -1;
    determine_best_pos_initial_coding(quant, quant_intra, natoms, speed,
                                      prec_hi, prec_lo, &initial_coding,
                                      &initial_coding_parameter);
  } else if (initial_coding_parameter == -1) {
    determine_best_pos_initial_coding(quant, quant_intra, 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_pos_coding(quant, quant_inter, quant_intra, natoms,
                                nframes, speed, prec_hi, prec_lo, &coding,
                                &coding_parameter);
    } else if (coding_parameter == -1) {
      determine_best_pos_coding(quant, quant_inter, quant_intra, natoms,
                                nframes, speed, prec_hi, prec_lo, &coding,
                                &coding_parameter);
    }
  }
  compress_quantized_pos(quant, quant_inter, quant_intra, natoms, nframes,
                         speed, initial_coding, initial_coding_parameter,
                         coding, coding_parameter, prec_hi, prec_lo, nitems,
                         data);
  free(quant_inter);
  free(quant_intra);
  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_pos_int>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x98,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x30(%rbp)
mov    %esi,-0x34(%rbp)
mov    %edx,-0x38(%rbp)
mov    %rcx,-0x40(%rbp)
mov    %r8,-0x48(%rbp)
mov    %r9d,-0x4c(%rbp)
mov    -0x34(%rbp),%eax
imul   -0x38(%rbp),%eax
imul   $0xe,%eax,%edi
add    $0x2c,%edi
call   1080 <malloc@plt>
mov    %rax,-0x58(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    -0x34(%rbp),%eax
imul   -0x38(%rbp),%eax
imul   $0x3,%eax,%eax
cltq
shl    $0x2,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x68(%rbp)
mov    -0x34(%rbp),%eax
imul   -0x38(%rbp),%eax
imul   $0x3,%eax,%eax
cltq
shl    $0x2,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x70(%rbp)
cmpl   $0x0,-0x4c(%rbp)
jne    1207 <tng_compress_pos_int+0x97>
movl   $0x2,-0x4c(%rbp)
cmpl   $0x1,-0x4c(%rbp)
jge    1218 <tng_compress_pos_int+0xa8>
movl   $0x1,-0x4c(%rbp)
cmpl   $0x6,-0x4c(%rbp)
jle    1229 <tng_compress_pos_int+0xb9>
movl   $0x6,-0x4c(%rbp)
mov    0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x74(%rbp)
mov    0x10(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x78(%rbp)
mov    0x10(%rbp),%rax
mov    0x8(%rax),%eax
mov    %eax,-0x7c(%rbp)
mov    0x10(%rbp),%rax
mov    0xc(%rax),%eax
mov    %eax,-0x80(%rbp)
mov    -0x60(%rbp),%rdi
mov    -0x34(%rbp),%esi
mov    -0x38(%rbp),%edx
mov    -0x70(%rbp),%rcx
call   1060 <quant_inter_differences@plt>
mov    -0x60(%rbp),%rdi
mov    -0x34(%rbp),%esi
mov    -0x38(%rbp),%edx
mov    -0x68(%rbp),%rcx
call   1070 <quant_intra_differences@plt>
cmpl   $0xffffffff,-0x74(%rbp)
jne    12b8 <tng_compress_pos_int+0x148>
movl   $0xffffffff,-0x78(%rbp)
mov    -0x60(%rbp),%rdi
mov    -0x68(%rbp),%rsi
mov    -0x34(%rbp),%edx
mov    -0x4c(%rbp),%ecx
mov    -0x40(%rbp),%r8
mov    -0x48(%rbp),%r9
lea    -0x74(%rbp),%r10
lea    -0x78(%rbp),%rax
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1050 <determine_best_pos_initial_coding@plt>
jmp    12f3 <tng_compress_pos_int+0x183>
cmpl   $0xffffffff,-0x78(%rbp)
jne    12ee <tng_compress_pos_int+0x17e>
mov    -0x60(%rbp),%rdi
mov    -0x68(%rbp),%rsi
mov    -0x34(%rbp),%edx
mov    -0x4c(%rbp),%ecx
mov    -0x40(%rbp),%r8
mov    -0x48(%rbp),%r9
lea    -0x74(%rbp),%r10
lea    -0x78(%rbp),%rax
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1050 <determine_best_pos_initial_coding@plt>
jmp    12f3 <tng_compress_pos_int+0x183>
cmpl   $0x1,-0x38(%rbp)
jne    130b <tng_compress_pos_int+0x19b>
movl   $0x0,-0x7c(%rbp)
movl   $0x0,-0x80(%rbp)
cmpl   $0x1,-0x38(%rbp)
jle    13bd <tng_compress_pos_int+0x24d>
cmpl   $0xffffffff,-0x7c(%rbp)
jne    136a <tng_compress_pos_int+0x1fa>
movl   $0xffffffff,-0x80(%rbp)
mov    -0x60(%rbp),%rdi
mov    -0x70(%rbp),%rsi
mov    -0x68(%rbp),%rdx
mov    -0x34(%rbp),%ecx
mov    -0x38(%rbp),%r8d
mov    -0x4c(%rbp),%r9d
mov    -0x40(%rbp),%rbx
mov    -0x48(%rbp),%r11
lea    -0x7c(%rbp),%r10
lea    -0x80(%rbp),%rax
mov    %rbx,(%rsp)
mov    %r11,0x8(%rsp)
mov    %r10,0x10(%rsp)
mov    %rax,0x18(%rsp)
call   1090 <determine_best_pos_coding@plt>
jmp    13b8 <tng_compress_pos_int+0x248>
cmpl   $0xffffffff,-0x80(%rbp)
jne    13b3 <tng_compress_pos_int+0x243>
mov    -0x60(%rbp),%rdi
mov    -0x70(%rbp),%rsi
mov    -0x68(%rbp),%rdx
mov    -0x34(%rbp),%ecx
mov    -0x38(%rbp),%r8d
mov    -0x4c(%rbp),%r9d
mov    -0x40(%rbp),%rbx
mov    -0x48(%rbp),%r11
lea    -0x7c(%rbp),%r10
lea    -0x80(%rbp),%rax
mov    %rbx,(%rsp)
mov    %r11,0x8(%rsp)
mov    %r10,0x10(%rsp)
mov    %rax,0x18(%rsp)
call   1090 <determine_best_pos_coding@plt>
jmp    13b8 <tng_compress_pos_int+0x248>
jmp    13bd <tng_compress_pos_int+0x24d>
mov    -0x60(%rbp),%rdi
mov    -0x70(%rbp),%rsi
mov    -0x68(%rbp),%rdx
mov    -0x34(%rbp),%ecx
mov    -0x38(%rbp),%r8d
mov    -0x4c(%rbp),%r9d
mov    -0x74(%rbp),%r13d
mov    -0x78(%rbp),%r12d
mov    -0x7c(%rbp),%r15d
mov    -0x80(%rbp),%r14d
mov    -0x40(%rbp),%rbx
mov    -0x48(%rbp),%r11
mov    0x18(%rbp),%r10
mov    -0x58(%rbp),%rax
mov    %r13d,(%rsp)
mov    %r12d,0x8(%rsp)
mov    %r15d,0x10(%rsp)
mov    %r14d,0x18(%rsp)
mov    %rbx,0x20(%rsp)
mov    %r11,0x28(%rsp)
mov    %r10,0x30(%rsp)
mov    %rax,0x38(%rsp)
call   1040 <compress_quantized_pos@plt>
mov    -0x70(%rbp),%rdi
call   1030 <free@plt>
mov    -0x68(%rbp),%rdi
call   1030 <free@plt>
mov    0x10(%rbp),%rax
cmpl   $0xffffffff,(%rax)
jne    1448 <tng_compress_pos_int+0x2d8>
mov    -0x74(%rbp),%ecx
mov    0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    0x10(%rbp),%rax
cmpl   $0xffffffff,0x4(%rax)
jne    1460 <tng_compress_pos_int+0x2f0>
mov    -0x78(%rbp),%ecx
mov    0x10(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    0x10(%rbp),%rax
cmpl   $0xffffffff,0x8(%rax)
jne    1478 <tng_compress_pos_int+0x308>
mov    -0x7c(%rbp),%ecx
mov    0x10(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    0x10(%rbp),%rax
cmpl   $0xffffffff,0xc(%rax)
jne    1490 <tng_compress_pos_int+0x320>
mov    -0x80(%rbp),%ecx
mov    0x10(%rbp),%rax
mov    %ecx,0xc(%rax)
mov    -0x58(%rbp),%rax
add    $0x98,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<tng_compress_pos_int>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
mov    %r9d,%r14d
mov    %r8,0x20(%rsp)
mov    %rcx,0x38(%rsp)
mov    %edx,0x34(%rsp)
mov    %esi,%r13d
mov    %rdi,0x40(%rsp)
mov    0x90(%rsp),%r12
mov    %edx,%ebp
imul   %esi,%ebp
mov    %ebp,%edi
shl    $0x4,%edi
sub    %ebp,%edi
sub    %ebp,%edi
add    $0x2c,%edi
call   1080 <malloc@plt>
mov    %rax,0x50(%rsp)
shl    $0x2,%ebp
lea    0x0(%rbp,%rbp,2),%ebp
mov    %ebp,%edi
call   1080 <malloc@plt>
mov    %rax,%r15
mov    %ebp,%edi
call   1080 <malloc@plt>
test   %r14d,%r14d
mov    $0x2,%edx
cmovne %r14d,%edx
test   %edx,%edx
mov    $0x1,%ecx
cmovg  %edx,%ecx
cmp    $0x6,%ecx
mov    $0x6,%edx
cmovb  %ecx,%edx
mov    %edx,0x8(%rsp)
mov    (%r12),%ebp
mov    %ebp,0x14(%rsp)
mov    0x4(%r12),%r14d
mov    %r14d,0x10(%rsp)
mov    0x8(%r12),%ecx
mov    %ecx,0x30(%rsp)
mov    %ecx,0x4(%rsp)
mov    0xc(%r12),%ecx
mov    0x34(%rsp),%r12d
mov    %ecx,0x2c(%rsp)
mov    %ecx,(%rsp)
mov    0x40(%rsp),%rbx
mov    %rbx,%rdi
mov    %r13d,%esi
mov    %r12d,%edx
mov    %rax,0x48(%rsp)
mov    %rax,%rcx
call   1060 <quant_inter_differences@plt>
mov    %rbx,%rdi
mov    %r13d,0xc(%rsp)
mov    %r13d,%esi
mov    %r12d,%r13d
mov    %r12d,%edx
mov    %r15,0x18(%rsp)
mov    %r15,%rcx
call   1070 <quant_intra_differences@plt>
cmp    $0xffffffff,%ebp
je     1275 <tng_compress_pos_int+0x105>
cmp    $0xffffffff,%r14d
mov    0x38(%rsp),%r14
mov    %rbx,%rbp
jne    12b2 <tng_compress_pos_int+0x142>
jmp    1285 <tng_compress_pos_int+0x115>
movl   $0xffffffff,0x10(%rsp)
ff
mov    0x38(%rsp),%r14
mov    %rbx,%rbp
lea    0x10(%rsp),%rax
lea    0x14(%rsp),%rbx
mov    %rbp,%rdi
mov    0x18(%rsp),%rsi
mov    0xc(%rsp),%edx
mov    0x8(%rsp),%ecx
mov    %r14,%r8
mov    0x20(%rsp),%r9
push   %rax
push   %rbx
call   1050 <determine_best_pos_initial_coding@plt>
add    $0x10,%rsp
cmp    $0x1,%r13d
mov    0x50(%rsp),%r12
mov    0x48(%rsp),%r15
jne    12d3 <tng_compress_pos_int+0x163>
movl   $0x0,0x4(%rsp)
movl   $0x0,(%rsp)
jmp    131c <tng_compress_pos_int+0x1ac>
jle    131c <tng_compress_pos_int+0x1ac>
cmpl   $0xffffffff,0x30(%rsp)
je     12e5 <tng_compress_pos_int+0x175>
cmpl   $0xffffffff,0x2c(%rsp)
jne    131c <tng_compress_pos_int+0x1ac>
jmp    12ec <tng_compress_pos_int+0x17c>
movl   $0xffffffff,(%rsp)
mov    %rsp,%rax
lea    0x4(%rsp),%rbx
mov    %rbp,%rdi
mov    %r15,%rsi
mov    0x18(%rsp),%rdx
mov    0xc(%rsp),%ecx
mov    %r13d,%r8d
mov    0x8(%rsp),%r9d
push   %rax
push   %rbx
push   0x30(%rsp)
push   %r14
call   1090 <determine_best_pos_coding@plt>
add    $0x20,%rsp
mov    0x14(%rsp),%r10d
mov    0x10(%rsp),%r11d
mov    0x4(%rsp),%ebx
mov    (%rsp),%eax
mov    %rbp,%rdi
mov    %r15,%rsi
mov    0x18(%rsp),%rbp
mov    %rbp,%rdx
mov    0xc(%rsp),%ecx
mov    %r13d,%r8d
mov    0x8(%rsp),%r9d
push   %r12
push   0xa0(%rsp)
push   0x30(%rsp)
push   %r14
push   %rax
push   %rbx
push   %r11
push   %r10
call   1040 <compress_quantized_pos@plt>
add    $0x40,%rsp
mov    %r15,%rdi
call   1030 <free@plt>
mov    %rbp,%rdi
call   1030 <free@plt>
mov    0x90(%rsp),%rcx
cmpl   $0xffffffff,(%rcx)
je     13a6 <tng_compress_pos_int+0x236>
cmpl   $0xffffffff,0x4(%rcx)
je     13b2 <tng_compress_pos_int+0x242>
cmpl   $0xffffffff,0x8(%rcx)
je     13bf <tng_compress_pos_int+0x24f>
cmpl   $0xffffffff,0xc(%rcx)
je     13cc <tng_compress_pos_int+0x25c>
mov    %r12,%rax
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x14(%rsp),%eax
mov    %eax,(%rcx)
cmpl   $0xffffffff,0x4(%rcx)
jne    1388 <tng_compress_pos_int+0x218>
mov    0x10(%rsp),%eax
mov    %eax,0x4(%rcx)
cmpl   $0xffffffff,0x8(%rcx)
jne    138e <tng_compress_pos_int+0x21e>
mov    0x4(%rsp),%eax
mov    %eax,0x8(%rcx)
cmpl   $0xffffffff,0xc(%rcx)
jne    1394 <tng_compress_pos_int+0x224>
mov    (%rsp),%eax
mov    %eax,0xc(%rcx)
jmp    1394 <tng_compress_pos_int+0x224>

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

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