#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 */
double acos(double);
double atan(double);
double cos(double);
double *dvector(int, int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ printf(char *, double, double, double, double, int, int);
int /*<<< orphan*/ rewind(int /*<<< orphan*/ *);
double sin(double);
int /*<<< orphan*/ sscanf(char *, char *, double *, double *, double *,
                          double *, double *, ...);
void readidem(char *sourceold, int *ns, double *reflat, double *reflon,
              double *refdepth, double *rake, double *strike, double **dip,
              double *oxdim, double *oydim, int *nsx, int *nsy, double *odiscx,
              double *odiscy, double **ox, double **oy, double **REslipo,
              double **rake_v, double **strike_v, double **lato, double **lono,
              double **depo) {
  FILE *fin2;
  int i, k;
  char data[256];
  double lat1, lon1, lat2, lon2, depth1, dip1;
  double pi = 4.0 * atan(1.0);
  double xref, yref, zref;
  fin2 = fopen(sourceold, "r");
  i = 0;
  while (fgets(data, 256, fin2) != NULL) {
    if (data[0] != '#') {
      i++;
    }
  }
  *ns = i;
  rewind(fin2);
  fgets(data, 256, fin2);
  *reflat = 99999.0;
  while (*reflat == 99999.0) {
    if (data[0] != '#') {
      sscanf(data, "%lf %lf %lf %*f %lf %lf %lf\n", reflat, reflon, refdepth,
             rake, strike, &dip1);
    } else {
      fgets(data, 256, fin2);
    }
  }
  rewind(fin2);
  *oxdim = 0.0;
  *oydim = 0.0;
  i = 0;
  while (fgets(data, 256, fin2) != NULL) {
    if (data[0] != '#') {
      sscanf(data, "%lf %lf %lf %*f %*f %lf %lf\n", &lat1, &lon1, &depth1,
             strike, &dip1);
      if (depth1 == *refdepth) {
        lat2 = lat1;
        lon2 = lon1;
        i++;
      } else {
        *oxdim = 180.0 / pi * 111.12 *
                 acos(sin(*reflat / 180 * pi) * sin(lat2 / 180 * pi) +
                      cos(*reflat / 180 * pi) * cos(lat2 / 180 * pi) *
                          cos((*reflon - lon2) / 180 * pi));
      }
    }
  }
  rewind(fin2);
  *nsx = i;
  *nsy = (int)*ns / (*nsx);
  *oydim = (depth1 - *refdepth) / sin(dip1 / 180 * pi);
  *odiscy = *oydim / (*nsy - 1);
  *oydim = *oydim + *odiscy;
  *odiscx = (*oxdim / (*nsx - 1));
  *oxdim = *oxdim + *odiscx;
  printf("oxdim=%lf, oydim=%lf, odiscx=%lf, odiscy=%lf, nsx=%d, nsy=%d\n",
         *oxdim, *oydim, *odiscx, *odiscy, *nsx, *nsy);
  *ox = dvector(1, *ns);
  *oy = dvector(1, *ns);
  *REslipo = dvector(1, *ns);
  *lato = dvector(1, *ns);
  *lono = dvector(1, *ns);
  *depo = dvector(1, *ns);
  *rake_v = dvector(1, *ns);
  *strike_v = dvector(1, *ns);
  *dip = dvector(1, *ns);
  i = 1;
  k = 0;
  zref = 0.0;
  xref = *reflat;
  yref = *reflon;
  while (fgets(data, 256, fin2) != NULL) {
    if (data[0] != '#') {
      sscanf(data, "%lf %lf %lf %lf %lf %lf %lf\n", &lat1, &lon1, &depth1,
             &(*REslipo)[i], &(*rake_v)[i], &(*strike_v)[i], &(*dip)[i]);
      if (depth1 > zref) {
        zref = depth1;
        k++;
        xref = lat1;
        yref = lon1;
      }
      (*oy)[i] = (k - 1) * (*odiscy);
      (*ox)[i] = 180.0 / pi * 111.12 *
                 acos(sin(xref / 180.0 * pi) * sin(lat1 / 180.0 * pi) +
                      cos(xref / 180.0 * pi) * cos(lat1 / 180.0 * pi) *
                          cos((yref - lon1) / 180.0 * pi));
      (*lato)[i] = lat1;
      (*lono)[i] = lon1;
      (*depo)[i] = depth1;
      i++;
    }
  }
  fclose(fin2);
}


x86 assembly (clang, -O0):
<readidem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x200,%rsp
mov    0x88(%rbp),%rax
mov    0x80(%rbp),%rax
mov    0x78(%rbp),%rax
mov    0x70(%rbp),%rax
mov    0x68(%rbp),%rax
mov    0x60(%rbp),%rax
mov    0x58(%rbp),%rax
mov    0x50(%rbp),%rax
mov    0x48(%rbp),%rax
mov    0x40(%rbp),%rax
mov    0x38(%rbp),%rax
mov    0x30(%rbp),%rax
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
movsd  0xde7(%rip),%xmm0
call   1090 <atan@plt>
movaps %xmm0,%xmm1
movsd  0xdcf(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x178(%rbp)
ff
mov    -0x8(%rbp),%rdi
lea    0xde0(%rip),%rsi
call   10d0 <fopen@plt>
mov    %rax,-0x38(%rbp)
movl   $0x0,-0x3c(%rbp)
lea    -0x140(%rbp),%rdi
mov    -0x38(%rbp),%rdx
mov    $0x100,%esi
call   1070 <fgets@plt>
cmp    $0x0,%rax
je     1295 <readidem+0xe5>
movsbl -0x140(%rbp),%eax
cmp    $0x23,%eax
je     1290 <readidem+0xe0>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1258 <readidem+0xa8>
mov    -0x3c(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x38(%rbp),%rdi
call   1050 <rewind@plt>
lea    -0x140(%rbp),%rdi
mov    -0x38(%rbp),%rdx
mov    $0x100,%esi
call   1070 <fgets@plt>
mov    -0x18(%rbp),%rax
movsd  0xd48(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0xd34(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1354 <readidem+0x1a4>
jp     1354 <readidem+0x1a4>
movsbl -0x140(%rbp),%eax
cmp    $0x23,%eax
je     133a <readidem+0x18a>
lea    -0x140(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
mov    0x10(%rbp),%r10
lea    0xd0c(%rip),%rsi
lea    -0x170(%rbp),%rax
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
mov    $0x0,%al
call   10a0 <sscanf@plt>
jmp    134f <readidem+0x19f>
lea    -0x140(%rbp),%rdi
mov    -0x38(%rbp),%rdx
mov    $0x100,%esi
call   1070 <fgets@plt>
jmp    12cc <readidem+0x11c>
mov    -0x38(%rbp),%rdi
call   1050 <rewind@plt>
mov    0x20(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    0x28(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
movl   $0x0,-0x3c(%rbp)
lea    -0x140(%rbp),%rdi
mov    -0x38(%rbp),%rdx
mov    $0x100,%esi
call   1070 <fgets@plt>
cmp    $0x0,%rax
je     1579 <readidem+0x3c9>
movsbl -0x140(%rbp),%eax
cmp    $0x23,%eax
je     1574 <readidem+0x3c4>
lea    -0x140(%rbp),%rdi
mov    0x10(%rbp),%r9
lea    0xc8c(%rip),%rsi
lea    -0x148(%rbp),%rdx
lea    -0x150(%rbp),%rcx
lea    -0x168(%rbp),%r8
lea    -0x170(%rbp),%rax
mov    %rax,(%rsp)
mov    $0x0,%al
call   10a0 <sscanf@plt>
movsd  -0x168(%rbp),%xmm0
ff
mov    -0x28(%rbp),%rax
ucomisd (%rax),%xmm0
jne    142c <readidem+0x27c>
jp     142c <readidem+0x27c>
movsd  -0x148(%rbp),%xmm0
ff
movsd  %xmm0,-0x158(%rbp)
ff
movsd  -0x150(%rbp),%xmm0
ff
movsd  %xmm0,-0x160(%rbp)
ff
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    156f <readidem+0x3bf>
movsd  0xbe4(%rip),%xmm0
divsd  -0x178(%rbp),%xmm0
ff
movsd  0xbdc(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x198(%rbp)
ff
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0xbb8(%rip),%xmm1
divsd  %xmm1,%xmm0
mulsd  -0x178(%rbp),%xmm0
ff
call   1080 <sin@plt>
movsd  %xmm0,-0x1a0(%rbp)
ff
movsd  -0x158(%rbp),%xmm0
ff
movsd  0xb8f(%rip),%xmm1
divsd  %xmm1,%xmm0
mulsd  -0x178(%rbp),%xmm0
ff
call   1080 <sin@plt>
movsd  %xmm0,-0x1a8(%rbp)
ff
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0xb66(%rip),%xmm1
divsd  %xmm1,%xmm0
mulsd  -0x178(%rbp),%xmm0
ff
call   10c0 <cos@plt>
movsd  %xmm0,-0x1b8(%rbp)
ff
movsd  -0x158(%rbp),%xmm0
ff
movsd  0xb3d(%rip),%xmm1
divsd  %xmm1,%xmm0
mulsd  -0x178(%rbp),%xmm0
ff
call   10c0 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x1b8(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x1b0(%rbp)
ff
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
subsd  -0x160(%rbp),%xmm0
ff
movsd  0xafd(%rip),%xmm1
divsd  %xmm1,%xmm0
mulsd  -0x178(%rbp),%xmm0
ff
call   10c0 <cos@plt>
movsd  -0x1b0(%rbp),%xmm1
ff
movsd  -0x1a8(%rbp),%xmm2
ff
movaps %xmm0,%xmm3
movsd  -0x1a0(%rbp),%xmm0
ff
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1060 <acos@plt>
movaps %xmm0,%xmm1
movsd  -0x198(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
mov    0x20(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    1574 <readidem+0x3c4>
jmp    137a <readidem+0x1ca>
mov    -0x38(%rbp),%rdi
call   1050 <rewind@plt>
mov    -0x3c(%rbp),%ecx
mov    0x30(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    0x30(%rbp),%rcx
cltd
idivl  (%rcx)
mov    %eax,%ecx
mov    0x38(%rbp),%rax
mov    %ecx,(%rax)
movsd  -0x168(%rbp),%xmm0
ff
mov    -0x28(%rbp),%rax
subsd  (%rax),%xmm0
movsd  %xmm0,-0x1c0(%rbp)
ff
movsd  -0x170(%rbp),%xmm0
ff
movsd  0xa50(%rip),%xmm1
divsd  %xmm1,%xmm0
mulsd  -0x178(%rbp),%xmm0
ff
call   1080 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x1c0(%rbp),%xmm0
ff
divsd  %xmm1,%xmm0
mov    0x28(%rbp),%rax
movsd  %xmm0,(%rax)
mov    0x28(%rbp),%rax
movsd  (%rax),%xmm0
mov    0x38(%rbp),%rax
mov    (%rax),%eax
sub    $0x1,%eax
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
mov    0x48(%rbp),%rax
movsd  %xmm0,(%rax)
mov    0x28(%rbp),%rax
movsd  (%rax),%xmm0
mov    0x48(%rbp),%rax
addsd  (%rax),%xmm0
mov    0x28(%rbp),%rax
movsd  %xmm0,(%rax)
mov    0x20(%rbp),%rax
movsd  (%rax),%xmm0
mov    0x30(%rbp),%rax
mov    (%rax),%eax
sub    $0x1,%eax
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
mov    0x40(%rbp),%rax
movsd  %xmm0,(%rax)
mov    0x20(%rbp),%rax
movsd  (%rax),%xmm0
mov    0x40(%rbp),%rax
addsd  (%rax),%xmm0
mov    0x20(%rbp),%rax
movsd  %xmm0,(%rax)
mov    0x20(%rbp),%rax
movsd  (%rax),%xmm0
mov    0x28(%rbp),%rax
movsd  (%rax),%xmm1
mov    0x40(%rbp),%rax
movsd  (%rax),%xmm2
mov    0x48(%rbp),%rax
movsd  (%rax),%xmm3
mov    0x30(%rbp),%rax
mov    (%rax),%esi
mov    0x38(%rbp),%rax
mov    (%rax),%edx
lea    0x9cf(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    $0x1,%edi
call   10b0 <dvector@plt>
mov    %rax,%rcx
mov    0x50(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    $0x1,%edi
call   10b0 <dvector@plt>
mov    %rax,%rcx
mov    0x58(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    $0x1,%edi
call   10b0 <dvector@plt>
mov    %rax,%rcx
mov    0x60(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    $0x1,%edi
call   10b0 <dvector@plt>
mov    %rax,%rcx
mov    0x78(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    $0x1,%edi
call   10b0 <dvector@plt>
mov    %rax,%rcx
mov    0x80(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    $0x1,%edi
call   10b0 <dvector@plt>
mov    %rax,%rcx
mov    0x88(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    $0x1,%edi
call   10b0 <dvector@plt>
mov    %rax,%rcx
mov    0x68(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    $0x1,%edi
call   10b0 <dvector@plt>
mov    %rax,%rcx
mov    0x70(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    $0x1,%edi
call   10b0 <dvector@plt>
mov    %rax,%rcx
mov    0x18(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x1,-0x3c(%rbp)
movl   $0x0,-0x40(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x190(%rbp)
ff
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x180(%rbp)
ff
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x188(%rbp)
ff
lea    -0x140(%rbp),%rdi
mov    -0x38(%rbp),%rdx
mov    $0x100,%esi
call   1070 <fgets@plt>
cmp    $0x0,%rax
je     1a8a <readidem+0x8da>
movsbl -0x140(%rbp),%eax
cmp    $0x23,%eax
je     1a85 <readidem+0x8d5>
lea    -0x140(%rbp),%rdi
mov    0x60(%rbp),%rax
mov    (%rax),%r9
movslq -0x3c(%rbp),%rax
shl    $0x3,%rax
add    %rax,%r9
mov    0x68(%rbp),%rax
mov    (%rax),%r11
movslq -0x3c(%rbp),%rax
shl    $0x3,%rax
add    %rax,%r11
mov    0x70(%rbp),%rax
mov    (%rax),%r10
movslq -0x3c(%rbp),%rax
shl    $0x3,%rax
add    %rax,%r10
mov    0x18(%rbp),%rax
mov    (%rax),%rax
movslq -0x3c(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
lea    0x85a(%rip),%rsi
lea    -0x148(%rbp),%rdx
lea    -0x150(%rbp),%rcx
lea    -0x168(%rbp),%r8
mov    %r11,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
mov    $0x0,%al
call   10a0 <sscanf@plt>
movsd  -0x168(%rbp),%xmm0
ff
ucomisd -0x190(%rbp),%xmm0
ff
jbe    18c1 <readidem+0x711>
movsd  -0x168(%rbp),%xmm0
ff
movsd  %xmm0,-0x190(%rbp)
ff
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
movsd  -0x148(%rbp),%xmm0
ff
movsd  %xmm0,-0x180(%rbp)
ff
movsd  -0x150(%rbp),%xmm0
ff
movsd  %xmm0,-0x188(%rbp)
ff
mov    -0x40(%rbp),%eax
sub    $0x1,%eax
cvtsi2sd %eax,%xmm0
mov    0x48(%rbp),%rax
mulsd  (%rax),%xmm0
mov    0x58(%rbp),%rax
mov    (%rax),%rax
movslq -0x3c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  0x72d(%rip),%xmm0
divsd  -0x178(%rbp),%xmm0
ff
movsd  0x725(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x1c8(%rbp)
ff
movsd  -0x180(%rbp),%xmm0
ff
movsd  0x701(%rip),%xmm1
divsd  %xmm1,%xmm0
mulsd  -0x178(%rbp),%xmm0
ff
call   1080 <sin@plt>
movsd  %xmm0,-0x1d0(%rbp)
ff
movsd  -0x148(%rbp),%xmm0
ff
movsd  0x6d8(%rip),%xmm1
divsd  %xmm1,%xmm0
mulsd  -0x178(%rbp),%xmm0
ff
call   1080 <sin@plt>
movsd  %xmm0,-0x1d8(%rbp)
ff
movsd  -0x180(%rbp),%xmm0
ff
movsd  0x6af(%rip),%xmm1
divsd  %xmm1,%xmm0
mulsd  -0x178(%rbp),%xmm0
ff
call   10c0 <cos@plt>
movsd  %xmm0,-0x1e8(%rbp)
ff
movsd  -0x148(%rbp),%xmm0
ff
movsd  0x686(%rip),%xmm1
divsd  %xmm1,%xmm0
mulsd  -0x178(%rbp),%xmm0
ff
call   10c0 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x1e8(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x1e0(%rbp)
ff
movsd  -0x188(%rbp),%xmm0
ff
subsd  -0x150(%rbp),%xmm0
ff
movsd  0x646(%rip),%xmm1
divsd  %xmm1,%xmm0
mulsd  -0x178(%rbp),%xmm0
ff
call   10c0 <cos@plt>
movsd  -0x1e0(%rbp),%xmm1
ff
movsd  -0x1d8(%rbp),%xmm2
ff
movaps %xmm0,%xmm3
movsd  -0x1d0(%rbp),%xmm0
ff
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1060 <acos@plt>
movaps %xmm0,%xmm1
movsd  -0x1c8(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
mov    0x50(%rbp),%rax
mov    (%rax),%rax
movslq -0x3c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x148(%rbp),%xmm0
ff
mov    0x78(%rbp),%rax
mov    (%rax),%rax
movslq -0x3c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x150(%rbp),%xmm0
ff
mov    0x80(%rbp),%rax
mov    (%rax),%rax
movslq -0x3c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x168(%rbp),%xmm0
ff
mov    0x88(%rbp),%rax
mov    (%rax),%rax
movslq -0x3c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    17c3 <readidem+0x613>
mov    -0x38(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x200,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readidem>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x178,%rsp
mov    %r9,%r12
mov    %r8,0x10(%rsp)
mov    %rcx,0x20(%rsp)
mov    %rdx,%r15
mov    %rsi,0x58(%rsp)
mov    %rdi,%rbx
movsd  0xe1f(%rip),%xmm0
call   1090 <atan@plt>
lea    0xe3b(%rip),%rsi
mov    %rbx,%rdi
call   10d0 <fopen@plt>
mov    %rax,%r13
lea    0x70(%rsp),%rdi
mov    $0x100,%esi
mov    %rax,%rdx
call   1070 <fgets@plt>
xor    %ebx,%ebx
test   %rax,%rax
je     1241 <readidem+0x91>
lea    0x70(%rsp),%rbp
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
cmpb   $0x23,0x70(%rsp)
setne  %al
add    %eax,%ebx
mov    %rbp,%rdi
mov    $0x100,%esi
mov    %r13,%rdx
call   1070 <fgets@plt>
test   %rax,%rax
jne    1220 <readidem+0x70>
mov    0x58(%rsp),%rax
mov    %ebx,(%rax)
mov    %r13,%rdi
call   1050 <rewind@plt>
lea    0x70(%rsp),%rbp
mov    %rbp,%rdi
mov    $0x100,%esi
mov    %r13,%rdx
call   1070 <fgets@plt>
movabs $0x40f869f000000000,%rax
69 f8 40
mov    %rax,(%r15)
lea    0xdb1(%rip),%r14
jmp    12a1 <readidem+0xf1>
nopl   0x0(%rax,%rax,1)
mov    %rbp,%rdi
mov    $0x100,%esi
mov    %r13,%rdx
call   1070 <fgets@plt>
movsd  (%r15),%xmm0
ucomisd 0xd6b(%rip),%xmm0
jne    12d8 <readidem+0x128>
jp     12d8 <readidem+0x128>
cmpb   $0x23,0x70(%rsp)
je     1280 <readidem+0xd0>
mov    %rbp,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
mov    0x20(%rsp),%rcx
mov    0x10(%rsp),%r8
mov    %r12,%r9
xor    %eax,%eax
lea    0x60(%rsp),%rbx
push   %rbx
push   0x1b8(%rsp)
call   10a0 <sscanf@plt>
add    $0x10,%rsp
jmp    1290 <readidem+0xe0>
mov    %r13,%rdi
call   1050 <rewind@plt>
mov    0x1c0(%rsp),%rax
movq   $0x0,(%rax)
mov    0x1c8(%rsp),%rax
movq   $0x0,(%rax)
lea    0x70(%rsp),%rdi
mov    $0x100,%esi
mov    %r13,%rdx
call   1070 <fgets@plt>
test   %rax,%rax
je     149b <readidem+0x2eb>
lea    0x70(%rsp),%r12
lea    0x28(%rsp),%r14
xor    %ebp,%ebp
jmp    1425 <readidem+0x275>
movsd  (%r15),%xmm0
movsd  0xcd9(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xcd5(%rip),%xmm1
mulsd  %xmm1,%xmm0
call   1080 <sin@plt>
movsd  %xmm0,0x40(%rsp)
movsd  0x48(%rsp),%xmm0
divsd  0xcb0(%rip),%xmm0
mulsd  0xcb0(%rip),%xmm0
movsd  %xmm0,0x50(%rsp)
call   1080 <sin@plt>
movsd  %xmm0,0x38(%rsp)
movsd  (%r15),%xmm0
divsd  0xc8a(%rip),%xmm0
mulsd  0xc8a(%rip),%xmm0
call   10c0 <cos@plt>
movsd  %xmm0,0x68(%rsp)
movsd  0x50(%rsp),%xmm0
call   10c0 <cos@plt>
mulsd  0x68(%rsp),%xmm0
movsd  %xmm0,0x50(%rsp)
mov    0x20(%rsp),%rax
movsd  (%rax),%xmm0
subsd  0x8(%rsp),%xmm0
divsd  0xc49(%rip),%xmm0
mulsd  0xc49(%rip),%xmm0
call   10c0 <cos@plt>
mulsd  0x50(%rsp),%xmm0
movsd  0x38(%rsp),%xmm1
mulsd  0x40(%rsp),%xmm1
addsd  %xmm1,%xmm0
call   1060 <acos@plt>
mulsd  0xc29(%rip),%xmm0
mov    0x1c0(%rsp),%rax
movsd  %xmm0,(%rax)
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r12,%rdi
mov    $0x100,%esi
mov    %r13,%rdx
call   1070 <fgets@plt>
test   %rax,%rax
je     149d <readidem+0x2ed>
cmpb   $0x23,0x70(%rsp)
je     1410 <readidem+0x260>
sub    $0x8,%rsp
mov    %r12,%rdi
lea    0xc0d(%rip),%rsi
lea    0x20(%rsp),%rdx
lea    0x38(%rsp),%rcx
mov    %r14,%r8
mov    0x1b8(%rsp),%r9
xor    %eax,%eax
lea    0x68(%rsp),%rbx
push   %rbx
call   10a0 <sscanf@plt>
add    $0x10,%rsp
movsd  0x28(%rsp),%xmm0
mov    0x10(%rsp),%rax
ucomisd (%rax),%xmm0
jne    132a <readidem+0x17a>
jp     132a <readidem+0x17a>
movsd  0x18(%rsp),%xmm0
movsd  %xmm0,0x48(%rsp)
movsd  0x30(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
add    $0x1,%ebp
jmp    1410 <readidem+0x260>
xor    %ebp,%ebp
mov    %r13,%rdi
call   1050 <rewind@plt>
mov    0x1d0(%rsp),%r14
mov    %ebp,(%r14)
mov    0x58(%rsp),%rbx
mov    (%rbx),%eax
cltd
idiv   %ebp
mov    0x1d8(%rsp),%rbp
mov    %eax,0x0(%rbp)
movsd  0x28(%rsp),%xmm0
mov    0x10(%rsp),%rax
subsd  (%rax),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x60(%rsp),%xmm0
divsd  0xb28(%rip),%xmm0
mulsd  0xb28(%rip),%xmm0
call   1080 <sin@plt>
movsd  0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
mov    0x1c8(%rsp),%rdi
movsd  %xmm1,(%rdi)
mov    0x0(%rbp),%edx
lea    -0x1(%rdx),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
divsd  %xmm0,%xmm1
mov    0x1e8(%rsp),%rcx
movsd  %xmm1,(%rcx)
addsd  (%rdi),%xmm1
movsd  %xmm1,(%rdi)
mov    0x1c0(%rsp),%rbp
movsd  0x0(%rbp),%xmm0
mov    (%r14),%esi
lea    -0x1(%rsi),%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
mov    0x1e0(%rsp),%rax
movsd  %xmm0,(%rax)
addsd  0x0(%rbp),%xmm0
movsd  %xmm0,0x0(%rbp)
movsd  (%rdi),%xmm1
movsd  (%rax),%xmm2
movsd  (%rcx),%xmm3
lea    0xaed(%rip),%rdi
call   1040 <printf@plt>
mov    (%rbx),%esi
mov    $0x1,%r14d
mov    $0x1,%edi
call   10b0 <dvector@plt>
mov    0x1f0(%rsp),%rcx
mov    %rax,(%rcx)
mov    (%rbx),%esi
mov    $0x1,%edi
call   10b0 <dvector@plt>
mov    0x1f8(%rsp),%rcx
mov    %rax,(%rcx)
mov    (%rbx),%esi
mov    $0x1,%edi
call   10b0 <dvector@plt>
mov    0x200(%rsp),%rcx
mov    %rax,(%rcx)
mov    (%rbx),%esi
mov    $0x1,%edi
call   10b0 <dvector@plt>
mov    0x218(%rsp),%rcx
mov    %rax,(%rcx)
mov    (%rbx),%esi
mov    $0x1,%edi
call   10b0 <dvector@plt>
mov    0x220(%rsp),%rcx
mov    %rax,(%rcx)
mov    (%rbx),%esi
mov    $0x1,%edi
call   10b0 <dvector@plt>
mov    0x228(%rsp),%rcx
mov    %rax,(%rcx)
mov    (%rbx),%esi
mov    $0x1,%edi
call   10b0 <dvector@plt>
mov    0x208(%rsp),%rcx
mov    %rax,(%rcx)
mov    (%rbx),%esi
mov    $0x1,%edi
call   10b0 <dvector@plt>
mov    0x210(%rsp),%rcx
mov    %rax,(%rcx)
mov    (%rbx),%esi
mov    $0x1,%edi
call   10b0 <dvector@plt>
mov    0x1b8(%rsp),%rcx
mov    %rax,(%rcx)
movsd  (%r15),%xmm0
movsd  %xmm0,0x48(%rsp)
mov    0x20(%rsp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,0x40(%rsp)
lea    0x70(%rsp),%rdi
mov    $0x100,%esi
mov    %r13,%rdx
call   1070 <fgets@plt>
test   %rax,%rax
je     18b7 <readidem+0x707>
xorps  %xmm0,%xmm0
movsd  %xmm0,0x38(%rsp)
lea    0x70(%rsp),%r12
xor    %r15d,%r15d
jmp    1827 <readidem+0x677>
nopl   0x0(%rax)
add    $0x1,%r15d
movsd  0x18(%rsp),%xmm1
movsd  0x30(%rsp),%xmm2
movsd  %xmm2,0x40(%rsp)
movsd  %xmm0,0x38(%rsp)
lea    -0x1(%r15),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mov    0x1e8(%rsp),%rax
mulsd  (%rax),%xmm0
mov    0x1f8(%rsp),%rax
mov    (%rax),%rax
movsd  %xmm0,(%rax,%r14,8)
movsd  %xmm1,0x48(%rsp)
movsd  0x91e(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0x91a(%rip),%xmm0
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
movapd %xmm1,%xmm0
call   1080 <sin@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x18(%rsp),%xmm0
divsd  0x8eb(%rip),%xmm0
mulsd  0x8eb(%rip),%xmm0
call   1080 <sin@plt>
movsd  %xmm0,0x20(%rsp)
movsd  0x8(%rsp),%xmm0
call   10c0 <cos@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x18(%rsp),%xmm0
divsd  0x8b9(%rip),%xmm0
mulsd  0x8b9(%rip),%xmm0
call   10c0 <cos@plt>
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x40(%rsp),%xmm0
subsd  0x30(%rsp),%xmm0
divsd  0x88c(%rip),%xmm0
mulsd  0x88c(%rip),%xmm0
call   10c0 <cos@plt>
mulsd  0x8(%rsp),%xmm0
movsd  0x20(%rsp),%xmm1
mulsd  0x10(%rsp),%xmm1
addsd  %xmm1,%xmm0
call   1060 <acos@plt>
mulsd  0x86c(%rip),%xmm0
mov    0x1f0(%rsp),%rax
mov    (%rax),%rax
movsd  %xmm0,(%rax,%r14,8)
movsd  0x18(%rsp),%xmm0
mov    0x218(%rsp),%rax
mov    (%rax),%rax
movsd  %xmm0,(%rax,%r14,8)
movsd  0x30(%rsp),%xmm0
mov    0x220(%rsp),%rax
mov    (%rax),%rax
movsd  %xmm0,(%rax,%r14,8)
movsd  0x28(%rsp),%xmm0
mov    0x228(%rsp),%rax
mov    (%rax),%rax
movsd  %xmm0,(%rax,%r14,8)
add    $0x1,%r14d
mov    %r12,%rdi
mov    $0x100,%esi
mov    %r13,%rdx
call   1070 <fgets@plt>
test   %rax,%rax
je     18b7 <readidem+0x707>
cmpb   $0x23,0x70(%rsp)
je     180e <readidem+0x65e>
movslq %r14d,%r14
lea    0x0(,%r14,8),%rbx
mov    0x200(%rsp),%rax
mov    (%rax),%r9
add    %rbx,%r9
mov    0x208(%rsp),%rax
mov    (%rax),%r10
add    %rbx,%r10
mov    0x210(%rsp),%rax
mov    (%rax),%rbp
add    %rbx,%rbp
mov    0x1b8(%rsp),%rax
add    (%rax),%rbx
sub    $0x8,%rsp
mov    %r12,%rdi
lea    0x826(%rip),%rsi
lea    0x20(%rsp),%rdx
lea    0x38(%rsp),%rcx
lea    0x30(%rsp),%r8
xor    %eax,%eax
push   %rbx
push   %rbp
push   %r10
call   10a0 <sscanf@plt>
add    $0x20,%rsp
movsd  0x28(%rsp),%xmm0
ucomisd 0x38(%rsp),%xmm0
ja     16a0 <readidem+0x4f0>
movsd  0x48(%rsp),%xmm1
jmp    16bc <readidem+0x50c>
mov    %r13,%rdi
call   1030 <fclose@plt>
add    $0x178,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@.str.1 = [29 x i8] c"%lf %lf %lf %*f %lf %lf %lf\0A\00"
@.str.2 = [29 x i8] c"%lf %lf %lf %*f %*f %lf %lf\0A\00"
@.str.3 = [62 x i8] c"oxdim=%lf, oydim=%lf, odiscx=%lf, odiscy=%lf, nsx=%d, nsy=%d\0A\00"
@.str.4 = [29 x i8] c"%lf %lf %lf %lf %lf %lf %lf\0A\00"
define void @readidem(i8* %0, i32* %1, double* %2, double* %3, double* %4, double* %5, double* %6, double** %7, double* %8, double* %9, i32* %10, i32* %11, double* %12, double* %13, double** %14, double** %15, double** %16, double** %17, double** %18, double** %19, double** %20, double** %21) {
%23 = alloca i8*
%24 = alloca i32*
%25 = alloca double*
%26 = alloca double*
%27 = alloca double*
%28 = alloca double*
%29 = alloca double*
%30 = alloca double**
%31 = alloca double*
%32 = alloca double*
%33 = alloca i32*
%34 = alloca i32*
%35 = alloca double*
%36 = alloca double*
%37 = alloca double**
%38 = alloca double**
%39 = alloca double**
%40 = alloca double**
%41 = alloca double**
%42 = alloca double**
%43 = alloca double**
%44 = alloca double**
%45 = alloca i32*
%46 = alloca i32
%47 = alloca i32
%48 = alloca [256 x i8]
%49 = alloca double
%50 = alloca double
%51 = alloca double
%52 = alloca double
%53 = alloca double
%54 = alloca double
%55 = alloca double
%56 = alloca double
%57 = alloca double
%58 = alloca double
store i8* %0, i8** %23
store i32* %1, i32** %24
store double* %2, double** %25
store double* %3, double** %26
store double* %4, double** %27
store double* %5, double** %28
store double* %6, double** %29
store double** %7, double*** %30
store double* %8, double** %31
store double* %9, double** %32
store i32* %10, i32** %33
store i32* %11, i32** %34
store double* %12, double** %35
store double* %13, double** %36
store double** %14, double*** %37
store double** %15, double*** %38
store double** %16, double*** %39
store double** %17, double*** %40
store double** %18, double*** %41
store double** %19, double*** %42
store double** %20, double*** %43
store double** %21, double*** %44
%59 = call double @atan(double 1.000000e+00)
%60 = fmul double 4.000000e+00, %59
store double %60, double* %55
%61 = load i8*, i8** %23
%62 = call i32* @fopen(i8* %61, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %62, i32** %45
store i32 0, i32* %46
br label %63
63: ; preds = %76, %22
%64 = getelementptr inbounds [256 x i8], [256 x i8]* %48, i64 0, i64 0
%65 = load i32*, i32** %45
%66 = call i32* @fgets(i8* %64, i32 256, i32* %65)
%67 = icmp ne i32* %66, null
br i1 %67, label %68, label %77
68: ; preds = %63
%69 = getelementptr inbounds [256 x i8], [256 x i8]* %48, i64 0, i64 0
%70 = load i8, i8* %69
%71 = sext i8 %70 to i32
%72 = icmp ne i32 %71, 35
br i1 %72, label %73, label %76
73: ; preds = %68
%74 = load i32, i32* %46
%75 = add nsw i32 %74, 1
store i32 %75, i32* %46
br label %76
76: ; preds = %73, %68
br label %63
77: ; preds = %63
%78 = load i32, i32* %46
%79 = load i32*, i32** %24
store i32 %78, i32* %79
%80 = load i32*, i32** %45
%81 = call i32 @rewind(i32* %80)
%82 = getelementptr inbounds [256 x i8], [256 x i8]* %48, i64 0, i64 0
%83 = load i32*, i32** %45
%84 = call i32* @fgets(i8* %82, i32 256, i32* %83)
%85 = load double*, double** %25
store double 9.999900e+04, double* %85
br label %86
86: ; preds = %107, %77
%87 = load double*, double** %25
%88 = load double, double* %87
%89 = fcmp oeq double %88, 9.999900e+04
br i1 %89, label %90, label %108
90: ; preds = %86
%91 = getelementptr inbounds [256 x i8], [256 x i8]* %48, i64 0, i64 0
%92 = load i8, i8* %91
%93 = sext i8 %92 to i32
%94 = icmp ne i32 %93, 35
br i1 %94, label %95, label %103
95: ; preds = %90
%96 = getelementptr inbounds [256 x i8], [256 x i8]* %48, i64 0, i64 0
%97 = load double*, double** %25
%98 = load double*, double** %26
%99 = load double*, double** %27
%100 = load double*, double** %28
%101 = load double*, double** %29
%102 = call i32 (i8*, i8*, double*, double*, double*, double*, double*, ...) @sscanf(i8* %96, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), double* %97, double* %98, double* %99, double* %100, double* %101, double* %54)
br label %107
103: ; preds = %90
%104 = getelementptr inbounds [256 x i8], [256 x i8]* %48, i64 0, i64 0
%105 = load i32*, i32** %45
%106 = call i32* @fgets(i8* %104, i32 256, i32* %105)
br label %107
107: ; preds = %103, %95
br label %86
108: ; preds = %86
%109 = load i32*, i32** %45
%110 = call i32 @rewind(i32* %109)
%111 = load double*, double** %31
store double 0.000000e+00, double* %111
%112 = load double*, double** %32
store double 0.000000e+00, double* %112
store i32 0, i32* %46
br label %113
113: ; preds = %177, %108
%114 = getelementptr inbounds [256 x i8], [256 x i8]* %48, i64 0, i64 0
%115 = load i32*, i32** %45
%116 = call i32* @fgets(i8* %114, i32 256, i32* %115)
%117 = icmp ne i32* %116, null
br i1 %117, label %118, label %178
118: ; preds = %113
%119 = getelementptr inbounds [256 x i8], [256 x i8]* %48, i64 0, i64 0
%120 = load i8, i8* %119
%121 = sext i8 %120 to i32
%122 = icmp ne i32 %121, 35
br i1 %122, label %123, label %177
123: ; preds = %118
%124 = getelementptr inbounds [256 x i8], [256 x i8]* %48, i64 0, i64 0
%125 = load double*, double** %29
%126 = call i32 (i8*, i8*, double*, double*, double*, double*, double*, ...) @sscanf(i8* %124, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), double* %49, double* %50, double* %53, double* %125, double* %54)
%127 = load double, double* %53
%128 = load double*, double** %27
%129 = load double, double* %128
%130 = fcmp oeq double %127, %129
br i1 %130, label %131, label %136
131: ; preds = %123
%132 = load double, double* %49
store double %132, double* %51
%133 = load double, double* %50
store double %133, double* %52
%134 = load i32, i32* %46
%135 = add nsw i32 %134, 1
store i32 %135, i32* %46
br label %176
136: ; preds = %123
%137 = load double, double* %55
%138 = fdiv double 1.800000e+02, %137
%139 = fmul double %138, 1.111200e+02
%140 = load double*, double** %25
%141 = load double, double* %140
%142 = fdiv double %141, 1.800000e+02
%143 = load double, double* %55
%144 = fmul double %142, %143
%145 = call double @sin(double %144)
%146 = load double, double* %51
%147 = fdiv double %146, 1.800000e+02
%148 = load double, double* %55
%149 = fmul double %147, %148
%150 = call double @sin(double %149)
%151 = load double*, double** %25
%152 = load double, double* %151
%153 = fdiv double %152, 1.800000e+02
%154 = load double, double* %55
%155 = fmul double %153, %154
%156 = call double @cos(double %155)
%157 = load double, double* %51
%158 = fdiv double %157, 1.800000e+02
%159 = load double, double* %55
%160 = fmul double %158, %159
%161 = call double @cos(double %160)
%162 = fmul double %156, %161
%163 = load double*, double** %26
%164 = load double, double* %163
%165 = load double, double* %52
%166 = fsub double %164, %165
%167 = fdiv double %166, 1.800000e+02
%168 = load double, double* %55
%169 = fmul double %167, %168
%170 = call double @cos(double %169)
%171 = fmul double %162, %170
%172 = call double @llvm.fmuladd.f64(double %145, double %150, double %171)
%173 = call double @acos(double %172)
%174 = fmul double %139, %173
%175 = load double*, double** %31
store double %174, double* %175
br label %176
176: ; preds = %136, %131
br label %177
177: ; preds = %176, %118
br label %113
178: ; preds = %113
%179 = load i32*, i32** %45
%180 = call i32 @rewind(i32* %179)
%181 = load i32, i32* %46
%182 = load i32*, i32** %33
store i32 %181, i32* %182
%183 = load i32*, i32** %24
%184 = load i32, i32* %183
%185 = load i32*, i32** %33
%186 = load i32, i32* %185
%187 = sdiv i32 %184, %186
%188 = load i32*, i32** %34
store i32 %187, i32* %188
%189 = load double, double* %53
%190 = load double*, double** %27
%191 = load double, double* %190
%192 = fsub double %189, %191
%193 = load double, double* %54
%194 = fdiv double %193, 1.800000e+02
%195 = load double, double* %55
%196 = fmul double %194, %195
%197 = call double @sin(double %196)
%198 = fdiv double %192, %197
%199 = load double*, double** %32
store double %198, double* %199
%200 = load double*, double** %32
%201 = load double, double* %200
%202 = load i32*, i32** %34
%203 = load i32, i32* %202
%204 = sub nsw i32 %203, 1
%205 = sitofp i32 %204 to double
%206 = fdiv double %201, %205
%207 = load double*, double** %36
store double %206, double* %207
%208 = load double*, double** %32
%209 = load double, double* %208
%210 = load double*, double** %36
%211 = load double, double* %210
%212 = fadd double %209, %211
%213 = load double*, double** %32
store double %212, double* %213
%214 = load double*, double** %31
%215 = load double, double* %214
%216 = load i32*, i32** %33
%217 = load i32, i32* %216
%218 = sub nsw i32 %217, 1
%219 = sitofp i32 %218 to double
%220 = fdiv double %215, %219
%221 = load double*, double** %35
store double %220, double* %221
%222 = load double*, double** %31
%223 = load double, double* %222
%224 = load double*, double** %35
%225 = load double, double* %224
%226 = fadd double %223, %225
%227 = load double*, double** %31
store double %226, double* %227
%228 = load double*, double** %31
%229 = load double, double* %228
%230 = load double*, double** %32
%231 = load double, double* %230
%232 = load double*, double** %35
%233 = load double, double* %232
%234 = load double*, double** %36
%235 = load double, double* %234
%236 = load i32*, i32** %33
%237 = load i32, i32* %236
%238 = load i32*, i32** %34
%239 = load i32, i32* %238
%240 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.3, i64 0, i64 0), double %229, double %231, double %233, double %235, i32 %237, i32 %239)
%241 = load i32*, i32** %24
%242 = load i32, i32* %241
%243 = call double* @dvector(i32 1, i32 %242)
%244 = load double**, double*** %37
store double* %243, double** %244
%245 = load i32*, i32** %24
%246 = load i32, i32* %245
%247 = call double* @dvector(i32 1, i32 %246)
%248 = load double**, double*** %38
store double* %247, double** %248
%249 = load i32*, i32** %24
%250 = load i32, i32* %249
%251 = call double* @dvector(i32 1, i32 %250)
%252 = load double**, double*** %39
store double* %251, double** %252
%253 = load i32*, i32** %24
%254 = load i32, i32* %253
%255 = call double* @dvector(i32 1, i32 %254)
%256 = load double**, double*** %42
store double* %255, double** %256
%257 = load i32*, i32** %24
%258 = load i32, i32* %257
%259 = call double* @dvector(i32 1, i32 %258)
%260 = load double**, double*** %43
store double* %259, double** %260
%261 = load i32*, i32** %24
%262 = load i32, i32* %261
%263 = call double* @dvector(i32 1, i32 %262)
%264 = load double**, double*** %44
store double* %263, double** %264
%265 = load i32*, i32** %24
%266 = load i32, i32* %265
%267 = call double* @dvector(i32 1, i32 %266)
%268 = load double**, double*** %40
store double* %267, double** %268
%269 = load i32*, i32** %24
%270 = load i32, i32* %269
%271 = call double* @dvector(i32 1, i32 %270)
%272 = load double**, double*** %41
store double* %271, double** %272
%273 = load i32*, i32** %24
%274 = load i32, i32* %273
%275 = call double* @dvector(i32 1, i32 %274)
%276 = load double**, double*** %30
store double* %275, double** %276
store i32 1, i32* %46
store i32 0, i32* %47
store double 0.000000e+00, double* %58
%277 = load double*, double** %25
%278 = load double, double* %277
store double %278, double* %56
%279 = load double*, double** %26
%280 = load double, double* %279
store double %280, double* %57
br label %281
281: ; preds = %395, %178
%282 = getelementptr inbounds [256 x i8], [256 x i8]* %48, i64 0, i64 0
%283 = load i32*, i32** %45
%284 = call i32* @fgets(i8* %282, i32 256, i32* %283)
%285 = icmp ne i32* %284, null
br i1 %285, label %286, label %396
286: ; preds = %281
%287 = getelementptr inbounds [256 x i8], [256 x i8]* %48, i64 0, i64 0
%288 = load i8, i8* %287
%289 = sext i8 %288 to i32
%290 = icmp ne i32 %289, 35
br i1 %290, label %291, label %395
291: ; preds = %286
%292 = getelementptr inbounds [256 x i8], [256 x i8]* %48, i64 0, i64 0
%293 = load double**, double*** %39
%294 = load double*, double** %293
%295 = load i32, i32* %46
%296 = sext i32 %295 to i64
%297 = getelementptr inbounds double, double* %294, i64 %296
%298 = load double**, double*** %40
%299 = load double*, double** %298
%300 = load i32, i32* %46
%301 = sext i32 %300 to i64
%302 = getelementptr inbounds double, double* %299, i64 %301
%303 = load double**, double*** %41
%304 = load double*, double** %303
%305 = load i32, i32* %46
%306 = sext i32 %305 to i64
%307 = getelementptr inbounds double, double* %304, i64 %306
%308 = load double**, double*** %30
%309 = load double*, double** %308
%310 = load i32, i32* %46
%311 = sext i32 %310 to i64
%312 = getelementptr inbounds double, double* %309, i64 %311
%313 = call i32 (i8*, i8*, double*, double*, double*, double*, double*, ...) @sscanf(i8* %292, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), double* %49, double* %50, double* %53, double* %297, double* %302, double* %307, double* %312)
%314 = load double, double* %53
%315 = load double, double* %58
%316 = fcmp ogt double %314, %315
br i1 %316, label %317, label %323
317: ; preds = %291
%318 = load double, double* %53
store double %318, double* %58
%319 = load i32, i32* %47
%320 = add nsw i32 %319, 1
store i32 %320, i32* %47
%321 = load double, double* %49
store double %321, double* %56
%322 = load double, double* %50
store double %322, double* %57
br label %323
323: ; preds = %317, %291
%324 = load i32, i32* %47
%325 = sub nsw i32 %324, 1
%326 = sitofp i32 %325 to double
%327 = load double*, double** %36
%328 = load double, double* %327
%329 = fmul double %326, %328
%330 = load double**, double*** %38
%331 = load double*, double** %330
%332 = load i32, i32* %46
%333 = sext i32 %332 to i64
%334 = getelementptr inbounds double, double* %331, i64 %333
store double %329, double* %334
%335 = load double, double* %55
%336 = fdiv double 1.800000e+02, %335
%337 = fmul double %336, 1.111200e+02
%338 = load double, double* %56
%339 = fdiv double %338, 1.800000e+02
%340 = load double, double* %55
%341 = fmul double %339, %340
%342 = call double @sin(double %341)
%343 = load double, double* %49
%344 = fdiv double %343, 1.800000e+02
%345 = load double, double* %55
%346 = fmul double %344, %345
%347 = call double @sin(double %346)
%348 = load double, double* %56
%349 = fdiv double %348, 1.800000e+02
%350 = load double, double* %55
%351 = fmul double %349, %350
%352 = call double @cos(double %351)
%353 = load double, double* %49
%354 = fdiv double %353, 1.800000e+02
%355 = load double, double* %55
%356 = fmul double %354, %355
%357 = call double @cos(double %356)
%358 = fmul double %352, %357
%359 = load double, double* %57
%360 = load double, double* %50
%361 = fsub double %359, %360
%362 = fdiv double %361, 1.800000e+02
%363 = load double, double* %55
%364 = fmul double %362, %363
%365 = call double @cos(double %364)
%366 = fmul double %358, %365
%367 = call double @llvm.fmuladd.f64(double %342, double %347, double %366)
%368 = call double @acos(double %367)
%369 = fmul double %337, %368
%370 = load double**, double*** %37
%371 = load double*, double** %370
%372 = load i32, i32* %46
%373 = sext i32 %372 to i64
%374 = getelementptr inbounds double, double* %371, i64 %373
store double %369, double* %374
%375 = load double, double* %49
%376 = load double**, double*** %42
%377 = load double*, double** %376
%378 = load i32, i32* %46
%379 = sext i32 %378 to i64
%380 = getelementptr inbounds double, double* %377, i64 %379
store double %375, double* %380
%381 = load double, double* %50
%382 = load double**, double*** %43
%383 = load double*, double** %382
%384 = load i32, i32* %46
%385 = sext i32 %384 to i64
%386 = getelementptr inbounds double, double* %383, i64 %385
store double %381, double* %386
%387 = load double, double* %53
%388 = load double**, double*** %44
%389 = load double*, double** %388
%390 = load i32, i32* %46
%391 = sext i32 %390 to i64
%392 = getelementptr inbounds double, double* %389, i64 %391
store double %387, double* %392
%393 = load i32, i32* %46
%394 = add nsw i32 %393, 1
store i32 %394, i32* %46
br label %395
395: ; preds = %323, %286
br label %281
396: ; preds = %281
%397 = load i32*, i32** %45
%398 = call i32 @fclose(i32* %397)
ret void
}

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