#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*/ assert(int);
double atof(char *);
int atoi(char *);
double cos(double);
int /*<<< orphan*/ cvtJ2000toGalactic(double, double, double *, double *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
char *fgets(char *, int const, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ rewind(int /*<<< orphan*/ *);
double sin(double);
char *strsep(char **, char *);
int main(void) {
  FILE *hip2 = fopen("hip2_sorted.dat", "r");
  FILE *hip = fopen("hip_main_sorted.dat", "r");
  const int nHip2 = 278;
  char achHip2[nHip2];
  const int nFieldsHip2 = 27;
  const int sepHip2[] = {6,   10,  12,  14,  28,  42,  50,  59,  68,
                         75,  82,  89,  96,  103, 107, 113, 116, 123,
                         128, 136, 143, 149, 151, 158, 164, 171, 276};
  const int nHip = 1024;
  char achHip[nHip];
  const int nFieldsHip = 78;
  char *p;
  char *tok, *tok1;
  int i;
  double ra, dec, plx, e_plx, hipMag, BminusV, VminusI;
  double l, b, r, x, y, z;
  int idHip, nComp, ihip, iVar, iSolution;
  assert(hip2 != NULL);
  assert(hip != NULL);
  p = fgets(achHip, nHip, hip);
  tok1 = strsep(&p, "|");
  assert(tok1 != NULL);
  tok1 = strsep(&p, "|");
  assert(tok1 != NULL);
  while (1) {
    tok = fgets(achHip2, nHip2, hip2);
    if (tok == NULL)
      break;
    for (i = 0; i < nFieldsHip2; ++i) {
      achHip2[sepHip2[i]] = 0;
      switch (i) {
      case 0:
        idHip = atoi(tok);
        rewind(hip);
        while (1) {
          if (atoi(tok1) == idHip)
            break;
          p = fgets(achHip, nHip, hip);
          tok1 = strsep(&p, "|");
          assert(tok1 != NULL);
          tok1 = strsep(&p, "|");
          assert(tok1 != NULL);
        }
        break;
      case 1:
        iSolution = atoi(tok);
        break;
      case 3:
        nComp = atoi(tok);
        break;
      case 4:
        ra = atof(tok);
        break;
      case 5:
        dec = atof(tok);
        break;
      case 6:
        plx = atof(tok);
        break;
      case 11:
        e_plx = atof(tok);
        break;
      case 19:
        hipMag = atof(tok);
        break;
      case 22:
        iVar = atoi(tok);
        break;
      case 23:
        BminusV = atof(tok);
        break;
      case 25:
        VminusI = atof(tok);
        break;
      }
      tok = &achHip2[sepHip2[i] + 1];
    }
    assert(*tok == 0);
    if (nComp > 1)
      continue;
    cvtJ2000toGalactic(ra, dec, &l, &b);
    if (plx < 0.5 * e_plx)
      r = 1.5 / e_plx;
    else
      r = 1 / plx;
    x = r * cos(b) * cos(l);
    y = r * cos(b) * sin(l);
    z = r * sin(b);
    printf("%6d,%13.10f,%13.10f,%13.10f,%7.4f,%1d,%6.3f,%6.3f", idHip, x, y, z,
           hipMag, iVar, BminusV, VminusI);
    for (ihip = 2; ihip < nFieldsHip; ++ihip) {
      tok1 = strsep(&p, "|");
      assert(tok1 != NULL);
      switch (ihip) {
      case 49:
        printf(",%s", tok1);
        break;
      case 50:
        printf(",%s", tok1);
        break;
      case 51:
        printf(",%s", tok1);
        break;
      case 52:
        printf(",%s", tok1);
        break;
      case 71:
        printf(",%s", tok1);
        break;
      case 76:
        printf(",%s", tok1);
        break;
      }
    }
    printf("\n");
  }
  fclose(hip2);
  fclose(hip);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x6a0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xf83(%rip),%rdi
lea    0xf8c(%rip),%rsi
call   10e0 <fopen@plt>
mov    %rax,-0x10(%rbp)
lea    0xf7e(%rip),%rdi
lea    0xf75(%rip),%rsi
call   10e0 <fopen@plt>
mov    %rax,-0x18(%rbp)
movl   $0x116,-0x1c(%rbp)
mov    %rsp,%rax
mov    %rax,-0x28(%rbp)
movl   $0x1b,-0x2c(%rbp)
lea    -0xa0(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x6c,%edx
call   10b0 <memcpy@plt>
movl   $0x400,-0xa4(%rbp)
movl   $0x4e,-0xa8(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1090 <assert@plt>
cmpq   $0x0,-0x18(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1090 <assert@plt>
mov    -0x18(%rbp),%rdx
lea    -0x660(%rbp),%rdi
mov    $0x400,%esi
call   1080 <fgets@plt>
mov    %rax,-0xb0(%rbp)
lea    -0xb0(%rbp),%rdi
lea    0xef3(%rip),%rsi
call   10c0 <strsep@plt>
mov    %rax,-0xc0(%rbp)
cmpq   $0x0,-0xc0(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1090 <assert@plt>
lea    -0xb0(%rbp),%rdi
lea    0xec4(%rip),%rsi
call   10c0 <strsep@plt>
mov    %rax,-0xc0(%rbp)
cmpq   $0x0,-0xc0(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1090 <assert@plt>
jmp    12f4 <main+0x124>
mov    -0x10(%rbp),%rdx
lea    -0x260(%rbp),%rdi
mov    $0x116,%esi
call   1080 <fgets@plt>
mov    %rax,-0xb8(%rbp)
cmpq   $0x0,-0xb8(%rbp)
jne    1323 <main+0x153>
jmp    1877 <main+0x6a7>
movl   $0x0,-0xc4(%rbp)
cmpl   $0x1b,-0xc4(%rbp)
jge    1568 <main+0x398>
movslq -0xc4(%rbp),%rax
movslq -0xa0(%rbp,%rax,4),%rax
ff
movb   $0x0,-0x260(%rbp,%rax,1)
mov    -0xc4(%rbp),%eax
mov    %rax,-0x668(%rbp)
sub    $0x19,%rax
ja     152f <main+0x35f>
mov    -0x668(%rbp),%rax
lea    0xd1a(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0xb8(%rbp),%rdi
call   10f0 <atoi@plt>
mov    %eax,-0x134(%rbp)
mov    -0x18(%rbp),%rdi
call   1070 <rewind@plt>
jmp    139f <main+0x1cf>
mov    -0xc0(%rbp),%rdi
call   10f0 <atoi@plt>
cmp    -0x134(%rbp),%eax
jne    13bc <main+0x1ec>
jmp    143b <main+0x26b>
mov    -0x18(%rbp),%rdx
lea    -0x660(%rbp),%rdi
mov    $0x400,%esi
call   1080 <fgets@plt>
mov    %rax,-0xb0(%rbp)
lea    -0xb0(%rbp),%rdi
lea    0xdac(%rip),%rsi
call   10c0 <strsep@plt>
mov    %rax,-0xc0(%rbp)
cmpq   $0x0,-0xc0(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1090 <assert@plt>
lea    -0xb0(%rbp),%rdi
lea    0xd7d(%rip),%rsi
call   10c0 <strsep@plt>
mov    %rax,-0xc0(%rbp)
cmpq   $0x0,-0xc0(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1090 <assert@plt>
jmp    139a <main+0x1ca>
jmp    152f <main+0x35f>
mov    -0xb8(%rbp),%rdi
call   10f0 <atoi@plt>
mov    %eax,-0x144(%rbp)
jmp    152f <main+0x35f>
mov    -0xb8(%rbp),%rdi
call   10f0 <atoi@plt>
mov    %eax,-0x138(%rbp)
jmp    152f <main+0x35f>
mov    -0xb8(%rbp),%rdi
call   1040 <atof@plt>
movsd  %xmm0,-0xd0(%rbp)
ff
jmp    152f <main+0x35f>
mov    -0xb8(%rbp),%rdi
call   1040 <atof@plt>
movsd  %xmm0,-0xd8(%rbp)
ff
jmp    152f <main+0x35f>
mov    -0xb8(%rbp),%rdi
call   1040 <atof@plt>
movsd  %xmm0,-0xe0(%rbp)
ff
jmp    152f <main+0x35f>
mov    -0xb8(%rbp),%rdi
call   1040 <atof@plt>
movsd  %xmm0,-0xe8(%rbp)
ff
jmp    152f <main+0x35f>
mov    -0xb8(%rbp),%rdi
call   1040 <atof@plt>
movsd  %xmm0,-0xf0(%rbp)
ff
jmp    152f <main+0x35f>
mov    -0xb8(%rbp),%rdi
call   10f0 <atoi@plt>
mov    %eax,-0x140(%rbp)
jmp    152f <main+0x35f>
mov    -0xb8(%rbp),%rdi
call   1040 <atof@plt>
movsd  %xmm0,-0xf8(%rbp)
ff
jmp    152f <main+0x35f>
mov    -0xb8(%rbp),%rdi
call   1040 <atof@plt>
movsd  %xmm0,-0x100(%rbp)
ff
movslq -0xc4(%rbp),%rax
mov    -0xa0(%rbp,%rax,4),%eax
add    $0x1,%eax
movslq %eax,%rcx
lea    -0x260(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0xb8(%rbp)
mov    -0xc4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc4(%rbp)
jmp    132d <main+0x15d>
mov    -0xb8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1090 <assert@plt>
cmpl   $0x1,-0x138(%rbp)
jle    1594 <main+0x3c4>
jmp    12ef <main+0x11f>
movsd  -0xd0(%rbp),%xmm0
ff
movsd  -0xd8(%rbp),%xmm1
ff
lea    -0x108(%rbp),%rdi
lea    -0x110(%rbp),%rsi
call   1030 <cvtJ2000toGalactic@plt>
movsd  -0xe0(%rbp),%xmm1
ff
movsd  0xa39(%rip),%xmm0
mulsd  -0xe8(%rbp),%xmm0
ff
ucomisd %xmm1,%xmm0
jbe    15f6 <main+0x426>
movsd  0xa2f(%rip),%xmm0
divsd  -0xe8(%rbp),%xmm0
ff
movsd  %xmm0,-0x118(%rbp)
ff
jmp    160e <main+0x43e>
movsd  0xa0a(%rip),%xmm0
divsd  -0xe0(%rbp),%xmm0
ff
movsd  %xmm0,-0x118(%rbp)
ff
movsd  -0x118(%rbp),%xmm0
ff
movsd  %xmm0,-0x690(%rbp)
ff
movsd  -0x110(%rbp),%xmm0
ff
call   10d0 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x690(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x688(%rbp)
ff
movsd  -0x108(%rbp),%xmm0
ff
call   10d0 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x688(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x120(%rbp)
ff
movsd  -0x118(%rbp),%xmm0
ff
movsd  %xmm0,-0x680(%rbp)
ff
movsd  -0x110(%rbp),%xmm0
ff
call   10d0 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x680(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x678(%rbp)
ff
movsd  -0x108(%rbp),%xmm0
ff
call   10a0 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x678(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x128(%rbp)
ff
movsd  -0x118(%rbp),%xmm0
ff
movsd  %xmm0,-0x670(%rbp)
ff
movsd  -0x110(%rbp),%xmm0
ff
call   10a0 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x670(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x130(%rbp)
ff
mov    -0x134(%rbp),%esi
movsd  -0x120(%rbp),%xmm0
ff
movsd  -0x128(%rbp),%xmm1
ff
movsd  -0x130(%rbp),%xmm2
ff
movsd  -0xf0(%rbp),%xmm3
ff
mov    -0x140(%rbp),%edx
movsd  -0xf8(%rbp),%xmm4
ff
movsd  -0x100(%rbp),%xmm5
ff
lea    0xa5f(%rip),%rdi
mov    $0x6,%al
call   1060 <printf@plt>
movl   $0x2,-0x13c(%rbp)
cmpl   $0x4e,-0x13c(%rbp)
jge    1864 <main+0x694>
lea    0xa38(%rip),%rsi
lea    -0xb0(%rbp),%rdi
call   10c0 <strsep@plt>
mov    %rax,-0xc0(%rbp)
mov    -0xc0(%rbp),%rax
test   %rax,%rax
setne  %al
movzbl %al,%edi
call   1090 <assert@plt>
mov    -0x13c(%rbp),%eax
add    $0xffffffcf,%eax
mov    %eax,%ecx
mov    %rcx,-0x698(%rbp)
sub    $0x1b,%eax
ja     184b <main+0x67b>
mov    -0x698(%rbp),%rax
lea    0x875(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0xc0(%rbp),%rsi
lea    0xa04(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    184b <main+0x67b>
mov    -0xc0(%rbp),%rsi
lea    0x9ea(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    184b <main+0x67b>
mov    -0xc0(%rbp),%rsi
lea    0x9d0(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    184b <main+0x67b>
mov    -0xc0(%rbp),%rsi
lea    0x9b6(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    184b <main+0x67b>
mov    -0xc0(%rbp),%rsi
lea    0x99c(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    184b <main+0x67b>
mov    -0xc0(%rbp),%rsi
lea    0x982(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    1850 <main+0x680>
mov    -0x13c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x13c(%rbp)
jmp    1746 <main+0x576>
lea    0x95f(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    12ef <main+0x11f>
mov    -0x10(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x18(%rbp),%rdi
call   1050 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
add    $0x6a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x5b8,%rsp
lea    0xf14(%rip),%rdi
lea    0xf1d(%rip),%rbx
mov    %rbx,%rsi
call   10e0 <fopen@plt>
mov    %rax,%rbp
lea    0xf0d(%rip),%rdi
mov    %rbx,%rsi
call   10e0 <fopen@plt>
mov    %rax,%rbx
xor    %edi,%edi
test   %rbp,%rbp
setne  %dil
call   10a0 <assert@plt>
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   10a0 <assert@plt>
lea    0x1b0(%rsp),%rdi
mov    $0x400,%esi
mov    %rbx,0x30(%rsp)
mov    %rbx,%rdx
call   1090 <fgets@plt>
mov    %rax,0x40(%rsp)
lea    0xed4(%rip),%r14
lea    0x40(%rsp),%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
call   10c0 <strsep@plt>
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   10a0 <assert@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   10c0 <strsep@plt>
mov    %rax,%r14
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   10a0 <assert@plt>
lea    0x90(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x116,%esi
mov    %rbp,0x50(%rsp)
mov    %rbp,%rdx
call   1090 <fgets@plt>
test   %rax,%rax
je     1764 <main+0x594>
lea    0xe6d(%rip),%r12
lea    0x40(%rsp),%r13
mov    $0x0,%r15d
jmp    130f <main+0x13f>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x90(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x116,%esi
mov    0x50(%rsp),%rdx
call   1090 <fgets@plt>
mov    $0x0,%r15d
test   %rax,%rax
movsd  0x10(%rsp),%xmm1
movsd  0x8(%rsp),%xmm2
je     1764 <main+0x594>
lea    0xd7a(%rip),%rcx
movslq (%rcx,%r15,4),%rdx
movb   $0x0,0x90(%rsp,%rdx,1)
cmp    $0x19,%r15d
ja     15c0 <main+0x3f0>
mov    %r15d,%ecx
lea    0xcea(%rip),%rsi
movslq (%rsi,%rcx,4),%rcx
add    %rsi,%rcx
jmp    *%rcx
mov    %rdx,0x18(%rsp)
movsd  %xmm2,0x8(%rsp)
movsd  %xmm1,0x10(%rsp)
mov    %rax,%rdi
call   10f0 <atoi@plt>
mov    %eax,%ebp
mov    0x30(%rsp),%rdi
call   1080 <rewind@plt>
mov    %r14,%rdi
call   10f0 <atoi@plt>
mov    %ebp,0x24(%rsp)
cmp    %ebp,%eax
jne    152d <main+0x35d>
movsd  0x10(%rsp),%xmm1
movsd  0x8(%rsp),%xmm2
lea    0x90(%rsp),%rbx
jmp    15af <main+0x3df>
mov    %rax,%rdi
movsd  %xmm1,0x10(%rsp)
movsd  %xmm2,0x8(%rsp)
mov    %rdx,%rbp
call   10f0 <atoi@plt>
mov    %rbp,%rdx
movsd  0x8(%rsp),%xmm2
movsd  0x10(%rsp),%xmm1
mov    %eax,0x4c(%rsp)
jmp    15c0 <main+0x3f0>
mov    %rax,%rdi
movsd  %xmm1,0x10(%rsp)
movsd  %xmm2,0x8(%rsp)
mov    %rdx,%rbp
call   1050 <atof@plt>
mov    %rbp,%rdx
movsd  0x8(%rsp),%xmm2
movsd  0x10(%rsp),%xmm1
movsd  %xmm0,0x60(%rsp)
jmp    15c0 <main+0x3f0>
mov    %rax,%rdi
movsd  %xmm1,0x10(%rsp)
movsd  %xmm2,0x8(%rsp)
mov    %rdx,%rbp
call   1050 <atof@plt>
mov    %rbp,%rdx
movsd  0x8(%rsp),%xmm2
movsd  0x10(%rsp),%xmm1
movsd  %xmm0,0x68(%rsp)
jmp    15c0 <main+0x3f0>
mov    %rax,%rdi
movsd  %xmm1,0x10(%rsp)
mov    %rdx,%rbp
call   1050 <atof@plt>
mov    %rbp,%rdx
movsd  0x10(%rsp),%xmm1
movapd %xmm0,%xmm2
jmp    15c0 <main+0x3f0>
mov    %rax,%rdi
movsd  %xmm2,0x8(%rsp)
mov    %rdx,%rbp
call   1050 <atof@plt>
mov    %rbp,%rdx
movsd  0x8(%rsp),%xmm2
movapd %xmm0,%xmm1
jmp    15c0 <main+0x3f0>
mov    %rax,%rdi
movsd  %xmm1,0x10(%rsp)
movsd  %xmm2,0x8(%rsp)
mov    %rdx,%rbp
call   1050 <atof@plt>
mov    %rbp,%rdx
movsd  0x8(%rsp),%xmm2
movsd  0x10(%rsp),%xmm1
movsd  %xmm0,0x70(%rsp)
jmp    15c0 <main+0x3f0>
mov    %rax,%rdi
movsd  %xmm1,0x10(%rsp)
movsd  %xmm2,0x8(%rsp)
mov    %rdx,%rbp
call   10f0 <atoi@plt>
mov    %rbp,%rdx
movsd  0x8(%rsp),%xmm2
movsd  0x10(%rsp),%xmm1
mov    %eax,0x48(%rsp)
jmp    15c0 <main+0x3f0>
mov    %rax,%rdi
movsd  %xmm1,0x10(%rsp)
movsd  %xmm2,0x8(%rsp)
mov    %rdx,%rbp
call   1050 <atof@plt>
mov    %rbp,%rdx
movsd  0x8(%rsp),%xmm2
movsd  0x10(%rsp),%xmm1
movsd  %xmm0,0x78(%rsp)
jmp    15c0 <main+0x3f0>
mov    %rax,%rdi
movsd  %xmm1,0x10(%rsp)
movsd  %xmm2,0x8(%rsp)
mov    %rdx,%rbp
call   1050 <atof@plt>
mov    %rbp,%rdx
movsd  0x8(%rsp),%xmm2
movsd  0x10(%rsp),%xmm1
movsd  %xmm0,0x80(%rsp)
jmp    15c0 <main+0x3f0>
mov    0x30(%rsp),%rbx
mov    0x24(%rsp),%ebp
cs nopw 0x0(%rax,%rax,1)
lea    0x1b0(%rsp),%rdi
mov    $0x400,%esi
mov    %rbx,%rdx
call   1090 <fgets@plt>
mov    %rax,0x40(%rsp)
mov    %r13,%rdi
mov    %r12,%rsi
call   10c0 <strsep@plt>
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   10a0 <assert@plt>
mov    %r13,%rdi
mov    %r12,%rsi
call   10c0 <strsep@plt>
mov    %rax,%r14
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   10a0 <assert@plt>
mov    %r14,%rdi
call   10f0 <atoi@plt>
cmp    %ebp,%eax
jne    1540 <main+0x370>
lea    0x90(%rsp),%rbx
movsd  0x10(%rsp),%xmm1
movsd  0x8(%rsp),%xmm2
mov    0x18(%rsp),%rdx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    (%rdx,%rbx,1),%rax
add    $0x1,%rax
add    $0x1,%r15
cmp    $0x1b,%r15
jne    130f <main+0x13f>
movsd  %xmm2,0x8(%rsp)
movsd  %xmm1,0x10(%rsp)
xor    %edi,%edi
cmpb   $0x0,0x1a5(%rsp)
sete   %dil
call   10a0 <assert@plt>
cmpl   $0x1,0x4c(%rsp)
jg     12e2 <main+0x112>
movsd  0x60(%rsp),%xmm0
movsd  0x68(%rsp),%xmm1
lea    0x58(%rsp),%rdi
lea    0x38(%rsp),%rsi
call   1040 <cvtJ2000toGalactic@plt>
movsd  0x10(%rsp),%xmm1
movapd %xmm1,%xmm0
mulsd  0x9d3(%rip),%xmm0
movsd  0x8(%rsp),%xmm2
ucomisd %xmm2,%xmm0
jbe    1647 <main+0x477>
movsd  0x9cf(%rip),%xmm0
divsd  %xmm1,%xmm0
jmp    1653 <main+0x483>
movsd  0x9b9(%rip),%xmm0
divsd  %xmm2,%xmm0
movsd  %xmm0,0x28(%rsp)
mov    $0x840000f,%ebx
lea    0xaf1(%rip),%r15
mov    0x24(%rsp),%ebp
movsd  0x38(%rsp),%xmm0
call   10d0 <cos@plt>
mulsd  0x28(%rsp),%xmm0
movsd  %xmm0,0x18(%rsp)
movsd  0x58(%rsp),%xmm0
call   10d0 <cos@plt>
mulsd  0x18(%rsp),%xmm0
movsd  %xmm0,0x88(%rsp)
movsd  0x38(%rsp),%xmm0
call   10d0 <cos@plt>
mulsd  0x28(%rsp),%xmm0
movsd  %xmm0,0x18(%rsp)
movsd  0x58(%rsp),%xmm0
call   10b0 <sin@plt>
movsd  0x18(%rsp),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x18(%rsp)
movsd  0x38(%rsp),%xmm0
call   10b0 <sin@plt>
movsd  0x28(%rsp),%xmm2
mulsd  %xmm0,%xmm2
lea    0xa3c(%rip),%rdi
mov    %ebp,%esi
movsd  0x88(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
movsd  0x70(%rsp),%xmm3
mov    0x48(%rsp),%edx
movsd  0x78(%rsp),%xmm4
movsd  0x80(%rsp),%xmm5
mov    $0x6,%al
call   1070 <printf@plt>
mov    $0x2,%ebp
jmp    172c <main+0x55c>
add    $0x1,%ebp
cmp    $0x4e,%ebp
je     12d0 <main+0x100>
mov    %r13,%rdi
mov    %r12,%rsi
call   10c0 <strsep@plt>
mov    %rax,%r14
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   10a0 <assert@plt>
lea    -0x31(%rbp),%eax
cmp    $0x1b,%eax
ja     1720 <main+0x550>
bt     %eax,%ebx
jae    1720 <main+0x550>
mov    %r15,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
jmp    1720 <main+0x550>
mov    0x50(%rsp),%rdi
call   1060 <fclose@plt>
mov    0x30(%rsp),%rdi
call   1060 <fclose@plt>
xor    %eax,%eax
add    $0x5b8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [16 x i8] c"hip2_sorted.dat\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [20 x i8] c"hip_main_sorted.dat\00"
@__const.main.sepHip2 = [27 x i32] [i32 6, i32 10, i32 12, i32 14, i32 28, i32 42, i32 50, i32 59, i32 68, i32 75, i32 82, i32 89, i32 96, i32 103, i32 107, i32 113, i32 116, i32 123, i32 128, i32 136, i32 143, i32 149, i32 151, i32 158, i32 164, i32 171, i32 276]
@.str.3 = [2 x i8] c"|\00"
@.str.4 = [50 x i8] c"%6d,%13.10f,%13.10f,%13.10f,%7.4f,%1d,%6.3f,%6.3f\00"
@.str.5 = [4 x i8] c",%s\00"
@.str.6 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca [27 x i32]
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i32
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca double
%21 = alloca double
%22 = alloca double
%23 = alloca double
%24 = alloca double
%25 = alloca double
%26 = alloca double
%27 = alloca i32
%28 = alloca i32
%29 = alloca i32
%30 = alloca i32
%31 = alloca i32
store i32 0, i32* %1
%32 = call i32* @fopen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %32, i32** %2
%33 = call i32* @fopen(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %33, i32** %3
store i32 278, i32* %4
%34 = call i8* @llvm.stacksave()
store i8* %34, i8** %5
%35 = alloca i8, i64 278
store i32 27, i32* %6
%36 = bitcast [27 x i32]* %7 to i8*
store i32 1024, i32* %8
%37 = alloca i8, i64 1024
store i32 78, i32* %9
%38 = load i32*, i32** %2
%39 = icmp ne i32* %38, null
%40 = zext i1 %39 to i32
%41 = call i32 @assert(i32 %40)
%42 = load i32*, i32** %3
%43 = icmp ne i32* %42, null
%44 = zext i1 %43 to i32
%45 = call i32 @assert(i32 %44)
%46 = load i32*, i32** %3
%47 = call i8* @fgets(i8* %37, i32 1024, i32* %46)
store i8* %47, i8** %10
%48 = call i8* @strsep(i8** %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i8* %48, i8** %12
%49 = load i8*, i8** %12
%50 = icmp ne i8* %49, null
%51 = zext i1 %50 to i32
%52 = call i32 @assert(i32 %51)
%53 = call i8* @strsep(i8** %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i8* %53, i8** %12
%54 = load i8*, i8** %12
%55 = icmp ne i8* %54, null
%56 = zext i1 %55 to i32
%57 = call i32 @assert(i32 %56)
br label %58
58: ; preds = %228, %153, %0
br label %59
59: ; preds = %58
%60 = load i32*, i32** %2
%61 = call i8* @fgets(i8* %35, i32 278, i32* %60)
store i8* %61, i8** %11
%62 = load i8*, i8** %11
%63 = icmp eq i8* %62, null
br i1 %63, label %64, label %65
64: ; preds = %59
br label %230
65: ; preds = %59
store i32 0, i32* %13
br label %66
66: ; preds = %141, %65
%67 = load i32, i32* %13
%68 = icmp slt i32 %67, 27
br i1 %68, label %69, label %144
69: ; preds = %66
%70 = load i32, i32* %13
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds [27 x i32], [27 x i32]* %7, i64 0, i64 %71
%73 = load i32, i32* %72
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds i8, i8* %35, i64 %74
store i8 0, i8* %75
%76 = load i32, i32* %13
switch i32 %76, label %133 [
i32 0, label %77
i32 1, label %103
i32 3, label %106
i32 4, label %109
i32 5, label %112
i32 6, label %115
i32 11, label %118
i32 19, label %121
i32 22, label %124
i32 23, label %127
i32 25, label %130
]
77: ; preds = %69
%78 = load i8*, i8** %11
%79 = call i32 @atoi(i8* %78)
store i32 %79, i32* %27
%80 = load i32*, i32** %3
%81 = call i32 @rewind(i32* %80)
br label %82
82: ; preds = %89, %77
br label %83
83: ; preds = %82
%84 = load i8*, i8** %12
%85 = call i32 @atoi(i8* %84)
%86 = load i32, i32* %27
%87 = icmp eq i32 %85, %86
br i1 %87, label %88, label %89
88: ; preds = %83
br label %102
89: ; preds = %83
%90 = load i32*, i32** %3
%91 = call i8* @fgets(i8* %37, i32 1024, i32* %90)
store i8* %91, i8** %10
%92 = call i8* @strsep(i8** %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i8* %92, i8** %12
%93 = load i8*, i8** %12
%94 = icmp ne i8* %93, null
%95 = zext i1 %94 to i32
%96 = call i32 @assert(i32 %95)
%97 = call i8* @strsep(i8** %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i8* %97, i8** %12
%98 = load i8*, i8** %12
%99 = icmp ne i8* %98, null
%100 = zext i1 %99 to i32
%101 = call i32 @assert(i32 %100)
br label %82
102: ; preds = %88
br label %133
103: ; preds = %69
%104 = load i8*, i8** %11
%105 = call i32 @atoi(i8* %104)
store i32 %105, i32* %31
br label %133
106: ; preds = %69
%107 = load i8*, i8** %11
%108 = call i32 @atoi(i8* %107)
store i32 %108, i32* %28
br label %133
109: ; preds = %69
%110 = load i8*, i8** %11
%111 = call double @atof(i8* %110)
store double %111, double* %14
br label %133
112: ; preds = %69
%113 = load i8*, i8** %11
%114 = call double @atof(i8* %113)
store double %114, double* %15
br label %133
115: ; preds = %69
%116 = load i8*, i8** %11
%117 = call double @atof(i8* %116)
store double %117, double* %16
br label %133
118: ; preds = %69
%119 = load i8*, i8** %11
%120 = call double @atof(i8* %119)
store double %120, double* %17
br label %133
121: ; preds = %69
%122 = load i8*, i8** %11
%123 = call double @atof(i8* %122)
store double %123, double* %18
br label %133
124: ; preds = %69
%125 = load i8*, i8** %11
%126 = call i32 @atoi(i8* %125)
store i32 %126, i32* %30
br label %133
127: ; preds = %69
%128 = load i8*, i8** %11
%129 = call double @atof(i8* %128)
store double %129, double* %19
br label %133
130: ; preds = %69
%131 = load i8*, i8** %11
%132 = call double @atof(i8* %131)
store double %132, double* %20
br label %133
133: ; preds = %69, %130, %127, %124, %121, %118, %115, %112, %109, %106, %103, %102
%134 = load i32, i32* %13
%135 = sext i32 %134 to i64
%136 = getelementptr inbounds [27 x i32], [27 x i32]* %7, i64 0, i64 %135
%137 = load i32, i32* %136
%138 = add nsw i32 %137, 1
%139 = sext i32 %138 to i64
%140 = getelementptr inbounds i8, i8* %35, i64 %139
store i8* %140, i8** %11
br label %141
141: ; preds = %133
%142 = load i32, i32* %13
%143 = add nsw i32 %142, 1
store i32 %143, i32* %13
br label %66
144: ; preds = %66
%145 = load i8*, i8** %11
%146 = load i8, i8* %145
%147 = sext i8 %146 to i32
%148 = icmp eq i32 %147, 0
%149 = zext i1 %148 to i32
%150 = call i32 @assert(i32 %149)
%151 = load i32, i32* %28
%152 = icmp sgt i32 %151, 1
br i1 %152, label %153, label %154
153: ; preds = %144
br label %58
154: ; preds = %144
%155 = load double, double* %14
%156 = load double, double* %15
%157 = call i32 @cvtJ2000toGalactic(double %155, double %156, double* %21, double* %22)
%158 = load double, double* %16
%159 = load double, double* %17
%160 = fmul double 5.000000e-01, %159
%161 = fcmp olt double %158, %160
br i1 %161, label %162, label %165
162: ; preds = %154
%163 = load double, double* %17
%164 = fdiv double 1.500000e+00, %163
store double %164, double* %23
br label %168
165: ; preds = %154
%166 = load double, double* %16
%167 = fdiv double 1.000000e+00, %166
store double %167, double* %23
br label %168
168: ; preds = %165, %162
%169 = load double, double* %23
%170 = load double, double* %22
%171 = call double @cos(double %170)
%172 = fmul double %169, %171
%173 = load double, double* %21
%174 = call double @cos(double %173)
%175 = fmul double %172, %174
store double %175, double* %24
%176 = load double, double* %23
%177 = load double, double* %22
%178 = call double @cos(double %177)
%179 = fmul double %176, %178
%180 = load double, double* %21
%181 = call double @sin(double %180)
%182 = fmul double %179, %181
store double %182, double* %25
%183 = load double, double* %23
%184 = load double, double* %22
%185 = call double @sin(double %184)
%186 = fmul double %183, %185
store double %186, double* %26
%187 = load i32, i32* %27
%188 = load double, double* %24
%189 = load double, double* %25
%190 = load double, double* %26
%191 = load double, double* %18
%192 = load i32, i32* %30
%193 = load double, double* %19
%194 = load double, double* %20
%195 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.4, i64 0, i64 0), i32 %187, double %188, double %189, double %190, double %191, i32 %192, double %193, double %194)
store i32 2, i32* %29
br label %196
196: ; preds = %225, %168
%197 = load i32, i32* %29
%198 = icmp slt i32 %197, 78
br i1 %198, label %199, label %228
199: ; preds = %196
%200 = call i8* @strsep(i8** %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i8* %200, i8** %12
%201 = load i8*, i8** %12
%202 = icmp ne i8* %201, null
%203 = zext i1 %202 to i32
%204 = call i32 @assert(i32 %203)
%205 = load i32, i32* %29
switch i32 %205, label %224 [
i32 49, label %206
i32 50, label %209
i32 51, label %212
i32 52, label %215
i32 71, label %218
i32 76, label %221
]
206: ; preds = %199
%207 = load i8*, i8** %12
%208 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* %207)
br label %224
209: ; preds = %199
%210 = load i8*, i8** %12
%211 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* %210)
br label %224
212: ; preds = %199
%213 = load i8*, i8** %12
%214 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* %213)
br label %224
215: ; preds = %199
%216 = load i8*, i8** %12
%217 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* %216)
br label %224
218: ; preds = %199
%219 = load i8*, i8** %12
%220 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* %219)
br label %224
221: ; preds = %199
%222 = load i8*, i8** %12
%223 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* %222)
br label %224
224: ; preds = %199, %221, %218, %215, %212, %209, %206
br label %225
225: ; preds = %224
%226 = load i32, i32* %29
%227 = add nsw i32 %226, 1
store i32 %227, i32* %29
br label %196
228: ; preds = %196
%229 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
br label %58
230: ; preds = %64
%231 = load i32*, i32** %2
%232 = call i32 @fclose(i32* %231)
%233 = load i32*, i32** %3
%234 = call i32 @fclose(i32* %233)
store i32 0, i32* %1
%235 = load i8*, i8** %5
%236 = load i32, i32* %1
ret i32 %236
}

LLVM IR (-O2):
@.str = [16 x i8] c"hip2_sorted.dat\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [20 x i8] c"hip_main_sorted.dat\00"
@__const.main.sepHip2 = [27 x i32] [i32 6, i32 10, i32 12, i32 14, i32 28, i32 42, i32 50, i32 59, i32 68, i32 75, i32 82, i32 89, i32 96, i32 103, i32 107, i32 113, i32 116, i32 123, i32 128, i32 136, i32 143, i32 149, i32 151, i32 158, i32 164, i32 171, i32 276]
@.str.3 = [2 x i8] c"|\00"
@.str.4 = [50 x i8] c"%6d,%13.10f,%13.10f,%13.10f,%7.4f,%1d,%6.3f,%6.3f\00"
@.str.5 = [4 x i8] c",%s\00"
define i32 @main() {
%1 = alloca i8*
%2 = alloca double
%3 = alloca double
%4 = tail call i32* @fopen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32* @fopen(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%6 = alloca [278 x i8]
%7 = alloca [1024 x i8]
%8 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%9 = getelementptr inbounds [278 x i8], [278 x i8]* %6, i64 0, i64 0
%10 = bitcast i8** %1 to i8*
%11 = bitcast double* %2 to i8*
%12 = bitcast double* %3 to i8*
%13 = icmp ne i32* %4, null
%14 = zext i1 %13 to i32
%15 = tail call i32 @assert(i32 %14)
%16 = icmp ne i32* %5, null
%17 = zext i1 %16 to i32
%18 = tail call i32 @assert(i32 %17)
%19 = call i8* @fgets(i8* %8, i32 1024, i32* %5)
store i8* %19, i8** %1
%20 = call i8* @strsep(i8** %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%21 = icmp ne i8* %20, null
%22 = zext i1 %21 to i32
%23 = call i32 @assert(i32 %22)
%24 = call i8* @strsep(i8** %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%25 = icmp ne i8* %24, null
%26 = zext i1 %25 to i32
%27 = call i32 @assert(i32 %26)
%28 = call i8* @fgets(i8* %9, i32 278, i32* %4)
%29 = icmp eq i8* %28, null
br i1 %29, label %156, label %30
30: ; preds = %0
%31 = getelementptr inbounds [278 x i8], [278 x i8]* %6, i64 0, i64 277
br label %32
32: ; preds = %103, %30
%33 = phi i64 [ 0, %30 ], [ %104, %103 ]
%34 = phi i32 [ undef, %30 ], [ %97, %103 ]
%35 = phi i32 [ undef, %30 ], [ %96, %103 ]
%36 = phi i32 [ undef, %30 ], [ %95, %103 ]
%37 = phi i8* [ %28, %30 ], [ %105, %103 ]
%38 = phi i8* [ %24, %30 ], [ %106, %103 ]
%39 = phi double [ undef, %30 ], [ %93, %103 ]
%40 = phi double [ undef, %30 ], [ %92, %103 ]
%41 = phi double [ undef, %30 ], [ %91, %103 ]
%42 = phi double [ undef, %30 ], [ %90, %103 ]
%43 = phi double [ undef, %30 ], [ %89, %103 ]
%44 = phi double [ undef, %30 ], [ %88, %103 ]
%45 = phi double [ undef, %30 ], [ %87, %103 ]
%46 = getelementptr inbounds [27 x i32], [27 x i32]* @__const.main.sepHip2, i64 0, i64 %33
%47 = load i32, i32* %46
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds [278 x i8], [278 x i8]* %6, i64 0, i64 %48
store i8 0, i8* %49
%50 = trunc i64 %33 to i32
switch i32 %50, label %86 [
i32 0, label %51
i32 25, label %84
i32 3, label %68
i32 4, label %70
i32 5, label %72
i32 6, label %74
i32 11, label %76
i32 19, label %78
i32 22, label %80
i32 23, label %82
]
51: ; preds = %32
%52 = call i32 @atoi(i8* %37)
%53 = call i32 @rewind(i32* %5)
%54 = call i32 @atoi(i8* %38)
%55 = icmp eq i32 %54, %52
br i1 %55, label %86, label %56
56: ; preds = %51, %56
%57 = call i8* @fgets(i8* %8, i32 1024, i32* %5)
store i8* %57, i8** %1
%58 = call i8* @strsep(i8** %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%59 = icmp ne i8* %58, null
%60 = zext i1 %59 to i32
%61 = call i32 @assert(i32 %60)
%62 = call i8* @strsep(i8** %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%63 = icmp ne i8* %62, null
%64 = zext i1 %63 to i32
%65 = call i32 @assert(i32 %64)
%66 = call i32 @atoi(i8* %62)
%67 = icmp eq i32 %66, %52
br i1 %67, label %86, label %56
68: ; preds = %32
%69 = call i32 @atoi(i8* %37)
br label %86
70: ; preds = %32
%71 = call double @atof(i8* %37)
br label %86
72: ; preds = %32
%73 = call double @atof(i8* %37)
br label %86
74: ; preds = %32
%75 = call double @atof(i8* %37)
br label %86
76: ; preds = %32
%77 = call double @atof(i8* %37)
br label %86
78: ; preds = %32
%79 = call double @atof(i8* %37)
br label %86
80: ; preds = %32
%81 = call i32 @atoi(i8* %37)
br label %86
82: ; preds = %32
%83 = call double @atof(i8* %37)
br label %86
84: ; preds = %32
%85 = call double @atof(i8* %37)
br label %86
86: ; preds = %56, %51, %32, %84, %82, %80, %78, %76, %74, %72, %70, %68
%87 = phi double [ %45, %84 ], [ %45, %82 ], [ %45, %80 ], [ %45, %78 ], [ %45, %76 ], [ %45, %74 ], [ %45, %72 ], [ %71, %70 ], [ %45, %68 ], [ %45, %32 ], [ %45, %51 ], [ %45, %56 ]
%88 = phi double [ %44, %84 ], [ %44, %82 ], [ %44, %80 ], [ %44, %78 ], [ %44, %76 ], [ %44, %74 ], [ %73, %72 ], [ %44, %70 ], [ %44, %68 ], [ %44, %32 ], [ %44, %51 ], [ %44, %56 ]
%89 = phi double [ %43, %84 ], [ %43, %82 ], [ %43, %80 ], [ %43, %78 ], [ %43, %76 ], [ %75, %74 ], [ %43, %72 ], [ %43, %70 ], [ %43, %68 ], [ %43, %32 ], [ %43, %51 ], [ %43, %56 ]
%90 = phi double [ %42, %84 ], [ %42, %82 ], [ %42, %80 ], [ %42, %78 ], [ %77, %76 ], [ %42, %74 ], [ %42, %72 ], [ %42, %70 ], [ %42, %68 ], [ %42, %32 ], [ %42, %51 ], [ %42, %56 ]
%91 = phi double [ %41, %84 ], [ %41, %82 ], [ %41, %80 ], [ %79, %78 ], [ %41, %76 ], [ %41, %74 ], [ %41, %72 ], [ %41, %70 ], [ %41, %68 ], [ %41, %32 ], [ %41, %51 ], [ %41, %56 ]
%92 = phi double [ %40, %84 ], [ %83, %82 ], [ %40, %80 ], [ %40, %78 ], [ %40, %76 ], [ %40, %74 ], [ %40, %72 ], [ %40, %70 ], [ %40, %68 ], [ %40, %32 ], [ %40, %51 ], [ %40, %56 ]
%93 = phi double [ %85, %84 ], [ %39, %82 ], [ %39, %80 ], [ %39, %78 ], [ %39, %76 ], [ %39, %74 ], [ %39, %72 ], [ %39, %70 ], [ %39, %68 ], [ %39, %32 ], [ %39, %51 ], [ %39, %56 ]
%94 = phi i8* [ %38, %84 ], [ %38, %82 ], [ %38, %80 ], [ %38, %78 ], [ %38, %76 ], [ %38, %74 ], [ %38, %72 ], [ %38, %70 ], [ %38, %68 ], [ %38, %32 ], [ %38, %51 ], [ %62, %56 ]
%95 = phi i32 [ %36, %84 ], [ %36, %82 ], [ %36, %80 ], [ %36, %78 ], [ %36, %76 ], [ %36, %74 ], [ %36, %72 ], [ %36, %70 ], [ %36, %68 ], [ %36, %32 ], [ %52, %51 ], [ %52, %56 ]
%96 = phi i32 [ %35, %84 ], [ %35, %82 ], [ %35, %80 ], [ %35, %78 ], [ %35, %76 ], [ %35, %74 ], [ %35, %72 ], [ %35, %70 ], [ %69, %68 ], [ %35, %32 ], [ %35, %51 ], [ %35, %56 ]
%97 = phi i32 [ %34, %84 ], [ %34, %82 ], [ %81, %80 ], [ %34, %78 ], [ %34, %76 ], [ %34, %74 ], [ %34, %72 ], [ %34, %70 ], [ %34, %68 ], [ %34, %32 ], [ %34, %51 ], [ %34, %56 ]
%98 = add nsw i32 %47, 1
%99 = sext i32 %98 to i64
%100 = getelementptr inbounds [278 x i8], [278 x i8]* %6, i64 0, i64 %99
%101 = add nuw nsw i64 %33, 1
%102 = icmp eq i64 %101, 27
br i1 %102, label %107, label %103
103: ; preds = %86, %152
%104 = phi i64 [ %101, %86 ], [ 0, %152 ]
%105 = phi i8* [ %100, %86 ], [ %154, %152 ]
%106 = phi i8* [ %94, %86 ], [ %153, %152 ]
br label %32
107: ; preds = %86
%108 = load i8, i8* %31
%109 = icmp eq i8 %108, 0
%110 = zext i1 %109 to i32
%111 = call i32 @assert(i32 %110)
%112 = icmp sgt i32 %96, 1
br i1 %112, label %152, label %113
113: ; preds = %107
%114 = call i32 @cvtJ2000toGalactic(double %87, double %88, double* %2, double* %3)
%115 = fmul double %90, 5.000000e-01
%116 = fcmp olt double %89, %115
br i1 %116, label %117, label %119
117: ; preds = %113
%118 = fdiv double 1.500000e+00, %90
br label %121
119: ; preds = %113
%120 = fdiv double 1.000000e+00, %89
br label %121
121: ; preds = %119, %117
%122 = phi double [ %118, %117 ], [ %120, %119 ]
%123 = load double, double* %3
%124 = call double @cos(double %123)
%125 = fmul double %122, %124
%126 = load double, double* %2
%127 = call double @cos(double %126)
%128 = fmul double %125, %127
%129 = load double, double* %3
%130 = call double @cos(double %129)
%131 = fmul double %122, %130
%132 = load double, double* %2
%133 = call double @sin(double %132)
%134 = fmul double %131, %133
%135 = load double, double* %3
%136 = call double @sin(double %135)
%137 = fmul double %122, %136
%138 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str.4, i64 0, i64 0), i32 %95, double %128, double %134, double %137, double %91, i32 %97, double %92, double %93)
br label %139
139: ; preds = %121, %147
%140 = phi i32 [ 2, %121 ], [ %148, %147 ]
%141 = call i8* @strsep(i8** %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%142 = icmp ne i8* %141, null
%143 = zext i1 %142 to i32
%144 = call i32 @assert(i32 %143)
switch i32 %140, label %147 [
i32 49, label %145
i32 50, label %145
i32 51, label %145
i32 52, label %145
i32 71, label %145
i32 76, label %145
]
145: ; preds = %139, %139, %139, %139, %139, %139
%146 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* %141)
br label %147
147: ; preds = %145, %139
%148 = add nuw nsw i32 %140, 1
%149 = icmp eq i32 %148, 78
br i1 %149, label %150, label %139
150: ; preds = %147
%151 = call i32 @putchar(i32 10)
br label %152
152: ; preds = %150, %107
%153 = phi i8* [ %94, %107 ], [ %141, %150 ]
%154 = call i8* @fgets(i8* %9, i32 278, i32* %4)
%155 = icmp eq i8* %154, null
br i1 %155, label %156, label %103
156: ; preds = %152, %0
%157 = call i32 @fclose(i32* %4)
%158 = call i32 @fclose(i32* %5)
ret i32 0
}