#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*/ check3;
typedef int /*<<< orphan*/ check2;
typedef int /*<<< orphan*/ check1;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ SEEK_SET;
char *calloc(int, int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ fread(char *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fseeko(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
long long ftello(int /*<<< orphan*/ *);
int /*<<< orphan*/ memset(char *, char, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strncmp(char *, char *, int);
int /*<<< orphan*/ swap(int, char *);
int trj_readheader_dcd_slim(FILE *dcd, int *sixtyfour_o, int *nframe_o,
                            int *varpbc_o, int *sex_o, int *comnum_o,
                            int *nato_o, int *fixatm_o) {
  int ii;
  int header_size;
  int frame_size, frame1_size;
  int field1, field2;
  int buf_size = 10240;
  char *buffer;
  char check1[4], check2[4], check3[4];
  char type[5];
  long long filesize;
  float real_nframe;
  int c_nframe;
  int begstp;
  int skpstp;
  int c_numstp;
  float tmstp;
  int sixtyfour = 0;
  int varpbc;
  int sex = 0;
  int nato, comnum;
  int fixatm;
  buffer = calloc(buf_size, sizeof(char));
  fseeko(dcd, 0, SEEK_END);
  filesize = ftello(dcd);
  fseeko(dcd, 0, SEEK_SET);
  if (filesize == 0) {
    printf("*** Error: empty file! ***\n\n");
    return -1;
  }
  memset(check1, '\0', sizeof(check1));
  memset(check2, '\0', sizeof(check2));
  memset(check3, '\0', sizeof(check3));
  fread(check1, 4, 1, dcd);
  fread(check2, 4, 1, dcd);
  fread(check3, 4, 1, dcd);
  field1 = *(int *)(check1 + 0);
  field2 = *(int *)(check2 + 0);
  if (field1 == 84 &&
      (!strncmp(check2, "CORD", 4) || !strncmp(check2, "VELD", 4))) {
    sex = 0;
    sixtyfour = 0;
  } else if (field1 == 84 && field2 == 0 &&
             (!strncmp(check3, "CORD", 4) || !strncmp(check3, "VELD", 4))) {
    sex = 0;
    sixtyfour = 1;
  } else if (field1 == 1409286144 &&
             (!strncmp(check2, "CORD", 4) || !strncmp(check2, "VELD", 4))) {
    sex = 1;
    sixtyfour = 0;
  } else if (field1 == 0 && field2 == 1409286144 &&
             (!strncmp(check3, "CORD", 4) || !strncmp(check3, "VELD", 4))) {
    sex = 1;
    sixtyfour = 1;
  } else {
    fprintf(stderr, "*** This is not a proper dcd file ***\n\n");
    return -1;
  }
  memset(buffer, '\0', buf_size);
  fseeko(dcd, 4 * (1 + sixtyfour), SEEK_SET);
  fread(type, 1, 4, dcd);
  type[4] = '\0';
  fread(buffer, 1, 80, dcd);
  if (sex) {
    swap(4, buffer + 0);
    swap(4, buffer + 4);
    swap(4, buffer + 8);
    swap(4, buffer + 12);
    swap(4, buffer + 32);
    swap(4, buffer + 36);
    swap(4, buffer + 40);
  }
  c_nframe = *(int *)(buffer + 0);
  begstp = *(int *)(buffer + 4);
  skpstp = *(int *)(buffer + 8);
  c_numstp = *(int *)(buffer + 12);
  fixatm = *(int *)(buffer + 32);
  tmstp = *(float *)(buffer + 36);
  varpbc = *(int *)(buffer + 40);
  if (varpbc != 0 && varpbc != 1) {
    fprintf(stderr, "varpbc field is wrong (%d)\n", varpbc);
    return -1;
  }
  fread(buffer, 1, 2 * 4 * (1 + sixtyfour), dcd);
  fread(buffer, 1, 4, dcd);
  if (sex) {
    swap(4, buffer);
  }
  comnum = *(int *)(buffer);
  for (ii = 0; ii < comnum; ii++) {
    fread(buffer, 1, 80, dcd);
  }
  fread(buffer, 1, 2 * 4 * (1 + sixtyfour), dcd);
  fread(buffer, 1, 4, dcd);
  if (sex) {
    swap(4, buffer);
  }
  nato = *(int *)(buffer);
  fseeko(dcd, 0, SEEK_END);
  if (!fixatm) {
    header_size = (6 * 4 * (1 + sixtyfour) + 23 * 4 + comnum * 80);
    frame_size = (6 * 4 * (1 + sixtyfour) + 3 * 4 * nato + 56 * (varpbc));
    real_nframe = ((filesize - header_size) / frame_size);
  } else {
    header_size = (6 * 4 * (1 + sixtyfour) + 23 * 4 + comnum * 80 +
                   (2 * 4 * (1 + sixtyfour) + 4 * (nato - fixatm)));
    frame1_size = (6 * 4 * (1 + sixtyfour) + 3 * 4 * nato + 56 * (varpbc));
    frame_size =
        (6 * 4 * (1 + sixtyfour) + 3 * 4 * (nato - fixatm) + 56 * (varpbc));
    real_nframe = ((filesize - header_size - frame1_size) / frame_size) + 1;
  }
  *sixtyfour_o = sixtyfour;
  *nframe_o = real_nframe;
  *varpbc_o = varpbc;
  *sex_o = sex;
  *comnum_o = comnum;
  *nato_o = nato;
  *fixatm_o = fixatm;
  return 0;
}


x86 assembly (clang, -O0):
<trj_readheader_dcd_slim>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9,-0x38(%rbp)
movl   $0x2800,-0x54(%rbp)
movl   $0x0,-0x9c(%rbp)
movl   $0x0,-0xa4(%rbp)
mov    -0x54(%rbp),%edi
mov    $0x1,%esi
call   1080 <calloc@plt>
mov    %rax,-0x60(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2df6(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   10a0 <fseeko@plt>
mov    -0x10(%rbp),%rdi
call   1040 <ftello@plt>
mov    %rax,-0x80(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2dbd(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   10a0 <fseeko@plt>
cmpq   $0x0,-0x80(%rbp)
jne    123f <trj_readheader_dcd_slim+0xaf>
lea    0xdd2(%rip),%rdi
call   1060 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1891 <trj_readheader_dcd_slim+0x701>
lea    -0x64(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1070 <memset@plt>
lea    -0x68(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1070 <memset@plt>
lea    -0x6c(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1070 <memset@plt>
lea    -0x64(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x4,%esi
mov    $0x1,%edx
call   1050 <fread@plt>
lea    -0x68(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x4,%esi
mov    $0x1,%edx
call   1050 <fread@plt>
lea    -0x6c(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x4,%esi
mov    $0x1,%edx
call   1050 <fread@plt>
mov    -0x64(%rbp),%eax
mov    %eax,-0x4c(%rbp)
mov    -0x68(%rbp),%eax
mov    %eax,-0x50(%rbp)
cmpl   $0x54,-0x4c(%rbp)
jne    131f <trj_readheader_dcd_slim+0x18f>
lea    -0x68(%rbp),%rdi
lea    0xd48(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
je     1306 <trj_readheader_dcd_slim+0x176>
lea    -0x68(%rbp),%rdi
lea    0xd2f(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    131f <trj_readheader_dcd_slim+0x18f>
movl   $0x0,-0xa4(%rbp)
movl   $0x0,-0x9c(%rbp)
jmp    1488 <trj_readheader_dcd_slim+0x2f8>
cmpl   $0x54,-0x4c(%rbp)
jne    1388 <trj_readheader_dcd_slim+0x1f8>
cmpl   $0x0,-0x50(%rbp)
jne    1388 <trj_readheader_dcd_slim+0x1f8>
lea    -0x6c(%rbp),%rdi
lea    0xcdf(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
je     136f <trj_readheader_dcd_slim+0x1df>
lea    -0x6c(%rbp),%rdi
lea    0xcc6(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    1388 <trj_readheader_dcd_slim+0x1f8>
movl   $0x0,-0xa4(%rbp)
movl   $0x1,-0x9c(%rbp)
jmp    1483 <trj_readheader_dcd_slim+0x2f3>
cmpl   $0x54000000,-0x4c(%rbp)
jne    13ea <trj_readheader_dcd_slim+0x25a>
lea    -0x68(%rbp),%rdi
lea    0xc7d(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
je     13d1 <trj_readheader_dcd_slim+0x241>
lea    -0x68(%rbp),%rdi
lea    0xc64(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    13ea <trj_readheader_dcd_slim+0x25a>
movl   $0x1,-0xa4(%rbp)
movl   $0x0,-0x9c(%rbp)
jmp    147e <trj_readheader_dcd_slim+0x2ee>
cmpl   $0x0,-0x4c(%rbp)
jne    1456 <trj_readheader_dcd_slim+0x2c6>
cmpl   $0x54000000,-0x50(%rbp)
jne    1456 <trj_readheader_dcd_slim+0x2c6>
lea    -0x6c(%rbp),%rdi
lea    0xc11(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
je     143d <trj_readheader_dcd_slim+0x2ad>
lea    -0x6c(%rbp),%rdi
lea    0xbf8(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    1456 <trj_readheader_dcd_slim+0x2c6>
movl   $0x1,-0xa4(%rbp)
movl   $0x1,-0x9c(%rbp)
jmp    1479 <trj_readheader_dcd_slim+0x2e9>
mov    0x2b7b(%rip),%rax
mov    (%rax),%edi
lea    0xbc1(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1891 <trj_readheader_dcd_slim+0x701>
jmp    147e <trj_readheader_dcd_slim+0x2ee>
jmp    1483 <trj_readheader_dcd_slim+0x2f3>
jmp    1488 <trj_readheader_dcd_slim+0x2f8>
mov    -0x60(%rbp),%rdi
mov    -0x54(%rbp),%edx
xor    %esi,%esi
call   1070 <memset@plt>
mov    -0x10(%rbp),%rdi
mov    -0x9c(%rbp),%esi
add    $0x1,%esi
shl    $0x2,%esi
mov    0x2b23(%rip),%rax
mov    (%rax),%edx
call   10a0 <fseeko@plt>
lea    -0x71(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x1,%esi
mov    $0x4,%edx
call   1050 <fread@plt>
movb   $0x0,-0x6d(%rbp)
mov    -0x60(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x1,%esi
mov    $0x50,%edx
call   1050 <fread@plt>
cmpl   $0x0,-0xa4(%rbp)
je     156d <trj_readheader_dcd_slim+0x3dd>
mov    -0x60(%rbp),%rsi
mov    $0x4,%edi
call   10b0 <swap@plt>
mov    -0x60(%rbp),%rsi
add    $0x4,%rsi
mov    $0x4,%edi
call   10b0 <swap@plt>
mov    -0x60(%rbp),%rsi
add    $0x8,%rsi
mov    $0x4,%edi
call   10b0 <swap@plt>
mov    -0x60(%rbp),%rsi
add    $0xc,%rsi
mov    $0x4,%edi
call   10b0 <swap@plt>
mov    -0x60(%rbp),%rsi
add    $0x20,%rsi
mov    $0x4,%edi
call   10b0 <swap@plt>
mov    -0x60(%rbp),%rsi
add    $0x24,%rsi
mov    $0x4,%edi
call   10b0 <swap@plt>
mov    -0x60(%rbp),%rsi
add    $0x28,%rsi
mov    $0x4,%edi
call   10b0 <swap@plt>
mov    -0x60(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x88(%rbp)
mov    -0x60(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x8c(%rbp)
mov    -0x60(%rbp),%rax
mov    0x8(%rax),%eax
mov    %eax,-0x90(%rbp)
mov    -0x60(%rbp),%rax
mov    0xc(%rax),%eax
mov    %eax,-0x94(%rbp)
mov    -0x60(%rbp),%rax
mov    0x20(%rax),%eax
mov    %eax,-0xb0(%rbp)
mov    -0x60(%rbp),%rax
movss  0x24(%rax),%xmm0
movss  %xmm0,-0x98(%rbp)
ff
mov    -0x60(%rbp),%rax
mov    0x28(%rax),%eax
mov    %eax,-0xa0(%rbp)
cmpl   $0x0,-0xa0(%rbp)
je     160e <trj_readheader_dcd_slim+0x47e>
cmpl   $0x1,-0xa0(%rbp)
je     160e <trj_readheader_dcd_slim+0x47e>
mov    0x29ec(%rip),%rax
mov    (%rax),%edi
mov    -0xa0(%rbp),%edx
lea    0xa54(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1891 <trj_readheader_dcd_slim+0x701>
mov    -0x60(%rbp),%rdi
mov    -0x9c(%rbp),%edx
add    $0x1,%edx
shl    $0x3,%edx
mov    -0x10(%rbp),%rcx
mov    $0x1,%esi
call   1050 <fread@plt>
mov    -0x60(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x1,%esi
mov    $0x4,%edx
call   1050 <fread@plt>
cmpl   $0x0,-0xa4(%rbp)
je     165e <trj_readheader_dcd_slim+0x4ce>
mov    -0x60(%rbp),%rsi
mov    $0x4,%edi
call   10b0 <swap@plt>
mov    -0x60(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xac(%rbp)
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0xac(%rbp),%eax
jge    16a5 <trj_readheader_dcd_slim+0x515>
mov    -0x60(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x1,%esi
mov    $0x50,%edx
call   1050 <fread@plt>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1671 <trj_readheader_dcd_slim+0x4e1>
mov    -0x60(%rbp),%rdi
mov    -0x9c(%rbp),%edx
add    $0x1,%edx
shl    $0x3,%edx
mov    -0x10(%rbp),%rcx
mov    $0x1,%esi
call   1050 <fread@plt>
mov    -0x60(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x1,%esi
mov    $0x4,%edx
call   1050 <fread@plt>
cmpl   $0x0,-0xa4(%rbp)
je     16f5 <trj_readheader_dcd_slim+0x565>
mov    -0x60(%rbp),%rsi
mov    $0x4,%edi
call   10b0 <swap@plt>
mov    -0x60(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xa8(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x28dc(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   10a0 <fseeko@plt>
cmpl   $0x0,-0xb0(%rbp)
jne    1784 <trj_readheader_dcd_slim+0x5f4>
mov    -0x9c(%rbp),%eax
add    $0x1,%eax
imul   $0x18,%eax,%eax
add    $0x5c,%eax
imul   $0x50,-0xac(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x40(%rbp)
mov    -0x9c(%rbp),%eax
add    $0x1,%eax
imul   $0x18,%eax,%eax
imul   $0xc,-0xa8(%rbp),%ecx
add    %ecx,%eax
imul   $0x38,-0xa0(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x44(%rbp)
mov    -0x80(%rbp),%rax
movslq -0x40(%rbp),%rcx
sub    %rcx,%rax
movslq -0x44(%rbp),%rcx
cqto
idiv   %rcx
cvtsi2ss %rax,%xmm0
movss  %xmm0,-0x84(%rbp)
ff
jmp    1834 <trj_readheader_dcd_slim+0x6a4>
mov    -0x9c(%rbp),%eax
add    $0x1,%eax
imul   $0x18,%eax,%eax
add    $0x5c,%eax
imul   $0x50,-0xac(%rbp),%ecx
add    %ecx,%eax
mov    -0x9c(%rbp),%ecx
add    $0x1,%ecx
shl    $0x3,%ecx
mov    -0xa8(%rbp),%edx
sub    -0xb0(%rbp),%edx
shl    $0x2,%edx
add    %edx,%ecx
add    %ecx,%eax
mov    %eax,-0x40(%rbp)
mov    -0x9c(%rbp),%eax
add    $0x1,%eax
imul   $0x18,%eax,%eax
imul   $0xc,-0xa8(%rbp),%ecx
add    %ecx,%eax
imul   $0x38,-0xa0(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x48(%rbp)
mov    -0x9c(%rbp),%eax
add    $0x1,%eax
imul   $0x18,%eax,%eax
mov    -0xa8(%rbp),%ecx
sub    -0xb0(%rbp),%ecx
imul   $0xc,%ecx,%ecx
add    %ecx,%eax
imul   $0x38,-0xa0(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x44(%rbp)
mov    -0x80(%rbp),%rax
movslq -0x40(%rbp),%rcx
sub    %rcx,%rax
movslq -0x48(%rbp),%rcx
sub    %rcx,%rax
movslq -0x44(%rbp),%rcx
cqto
idiv   %rcx
add    $0x1,%rax
cvtsi2ss %rax,%xmm0
movss  %xmm0,-0x84(%rbp)
ff
mov    -0x9c(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
cvttss2si -0x84(%rbp),%ecx
ff
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xa0(%rbp),%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xa4(%rbp),%ecx
mov    -0x30(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xac(%rbp),%ecx
mov    -0x38(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xa8(%rbp),%ecx
mov    0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xb0(%rbp),%ecx
mov    0x18(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trj_readheader_dcd_slim>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
mov    %r9,%r13
mov    %r8,%rbp
mov    %rcx,%rbx
mov    %rdx,0x38(%rsp)
mov    %rsi,0x30(%rsp)
mov    %rdi,%r14
mov    $0x2800,%edi
mov    $0x1,%esi
call   1080 <calloc@plt>
mov    %rax,%r15
mov    0x2e1b(%rip),%rax
mov    (%rax),%edx
mov    %r14,%rdi
xor    %esi,%esi
call   10a0 <fseeko@plt>
mov    %r14,%rdi
call   1040 <ftello@plt>
mov    %rax,%r12
mov    0x2de5(%rip),%rax
mov    (%rax),%edx
mov    %r14,%rdi
xor    %esi,%esi
call   10a0 <fseeko@plt>
test   %r12,%r12
je     133a <trj_readheader_dcd_slim+0x1aa>
mov    %rbx,0x18(%rsp)
mov    %rbp,0x20(%rsp)
mov    %r13,0x28(%rsp)
lea    0x44(%rsp),%r13
mov    %r13,%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1070 <memset@plt>
lea    0x4(%rsp),%rbp
mov    %rbp,%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1070 <memset@plt>
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1070 <memset@plt>
mov    %r13,%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1060 <fread@plt>
mov    %rbp,%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1060 <fread@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1060 <fread@plt>
mov    0x44(%rsp),%eax
cmp    $0x54000000,%eax
je     1350 <trj_readheader_dcd_slim+0x1c0>
mov    0x4(%rsp),%ebx
cmp    $0x54,%eax
jne    1395 <trj_readheader_dcd_slim+0x205>
lea    0xd53(%rip),%rsi
lea    0x4(%rsp),%rdi
mov    $0x4,%edx
call   1030 <strncmp@plt>
mov    $0x1,%bpl
movl   $0x0,(%rsp)
test   %eax,%eax
je     13fd <trj_readheader_dcd_slim+0x26d>
lea    0xd30(%rip),%rsi
lea    0x4(%rsp),%rdi
mov    $0x4,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     13fd <trj_readheader_dcd_slim+0x26d>
test   %ebx,%ebx
jne    13da <trj_readheader_dcd_slim+0x24a>
lea    0xd05(%rip),%rsi
lea    0x8(%rsp),%rdi
mov    $0x4,%edx
call   1030 <strncmp@plt>
mov    $0x1,%ebx
test   %eax,%eax
je     140a <trj_readheader_dcd_slim+0x27a>
lea    0xce7(%rip),%rsi
lea    0x8(%rsp),%rdi
mov    $0x4,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
jne    13da <trj_readheader_dcd_slim+0x24a>
jmp    140a <trj_readheader_dcd_slim+0x27a>
lea    0xd0d(%rip),%rdi
call   1050 <puts@plt>
mov    $0xffffffff,%eax
jmp    170f <trj_readheader_dcd_slim+0x57f>
movl   $0x1,(%rsp)
lea    0xca2(%rip),%rsi
lea    0x4(%rsp),%rdi
mov    $0x4,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     13fb <trj_readheader_dcd_slim+0x26b>
lea    0xc89(%rip),%rsi
lea    0x4(%rsp),%rdi
mov    $0x4,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
jne    13da <trj_readheader_dcd_slim+0x24a>
xor    %ebx,%ebx
xor    %ebp,%ebp
jmp    140a <trj_readheader_dcd_slim+0x27a>
test   %eax,%eax
jne    13da <trj_readheader_dcd_slim+0x24a>
cmp    $0x54000000,%ebx
jne    13da <trj_readheader_dcd_slim+0x24a>
lea    0xc58(%rip),%rsi
lea    0x8(%rsp),%rdi
mov    $0x4,%edx
call   1030 <strncmp@plt>
mov    $0x1,%ebx
test   %eax,%eax
je     1401 <trj_readheader_dcd_slim+0x271>
lea    0xc3e(%rip),%rsi
lea    0x8(%rsp),%rdi
mov    $0x4,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     1401 <trj_readheader_dcd_slim+0x271>
mov    0x2bf7(%rip),%rax
mov    (%rax),%edi
lea    0xc20(%rip),%rsi
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    $0xffffffff,%eax
jmp    170f <trj_readheader_dcd_slim+0x57f>
xor    %ebp,%ebp
xor    %ebx,%ebx
jmp    140a <trj_readheader_dcd_slim+0x27a>
xor    %ebp,%ebp
movl   $0x1,(%rsp)
mov    %r15,%rdi
xor    %esi,%esi
mov    $0x2800,%edx
call   1070 <memset@plt>
lea    0x4(,%rbx,4),%esi
mov    0x2ba9(%rip),%rax
mov    (%rax),%edx
mov    %r14,%rdi
call   10a0 <fseeko@plt>
lea    0x4b(%rsp),%rdi
mov    $0x1,%esi
mov    $0x4,%edx
mov    %r14,%rcx
call   1060 <fread@plt>
movb   $0x0,0x4f(%rsp)
mov    %r15,%rdi
mov    $0x1,%esi
mov    $0x50,%edx
mov    %r14,%rcx
call   1060 <fread@plt>
test   %bpl,%bpl
jne    14cb <trj_readheader_dcd_slim+0x33b>
mov    $0x4,%edi
mov    %r15,%rsi
call   10b0 <swap@plt>
lea    0x4(%r15),%rsi
mov    $0x4,%edi
call   10b0 <swap@plt>
lea    0x8(%r15),%rsi
mov    $0x4,%edi
call   10b0 <swap@plt>
lea    0xc(%r15),%rsi
mov    $0x4,%edi
call   10b0 <swap@plt>
lea    0x20(%r15),%rsi
mov    $0x4,%edi
call   10b0 <swap@plt>
lea    0x24(%r15),%rsi
mov    $0x4,%edi
call   10b0 <swap@plt>
mov    %r15,%rsi
add    $0x28,%rsi
mov    $0x4,%edi
call   10b0 <swap@plt>
mov    0x28(%r15),%edx
cmp    $0x2,%edx
jae    1616 <trj_readheader_dcd_slim+0x486>
mov    %edx,0xc(%rsp)
mov    %rbx,0x10(%rsp)
lea    0x1(%rbx),%r13d
mov    0x20(%r15),%eax
mov    %eax,0x40(%rsp)
shl    $0x3,%r13d
mov    %r15,%rdi
mov    $0x1,%esi
mov    %r13d,%edx
mov    %r14,%rcx
call   1060 <fread@plt>
mov    %r15,%rdi
mov    $0x1,%esi
mov    $0x4,%edx
mov    %r14,%rcx
call   1060 <fread@plt>
mov    %rbp,0x50(%rsp)
test   %bpl,%bpl
jne    1530 <trj_readheader_dcd_slim+0x3a0>
mov    $0x4,%edi
mov    %r15,%rsi
call   10b0 <swap@plt>
mov    (%r15),%eax
mov    %rax,%rbx
test   %eax,%eax
jle    155a <trj_readheader_dcd_slim+0x3ca>
mov    %ebx,%ebp
nopl   0x0(%rax)
mov    %r15,%rdi
mov    $0x1,%esi
mov    $0x50,%edx
mov    %r14,%rcx
call   1060 <fread@plt>
add    $0xffffffff,%ebp
jne    1540 <trj_readheader_dcd_slim+0x3b0>
mov    %r15,%rdi
mov    $0x1,%esi
mov    %r13d,%edx
mov    %r14,%rcx
call   1060 <fread@plt>
mov    %r15,%rdi
mov    $0x1,%esi
mov    $0x4,%edx
mov    %r14,%rcx
call   1060 <fread@plt>
cmpb   $0x0,0x50(%rsp)
jne    1596 <trj_readheader_dcd_slim+0x406>
mov    $0x4,%edi
mov    %r15,%rsi
call   10b0 <swap@plt>
mov    (%r15),%r15d
mov    0x2a48(%rip),%rax
mov    (%rax),%edx
mov    %r14,%rdi
xor    %esi,%esi
call   10a0 <fseeko@plt>
lea    0x0(%r13,%r13,2),%eax
mov    0x40(%rsp),%r10d
mov    %rbx,%r11
test   %r10d,%r10d
je     1637 <trj_readheader_dcd_slim+0x4a7>
lea    (%rbx,%rbx,4),%ecx
shl    $0x4,%ecx
mov    %r15d,%edx
sub    %r10d,%edx
add    %eax,%r13d
add    %ecx,%r13d
lea    0x5c(%r13,%rdx,4),%esi
lea    (%r15,%r15,2),%ecx
mov    0xc(%rsp),%r9d
imul   $0x38,%r9d,%edi
add    %eax,%edi
lea    (%rdi,%rcx,4),%eax
lea    (%rdx,%rdx,2),%ecx
lea    (%rdi,%rcx,4),%ecx
movslq %esi,%rdx
cltq
add    %rdx,%rax
sub    %rax,%r12
movslq %ecx,%rsi
mov    %r12,%rax
or     %rsi,%rax
shr    $0x20,%rax
je     1679 <trj_readheader_dcd_slim+0x4e9>
mov    0x10(%rsp),%r8
mov    %r12,%rax
cqto
idiv   %rsi
jmp    1685 <trj_readheader_dcd_slim+0x4f5>
mov    0x29bb(%rip),%rax
mov    (%rax),%edi
lea    0xa0c(%rip),%rsi
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    $0xffffffff,%eax
jmp    170f <trj_readheader_dcd_slim+0x57f>
lea    (%rbx,%rbx,4),%ecx
shl    $0x4,%ecx
lea    (%rax,%rcx,1),%edx
add    $0x5c,%edx
lea    (%r15,%r15,2),%ecx
mov    0xc(%rsp),%r9d
imul   $0x38,%r9d,%esi
add    %eax,%esi
lea    (%rsi,%rcx,4),%ecx
movslq %edx,%rax
sub    %rax,%r12
movslq %ecx,%rsi
mov    %r12,%rax
or     %rsi,%rax
shr    $0x20,%rax
je     16b7 <trj_readheader_dcd_slim+0x527>
mov    0x10(%rsp),%r8
mov    %r12,%rax
cqto
idiv   %rsi
jmp    16c3 <trj_readheader_dcd_slim+0x533>
mov    0x10(%rsp),%r8
mov    %r12d,%eax
xor    %edx,%edx
div    %ecx
mov    0x28(%rsp),%r14
mov    0x20(%rsp),%rdx
mov    0x18(%rsp),%rsi
mov    0x38(%rsp),%rdi
mov    0x30(%rsp),%rbp
mov    (%rsp),%ebx
mov    0x98(%rsp),%r12
mov    0x90(%rsp),%rcx
add    $0x1,%rax
jmp    16ef <trj_readheader_dcd_slim+0x55f>
mov    0x10(%rsp),%r8
mov    %r12d,%eax
xor    %edx,%edx
div    %ecx
mov    0x28(%rsp),%r14
mov    0x20(%rsp),%rdx
mov    0x18(%rsp),%rsi
mov    0x38(%rsp),%rdi
mov    0x30(%rsp),%rbp
mov    (%rsp),%ebx
mov    0x98(%rsp),%r12
mov    0x90(%rsp),%rcx
cvtsi2ss %rax,%xmm0
cvttss2si %xmm0,%eax
mov    %r8d,0x0(%rbp)
mov    %eax,(%rdi)
mov    %r9d,(%rsi)
mov    %ebx,(%rdx)
mov    %r11d,(%r14)
mov    %r15d,(%rcx)
mov    %r10d,(%r12)
xor    %eax,%eax
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
@.str.1 = [5 x i8] c"CORD\00"
@.str.2 = [5 x i8] c"VELD\00"
@stderr = global i32 0
@.str.3 = [40 x i8] c"*** This is not a proper dcd file ***\0A\0A\00"
@.str.4 = [28 x i8] c"varpbc field is wrong (%d)\0A\00"
@str = [28 x i8] c"*** Error: empty file! ***\0A\00"
define i32 @trj_readheader_dcd_slim(i32* nocapture %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2, i32* nocapture writeonly %3, i32* nocapture writeonly %4, i32* nocapture writeonly %5, i32* nocapture writeonly %6, i32* nocapture writeonly %7) {
%9 = alloca i32
%10 = alloca i32
%11 = alloca [4 x i8]
%12 = alloca [5 x i8]
%13 = bitcast i32* %9 to i8*
%14 = bitcast i32* %10 to i8*
%15 = getelementptr inbounds [4 x i8], [4 x i8]* %11, i64 0, i64 0
%16 = getelementptr inbounds [5 x i8], [5 x i8]* %12, i64 0, i64 0
%17 = tail call dereferenceable_or_null(10240) i8* @calloc(i32 10240, i32 1)
%18 = load i32, i32* @SEEK_END
%19 = tail call i32 @fseeko(i32* %0, i32 0, i32 %18)
%20 = tail call i64 @ftello(i32* %0)
%21 = load i32, i32* @SEEK_SET
%22 = tail call i32 @fseeko(i32* %0, i32 0, i32 %21)
%23 = icmp eq i64 %20, 0
br i1 %23, label %24, label %26
24: ; preds = %8
%25 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
br label %168
26: ; preds = %8
%27 = call i32 @memset(i8* %13, i8 signext 0, i32 4)
%28 = call i32 @memset(i8* %14, i8 signext 0, i32 4)
%29 = call i32 @memset(i8* %15, i8 signext 0, i32 4)
%30 = call i32 @fread(i8* %13, i32 4, i32 1, i32* %0)
%31 = call i32 @fread(i8* %14, i32 4, i32 1, i32* %0)
%32 = call i32 @fread(i8* %15, i32 4, i32 1, i32* %0)
%33 = load i32, i32* %9
%34 = load i32, i32* %10
switch i32 %33, label %55 [
i32 84, label %35
i32 1409286144, label %49
]
35: ; preds = %26
%36 = call i32 @strncmp(i8* %14, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 4)
%37 = icmp eq i32 %36, 0
br i1 %37, label %68, label %38
38: ; preds = %35
%39 = call i32 @strncmp(i8* %14, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 4)
%40 = icmp eq i32 %39, 0
br i1 %40, label %68, label %41
41: ; preds = %38
%42 = icmp eq i32 %34, 0
br i1 %42, label %43, label %65
43: ; preds = %41
%44 = call i32 @strncmp(i8* %15, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 4)
%45 = icmp eq i32 %44, 0
br i1 %45, label %68, label %46
46: ; preds = %43
%47 = call i32 @strncmp(i8* %15, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 4)
%48 = icmp eq i32 %47, 0
br i1 %48, label %68, label %65
49: ; preds = %26
%50 = call i32 @strncmp(i8* %14, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 4)
%51 = icmp eq i32 %50, 0
br i1 %51, label %68, label %52
52: ; preds = %49
%53 = call i32 @strncmp(i8* %14, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 4)
%54 = icmp eq i32 %53, 0
br i1 %54, label %68, label %65
55: ; preds = %26
%56 = icmp eq i32 %33, 0
%57 = icmp eq i32 %34, 1409286144
%58 = select i1 %56, i1 %57, i1 false
br i1 %58, label %59, label %65
59: ; preds = %55
%60 = call i32 @strncmp(i8* %15, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 4)
%61 = icmp eq i32 %60, 0
br i1 %61, label %68, label %62
62: ; preds = %59
%63 = call i32 @strncmp(i8* %15, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 4)
%64 = icmp eq i32 %63, 0
br i1 %64, label %68, label %65
65: ; preds = %41, %46, %52, %62, %55
%66 = load i32, i32* @stderr
%67 = call i32 (i32, i8*, ...) @fprintf(i32 %66, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.3, i64 0, i64 0))
br label %168
68: ; preds = %59, %62, %49, %52, %43, %46, %35, %38
%69 = phi i32 [ 0, %38 ], [ 0, %35 ], [ 1, %46 ], [ 1, %43 ], [ 0, %52 ], [ 0, %49 ], [ 1, %62 ], [ 1, %59 ]
%70 = phi i1 [ true, %38 ], [ true, %35 ], [ true, %46 ], [ true, %43 ], [ false, %52 ], [ false, %49 ], [ false, %62 ], [ false, %59 ]
%71 = phi i32 [ 0, %38 ], [ 0, %35 ], [ 0, %46 ], [ 0, %43 ], [ 1, %52 ], [ 1, %49 ], [ 1, %62 ], [ 1, %59 ]
%72 = call i32 @memset(i8* %17, i8 signext 0, i32 10240)
%73 = add nuw nsw i32 %69, 1
%74 = shl nuw nsw i32 %73, 2
%75 = load i32, i32* @SEEK_SET
%76 = call i32 @fseeko(i32* %0, i32 %74, i32 %75)
%77 = call i32 @fread(i8* %16, i32 1, i32 4, i32* %0)
%78 = getelementptr inbounds [5 x i8], [5 x i8]* %12, i64 0, i64 4
store i8 0, i8* %78
%79 = call i32 @fread(i8* %17, i32 1, i32 80, i32* %0)
br i1 %70, label %94, label %80
80: ; preds = %68
%81 = call i32 @swap(i32 4, i8* %17)
%82 = getelementptr inbounds i8, i8* %17, i64 4
%83 = call i32 @swap(i32 4, i8* %82)
%84 = getelementptr inbounds i8, i8* %17, i64 8
%85 = call i32 @swap(i32 4, i8* %84)
%86 = getelementptr inbounds i8, i8* %17, i64 12
%87 = call i32 @swap(i32 4, i8* %86)
%88 = getelementptr inbounds i8, i8* %17, i64 32
%89 = call i32 @swap(i32 4, i8* %88)
%90 = getelementptr inbounds i8, i8* %17, i64 36
%91 = call i32 @swap(i32 4, i8* %90)
%92 = getelementptr inbounds i8, i8* %17, i64 40
%93 = call i32 @swap(i32 4, i8* %92)
br label %94
94: ; preds = %80, %68
%95 = bitcast i8* %17 to i32*
%96 = getelementptr inbounds i8, i8* %17, i64 32
%97 = bitcast i8* %96 to i32*
%98 = load i32, i32* %97
%99 = getelementptr inbounds i8, i8* %17, i64 40
%100 = bitcast i8* %99 to i32*
%101 = load i32, i32* %100
%102 = icmp ult i32 %101, 2
br i1 %102, label %106, label %103
103: ; preds = %94
%104 = load i32, i32* @stderr
%105 = call i32 (i32, i8*, ...) @fprintf(i32 %104, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0), i32 %101)
br label %168
106: ; preds = %94
%107 = shl nuw nsw i32 %73, 3
%108 = call i32 @fread(i8* %17, i32 1, i32 %107, i32* %0)
%109 = call i32 @fread(i8* %17, i32 1, i32 4, i32* %0)
br i1 %70, label %112, label %110
110: ; preds = %106
%111 = call i32 @swap(i32 4, i8* %17)
br label %112
112: ; preds = %110, %106
%113 = load i32, i32* %95
%114 = icmp sgt i32 %113, 0
br i1 %114, label %115, label %120
115: ; preds = %112, %115
%116 = phi i32 [ %118, %115 ], [ 0, %112 ]
%117 = call i32 @fread(i8* %17, i32 1, i32 80, i32* %0)
%118 = add nuw nsw i32 %116, 1
%119 = icmp eq i32 %118, %113
br i1 %119, label %120, label %115
120: ; preds = %115, %112
%121 = call i32 @fread(i8* %17, i32 1, i32 %107, i32* %0)
%122 = call i32 @fread(i8* %17, i32 1, i32 4, i32* %0)
br i1 %70, label %125, label %123
123: ; preds = %120
%124 = call i32 @swap(i32 4, i8* %17)
br label %125
125: ; preds = %123, %120
%126 = load i32, i32* %95
%127 = load i32, i32* @SEEK_END
%128 = call i32 @fseeko(i32* %0, i32 0, i32 %127)
%129 = icmp eq i32 %98, 0
%130 = mul nuw nsw i32 %73, 24
br i1 %129, label %131, label %143
131: ; preds = %125
%132 = add nuw nsw i32 %130, 92
%133 = mul nsw i32 %113, 80
%134 = add nsw i32 %132, %133
%135 = mul nsw i32 %126, 12
%136 = mul nsw i32 %101, 56
%137 = add i32 %136, %130
%138 = add i32 %137, %135
%139 = sext i32 %134 to i64
%140 = sub nsw i64 %20, %139
%141 = sext i32 %138 to i64
%142 = sdiv i64 %140, %141
br label %164
143: ; preds = %125
%144 = mul nsw i32 %113, 80
%145 = sub nsw i32 %126, %98
%146 = shl nsw i32 %145, 2
%147 = add nuw nsw i32 %130, 92
%148 = add nuw nsw i32 %147, %107
%149 = add i32 %148, %144
%150 = add i32 %149, %146
%151 = mul nsw i32 %126, 12
%152 = mul nsw i32 %101, 56
%153 = add i32 %152, %130
%154 = add i32 %153, %151
%155 = mul nsw i32 %145, 12
%156 = add i32 %153, %155
%157 = sext i32 %150 to i64
%158 = sext i32 %154 to i64
%159 = add nsw i64 %158, %157
%160 = sub i64 %20, %159
%161 = sext i32 %156 to i64
%162 = sdiv i64 %160, %161
%163 = add nsw i64 %162, 1
br label %164
164: ; preds = %143, %131
%165 = phi i64 [ %163, %143 ], [ %142, %131 ]
%166 = sitofp i64 %165 to float
store i32 %69, i32* %1
%167 = fptosi float %166 to i32
store i32 %167, i32* %2
store i32 %101, i32* %3
store i32 %71, i32* %4
store i32 %113, i32* %5
store i32 %126, i32* %6
store i32 %98, i32* %7
br label %168
168: ; preds = %164, %103, %65, %24
%169 = phi i32 [ -1, %24 ], [ -1, %65 ], [ -1, %103 ], [ 0, %164 ]
ret i32 %169
}