#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 /*<<< orphan*/ FILE;

/* Variables and functions */
int cmp_barker(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int fread_bo(int *, int, int, int /*<<< orphan*/ *, int);
int idcheck(unsigned short);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stderr;
int read_adts(FILE *fp, short int *data, short int *aux, float *r2a, int pol,
              int ncsamples) {
  unsigned short aux_mask[16], header;
  short int odd, even;
  int word, rval, k, id, aflag = 0, count, aux_save = 0, aux_enable = 1,
                         flag1 = 0, flag2 = 0;
  aux_mask[0] = 32768;
  for (k = 1; k < 16; k++)
    aux_mask[k] = aux_mask[k - 1] >> 1;
  while (flag2 == 0) {
    if ((rval = cmp_barker(fp)) < 0) {
      if (rval == -1)
        fprintf(stderr, "Unable to find barker sequence.\n");
      if (rval == -2)
        fprintf(stderr, "Unable to read input file.\n");
      return (-1);
    }
    count = 0;
    header = 0x0000;
    aux_enable = 1;
    if (!aux_save)
      for (k = 0; k < 57; k++)
        aux[k] = 0x0000;
    for (k = 0; k < ncsamples; k++) {
      if (4 != fread_bo(&word, 1, 4, fp, 4)) {
        fprintf(stderr, "Error reading sample %d\n", k);
        return (-1);
      }
      odd = (short int)((word >> 20) & 0x000003ff);
      if (((word >> 30) & 0x00000001) > 0)
        odd |= 0xfc00;
      even = (short int)((word >> 4) & 0x000003ff);
      if (((word >> 14) & 0x00000001) > 0)
        even |= 0xfc00;
      data[2 * k] = even;
      data[2 * k + 1] = odd;
      if (((count < 57 + 1) && aux_enable) || !count) {
        if ((word & 0x00000008) > 0) {
          if (!count)
            header = header | aux_mask[k % 16];
          else
            aux[count - 1] = aux[count - 1] | aux_mask[k % 16];
        }
        if ((k + 1) % 16 == 0) {
          if (count == 0) {
            if ((header | 0x00f0) == 0x03f0) {
              if (pol == 0)
                flag1 = 1;
            } else if ((header | 0x00f0) == 0x43f5) {
              if (pol == 1)
                flag1 = 1;
              aux_enable = 0;
            } else if ((header | 0x00f0) == 0x83fa) {
              if (pol == 2)
                flag1 = 1;
              aux_enable = 0;
            } else if ((header | 0x00f0) == 0xc3ff) {
              if (pol == 3)
                flag1 = 1;
              aux_enable = 0;
            } else {
              fprintf(stderr, "Cannot determine pole, id=%04x\n",
                      (unsigned)header);
              fprintf(stderr, "Rechecking...\n");
              id = idcheck(header);
              if (id < 0) {
                fprintf(stderr, "Fatal Error in polarization id.\n");
                return (-1);
              } else if (id == 0) {
                if (pol == 0)
                  flag1 = 1;
                printf("Choosing HH.\n");
                aflag = 1;
              } else if (id == 1) {
                if (pol == 1)
                  flag1 = 1;
                aux_enable = 0;
                printf("Choosing HV.\n");
              } else if (id == 2) {
                if (pol == 2)
                  flag1 = 1;
                aux_enable = 0;
                printf("Choosing VH.\n");
              } else if (id == 3) {
                if (pol == 3)
                  flag1 = 1;
                aux_enable = 0;
                printf("Choosing VV.\n");
              }
            }
          } else if (count == 29) {
            *r2a = 2.0 * aux[count - 2] + (aux[count - 1] & 0x7fff) / 16384.;
            if (aflag)
              printf("range=%g\n", *r2a);
            aflag = 0;
          } else if (count == 57)
            aux_save = 1;
          count++;
        }
      }
    }
    if (flag1)
      flag2 = 1;
  }
  return (0);
}


x86 assembly (clang, -O0):
<read_adts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8d,-0x2c(%rbp)
mov    %r9d,-0x30(%rbp)
movl   $0x0,-0x6c(%rbp)
movl   $0x0,-0x74(%rbp)
movl   $0x1,-0x78(%rbp)
movl   $0x0,-0x7c(%rbp)
movl   $0x0,-0x80(%rbp)
movw   $0x8000,-0x50(%rbp)
movl   $0x1,-0x64(%rbp)
cmpl   $0x10,-0x64(%rbp)
jge    11d7 <read_adts+0x87>
mov    -0x64(%rbp),%eax
sub    $0x1,%eax
cltq
movzwl -0x50(%rbp,%rax,2),%eax
sar    $0x1,%eax
mov    %ax,%cx
movslq -0x64(%rbp),%rax
mov    %cx,-0x50(%rbp,%rax,2)
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    11a3 <read_adts+0x53>
jmp    11dc <read_adts+0x8c>
cmpl   $0x0,-0x80(%rbp)
jne    1755 <read_adts+0x605>
mov    -0x10(%rbp),%rdi
call   1030 <cmp_barker@plt>
mov    %eax,-0x60(%rbp)
cmp    $0x0,%eax
jge    1249 <read_adts+0xf9>
cmpl   $0xffffffff,-0x60(%rbp)
jne    121c <read_adts+0xcc>
mov    0x2dd4(%rip),%rax
mov    (%rax),%edi
lea    0xdf3(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
cmpl   $0xfffffffe,-0x60(%rbp)
jne    123d <read_adts+0xed>
mov    0x2db3(%rip),%rax
mov    (%rax),%edi
lea    0xdf3(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    175c <read_adts+0x60c>
movl   $0x0,-0x70(%rbp)
movw   $0x0,-0x52(%rbp)
movl   $0x1,-0x78(%rbp)
cmpl   $0x0,-0x74(%rbp)
jne    1299 <read_adts+0x149>
movl   $0x0,-0x64(%rbp)
cmpl   $0x39,-0x64(%rbp)
jge    1294 <read_adts+0x144>
mov    -0x20(%rbp),%rax
movslq -0x64(%rbp),%rcx
movw   $0x0,(%rax,%rcx,2)
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    126e <read_adts+0x11e>
jmp    1299 <read_adts+0x149>
movl   $0x0,-0x64(%rbp)
mov    -0x64(%rbp),%eax
cmp    -0x30(%rbp),%eax
jge    173f <read_adts+0x5ef>
mov    -0x10(%rbp),%rcx
lea    -0x5c(%rbp),%rdi
mov    $0x1,%esi
mov    $0x4,%r8d
mov    %r8d,%edx
call   1070 <fread_bo@plt>
mov    %eax,%ecx
mov    $0x4,%eax
cmp    %ecx,%eax
je     12fc <read_adts+0x1ac>
mov    0x2d03(%rip),%rax
mov    (%rax),%edi
mov    -0x64(%rbp),%edx
lea    0xd5c(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    175c <read_adts+0x60c>
mov    -0x5c(%rbp),%eax
sar    $0x14,%eax
and    $0x3ff,%eax
mov    %ax,-0x54(%rbp)
mov    -0x5c(%rbp),%eax
sar    $0x1e,%eax
and    $0x1,%eax
cmp    $0x0,%eax
jle    132a <read_adts+0x1da>
movswl -0x54(%rbp),%eax
or     $0xfc00,%eax
mov    %ax,-0x54(%rbp)
mov    -0x5c(%rbp),%eax
sar    $0x4,%eax
and    $0x3ff,%eax
mov    %ax,-0x56(%rbp)
mov    -0x5c(%rbp),%eax
sar    $0xe,%eax
and    $0x1,%eax
cmp    $0x0,%eax
jle    1358 <read_adts+0x208>
movswl -0x56(%rbp),%eax
or     $0xfc00,%eax
mov    %ax,-0x56(%rbp)
mov    -0x56(%rbp),%dx
mov    -0x18(%rbp),%rax
mov    -0x64(%rbp),%ecx
shl    $0x1,%ecx
movslq %ecx,%rcx
mov    %dx,(%rax,%rcx,2)
mov    -0x54(%rbp),%dx
mov    -0x18(%rbp),%rax
mov    -0x64(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    %dx,(%rax,%rcx,2)
cmpl   $0x3a,-0x70(%rbp)
jge    1399 <read_adts+0x249>
cmpl   $0x0,-0x78(%rbp)
jne    13a3 <read_adts+0x253>
cmpl   $0x0,-0x70(%rbp)
jne    172c <read_adts+0x5dc>
mov    -0x5c(%rbp),%eax
and    $0x8,%eax
cmp    $0x0,%eax
jle    1435 <read_adts+0x2e5>
cmpl   $0x0,-0x70(%rbp)
jne    13ea <read_adts+0x29a>
movzwl -0x52(%rbp),%eax
mov    %eax,-0x84(%rbp)
mov    -0x64(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
mov    -0x84(%rbp),%eax
movslq %edx,%rcx
movzwl -0x50(%rbp,%rcx,2),%ecx
or     %ecx,%eax
mov    %ax,-0x52(%rbp)
jmp    1430 <read_adts+0x2e0>
mov    -0x20(%rbp),%rax
mov    -0x70(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movswl (%rax,%rcx,2),%eax
mov    %eax,-0x88(%rbp)
mov    -0x64(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
mov    -0x88(%rbp),%eax
movslq %edx,%rcx
movzwl -0x50(%rbp,%rcx,2),%ecx
or     %ecx,%eax
mov    %ax,%dx
mov    -0x20(%rbp),%rax
mov    -0x70(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    %dx,(%rax,%rcx,2)
jmp    1435 <read_adts+0x2e5>
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1727 <read_adts+0x5d7>
cmpl   $0x0,-0x70(%rbp)
jne    167a <read_adts+0x52a>
movzwl -0x52(%rbp),%eax
or     $0xf0,%eax
cmp    $0x3f0,%eax
jne    1480 <read_adts+0x330>
cmpl   $0x0,-0x2c(%rbp)
jne    147b <read_adts+0x32b>
movl   $0x1,-0x7c(%rbp)
jmp    1675 <read_adts+0x525>
movzwl -0x52(%rbp),%eax
or     $0xf0,%eax
cmp    $0x43f5,%eax
jne    14b1 <read_adts+0x361>
cmpl   $0x1,-0x2c(%rbp)
jne    14a5 <read_adts+0x355>
movl   $0x1,-0x7c(%rbp)
movl   $0x0,-0x78(%rbp)
jmp    1670 <read_adts+0x520>
movzwl -0x52(%rbp),%eax
or     $0xf0,%eax
cmp    $0x83fa,%eax
jne    14e2 <read_adts+0x392>
cmpl   $0x2,-0x2c(%rbp)
jne    14d6 <read_adts+0x386>
movl   $0x1,-0x7c(%rbp)
movl   $0x0,-0x78(%rbp)
jmp    166b <read_adts+0x51b>
movzwl -0x52(%rbp),%eax
or     $0xf0,%eax
cmp    $0xc3ff,%eax
jne    1513 <read_adts+0x3c3>
cmpl   $0x3,-0x2c(%rbp)
jne    1507 <read_adts+0x3b7>
movl   $0x1,-0x7c(%rbp)
movl   $0x0,-0x78(%rbp)
jmp    1666 <read_adts+0x516>
mov    0x2ac6(%rip),%rax
mov    (%rax),%edi
movzwl -0x52(%rbp),%edx
lea    0xb37(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    0x2aab(%rip),%rax
mov    (%rax),%edi
lea    0xb40(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
movzwl -0x52(%rbp),%edi
call   1040 <idcheck@plt>
mov    %eax,-0x68(%rbp)
cmpl   $0x0,-0x68(%rbp)
jge    157e <read_adts+0x42e>
mov    0x2a7e(%rip),%rax
mov    (%rax),%edi
lea    0xb22(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    175c <read_adts+0x60c>
cmpl   $0x0,-0x68(%rbp)
jne    15b3 <read_adts+0x463>
cmpl   $0x0,-0x2c(%rbp)
jne    1599 <read_adts+0x449>
movl   $0x1,-0x7c(%rbp)
lea    0xb0e(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x1,-0x6c(%rbp)
jmp    165c <read_adts+0x50c>
cmpl   $0x1,-0x68(%rbp)
jne    15e8 <read_adts+0x498>
cmpl   $0x1,-0x2c(%rbp)
jne    15ce <read_adts+0x47e>
movl   $0x1,-0x7c(%rbp)
movl   $0x0,-0x78(%rbp)
lea    0xae0(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1657 <read_adts+0x507>
cmpl   $0x2,-0x68(%rbp)
jne    161d <read_adts+0x4cd>
cmpl   $0x2,-0x2c(%rbp)
jne    1603 <read_adts+0x4b3>
movl   $0x1,-0x7c(%rbp)
movl   $0x0,-0x78(%rbp)
lea    0xab9(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1652 <read_adts+0x502>
cmpl   $0x3,-0x68(%rbp)
jne    164d <read_adts+0x4fd>
cmpl   $0x3,-0x2c(%rbp)
jne    1638 <read_adts+0x4e8>
movl   $0x1,-0x7c(%rbp)
movl   $0x0,-0x78(%rbp)
lea    0xa92(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1652 <read_adts+0x502>
jmp    1657 <read_adts+0x507>
jmp    165c <read_adts+0x50c>
jmp    1661 <read_adts+0x511>
jmp    1666 <read_adts+0x516>
jmp    166b <read_adts+0x51b>
jmp    1670 <read_adts+0x520>
jmp    1675 <read_adts+0x525>
jmp    171e <read_adts+0x5ce>
cmpl   $0x1d,-0x70(%rbp)
jne    1703 <read_adts+0x5b3>
mov    -0x20(%rbp),%rax
mov    -0x70(%rbp),%ecx
sub    $0x2,%ecx
movslq %ecx,%rcx
movswl (%rax,%rcx,2),%eax
cvtsi2sd %eax,%xmm0
mov    -0x20(%rbp),%rax
mov    -0x70(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movswl (%rax,%rcx,2),%eax
and    $0x7fff,%eax
cvtsi2sd %eax,%xmm1
movsd  0x945(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x28(%rbp),%rax
movss  %xmm0,(%rax)
cmpl   $0x0,-0x6c(%rbp)
je     16f7 <read_adts+0x5a7>
mov    -0x28(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0x9f6(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movl   $0x0,-0x6c(%rbp)
jmp    1719 <read_adts+0x5c9>
cmpl   $0x39,-0x70(%rbp)
jne    1714 <read_adts+0x5c4>
movl   $0x1,-0x74(%rbp)
jmp    1719 <read_adts+0x5c9>
jmp    171e <read_adts+0x5ce>
mov    -0x70(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x70(%rbp)
jmp    172c <read_adts+0x5dc>
jmp    1731 <read_adts+0x5e1>
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    12a0 <read_adts+0x150>
cmpl   $0x0,-0x7c(%rbp)
je     1750 <read_adts+0x600>
movl   $0x1,-0x80(%rbp)
jmp    11dc <read_adts+0x8c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_adts>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
mov    %r8d,0x8(%rsp)
mov    %rcx,0x30(%rsp)
mov    %rdx,0x18(%rsp)
mov    %rsi,%rbx
mov    %rdi,%r14
movaps 0xe76(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xe7a(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
mov    %r9d,0x28(%rsp)
mov    %r9d,%eax
mov    %rax,0x38(%rsp)
movl   $0x0,0x14(%rsp)
movl   $0x0,0xc(%rsp)
mov    %r14,%rdi
call   1030 <cmp_barker@plt>
test   %eax,%eax
js     156a <read_adts+0x40a>
cmpl   $0x0,0x14(%rsp)
jne    11f8 <read_adts+0x98>
mov    0x18(%rsp),%rax
xorps  %xmm0,%xmm0
movups %xmm0,0x60(%rax)
movups %xmm0,0x50(%rax)
movups %xmm0,0x40(%rax)
movups %xmm0,0x30(%rax)
movups %xmm0,0x20(%rax)
movups %xmm0,0x10(%rax)
movups %xmm0,(%rax)
movw   $0x0,0x70(%rax)
cmpl   $0x0,0x28(%rsp)
mov    0x38(%rsp),%rbp
jle    1520 <read_adts+0x3c0>
mov    $0x1,%r13d
xor    %r12d,%r12d
movl   $0x0,0x4(%rsp)
xor    %r15d,%r15d
movl   $0x0,0x10(%rsp)
jmp    123d <read_adts+0xdd>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%r12
cmp    %rbp,%r12
je     1528 <read_adts+0x3c8>
lea    0x2c(%rsp),%rdi
mov    $0x1,%esi
mov    $0x4,%edx
mov    %r14,%rcx
mov    $0x4,%r8d
call   1080 <fread_bo@plt>
cmp    $0x4,%eax
jne    153a <read_adts+0x3da>
mov    0x2c(%rsp),%eax
mov    %eax,%ecx
shr    $0x14,%ecx
and    $0x3ff,%ecx
xor    %edx,%edx
test   $0x40000000,%eax
sete   %dl
shl    $0xa,%edx
add    %edx,%ecx
add    $0xfffffc00,%ecx
mov    %eax,%edx
shr    $0x4,%edx
and    $0x3ff,%edx
xor    %esi,%esi
test   $0x4000,%eax
sete   %sil
shl    $0xa,%esi
add    %esi,%edx
add    $0xfffffc00,%edx
mov    %dx,(%rbx,%r12,4)
mov    %cx,0x2(%rbx,%r12,4)
cmp    $0x3a,%r15d
setge  %cl
test   %r13d,%r13d
sete   %dl
test   %r15d,%r15d
je     12cd <read_adts+0x16d>
or     %dl,%cl
jne    1230 <read_adts+0xd0>
test   $0x8,%al
je     1310 <read_adts+0x1b0>
test   %r15d,%r15d
je     12f0 <read_adts+0x190>
movslq %r15d,%rax
mov    %r12d,%ecx
and    $0xf,%ecx
movzwl 0x40(%rsp,%rcx,2),%ecx
mov    0x18(%rsp),%rdx
or     %cx,-0x2(%rdx,%rax,2)
jmp    1310 <read_adts+0x1b0>
mov    %r12d,%eax
and    $0xf,%eax
mov    0x10(%rsp),%ecx
or     0x40(%rsp,%rax,2),%cx
mov    %ecx,0x10(%rsp)
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%r12
test   $0xf,%r12b
jne    1234 <read_adts+0xd4>
cmp    $0x39,%r15d
je     136a <read_adts+0x20a>
cmp    $0x1d,%r15d
je     1377 <read_adts+0x217>
test   %r15d,%r15d
jne    1427 <read_adts+0x2c7>
mov    0x10(%rsp),%eax
or     $0xf0,%eax
movswl %ax,%ecx
movzwl %ax,%eax
cmp    $0x3ef,%ecx
jg     13c5 <read_adts+0x265>
cmp    $0x83fa,%eax
je     1406 <read_adts+0x2a6>
cmp    $0xc3ff,%eax
jne    1430 <read_adts+0x2d0>
cmpl   $0x3,0x8(%rsp)
jmp    140b <read_adts+0x2ab>
movl   $0x1,0x14(%rsp)
jmp    1427 <read_adts+0x2c7>
mov    0x18(%rsp),%rcx
movswl 0x36(%rcx),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movzwl 0x38(%rcx),%eax
and    $0x7fff,%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
mulsd  0xc81(%rip),%xmm1
addsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    0x30(%rsp),%rax
movss  %xmm0,(%rax)
cmpl   $0x0,0xc(%rsp)
jne    13ea <read_adts+0x28a>
movl   $0x0,0xc(%rsp)
jmp    1427 <read_adts+0x2c7>
cmp    $0x43f5,%eax
je     1412 <read_adts+0x2b2>
cmp    $0x3f0,%eax
jne    1430 <read_adts+0x2d0>
cmpl   $0x0,0x8(%rsp)
mov    $0x1,%eax
mov    0x4(%rsp),%ecx
cmove  %eax,%ecx
mov    %ecx,0x4(%rsp)
jmp    1427 <read_adts+0x2c7>
cvtss2sd %xmm0,%xmm0
lea    0xce9(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movl   $0x0,0xc(%rsp)
jmp    1427 <read_adts+0x2c7>
cmpl   $0x2,0x8(%rsp)
mov    $0x1,%eax
jmp    1419 <read_adts+0x2b9>
mov    0x8(%rsp),%eax
cmp    $0x1,%eax
mov    0x4(%rsp),%ecx
cmove  %eax,%ecx
mov    %ecx,0x4(%rsp)
xor    %r13d,%r13d
add    $0x1,%r15d
jmp    1234 <read_adts+0xd4>
movzwl 0x10(%rsp),%edx
mov    %edx,0x24(%rsp)
mov    0x2ba0(%rip),%rax
mov    (%rax),%edi
lea    0xc45(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    0x2b89(%rip),%rax
mov    (%rax),%edi
lea    0xc4e(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    0x24(%rsp),%edi
call   1050 <idcheck@plt>
test   %eax,%eax
js     15a4 <read_adts+0x444>
cmp    $0x3,%eax
ja     1427 <read_adts+0x2c7>
mov    %eax,%eax
lea    0xba2(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
cmpl   $0x0,0x8(%rsp)
mov    $0x1,%eax
movl   $0x1,0xc(%rsp)
mov    0x4(%rsp),%ecx
cmove  %eax,%ecx
mov    %ecx,0x4(%rsp)
lea    0xc5c(%rip),%rdi
call   1040 <puts@plt>
jmp    1427 <read_adts+0x2c7>
mov    0x8(%rsp),%eax
cmp    $0x1,%eax
mov    0x4(%rsp),%ecx
cmove  %eax,%ecx
mov    %ecx,0x4(%rsp)
lea    0xc2c(%rip),%rdi
jmp    1512 <read_adts+0x3b2>
cmpl   $0x2,0x8(%rsp)
mov    $0x1,%eax
mov    0x4(%rsp),%ecx
cmove  %eax,%ecx
mov    %ecx,0x4(%rsp)
lea    0xc01(%rip),%rdi
jmp    1512 <read_adts+0x3b2>
cmpl   $0x3,0x8(%rsp)
mov    $0x1,%eax
mov    0x4(%rsp),%ecx
cmove  %eax,%ecx
mov    %ecx,0x4(%rsp)
lea    0xbd6(%rip),%rdi
call   1040 <puts@plt>
jmp    1424 <read_adts+0x2c4>
nopl   0x0(%rax)
movl   $0x0,0x4(%rsp)
cmpl   $0x0,0x4(%rsp)
mov    $0x0,%ebp
je     11b8 <read_adts+0x58>
jmp    1559 <read_adts+0x3f9>
mov    0x2a9f(%rip),%rax
mov    (%rax),%edi
lea    0xb2b(%rip),%rsi
mov    %r12d,%edx
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    $0xffffffff,%ebp
mov    %ebp,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    $0xffffffff,%ebp
cmp    $0xfffffffe,%eax
je     158b <read_adts+0x42b>
cmp    $0xffffffff,%eax
jne    1559 <read_adts+0x3f9>
mov    0x2a60(%rip),%rax
mov    (%rax),%edi
lea    0xaaf(%rip),%rsi
jmp    159b <read_adts+0x43b>
mov    0x2a4e(%rip),%rax
mov    (%rax),%edi
lea    0xabe(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
jmp    1559 <read_adts+0x3f9>
mov    0x2a35(%rip),%rax
mov    (%rax),%edi
lea    0xb09(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
jmp    1554 <read_adts+0x3f4>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [33 x i8] c"Unable to find barker sequence.\0A\00"
@.str.1 = [28 x i8] c"Unable to read input file.\0A\00"
@.str.2 = [25 x i8] c"Error reading sample %d\0A\00"
@.str.3 = [32 x i8] c"Cannot determine pole, id=%04x\0A\00"
@.str.4 = [15 x i8] c"Rechecking...\0A\00"
@.str.5 = [33 x i8] c"Fatal Error in polarization id.\0A\00"
@.str.6 = [14 x i8] c"Choosing HH.\0A\00"
@.str.7 = [14 x i8] c"Choosing HV.\0A\00"
@.str.8 = [14 x i8] c"Choosing VH.\0A\00"
@.str.9 = [14 x i8] c"Choosing VV.\0A\00"
@.str.10 = [10 x i8] c"range=%g\0A\00"
define i32 @read_adts(i32* %0, i16* %1, i16* %2, float* %3, i32 %4, i32 %5) {
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i16*
%10 = alloca i16*
%11 = alloca float*
%12 = alloca i32
%13 = alloca i32
%14 = alloca [16 x i16]
%15 = alloca i16
%16 = alloca i16
%17 = alloca i16
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
%24 = alloca i32
%25 = alloca i32
%26 = alloca i32
%27 = alloca i32
store i32* %0, i32** %8
store i16* %1, i16** %9
store i16* %2, i16** %10
store float* %3, float** %11
store i32 %4, i32* %12
store i32 %5, i32* %13
store i32 0, i32* %22
store i32 0, i32* %24
store i32 1, i32* %25
store i32 0, i32* %26
store i32 0, i32* %27
%28 = getelementptr inbounds [16 x i16], [16 x i16]* %14, i64 0, i64 0
store i16 -32768, i16* %28
store i32 1, i32* %20
br label %29
29: ; preds = %44, %6
%30 = load i32, i32* %20
%31 = icmp slt i32 %30, 16
br i1 %31, label %32, label %47
32: ; preds = %29
%33 = load i32, i32* %20
%34 = sub nsw i32 %33, 1
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [16 x i16], [16 x i16]* %14, i64 0, i64 %35
%37 = load i16, i16* %36
%38 = zext i16 %37 to i32
%39 = ashr i32 %38, 1
%40 = trunc i32 %39 to i16
%41 = load i32, i32* %20
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds [16 x i16], [16 x i16]* %14, i64 0, i64 %42
store i16 %40, i16* %43
br label %44
44: ; preds = %32
%45 = load i32, i32* %20
%46 = add nsw i32 %45, 1
store i32 %46, i32* %20
br label %29
47: ; preds = %29
br label %48
48: ; preds = %345, %47
%49 = load i32, i32* %27
%50 = icmp eq i32 %49, 0
br i1 %50, label %51, label %346
51: ; preds = %48
%52 = load i32*, i32** %8
%53 = call i32 @cmp_barker(i32* %52)
store i32 %53, i32* %19
%54 = icmp slt i32 %53, 0
br i1 %54, label %55, label %68
55: ; preds = %51
%56 = load i32, i32* %19
%57 = icmp eq i32 %56, -1
br i1 %57, label %58, label %61
58: ; preds = %55
%59 = load i32, i32* @stderr
%60 = call i32 (i32, i8*, ...) @fprintf(i32 %59, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %61
61: ; preds = %58, %55
%62 = load i32, i32* %19
%63 = icmp eq i32 %62, -2
br i1 %63, label %64, label %67
64: ; preds = %61
%65 = load i32, i32* @stderr
%66 = call i32 (i32, i8*, ...) @fprintf(i32 %65, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
br label %67
67: ; preds = %64, %61
store i32 -1, i32* %7
br label %347
68: ; preds = %51
store i32 0, i32* %23
store i16 0, i16* %15
store i32 1, i32* %25
%69 = load i32, i32* %24
%70 = icmp ne i32 %69, 0
br i1 %70, label %84, label %71
71: ; preds = %68
store i32 0, i32* %20
br label %72
72: ; preds = %80, %71
%73 = load i32, i32* %20
%74 = icmp slt i32 %73, 57
br i1 %74, label %75, label %83
75: ; preds = %72
%76 = load i16*, i16** %10
%77 = load i32, i32* %20
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds i16, i16* %76, i64 %78
store i16 0, i16* %79
br label %80
80: ; preds = %75
%81 = load i32, i32* %20
%82 = add nsw i32 %81, 1
store i32 %82, i32* %20
br label %72
83: ; preds = %72
br label %84
84: ; preds = %83, %68
store i32 0, i32* %20
br label %85
85: ; preds = %338, %84
%86 = load i32, i32* %20
%87 = load i32, i32* %13
%88 = icmp slt i32 %86, %87
br i1 %88, label %89, label %341
89: ; preds = %85
%90 = load i32*, i32** %8
%91 = call i32 @fread_bo(i32* %18, i32 1, i32 4, i32* %90, i32 4)
%92 = icmp ne i32 4, %91
br i1 %92, label %93, label %97
93: ; preds = %89
%94 = load i32, i32* @stderr
%95 = load i32, i32* %20
%96 = call i32 (i32, i8*, ...) @fprintf(i32 %94, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 %95)
store i32 -1, i32* %7
br label %347
97: ; preds = %89
%98 = load i32, i32* %18
%99 = ashr i32 %98, 20
%100 = and i32 %99, 1023
%101 = trunc i32 %100 to i16
store i16 %101, i16* %16
%102 = load i32, i32* %18
%103 = ashr i32 %102, 30
%104 = and i32 %103, 1
%105 = icmp sgt i32 %104, 0
br i1 %105, label %106, label %111
106: ; preds = %97
%107 = load i16, i16* %16
%108 = sext i16 %107 to i32
%109 = or i32 %108, 64512
%110 = trunc i32 %109 to i16
store i16 %110, i16* %16
br label %111
111: ; preds = %106, %97
%112 = load i32, i32* %18
%113 = ashr i32 %112, 4
%114 = and i32 %113, 1023
%115 = trunc i32 %114 to i16
store i16 %115, i16* %17
%116 = load i32, i32* %18
%117 = ashr i32 %116, 14
%118 = and i32 %117, 1
%119 = icmp sgt i32 %118, 0
br i1 %119, label %120, label %125
120: ; preds = %111
%121 = load i16, i16* %17
%122 = sext i16 %121 to i32
%123 = or i32 %122, 64512
%124 = trunc i32 %123 to i16
store i16 %124, i16* %17
br label %125
125: ; preds = %120, %111
%126 = load i16, i16* %17
%127 = load i16*, i16** %9
%128 = load i32, i32* %20
%129 = mul nsw i32 2, %128
%130 = sext i32 %129 to i64
%131 = getelementptr inbounds i16, i16* %127, i64 %130
store i16 %126, i16* %131
%132 = load i16, i16* %16
%133 = load i16*, i16** %9
%134 = load i32, i32* %20
%135 = mul nsw i32 2, %134
%136 = add nsw i32 %135, 1
%137 = sext i32 %136 to i64
%138 = getelementptr inbounds i16, i16* %133, i64 %137
store i16 %132, i16* %138
%139 = load i32, i32* %23
%140 = icmp slt i32 %139, 58
br i1 %140, label %141, label %144
141: ; preds = %125
%142 = load i32, i32* %25
%143 = icmp ne i32 %142, 0
br i1 %143, label %147, label %144
144: ; preds = %141, %125
%145 = load i32, i32* %23
%146 = icmp ne i32 %145, 0
br i1 %146, label %337, label %147
147: ; preds = %144, %141
%148 = load i32, i32* %18
%149 = and i32 %148, 8
%150 = icmp sgt i32 %149, 0
br i1 %150, label %151, label %187
151: ; preds = %147
%152 = load i32, i32* %23
%153 = icmp ne i32 %152, 0
br i1 %153, label %165, label %154
154: ; preds = %151
%155 = load i16, i16* %15
%156 = zext i16 %155 to i32
%157 = load i32, i32* %20
%158 = srem i32 %157, 16
%159 = sext i32 %158 to i64
%160 = getelementptr inbounds [16 x i16], [16 x i16]* %14, i64 0, i64 %159
%161 = load i16, i16* %160
%162 = zext i16 %161 to i32
%163 = or i32 %156, %162
%164 = trunc i32 %163 to i16
store i16 %164, i16* %15
br label %186
165: ; preds = %151
%166 = load i16*, i16** %10
%167 = load i32, i32* %23
%168 = sub nsw i32 %167, 1
%169 = sext i32 %168 to i64
%170 = getelementptr inbounds i16, i16* %166, i64 %169
%171 = load i16, i16* %170
%172 = sext i16 %171 to i32
%173 = load i32, i32* %20
%174 = srem i32 %173, 16
%175 = sext i32 %174 to i64
%176 = getelementptr inbounds [16 x i16], [16 x i16]* %14, i64 0, i64 %175
%177 = load i16, i16* %176
%178 = zext i16 %177 to i32
%179 = or i32 %172, %178
%180 = trunc i32 %179 to i16
%181 = load i16*, i16** %10
%182 = load i32, i32* %23
%183 = sub nsw i32 %182, 1
%184 = sext i32 %183 to i64
%185 = getelementptr inbounds i16, i16* %181, i64 %184
store i16 %180, i16* %185
br label %186
186: ; preds = %165, %154
br label %187
187: ; preds = %186, %147
%188 = load i32, i32* %20
%189 = add nsw i32 %188, 1
%190 = srem i32 %189, 16
%191 = icmp eq i32 %190, 0
br i1 %191, label %192, label %336
192: ; preds = %187
%193 = load i32, i32* %23
%194 = icmp eq i32 %193, 0
br i1 %194, label %195, label %294
195: ; preds = %192
%196 = load i16, i16* %15
%197 = zext i16 %196 to i32
%198 = or i32 %197, 240
%199 = icmp eq i32 %198, 1008
br i1 %199, label %200, label %205
200: ; preds = %195
%201 = load i32, i32* %12
%202 = icmp eq i32 %201, 0
br i1 %202, label %203, label %204
203: ; preds = %200
store i32 1, i32* %26
br label %204
204: ; preds = %203, %200
br label %293
205: ; preds = %195
%206 = load i16, i16* %15
%207 = zext i16 %206 to i32
%208 = or i32 %207, 240
%209 = icmp eq i32 %208, 17397
br i1 %209, label %210, label %215
210: ; preds = %205
%211 = load i32, i32* %12
%212 = icmp eq i32 %211, 1
br i1 %212, label %213, label %214
213: ; preds = %210
store i32 1, i32* %26
br label %214
214: ; preds = %213, %210
store i32 0, i32* %25
br label %292
215: ; preds = %205
%216 = load i16, i16* %15
%217 = zext i16 %216 to i32
%218 = or i32 %217, 240
%219 = icmp eq i32 %218, 33786
br i1 %219, label %220, label %225
220: ; preds = %215
%221 = load i32, i32* %12
%222 = icmp eq i32 %221, 2
br i1 %222, label %223, label %224
223: ; preds = %220
store i32 1, i32* %26
br label %224
224: ; preds = %223, %220
store i32 0, i32* %25
br label %291
225: ; preds = %215
%226 = load i16, i16* %15
%227 = zext i16 %226 to i32
%228 = or i32 %227, 240
%229 = icmp eq i32 %228, 50175
br i1 %229, label %230, label %235
230: ; preds = %225
%231 = load i32, i32* %12
%232 = icmp eq i32 %231, 3
br i1 %232, label %233, label %234
233: ; preds = %230
store i32 1, i32* %26
br label %234
234: ; preds = %233, %230
store i32 0, i32* %25
br label %290
235: ; preds = %225
%236 = load i32, i32* @stderr
%237 = load i16, i16* %15
%238 = zext i16 %237 to i32
%239 = call i32 (i32, i8*, ...) @fprintf(i32 %236, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0), i32 %238)
%240 = load i32, i32* @stderr
%241 = call i32 (i32, i8*, ...) @fprintf(i32 %240, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0))
%242 = load i16, i16* %15
%243 = call i32 @idcheck(i16 zeroext %242)
store i32 %243, i32* %21
%244 = load i32, i32* %21
%245 = icmp slt i32 %244, 0
br i1 %245, label %246, label %249
246: ; preds = %235
%247 = load i32, i32* @stderr
%248 = call i32 (i32, i8*, ...) @fprintf(i32 %247, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0))
store i32 -1, i32* %7
br label %347
249: ; preds = %235
%250 = load i32, i32* %21
%251 = icmp eq i32 %250, 0
br i1 %251, label %252, label %258
252: ; preds = %249
%253 = load i32, i32* %12
%254 = icmp eq i32 %253, 0
br i1 %254, label %255, label %256
255: ; preds = %252
store i32 1, i32* %26
br label %256
256: ; preds = %255, %252
%257 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0))
store i32 1, i32* %22
br label %288
258: ; preds = %249
%259 = load i32, i32* %21
%260 = icmp eq i32 %259, 1
br i1 %260, label %261, label %267
261: ; preds = %258
%262 = load i32, i32* %12
%263 = icmp eq i32 %262, 1
br i1 %263, label %264, label %265
264: ; preds = %261
store i32 1, i32* %26
br label %265
265: ; preds = %264, %261
store i32 0, i32* %25
%266 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0))
br label %287
267: ; preds = %258
%268 = load i32, i32* %21
%269 = icmp eq i32 %268, 2
br i1 %269, label %270, label %276
270: ; preds = %267
%271 = load i32, i32* %12
%272 = icmp eq i32 %271, 2
br i1 %272, label %273, label %274
273: ; preds = %270
store i32 1, i32* %26
br label %274
274: ; preds = %273, %270
store i32 0, i32* %25
%275 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0))
br label %286
276: ; preds = %267
%277 = load i32, i32* %21
%278 = icmp eq i32 %277, 3
br i1 %278, label %279, label %285
279: ; preds = %276
%280 = load i32, i32* %12
%281 = icmp eq i32 %280, 3
br i1 %281, label %282, label %283
282: ; preds = %279
store i32 1, i32* %26
br label %283
283: ; preds = %282, %279
store i32 0, i32* %25
%284 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.9, i64 0, i64 0))
br label %285
285: ; preds = %283, %276
br label %286
286: ; preds = %285, %274
br label %287
287: ; preds = %286, %265
br label %288
288: ; preds = %287, %256
br label %289
289: ; preds = %288
br label %290
290: ; preds = %289, %234
br label %291
291: ; preds = %290, %224
br label %292
292: ; preds = %291, %214
br label %293
293: ; preds = %292, %204
br label %333
294: ; preds = %192
%295 = load i32, i32* %23
%296 = icmp eq i32 %295, 29
br i1 %296, label %297, label %327
297: ; preds = %294
%298 = load i16*, i16** %10
%299 = load i32, i32* %23
%300 = sub nsw i32 %299, 2
%301 = sext i32 %300 to i64
%302 = getelementptr inbounds i16, i16* %298, i64 %301
%303 = load i16, i16* %302
%304 = sext i16 %303 to i32
%305 = sitofp i32 %304 to double
%306 = load i16*, i16** %10
%307 = load i32, i32* %23
%308 = sub nsw i32 %307, 1
%309 = sext i32 %308 to i64
%310 = getelementptr inbounds i16, i16* %306, i64 %309
%311 = load i16, i16* %310
%312 = sext i16 %311 to i32
%313 = and i32 %312, 32767
%314 = sitofp i32 %313 to double
%315 = fdiv double %314, 1.638400e+04
%316 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %305, double %315)
%317 = fptrunc double %316 to float
%318 = load float*, float** %11
store float %317, float* %318
%319 = load i32, i32* %22
%320 = icmp ne i32 %319, 0
br i1 %320, label %321, label %326
321: ; preds = %297
%322 = load float*, float** %11
%323 = load float, float* %322
%324 = fpext float %323 to double
%325 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.10, i64 0, i64 0), double %324)
br label %326
326: ; preds = %321, %297
store i32 0, i32* %22
br label %332
327: ; preds = %294
%328 = load i32, i32* %23
%329 = icmp eq i32 %328, 57
br i1 %329, label %330, label %331
330: ; preds = %327
store i32 1, i32* %24
br label %331
331: ; preds = %330, %327
br label %332
332: ; preds = %331, %326
br label %333
333: ; preds = %332, %293
%334 = load i32, i32* %23
%335 = add nsw i32 %334, 1
store i32 %335, i32* %23
br label %336
336: ; preds = %333, %187
br label %337
337: ; preds = %336, %144
br label %338
338: ; preds = %337
%339 = load i32, i32* %20
%340 = add nsw i32 %339, 1
store i32 %340, i32* %20
br label %85
341: ; preds = %85
%342 = load i32, i32* %26
%343 = icmp ne i32 %342, 0
br i1 %343, label %344, label %345
344: ; preds = %341
store i32 1, i32* %27
br label %345
345: ; preds = %344, %341
br label %48
346: ; preds = %48
store i32 0, i32* %7
br label %347
347: ; preds = %346, %246, %93, %67
%348 = load i32, i32* %7
ret i32 %348
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [33 x i8] c"Unable to find barker sequence.\0A\00"
@.str.1 = [28 x i8] c"Unable to read input file.\0A\00"
@.str.2 = [25 x i8] c"Error reading sample %d\0A\00"
@.str.3 = [32 x i8] c"Cannot determine pole, id=%04x\0A\00"
@.str.4 = [15 x i8] c"Rechecking...\0A\00"
@.str.5 = [33 x i8] c"Fatal Error in polarization id.\0A\00"
@.str.10 = [10 x i8] c"range=%g\0A\00"
@str = [13 x i8] c"Choosing VV.\00"
@str.11 = [13 x i8] c"Choosing VH.\00"
@str.12 = [13 x i8] c"Choosing HV.\00"
@str.13 = [13 x i8] c"Choosing HH.\00"
define i32 @read_adts(i32* %0, i16* nocapture writeonly %1, i16* nocapture %2, float* nocapture writeonly %3, i32 %4, i32 %5) {
%7 = bitcast i16* %2 to i8*
%8 = alloca [16 x i16]
%9 = alloca i32
%10 = bitcast [16 x i16]* %8 to i8*
%11 = bitcast i32* %9 to i8*
%12 = bitcast [16 x i16]* %8 to <8 x i16>*
store <8 x i16> <i16 -32768, i16 16384, i16 8192, i16 4096, i16 2048, i16 1024, i16 512, i16 256>, <8 x i16>* %12
%13 = getelementptr inbounds [16 x i16], [16 x i16]* %8, i64 0, i64 8
%14 = bitcast i16* %13 to <8 x i16>*
store <8 x i16> <i16 128, i16 64, i16 32, i16 16, i16 8, i16 4, i16 2, i16 1>, <8 x i16>* %14
%15 = icmp sgt i32 %5, 0
%16 = getelementptr inbounds i16, i16* %2, i64 27
%17 = getelementptr inbounds i16, i16* %2, i64 28
%18 = icmp eq i32 %4, 3
%19 = icmp eq i32 %4, 2
%20 = icmp eq i32 %4, 1
%21 = icmp eq i32 %4, 0
%22 = zext i32 %5 to i64
br label %23
23: ; preds = %6, %167
%24 = phi i32 [ 0, %6 ], [ %169, %167 ]
%25 = phi i32 [ 0, %6 ], [ %168, %167 ]
%26 = call i32 @cmp_barker(i32* %0)
%27 = icmp slt i32 %26, 0
br i1 %27, label %28, label %35
28: ; preds = %23
switch i32 %26, label %172 [
i32 -1, label %29
i32 -2, label %32
]
29: ; preds = %28
%30 = load i32, i32* @stderr
%31 = call i32 (i32, i8*, ...) @fprintf(i32 %30, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %172
32: ; preds = %28
%33 = load i32, i32* @stderr
%34 = call i32 (i32, i8*, ...) @fprintf(i32 %33, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
br label %172
35: ; preds = %23
%36 = icmp eq i32 %24, 0
br i1 %36, label %37, label %38
37: ; preds = %35
br label %38
38: ; preds = %37, %35
br i1 %15, label %39, label %167
39: ; preds = %38, %158
%40 = phi i64 [ %159, %158 ], [ 0, %38 ]
%41 = phi i32 [ %165, %158 ], [ 0, %38 ]
%42 = phi i32 [ %164, %158 ], [ 1, %38 ]
%43 = phi i32 [ %163, %158 ], [ %24, %38 ]
%44 = phi i32 [ %162, %158 ], [ 0, %38 ]
%45 = phi i32 [ %161, %158 ], [ %25, %38 ]
%46 = phi i16 [ %160, %158 ], [ 0, %38 ]
%47 = call i32 @fread_bo(i32* %9, i32 1, i32 4, i32* %0, i32 4)
%48 = icmp eq i32 %47, 4
br i1 %48, label %53, label %49
49: ; preds = %39
%50 = trunc i64 %40 to i32
%51 = load i32, i32* @stderr
%52 = call i32 (i32, i8*, ...) @fprintf(i32 %51, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 %50)
br label %172
53: ; preds = %39
%54 = load i32, i32* %9
%55 = lshr i32 %54, 20
%56 = trunc i32 %55 to i16
%57 = and i16 %56, 1023
%58 = and i32 %54, 1073741824
%59 = icmp eq i32 %58, 0
%60 = select i1 %59, i16 0, i16 -1024
%61 = or i16 %57, %60
%62 = trunc i32 %54 to i16
%63 = lshr i16 %62, 4
%64 = and i16 %63, 1023
%65 = and i32 %54, 16384
%66 = icmp eq i32 %65, 0
%67 = select i1 %66, i16 0, i16 -1024
%68 = or i16 %64, %67
%69 = shl nuw nsw i64 %40, 1
%70 = getelementptr inbounds i16, i16* %1, i64 %69
store i16 %68, i16* %70
%71 = or i64 %69, 1
%72 = getelementptr inbounds i16, i16* %1, i64 %71
store i16 %61, i16* %72
%73 = icmp sgt i32 %44, 57
%74 = icmp eq i32 %42, 0
%75 = select i1 %73, i1 true, i1 %74
%76 = icmp ne i32 %44, 0
%77 = and i1 %76, %75
br i1 %77, label %78, label %80
78: ; preds = %53
%79 = add nuw nsw i64 %40, 1
br label %158
80: ; preds = %53
%81 = and i32 %54, 8
%82 = icmp eq i32 %81, 0
br i1 %82, label %98, label %83
83: ; preds = %80
br i1 %76, label %89, label %84
84: ; preds = %83
%85 = and i64 %40, 15
%86 = getelementptr inbounds [16 x i16], [16 x i16]* %8, i64 0, i64 %85
%87 = load i16, i16* %86
%88 = or i16 %87, %46
br label %98
89: ; preds = %83
%90 = add nsw i32 %44, -1
%91 = sext i32 %90 to i64
%92 = getelementptr inbounds i16, i16* %2, i64 %91
%93 = load i16, i16* %92
%94 = and i64 %40, 15
%95 = getelementptr inbounds [16 x i16], [16 x i16]* %8, i64 0, i64 %94
%96 = load i16, i16* %95
%97 = or i16 %96, %93
store i16 %97, i16* %92
br label %98
98: ; preds = %84, %89, %80
%99 = phi i16 [ %46, %89 ], [ %88, %84 ], [ %46, %80 ]
%100 = add nuw nsw i64 %40, 1
%101 = and i64 %100, 15
%102 = icmp eq i64 %101, 0
br i1 %102, label %103, label %158
103: ; preds = %98
switch i32 %44, label %152 [
i32 0, label %104
i32 29, label %138
i32 57, label %151
]
104: ; preds = %103
%105 = or i16 %99, 240
switch i16 %105, label %114 [
i16 1008, label %106
i16 17397, label %108
i16 -31750, label %110
i16 -15361, label %112
]
106: ; preds = %104
%107 = select i1 %21, i32 1, i32 %41
br label %152
108: ; preds = %104
%109 = select i1 %20, i32 1, i32 %41
br label %152
110: ; preds = %104
%111 = select i1 %19, i32 1, i32 %41
br label %152
112: ; preds = %104
%113 = select i1 %18, i32 1, i32 %41
br label %152
114: ; preds = %104
%115 = zext i16 %99 to i32
%116 = load i32, i32* @stderr
%117 = call i32 (i32, i8*, ...) @fprintf(i32 %116, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0), i32 %115)
%118 = load i32, i32* @stderr
%119 = call i32 (i32, i8*, ...) @fprintf(i32 %118, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0))
%120 = call i32 @idcheck(i16 zeroext %99)
%121 = icmp slt i32 %120, 0
br i1 %121, label %122, label %125
122: ; preds = %114
%123 = load i32, i32* @stderr
%124 = call i32 (i32, i8*, ...) @fprintf(i32 %123, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0))
br label %172
125: ; preds = %114
switch i32 %120, label %152 [
i32 0, label %126
i32 1, label %129
i32 2, label %132
i32 3, label %135
]
126: ; preds = %125
%127 = select i1 %21, i32 1, i32 %41
%128 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.13, i64 0, i64 0))
br label %152
129: ; preds = %125
%130 = select i1 %20, i32 1, i32 %41
%131 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.12, i64 0, i64 0))
br label %152
132: ; preds = %125
%133 = select i1 %19, i32 1, i32 %41
%134 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.11, i64 0, i64 0))
br label %152
135: ; preds = %125
%136 = select i1 %18, i32 1, i32 %41
%137 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
br label %152
138: ; preds = %103
%139 = load i16, i16* %16
%140 = sitofp i16 %139 to double
%141 = load i16, i16* %17
%142 = and i16 %141, 32767
%143 = uitofp i16 %142 to double
%144 = fmul double %143, 0x3F10000000000000
%145 = call double @llvm.fmuladd.f64(double %140, double 2.000000e+00, double %144)
%146 = fptrunc double %145 to float
store float %146, float* %3
%147 = icmp eq i32 %45, 0
br i1 %147, label %152, label %148
148: ; preds = %138
%149 = fpext float %146 to double
%150 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.10, i64 0, i64 0), double %149)
br label %152
151: ; preds = %103
br label %152
152: ; preds = %106, %103, %138, %148, %125, %151, %110, %129, %135, %132, %126, %112, %108
%153 = phi i32 [ %45, %108 ], [ %45, %110 ], [ %45, %112 ], [ 1, %126 ], [ %45, %129 ], [ %45, %132 ], [ %45, %135 ], [ %45, %151 ], [ %45, %106 ], [ %45, %125 ], [ 0, %148 ], [ 0, %138 ], [ %45, %103 ]
%154 = phi i32 [ %43, %108 ], [ %43, %110 ], [ %43, %112 ], [ %43, %126 ], [ %43, %129 ], [ %43, %132 ], [ %43, %135 ], [ 1, %151 ], [ %43, %106 ], [ %43, %125 ], [ %43, %148 ], [ %43, %138 ], [ %43, %103 ]
%155 = phi i32 [ 0, %108 ], [ 0, %110 ], [ 0, %112 ], [ %42, %126 ], [ 0, %129 ], [ 0, %132 ], [ 0, %135 ], [ %42, %151 ], [ %42, %106 ], [ %42, %125 ], [ %42, %148 ], [ %42, %138 ], [ %42, %103 ]
%156 = phi i32 [ %109, %108 ], [ %111, %110 ], [ %113, %112 ], [ %127, %126 ], [ %130, %129 ], [ %133, %132 ], [ %136, %135 ], [ %41, %151 ], [ %107, %106 ], [ %41, %125 ], [ %41, %148 ], [ %41, %138 ], [ %41, %103 ]
%157 = add nsw i32 %44, 1
br label %158
158: ; preds = %78, %152, %98
%159 = phi i64 [ %79, %78 ], [ %100, %152 ], [ %100, %98 ]
%160 = phi i16 [ %46, %78 ], [ %99, %152 ], [ %99, %98 ]
%161 = phi i32 [ %45, %78 ], [ %153, %152 ], [ %45, %98 ]
%162 = phi i32 [ %44, %78 ], [ %157, %152 ], [ %44, %98 ]
%163 = phi i32 [ %43, %78 ], [ %154, %152 ], [ %43, %98 ]
%164 = phi i32 [ %42, %78 ], [ %155, %152 ], [ %42, %98 ]
%165 = phi i32 [ %41, %78 ], [ %156, %152 ], [ %41, %98 ]
%166 = icmp eq i64 %159, %22
br i1 %166, label %167, label %39
167: ; preds = %158, %38
%168 = phi i32 [ %25, %38 ], [ %161, %158 ]
%169 = phi i32 [ %24, %38 ], [ %163, %158 ]
%170 = phi i32 [ 0, %38 ], [ %165, %158 ]
%171 = icmp eq i32 %170, 0
br i1 %171, label %23, label %172
172: ; preds = %167, %29, %32, %28, %122, %49
%173 = phi i32 [ -1, %49 ], [ -1, %122 ], [ -1, %28 ], [ -1, %32 ], [ -1, %29 ], [ 0, %167 ]
ret i32 %173
}