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


x86 assembly (clang, -O0):
<readidem2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1e0,%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,-0x188(%rbp)
ff
mov    -0x8(%rbp),%rdi
lea    0xde0(%rip),%rsi
call   10d0 <fopen@plt>
mov    %rax,-0x38(%rbp)
movl   $0x0,-0x3c(%rbp)
lea    -0x150(%rbp),%rdi
mov    -0x38(%rbp),%rdx
mov    $0x100,%esi
call   1070 <fgets@plt>
cmp    $0x0,%rax
je     1295 <readidem2+0xe5>
movsbl -0x150(%rbp),%eax
cmp    $0x23,%eax
je     1290 <readidem2+0xe0>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1258 <readidem2+0xa8>
mov    -0x3c(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x38(%rbp),%rdi
call   1050 <rewind@plt>
lea    -0x150(%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 <readidem2+0x1a4>
jp     1354 <readidem2+0x1a4>
movsbl -0x150(%rbp),%eax
cmp    $0x23,%eax
je     133a <readidem2+0x18a>
lea    -0x150(%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    -0x180(%rbp),%rax
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
mov    $0x0,%al
call   10a0 <sscanf@plt>
jmp    134f <readidem2+0x19f>
lea    -0x150(%rbp),%rdi
mov    -0x38(%rbp),%rdx
mov    $0x100,%esi
call   1070 <fgets@plt>
jmp    12cc <readidem2+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    -0x150(%rbp),%rdi
mov    -0x38(%rbp),%rdx
mov    $0x100,%esi
call   1070 <fgets@plt>
cmp    $0x0,%rax
je     15c9 <readidem2+0x419>
movsbl -0x150(%rbp),%eax
cmp    $0x23,%eax
je     15c4 <readidem2+0x414>
lea    -0x150(%rbp),%rdi
mov    0x10(%rbp),%r9
lea    0xc8c(%rip),%rsi
lea    -0x158(%rbp),%rdx
lea    -0x160(%rbp),%rcx
lea    -0x178(%rbp),%r8
lea    -0x180(%rbp),%rax
mov    %rax,(%rsp)
mov    $0x0,%al
call   10a0 <sscanf@plt>
movsd  -0x178(%rbp),%xmm0
ff
mov    -0x28(%rbp),%rax
ucomisd (%rax),%xmm0
jne    142c <readidem2+0x27c>
jp     142c <readidem2+0x27c>
movsd  -0x158(%rbp),%xmm0
ff
movsd  %xmm0,-0x168(%rbp)
ff
movsd  -0x160(%rbp),%xmm0
ff
movsd  %xmm0,-0x170(%rbp)
ff
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    15bf <readidem2+0x40f>
movsd  0xbe4(%rip),%xmm0
divsd  -0x188(%rbp),%xmm0
ff
movsd  0xbdc(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x1a0(%rbp)
ff
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0xbb8(%rip),%xmm1
divsd  %xmm1,%xmm0
mulsd  -0x188(%rbp),%xmm0
ff
call   1080 <sin@plt>
movsd  %xmm0,-0x1a8(%rbp)
ff
movsd  -0x168(%rbp),%xmm0
ff
movsd  0xb8f(%rip),%xmm1
divsd  %xmm1,%xmm0
mulsd  -0x188(%rbp),%xmm0
ff
call   1080 <sin@plt>
movsd  %xmm0,-0x1b0(%rbp)
ff
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0xb66(%rip),%xmm1
divsd  %xmm1,%xmm0
mulsd  -0x188(%rbp),%xmm0
ff
call   10c0 <cos@plt>
movsd  %xmm0,-0x1c0(%rbp)
ff
movsd  -0x168(%rbp),%xmm0
ff
movsd  0xb3d(%rip),%xmm1
divsd  %xmm1,%xmm0
mulsd  -0x188(%rbp),%xmm0
ff
call   10c0 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x1c0(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x1b8(%rbp)
ff
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
subsd  -0x170(%rbp),%xmm0
ff
movsd  0xafd(%rip),%xmm1
divsd  %xmm1,%xmm0
mulsd  -0x188(%rbp),%xmm0
ff
call   10c0 <cos@plt>
movsd  -0x1b8(%rbp),%xmm1
ff
movsd  -0x1b0(%rbp),%xmm2
ff
movaps %xmm0,%xmm3
movsd  -0x1a8(%rbp),%xmm0
ff
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1060 <acos@plt>
movaps %xmm0,%xmm1
movsd  -0x1a0(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
mov    0x20(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x178(%rbp),%xmm0
ff
mov    -0x28(%rbp),%rax
subsd  (%rax),%xmm0
movsd  %xmm0,-0x198(%rbp)
ff
movsd  -0x180(%rbp),%xmm0
ff
movsd  0xa81(%rip),%xmm1
divsd  %xmm1,%xmm0
mulsd  -0x188(%rbp),%xmm0
ff
call   1080 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x198(%rbp),%xmm0
ff
divsd  %xmm1,%xmm0
mov    0x28(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    15c4 <readidem2+0x414>
jmp    137a <readidem2+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)
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    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    0x20(%rbp),%rax
movsd  (%rax),%xmm0
mov    0x28(%rbp),%rax
movsd  (%rax),%xmm1
mov    0x30(%rbp),%rax
cvtsi2sdl (%rax),%xmm2
mov    0x38(%rbp),%rax
cvtsi2sdl (%rax),%xmm3
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
lea    0x9ed(%rip),%rdi
mov    $0x4,%al
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   $0xffffffff,-0x40(%rbp)
movl   $0x0,-0x44(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x190(%rbp)
ff
lea    -0x150(%rbp),%rdi
mov    -0x38(%rbp),%rdx
mov    $0x100,%esi
call   1070 <fgets@plt>
cmp    $0x0,%rax
je     194e <readidem2+0x79e>
movsbl -0x150(%rbp),%eax
cmp    $0x23,%eax
je     1949 <readidem2+0x799>
lea    -0x150(%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    0x87f(%rip),%rsi
lea    -0x158(%rbp),%rdx
lea    -0x160(%rbp),%rcx
lea    -0x178(%rbp),%r8
mov    %r11,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
mov    $0x0,%al
call   10a0 <sscanf@plt>
movsd  -0x178(%rbp),%xmm0
ff
ucomisd -0x190(%rbp),%xmm0
ff
jbe    1871 <readidem2+0x6c1>
movsd  -0x178(%rbp),%xmm0
ff
movsd  %xmm0,-0x190(%rbp)
ff
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    18b0 <readidem2+0x700>
movsd  -0x178(%rbp),%xmm1
ff
movsd  -0x190(%rbp),%xmm0
ff
ucomisd %xmm1,%xmm0
jb     18ab <readidem2+0x6fb>
movsd  -0x178(%rbp),%xmm0
ff
movsd  %xmm0,-0x190(%rbp)
ff
movl   $0x0,-0x40(%rbp)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    18b0 <readidem2+0x700>
mov    0x40(%rbp),%rax
movsd  (%rax),%xmm0
cvtsi2sdl -0x44(%rbp),%xmm1
mulsd  %xmm1,%xmm0
mov    0x50(%rbp),%rax
mov    (%rax),%rax
movslq -0x3c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    0x48(%rbp),%rax
movsd  (%rax),%xmm0
cvtsi2sdl -0x40(%rbp),%xmm1
mulsd  %xmm1,%xmm0
mov    0x58(%rbp),%rax
mov    (%rax),%rax
movslq -0x3c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x158(%rbp),%xmm0
ff
mov    0x78(%rbp),%rax
mov    (%rax),%rax
movslq -0x3c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x160(%rbp),%xmm0
ff
mov    0x80(%rbp),%rax
mov    (%rax),%rax
movslq -0x3c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x178(%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    178e <readidem2+0x5de>
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
lea    0x73a(%rip),%rdi
mov    $0x4,%al
call   1040 <printf@plt>
mov    -0x38(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x1e0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readidem2>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x178,%rsp
mov    %r9,0x28(%rsp)
mov    %r8,0x40(%rsp)
mov    %rcx,0x8(%rsp)
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rdi,%rbp
movsd  0xe1f(%rip),%xmm0
call   1090 <atan@plt>
lea    0xe3b(%rip),%rsi
mov    %rbp,%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 <readidem2+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 <readidem2+0x70>
mov    %r12,0x50(%rsp)
mov    %ebx,(%r12)
mov    %r13,%rdi
call   1050 <rewind@plt>
lea    0x70(%rsp),%r14
mov    %r14,%rdi
mov    $0x100,%esi
mov    %r13,%rdx
call   1070 <fgets@plt>
movabs $0x40f869f000000000,%rax
69 f8 40
mov    %rax,(%r15)
lea    0xdaf(%rip),%r12
mov    0x40(%rsp),%rbx
jmp    12b1 <readidem2+0x101>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
mov    $0x100,%esi
mov    %r13,%rdx
call   1070 <fgets@plt>
movsd  (%r15),%xmm0
ucomisd 0xd5b(%rip),%xmm0
jne    12e8 <readidem2+0x138>
jp     12e8 <readidem2+0x138>
cmpb   $0x23,0x70(%rsp)
je     1290 <readidem2+0xe0>
mov    %r14,%rdi
mov    %r12,%rsi
mov    %r15,%rdx
mov    0x8(%rsp),%rcx
mov    %rbx,%r8
mov    0x28(%rsp),%r9
xor    %eax,%eax
lea    0x48(%rsp),%rbp
push   %rbp
push   0x1b8(%rsp)
call   10a0 <sscanf@plt>
add    $0x10,%rsp
jmp    12a0 <readidem2+0xf0>
mov    %r13,%rdi
call   1050 <rewind@plt>
mov    0x1c0(%rsp),%r12
movq   $0x0,(%r12)
mov    0x1c8(%rsp),%rbx
movq   $0x0,(%rbx)
lea    0x70(%rsp),%rdi
mov    $0x100,%esi
mov    %r13,%rdx
call   1070 <fgets@plt>
test   %rax,%rax
je     14e9 <readidem2+0x339>
lea    0x70(%rsp),%r14
xor    %r12d,%r12d
mov    0x40(%rsp),%rbx
jmp    1475 <readidem2+0x2c5>
movsd  (%r15),%xmm0
movsd  0xcc7(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xcc3(%rip),%xmm1
mulsd  %xmm1,%xmm0
call   1080 <sin@plt>
movsd  %xmm0,0x20(%rsp)
movsd  0x68(%rsp),%xmm0
divsd  0xc9e(%rip),%xmm0
mulsd  0xc9e(%rip),%xmm0
movsd  %xmm0,0x18(%rsp)
call   1080 <sin@plt>
movsd  %xmm0,0x60(%rsp)
movsd  (%r15),%xmm0
divsd  0xc78(%rip),%xmm0
mulsd  0xc78(%rip),%xmm0
call   10c0 <cos@plt>
movsd  %xmm0,0x58(%rsp)
movsd  0x18(%rsp),%xmm0
call   10c0 <cos@plt>
mulsd  0x58(%rsp),%xmm0
movsd  %xmm0,0x18(%rsp)
mov    0x8(%rsp),%rax
movsd  (%rax),%xmm0
subsd  0x28(%rsp),%xmm0
divsd  0xc37(%rip),%xmm0
mulsd  0xc37(%rip),%xmm0
call   10c0 <cos@plt>
mulsd  0x18(%rsp),%xmm0
movsd  0x60(%rsp),%xmm1
mulsd  0x20(%rsp),%xmm1
addsd  %xmm1,%xmm0
call   1060 <acos@plt>
mulsd  0xc17(%rip),%xmm0
mov    0x1c0(%rsp),%rax
movsd  %xmm0,(%rax)
movsd  0x10(%rsp),%xmm0
subsd  (%rbx),%xmm0
movsd  %xmm0,0x20(%rsp)
movsd  0x48(%rsp),%xmm0
divsd  0xbdd(%rip),%xmm0
mulsd  0xbdd(%rip),%xmm0
call   1080 <sin@plt>
movsd  0x20(%rsp),%xmm1
divsd  %xmm0,%xmm1
mov    0x1c8(%rsp),%rax
movsd  %xmm1,(%rax)
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    $0x100,%esi
mov    %r13,%rdx
call   1070 <fgets@plt>
test   %rax,%rax
je     14ec <readidem2+0x33c>
cmpb   $0x23,0x70(%rsp)
je     1460 <readidem2+0x2b0>
sub    $0x8,%rsp
mov    %r14,%rdi
lea    0xbbd(%rip),%rsi
lea    0x40(%rsp),%rdx
lea    0x38(%rsp),%rcx
lea    0x18(%rsp),%r8
mov    0x1b8(%rsp),%r9
xor    %eax,%eax
lea    0x50(%rsp),%rbp
push   %rbp
call   10a0 <sscanf@plt>
add    $0x10,%rsp
movsd  0x10(%rsp),%xmm0
ucomisd (%rbx),%xmm0
jne    133c <readidem2+0x18c>
jp     133c <readidem2+0x18c>
movsd  0x38(%rsp),%xmm0
movsd  %xmm0,0x68(%rsp)
movsd  0x30(%rsp),%xmm0
movsd  %xmm0,0x28(%rsp)
add    $0x1,%r12d
jmp    1460 <readidem2+0x2b0>
xor    %r12d,%r12d
mov    %r13,%rdi
call   1050 <rewind@plt>
mov    0x1d0(%rsp),%rcx
mov    %r12d,(%rcx)
mov    0x50(%rsp),%rbx
mov    (%rbx),%eax
cltd
idiv   %r12d
mov    0x1d8(%rsp),%rdx
mov    %eax,(%rdx)
mov    0x1c0(%rsp),%rdi
movsd  (%rdi),%xmm0
mov    (%rcx),%ecx
lea    -0x1(%rcx),%edx
xorps  %xmm1,%xmm1
cvtsi2sd %edx,%xmm1
divsd  %xmm1,%xmm0
mov    0x1e0(%rsp),%rdx
movsd  %xmm0,(%rdx)
addsd  (%rdi),%xmm0
movsd  %xmm0,(%rdi)
mov    0x1c8(%rsp),%rsi
movsd  (%rsi),%xmm0
lea    -0x1(%rax),%edx
xorps  %xmm1,%xmm1
cvtsi2sd %edx,%xmm1
divsd  %xmm1,%xmm0
mov    0x1e8(%rsp),%rdx
movsd  %xmm0,(%rdx)
movsd  (%rdi),%xmm0
cvtsi2sd %ecx,%xmm2
movsd  (%rsi),%xmm1
cvtsi2sd %eax,%xmm3
mov    (%rbx),%esi
lea    0xae1(%rip),%rdi
mov    $0x4,%al
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)
lea    0x70(%rsp),%rdi
mov    $0x100,%esi
mov    %r13,%rdx
call   1070 <fgets@plt>
test   %rax,%rax
je     17fe <readidem2+0x64e>
mov    $0xffffffff,%r15d
xorpd  %xmm0,%xmm0
movsd  %xmm0,0x8(%rsp)
xor    %r12d,%r12d
jmp    1758 <readidem2+0x5a8>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%r15d
xorps  %xmm1,%xmm1
cvtsi2sd %r12d,%xmm1
mov    0x1e0(%rsp),%rax
mulsd  (%rax),%xmm1
mov    0x1f0(%rsp),%rax
mov    (%rax),%rax
movsd  %xmm1,(%rax,%r14,8)
xorps  %xmm1,%xmm1
cvtsi2sd %r15d,%xmm1
mov    0x1e8(%rsp),%rax
mulsd  (%rax),%xmm1
mov    0x1f8(%rsp),%rax
mov    (%rax),%rax
movsd  %xmm1,(%rax,%r14,8)
movsd  0x38(%rsp),%xmm1
mov    0x218(%rsp),%rax
mov    (%rax),%rax
movsd  %xmm1,(%rax,%r14,8)
movsd  0x30(%rsp),%xmm1
mov    0x220(%rsp),%rax
mov    (%rax),%rax
movsd  %xmm1,(%rax,%r14,8)
movsd  0x10(%rsp),%xmm1
mov    0x228(%rsp),%rax
mov    (%rax),%rax
movsd  %xmm1,(%rax,%r14,8)
add    $0x1,%r14d
movsd  %xmm0,0x8(%rsp)
lea    0x70(%rsp),%rdi
mov    $0x100,%esi
mov    %r13,%rdx
call   1070 <fgets@plt>
test   %rax,%rax
je     17fe <readidem2+0x64e>
cmpb   $0x23,0x70(%rsp)
je     173d <readidem2+0x58d>
movslq %r14d,%r14
lea    0x0(,%r14,8),%rbp
mov    0x200(%rsp),%rax
mov    (%rax),%r9
add    %rbp,%r9
mov    0x208(%rsp),%rax
mov    (%rax),%r10
add    %rbp,%r10
mov    0x210(%rsp),%rax
mov    (%rax),%rbx
add    %rbp,%rbx
mov    0x1b8(%rsp),%rax
add    (%rax),%rbp
sub    $0x8,%rsp
lea    0x78(%rsp),%rdi
lea    0x8e3(%rip),%rsi
lea    0x40(%rsp),%rdx
lea    0x38(%rsp),%rcx
lea    0x18(%rsp),%r8
xor    %eax,%eax
push   %rbp
push   %rbx
push   %r10
call   10a0 <sscanf@plt>
add    $0x20,%rsp
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
ucomisd %xmm1,%xmm0
ja     16a0 <readidem2+0x4f0>
ucomisd %xmm0,%xmm1
jae    17f2 <readidem2+0x642>
movapd %xmm1,%xmm0
jmp    16a4 <readidem2+0x4f4>
add    $0x1,%r12d
xor    %r15d,%r15d
jmp    16a4 <readidem2+0x4f4>
mov    0x1c0(%rsp),%rax
movsd  (%rax),%xmm0
mov    0x1c8(%rsp),%rax
movsd  (%rax),%xmm1
mov    0x1e0(%rsp),%rax
movsd  (%rax),%xmm2
mov    0x1e8(%rsp),%rax
movsd  (%rax),%xmm3
lea    0x87a(%rip),%rdi
mov    $0x4,%al
call   1040 <printf@plt>
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 = [46 x i8] c"oxdim=%lf, oydim=%lf, nsx=%d, nsy=%d, pns=%d\0A\00"
@.str.4 = [29 x i8] c"%lf %lf %lf %lf %lf %lf %lf\0A\00"
@.str.5 = [46 x i8] c"oxdim=%lf, oydim=%lf, odiscx=%lf, odiscy=%lf\0A\00"
define void @readidem2(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 i32
%49 = alloca [256 x i8]
%50 = alloca double
%51 = alloca double
%52 = alloca double
%53 = alloca double
%54 = alloca double
%55 = alloca double
%56 = alloca double
%57 = 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
%58 = call double @atan(double 1.000000e+00)
%59 = fmul double 4.000000e+00, %58
store double %59, double* %56
%60 = load i8*, i8** %23
%61 = call i32* @fopen(i8* %60, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %61, i32** %45
store i32 0, i32* %46
br label %62
62: ; preds = %75, %22
%63 = getelementptr inbounds [256 x i8], [256 x i8]* %49, i64 0, i64 0
%64 = load i32*, i32** %45
%65 = call i32* @fgets(i8* %63, i32 256, i32* %64)
%66 = icmp ne i32* %65, null
br i1 %66, label %67, label %76
67: ; preds = %62
%68 = getelementptr inbounds [256 x i8], [256 x i8]* %49, i64 0, i64 0
%69 = load i8, i8* %68
%70 = sext i8 %69 to i32
%71 = icmp ne i32 %70, 35
br i1 %71, label %72, label %75
72: ; preds = %67
%73 = load i32, i32* %46
%74 = add nsw i32 %73, 1
store i32 %74, i32* %46
br label %75
75: ; preds = %72, %67
br label %62
76: ; preds = %62
%77 = load i32, i32* %46
%78 = load i32*, i32** %24
store i32 %77, i32* %78
%79 = load i32*, i32** %45
%80 = call i32 @rewind(i32* %79)
%81 = getelementptr inbounds [256 x i8], [256 x i8]* %49, i64 0, i64 0
%82 = load i32*, i32** %45
%83 = call i32* @fgets(i8* %81, i32 256, i32* %82)
%84 = load double*, double** %25
store double 9.999900e+04, double* %84
br label %85
85: ; preds = %106, %76
%86 = load double*, double** %25
%87 = load double, double* %86
%88 = fcmp oeq double %87, 9.999900e+04
br i1 %88, label %89, label %107
89: ; preds = %85
%90 = getelementptr inbounds [256 x i8], [256 x i8]* %49, i64 0, i64 0
%91 = load i8, i8* %90
%92 = sext i8 %91 to i32
%93 = icmp ne i32 %92, 35
br i1 %93, label %94, label %102
94: ; preds = %89
%95 = getelementptr inbounds [256 x i8], [256 x i8]* %49, i64 0, i64 0
%96 = load double*, double** %25
%97 = load double*, double** %26
%98 = load double*, double** %27
%99 = load double*, double** %28
%100 = load double*, double** %29
%101 = call i32 (i8*, i8*, double*, double*, double*, double*, double*, ...) @sscanf(i8* %95, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), double* %96, double* %97, double* %98, double* %99, double* %100, double* %55)
br label %106
102: ; preds = %89
%103 = getelementptr inbounds [256 x i8], [256 x i8]* %49, i64 0, i64 0
%104 = load i32*, i32** %45
%105 = call i32* @fgets(i8* %103, i32 256, i32* %104)
br label %106
106: ; preds = %102, %94
br label %85
107: ; preds = %85
%108 = load i32*, i32** %45
%109 = call i32 @rewind(i32* %108)
%110 = load double*, double** %31
store double 0.000000e+00, double* %110
%111 = load double*, double** %32
store double 0.000000e+00, double* %111
store i32 0, i32* %46
br label %112
112: ; preds = %187, %107
%113 = getelementptr inbounds [256 x i8], [256 x i8]* %49, i64 0, i64 0
%114 = load i32*, i32** %45
%115 = call i32* @fgets(i8* %113, i32 256, i32* %114)
%116 = icmp ne i32* %115, null
br i1 %116, label %117, label %188
117: ; preds = %112
%118 = getelementptr inbounds [256 x i8], [256 x i8]* %49, i64 0, i64 0
%119 = load i8, i8* %118
%120 = sext i8 %119 to i32
%121 = icmp ne i32 %120, 35
br i1 %121, label %122, label %187
122: ; preds = %117
%123 = getelementptr inbounds [256 x i8], [256 x i8]* %49, i64 0, i64 0
%124 = load double*, double** %29
%125 = call i32 (i8*, i8*, double*, double*, double*, double*, double*, ...) @sscanf(i8* %123, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), double* %50, double* %51, double* %54, double* %124, double* %55)
%126 = load double, double* %54
%127 = load double*, double** %27
%128 = load double, double* %127
%129 = fcmp oeq double %126, %128
br i1 %129, label %130, label %135
130: ; preds = %122
%131 = load double, double* %50
store double %131, double* %52
%132 = load double, double* %51
store double %132, double* %53
%133 = load i32, i32* %46
%134 = add nsw i32 %133, 1
store i32 %134, i32* %46
br label %186
135: ; preds = %122
%136 = load double, double* %56
%137 = fdiv double 1.800000e+02, %136
%138 = fmul double %137, 1.111200e+02
%139 = load double*, double** %25
%140 = load double, double* %139
%141 = fdiv double %140, 1.800000e+02
%142 = load double, double* %56
%143 = fmul double %141, %142
%144 = call double @sin(double %143)
%145 = load double, double* %52
%146 = fdiv double %145, 1.800000e+02
%147 = load double, double* %56
%148 = fmul double %146, %147
%149 = call double @sin(double %148)
%150 = load double*, double** %25
%151 = load double, double* %150
%152 = fdiv double %151, 1.800000e+02
%153 = load double, double* %56
%154 = fmul double %152, %153
%155 = call double @cos(double %154)
%156 = load double, double* %52
%157 = fdiv double %156, 1.800000e+02
%158 = load double, double* %56
%159 = fmul double %157, %158
%160 = call double @cos(double %159)
%161 = fmul double %155, %160
%162 = load double*, double** %26
%163 = load double, double* %162
%164 = load double, double* %53
%165 = fsub double %163, %164
%166 = fdiv double %165, 1.800000e+02
%167 = load double, double* %56
%168 = fmul double %166, %167
%169 = call double @cos(double %168)
%170 = fmul double %161, %169
%171 = call double @llvm.fmuladd.f64(double %144, double %149, double %170)
%172 = call double @acos(double %171)
%173 = fmul double %138, %172
%174 = load double*, double** %31
store double %173, double* %174
%175 = load double, double* %54
%176 = load double*, double** %27
%177 = load double, double* %176
%178 = fsub double %175, %177
%179 = load double, double* %55
%180 = fdiv double %179, 1.800000e+02
%181 = load double, double* %56
%182 = fmul double %180, %181
%183 = call double @sin(double %182)
%184 = fdiv double %178, %183
%185 = load double*, double** %32
store double %184, double* %185
br label %186
186: ; preds = %135, %130
br label %187
187: ; preds = %186, %117
br label %112
188: ; preds = %112
%189 = load i32*, i32** %45
%190 = call i32 @rewind(i32* %189)
%191 = load i32, i32* %46
%192 = load i32*, i32** %33
store i32 %191, i32* %192
%193 = load i32*, i32** %24
%194 = load i32, i32* %193
%195 = load i32*, i32** %33
%196 = load i32, i32* %195
%197 = sdiv i32 %194, %196
%198 = load i32*, i32** %34
store i32 %197, i32* %198
%199 = load double*, double** %31
%200 = load double, double* %199
%201 = load i32*, i32** %33
%202 = load i32, i32* %201
%203 = sub nsw i32 %202, 1
%204 = sitofp i32 %203 to double
%205 = fdiv double %200, %204
%206 = load double*, double** %35
store double %205, double* %206
%207 = load double*, double** %31
%208 = load double, double* %207
%209 = load double*, double** %35
%210 = load double, double* %209
%211 = fadd double %208, %210
%212 = load double*, double** %31
store double %211, double* %212
%213 = load double*, double** %32
%214 = load double, double* %213
%215 = load i32*, i32** %34
%216 = load i32, i32* %215
%217 = sub nsw i32 %216, 1
%218 = sitofp i32 %217 to double
%219 = fdiv double %214, %218
%220 = load double*, double** %36
store double %219, double* %220
%221 = load double*, double** %31
%222 = load double, double* %221
%223 = load double*, double** %32
%224 = load double, double* %223
%225 = load i32*, i32** %33
%226 = load i32, i32* %225
%227 = sitofp i32 %226 to double
%228 = load i32*, i32** %34
%229 = load i32, i32* %228
%230 = sitofp i32 %229 to double
%231 = load i32*, i32** %24
%232 = load i32, i32* %231
%233 = call i32 (i8*, double, double, double, double, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.3, i64 0, i64 0), double %222, double %224, double %227, double %230, i32 %232)
%234 = load i32*, i32** %24
%235 = load i32, i32* %234
%236 = call double* @dvector(i32 1, i32 %235)
%237 = load double**, double*** %37
store double* %236, double** %237
%238 = load i32*, i32** %24
%239 = load i32, i32* %238
%240 = call double* @dvector(i32 1, i32 %239)
%241 = load double**, double*** %38
store double* %240, double** %241
%242 = load i32*, i32** %24
%243 = load i32, i32* %242
%244 = call double* @dvector(i32 1, i32 %243)
%245 = load double**, double*** %39
store double* %244, double** %245
%246 = load i32*, i32** %24
%247 = load i32, i32* %246
%248 = call double* @dvector(i32 1, i32 %247)
%249 = load double**, double*** %42
store double* %248, double** %249
%250 = load i32*, i32** %24
%251 = load i32, i32* %250
%252 = call double* @dvector(i32 1, i32 %251)
%253 = load double**, double*** %43
store double* %252, double** %253
%254 = load i32*, i32** %24
%255 = load i32, i32* %254
%256 = call double* @dvector(i32 1, i32 %255)
%257 = load double**, double*** %44
store double* %256, double** %257
%258 = load i32*, i32** %24
%259 = load i32, i32* %258
%260 = call double* @dvector(i32 1, i32 %259)
%261 = load double**, double*** %40
store double* %260, double** %261
%262 = load i32*, i32** %24
%263 = load i32, i32* %262
%264 = call double* @dvector(i32 1, i32 %263)
%265 = load double**, double*** %41
store double* %264, double** %265
%266 = load i32*, i32** %24
%267 = load i32, i32* %266
%268 = call double* @dvector(i32 1, i32 %267)
%269 = load double**, double*** %30
store double* %268, double** %269
store i32 1, i32* %46
store i32 -1, i32* %47
store i32 0, i32* %48
store double 0.000000e+00, double* %57
br label %270
270: ; preds = %360, %188
%271 = getelementptr inbounds [256 x i8], [256 x i8]* %49, i64 0, i64 0
%272 = load i32*, i32** %45
%273 = call i32* @fgets(i8* %271, i32 256, i32* %272)
%274 = icmp ne i32* %273, null
br i1 %274, label %275, label %361
275: ; preds = %270
%276 = getelementptr inbounds [256 x i8], [256 x i8]* %49, i64 0, i64 0
%277 = load i8, i8* %276
%278 = sext i8 %277 to i32
%279 = icmp ne i32 %278, 35
br i1 %279, label %280, label %360
280: ; preds = %275
%281 = getelementptr inbounds [256 x i8], [256 x i8]* %49, i64 0, i64 0
%282 = load double**, double*** %39
%283 = load double*, double** %282
%284 = load i32, i32* %46
%285 = sext i32 %284 to i64
%286 = getelementptr inbounds double, double* %283, i64 %285
%287 = load double**, double*** %40
%288 = load double*, double** %287
%289 = load i32, i32* %46
%290 = sext i32 %289 to i64
%291 = getelementptr inbounds double, double* %288, i64 %290
%292 = load double**, double*** %41
%293 = load double*, double** %292
%294 = load i32, i32* %46
%295 = sext i32 %294 to i64
%296 = getelementptr inbounds double, double* %293, i64 %295
%297 = load double**, double*** %30
%298 = load double*, double** %297
%299 = load i32, i32* %46
%300 = sext i32 %299 to i64
%301 = getelementptr inbounds double, double* %298, i64 %300
%302 = call i32 (i8*, i8*, double*, double*, double*, double*, double*, ...) @sscanf(i8* %281, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), double* %50, double* %51, double* %54, double* %286, double* %291, double* %296, double* %301)
%303 = load double, double* %54
%304 = load double, double* %57
%305 = fcmp ogt double %303, %304
br i1 %305, label %306, label %310
306: ; preds = %280
%307 = load double, double* %54
store double %307, double* %57
%308 = load i32, i32* %47
%309 = add nsw i32 %308, 1
store i32 %309, i32* %47
br label %319
310: ; preds = %280
%311 = load double, double* %54
%312 = load double, double* %57
%313 = fcmp ole double %311, %312
br i1 %313, label %314, label %318
314: ; preds = %310
%315 = load double, double* %54
store double %315, double* %57
store i32 0, i32* %47
%316 = load i32, i32* %48
%317 = add nsw i32 %316, 1
store i32 %317, i32* %48
br label %318
318: ; preds = %314, %310
br label %319
319: ; preds = %318, %306
%320 = load double*, double** %35
%321 = load double, double* %320
%322 = load i32, i32* %48
%323 = sitofp i32 %322 to double
%324 = fmul double %321, %323
%325 = load double**, double*** %37
%326 = load double*, double** %325
%327 = load i32, i32* %46
%328 = sext i32 %327 to i64
%329 = getelementptr inbounds double, double* %326, i64 %328
store double %324, double* %329
%330 = load double*, double** %36
%331 = load double, double* %330
%332 = load i32, i32* %47
%333 = sitofp i32 %332 to double
%334 = fmul double %331, %333
%335 = load double**, double*** %38
%336 = load double*, double** %335
%337 = load i32, i32* %46
%338 = sext i32 %337 to i64
%339 = getelementptr inbounds double, double* %336, i64 %338
store double %334, double* %339
%340 = load double, double* %50
%341 = load double**, double*** %42
%342 = load double*, double** %341
%343 = load i32, i32* %46
%344 = sext i32 %343 to i64
%345 = getelementptr inbounds double, double* %342, i64 %344
store double %340, double* %345
%346 = load double, double* %51
%347 = load double**, double*** %43
%348 = load double*, double** %347
%349 = load i32, i32* %46
%350 = sext i32 %349 to i64
%351 = getelementptr inbounds double, double* %348, i64 %350
store double %346, double* %351
%352 = load double, double* %54
%353 = load double**, double*** %44
%354 = load double*, double** %353
%355 = load i32, i32* %46
%356 = sext i32 %355 to i64
%357 = getelementptr inbounds double, double* %354, i64 %356
store double %352, double* %357
%358 = load i32, i32* %46
%359 = add nsw i32 %358, 1
store i32 %359, i32* %46
br label %360
360: ; preds = %319, %275
br label %270
361: ; preds = %270
%362 = load double*, double** %31
%363 = load double, double* %362
%364 = load double*, double** %32
%365 = load double, double* %364
%366 = load double*, double** %35
%367 = load double, double* %366
%368 = load double*, double** %36
%369 = load double, double* %368
%370 = call i32 (i8*, double, double, double, double, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.5, i64 0, i64 0), double %363, double %365, double %367, double %369)
%371 = load i32*, i32** %45
%372 = call i32 @fclose(i32* %371)
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 = [46 x i8] c"oxdim=%lf, oydim=%lf, nsx=%d, nsy=%d, pns=%d\0A\00"
@.str.4 = [29 x i8] c"%lf %lf %lf %lf %lf %lf %lf\0A\00"
@.str.5 = [46 x i8] c"oxdim=%lf, oydim=%lf, odiscx=%lf, odiscy=%lf\0A\00"
define void @readidem2(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 %115, label %63
63: ; preds = %59, %109
%64 = phi i32 [ %112, %109 ], [ 0, %59 ]
%65 = phi double [ %111, %109 ], [ undef, %59 ]
%66 = phi double [ %110, %109 ], [ undef, %59 ]
%67 = load i8, i8* %28
%68 = icmp eq i8 %67, 35
br i1 %68, label %109, 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 %109
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
%101 = load double, double* %26
%102 = load double, double* %4
%103 = fsub double %101, %102
%104 = load double, double* %27
%105 = fdiv double %104, 1.800000e+02
%106 = fmul double %105, 0x400921FB54442D18
%107 = call double @sin(double %106)
%108 = fdiv double %103, %107
store double %108, double* %9
br label %109
109: ; preds = %74, %78, %63
%110 = phi double [ %75, %74 ], [ %66, %78 ], [ %66, %63 ]
%111 = phi double [ %76, %74 ], [ %65, %78 ], [ %65, %63 ]
%112 = phi i32 [ %77, %74 ], [ %64, %78 ], [ %64, %63 ]
%113 = call i32* @fgets(i8* %28, i32 256, i32* %34)
%114 = icmp eq i32* %113, null
br i1 %114, label %115, label %63
115: ; preds = %109, %59
%116 = phi i32 [ 0, %59 ], [ %112, %109 ]
%117 = call i32 @rewind(i32* %34)
store i32 %116, i32* %10
%118 = load i32, i32* %1
%119 = sdiv i32 %118, %116
store i32 %119, i32* %11
%120 = load double, double* %8
%121 = load i32, i32* %10
%122 = add nsw i32 %121, -1
%123 = sitofp i32 %122 to double
%124 = fdiv double %120, %123
store double %124, double* %12
%125 = load double, double* %8
%126 = fadd double %125, %124
store double %126, double* %8
%127 = load double, double* %9
%128 = add nsw i32 %119, -1
%129 = sitofp i32 %128 to double
%130 = fdiv double %127, %129
store double %130, double* %13
%131 = load double, double* %8
%132 = load double, double* %9
%133 = sitofp i32 %121 to double
%134 = sitofp i32 %119 to double
%135 = load i32, i32* %1
%136 = call i32 (i8*, double, double, double, double, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.3, i64 0, i64 0), double %131, double %132, double %133, double %134, i32 %135)
%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 = call i32* @fgets(i8* %28, i32 256, i32* %34)
%156 = icmp eq i32* %155, null
br i1 %156, label %214, label %157
157: ; preds = %115, %207
%158 = phi double [ %211, %207 ], [ 0.000000e+00, %115 ]
%159 = phi i32 [ %210, %207 ], [ 1, %115 ]
%160 = phi i32 [ %209, %207 ], [ 0, %115 ]
%161 = phi i32 [ %208, %207 ], [ -1, %115 ]
%162 = load i8, i8* %28
%163 = icmp eq i8 %162, 35
br i1 %163, label %207, label %164
164: ; preds = %157
%165 = load double*, double** %16
%166 = sext i32 %159 to i64
%167 = getelementptr inbounds double, double* %165, i64 %166
%168 = load double*, double** %17
%169 = getelementptr inbounds double, double* %168, i64 %166
%170 = load double*, double** %18
%171 = getelementptr inbounds double, double* %170, i64 %166
%172 = load double*, double** %7
%173 = getelementptr inbounds double, double* %172, i64 %166
%174 = 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* %167, double* %169, double* %171, double* %173)
%175 = load double, double* %26
%176 = fcmp ogt double %175, %158
br i1 %176, label %177, label %179
177: ; preds = %164
%178 = add nsw i32 %161, 1
br label %183
179: ; preds = %164
%180 = fcmp ugt double %175, %158
br i1 %180, label %183, label %181
181: ; preds = %179
%182 = add nsw i32 %160, 1
br label %183
183: ; preds = %179, %181, %177
%184 = phi i32 [ %178, %177 ], [ 0, %181 ], [ %161, %179 ]
%185 = phi i32 [ %160, %177 ], [ %182, %181 ], [ %160, %179 ]
%186 = phi double [ %175, %177 ], [ %175, %181 ], [ %158, %179 ]
%187 = load double, double* %12
%188 = sitofp i32 %185 to double
%189 = fmul double %187, %188
%190 = load double*, double** %14
%191 = getelementptr inbounds double, double* %190, i64 %166
store double %189, double* %191
%192 = load double, double* %13
%193 = sitofp i32 %184 to double
%194 = fmul double %192, %193
%195 = load double*, double** %15
%196 = getelementptr inbounds double, double* %195, i64 %166
store double %194, double* %196
%197 = load double, double* %24
%198 = load double*, double** %19
%199 = getelementptr inbounds double, double* %198, i64 %166
store double %197, double* %199
%200 = load double, double* %25
%201 = load double*, double** %20
%202 = getelementptr inbounds double, double* %201, i64 %166
store double %200, double* %202
%203 = load double, double* %26
%204 = load double*, double** %21
%205 = getelementptr inbounds double, double* %204, i64 %166
store double %203, double* %205
%206 = add nsw i32 %159, 1
br label %207
207: ; preds = %183, %157
%208 = phi i32 [ %184, %183 ], [ %161, %157 ]
%209 = phi i32 [ %185, %183 ], [ %160, %157 ]
%210 = phi i32 [ %206, %183 ], [ %159, %157 ]
%211 = phi double [ %186, %183 ], [ %158, %157 ]
%212 = call i32* @fgets(i8* %28, i32 256, i32* %34)
%213 = icmp eq i32* %212, null
br i1 %213, label %214, label %157
214: ; preds = %207, %115
%215 = load double, double* %8
%216 = load double, double* %9
%217 = load double, double* %12
%218 = load double, double* %13
%219 = call i32 (i8*, double, double, double, double, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.5, i64 0, i64 0), double %215, double %216, double %217, double %218)
%220 = call i32 @fclose(i32* %34)
ret void
}