#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 /*<<< orphan*/ SEEK_CUR;
scalar_t__ atoi(char *);
int /*<<< orphan*/ dump_hdr_filter(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int fread(char *, int, int, int /*<<< orphan*/ *);
int fseek(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, ...);
char *qfits_getvalue(char *);
int /*<<< orphan*/ rewind(int /*<<< orphan*/ *);
char *rstrip(char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strlen(char *);
scalar_t__ strncmp(char *, char *, int /*<<< orphan*/);
int dump_fits_filter(FILE *in, int xtnum) {
  int n_xt;
  char buf[80 + 2];
  int err;
  int data_bytes, naxis;
  char *read_val;
  int skip_blocks;
  int seeked;
  int hdr, hdr_type;
  int i;
  memset(buf, 0, 80 + 2);
  if (fread(buf, sizeof(char), 80 + 1, in) != 80 + 1) {
    fprintf(stderr, "error reading input\n");
    return 1;
  }
  rewind(in);
  hdr = 0;
  for (i = 0; i < 80 + 2; i++) {
    if ((int)(buf[i]) == 10) {
      hdr = 1;
      break;
    }
  }
  if (hdr) {
    if (!strncmp(buf, "SIMPLE  =", strlen("SIMPLE  ="))) {
      hdr_type = 0;
    } else if (!strncmp(buf, "XTENSION=", strlen("XTENSION="))) {
      hdr_type = 1;
    } else {
      fprintf(stderr, "not a HDR file\n");
      return 1;
    }
    dump_hdr_filter(in, hdr_type);
    return 0;
  }
  if (strncmp(buf, "SIMPLE  =", strlen("SIMPLE  ="))) {
    fprintf(stderr, "not a FITS file\n");
    return 1;
  }
  naxis = 0;
  data_bytes = 1;
  memset(buf, 0, 80 + 2);
  if (xtnum < 1) {
    data_bytes = 1;
    naxis = 0;
    while ((err = fread(buf, sizeof(char), 80, in)) == 80) {
      printf("%s\n", rstrip(buf));
      if (buf[0] == 'B' && buf[1] == 'I' && buf[2] == 'T' && buf[3] == 'P' &&
          buf[4] == 'I' && buf[5] == 'X' && buf[6] == ' ') {
        read_val = qfits_getvalue(buf);
        data_bytes *= (int)atoi(read_val) / 8;
        if (data_bytes < 0)
          data_bytes *= -1;
      } else if (buf[0] == 'N' && buf[1] == 'A' && buf[2] == 'X' &&
                 buf[3] == 'I' && buf[4] == 'S') {
        if (buf[5] == ' ') {
          read_val = qfits_getvalue(buf);
          naxis = (int)atoi(read_val);
        } else {
          read_val = qfits_getvalue(buf);
          data_bytes *= (int)atoi(read_val);
        }
      } else if (buf[0] == 'E' && buf[1] == 'N' && buf[2] == 'D') {
        break;
      }
    }
    if (err != 80)
      return 1;
  }
  if (xtnum < 0)
    return 0;
  n_xt = 0;
  while (1) {
    if (naxis > 0) {
      skip_blocks = data_bytes / 2880;
      if ((data_bytes % 2880) != 0)
        skip_blocks++;
      seeked = fseek(in, skip_blocks * 2880, SEEK_CUR);
      if (seeked < 0)
        return -1;
    }
    while ((err = fread(buf, sizeof(char), 80, in)) == 80) {
      if (buf[0] == 'X' && buf[1] == 'T' && buf[2] == 'E' && buf[3] == 'N' &&
          buf[4] == 'S' && buf[5] == 'I' && buf[6] == 'O' && buf[7] == 'N')
        break;
    }
    if (err == 0)
      break;
    if (err != 80)
      return 1;
    n_xt++;
    if (xtnum == 0 || xtnum == n_xt) {
      printf("===> xtension %d\n", n_xt);
      printf("%s\n", rstrip(buf));
    }
    data_bytes = 1;
    naxis = 0;
    while ((err = fread(buf, sizeof(char), 80, in)) == 80) {
      if (xtnum == 0 || xtnum == n_xt)
        printf("%s\n", rstrip(buf));
      if (buf[0] == 'B' && buf[1] == 'I' && buf[2] == 'T' && buf[3] == 'P' &&
          buf[4] == 'I' && buf[5] == 'X' && buf[6] == ' ') {
        read_val = qfits_getvalue(buf);
        data_bytes *= (int)atoi(read_val) / 8;
        if (data_bytes < 0)
          data_bytes *= -1;
      } else if (buf[0] == 'N' && buf[1] == 'A' && buf[2] == 'X' &&
                 buf[3] == 'I' && buf[4] == 'S') {
        if (buf[5] == ' ') {
          read_val = qfits_getvalue(buf);
          naxis = (int)atoi(read_val);
        } else {
          read_val = qfits_getvalue(buf);
          data_bytes *= (int)atoi(read_val);
        }
      } else if (buf[0] == 'E' && buf[1] == 'N' && buf[2] == 'D')
        break;
    }
    if (n_xt == xtnum)
      break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<dump_fits_filter>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
lea    -0x70(%rbp),%rdi
xor    %esi,%esi
mov    $0x52,%edx
call   10a0 <memset@plt>
lea    -0x70(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x1,%esi
mov    $0x51,%edx
call   1060 <fread@plt>
cmp    $0x51,%eax
je     1223 <dump_fits_filter+0x63>
mov    0x2dcf(%rip),%rax
mov    (%rax),%edi
lea    0xdee(%rip),%rsi
call   10b0 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    194b <dump_fits_filter+0x78b>
mov    -0x10(%rbp),%rdi
call   1090 <rewind@plt>
movl   $0x0,-0x94(%rbp)
movl   $0x0,-0x9c(%rbp)
cmpl   $0x52,-0x9c(%rbp)
jge    128a <dump_fits_filter+0xca>
movslq -0x9c(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%eax
cmp    $0xa,%eax
jne    1271 <dump_fits_filter+0xb1>
movl   $0x1,-0x94(%rbp)
jmp    128a <dump_fits_filter+0xca>
jmp    1276 <dump_fits_filter+0xb6>
mov    -0x9c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9c(%rbp)
jmp    1240 <dump_fits_filter+0x80>
cmpl   $0x0,-0x94(%rbp)
je     1362 <dump_fits_filter+0x1a2>
lea    -0x70(%rbp),%rax
mov    %rax,-0xa8(%rbp)
lea    0xd6c(%rip),%rdi
call   1070 <strlen@plt>
mov    -0xa8(%rbp),%rdi
mov    %eax,%edx
lea    0xd57(%rip),%rsi
call   1050 <strncmp@plt>
cmp    $0x0,%rax
jne    12dc <dump_fits_filter+0x11c>
movl   $0x0,-0x98(%rbp)
jmp    1347 <dump_fits_filter+0x187>
lea    -0x70(%rbp),%rax
mov    %rax,-0xb0(%rbp)
lea    0xd31(%rip),%rdi
call   1070 <strlen@plt>
mov    -0xb0(%rbp),%rdi
mov    %eax,%edx
lea    0xd1c(%rip),%rsi
call   1050 <strncmp@plt>
cmp    $0x0,%rax
jne    1321 <dump_fits_filter+0x161>
movl   $0x1,-0x98(%rbp)
jmp    1342 <dump_fits_filter+0x182>
mov    0x2cb0(%rip),%rax
mov    (%rax),%edi
lea    0xcf8(%rip),%rsi
call   10b0 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    194b <dump_fits_filter+0x78b>
jmp    1347 <dump_fits_filter+0x187>
mov    -0x10(%rbp),%rdi
mov    -0x98(%rbp),%esi
call   1040 <dump_hdr_filter@plt>
movl   $0x0,-0x4(%rbp)
jmp    194b <dump_fits_filter+0x78b>
lea    -0x70(%rbp),%rax
mov    %rax,-0xb8(%rbp)
lea    0xca1(%rip),%rdi
call   1070 <strlen@plt>
mov    -0xb8(%rbp),%rdi
mov    %eax,%edx
lea    0xc8c(%rip),%rsi
call   1050 <strncmp@plt>
cmp    $0x0,%rax
je     13b9 <dump_fits_filter+0x1f9>
mov    0x2c39(%rip),%rax
mov    (%rax),%edi
lea    0xc91(%rip),%rsi
call   10b0 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    194b <dump_fits_filter+0x78b>
movl   $0x0,-0x7c(%rbp)
movl   $0x1,-0x78(%rbp)
lea    -0x70(%rbp),%rdi
xor    %esi,%esi
mov    $0x52,%edx
call   10a0 <memset@plt>
cmpl   $0x1,-0x14(%rbp)
jge    15b8 <dump_fits_filter+0x3f8>
movl   $0x1,-0x78(%rbp)
movl   $0x0,-0x7c(%rbp)
lea    -0x70(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x1,%esi
mov    $0x50,%edx
call   1060 <fread@plt>
mov    %eax,-0x74(%rbp)
cmp    $0x50,%eax
jne    159d <dump_fits_filter+0x3dd>
lea    -0x70(%rbp),%rdi
call   1030 <rstrip@plt>
mov    %rax,%rsi
lea    0xc25(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
movsbl -0x70(%rbp),%eax
cmp    $0x42,%eax
jne    14c8 <dump_fits_filter+0x308>
movsbl -0x6f(%rbp),%eax
cmp    $0x49,%eax
jne    14c8 <dump_fits_filter+0x308>
movsbl -0x6e(%rbp),%eax
cmp    $0x54,%eax
jne    14c8 <dump_fits_filter+0x308>
movsbl -0x6d(%rbp),%eax
cmp    $0x50,%eax
jne    14c8 <dump_fits_filter+0x308>
movsbl -0x6c(%rbp),%eax
cmp    $0x49,%eax
jne    14c8 <dump_fits_filter+0x308>
movsbl -0x6b(%rbp),%eax
cmp    $0x58,%eax
jne    14c8 <dump_fits_filter+0x308>
movsbl -0x6a(%rbp),%eax
cmp    $0x20,%eax
jne    14c8 <dump_fits_filter+0x308>
lea    -0x70(%rbp),%rdi
call   10d0 <qfits_getvalue@plt>
mov    %rax,-0x88(%rbp)
mov    -0x88(%rbp),%rdi
call   10e0 <atoi@plt>
mov    $0x8,%ecx
cltd
idiv   %ecx
imul   -0x78(%rbp),%eax
mov    %eax,-0x78(%rbp)
cmpl   $0x0,-0x78(%rbp)
jge    14c3 <dump_fits_filter+0x303>
imul   $0xffffffff,-0x78(%rbp),%eax
mov    %eax,-0x78(%rbp)
jmp    1598 <dump_fits_filter+0x3d8>
movsbl -0x70(%rbp),%eax
cmp    $0x4e,%eax
jne    1562 <dump_fits_filter+0x3a2>
movsbl -0x6f(%rbp),%eax
cmp    $0x41,%eax
jne    1562 <dump_fits_filter+0x3a2>
movsbl -0x6e(%rbp),%eax
cmp    $0x58,%eax
jne    1562 <dump_fits_filter+0x3a2>
movsbl -0x6d(%rbp),%eax
cmp    $0x49,%eax
jne    1562 <dump_fits_filter+0x3a2>
movsbl -0x6c(%rbp),%eax
cmp    $0x53,%eax
jne    1562 <dump_fits_filter+0x3a2>
movsbl -0x6b(%rbp),%eax
cmp    $0x20,%eax
jne    153a <dump_fits_filter+0x37a>
lea    -0x70(%rbp),%rdi
call   10d0 <qfits_getvalue@plt>
mov    %rax,-0x88(%rbp)
mov    -0x88(%rbp),%rdi
call   10e0 <atoi@plt>
mov    %eax,-0x7c(%rbp)
jmp    155d <dump_fits_filter+0x39d>
lea    -0x70(%rbp),%rdi
call   10d0 <qfits_getvalue@plt>
mov    %rax,-0x88(%rbp)
mov    -0x88(%rbp),%rdi
call   10e0 <atoi@plt>
imul   -0x78(%rbp),%eax
mov    %eax,-0x78(%rbp)
jmp    1593 <dump_fits_filter+0x3d3>
movsbl -0x70(%rbp),%eax
cmp    $0x45,%eax
jne    158e <dump_fits_filter+0x3ce>
movsbl -0x6f(%rbp),%eax
cmp    $0x4e,%eax
jne    158e <dump_fits_filter+0x3ce>
movsbl -0x6e(%rbp),%eax
cmp    $0x44,%eax
jne    158e <dump_fits_filter+0x3ce>
jmp    159d <dump_fits_filter+0x3dd>
jmp    1593 <dump_fits_filter+0x3d3>
jmp    1598 <dump_fits_filter+0x3d8>
jmp    13ef <dump_fits_filter+0x22f>
cmpl   $0x50,-0x74(%rbp)
je     15b3 <dump_fits_filter+0x3f3>
movl   $0x1,-0x4(%rbp)
jmp    194b <dump_fits_filter+0x78b>
jmp    15b8 <dump_fits_filter+0x3f8>
cmpl   $0x0,-0x14(%rbp)
jge    15ce <dump_fits_filter+0x40e>
movl   $0x0,-0x4(%rbp)
jmp    194b <dump_fits_filter+0x78b>
movl   $0x0,-0x18(%rbp)
cmpl   $0x0,-0x7c(%rbp)
jle    1653 <dump_fits_filter+0x493>
mov    -0x78(%rbp),%eax
mov    $0xb40,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8c(%rbp)
mov    -0x78(%rbp),%eax
mov    $0xb40,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1613 <dump_fits_filter+0x453>
mov    -0x8c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8c(%rbp)
mov    -0x10(%rbp),%rdi
imul   $0xb40,-0x8c(%rbp),%esi
mov    0x29c0(%rip),%rax
mov    (%rax),%edx
call   10c0 <fseek@plt>
mov    %eax,-0x90(%rbp)
cmpl   $0x0,-0x90(%rbp)
jge    164e <dump_fits_filter+0x48e>
movl   $0xffffffff,-0x4(%rbp)
jmp    194b <dump_fits_filter+0x78b>
jmp    1653 <dump_fits_filter+0x493>
jmp    1658 <dump_fits_filter+0x498>
lea    -0x70(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x1,%esi
mov    $0x50,%edx
call   1060 <fread@plt>
mov    %eax,-0x74(%rbp)
cmp    $0x50,%eax
jne    16ed <dump_fits_filter+0x52d>
movsbl -0x70(%rbp),%eax
cmp    $0x58,%eax
jne    16e8 <dump_fits_filter+0x528>
movsbl -0x6f(%rbp),%eax
cmp    $0x54,%eax
jne    16e8 <dump_fits_filter+0x528>
movsbl -0x6e(%rbp),%eax
cmp    $0x45,%eax
jne    16e8 <dump_fits_filter+0x528>
movsbl -0x6d(%rbp),%eax
cmp    $0x4e,%eax
jne    16e8 <dump_fits_filter+0x528>
movsbl -0x6c(%rbp),%eax
cmp    $0x53,%eax
jne    16e8 <dump_fits_filter+0x528>
movsbl -0x6b(%rbp),%eax
cmp    $0x49,%eax
jne    16e8 <dump_fits_filter+0x528>
movsbl -0x6a(%rbp),%eax
cmp    $0x4f,%eax
jne    16e8 <dump_fits_filter+0x528>
movsbl -0x69(%rbp),%eax
cmp    $0x4e,%eax
jne    16e8 <dump_fits_filter+0x528>
jmp    16ed <dump_fits_filter+0x52d>
jmp    1658 <dump_fits_filter+0x498>
cmpl   $0x0,-0x74(%rbp)
jne    16fc <dump_fits_filter+0x53c>
jmp    1944 <dump_fits_filter+0x784>
cmpl   $0x50,-0x74(%rbp)
je     1712 <dump_fits_filter+0x552>
movl   $0x1,-0x4(%rbp)
jmp    194b <dump_fits_filter+0x78b>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1731 <dump_fits_filter+0x571>
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jne    175c <dump_fits_filter+0x59c>
mov    -0x18(%rbp),%esi
lea    0x913(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    -0x70(%rbp),%rdi
call   1030 <rstrip@plt>
mov    %rax,%rsi
lea    0x8f5(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
movl   $0x1,-0x78(%rbp)
movl   $0x0,-0x7c(%rbp)
lea    -0x70(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x1,%esi
mov    $0x50,%edx
call   1060 <fread@plt>
mov    %eax,-0x74(%rbp)
cmp    $0x50,%eax
jne    192e <dump_fits_filter+0x76e>
cmpl   $0x0,-0x14(%rbp)
je     17a3 <dump_fits_filter+0x5e3>
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jne    17bd <dump_fits_filter+0x5fd>
lea    -0x70(%rbp),%rdi
call   1030 <rstrip@plt>
mov    %rax,%rsi
lea    0x894(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
movsbl -0x70(%rbp),%eax
cmp    $0x42,%eax
jne    1859 <dump_fits_filter+0x699>
movsbl -0x6f(%rbp),%eax
cmp    $0x49,%eax
jne    1859 <dump_fits_filter+0x699>
movsbl -0x6e(%rbp),%eax
cmp    $0x54,%eax
jne    1859 <dump_fits_filter+0x699>
movsbl -0x6d(%rbp),%eax
cmp    $0x50,%eax
jne    1859 <dump_fits_filter+0x699>
movsbl -0x6c(%rbp),%eax
cmp    $0x49,%eax
jne    1859 <dump_fits_filter+0x699>
movsbl -0x6b(%rbp),%eax
cmp    $0x58,%eax
jne    1859 <dump_fits_filter+0x699>
movsbl -0x6a(%rbp),%eax
cmp    $0x20,%eax
jne    1859 <dump_fits_filter+0x699>
lea    -0x70(%rbp),%rdi
call   10d0 <qfits_getvalue@plt>
mov    %rax,-0x88(%rbp)
mov    -0x88(%rbp),%rdi
call   10e0 <atoi@plt>
mov    $0x8,%ecx
cltd
idiv   %ecx
imul   -0x78(%rbp),%eax
mov    %eax,-0x78(%rbp)
cmpl   $0x0,-0x78(%rbp)
jge    1854 <dump_fits_filter+0x694>
imul   $0xffffffff,-0x78(%rbp),%eax
mov    %eax,-0x78(%rbp)
jmp    1929 <dump_fits_filter+0x769>
movsbl -0x70(%rbp),%eax
cmp    $0x4e,%eax
jne    18f3 <dump_fits_filter+0x733>
movsbl -0x6f(%rbp),%eax
cmp    $0x41,%eax
jne    18f3 <dump_fits_filter+0x733>
movsbl -0x6e(%rbp),%eax
cmp    $0x58,%eax
jne    18f3 <dump_fits_filter+0x733>
movsbl -0x6d(%rbp),%eax
cmp    $0x49,%eax
jne    18f3 <dump_fits_filter+0x733>
movsbl -0x6c(%rbp),%eax
cmp    $0x53,%eax
jne    18f3 <dump_fits_filter+0x733>
movsbl -0x6b(%rbp),%eax
cmp    $0x20,%eax
jne    18cb <dump_fits_filter+0x70b>
lea    -0x70(%rbp),%rdi
call   10d0 <qfits_getvalue@plt>
mov    %rax,-0x88(%rbp)
mov    -0x88(%rbp),%rdi
call   10e0 <atoi@plt>
mov    %eax,-0x7c(%rbp)
jmp    18ee <dump_fits_filter+0x72e>
lea    -0x70(%rbp),%rdi
call   10d0 <qfits_getvalue@plt>
mov    %rax,-0x88(%rbp)
mov    -0x88(%rbp),%rdi
call   10e0 <atoi@plt>
imul   -0x78(%rbp),%eax
mov    %eax,-0x78(%rbp)
jmp    1924 <dump_fits_filter+0x764>
movsbl -0x70(%rbp),%eax
cmp    $0x45,%eax
jne    191f <dump_fits_filter+0x75f>
movsbl -0x6f(%rbp),%eax
cmp    $0x4e,%eax
jne    191f <dump_fits_filter+0x75f>
movsbl -0x6e(%rbp),%eax
cmp    $0x44,%eax
jne    191f <dump_fits_filter+0x75f>
jmp    192e <dump_fits_filter+0x76e>
jmp    1924 <dump_fits_filter+0x764>
jmp    1929 <dump_fits_filter+0x769>
jmp    176a <dump_fits_filter+0x5aa>
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jne    193f <dump_fits_filter+0x77f>
jmp    1944 <dump_fits_filter+0x784>
jmp    15d5 <dump_fits_filter+0x415>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_fits_filter>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
mov    %esi,%r14d
mov    %rdi,%r12
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x52,%edx
call   10b0 <memset@plt>
mov    $0x1,%ebp
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x51,%edx
mov    %r12,%rcx
call   1070 <fread@plt>
cmp    $0x51,%eax
jne    1289 <dump_fits_filter+0xb9>
mov    %r12,%rdi
call   10a0 <rewind@plt>
mov    $0x1,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
cmpb   $0xa,0xf(%rsp,%rax,1)
je     12a0 <dump_fits_filter+0xd0>
cmpb   $0xa,0x10(%rsp,%rax,1)
je     12a0 <dump_fits_filter+0xd0>
add    $0x2,%rax
cmp    $0x53,%rax
jne    1230 <dump_fits_filter+0x60>
lea    0xdc6(%rip),%rbx
mov    %rbx,%rdi
call   1080 <strlen@plt>
lea    0x10(%rsp),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1050 <strncmp@plt>
test   %rax,%rax
je     1327 <dump_fits_filter+0x157>
mov    0x2d62(%rip),%rax
mov    (%rax),%edi
lea    0xdba(%rip),%rsi
call   10c0 <fprintf@plt>
jmp    1316 <dump_fits_filter+0x146>
mov    0x2d48(%rip),%rax
mov    (%rax),%edi
lea    0xd67(%rip),%rsi
call   10c0 <fprintf@plt>
jmp    1316 <dump_fits_filter+0x146>
lea    0xd6e(%rip),%rbx
mov    %rbx,%rdi
call   1080 <strlen@plt>
lea    0x10(%rsp),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1050 <strncmp@plt>
xor    %ebp,%ebp
mov    $0x0,%esi
test   %rax,%rax
je     130e <dump_fits_filter+0x13e>
lea    0xd4e(%rip),%rbx
mov    %rbx,%rdi
call   1080 <strlen@plt>
lea    0x10(%rsp),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1050 <strncmp@plt>
test   %rax,%rax
je     1309 <dump_fits_filter+0x139>
mov    0x2ce4(%rip),%rax
mov    (%rax),%edi
lea    0xd2c(%rip),%rsi
call   10c0 <fprintf@plt>
mov    $0x1,%ebp
jmp    1316 <dump_fits_filter+0x146>
mov    $0x1,%esi
mov    %r12,%rdi
call   1040 <dump_hdr_filter@plt>
mov    %ebp,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0x10(%rsp),%rdi
xor    %esi,%esi
mov    $0x52,%edx
call   10b0 <memset@plt>
mov    $0x0,%eax
mov    $0x1,%r13d
test   %r14d,%r14d
jle    15b0 <dump_fits_filter+0x3e0>
mov    %eax,(%rsp)
mov    0x2c92(%rip),%rdi
lea    0x10(%rsp),%r15
movabs $0x4e4f49534e455458,%rbx
49 4f 4e
movl   $0x0,0x8(%rsp)
xor    %ebp,%ebp
cmpl   $0x0,(%rsp)
jle    13c0 <dump_fits_filter+0x1f0>
movslq %r13d,%rax
imul   $0xffffffffb60b60b7,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0xb,%ecx
add    %edx,%ecx
imul   $0xa4fa4fa5,%eax,%eax
add    $0x2d82d80,%eax
ror    $0x6,%eax
cmp    $0x16c16d,%eax
sbb    $0xffffffff,%ecx
imul   $0xb40,%ecx,%esi
mov    (%rdi),%edx
mov    %r12,%rdi
call   10d0 <fseek@plt>
test   %eax,%eax
js     170b <dump_fits_filter+0x53b>
nopl   (%rax)
mov    %r15,%rdi
mov    $0x1,%esi
mov    $0x50,%edx
mov    %r12,%rcx
call   1070 <fread@plt>
cmp    $0x50,%eax
jne    15a1 <dump_fits_filter+0x3d1>
movq   0x10(%rsp),%xmm0
movq   %xmm0,%rax
cmp    %rbx,%rax
jne    13c0 <dump_fits_filter+0x1f0>
test   %r14d,%r14d
sete   %al
mov    0x8(%rsp),%ecx
add    $0x1,%ecx
mov    %r14d,0xc(%rsp)
mov    %ecx,0x8(%rsp)
cmp    %r14d,%ecx
sete   %cl
or     %al,%cl
mov    %cl,0x7(%rsp)
cmp    $0x1,%cl
jne    1437 <dump_fits_filter+0x267>
lea    0xc2e(%rip),%rdi
mov    0x8(%rsp),%esi
xor    %eax,%eax
call   1090 <printf@plt>
mov    %r15,%rdi
call   1030 <rstrip@plt>
mov    %rax,%rdi
call   1060 <puts@plt>
mov    $0x1,%r13d
mov    %r15,%rdi
mov    $0x1,%esi
mov    $0x50,%edx
mov    %r12,%rcx
call   1070 <fread@plt>
movl   $0x0,(%rsp)
cmp    $0x50,%eax
jne    157b <dump_fits_filter+0x3ab>
mov    $0x1,%r13d
movl   $0x0,(%rsp)
jmp    14b8 <dump_fits_filter+0x2e8>
mov    %r15,%rdi
call   10e0 <qfits_getvalue@plt>
mov    %rax,%rdi
call   10f0 <atoi@plt>
lea    0x7(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
sar    $0x3,%ecx
imul   %r13d,%ecx
mov    %ecx,%r13d
neg    %r13d
cmovs  %ecx,%r13d
mov    %r15,%rdi
mov    $0x1,%esi
mov    $0x50,%edx
mov    %r12,%rcx
call   1070 <fread@plt>
cmp    $0x50,%eax
jne    157b <dump_fits_filter+0x3ab>
cmpb   $0x0,0x7(%rsp)
je     14cf <dump_fits_filter+0x2ff>
mov    %r15,%rdi
call   1030 <rstrip@plt>
mov    %rax,%rdi
call   1060 <puts@plt>
movzbl 0x10(%rsp),%edx
movzbl 0x11(%rsp),%ecx
movzbl 0x12(%rsp),%esi
movzbl 0x13(%rsp),%eax
movzbl 0x14(%rsp),%ebx
movzbl 0x15(%rsp),%r14d
cmp    $0x42,%dl
jne    1518 <dump_fits_filter+0x348>
cmp    $0x49,%cl
jne    1518 <dump_fits_filter+0x348>
cmp    $0x54,%sil
jne    1518 <dump_fits_filter+0x348>
cmp    $0x50,%al
jne    1518 <dump_fits_filter+0x348>
cmp    $0x49,%bl
jne    1518 <dump_fits_filter+0x348>
cmp    $0x58,%r14b
jne    1518 <dump_fits_filter+0x348>
cmpb   $0x20,0x16(%rsp)
je     1471 <dump_fits_filter+0x2a1>
cmp    $0x4e,%dl
jne    155f <dump_fits_filter+0x38f>
cmp    $0x41,%cl
jne    155f <dump_fits_filter+0x38f>
cmp    $0x58,%sil
jne    155f <dump_fits_filter+0x38f>
cmp    $0x49,%al
jne    155f <dump_fits_filter+0x38f>
cmp    $0x53,%bl
jne    155f <dump_fits_filter+0x38f>
mov    %r15,%rdi
call   10e0 <qfits_getvalue@plt>
mov    %rax,%rdi
call   10f0 <atoi@plt>
cmp    $0x20,%r14b
mov    (%rsp),%ecx
cmove  %eax,%ecx
mov    %ecx,(%rsp)
mov    $0x1,%ecx
cmove  %ecx,%eax
imul   %eax,%r13d
jmp    149a <dump_fits_filter+0x2ca>
cmp    $0x45,%dl
jne    149a <dump_fits_filter+0x2ca>
cmp    $0x4e,%cl
jne    149a <dump_fits_filter+0x2ca>
cmp    $0x44,%sil
jne    149a <dump_fits_filter+0x2ca>
mov    0xc(%rsp),%r14d
cmp    %r14d,0x8(%rsp)
mov    0x2a5c(%rip),%rdi
movabs $0x4e4f49534e455458,%rbx
49 4f 4e
jne    136f <dump_fits_filter+0x19f>
jmp    1316 <dump_fits_filter+0x146>
test   %eax,%eax
jne    1701 <dump_fits_filter+0x531>
xor    %ebp,%ebp
jmp    1316 <dump_fits_filter+0x146>
lea    0x10(%rsp),%rdi
mov    $0x1,%ebp
mov    $0x1,%esi
mov    $0x50,%edx
mov    %r12,%rcx
call   1070 <fread@plt>
cmp    $0x50,%eax
jne    1316 <dump_fits_filter+0x146>
movl   $0x0,(%rsp)
lea    0x10(%rsp),%r15
mov    $0x1,%r13d
jmp    1635 <dump_fits_filter+0x465>
mov    %r15,%rdi
call   10e0 <qfits_getvalue@plt>
mov    %rax,%rdi
call   10f0 <atoi@plt>
lea    0x7(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
sar    $0x3,%ecx
imul   %r13d,%ecx
mov    %ecx,%r13d
neg    %r13d
cmovs  %ecx,%r13d
mov    $0x1,%ebp
mov    %r15,%rdi
mov    $0x1,%esi
mov    $0x50,%edx
mov    %r12,%rcx
call   1070 <fread@plt>
cmp    $0x50,%eax
jne    1316 <dump_fits_filter+0x146>
mov    %r15,%rdi
call   1030 <rstrip@plt>
mov    %rax,%rdi
call   1060 <puts@plt>
movzbl 0x10(%rsp),%edx
movzbl 0x11(%rsp),%ecx
movzbl 0x12(%rsp),%esi
movzbl 0x13(%rsp),%eax
movzbl 0x14(%rsp),%ebx
movzbl 0x15(%rsp),%ebp
cmp    $0x42,%dl
jne    168d <dump_fits_filter+0x4bd>
cmp    $0x49,%cl
jne    168d <dump_fits_filter+0x4bd>
cmp    $0x54,%sil
jne    168d <dump_fits_filter+0x4bd>
cmp    $0x50,%al
jne    168d <dump_fits_filter+0x4bd>
cmp    $0x49,%bl
jne    168d <dump_fits_filter+0x4bd>
cmp    $0x58,%bpl
jne    168d <dump_fits_filter+0x4bd>
cmpb   $0x20,0x16(%rsp)
je     15e9 <dump_fits_filter+0x419>
cmp    $0x4e,%dl
jne    16d4 <dump_fits_filter+0x504>
cmp    $0x41,%cl
jne    16d4 <dump_fits_filter+0x504>
cmp    $0x58,%sil
jne    16d4 <dump_fits_filter+0x504>
cmp    $0x49,%al
jne    16d4 <dump_fits_filter+0x504>
cmp    $0x53,%bl
jne    16d4 <dump_fits_filter+0x504>
mov    %r15,%rdi
call   10e0 <qfits_getvalue@plt>
mov    %rax,%rdi
call   10f0 <atoi@plt>
cmp    $0x20,%bpl
mov    (%rsp),%ecx
cmove  %eax,%ecx
mov    %ecx,(%rsp)
mov    $0x1,%ecx
cmove  %ecx,%eax
imul   %eax,%r13d
jmp    1612 <dump_fits_filter+0x442>
cmp    $0x45,%dl
jne    1612 <dump_fits_filter+0x442>
cmp    $0x4e,%cl
jne    1612 <dump_fits_filter+0x442>
cmp    $0x44,%sil
jne    1612 <dump_fits_filter+0x442>
test   %r14d,%r14d
mov    (%rsp),%eax
jns    134c <dump_fits_filter+0x17c>
jmp    15a9 <dump_fits_filter+0x3d9>
mov    $0x1,%ebp
jmp    1316 <dump_fits_filter+0x146>
mov    $0xffffffff,%ebp
jmp    1316 <dump_fits_filter+0x146>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [21 x i8] c"error reading input\0A\00"
@.str.1 = [10 x i8] c"SIMPLE =\00"
@.str.2 = [10 x i8] c"XTENSION=\00"
@.str.3 = [16 x i8] c"not a HDR file\0A\00"
@.str.4 = [17 x i8] c"not a FITS file\0A\00"
@.str.5 = [4 x i8] c"%s\0A\00"
@SEEK_CUR = global i32 0
@.str.6 = [18 x i8] c"===> xtension %d\0A\00"
define i32 @dump_fits_filter(i32* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca [82 x i8]
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
%17 = getelementptr inbounds [82 x i8], [82 x i8]* %7, i64 0, i64 0
%18 = call i32 @memset(i8* %17, i32 0, i32 82)
%19 = getelementptr inbounds [82 x i8], [82 x i8]* %7, i64 0, i64 0
%20 = load i32*, i32** %4
%21 = call i32 @fread(i8* %19, i32 1, i32 81, i32* %20)
%22 = icmp ne i32 %21, 81
br i1 %22, label %23, label %26
23: ; preds = %2
%24 = load i32, i32* @stderr
%25 = call i32 @fprintf(i32 %24, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %444
26: ; preds = %2
%27 = load i32*, i32** %4
%28 = call i32 @rewind(i32* %27)
store i32 0, i32* %14
store i32 0, i32* %16
br label %29
29: ; preds = %41, %26
%30 = load i32, i32* %16
%31 = icmp slt i32 %30, 82
br i1 %31, label %32, label %44
32: ; preds = %29
%33 = load i32, i32* %16
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [82 x i8], [82 x i8]* %7, i64 0, i64 %34
%36 = load i8, i8* %35
%37 = sext i8 %36 to i32
%38 = icmp eq i32 %37, 10
br i1 %38, label %39, label %40
39: ; preds = %32
store i32 1, i32* %14
br label %44
40: ; preds = %32
br label %41
41: ; preds = %40
%42 = load i32, i32* %16
%43 = add nsw i32 %42, 1
store i32 %43, i32* %16
br label %29
44: ; preds = %39, %29
%45 = load i32, i32* %14
%46 = icmp ne i32 %45, 0
br i1 %46, label %47, label %67
47: ; preds = %44
%48 = getelementptr inbounds [82 x i8], [82 x i8]* %7, i64 0, i64 0
%49 = call i32 @strlen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%50 = call i64 @strncmp(i8* %48, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %49)
%51 = icmp ne i64 %50, 0
br i1 %51, label %53, label %52
52: ; preds = %47
store i32 0, i32* %15
br label %63
53: ; preds = %47
%54 = getelementptr inbounds [82 x i8], [82 x i8]* %7, i64 0, i64 0
%55 = call i32 @strlen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%56 = call i64 @strncmp(i8* %54, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %55)
%57 = icmp ne i64 %56, 0
br i1 %57, label %59, label %58
58: ; preds = %53
store i32 1, i32* %15
br label %62
59: ; preds = %53
%60 = load i32, i32* @stderr
%61 = call i32 @fprintf(i32 %60, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
store i32 1, i32* %3
br label %444
62: ; preds = %58
br label %63
63: ; preds = %62, %52
%64 = load i32*, i32** %4
%65 = load i32, i32* %15
%66 = call i32 @dump_hdr_filter(i32* %64, i32 %65)
store i32 0, i32* %3
br label %444
67: ; preds = %44
%68 = getelementptr inbounds [82 x i8], [82 x i8]* %7, i64 0, i64 0
%69 = call i32 @strlen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%70 = call i64 @strncmp(i8* %68, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %69)
%71 = icmp ne i64 %70, 0
br i1 %71, label %72, label %75
72: ; preds = %67
%73 = load i32, i32* @stderr
%74 = call i32 @fprintf(i32 %73, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0))
store i32 1, i32* %3
br label %444
75: ; preds = %67
store i32 0, i32* %10
store i32 1, i32* %9
%76 = getelementptr inbounds [82 x i8], [82 x i8]* %7, i64 0, i64 0
%77 = call i32 @memset(i8* %76, i32 0, i32 82)
%78 = load i32, i32* %5
%79 = icmp slt i32 %78, 1
br i1 %79, label %80, label %208
80: ; preds = %75
store i32 1, i32* %9
store i32 0, i32* %10
br label %81
81: ; preds = %202, %80
%82 = getelementptr inbounds [82 x i8], [82 x i8]* %7, i64 0, i64 0
%83 = load i32*, i32** %4
%84 = call i32 @fread(i8* %82, i32 1, i32 80, i32* %83)
store i32 %84, i32* %8
%85 = icmp eq i32 %84, 80
br i1 %85, label %86, label %203
86: ; preds = %81
%87 = getelementptr inbounds [82 x i8], [82 x i8]* %7, i64 0, i64 0
%88 = call i8* @rstrip(i8* %87)
%89 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* %88)
%90 = getelementptr inbounds [82 x i8], [82 x i8]* %7, i64 0, i64 0
%91 = load i8, i8* %90
%92 = sext i8 %91 to i32
%93 = icmp eq i32 %92, 66
br i1 %93, label %94, label %139
94: ; preds = %86
%95 = getelementptr inbounds [82 x i8], [82 x i8]* %7, i64 0, i64 1
%96 = load i8, i8* %95
%97 = sext i8 %96 to i32
%98 = icmp eq i32 %97, 73
br i1 %98, label %99, label %139
99: ; preds = %94
%100 = getelementptr inbounds [82 x i8], [82 x i8]* %7, i64 0, i64 2
%101 = load i8, i8* %100
%102 = sext i8 %101 to i32
%103 = icmp eq i32 %102, 84
br i1 %103, label %104, label %139
104: ; preds = %99
%105 = getelementptr inbounds [82 x i8], [82 x i8]* %7, i64 0, i64 3
%106 = load i8, i8* %105
%107 = sext i8 %106 to i32
%108 = icmp eq i32 %107, 80
br i1 %108, label %109, label %139
109: ; preds = %104
%110 = getelementptr inbounds [82 x i8], [82 x i8]* %7, i64 0, i64 4
%111 = load i8, i8* %110
%112 = sext i8 %111 to i32
%113 = icmp eq i32 %112, 73
br i1 %113, label %114, label %139
114: ; preds = %109
%115 = getelementptr inbounds [82 x i8], [82 x i8]* %7, i64 0, i64 5
%116 = load i8, i8* %115
%117 = sext i8 %116 to i32
%118 = icmp eq i32 %117, 88
br i1 %118, label %119, label %139
119: ; preds = %114
%120 = getelementptr inbounds [82 x i8], [82 x i8]* %7, i64 0, i64 6
%121 = load i8, i8* %120
%122 = sext i8 %121 to i32
%123 = icmp eq i32 %122, 32
br i1 %123, label %124, label %139
124: ; preds = %119
%125 = getelementptr inbounds [82 x i8], [82 x i8]* %7, i64 0, i64 0
%126 = call i8* @qfits_getvalue(i8* %125)
store i8* %126, i8** %11
%127 = load i8*, i8** %11
%128 = call i64 @atoi(i8* %127)
%129 = trunc i64 %128 to i32
%130 = sdiv i32 %129, 8
%131 = load i32, i32* %9
%132 = mul nsw i32 %131, %130
store i32 %132, i32* %9
%133 = load i32, i32* %9
%134 = icmp slt i32 %133, 0
br i1 %134, label %135, label %138
135: ; preds = %124
%136 = load i32, i32* %9
%137 = mul nsw i32 %136, -1
store i32 %137, i32* %9
br label %138
138: ; preds = %135, %124
br label %202
139: ; preds = %119, %114, %109, %104, %99, %94, %86
%140 = getelementptr inbounds [82 x i8], [82 x i8]* %7, i64 0, i64 0
%141 = load i8, i8* %140
%142 = sext i8 %141 to i32
%143 = icmp eq i32 %142, 78
br i1 %143, label %144, label %184
144: ; preds = %139
%145 = getelementptr inbounds [82 x i8], [82 x i8]* %7, i64 0, i64 1
%146 = load i8, i8* %145
%147 = sext i8 %146 to i32
%148 = icmp eq i32 %147, 65
br i1 %148, label %149, label %184
149: ; preds = %144
%150 = getelementptr inbounds [82 x i8], [82 x i8]* %7, i64 0, i64 2
%151 = load i8, i8* %150
%152 = sext i8 %151 to i32
%153 = icmp eq i32 %152, 88
br i1 %153, label %154, label %184
154: ; preds = %149
%155 = getelementptr inbounds [82 x i8], [82 x i8]* %7, i64 0, i64 3
%156 = load i8, i8* %155
%157 = sext i8 %156 to i32
%158 = icmp eq i32 %157, 73
br i1 %158, label %159, label %184
159: ; preds = %154
%160 = getelementptr inbounds [82 x i8], [82 x i8]* %7, i64 0, i64 4
%161 = load i8, i8* %160
%162 = sext i8 %161 to i32
%163 = icmp eq i32 %162, 83
br i1 %163, label %164, label %184
164: ; preds = %159
%165 = getelementptr inbounds [82 x i8], [82 x i8]* %7, i64 0, i64 5
%166 = load i8, i8* %165
%167 = sext i8 %166 to i32
%168 = icmp eq i32 %167, 32
br i1 %168, label %169, label %175
169: ; preds = %164
%170 = getelementptr inbounds [82 x i8], [82 x i8]* %7, i64 0, i64 0
%171 = call i8* @qfits_getvalue(i8* %170)
store i8* %171, i8** %11
%172 = load i8*, i8** %11
%173 = call i64 @atoi(i8* %172)
%174 = trunc i64 %173 to i32
store i32 %174, i32* %10
br label %183
175: ; preds = %164
%176 = getelementptr inbounds [82 x i8], [82 x i8]* %7, i64 0, i64 0
%177 = call i8* @qfits_getvalue(i8* %176)
store i8* %177, i8** %11
%178 = load i8*, i8** %11
%179 = call i64 @atoi(i8* %178)
%180 = trunc i64 %179 to i32
%181 = load i32, i32* %9
%182 = mul nsw i32 %181, %180
store i32 %182, i32* %9
br label %183
183: ; preds = %175, %169
br label %201
184: ; preds = %159, %154, %149, %144, %139
%185 = getelementptr inbounds [82 x i8], [82 x i8]* %7, i64 0, i64 0
%186 = load i8, i8* %185
%187 = sext i8 %186 to i32
%188 = icmp eq i32 %187, 69
br i1 %188, label %189, label %200
189: ; preds = %184
%190 = getelementptr inbounds [82 x i8], [82 x i8]* %7, i64 0, i64 1
%191 = load i8, i8* %190
%192 = sext i8 %191 to i32
%193 = icmp eq i32 %192, 78
br i1 %193, label %194, label %200
194: ; preds = %189
%195 = getelementptr inbounds [82 x i8], [82 x i8]* %7, i64 0, i64 2
%196 = load i8, i8* %195
%197 = sext i8 %196 to i32
%198 = icmp eq i32 %197, 68
br i1 %198, label %199, label %200
199: ; preds = %194
br label %203
200: ; preds = %194, %189, %184
br label %201
201: ; preds = %200, %183
br label %202
202: ; preds = %201, %138
br label %81
203: ; preds = %199, %81
%204 = load i32, i32* %8
%205 = icmp ne i32 %204, 80
br i1 %205, label %206, label %207
206: ; preds = %203
store i32 1, i32* %3
br label %444
207: ; preds = %203
br label %208
208: ; preds = %207, %75
%209 = load i32, i32* %5
%210 = icmp slt i32 %209, 0
br i1 %210, label %211, label %212
211: ; preds = %208
store i32 0, i32* %3
br label %444
212: ; preds = %208
store i32 0, i32* %6
br label %213
213: ; preds = %212, %442
%214 = load i32, i32* %10
%215 = icmp sgt i32 %214, 0
br i1 %215, label %216, label %235
216: ; preds = %213
%217 = load i32, i32* %9
%218 = sdiv i32 %217, 2880
store i32 %218, i32* %12
%219 = load i32, i32* %9
%220 = srem i32 %219, 2880
%221 = icmp ne i32 %220, 0
br i1 %221, label %222, label %225
222: ; preds = %216
%223 = load i32, i32* %12
%224 = add nsw i32 %223, 1
store i32 %224, i32* %12
br label %225
225: ; preds = %222, %216
%226 = load i32*, i32** %4
%227 = load i32, i32* %12
%228 = mul nsw i32 %227, 2880
%229 = load i32, i32* @SEEK_CUR
%230 = call i32 @fseek(i32* %226, i32 %228, i32 %229)
store i32 %230, i32* %13
%231 = load i32, i32* %13
%232 = icmp slt i32 %231, 0
br i1 %232, label %233, label %234
233: ; preds = %225
store i32 -1, i32* %3
br label %444
234: ; preds = %225
br label %235
235: ; preds = %234, %213
br label %236
236: ; preds = %282, %235
%237 = getelementptr inbounds [82 x i8], [82 x i8]* %7, i64 0, i64 0
%238 = load i32*, i32** %4
%239 = call i32 @fread(i8* %237, i32 1, i32 80, i32* %238)
store i32 %239, i32* %8
%240 = icmp eq i32 %239, 80
br i1 %240, label %241, label %283
241: ; preds = %236
%242 = getelementptr inbounds [82 x i8], [82 x i8]* %7, i64 0, i64 0
%243 = load i8, i8* %242
%244 = sext i8 %243 to i32
%245 = icmp eq i32 %244, 88
br i1 %245, label %246, label %282
246: ; preds = %241
%247 = getelementptr inbounds [82 x i8], [82 x i8]* %7, i64 0, i64 1
%248 = load i8, i8* %247
%249 = sext i8 %248 to i32
%250 = icmp eq i32 %249, 84
br i1 %250, label %251, label %282
251: ; preds = %246
%252 = getelementptr inbounds [82 x i8], [82 x i8]* %7, i64 0, i64 2
%253 = load i8, i8* %252
%254 = sext i8 %253 to i32
%255 = icmp eq i32 %254, 69
br i1 %255, label %256, label %282
256: ; preds = %251
%257 = getelementptr inbounds [82 x i8], [82 x i8]* %7, i64 0, i64 3
%258 = load i8, i8* %257
%259 = sext i8 %258 to i32
%260 = icmp eq i32 %259, 78
br i1 %260, label %261, label %282
261: ; preds = %256
%262 = getelementptr inbounds [82 x i8], [82 x i8]* %7, i64 0, i64 4
%263 = load i8, i8* %262
%264 = sext i8 %263 to i32
%265 = icmp eq i32 %264, 83
br i1 %265, label %266, label %282
266: ; preds = %261
%267 = getelementptr inbounds [82 x i8], [82 x i8]* %7, i64 0, i64 5
%268 = load i8, i8* %267
%269 = sext i8 %268 to i32
%270 = icmp eq i32 %269, 73
br i1 %270, label %271, label %282
271: ; preds = %266
%272 = getelementptr inbounds [82 x i8], [82 x i8]* %7, i64 0, i64 6
%273 = load i8, i8* %272
%274 = sext i8 %273 to i32
%275 = icmp eq i32 %274, 79
br i1 %275, label %276, label %282
276: ; preds = %271
%277 = getelementptr inbounds [82 x i8], [82 x i8]* %7, i64 0, i64 7
%278 = load i8, i8* %277
%279 = sext i8 %278 to i32
%280 = icmp eq i32 %279, 78
br i1 %280, label %281, label %282
281: ; preds = %276
br label %283
282: ; preds = %276, %271, %266, %261, %256, %251, %246, %241
br label %236
283: ; preds = %281, %236
%284 = load i32, i32* %8
%285 = icmp eq i32 %284, 0
br i1 %285, label %286, label %287
286: ; preds = %283
br label %443
287: ; preds = %283
%288 = load i32, i32* %8
%289 = icmp ne i32 %288, 80
br i1 %289, label %290, label %291
290: ; preds = %287
store i32 1, i32* %3
br label %444
291: ; preds = %287
%292 = load i32, i32* %6
%293 = add nsw i32 %292, 1
store i32 %293, i32* %6
%294 = load i32, i32* %5
%295 = icmp eq i32 %294, 0
br i1 %295, label %300, label %296
296: ; preds = %291
%297 = load i32, i32* %5
%298 = load i32, i32* %6
%299 = icmp eq i32 %297, %298
br i1 %299, label %300, label %306
300: ; preds = %296, %291
%301 = load i32, i32* %6
%302 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0), i32 %301)
%303 = getelementptr inbounds [82 x i8], [82 x i8]* %7, i64 0, i64 0
%304 = call i8* @rstrip(i8* %303)
%305 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* %304)
br label %306
306: ; preds = %300, %296
store i32 1, i32* %9
store i32 0, i32* %10
br label %307
307: ; preds = %436, %306
%308 = getelementptr inbounds [82 x i8], [82 x i8]* %7, i64 0, i64 0
%309 = load i32*, i32** %4
%310 = call i32 @fread(i8* %308, i32 1, i32 80, i32* %309)
store i32 %310, i32* %8
%311 = icmp eq i32 %310, 80
br i1 %311, label %312, label %437
312: ; preds = %307
%313 = load i32, i32* %5
%314 = icmp eq i32 %313, 0
br i1 %314, label %319, label %315
315: ; preds = %312
%316 = load i32, i32* %5
%317 = load i32, i32* %6
%318 = icmp eq i32 %316, %317
br i1 %318, label %319, label %323
319: ; preds = %315, %312
%320 = getelementptr inbounds [82 x i8], [82 x i8]* %7, i64 0, i64 0
%321 = call i8* @rstrip(i8* %320)
%322 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* %321)
br label %323
323: ; preds = %319, %315
%324 = getelementptr inbounds [82 x i8], [82 x i8]* %7, i64 0, i64 0
%325 = load i8, i8* %324
%326 = sext i8 %325 to i32
%327 = icmp eq i32 %326, 66
br i1 %327, label %328, label %373
328: ; preds = %323
%329 = getelementptr inbounds [82 x i8], [82 x i8]* %7, i64 0, i64 1
%330 = load i8, i8* %329
%331 = sext i8 %330 to i32
%332 = icmp eq i32 %331, 73
br i1 %332, label %333, label %373
333: ; preds = %328
%334 = getelementptr inbounds [82 x i8], [82 x i8]* %7, i64 0, i64 2
%335 = load i8, i8* %334
%336 = sext i8 %335 to i32
%337 = icmp eq i32 %336, 84
br i1 %337, label %338, label %373
338: ; preds = %333
%339 = getelementptr inbounds [82 x i8], [82 x i8]* %7, i64 0, i64 3
%340 = load i8, i8* %339
%341 = sext i8 %340 to i32
%342 = icmp eq i32 %341, 80
br i1 %342, label %343, label %373
343: ; preds = %338
%344 = getelementptr inbounds [82 x i8], [82 x i8]* %7, i64 0, i64 4
%345 = load i8, i8* %344
%346 = sext i8 %345 to i32
%347 = icmp eq i32 %346, 73
br i1 %347, label %348, label %373
348: ; preds = %343
%349 = getelementptr inbounds [82 x i8], [82 x i8]* %7, i64 0, i64 5
%350 = load i8, i8* %349
%351 = sext i8 %350 to i32
%352 = icmp eq i32 %351, 88
br i1 %352, label %353, label %373
353: ; preds = %348
%354 = getelementptr inbounds [82 x i8], [82 x i8]* %7, i64 0, i64 6
%355 = load i8, i8* %354
%356 = sext i8 %355 to i32
%357 = icmp eq i32 %356, 32
br i1 %357, label %358, label %373
358: ; preds = %353
%359 = getelementptr inbounds [82 x i8], [82 x i8]* %7, i64 0, i64 0
%360 = call i8* @qfits_getvalue(i8* %359)
store i8* %360, i8** %11
%361 = load i8*, i8** %11
%362 = call i64 @atoi(i8* %361)
%363 = trunc i64 %362 to i32
%364 = sdiv i32 %363, 8
%365 = load i32, i32* %9
%366 = mul nsw i32 %365, %364
store i32 %366, i32* %9
%367 = load i32, i32* %9
%368 = icmp slt i32 %367, 0
br i1 %368, label %369, label %372
369: ; preds = %358
%370 = load i32, i32* %9
%371 = mul nsw i32 %370, -1
store i32 %371, i32* %9
br label %372
372: ; preds = %369, %358
br label %436
373: ; preds = %353, %348, %343, %338, %333, %328, %323
%374 = getelementptr inbounds [82 x i8], [82 x i8]* %7, i64 0, i64 0
%375 = load i8, i8* %374
%376 = sext i8 %375 to i32
%377 = icmp eq i32 %376, 78
br i1 %377, label %378, label %418
378: ; preds = %373
%379 = getelementptr inbounds [82 x i8], [82 x i8]* %7, i64 0, i64 1
%380 = load i8, i8* %379
%381 = sext i8 %380 to i32
%382 = icmp eq i32 %381, 65
br i1 %382, label %383, label %418
383: ; preds = %378
%384 = getelementptr inbounds [82 x i8], [82 x i8]* %7, i64 0, i64 2
%385 = load i8, i8* %384
%386 = sext i8 %385 to i32
%387 = icmp eq i32 %386, 88
br i1 %387, label %388, label %418
388: ; preds = %383
%389 = getelementptr inbounds [82 x i8], [82 x i8]* %7, i64 0, i64 3
%390 = load i8, i8* %389
%391 = sext i8 %390 to i32
%392 = icmp eq i32 %391, 73
br i1 %392, label %393, label %418
393: ; preds = %388
%394 = getelementptr inbounds [82 x i8], [82 x i8]* %7, i64 0, i64 4
%395 = load i8, i8* %394
%396 = sext i8 %395 to i32
%397 = icmp eq i32 %396, 83
br i1 %397, label %398, label %418
398: ; preds = %393
%399 = getelementptr inbounds [82 x i8], [82 x i8]* %7, i64 0, i64 5
%400 = load i8, i8* %399
%401 = sext i8 %400 to i32
%402 = icmp eq i32 %401, 32
br i1 %402, label %403, label %409
403: ; preds = %398
%404 = getelementptr inbounds [82 x i8], [82 x i8]* %7, i64 0, i64 0
%405 = call i8* @qfits_getvalue(i8* %404)
store i8* %405, i8** %11
%406 = load i8*, i8** %11
%407 = call i64 @atoi(i8* %406)
%408 = trunc i64 %407 to i32
store i32 %408, i32* %10
br label %417
409: ; preds = %398
%410 = getelementptr inbounds [82 x i8], [82 x i8]* %7, i64 0, i64 0
%411 = call i8* @qfits_getvalue(i8* %410)
store i8* %411, i8** %11
%412 = load i8*, i8** %11
%413 = call i64 @atoi(i8* %412)
%414 = trunc i64 %413 to i32
%415 = load i32, i32* %9
%416 = mul nsw i32 %415, %414
store i32 %416, i32* %9
br label %417
417: ; preds = %409, %403
br label %435
418: ; preds = %393, %388, %383, %378, %373
%419 = getelementptr inbounds [82 x i8], [82 x i8]* %7, i64 0, i64 0
%420 = load i8, i8* %419
%421 = sext i8 %420 to i32
%422 = icmp eq i32 %421, 69
br i1 %422, label %423, label %434
423: ; preds = %418
%424 = getelementptr inbounds [82 x i8], [82 x i8]* %7, i64 0, i64 1
%425 = load i8, i8* %424
%426 = sext i8 %425 to i32
%427 = icmp eq i32 %426, 78
br i1 %427, label %428, label %434
428: ; preds = %423
%429 = getelementptr inbounds [82 x i8], [82 x i8]* %7, i64 0, i64 2
%430 = load i8, i8* %429
%431 = sext i8 %430 to i32
%432 = icmp eq i32 %431, 68
br i1 %432, label %433, label %434
433: ; preds = %428
br label %437
434: ; preds = %428, %423, %418
br label %435
435: ; preds = %434, %417
br label %436
436: ; preds = %435, %372
br label %307
437: ; preds = %433, %307
%438 = load i32, i32* %6
%439 = load i32, i32* %5
%440 = icmp eq i32 %438, %439
br i1 %440, label %441, label %442
441: ; preds = %437
br label %443
442: ; preds = %437
br label %213
443: ; preds = %441, %286
store i32 0, i32* %3
br label %444
444: ; preds = %443, %290, %233, %211, %206, %72, %63, %59, %23
%445 = load i32, i32* %3
ret i32 %445
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [21 x i8] c"error reading input\0A\00"
@.str.1 = [10 x i8] c"SIMPLE =\00"
@.str.2 = [10 x i8] c"XTENSION=\00"
@.str.3 = [16 x i8] c"not a HDR file\0A\00"
@.str.4 = [17 x i8] c"not a FITS file\0A\00"
@SEEK_CUR = global i32 0
@.str.6 = [18 x i8] c"===> xtension %d\0A\00"
define i32 @dump_fits_filter(i32* %0, i32 %1) {
%3 = alloca [82 x i8]
%4 = getelementptr inbounds [82 x i8], [82 x i8]* %3, i64 0, i64 0
%5 = call i32 @memset(i8* %4, i32 0, i32 82)
%6 = call i32 @fread(i8* %4, i32 1, i32 81, i32* %0)
%7 = icmp eq i32 %6, 81
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %235
11: ; preds = %2
%12 = call i32 @rewind(i32* %0)
br label %21
13: ; preds = %21
%14 = or i64 %22, 1
%15 = getelementptr inbounds [82 x i8], [82 x i8]* %3, i64 0, i64 %14
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 10
br i1 %17, label %26, label %18
18: ; preds = %13
%19 = add nuw nsw i64 %22, 2
%20 = icmp eq i64 %19, 82
br i1 %20, label %40, label %21
21: ; preds = %18, %11
%22 = phi i64 [ 0, %11 ], [ %19, %18 ]
%23 = getelementptr inbounds [82 x i8], [82 x i8]* %3, i64 0, i64 %22
%24 = load i8, i8* %23
%25 = icmp eq i8 %24, 10
br i1 %25, label %26, label %13
26: ; preds = %13, %21
%27 = call i32 @strlen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%28 = call i64 @strncmp(i8* %4, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %27)
%29 = icmp eq i64 %28, 0
br i1 %29, label %37, label %30
30: ; preds = %26
%31 = call i32 @strlen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%32 = call i64 @strncmp(i8* %4, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %31)
%33 = icmp eq i64 %32, 0
br i1 %33, label %37, label %34
34: ; preds = %30
%35 = load i32, i32* @stderr
%36 = call i32 @fprintf(i32 %35, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
br label %235
37: ; preds = %30, %26
%38 = phi i32 [ 0, %26 ], [ 1, %30 ]
%39 = call i32 @dump_hdr_filter(i32* %0, i32 %38)
br label %235
40: ; preds = %18
%41 = call i32 @strlen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%42 = call i64 @strncmp(i8* %4, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %41)
%43 = icmp eq i64 %42, 0
br i1 %43, label %47, label %44
44: ; preds = %40
%45 = load i32, i32* @stderr
%46 = call i32 @fprintf(i32 %45, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0))
br label %235
47: ; preds = %40
%48 = call i32 @memset(i8* %4, i32 0, i32 82)
%49 = icmp slt i32 %1, 1
br i1 %49, label %50, label %123
50: ; preds = %47
%51 = call i32 @fread(i8* %4, i32 1, i32 80, i32* %0)
%52 = icmp eq i32 %51, 80
br i1 %52, label %53, label %235
53: ; preds = %50
%54 = getelementptr inbounds [82 x i8], [82 x i8]* %3, i64 0, i64 1
%55 = getelementptr inbounds [82 x i8], [82 x i8]* %3, i64 0, i64 2
%56 = getelementptr inbounds [82 x i8], [82 x i8]* %3, i64 0, i64 3
%57 = getelementptr inbounds [82 x i8], [82 x i8]* %3, i64 0, i64 4
%58 = getelementptr inbounds [82 x i8], [82 x i8]* %3, i64 0, i64 5
%59 = getelementptr inbounds [82 x i8], [82 x i8]* %3, i64 0, i64 6
br label %60
60: ; preds = %53, %116
%61 = phi i32 [ 0, %53 ], [ %118, %116 ]
%62 = phi i32 [ 1, %53 ], [ %117, %116 ]
%63 = call i8* @rstrip(i8* %4)
%64 = call i32 @puts(i8* dereferenceable(1) %63)
%65 = load i8, i8* %4
%66 = icmp eq i8 %65, 66
%67 = load i8, i8* %54
%68 = icmp eq i8 %67, 73
%69 = select i1 %66, i1 %68, i1 false
%70 = load i8, i8* %55
%71 = icmp eq i8 %70, 84
%72 = select i1 %69, i1 %71, i1 false
%73 = load i8, i8* %56
%74 = icmp eq i8 %73, 80
%75 = select i1 %72, i1 %74, i1 false
%76 = load i8, i8* %57
%77 = icmp eq i8 %76, 73
%78 = select i1 %75, i1 %77, i1 false
%79 = load i8, i8* %58
%80 = icmp eq i8 %79, 88
%81 = select i1 %78, i1 %80, i1 false
%82 = load i8, i8* %59
%83 = icmp eq i8 %82, 32
%84 = select i1 %81, i1 %83, i1 false
br i1 %84, label %85, label %92
85: ; preds = %60
%86 = call i8* @qfits_getvalue(i8* %4)
%87 = call i64 @atoi(i8* %86)
%88 = trunc i64 %87 to i32
%89 = sdiv i32 %88, 8
%90 = mul nsw i32 %89, %62
%91 = call i32 @llvm.abs.i32(i32 %90, i1 true)
br label %116
92: ; preds = %60
%93 = icmp eq i8 %65, 78
%94 = icmp eq i8 %67, 65
%95 = select i1 %93, i1 %94, i1 false
%96 = icmp eq i8 %70, 88
%97 = select i1 %95, i1 %96, i1 false
%98 = icmp eq i8 %73, 73
%99 = select i1 %97, i1 %98, i1 false
%100 = icmp eq i8 %76, 83
%101 = select i1 %99, i1 %100, i1 false
br i1 %101, label %102, label %110
102: ; preds = %92
%103 = icmp eq i8 %79, 32
%104 = call i8* @qfits_getvalue(i8* %4)
%105 = call i64 @atoi(i8* %104)
%106 = trunc i64 %105 to i32
%107 = select i1 %103, i32 1, i32 %106
%108 = mul nsw i32 %62, %107
%109 = select i1 %103, i32 %106, i32 %61
br label %116
110: ; preds = %92
%111 = icmp eq i8 %65, 69
%112 = icmp eq i8 %67, 78
%113 = select i1 %111, i1 %112, i1 false
%114 = icmp eq i8 %70, 68
%115 = select i1 %113, i1 %114, i1 false
br i1 %115, label %121, label %116
116: ; preds = %102, %85, %110
%117 = phi i32 [ %62, %110 ], [ %91, %85 ], [ %108, %102 ]
%118 = phi i32 [ %61, %110 ], [ %61, %85 ], [ %109, %102 ]
%119 = call i32 @fread(i8* %4, i32 1, i32 80, i32* %0)
%120 = icmp eq i32 %119, 80
br i1 %120, label %60, label %235
121: ; preds = %110
%122 = icmp slt i32 %1, 0
br i1 %122, label %235, label %123
123: ; preds = %47, %121
%124 = phi i32 [ %61, %121 ], [ 0, %47 ]
%125 = phi i32 [ %62, %121 ], [ 1, %47 ]
%126 = getelementptr inbounds [82 x i8], [82 x i8]* %3, i64 0, i64 1
%127 = getelementptr inbounds [82 x i8], [82 x i8]* %3, i64 0, i64 2
%128 = getelementptr inbounds [82 x i8], [82 x i8]* %3, i64 0, i64 3
%129 = getelementptr inbounds [82 x i8], [82 x i8]* %3, i64 0, i64 4
%130 = getelementptr inbounds [82 x i8], [82 x i8]* %3, i64 0, i64 5
%131 = getelementptr inbounds [82 x i8], [82 x i8]* %3, i64 0, i64 6
%132 = icmp eq i32 %1, 0
%133 = bitcast [82 x i8]* %3 to <8 x i8>*
br label %134
134: ; preds = %123, %231
%135 = phi i32 [ %158, %231 ], [ 0, %123 ]
%136 = phi i32 [ %232, %231 ], [ %125, %123 ]
%137 = phi i32 [ %233, %231 ], [ %124, %123 ]
%138 = icmp sgt i32 %137, 0
br i1 %138, label %139, label %149
139: ; preds = %134
%140 = sdiv i32 %136, 2880
%141 = srem i32 %136, 2880
%142 = icmp ne i32 %141, 0
%143 = zext i1 %142 to i32
%144 = add nsw i32 %140, %143
%145 = mul nsw i32 %144, 2880
%146 = load i32, i32* @SEEK_CUR
%147 = call i32 @fseek(i32* %0, i32 %145, i32 %146)
%148 = icmp slt i32 %147, 0
br i1 %148, label %235, label %149
149: ; preds = %139, %134
br label %150
150: ; preds = %149, %152
%151 = call i32 @fread(i8* %4, i32 1, i32 80, i32* %0)
switch i32 %151, label %234 [
i32 80, label %152
i32 0, label %235
]
152: ; preds = %150
%153 = load <8 x i8>, <8 x i8>* %133
%154 = freeze <8 x i8> %153
%155 = bitcast <8 x i8> %154 to i64
%156 = icmp eq i64 %155, 5642809480262800472
br i1 %156, label %157, label %150
157: ; preds = %152
%158 = add nuw nsw i32 %135, 1
%159 = icmp eq i32 %158, %1
%160 = select i1 %132, i1 true, i1 %159
br i1 %160, label %161, label %165
161: ; preds = %157
%162 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0), i32 %158)
%163 = call i8* @rstrip(i8* %4)
%164 = call i32 @puts(i8* dereferenceable(1) %163)
br label %165
165: ; preds = %157, %161
%166 = call i32 @fread(i8* %4, i32 1, i32 80, i32* %0)
%167 = icmp eq i32 %166, 80
br i1 %167, label %168, label %231
168: ; preds = %165, %226
%169 = phi i32 [ %228, %226 ], [ 0, %165 ]
%170 = phi i32 [ %227, %226 ], [ 1, %165 ]
br i1 %160, label %171, label %174
171: ; preds = %168
%172 = call i8* @rstrip(i8* %4)
%173 = call i32 @puts(i8* dereferenceable(1) %172)
br label %174
174: ; preds = %168, %171
%175 = load i8, i8* %4
%176 = icmp eq i8 %175, 66
%177 = load i8, i8* %126
%178 = icmp eq i8 %177, 73
%179 = select i1 %176, i1 %178, i1 false
%180 = load i8, i8* %127
%181 = icmp eq i8 %180, 84
%182 = select i1 %179, i1 %181, i1 false
%183 = load i8, i8* %128
%184 = icmp eq i8 %183, 80
%185 = select i1 %182, i1 %184, i1 false
%186 = load i8, i8* %129
%187 = icmp eq i8 %186, 73
%188 = select i1 %185, i1 %187, i1 false
%189 = load i8, i8* %130
%190 = icmp eq i8 %189, 88
%191 = select i1 %188, i1 %190, i1 false
%192 = load i8, i8* %131
%193 = icmp eq i8 %192, 32
%194 = select i1 %191, i1 %193, i1 false
br i1 %194, label %195, label %202
195: ; preds = %174
%196 = call i8* @qfits_getvalue(i8* %4)
%197 = call i64 @atoi(i8* %196)
%198 = trunc i64 %197 to i32
%199 = sdiv i32 %198, 8
%200 = mul nsw i32 %199, %170
%201 = call i32 @llvm.abs.i32(i32 %200, i1 true)
br label %226
202: ; preds = %174
%203 = icmp eq i8 %175, 78
%204 = icmp eq i8 %177, 65
%205 = select i1 %203, i1 %204, i1 false
%206 = icmp eq i8 %180, 88
%207 = select i1 %205, i1 %206, i1 false
%208 = icmp eq i8 %183, 73
%209 = select i1 %207, i1 %208, i1 false
%210 = icmp eq i8 %186, 83
%211 = select i1 %209, i1 %210, i1 false
br i1 %211, label %212, label %220
212: ; preds = %202
%213 = icmp eq i8 %189, 32
%214 = call i8* @qfits_getvalue(i8* %4)
%215 = call i64 @atoi(i8* %214)
%216 = trunc i64 %215 to i32
%217 = select i1 %213, i32 1, i32 %216
%218 = mul nsw i32 %170, %217
%219 = select i1 %213, i32 %216, i32 %169
br label %226
220: ; preds = %202
%221 = icmp eq i8 %175, 69
%222 = icmp eq i8 %177, 78
%223 = select i1 %221, i1 %222, i1 false
%224 = icmp eq i8 %180, 68
%225 = select i1 %223, i1 %224, i1 false
br i1 %225, label %231, label %226
226: ; preds = %212, %195, %220
%227 = phi i32 [ %170, %220 ], [ %201, %195 ], [ %218, %212 ]
%228 = phi i32 [ %169, %220 ], [ %169, %195 ], [ %219, %212 ]
%229 = call i32 @fread(i8* %4, i32 1, i32 80, i32* %0)
%230 = icmp eq i32 %229, 80
br i1 %230, label %168, label %231
231: ; preds = %226, %220, %165
%232 = phi i32 [ 1, %165 ], [ %170, %220 ], [ %227, %226 ]
%233 = phi i32 [ 0, %165 ], [ %169, %220 ], [ %228, %226 ]
br i1 %159, label %235, label %134
234: ; preds = %150
br label %235
235: ; preds = %116, %139, %231, %150, %234, %50, %121, %44, %37, %34, %8
%236 = phi i32 [ 1, %8 ], [ 1, %34 ], [ 0, %37 ], [ 1, %44 ], [ 0, %121 ], [ 1, %50 ], [ 1, %234 ], [ 0, %150 ], [ 0, %231 ], [ -1, %139 ], [ 1, %116 ]
ret i32 %236
}