#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 */
struct coder {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ Ptngc_coder_deinit(struct coder *);
struct coder *Ptngc_coder_init();
scalar_t__ Ptngc_i32x2_to_d(unsigned long, unsigned long);
int Ptngc_unpack_array(struct coder *, unsigned char *, int *, int, int, int,
                       int);
int /*<<< orphan*/ free(int *);
int *malloc(int);
int /*<<< orphan*/ memcpy(int *, int *, int);
unsigned long readbufferfix(unsigned char *, int);
int /*<<< orphan*/ unquantize(double *, int, int, scalar_t__, int *);
int /*<<< orphan*/ unquantize_float(float *, int, int, float, int *);
int /*<<< orphan*/ unquantize_inter_differences(double *, int, int, scalar_t__,
                                                int *);
int /*<<< orphan*/ unquantize_inter_differences_float(float *, int, int, float,
                                                      int *);
int /*<<< orphan*/ unquantize_inter_differences_int(int *, int, int, int *);
int tng_compress_uncompress_vel_gen(char *data, double *veld, float *velf,
                                    int *veli, unsigned long *prec_hi,
                                    unsigned long *prec_lo) {
  int bufloc = 0;
  int length;
  int natoms, nframes;
  int initial_coding, initial_coding_parameter;
  int coding, coding_parameter;
  int *quant = NULL;
  struct coder *coder = NULL;
  int rval = 0;
  int magic_int;
  magic_int = (int)readbufferfix((unsigned char *)data + bufloc, 4);
  bufloc += 4;
  if (magic_int != 0x56474E54) {
    rval = 1;
    goto error;
  }
  natoms = (int)readbufferfix((unsigned char *)data + bufloc, 4);
  bufloc += 4;
  nframes = (int)readbufferfix((unsigned char *)data + bufloc, 4);
  bufloc += 4;
  initial_coding = (int)readbufferfix((unsigned char *)data + bufloc, 4);
  bufloc += 4;
  initial_coding_parameter =
      (int)readbufferfix((unsigned char *)data + bufloc, 4);
  bufloc += 4;
  coding = (int)readbufferfix((unsigned char *)data + bufloc, 4);
  bufloc += 4;
  coding_parameter = (int)readbufferfix((unsigned char *)data + bufloc, 4);
  bufloc += 4;
  *prec_lo = readbufferfix((unsigned char *)data + bufloc, 4);
  bufloc += 4;
  *prec_hi = readbufferfix((unsigned char *)data + bufloc, 4);
  bufloc += 4;
  quant = malloc(natoms * nframes * 3 * sizeof *quant);
  length = (int)readbufferfix((unsigned char *)data + bufloc, 4);
  bufloc += 4;
  coder = Ptngc_coder_init();
  rval = Ptngc_unpack_array(coder, (unsigned char *)data + bufloc, quant,
                            natoms * 3, initial_coding,
                            initial_coding_parameter, natoms);
  Ptngc_coder_deinit(coder);
  if (rval)
    goto error;
  bufloc += length;
  if ((initial_coding == 1) || (initial_coding == 3) || (initial_coding == 9)) {
    if (veld)
      unquantize(veld, natoms, 1, (Ptngc_i32x2_to_d(*prec_hi, *prec_lo)),
                 quant);
    else if (velf)
      unquantize_float(velf, natoms, 1,
                       (float)(Ptngc_i32x2_to_d(*prec_hi, *prec_lo)), quant);
    else if (veli)
      memcpy(veli, quant, natoms * 3 * sizeof *veli);
  }
  if (nframes > 1) {
    bufloc += 4;
    coder = Ptngc_coder_init();
    rval = Ptngc_unpack_array(coder, (unsigned char *)data + bufloc,
                              quant + natoms * 3, (nframes - 1) * natoms * 3,
                              coding, coding_parameter, natoms);
    Ptngc_coder_deinit(coder);
    if (rval)
      goto error;
    if ((coding == 2) || (coding == 6) || (coding == 8)) {
      if (veld)
        unquantize_inter_differences(veld, natoms, nframes,
                                     (Ptngc_i32x2_to_d(*prec_hi, *prec_lo)),
                                     quant);
      else if (velf)
        unquantize_inter_differences_float(
            velf, natoms, nframes,
            (float)(Ptngc_i32x2_to_d(*prec_hi, *prec_lo)), quant);
      else if (veli)
        unquantize_inter_differences_int(veli, natoms, nframes, quant);
    } else if ((coding == 1) || (coding == 3) || (coding == 9)) {
      if (veld)
        unquantize(veld + natoms * 3, natoms, nframes - 1,
                   (Ptngc_i32x2_to_d(*prec_hi, *prec_lo)), quant + natoms * 3);
      else if (velf)
        unquantize_float(velf + natoms * 3, natoms, nframes - 1,
                         (float)(Ptngc_i32x2_to_d(*prec_hi, *prec_lo)),
                         quant + natoms * 3);
      else if (veli)
        memcpy(veli + natoms * 3, quant + natoms * 3,
               natoms * 3 * (nframes - 1) * sizeof *veli);
    }
  }
error:
  free(quant);
  return rval;
}


x86 assembly (clang, -O0):
<tng_compress_uncompress_vel_gen>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
movq   $0x0,-0x58(%rbp)
movq   $0x0,-0x60(%rbp)
movl   $0x0,-0x64(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0x34(%rbp),%rax
add    %rax,%rdi
mov    $0x4,%esi
call   1040 <readbufferfix@plt>
mov    %eax,-0x68(%rbp)
mov    -0x34(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x34(%rbp)
cmpl   $0x56474e54,-0x68(%rbp)
je     124b <tng_compress_uncompress_vel_gen+0x7b>
movl   $0x1,-0x64(%rbp)
jmp    17e4 <tng_compress_uncompress_vel_gen+0x614>
mov    -0x8(%rbp),%rdi
movslq -0x34(%rbp),%rax
add    %rax,%rdi
mov    $0x4,%esi
call   1040 <readbufferfix@plt>
mov    %eax,-0x3c(%rbp)
mov    -0x34(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x34(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0x34(%rbp),%rax
add    %rax,%rdi
mov    $0x4,%esi
call   1040 <readbufferfix@plt>
mov    %eax,-0x40(%rbp)
mov    -0x34(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x34(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0x34(%rbp),%rax
add    %rax,%rdi
mov    $0x4,%esi
call   1040 <readbufferfix@plt>
mov    %eax,-0x44(%rbp)
mov    -0x34(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x34(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0x34(%rbp),%rax
add    %rax,%rdi
mov    $0x4,%esi
call   1040 <readbufferfix@plt>
mov    %eax,-0x48(%rbp)
mov    -0x34(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x34(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0x34(%rbp),%rax
add    %rax,%rdi
mov    $0x4,%esi
call   1040 <readbufferfix@plt>
mov    %eax,-0x4c(%rbp)
mov    -0x34(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x34(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0x34(%rbp),%rax
add    %rax,%rdi
mov    $0x4,%esi
call   1040 <readbufferfix@plt>
mov    %eax,-0x50(%rbp)
mov    -0x34(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x34(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0x34(%rbp),%rax
add    %rax,%rdi
mov    $0x4,%esi
call   1040 <readbufferfix@plt>
mov    %rax,%rcx
mov    -0x30(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x34(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x34(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0x34(%rbp),%rax
add    %rax,%rdi
mov    $0x4,%esi
call   1040 <readbufferfix@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x34(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x34(%rbp)
mov    -0x3c(%rbp),%eax
imul   -0x40(%rbp),%eax
imul   $0x3,%eax,%eax
cltq
shl    $0x2,%rax
mov    %eax,%edi
call   10a0 <malloc@plt>
mov    %rax,-0x58(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0x34(%rbp),%rax
add    %rax,%rdi
mov    $0x4,%esi
call   1040 <readbufferfix@plt>
mov    %eax,-0x38(%rbp)
mov    -0x34(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x34(%rbp)
mov    $0x0,%al
call   1080 <Ptngc_coder_init@plt>
mov    %rax,-0x60(%rbp)
mov    -0x60(%rbp),%rdi
mov    -0x8(%rbp),%rsi
movslq -0x34(%rbp),%rax
add    %rax,%rsi
mov    -0x58(%rbp),%rdx
imul   $0x3,-0x3c(%rbp),%ecx
mov    -0x44(%rbp),%r8d
mov    -0x48(%rbp),%r9d
mov    -0x3c(%rbp),%eax
mov    %eax,(%rsp)
call   10e0 <Ptngc_unpack_array@plt>
mov    %eax,-0x64(%rbp)
mov    -0x60(%rbp),%rdi
call   1070 <Ptngc_coder_deinit@plt>
cmpl   $0x0,-0x64(%rbp)
je     13ed <tng_compress_uncompress_vel_gen+0x21d>
jmp    17e4 <tng_compress_uncompress_vel_gen+0x614>
mov    -0x38(%rbp),%eax
add    -0x34(%rbp),%eax
mov    %eax,-0x34(%rbp)
cmpl   $0x1,-0x44(%rbp)
je     1414 <tng_compress_uncompress_vel_gen+0x244>
cmpl   $0x3,-0x44(%rbp)
je     1414 <tng_compress_uncompress_vel_gen+0x244>
cmpl   $0x9,-0x44(%rbp)
jne    14e1 <tng_compress_uncompress_vel_gen+0x311>
cmpq   $0x0,-0x10(%rbp)
je     145d <tng_compress_uncompress_vel_gen+0x28d>
mov    -0x10(%rbp),%rax
mov    %rax,-0x78(%rbp)
mov    -0x3c(%rbp),%eax
mov    %eax,-0x6c(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%rdi
mov    -0x30(%rbp),%rax
mov    (%rax),%rsi
call   10f0 <Ptngc_i32x2_to_d@plt>
mov    -0x78(%rbp),%rdi
mov    -0x6c(%rbp),%esi
mov    %rax,%rcx
mov    -0x58(%rbp),%r8
mov    $0x1,%edx
call   10c0 <unquantize@plt>
jmp    14dc <tng_compress_uncompress_vel_gen+0x30c>
cmpq   $0x0,-0x18(%rbp)
je     14ae <tng_compress_uncompress_vel_gen+0x2de>
mov    -0x18(%rbp),%rax
mov    %rax,-0x88(%rbp)
mov    -0x3c(%rbp),%eax
mov    %eax,-0x7c(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%rdi
mov    -0x30(%rbp),%rax
mov    (%rax),%rsi
call   10f0 <Ptngc_i32x2_to_d@plt>
mov    -0x88(%rbp),%rdi
mov    -0x7c(%rbp),%esi
cvtsi2ss %rax,%xmm0
mov    -0x58(%rbp),%rcx
mov    $0x1,%edx
call   10b0 <unquantize_float@plt>
jmp    14d7 <tng_compress_uncompress_vel_gen+0x307>
cmpq   $0x0,-0x20(%rbp)
je     14d2 <tng_compress_uncompress_vel_gen+0x302>
mov    -0x20(%rbp),%rdi
mov    -0x58(%rbp),%rsi
imul   $0x3,-0x3c(%rbp),%eax
cltq
shl    $0x2,%rax
mov    %eax,%edx
call   1090 <memcpy@plt>
jmp    14d7 <tng_compress_uncompress_vel_gen+0x307>
jmp    14dc <tng_compress_uncompress_vel_gen+0x30c>
jmp    14e1 <tng_compress_uncompress_vel_gen+0x311>
cmpl   $0x1,-0x40(%rbp)
jle    17df <tng_compress_uncompress_vel_gen+0x60f>
mov    -0x34(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x34(%rbp)
mov    $0x0,%al
call   1080 <Ptngc_coder_init@plt>
mov    %rax,-0x60(%rbp)
mov    -0x60(%rbp),%rdi
mov    -0x8(%rbp),%rsi
movslq -0x34(%rbp),%rax
add    %rax,%rsi
mov    -0x58(%rbp),%rdx
imul   $0x3,-0x3c(%rbp),%eax
cltq
shl    $0x2,%rax
add    %rax,%rdx
mov    -0x40(%rbp),%eax
sub    $0x1,%eax
imul   -0x3c(%rbp),%eax
imul   $0x3,%eax,%ecx
mov    -0x4c(%rbp),%r8d
mov    -0x50(%rbp),%r9d
mov    -0x3c(%rbp),%eax
mov    %eax,(%rsp)
call   10e0 <Ptngc_unpack_array@plt>
mov    %eax,-0x64(%rbp)
mov    -0x60(%rbp),%rdi
call   1070 <Ptngc_coder_deinit@plt>
cmpl   $0x0,-0x64(%rbp)
je     155a <tng_compress_uncompress_vel_gen+0x38a>
jmp    17e4 <tng_compress_uncompress_vel_gen+0x614>
cmpl   $0x2,-0x4c(%rbp)
je     1578 <tng_compress_uncompress_vel_gen+0x3a8>
cmpl   $0x6,-0x4c(%rbp)
je     1578 <tng_compress_uncompress_vel_gen+0x3a8>
cmpl   $0x8,-0x4c(%rbp)
jne    1665 <tng_compress_uncompress_vel_gen+0x495>
cmpq   $0x0,-0x10(%rbp)
je     15d7 <tng_compress_uncompress_vel_gen+0x407>
mov    -0x10(%rbp),%rax
mov    %rax,-0x98(%rbp)
mov    -0x3c(%rbp),%eax
mov    %eax,-0x90(%rbp)
mov    -0x40(%rbp),%eax
mov    %eax,-0x8c(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%rdi
mov    -0x30(%rbp),%rax
mov    (%rax),%rsi
call   10f0 <Ptngc_i32x2_to_d@plt>
mov    -0x98(%rbp),%rdi
mov    -0x90(%rbp),%esi
mov    -0x8c(%rbp),%edx
mov    %rax,%rcx
mov    -0x58(%rbp),%r8
call   1060 <unquantize_inter_differences@plt>
jmp    1660 <tng_compress_uncompress_vel_gen+0x490>
cmpq   $0x0,-0x18(%rbp)
je     1638 <tng_compress_uncompress_vel_gen+0x468>
mov    -0x18(%rbp),%rax
mov    %rax,-0xa8(%rbp)
mov    -0x3c(%rbp),%eax
mov    %eax,-0xa0(%rbp)
mov    -0x40(%rbp),%eax
mov    %eax,-0x9c(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%rdi
mov    -0x30(%rbp),%rax
mov    (%rax),%rsi
call   10f0 <Ptngc_i32x2_to_d@plt>
mov    -0xa8(%rbp),%rdi
mov    -0xa0(%rbp),%esi
mov    -0x9c(%rbp),%edx
cvtsi2ss %rax,%xmm0
mov    -0x58(%rbp),%rcx
call   1050 <unquantize_inter_differences_float@plt>
jmp    165b <tng_compress_uncompress_vel_gen+0x48b>
cmpq   $0x0,-0x20(%rbp)
je     1656 <tng_compress_uncompress_vel_gen+0x486>
mov    -0x20(%rbp),%rdi
mov    -0x3c(%rbp),%esi
mov    -0x40(%rbp),%edx
mov    -0x58(%rbp),%rcx
call   10d0 <unquantize_inter_differences_int@plt>
jmp    165b <tng_compress_uncompress_vel_gen+0x48b>
jmp    1660 <tng_compress_uncompress_vel_gen+0x490>
jmp    17da <tng_compress_uncompress_vel_gen+0x60a>
cmpl   $0x1,-0x4c(%rbp)
je     1683 <tng_compress_uncompress_vel_gen+0x4b3>
cmpl   $0x3,-0x4c(%rbp)
je     1683 <tng_compress_uncompress_vel_gen+0x4b3>
cmpl   $0x9,-0x4c(%rbp)
jne    17d5 <tng_compress_uncompress_vel_gen+0x605>
cmpq   $0x0,-0x10(%rbp)
je     1700 <tng_compress_uncompress_vel_gen+0x530>
mov    -0x10(%rbp),%rax
imul   $0x3,-0x3c(%rbp),%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0xb8(%rbp)
mov    -0x3c(%rbp),%eax
mov    %eax,-0xb0(%rbp)
mov    -0x40(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xac(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%rdi
mov    -0x30(%rbp),%rax
mov    (%rax),%rsi
call   10f0 <Ptngc_i32x2_to_d@plt>
mov    -0xb8(%rbp),%rdi
mov    -0xb0(%rbp),%esi
mov    -0xac(%rbp),%edx
mov    %rax,%rcx
mov    -0x58(%rbp),%r8
imul   $0x3,-0x3c(%rbp),%eax
cltq
shl    $0x2,%rax
add    %rax,%r8
call   10c0 <unquantize@plt>
jmp    17d0 <tng_compress_uncompress_vel_gen+0x600>
cmpq   $0x0,-0x18(%rbp)
je     177f <tng_compress_uncompress_vel_gen+0x5af>
mov    -0x18(%rbp),%rax
imul   $0x3,-0x3c(%rbp),%ecx
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0xc8(%rbp)
mov    -0x3c(%rbp),%eax
mov    %eax,-0xc0(%rbp)
mov    -0x40(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xbc(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%rdi
mov    -0x30(%rbp),%rax
mov    (%rax),%rsi
call   10f0 <Ptngc_i32x2_to_d@plt>
mov    -0xc8(%rbp),%rdi
mov    -0xc0(%rbp),%esi
mov    -0xbc(%rbp),%edx
cvtsi2ss %rax,%xmm0
mov    -0x58(%rbp),%rcx
imul   $0x3,-0x3c(%rbp),%eax
cltq
shl    $0x2,%rax
add    %rax,%rcx
call   10b0 <unquantize_float@plt>
jmp    17cb <tng_compress_uncompress_vel_gen+0x5fb>
cmpq   $0x0,-0x20(%rbp)
je     17c6 <tng_compress_uncompress_vel_gen+0x5f6>
mov    -0x20(%rbp),%rdi
imul   $0x3,-0x3c(%rbp),%eax
cltq
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x58(%rbp),%rsi
imul   $0x3,-0x3c(%rbp),%eax
cltq
shl    $0x2,%rax
add    %rax,%rsi
imul   $0x3,-0x3c(%rbp),%eax
mov    -0x40(%rbp),%ecx
sub    $0x1,%ecx
imul   %ecx,%eax
cltq
shl    $0x2,%rax
mov    %eax,%edx
call   1090 <memcpy@plt>
jmp    17cb <tng_compress_uncompress_vel_gen+0x5fb>
jmp    17d0 <tng_compress_uncompress_vel_gen+0x600>
jmp    17d5 <tng_compress_uncompress_vel_gen+0x605>
jmp    17da <tng_compress_uncompress_vel_gen+0x60a>
jmp    17df <tng_compress_uncompress_vel_gen+0x60f>
jmp    17e4 <tng_compress_uncompress_vel_gen+0x614>
mov    -0x58(%rbp),%rdi
call   1030 <free@plt>
mov    -0x64(%rbp),%eax
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tng_compress_uncompress_vel_gen>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
mov    %r9,%r14
mov    %r8,%r15
mov    %rcx,%r13
mov    %rdx,%rbp
mov    %rsi,%rbx
mov    %rdi,%r12
mov    $0x4,%esi
call   1040 <readbufferfix@plt>
cmp    $0x56474e54,%eax
jne    1332 <tng_compress_uncompress_vel_gen+0x162>
mov    %rbx,0x40(%rsp)
mov    %r13,0x28(%rsp)
mov    %rbp,0x38(%rsp)
lea    0x4(%r12),%rdi
mov    $0x4,%esi
call   1040 <readbufferfix@plt>
mov    %r15,%rbx
mov    %rax,%r15
lea    0x8(%r12),%rdi
mov    $0x4,%esi
call   1040 <readbufferfix@plt>
mov    %rax,%rbp
lea    0xc(%r12),%rdi
mov    $0x4,%esi
call   1040 <readbufferfix@plt>
mov    %rax,%r13
lea    0x10(%r12),%rdi
mov    $0x4,%esi
call   1040 <readbufferfix@plt>
mov    %rax,0x8(%rsp)
lea    0x14(%r12),%rdi
mov    $0x4,%esi
call   1040 <readbufferfix@plt>
mov    %rax,0x60(%rsp)
lea    0x18(%r12),%rdi
mov    $0x4,%esi
call   1040 <readbufferfix@plt>
mov    %rax,0x58(%rsp)
lea    0x1c(%r12),%rdi
mov    $0x4,%esi
call   1040 <readbufferfix@plt>
mov    %rax,(%r14)
lea    0x20(%r12),%rdi
mov    $0x4,%esi
call   1040 <readbufferfix@plt>
mov    %rbx,0x20(%rsp)
mov    %rax,(%rbx)
mov    %r15d,%eax
mov    %rbp,0x30(%rsp)
imul   %ebp,%eax
shl    $0x20,%rax
lea    (%rax,%rax,2),%rdi
shr    $0x1e,%rdi
call   10a0 <malloc@plt>
mov    %r14,0x18(%rsp)
mov    %rax,%rbx
lea    0x24(%r12),%rdi
mov    $0x4,%esi
call   1040 <readbufferfix@plt>
mov    %rax,0x50(%rsp)
xor    %eax,%eax
call   1080 <Ptngc_coder_init@plt>
mov    %rax,%r14
lea    0x28(%r12),%rsi
lea    (%r15,%r15,2),%eax
mov    %r15d,(%rsp)
mov    %r14,%rdi
mov    %rbx,0x10(%rsp)
mov    %rbx,%rdx
mov    %eax,%ebx
mov    %eax,%ecx
mov    %r13,%r8
mov    0x8(%rsp),%r9
call   10e0 <Ptngc_unpack_array@plt>
mov    %eax,%ebp
mov    %r14,%rdi
call   1070 <Ptngc_coder_deinit@plt>
test   %ebp,%ebp
je     1352 <tng_compress_uncompress_vel_gen+0x182>
mov    0x10(%rsp),%rbx
jmp    1339 <tng_compress_uncompress_vel_gen+0x169>
mov    $0x1,%ebp
xor    %ebx,%ebx
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %ebp,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %ebx,0x4c(%rsp)
mov    %r15,0x8(%rsp)
cmp    $0x9,%r13d
mov    0x10(%rsp),%rbx
mov    0x20(%rsp),%rcx
ja     140c <tng_compress_uncompress_vel_gen+0x23c>
mov    $0x20a,%eax
bt     %r13d,%eax
jae    140c <tng_compress_uncompress_vel_gen+0x23c>
mov    0x40(%rsp),%rbp
test   %rbp,%rbp
je     13b2 <tng_compress_uncompress_vel_gen+0x1e2>
mov    (%rcx),%rdi
mov    0x18(%rsp),%rax
mov    (%rax),%rsi
call   10f0 <Ptngc_i32x2_to_d@plt>
mov    %rbp,%rdi
mov    0x8(%rsp),%rsi
mov    $0x1,%edx
mov    %rax,%rcx
mov    %rbx,%r8
call   10c0 <unquantize@plt>
jmp    140c <tng_compress_uncompress_vel_gen+0x23c>
mov    0x38(%rsp),%rbp
test   %rbp,%rbp
je     13e8 <tng_compress_uncompress_vel_gen+0x218>
mov    (%rcx),%rdi
mov    0x18(%rsp),%rax
mov    (%rax),%rsi
call   10f0 <Ptngc_i32x2_to_d@plt>
cvtsi2ss %rax,%xmm0
mov    %rbp,%rdi
mov    0x8(%rsp),%rsi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10b0 <unquantize_float@plt>
jmp    140c <tng_compress_uncompress_vel_gen+0x23c>
cmpq   $0x0,0x28(%rsp)
je     140c <tng_compress_uncompress_vel_gen+0x23c>
mov    0x8(%rsp),%rax
lea    0x0(,%rax,4),%eax
lea    (%rax,%rax,2),%edx
mov    0x28(%rsp),%rdi
mov    %rbx,%rsi
call   1090 <memcpy@plt>
mov    0x30(%rsp),%r15
cmp    $0x2,%r15d
jl     1480 <tng_compress_uncompress_vel_gen+0x2b0>
xor    %eax,%eax
call   1080 <Ptngc_coder_init@plt>
mov    %rax,%r14
mov    0x50(%rsp),%r13
add    $0x2c,%r13d
movslq %r13d,%rax
add    %rax,%r12
mov    0x4c(%rsp),%ecx
movslq %ecx,%r13
lea    (%rbx,%r13,4),%rdx
add    $0xffffffff,%r15d
imul   %r15d,%ecx
mov    0x8(%rsp),%rax
mov    %eax,(%rsp)
mov    %r14,%rdi
mov    %r12,%rsi
mov    %rdx,%r12
mov    0x60(%rsp),%rbp
mov    %ebp,%r8d
mov    0x58(%rsp),%r9
call   10e0 <Ptngc_unpack_array@plt>
mov    %eax,%ebx
mov    %r14,%rdi
call   1070 <Ptngc_coder_deinit@plt>
test   %ebx,%ebx
je     1487 <tng_compress_uncompress_vel_gen+0x2b7>
mov    %ebx,%ebp
mov    0x10(%rsp),%rbx
jmp    1339 <tng_compress_uncompress_vel_gen+0x169>
xor    %ebp,%ebp
jmp    1339 <tng_compress_uncompress_vel_gen+0x169>
cmp    $0x9,%ebp
ja     15c3 <tng_compress_uncompress_vel_gen+0x3f3>
mov    $0x144,%eax
bt     %ebp,%eax
mov    0x10(%rsp),%rbx
jb     14f5 <tng_compress_uncompress_vel_gen+0x325>
mov    $0x20a,%eax
bt     %ebp,%eax
mov    $0x0,%ebp
jae    1339 <tng_compress_uncompress_vel_gen+0x169>
mov    0x40(%rsp),%rax
test   %rax,%rax
je     1536 <tng_compress_uncompress_vel_gen+0x366>
lea    (%rax,%r13,8),%rbx
mov    0x20(%rsp),%rax
mov    (%rax),%rdi
mov    0x18(%rsp),%rax
mov    (%rax),%rsi
call   10f0 <Ptngc_i32x2_to_d@plt>
mov    %rbx,%rdi
mov    0x10(%rsp),%rbx
mov    0x8(%rsp),%rsi
mov    %r15d,%edx
mov    %rax,%rcx
mov    %r12,%r8
call   10c0 <unquantize@plt>
jmp    1339 <tng_compress_uncompress_vel_gen+0x169>
mov    0x40(%rsp),%r14
test   %r14,%r14
mov    $0x0,%ebp
je     1582 <tng_compress_uncompress_vel_gen+0x3b2>
mov    0x20(%rsp),%rax
mov    (%rax),%rdi
mov    0x18(%rsp),%rax
mov    (%rax),%rsi
call   10f0 <Ptngc_i32x2_to_d@plt>
mov    %r14,%rdi
mov    0x8(%rsp),%rsi
mov    0x30(%rsp),%rdx
mov    %rax,%rcx
mov    %rbx,%r8
call   1060 <unquantize_inter_differences@plt>
jmp    1339 <tng_compress_uncompress_vel_gen+0x169>
mov    0x38(%rsp),%rax
test   %rax,%rax
je     15cf <tng_compress_uncompress_vel_gen+0x3ff>
lea    (%rax,%r13,4),%rbx
mov    0x20(%rsp),%rax
mov    (%rax),%rdi
mov    0x18(%rsp),%rax
mov    (%rax),%rsi
call   10f0 <Ptngc_i32x2_to_d@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
mov    %rbx,%rdi
mov    0x10(%rsp),%rbx
mov    0x8(%rsp),%rsi
mov    %r15d,%edx
mov    %r12,%rcx
call   10b0 <unquantize_float@plt>
jmp    1339 <tng_compress_uncompress_vel_gen+0x169>
mov    0x38(%rsp),%r14
test   %r14,%r14
je     15fd <tng_compress_uncompress_vel_gen+0x42d>
mov    0x20(%rsp),%rax
mov    (%rax),%rdi
mov    0x18(%rsp),%rax
mov    (%rax),%rsi
call   10f0 <Ptngc_i32x2_to_d@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
mov    %r14,%rdi
mov    0x8(%rsp),%rsi
mov    0x30(%rsp),%rdx
mov    %rbx,%rcx
call   1050 <unquantize_inter_differences_float@plt>
jmp    1339 <tng_compress_uncompress_vel_gen+0x169>
mov    0x10(%rsp),%rbx
xor    %ebp,%ebp
jmp    1339 <tng_compress_uncompress_vel_gen+0x169>
mov    0x28(%rsp),%rcx
test   %rcx,%rcx
mov    0x8(%rsp),%rax
je     1339 <tng_compress_uncompress_vel_gen+0x169>
lea    (%rcx,%r13,4),%rdi
imul   %r15d,%eax
shl    $0x2,%eax
lea    (%rax,%rax,2),%edx
mov    %r12,%rsi
call   1090 <memcpy@plt>
jmp    1339 <tng_compress_uncompress_vel_gen+0x169>
mov    0x28(%rsp),%rdi
test   %rdi,%rdi
mov    0x8(%rsp),%rsi
je     1339 <tng_compress_uncompress_vel_gen+0x169>
mov    0x30(%rsp),%rdx
mov    %rbx,%rcx
call   10d0 <unquantize_inter_differences_int@plt>
jmp    1339 <tng_compress_uncompress_vel_gen+0x169>

LLVM IR (-O0):
%struct.coder = type { i32 }
define i32 @tng_compress_uncompress_vel_gen(i8* %0, double* %1, float* %2, i32* %3, i64* %4, i64* %5) {
%7 = alloca i8*
%8 = alloca double*
%9 = alloca float*
%10 = alloca i32*
%11 = alloca i64*
%12 = alloca i64*
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32*
%22 = alloca %struct.coder*
%23 = alloca i32
%24 = alloca i32
store i8* %0, i8** %7
store double* %1, double** %8
store float* %2, float** %9
store i32* %3, i32** %10
store i64* %4, i64** %11
store i64* %5, i64** %12
store i32 0, i32* %13
store i32* null, i32** %21
store %struct.coder* null, %struct.coder** %22
store i32 0, i32* %23
%25 = load i8*, i8** %7
%26 = load i32, i32* %13
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i8, i8* %25, i64 %27
%29 = call i64 @readbufferfix(i8* %28, i32 4)
%30 = trunc i64 %29 to i32
store i32 %30, i32* %24
%31 = load i32, i32* %13
%32 = add nsw i32 %31, 4
store i32 %32, i32* %13
%33 = load i32, i32* %24
%34 = icmp ne i32 %33, 1447513684
br i1 %34, label %35, label %36
35: ; preds = %6
store i32 1, i32* %23
br label %355
36: ; preds = %6
%37 = load i8*, i8** %7
%38 = load i32, i32* %13
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds i8, i8* %37, i64 %39
%41 = call i64 @readbufferfix(i8* %40, i32 4)
%42 = trunc i64 %41 to i32
store i32 %42, i32* %15
%43 = load i32, i32* %13
%44 = add nsw i32 %43, 4
store i32 %44, i32* %13
%45 = load i8*, i8** %7
%46 = load i32, i32* %13
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds i8, i8* %45, i64 %47
%49 = call i64 @readbufferfix(i8* %48, i32 4)
%50 = trunc i64 %49 to i32
store i32 %50, i32* %16
%51 = load i32, i32* %13
%52 = add nsw i32 %51, 4
store i32 %52, i32* %13
%53 = load i8*, i8** %7
%54 = load i32, i32* %13
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds i8, i8* %53, i64 %55
%57 = call i64 @readbufferfix(i8* %56, i32 4)
%58 = trunc i64 %57 to i32
store i32 %58, i32* %17
%59 = load i32, i32* %13
%60 = add nsw i32 %59, 4
store i32 %60, i32* %13
%61 = load i8*, i8** %7
%62 = load i32, i32* %13
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds i8, i8* %61, i64 %63
%65 = call i64 @readbufferfix(i8* %64, i32 4)
%66 = trunc i64 %65 to i32
store i32 %66, i32* %18
%67 = load i32, i32* %13
%68 = add nsw i32 %67, 4
store i32 %68, i32* %13
%69 = load i8*, i8** %7
%70 = load i32, i32* %13
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds i8, i8* %69, i64 %71
%73 = call i64 @readbufferfix(i8* %72, i32 4)
%74 = trunc i64 %73 to i32
store i32 %74, i32* %19
%75 = load i32, i32* %13
%76 = add nsw i32 %75, 4
store i32 %76, i32* %13
%77 = load i8*, i8** %7
%78 = load i32, i32* %13
%79 = sext i32 %78 to i64
%80 = getelementptr inbounds i8, i8* %77, i64 %79
%81 = call i64 @readbufferfix(i8* %80, i32 4)
%82 = trunc i64 %81 to i32
store i32 %82, i32* %20
%83 = load i32, i32* %13
%84 = add nsw i32 %83, 4
store i32 %84, i32* %13
%85 = load i8*, i8** %7
%86 = load i32, i32* %13
%87 = sext i32 %86 to i64
%88 = getelementptr inbounds i8, i8* %85, i64 %87
%89 = call i64 @readbufferfix(i8* %88, i32 4)
%90 = load i64*, i64** %12
store i64 %89, i64* %90
%91 = load i32, i32* %13
%92 = add nsw i32 %91, 4
store i32 %92, i32* %13
%93 = load i8*, i8** %7
%94 = load i32, i32* %13
%95 = sext i32 %94 to i64
%96 = getelementptr inbounds i8, i8* %93, i64 %95
%97 = call i64 @readbufferfix(i8* %96, i32 4)
%98 = load i64*, i64** %11
store i64 %97, i64* %98
%99 = load i32, i32* %13
%100 = add nsw i32 %99, 4
store i32 %100, i32* %13
%101 = load i32, i32* %15
%102 = load i32, i32* %16
%103 = mul nsw i32 %101, %102
%104 = mul nsw i32 %103, 3
%105 = sext i32 %104 to i64
%106 = mul i64 %105, 4
%107 = trunc i64 %106 to i32
%108 = call i32* @malloc(i32 %107)
store i32* %108, i32** %21
%109 = load i8*, i8** %7
%110 = load i32, i32* %13
%111 = sext i32 %110 to i64
%112 = getelementptr inbounds i8, i8* %109, i64 %111
%113 = call i64 @readbufferfix(i8* %112, i32 4)
%114 = trunc i64 %113 to i32
store i32 %114, i32* %14
%115 = load i32, i32* %13
%116 = add nsw i32 %115, 4
store i32 %116, i32* %13
%117 = call %struct.coder* (...) @Ptngc_coder_init()
store %struct.coder* %117, %struct.coder** %22
%118 = load %struct.coder*, %struct.coder** %22
%119 = load i8*, i8** %7
%120 = load i32, i32* %13
%121 = sext i32 %120 to i64
%122 = getelementptr inbounds i8, i8* %119, i64 %121
%123 = load i32*, i32** %21
%124 = load i32, i32* %15
%125 = mul nsw i32 %124, 3
%126 = load i32, i32* %17
%127 = load i32, i32* %18
%128 = load i32, i32* %15
%129 = call i32 @Ptngc_unpack_array(%struct.coder* %118, i8* %122, i32* %123, i32 %125, i32 %126, i32 %127, i32 %128)
store i32 %129, i32* %23
%130 = load %struct.coder*, %struct.coder** %22
%131 = call i32 @Ptngc_coder_deinit(%struct.coder* %130)
%132 = load i32, i32* %23
%133 = icmp ne i32 %132, 0
br i1 %133, label %134, label %135
134: ; preds = %36
br label %355
135: ; preds = %36
%136 = load i32, i32* %14
%137 = load i32, i32* %13
%138 = add nsw i32 %137, %136
store i32 %138, i32* %13
%139 = load i32, i32* %17
%140 = icmp eq i32 %139, 1
br i1 %140, label %147, label %141
141: ; preds = %135
%142 = load i32, i32* %17
%143 = icmp eq i32 %142, 3
br i1 %143, label %147, label %144
144: ; preds = %141
%145 = load i32, i32* %17
%146 = icmp eq i32 %145, 9
br i1 %146, label %147, label %189
147: ; preds = %144, %141, %135
%148 = load double*, double** %8
%149 = icmp ne double* %148, null
br i1 %149, label %150, label %160
150: ; preds = %147
%151 = load double*, double** %8
%152 = load i32, i32* %15
%153 = load i64*, i64** %11
%154 = load i64, i64* %153
%155 = load i64*, i64** %12
%156 = load i64, i64* %155
%157 = call i64 @Ptngc_i32x2_to_d(i64 %154, i64 %156)
%158 = load i32*, i32** %21
%159 = call i32 @unquantize(double* %151, i32 %152, i32 1, i64 %157, i32* %158)
br label %188
160: ; preds = %147
%161 = load float*, float** %9
%162 = icmp ne float* %161, null
br i1 %162, label %163, label %174
163: ; preds = %160
%164 = load float*, float** %9
%165 = load i32, i32* %15
%166 = load i64*, i64** %11
%167 = load i64, i64* %166
%168 = load i64*, i64** %12
%169 = load i64, i64* %168
%170 = call i64 @Ptngc_i32x2_to_d(i64 %167, i64 %169)
%171 = sitofp i64 %170 to float
%172 = load i32*, i32** %21
%173 = call i32 @unquantize_float(float* %164, i32 %165, i32 1, float %171, i32* %172)
br label %187
174: ; preds = %160
%175 = load i32*, i32** %10
%176 = icmp ne i32* %175, null
br i1 %176, label %177, label %186
177: ; preds = %174
%178 = load i32*, i32** %10
%179 = load i32*, i32** %21
%180 = load i32, i32* %15
%181 = mul nsw i32 %180, 3
%182 = sext i32 %181 to i64
%183 = mul i64 %182, 4
%184 = trunc i64 %183 to i32
%185 = call i32 @memcpy(i32* %178, i32* %179, i32 %184)
br label %186
186: ; preds = %177, %174
br label %187
187: ; preds = %186, %163
br label %188
188: ; preds = %187, %150
br label %189
189: ; preds = %188, %144
%190 = load i32, i32* %16
%191 = icmp sgt i32 %190, 1
br i1 %191, label %192, label %354
192: ; preds = %189
%193 = load i32, i32* %13
%194 = add nsw i32 %193, 4
store i32 %194, i32* %13
%195 = call %struct.coder* (...) @Ptngc_coder_init()
store %struct.coder* %195, %struct.coder** %22
%196 = load %struct.coder*, %struct.coder** %22
%197 = load i8*, i8** %7
%198 = load i32, i32* %13
%199 = sext i32 %198 to i64
%200 = getelementptr inbounds i8, i8* %197, i64 %199
%201 = load i32*, i32** %21
%202 = load i32, i32* %15
%203 = mul nsw i32 %202, 3
%204 = sext i32 %203 to i64
%205 = getelementptr inbounds i32, i32* %201, i64 %204
%206 = load i32, i32* %16
%207 = sub nsw i32 %206, 1
%208 = load i32, i32* %15
%209 = mul nsw i32 %207, %208
%210 = mul nsw i32 %209, 3
%211 = load i32, i32* %19
%212 = load i32, i32* %20
%213 = load i32, i32* %15
%214 = call i32 @Ptngc_unpack_array(%struct.coder* %196, i8* %200, i32* %205, i32 %210, i32 %211, i32 %212, i32 %213)
store i32 %214, i32* %23
%215 = load %struct.coder*, %struct.coder** %22
%216 = call i32 @Ptngc_coder_deinit(%struct.coder* %215)
%217 = load i32, i32* %23
%218 = icmp ne i32 %217, 0
br i1 %218, label %219, label %220
219: ; preds = %192
br label %355
220: ; preds = %192
%221 = load i32, i32* %19
%222 = icmp eq i32 %221, 2
br i1 %222, label %229, label %223
223: ; preds = %220
%224 = load i32, i32* %19
%225 = icmp eq i32 %224, 6
br i1 %225, label %229, label %226
226: ; preds = %223
%227 = load i32, i32* %19
%228 = icmp eq i32 %227, 8
br i1 %228, label %229, label %270
229: ; preds = %226, %223, %220
%230 = load double*, double** %8
%231 = icmp ne double* %230, null
br i1 %231, label %232, label %243
232: ; preds = %229
%233 = load double*, double** %8
%234 = load i32, i32* %15
%235 = load i32, i32* %16
%236 = load i64*, i64** %11
%237 = load i64, i64* %236
%238 = load i64*, i64** %12
%239 = load i64, i64* %238
%240 = call i64 @Ptngc_i32x2_to_d(i64 %237, i64 %239)
%241 = load i32*, i32** %21
%242 = call i32 @unquantize_inter_differences(double* %233, i32 %234, i32 %235, i64 %240, i32* %241)
br label %269
243: ; preds = %229
%244 = load float*, float** %9
%245 = icmp ne float* %244, null
br i1 %245, label %246, label %258
246: ; preds = %243
%247 = load float*, float** %9
%248 = load i32, i32* %15
%249 = load i32, i32* %16
%250 = load i64*, i64** %11
%251 = load i64, i64* %250
%252 = load i64*, i64** %12
%253 = load i64, i64* %252
%254 = call i64 @Ptngc_i32x2_to_d(i64 %251, i64 %253)
%255 = sitofp i64 %254 to float
%256 = load i32*, i32** %21
%257 = call i32 @unquantize_inter_differences_float(float* %247, i32 %248, i32 %249, float %255, i32* %256)
br label %268
258: ; preds = %243
%259 = load i32*, i32** %10
%260 = icmp ne i32* %259, null
br i1 %260, label %261, label %267
261: ; preds = %258
%262 = load i32*, i32** %10
%263 = load i32, i32* %15
%264 = load i32, i32* %16
%265 = load i32*, i32** %21
%266 = call i32 @unquantize_inter_differences_int(i32* %262, i32 %263, i32 %264, i32* %265)
br label %267
267: ; preds = %261, %258
br label %268
268: ; preds = %267, %246
br label %269
269: ; preds = %268, %232
br label %353
270: ; preds = %226
%271 = load i32, i32* %19
%272 = icmp eq i32 %271, 1
br i1 %272, label %279, label %273
273: ; preds = %270
%274 = load i32, i32* %19
%275 = icmp eq i32 %274, 3
br i1 %275, label %279, label %276
276: ; preds = %273
%277 = load i32, i32* %19
%278 = icmp eq i32 %277, 9
br i1 %278, label %279, label %352
279: ; preds = %276, %273, %270
%280 = load double*, double** %8
%281 = icmp ne double* %280, null
br i1 %281, label %282, label %302
282: ; preds = %279
%283 = load double*, double** %8
%284 = load i32, i32* %15
%285 = mul nsw i32 %284, 3
%286 = sext i32 %285 to i64
%287 = getelementptr inbounds double, double* %283, i64 %286
%288 = load i32, i32* %15
%289 = load i32, i32* %16
%290 = sub nsw i32 %289, 1
%291 = load i64*, i64** %11
%292 = load i64, i64* %291
%293 = load i64*, i64** %12
%294 = load i64, i64* %293
%295 = call i64 @Ptngc_i32x2_to_d(i64 %292, i64 %294)
%296 = load i32*, i32** %21
%297 = load i32, i32* %15
%298 = mul nsw i32 %297, 3
%299 = sext i32 %298 to i64
%300 = getelementptr inbounds i32, i32* %296, i64 %299
%301 = call i32 @unquantize(double* %287, i32 %288, i32 %290, i64 %295, i32* %300)
br label %351
302: ; preds = %279
%303 = load float*, float** %9
%304 = icmp ne float* %303, null
br i1 %304, label %305, label %326
305: ; preds = %302
%306 = load float*, float** %9
%307 = load i32, i32* %15
%308 = mul nsw i32 %307, 3
%309 = sext i32 %308 to i64
%310 = getelementptr inbounds float, float* %306, i64 %309
%311 = load i32, i32* %15
%312 = load i32, i32* %16
%313 = sub nsw i32 %312, 1
%314 = load i64*, i64** %11
%315 = load i64, i64* %314
%316 = load i64*, i64** %12
%317 = load i64, i64* %316
%318 = call i64 @Ptngc_i32x2_to_d(i64 %315, i64 %317)
%319 = sitofp i64 %318 to float
%320 = load i32*, i32** %21
%321 = load i32, i32* %15
%322 = mul nsw i32 %321, 3
%323 = sext i32 %322 to i64
%324 = getelementptr inbounds i32, i32* %320, i64 %323
%325 = call i32 @unquantize_float(float* %310, i32 %311, i32 %313, float %319, i32* %324)
br label %350
326: ; preds = %302
%327 = load i32*, i32** %10
%328 = icmp ne i32* %327, null
br i1 %328, label %329, label %349
329: ; preds = %326
%330 = load i32*, i32** %10
%331 = load i32, i32* %15
%332 = mul nsw i32 %331, 3
%333 = sext i32 %332 to i64
%334 = getelementptr inbounds i32, i32* %330, i64 %333
%335 = load i32*, i32** %21
%336 = load i32, i32* %15
%337 = mul nsw i32 %336, 3
%338 = sext i32 %337 to i64
%339 = getelementptr inbounds i32, i32* %335, i64 %338
%340 = load i32, i32* %15
%341 = mul nsw i32 %340, 3
%342 = load i32, i32* %16
%343 = sub nsw i32 %342, 1
%344 = mul nsw i32 %341, %343
%345 = sext i32 %344 to i64
%346 = mul i64 %345, 4
%347 = trunc i64 %346 to i32
%348 = call i32 @memcpy(i32* %334, i32* %339, i32 %347)
br label %349
349: ; preds = %329, %326
br label %350
350: ; preds = %349, %305
br label %351
351: ; preds = %350, %282
br label %352
352: ; preds = %351, %276
br label %353
353: ; preds = %352, %269
br label %354
354: ; preds = %353, %189
br label %355
355: ; preds = %354, %219, %134, %35
%356 = load i32*, i32** %21
%357 = call i32 @free(i32* %356)
%358 = load i32, i32* %23
ret i32 %358
}

LLVM IR (-O2):
%struct.coder = type { i32 }
define i32 @tng_compress_uncompress_vel_gen(i8* %0, double* %1, float* %2, i32* %3, i64* nocapture %4, i64* nocapture %5) {
%7 = tail call i64 @readbufferfix(i8* %0, i32 4)
%8 = trunc i64 %7 to i32
%9 = icmp eq i32 %8, 1447513684
br i1 %9, label %10, label %126
10: ; preds = %6
%11 = getelementptr inbounds i8, i8* %0, i64 4
%12 = tail call i64 @readbufferfix(i8* %11, i32 4)
%13 = trunc i64 %12 to i32
%14 = getelementptr inbounds i8, i8* %0, i64 8
%15 = tail call i64 @readbufferfix(i8* %14, i32 4)
%16 = trunc i64 %15 to i32
%17 = getelementptr inbounds i8, i8* %0, i64 12
%18 = tail call i64 @readbufferfix(i8* %17, i32 4)
%19 = trunc i64 %18 to i32
%20 = getelementptr inbounds i8, i8* %0, i64 16
%21 = tail call i64 @readbufferfix(i8* %20, i32 4)
%22 = trunc i64 %21 to i32
%23 = getelementptr inbounds i8, i8* %0, i64 20
%24 = tail call i64 @readbufferfix(i8* %23, i32 4)
%25 = trunc i64 %24 to i32
%26 = getelementptr inbounds i8, i8* %0, i64 24
%27 = tail call i64 @readbufferfix(i8* %26, i32 4)
%28 = trunc i64 %27 to i32
%29 = getelementptr inbounds i8, i8* %0, i64 28
%30 = tail call i64 @readbufferfix(i8* %29, i32 4)
store i64 %30, i64* %5
%31 = getelementptr inbounds i8, i8* %0, i64 32
%32 = tail call i64 @readbufferfix(i8* %31, i32 4)
store i64 %32, i64* %4
%33 = mul i64 %12, 12884901888
%34 = mul i64 %33, %15
%35 = lshr exact i64 %34, 30
%36 = trunc i64 %35 to i32
%37 = tail call i32* @malloc(i32 %36)
%38 = getelementptr inbounds i8, i8* %0, i64 36
%39 = tail call i64 @readbufferfix(i8* %38, i32 4)
%40 = tail call %struct.coder* (...) @Ptngc_coder_init()
%41 = getelementptr inbounds i8, i8* %0, i64 40
%42 = mul i32 %13, 3
%43 = tail call i32 @Ptngc_unpack_array(%struct.coder* %40, i8* %41, i32* %37, i32 %42, i32 %19, i32 %22, i32 %13)
%44 = tail call i32 @Ptngc_coder_deinit(%struct.coder* %40)
%45 = icmp eq i32 %43, 0
br i1 %45, label %46, label %126
46: ; preds = %10
switch i32 %19, label %67 [
i32 9, label %47
i32 3, label %47
i32 1, label %47
]
47: ; preds = %46, %46, %46
%48 = icmp eq double* %1, null
br i1 %48, label %54, label %49
49: ; preds = %47
%50 = load i64, i64* %4
%51 = load i64, i64* %5
%52 = tail call i64 @Ptngc_i32x2_to_d(i64 %50, i64 %51)
%53 = tail call i32 @unquantize(double* %1, i32 %13, i32 1, i64 %52, i32* %37)
br label %67
54: ; preds = %47
%55 = icmp eq float* %2, null
br i1 %55, label %62, label %56
56: ; preds = %54
%57 = load i64, i64* %4
%58 = load i64, i64* %5
%59 = tail call i64 @Ptngc_i32x2_to_d(i64 %57, i64 %58)
%60 = sitofp i64 %59 to float
%61 = tail call i32 @unquantize_float(float* %2, i32 %13, i32 1, float %60, i32* %37)
br label %67
62: ; preds = %54
%63 = icmp eq i32* %3, null
br i1 %63, label %67, label %64
64: ; preds = %62
%65 = mul i32 %13, 12
%66 = tail call i32 @memcpy(i32* %3, i32* %37, i32 %65)
br label %67
67: ; preds = %46, %49, %62, %64, %56
%68 = icmp sgt i32 %16, 1
br i1 %68, label %69, label %126
69: ; preds = %67
%70 = tail call %struct.coder* (...) @Ptngc_coder_init()
%71 = shl i64 %39, 32
%72 = add i64 %71, 188978561024
%73 = ashr exact i64 %72, 32
%74 = getelementptr inbounds i8, i8* %0, i64 %73
%75 = sext i32 %42 to i64
%76 = getelementptr inbounds i32, i32* %37, i64 %75
%77 = add nsw i32 %16, -1
%78 = mul i32 %42, %77
%79 = tail call i32 @Ptngc_unpack_array(%struct.coder* %70, i8* %74, i32* %76, i32 %78, i32 %25, i32 %28, i32 %13)
%80 = tail call i32 @Ptngc_coder_deinit(%struct.coder* %70)
%81 = icmp eq i32 %79, 0
br i1 %81, label %82, label %126
82: ; preds = %69
switch i32 %25, label %126 [
i32 8, label %83
i32 6, label %83
i32 2, label %83
i32 9, label %102
i32 3, label %102
i32 1, label %102
]
83: ; preds = %82, %82, %82
%84 = icmp eq double* %1, null
br i1 %84, label %90, label %85
85: ; preds = %83
%86 = load i64, i64* %4
%87 = load i64, i64* %5
%88 = tail call i64 @Ptngc_i32x2_to_d(i64 %86, i64 %87)
%89 = tail call i32 @unquantize_inter_differences(double* %1, i32 %13, i32 %16, i64 %88, i32* %37)
br label %126
90: ; preds = %83
%91 = icmp eq float* %2, null
br i1 %91, label %98, label %92
92: ; preds = %90
%93 = load i64, i64* %4
%94 = load i64, i64* %5
%95 = tail call i64 @Ptngc_i32x2_to_d(i64 %93, i64 %94)
%96 = sitofp i64 %95 to float
%97 = tail call i32 @unquantize_inter_differences_float(float* %2, i32 %13, i32 %16, float %96, i32* %37)
br label %126
98: ; preds = %90
%99 = icmp eq i32* %3, null
br i1 %99, label %126, label %100
100: ; preds = %98
%101 = tail call i32 @unquantize_inter_differences_int(i32* %3, i32 %13, i32 %16, i32* %37)
br label %126
102: ; preds = %82, %82, %82
%103 = icmp eq double* %1, null
br i1 %103, label %110, label %104
104: ; preds = %102
%105 = getelementptr inbounds double, double* %1, i64 %75
%106 = load i64, i64* %4
%107 = load i64, i64* %5
%108 = tail call i64 @Ptngc_i32x2_to_d(i64 %106, i64 %107)
%109 = tail call i32 @unquantize(double* %105, i32 %13, i32 %77, i64 %108, i32* %76)
br label %126
110: ; preds = %102
%111 = icmp eq float* %2, null
br i1 %111, label %119, label %112
112: ; preds = %110
%113 = getelementptr inbounds float, float* %2, i64 %75
%114 = load i64, i64* %4
%115 = load i64, i64* %5
%116 = tail call i64 @Ptngc_i32x2_to_d(i64 %114, i64 %115)
%117 = sitofp i64 %116 to float
%118 = tail call i32 @unquantize_float(float* %113, i32 %13, i32 %77, float %117, i32* %76)
br label %126
119: ; preds = %110
%120 = icmp eq i32* %3, null
br i1 %120, label %126, label %121
121: ; preds = %119
%122 = getelementptr inbounds i32, i32* %3, i64 %75
%123 = mul i32 %13, 12
%124 = mul i32 %123, %77
%125 = tail call i32 @memcpy(i32* %122, i32* %76, i32 %124)
br label %126
126: ; preds = %82, %6, %67, %112, %121, %119, %104, %85, %98, %100, %92, %69, %10
%127 = phi i32* [ %37, %10 ], [ %37, %69 ], [ %37, %85 ], [ %37, %92 ], [ %37, %100 ], [ %37, %98 ], [ %37, %104 ], [ %37, %112 ], [ %37, %121 ], [ %37, %119 ], [ %37, %67 ], [ null, %6 ], [ %37, %82 ]
%128 = phi i32 [ %43, %10 ], [ %79, %69 ], [ 0, %85 ], [ 0, %92 ], [ 0, %100 ], [ 0, %98 ], [ 0, %104 ], [ 0, %112 ], [ 0, %121 ], [ 0, %119 ], [ 0, %67 ], [ 1, %6 ], [ 0, %82 ]
%129 = tail call i32 @free(i32* %127)
ret i32 %128
}