original_code:
void z_div(doublecomplex *c, doublecomplex *a, doublecomplex *b)
{
 double ratio, den;
 double abr, abi, cr;
 if( (abr = b->r) < 0.)
  abr = - abr;
 if( (abi = b->i) < 0.)
  abi = - abi;
 if( abr <= abi )
  {
  if(abi == 0) {
   sig_die("complex division by zero", 1);
   }
  ratio = b->r / b->i ;
  den = b->i * (1 + ratio*ratio);
  cr = (a->r*ratio + a->i) / den;
  c->i = (a->i*ratio - a->r) / den;
  }
 else
  {
  ratio = b->i / b->r ;
  den = b->r * (1 + ratio*ratio);
  cr = (a->r + a->i*ratio) / den;
  c->i = (a->i - a->r*ratio) / den;
  }
 c->r = cr;
 }

canonical_original_code:
void z_div(struct doublecomplex *c, struct doublecomplex *a, struct doublecomplex *b)
{
 double ratio; double den;
 double abr; double abi; double cr;
 if( (abr = b->r) < 0.)
  abr = - abr;
 if( (abi = b->i) < 0.)
  abi = - abi;
 if( abr <= abi )
  {
  if(abi == 0) {
   sig_die("complex division by zero", 1);
   }
  ratio = b->r / b->i ;
  den = b->i * (1 + ratio*ratio);
  cr = (a->r*ratio + a->i) / den;
  c->i = (a->i*ratio - a->r) / den;
  }
 else
  {
  ratio = b->i / b->r ;
  den = b->r * (1 + ratio*ratio);
  cr = (a->r + a->i*ratio) / den;
  c->i = (a->i - a->r*ratio) / den;
  }
 c->r = cr;
 }

variable_types:
c
struct doublecomplex { double r; } *

variable_types:
a
struct doublecomplex *

variable_types:
b
struct doublecomplex *

variable_types: ratio double

variable_types: den double

variable_types: abr double

variable_types: abi double

variable_types: cr double


repo: kimtang/qml

decompiled_code:
__int64 __fastcall pars_f(char *a1)
{
f = 0;
f__revloc = 0;
f__parenlvl = 0;
return (unsigned int)-(sub_97B(a1, 0) == 0LL);
}

canonical_decompiled_code:
__int64 __fastcall func9(char *a1)
{
f = 0;
f__revloc = 0;
f__parenlvl = 0;
return (unsigned int)-(func8(a1, 0) == 0LL);
}

original_code:
int
pars_f(const char *s)
{
 f__parenlvl=f__revloc=f__pc=0;
 if(f_s(s,0) == ((void *)0))
 {
  return(-1);
 }
 return(0);
}

canonical_original_code:
int pars_f(char *s)
{
 f__parenlvl=f__revloc=f__pc=0;
 if(f_s(s,0) == ((void *)0))
 {
  return(-1);
 }
 return(0);
}

variable_types:
s
char *

return_type: int


decompiled_code:
__int64 __fastcall do_fio(__int64 *a1, __int64 a2, __int64 a3, float a4)
{
unsigned int v4; // ebp
unsigned int *v5; // rbx
unsigned int v6; // er12
__int64 result; // rax
__int64 v8; // rdx
__int64 v9; // rcx
int v10; // edx
int v11; // eax
__int64 v12; // rdx
__int64 v13; // rcx
int v14; // edx
int v15; // eax
int v16; // eax
__int64 v18; // [rsp+8h] [rbp-50h]

if ( *a1 <= 0 )
return 0LL;
v18 = 0LL;
while ( 2 )
{
v4 = f;
v5 = (unsigned int *)&qword_1600[2 * (int)f];
v6 = *v5;
switch ( (unsigned int)sub_61(*v5) )
{
case 1u:
f__ret[++f] = HIDWORD(qword_1600[2 * (int)v4]);
f = v4 + 1;
continue;
case 2u:
f[0] = 0;
f = 0;
f = HIDWORD(qword_1600[2 * (int)v4]);
if ( !a2 )
return (int)f__doend();
result = f__workdone;
if ( !f__workdone )
return result;
LODWORD(result) = f__dorevert();
if ( !(_DWORD)result )
continue;
return (int)result;
case 3u:
v14 = f[0];
v15 = f__cnt[f[0]] - 1;
f__cnt[f[0]] = v15;
if ( v15 <= 0 )
{
f[0] = v14 - 1;
--f;
f = v4 + 1;
}
else
{
v16 = f--;
f = f__ret[v16] + 1;
}
continue;
case 6u:
f__cnt[++f[0]] = HIDWORD(qword_1600[2 * (int)v4]);
f = v4 + 1;
continue;
case 8u:
v10 = f__cnt[f[0]];
if ( v10 <= 0 )
{
--f[0];
f = v4 + 1;
continue;
}
if ( !a2 )
return (int)f__doend();
f__cnt[f[0]] = v10 - 1;
f__workdone = 1LL;
v11 = f__doed(v5, a2, a3);
if ( v11 > 0 )
{
_errno_location();
err(a4, *f__elist);
}
if ( v11 >= 0 )
{
LABEL_12:
a2 += a3;
if ( *a1 <= ++v18 )
return 0LL;
continue;
}
if ( f__elist[2] )
*_errno_location() = -1;
else
f__fatal(0xFFFFFFFFLL, "fmt", v12, v13);
return -1LL;
case 9u:
if ( (unsigned int)f__doned(v5) )
{
++f;
continue;
}
++f;
goto LABEL_12;
case 0x10u:
if ( !a2 )
return (int)f__doend();
f = v4 + 1;
continue;
case 0x11u:
case 0x13u:
f__cplus = 0LL;
f = v4 + 1;
continue;
case 0x12u:
f__cplus = 1LL;
f = v4 + 1;
continue;
case 0x14u:
f__scale = HIDWORD(qword_1600[2 * (int)v4]);
f = v4 + 1;
continue;
case 0x15u:
f__cblank = 0LL;
f = v4 + 1;
continue;
case 0x16u:
f__cblank = 1LL;
f = v4 + 1;
continue;
case 0x21u:
f__nonl = 1LL;
f = v4 + 1;
continue;
default:
fprintf(stderr, "unknown code in do_fio: %d\n%s\n", v6, f__fmtbuf);
if ( *f__elist )
{
*_errno_location() = 100;
result = 100LL;
}
else
{
f__fatal(100LL, "do_fio", v8, v9);
result = 100LL;
}
return result;
}
}
}

canonical_decompiled_code:
__int64 __fastcall func10(__int64 *a1, __int64 a2, __int64 a3, float a4)
{
unsigned int v4; // ebp
unsigned int *v5; // rbx
unsigned int v6; // er12
__int64 result; // rax
__int64 v8; // rdx
__int64 v9; // rcx
int v10; // edx
int v11; // eax
__int64 v12; // rdx
__int64 v13; // rcx
int v14; // edx
int v15; // eax
int v16; // eax
__int64 v18; // [rsp+8h] [rbp-50h]

if ( *a1 <= 0 )
return 0LL;
v18 = 0LL;
while ( 2 )
{
v4 = f;
v5 = (unsigned int *)&qword_1600[2 * (int)f];
v6 = *v5;
switch ( (unsigned int)func1(*v5) )
{
case 1u:
f__ret[++f] = HIDWORD(qword_1600[2 * (int)v4]);
f = v4 + 1;
continue;
case 2u:
f[0] = 0;
f = 0;
f = HIDWORD(qword_1600[2 * (int)v4]);
if ( !a2 )
return (int)f__doend();
result = f__workdone;
if ( !f__workdone )
return result;
LODWORD(result) = f__dorevert();
if ( !(_DWORD)result )
continue;
return (int)result;
case 3u:
v14 = f[0];
v15 = f__cnt[f[0]] - 1;
f__cnt[f[0]] = v15;
if ( v15 <= 0 )
{
f[0] = v14 - 1;
--f;
f = v4 + 1;
}
else
{
v16 = f--;
f = f__ret[v16] + 1;
}
continue;
case 6u:
f__cnt[++f[0]] = HIDWORD(qword_1600[2 * (int)v4]);
f = v4 + 1;
continue;
case 8u:
v10 = f__cnt[f[0]];
if ( v10 <= 0 )
{
--f[0];
f = v4 + 1;
continue;
}
if ( !a2 )
return (int)f__doend();
f__cnt[f[0]] = v10 - 1;
f__workdone = 1LL;
v11 = f__doed(v5, a2, a3);
if ( v11 > 0 )
{
_errno_location();
err(a4, *f__elist);
}
if ( v11 >= 0 )
{
LABEL_12:
a2 += a3;
if ( *a1 <= ++v18 )
return 0LL;
continue;
}
if ( f__elist[2] )
*_errno_location() = -1;
else
f__fatal(0xFFFFFFFFLL, "fmt", v12, v13);
return -1LL;
case 9u:
if ( (unsigned int)f__doned(v5) )
{
++f;
continue;
}
++f;
goto LABEL_12;
case 0x10u:
if ( !a2 )
return (int)f__doend();
f = v4 + 1;
continue;
case 0x11u:
case 0x13u:
f__cplus = 0LL;
f = v4 + 1;
continue;
case 0x12u:
f__cplus = 1LL;
f = v4 + 1;
continue;
case 0x14u:
f__scale = HIDWORD(qword_1600[2 * (int)v4]);
f = v4 + 1;
continue;
case 0x15u:
f__cblank = 0LL;
f = v4 + 1;
continue;
case 0x16u:
f__cblank = 1LL;
f = v4 + 1;
continue;
case 0x21u:
f__nonl = 1LL;
f = v4 + 1;
continue;
default:
fprintf(stderr, "unknown code in do_fio: %d\n%s\n", v6, f__fmtbuf);
if ( *f__elist )
{
*_errno_location() = 100;
result = 100LL;
}
else
{
f__fatal(100LL, "do_fio", v8, v9);
result = 100LL;
}
return result;
}
}
}

original_code:
integer do_fio(ftnint *number, char *ptr, ftnlen len)
{ struct syl *p;
 int n,i;
 for(i=0;i<*number;i++,ptr+=len)
 {
loop: switch(type_f((p= &f__syl[f__pc])->op))
 {
 default:
  fprintf(stderr,"unknown code in do_fio: %d\n%s\n",
   p->op,f__fmtbuf);
  {if(f__elist->cierr) (*__errno_location ())= 100; else f__fatal(100,"do_fio"); return(100);};
 case 9:
  if((*f__doned)(p))
  { f__pc++;
   goto loop;
  }
  f__pc++;
  continue;
 case 8:
  if(f__cnt[f__cp]<=0)
  { f__cp--;
   f__pc++;
   goto loop;
  }
  if(ptr==((void *)0))
   return((*f__doend)());
  f__cnt[f__cp]--;
  f__workdone=1;
  if((n=(*f__doed)(p,ptr,len))>0)
   return err__fl((int)f__elist->cierr,(*__errno_location ()),"fmt");
  if(n<0)
   {if(f__elist->ciend) (*__errno_location ())= ((-1)); else f__fatal(((-1)),"fmt"); return(((-1)));};
  continue;
 case 6:
  f__cnt[++f__cp]=p->p1;
  f__pc++;
  goto loop;
 case 1:
  f__ret[++f__rp]=p->p1;
  f__pc++;
  goto loop;
 case 3:
  if(--f__cnt[f__cp]<=0)
  { f__cp--;
   f__rp--;
   f__pc++;
   goto loop;
  }
  f__pc=1+f__ret[f__rp--];
  goto loop;
 case 2:
  f__rp=f__cp=0;
  f__pc = p->p1;
  if(ptr==((void *)0))
   return((*f__doend)());
  if(!f__workdone) return(0);
  if((n=(*f__dorevert)()) != 0) return(n);
  goto loop;
 case 16:
  if(ptr==((void *)0))
   return((*f__doend)());
  f__pc++;
  goto loop;
 case 33:
  f__nonl = 1;
  f__pc++;
  goto loop;
 case 17:
 case 19:
  f__cplus=0;
  f__pc++;
  goto loop;
 case 18:
  f__cplus = 1;
  f__pc++;
  goto loop;
 case 20: f__scale=p->p1;
  f__pc++;
  goto loop;
 case 21:
  f__cblank=0;
  f__pc++;
  goto loop;
 case 22:
  f__cblank=1;
  f__pc++;
  goto loop;
 }
 }
 return(0);
}

canonical_original_code:
long do_fio(long *number, char *ptr, long len)
{ struct syl *p;
 int n; int i;
 for(i=0;i<*number;i++,ptr+=len)
 {
loop: switch(type_f((p= &f__syl[f__pc])->op))
 {
 default:
  fprintf(stderr,"unknown code in do_fio: %d\n%s\n",
   p->op,f__fmtbuf);
  {if(f__elist->cierr) (*__errno_location ())= 100; else f__fatal(100,"do_fio"); return(100);};
 case 9:
  if((*f__doned)(p))
  { f__pc++;
   goto loop;
  }
  f__pc++;
  continue;
 case 8:
  if(f__cnt[f__cp]<=0)
  { f__cp--;
   f__pc++;
   goto loop;
  }
  if(ptr==((void *)0))
   return((*f__doend)());
  f__cnt[f__cp]--;
  f__workdone=1;
  if((n=(*f__doed)(p,ptr,len))>0)
   return err__fl((int)f__elist->cierr,(*__errno_location ()),"fmt");
  if(n<0)
   {if(f__elist->ciend) (*__errno_location ())= ((-1)); else f__fatal(((-1)),"fmt"); return(((-1)));};
  continue;
 case 6:
  f__cnt[++f__cp]=p->p1;
  f__pc++;
  goto loop;
 case 1:
  f__ret[++f__rp]=p->p1;
  f__pc++;
  goto loop;
 case 3:
  if(--f__cnt[f__cp]<=0)
  { f__cp--;
   f__rp--;
   f__pc++;
   goto loop;
  }
  f__pc=1+f__ret[f__rp--];
  goto loop;
 case 2:
  f__rp=f__cp=0;
  f__pc = p->p1;
  if(ptr==((void *)0))
   return((*f__doend)());
  if(!f__workdone) return(0);
  if((n=(*f__dorevert)()) != 0) return(n);
  goto loop;
 case 16:
  if(ptr==((void *)0))
   return((*f__doend)());
  f__pc++;
  goto loop;
 case 33:
  f__nonl = 1;
  f__pc++;
  goto loop;
 case 17:
 case 19:
  f__cplus=0;
  f__pc++;
  goto loop;
 case 18:
  f__cplus = 1;
  f__pc++;
  goto loop;
 case 20: f__scale=p->p1;
  f__pc++;
  goto loop;
 case 21:
  f__cblank=0;
  f__pc++;
  goto loop;
 case 22:
  f__cblank=1;
  f__pc++;
  goto loop;
 }
 }
 return(0);
}

variable_types:
number
long *

variable_types:
ptr
char *

variable_types: len long

variable_types: struct syl { int op; int p1; union { int i[2]; char *s; } p2; } *

variable_types: n int

variable_types: i int

return_type: long


decompiled_code:
__int64 __fastcall en_fio(float a1)
{
__int64 v2; // [rsp+8h] [rbp-10h] BYREF

v2 = 1LL;
return do_fio(&v2, 0LL, 0LL, a1);
}

canonical_decompiled_code:
__int64 __fastcall func11(float a1)
{
__int64 v2; // [rsp+8h] [rbp-10h] BYREF

v2 = 1LL;
return func10(&v2, 0LL, 0LL, a1);
}

original_code:
int
en_fio(void)
{ ftnint one=1;
 return(do_fio(&one,(char *)((void *)0),(ftnint)0));
}

canonical_original_code:
int en_fio()
{ long one = 1;
 return(do_fio(&one,(char *)((void *)0),(long)0));
}

variable_types: one long


decompiled_code:
_DWORD *fmt_bg()
{
_DWORD *result; // rax

f__cursor = 0LL;
f = 0;
f = 0;
f[0] = 0;
f__workdone = 0LL;
f__ret[0] = 0;
result = f__cnt;
f__cnt[0] = 0;
return result;
}

canonical_decompiled_code:
_DWORD *func12()
{
_DWORD *result; // rax

f__cursor = 0LL;
f = 0;
f = 0;
f[0] = 0;
f__workdone = 0LL;
f__ret[0] = 0;
result = f__cnt;
f__cnt[0] = 0;
return result;
}

original_code:
void
fmt_bg(void)
{
 f__workdone=f__cp=f__rp=f__pc=f__cursor=0;
 f__cnt[0]=f__ret[0]=0;
}

canonical_original_code:
void fmt_bg()
{
 f__workdone=f__cp=f__rp=f__pc=f__cursor=0;
 f__cnt[0]=f__ret[0]=0;
}

return_type: void


decompiled_code:
__int64 __fastcall lbit_bits(unsigned __int64 a1, char a2, char a3)
{
return (a1 >> a2) & ~(-1LL << a3);
}

canonical_decompiled_code:
__int64 __fastcall func0(unsigned __int64 a1, char a2, char a3)
{
return (a1 >> a2) & ~(-1LL << a3);
}

original_code:
integer
lbit_bits(integer a, integer b, integer len)
{
 unsigned long x, y;
 x = (unsigned long) a;
 y = (unsigned long)-1L;
 x >>= b;
 y <<= len;
 return (integer)(x & ~y);
 }

canonical_original_code:
long lbit_bits(long a, long b, long len)
{
 unsigned long x; unsigned long y;
 x = (unsigned long) a;
 y = (unsigned long)-1L;
 x >>= b;
 y <<= len;
 return (integer)(x & ~y);
 }

variable_types: a long

variable_types: b long

variable_types:
x
unsigned long

variable_types:
y
unsigned long


original_code:
integer
lbit_cshift(integer a, integer b, integer len)
{
 unsigned long x, y, z;
 x = (unsigned long)a;
 if (len <= 0) {
  if (len == 0)
   return 0;
  goto full_len;
  }
 if (len >= 32) {
 full_len:
  if (b >= 0) {
   b %= 32;
   return (integer)(x << b | x >> 32 -b );
   }
  b = -b;
  b %= 32;
  return (integer)(x << 32 - b | x >> b);
  }
 y = z = (unsigned long)-1;
 y <<= len;
 z &= ~y;
 y &= x;
 x &= z;
 if (b >= 0) {
  b %= len;
  return (integer)(y | z & (x << b | x >> len - b));
  }
 b = -b;
 b %= len;
 return (integer)(y | z & (x >> b | x << len - b));
 }

canonical_original_code:
long lbit_cshift(long a, long b, long len)
{
 unsigned long x; unsigned long y; unsigned long z;
 x = (unsigned long)a;
 if (len <= 0) {
  if (len == 0)
   return 0;
  goto full_len;
  }
 if (len >= 32) {
 full_len:
  if (b >= 0) {
   b %= 32;
   return (integer)(x << b | x >> 32 -b );
   }
  b = -b;
  b %= 32;
  return (integer)(x << 32 - b | x >> b);
  }
 y = z = (unsigned long)-1;
 y <<= len;
 z &= ~y;
 y &= x;
 x &= z;
 if (b >= 0) {
  b %= len;
  return (integer)(y | z & (x << b | x >> len - b));
  }
 b = -b;
 b %= len;
 return (integer)(y | z & (x >> b | x << len - b));
 }

variable_types:
z
unsigned long


decompiled_code:
void __fastcall derf_(double *a1)
{
erf(*a1);
}

canonical_decompiled_code:
void __fastcall func0(double *a1)
{
erf(*a1);
}

original_code:
double derf_(doublereal *x)
{
return( erf(*x) );
}

canonical_original_code:
double derf_(double *x)
{
return( erf(*x) );
}

variable_types:
x
double *

return_type: double


decompiled_code:
void __fastcall d_tanh(double *a1)
{
tanh(*a1);
}

canonical_decompiled_code:
void __fastcall func0(double *a1)
{
tanh(*a1);
}

original_code:
double d_tanh(doublereal *x)
{
return( tanh(*x) );
}

canonical_original_code:
double d_tanh(double *x)
{
return( tanh(*x) );
}


original_code:
void c_div(complex *c, complex *a, complex *b)
{
 double ratio, den;
 double abr, abi, cr;
 if( (abr = b->r) < 0.)
  abr = - abr;
 if( (abi = b->i) < 0.)
  abi = - abi;
 if( abr <= abi )
  {
  if(abi == 0) {
   sig_die("complex division by zero", 1);
   }
  ratio = (double)b->r / b->i ;
  den = b->i * (1 + ratio*ratio);
  cr = (a->r*ratio + a->i) / den;
  c->i = (a->i*ratio - a->r) / den;
  }
 else
  {
  ratio = (double)b->i / b->r ;
  den = b->r * (1 + ratio*ratio);
  cr = (a->r + a->i*ratio) / den;
  c->i = (a->i - a->r*ratio) / den;
  }
 c->r = cr;
 }

canonical_original_code:
void c_div(struct complex *c, struct complex *a, struct complex *b)
{
 double ratio; double den;
 double abr; double abi; double cr;
 if( (abr = b->r) < 0.)
  abr = - abr;
 if( (abi = b->i) < 0.)
  abi = - abi;
 if( abr <= abi )
  {
  if(abi == 0) {
   sig_die("complex division by zero", 1);
   }
  ratio = (double)b->r / b->i ;
  den = b->i * (1 + ratio*ratio);
  cr = (a->r*ratio + a->i) / den;
  c->i = (a->i*ratio - a->r) / den;
  }
 else
  {
  ratio = (double)b->i / b->r ;
  den = b->r * (1 + ratio*ratio);
  cr = (a->r + a->i*ratio) / den;
  c->i = (a->i - a->r*ratio) / den;
  }
 c->r = cr;
 }

variable_types:
c
struct complex { float r; } *

variable_types:
a
struct complex *

variable_types:
b
struct complex *

variable_types: ratio double

variable_types: den double

variable_types: abr double


decompiled_code:
__int64 __fastcall ef1cmc_(__int64 a1, _QWORD *a2, __int64 a3, _QWORD *a4)
{
return s_cmp(a1, a3, *a2, *a4);
}

canonical_decompiled_code:
__int64 __fastcall func0(__int64 a1, _QWORD *a2, __int64 a3, _QWORD *a4)
{
return s_cmp(a1, a3, *a2, *a4);
}

original_code:
integer ef1cmc_(ftnint *a, ftnlen *la, ftnint *b, ftnlen *lb)
{
return( s_cmp( (char *)a, (char *)b, *la, *lb) );
}

canonical_original_code:
long ef1cmc_(long *a, long *la, long *b, long *lb)
{
return( s_cmp( (char *)a, (char *)b, *la, *lb) );
}

variable_types:
a
long *

variable_types:
la
long *

variable_types:
b
long *

variable_types:
lb
long *


decompiled_code:
__int64 __fastcall s_wsne(_QWORD *a1)
{
__int64 result; // rax
int *v2; // rax

LODWORD(result) = c_le();
if ( (_DWORD)result )
return (int)result;
f__reading = 0LL;
f__external = 1LL;
f__formatted = 1LL;
f__putn = &x_putc;
L_len = 80LL;
f__donewrec = &x_wSL;
if ( *(_QWORD *)(f__curunit + 72LL) != 1LL && (unsigned int)f__nowwriting() )
{
if ( !*a1 )
{
v2 = _errno_location();
f__fatal((unsigned int)*v2, "namelist output start");
}
result = *_errno_location();
}
else
{
x_wsne(a1);
result = e_wsle();
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func0(_QWORD *a1)
{
__int64 result; // rax
int *v2; // rax

LODWORD(result) = c_le();
if ( (_DWORD)result )
return (int)result;
f__reading = 0LL;
f__external = 1LL;
f__formatted = 1LL;
f__putn = &x_putc;
L_len = 80LL;
f__donewrec = &x_wSL;
if ( *(_QWORD *)(f__curunit + 72LL) != 1LL && (unsigned int)f__nowwriting() )
{
if ( !*a1 )
{
v2 = _errno_location();
f__fatal((unsigned int)*v2, "namelist output start");
}
result = *_errno_location();
}
else
{
x_wsne(a1);
result = e_wsle();
}
return result;
}

original_code:
integer
s_wsne(cilist *a)
{
 int n;
 if(n=c_le(a))
  return(n);
 f__reading=0;
 f__external=1;
 f__formatted=1;
 f__putn = x_putc;
 L_len = 80;
 f__donewrec = x_wSL;
 if(f__curunit->uwrt != 1 && f__nowwriting(f__curunit))
  {if(a->cierr) (*__errno_location ())= (*__errno_location ()); else f__fatal((*__errno_location ()),"namelist output start"); return((*__errno_location ()));};
 x_wsne(a);
 return e_wsle();
 }

canonical_original_code:
long s_wsne(struct cilist *a)
{
 int n;
 if(n=c_le(a))
  return(n);
 f__reading=0;
 f__external=1;
 f__formatted=1;
 f__putn = x_putc;
 L_len = 80;
 f__donewrec = x_wSL;
 if(f__curunit->uwrt != 1 && f__nowwriting(f__curunit))
  {if(a->cierr) (*__errno_location ())= (*__errno_location ()); else f__fatal((*__errno_location ()),"namelist output start"); return((*__errno_location ()));};
 x_wsne(a);
 return e_wsle();
 }

variable_types: struct cilist { long cierr; long ciunit; long ciend; char *cifmt; long cirec; } *

variable_types: n int


decompiled_code:
double __fastcall r_imag(__int64 a1)
{
return *(float *)(a1 + 4);
}

canonical_decompiled_code:
double __fastcall func0(__int64 a1)
{
return *(float *)(a1 + 4);
}

original_code:
double r_imag(complex *z)
{
return(z->i);
}

canonical_original_code:
double r_imag(struct complex *z)
{
return(z->i);
}

variable_types:
z
struct complex { float r; } *


decompiled_code:
__int64 __fastcall b_char(__int64 a1, __int64 a2, __int64 a3)
{
__int64 result; // rax
_BYTE *v7; // rdx
char v8; // cl
_BYTE *v9; // rsi

result = 0LL;
if ( a3 > 0 )
{
while ( 1 )
{
v7 = (_BYTE *)(a2 + result);
v8 = *(_BYTE *)(a1 + result);
if ( !v8 )
break;
*(_BYTE *)(a2 + result++) = v8;
if ( result == a3 )
return result;
}
result = (int)result;
if ( a3 > (int)result )
{
v9 = &v7[a3 - (int)result];
do
*v7++ = 32;
while ( v7 != v9 );
}
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func0(__int64 a1, __int64 a2, __int64 a3)
{
__int64 result; // rax
_BYTE *v7; // rdx
char v8; // cl
_BYTE *v9; // rsi

result = 0LL;
if ( a3 > 0 )
{
while ( 1 )
{
v7 = (_BYTE *)(a2 + result);
v8 = *(_BYTE *)(a1 + result);
if ( !v8 )
break;
*(_BYTE *)(a2 + result++) = v8;
if ( result == a3 )
return result;
}
result = (int)result;
if ( a3 > (int)result )
{
v9 = &v7[a3 - (int)result];
do
*v7++ = 32;
while ( v7 != v9 );
}
}
return result;
}

original_code:
void
b_char(const char *a, char *b, ftnlen blen)
{ int i;
 for(i=0;i<blen && *a!=0;i++) *b++= *a++;
 for(;i<blen;i++) *b++=' ';
}

canonical_original_code:
void b_char(char *a, char *b, long blen)
{ int i;
 for(i=0;i<blen && *a!=0;i++) *b++= *a++;
 for(;i<blen;i++) *b++=' ';
}

variable_types:
a
char *

variable_types:
b
char *

variable_types: blen long

variable_types: i int


decompiled_code:
__ino64_t __fastcall f__inode(const char *a1, _DWORD *a2)
{
struct stat64 v3; // [rsp+0h] [rbp-98h] BYREF

if ( stat64(a1, &v3) < 0 )
return -1LL;
*a2 = v3.st_dev;
return v3.st_ino;
}

canonical_decompiled_code:
__ino64_t __fastcall func1(const char *a1, _DWORD *a2)
{
struct stat64 v3; // [rsp+0h] [rbp-98h] BYREF

if ( stat64(a1, &v3) < 0 )
return -1LL;
*a2 = v3.st_dev;
return v3.st_ino;
}

original_code:
long f__inode(char *a, int *dev)
{ struct stat64 x;
 if(stat64(a,&x)<0) return(-1);
 *dev = x.st_dev;
 return(x.st_ino);
}

variable_types:
dev
int *

variable_types: struct stat64 { unsigned long st_dev; unsigned long st_ino; unsigned long st_nlink; unsigned int st_mode; unsigned int st_uid; unsigned int st_gid; int __pad0; unsigned long st_rdev; long st_size; long st_blksize; long st_blocks; struct timespec { long tv_sec; long tv_nsec; } st_atim; struct timespec st_mtim; struct timespec st_ctim; long __glibc_reserved[3]; }

user_defined_types: struct stat64 { unsigned long st_dev; unsigned long st_ino; unsigned long st_nlink; unsigned int st_mode; unsigned int st_uid; unsigned int st_gid; int __pad0; unsigned long st_rdev; long st_size; long st_blksize; long st_blocks; struct timespec st_atim; struct timespec st_mtim; struct timespec st_ctim; long __glibc_reserved[3]; }


decompiled_code:
void __fastcall r_tan(float *a1)
{
tan(*a1);
}

canonical_decompiled_code:
void __fastcall func0(float *a1)
{
tan(*a1);
}

original_code:
double r_tan(real *x)
{
return( tan(*x) );
}

canonical_original_code:
double r_tan(float *x)
{
return( tan(*x) );
}

variable_types:
x
float *


decompiled_code:
__int64 __fastcall c_sue(_QWORD *a1)
{
unsigned __int64 v1; // rdx
unsigned int v2; // edx

f__sequential = 1LL;
f__external = 1LL;
f__formatted = 0LL;
v1 = a1[1];
f__curunit = &f__units[11 * v1];
if ( v1 <= 0x63 )
{
f__elist = a1;
if ( !f__units[11 * v1] && (unsigned int)fk_open(3LL, 6LL) )
{
if ( *a1 )
*_errno_location() = 114;
else
f__fatal(114LL, "sue");
return 114;
}
f = (_QWORD (__fastcall *)(char, float))*f__curunit;
if ( f__curunit[5] )
{
if ( !*a1 )
goto LABEL_19;
}
else
{
v2 = 0;
if ( f__curunit[4] )
return v2;
if ( !*a1 )
{
LABEL_19:
f__fatal(103LL, "sue");
return 103;
}
}
*_errno_location() = 103;
return 103;
}
if ( *a1 )
*_errno_location() = 101;
else
f__fatal(101LL, "startio");
return 101;
}

canonical_decompiled_code:
__int64 __fastcall func0(_QWORD *a1)
{
unsigned __int64 v1; // rdx
unsigned int v2; // edx

f__sequential = 1LL;
f__external = 1LL;
f__formatted = 0LL;
v1 = a1[1];
f__curunit = &f__units[11 * v1];
if ( v1 <= 0x63 )
{
f__elist = a1;
if ( !f__units[11 * v1] && (unsigned int)fk_open(3LL, 6LL) )
{
if ( *a1 )
*_errno_location() = 114;
else
f__fatal(114LL, "sue");
return 114;
}
f = (_QWORD (__fastcall *)(char, float))*f__curunit;
if ( f__curunit[5] )
{
if ( !*a1 )
goto LABEL_19;
}
else
{
v2 = 0;
if ( f__curunit[4] )
return v2;
if ( !*a1 )
{
LABEL_19:
f__fatal(103LL, "sue");
return 103;
}
}
*_errno_location() = 103;
return 103;
}
if ( *a1 )
*_errno_location() = 101;
else
f__fatal(101LL, "startio");
return 101;
}

original_code:
int
c_sue(cilist *a)
{
 f__external=f__sequential=1;
 f__formatted=0;
 f__curunit = &f__units[a->ciunit];
 if(a->ciunit >= 100 || a->ciunit < 0)
  {if(a->cierr) (*__errno_location ())= 101; else f__fatal(101,"startio"); return(101);};
 f__elist=a;
 if(f__curunit->ufd==((void *)0) && fk_open(3,6,a->ciunit))
  {if(a->cierr) (*__errno_location ())= 114; else f__fatal(114,"sue"); return(114);};
 f__cf=f__curunit->ufd;
 if(f__curunit->ufmt) {if(a->cierr) (*__errno_location ())= 103; else f__fatal(103,"sue"); return(103);}
 if(!f__curunit->useek) {if(a->cierr) (*__errno_location ())= 103; else f__fatal(103,"sue"); return(103);}
 return(0);
}

canonical_original_code:
int c_sue(struct cilist *a)
{
 f__external=f__sequential=1;
 f__formatted=0;
 f__curunit = &f__units[a->ciunit];
 if(a->ciunit >= 100 || a->ciunit < 0)
  {if(a->cierr) (*__errno_location ())= 101; else f__fatal(101,"startio"); return(101);};
 f__elist=a;
 if(f__curunit->ufd==((void *)0) && fk_open(3,6,a->ciunit))
  {if(a->cierr) (*__errno_location ())= 114; else f__fatal(114,"sue"); return(114);};
 f__cf=f__curunit->ufd;
 if(f__curunit->ufmt) {if(a->cierr) (*__errno_location ())= 103; else f__fatal(103,"sue"); return(103);}
 if(!f__curunit->useek) {if(a->cierr) (*__errno_location ())= 103; else f__fatal(103,"sue"); return(103);}
 return(0);
}

user_defined_types: struct cilist { long cierr; long ciunit; long ciend; char *cifmt; long cirec; }


decompiled_code:
__int64 __fastcall s_rsue(_QWORD *a1)
{
__int64 result; // rax
size_t v2; // rdx
int *v3; // rax
int *v4; // rax

if ( !f__init )
f_init();
f__reading = 1LL;
LODWORD(result) = c_sue(a1);
if ( (_DWORD)result )
return (int)result;
f__recpos = 0;
if ( f__curunit[9] && (unsigned int)f__nowreading() )
{
if ( !*a1 )
{
v3 = _errno_location();
f__fatal((unsigned int)*v3, "read start");
}
return *_errno_location();
}
v2 = fread(&f__reclen, 8uLL, 1uLL, (FILE *)f);
result = 0LL;
if ( v2 != 1 )
{
if ( !feof((FILE *)f) )
{
clearerr((FILE *)f);
if ( !*a1 )
{
v4 = _errno_location();
f__fatal((unsigned int)*v4, "start");
}
return *_errno_location();
}
f__curunit[8] = 1LL;
if ( a1[2] )
*_errno_location() = -1;
else
f__fatal(0xFFFFFFFFLL, "start");
result = -1LL;
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func1(_QWORD *a1)
{
__int64 result; // rax
size_t v2; // rdx
int *v3; // rax
int *v4; // rax

if ( !f__init )
f_init();
f__reading = 1LL;
LODWORD(result) = func0(a1);
if ( (_DWORD)result )
return (int)result;
f__recpos = 0;
if ( f__curunit[9] && (unsigned int)f__nowreading() )
{
if ( !*a1 )
{
v3 = _errno_location();
f__fatal((unsigned int)*v3, "read start");
}
return *_errno_location();
}
v2 = fread(&f__reclen, 8uLL, 1uLL, (FILE *)f);
result = 0LL;
if ( v2 != 1 )
{
if ( !feof((FILE *)f) )
{
clearerr((FILE *)f);
if ( !*a1 )
{
v4 = _errno_location();
f__fatal((unsigned int)*v4, "start");
}
return *_errno_location();
}
f__curunit[8] = 1LL;
if ( a1[2] )
*_errno_location() = -1;
else
f__fatal(0xFFFFFFFFLL, "start");
result = -1LL;
}
return result;
}

original_code:
integer s_rsue(cilist *a)
{
 int n;
 if(!f__init) f_init();
 f__reading=1;
 if(n=c_sue(a)) return(n);
 f__recpos=0;
 if(f__curunit->uwrt && f__nowreading(f__curunit))
  {if(a->cierr) (*__errno_location ())= (*__errno_location ()); else f__fatal((*__errno_location ()),"read start"); return((*__errno_location ()));};
 if(fread((char *)&f__reclen,sizeof(uiolen),1,f__cf)
  != 1)
 { if(feof(f__cf))
  { f__curunit->uend = 1;
   {if(a->ciend) (*__errno_location ())= (-1); else f__fatal((-1),"start"); return((-1));};
  }
  clearerr(f__cf);
  {if(a->cierr) (*__errno_location ())= (*__errno_location ()); else f__fatal((*__errno_location ()),"start"); return((*__errno_location ()));};
 }
 return(0);
}

canonical_original_code:
long s_rsue(struct cilist *a)
{
 int n;
 if(!f__init) f_init();
 f__reading=1;
 if(n=c_sue(a)) return(n);
 f__recpos=0;
 if(f__curunit->uwrt && f__nowreading(f__curunit))
  {if(a->cierr) (*__errno_location ())= (*__errno_location ()); else f__fatal((*__errno_location ()),"read start"); return((*__errno_location ()));};
 if(fread((char *)&f__reclen,sizeof(uiolen),1,f__cf)
  != 1)
 { if(feof(f__cf))
  { f__curunit->uend = 1;
   {if(a->ciend) (*__errno_location ())= (-1); else f__fatal((-1),"start"); return((-1));};
  }
  clearerr(f__cf);
  {if(a->cierr) (*__errno_location ())= (*__errno_location ()); else f__fatal((*__errno_location ()),"start"); return((*__errno_location ()));};
 }
 return(0);
}


decompiled_code:
__int64 __fastcall s_wsue(_QWORD *a1)
{
__int64 result; // rax
int *v2; // rax

if ( !f__init )
f_init();
LODWORD(result) = c_sue(a1);
if ( (_DWORD)result )
return (int)result;
f__reading = 0LL;
f__reclen = 0LL;
if ( f__curunit[9] != 1LL && (unsigned int)f__nowwriting() )
{
if ( !*a1 )
{
v2 = _errno_location();
f__fatal((unsigned int)*v2, "write start");
}
result = *_errno_location();
}
else
{
f__recloc = ftello64((FILE *)f);
fseeko64((FILE *)f, 8LL, 1);
result = 0LL;
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func2(_QWORD *a1)
{
__int64 result; // rax
int *v2; // rax

if ( !f__init )
f_init();
LODWORD(result) = func0(a1);
if ( (_DWORD)result )
return (int)result;
f__reading = 0LL;
f__reclen = 0LL;
if ( f__curunit[9] != 1LL && (unsigned int)f__nowwriting() )
{
if ( !*a1 )
{
v2 = _errno_location();
f__fatal((unsigned int)*v2, "write start");
}
result = *_errno_location();
}
else
{
f__recloc = ftello64((FILE *)f);
fseeko64((FILE *)f, 8LL, 1);
result = 0LL;
}
return result;
}

original_code:
integer s_wsue(cilist *a)
{
 int n;
 if(!f__init) f_init();
 if(n=c_sue(a)) return(n);
 f__reading=0;
 f__reclen=0;
 if(f__curunit->uwrt != 1 && f__nowwriting(f__curunit))
  {if(a->cierr) (*__errno_location ())= (*__errno_location ()); else f__fatal((*__errno_location ()),"write start"); return((*__errno_location ()));};
 f__recloc=ftello64(f__cf);
 fseeko64(f__cf,(__off64_t)sizeof(uiolen),1);
 return(0);
}

canonical_original_code:
long s_wsue(struct cilist *a)
{
 int n;
 if(!f__init) f_init();
 if(n=c_sue(a)) return(n);
 f__reading=0;
 f__reclen=0;
 if(f__curunit->uwrt != 1 && f__nowwriting(f__curunit))
  {if(a->cierr) (*__errno_location ())= (*__errno_location ()); else f__fatal((*__errno_location ()),"write start"); return((*__errno_location ()));};
 f__recloc=ftello64(f__cf);
 fseeko64(f__cf,(long)sizeof(uiolen),1);
 return(0);
}


decompiled_code:
__int64 e_wsue()
{
__off64_t v0; // rbp

fwrite(&f__reclen, 8uLL, 1uLL, (FILE *)f);
v0 = ftello64((FILE *)f);
fseeko64((FILE *)f, f__recloc, 0);
fwrite(&f__reclen, 8uLL, 1uLL, (FILE *)f);
fseeko64((FILE *)f, v0, 0);
return 0LL;
}

canonical_decompiled_code:
__int64 func3()
{
__off64_t v0; // rbp

fwrite(&f__reclen, 8uLL, 1uLL, (FILE *)f);
v0 = ftello64((FILE *)f);
fseeko64((FILE *)f, f__recloc, 0);
fwrite(&f__reclen, 8uLL, 1uLL, (FILE *)f);
fseeko64((FILE *)f, v0, 0);
return 0LL;
}

original_code:
integer e_wsue(void)
{ __off64_t loc;
 fwrite((char *)&f__reclen,sizeof(uiolen),1,f__cf);
 loc=ftello64(f__cf);
 fseeko64(f__cf,f__recloc,0);
 fwrite((char *)&f__reclen,sizeof(uiolen),1,f__cf);
 fseeko64(f__cf,loc,0);
 return(0);
}

canonical_original_code:
long e_wsue()
{ long loc;
 fwrite((char *)&f__reclen,sizeof(uiolen),1,f__cf);
 loc=ftello64(f__cf);
 fseeko64(f__cf,f__recloc,0);
 fwrite((char *)&f__reclen,sizeof(uiolen),1,f__cf);
 fseeko64(f__cf,loc,0);
 return(0);
}

variable_types: loc long


decompiled_code:
__int64 e_rsue()
{
fseeko64((FILE *)f, f__reclen - f__recpos + 8LL, 1);
return 0LL;
}

canonical_decompiled_code:
__int64 func4()
{
fseeko64((FILE *)f, f__reclen - f__recpos + 8LL, 1);
return 0LL;
}

original_code:
integer e_rsue(void)
{
 fseeko64(f__cf,(__off64_t)(f__reclen-f__recpos+sizeof(uiolen)),1);
 return(0);
}

canonical_original_code:
long e_rsue()
{
 fseeko64(f__cf,(__off64_t)(f__reclen-f__recpos+sizeof(uiolen)),1);
 return(0);
}


decompiled_code:
double __fastcall r_dim(float *a1, float *a2)
{
double v3; // [rsp+0h] [rbp-18h]

if ( *a1 <= *a2 )
v3 = 0.0;
else
v3 = (float)(*a1 - *a2);
return v3;
}

canonical_decompiled_code:
double __fastcall func0(float *a1, float *a2)
{
double v3; // [rsp+0h] [rbp-18h]

if ( *a1 <= *a2 )
v3 = 0.0;
else
v3 = (float)(*a1 - *a2);
return v3;
}

original_code:
double r_dim(real *a, real *b)
{
return( *a > *b ? *a - *b : 0);
}

canonical_original_code:
double r_dim(float *a, float *b)
{
return( *a > *b ? *a - *b : 0);
}

variable_types:
a
float *

variable_types:
b
float *


decompiled_code:
_BOOL8 hl_le()
{
return s_cmp() <= 0;
}

canonical_decompiled_code:
_BOOL8 func0()
{
return s_cmp() <= 0;
}

original_code:
shortlogical hl_le(char *a, char *b, ftnlen la, ftnlen lb)
{
return(s_cmp(a,b,la,lb) <= 0);
}

canonical_original_code:
short hl_le(char *a, char *b, long la, long lb)
{
return(s_cmp(a,b,la,lb) <= 0);
}

variable_types: la long

variable_types: lb long

return_type: short


decompiled_code:
void __fastcall __noreturn s_stop(char *a1, __int64 a2)
{
char *v2; // rbx

if ( a2 > 0 )
{
v2 = a1;
fwrite("STOP ", 1uLL, 5uLL, stderr);
do
putc(*v2++, stderr);
while ( &a1[a2] != v2 );
fwrite(" statement executed\n", 1uLL, 0x14uLL, stderr);
}
exit(0);
}

canonical_decompiled_code:
void __fastcall __noreturn func0(char *a1, __int64 a2)
{
char *v2; // rbx

if ( a2 > 0 )
{
v2 = a1;
fwrite("STOP ", 1uLL, 5uLL, stderr);
do
putc(*v2++, stderr);
while ( &a1[a2] != v2 );
fwrite(" statement executed\n", 1uLL, 0x14uLL, stderr);
}
exit(0);
}

original_code:
int s_stop(char *s, ftnlen n)
{
int i;
if(n > 0)
 {
 fprintf(stderr, "STOP ");
 for(i = 0; i<n ; ++i)
  putc(*s++, stderr);
 fprintf(stderr, " statement executed\n");
 }
exit(0);
return 0;
}

canonical_original_code:
int s_stop(char *s, long n)
{
int i;
if(n > 0)
 {
 fprintf(stderr, "STOP ");
 for(i = 0; i<n ; ++i)
  putc(*s++, stderr);
 fprintf(stderr, " statement executed\n");
 }
exit(0);
return 0;
}

variable_types:
s
char *

variable_types: n long


decompiled_code:
void __fastcall r_cos(float *a1)
{
cos(*a1);
}

canonical_decompiled_code:
void __fastcall func0(float *a1)
{
cos(*a1);
}

original_code:
double r_cos(real *x)
{
return( cos(*x) );
}

canonical_original_code:
double r_cos(float *x)
{
return( cos(*x) );
}


decompiled_code:
__int64 __fastcall l_write(__int64 *a1, __int16 *a2, __int64 a3, int a4)
{
__int64 v8; // rbp
__int64 v9; // rdi
__int64 result; // rax
double v11; // [rsp+0h] [rbp-60h]
double v12; // [rsp+8h] [rbp-58h]
double v13; // [rsp+10h] [rbp-50h]

if ( *a1 <= 0 )
return 0LL;
v8 = 0LL;
while ( 2 )
{
switch ( a4 )
{
case 2:
v9 = *a2;
goto LABEL_5;
case 3:
v9 = *(_QWORD *)a2;
goto LABEL_5;
case 4:
v13 = *(float *)a2;
goto LABEL_11;
case 5:
v13 = *(double *)a2;
LABEL_11:
sub_3B7(v13);
goto LABEL_6;
case 6:
v12 = *(float *)a2;
v11 = *((float *)a2 + 1);
goto LABEL_14;
case 7:
v12 = *(double *)a2;
v11 = *((double *)a2 + 1);
LABEL_14:
sub_3FE(v12, v11);
goto LABEL_6;
case 8:
case 12:
case 13:
sub_532(*(_QWORD *)a2, a3);
goto LABEL_6;
case 9:
sub_1F(a2, a3);
goto LABEL_6;
case 11:
goto LABEL_4;
default:
f__fatal(117LL, "unknown type in lio");
LABEL_4:
v9 = *(char *)a2;
LABEL_5:
sub_1E7(v9);
LABEL_6:
a2 = (__int16 *)((char *)a2 + a3);
if ( *a1 > ++v8 )
continue;
result = 0LL;
break;
}
return result;
}
}

canonical_decompiled_code:
__int64 __fastcall func5(__int64 *a1, __int16 *a2, __int64 a3, int a4)
{
__int64 v8; // rbp
__int64 v9; // rdi
__int64 result; // rax
double v11; // [rsp+0h] [rbp-60h]
double v12; // [rsp+8h] [rbp-58h]
double v13; // [rsp+10h] [rbp-50h]

if ( *a1 <= 0 )
return 0LL;
v8 = 0LL;
while ( 2 )
{
switch ( a4 )
{
case 2:
v9 = *a2;
goto LABEL_5;
case 3:
v9 = *(_QWORD *)a2;
goto LABEL_5;
case 4:
v13 = *(float *)a2;
goto LABEL_11;
case 5:
v13 = *(double *)a2;
LABEL_11:
sub_3B7(v13);
goto LABEL_6;
case 6:
v12 = *(float *)a2;
v11 = *((float *)a2 + 1);
goto LABEL_14;
case 7:
v12 = *(double *)a2;
v11 = *((double *)a2 + 1);
LABEL_14:
func3(v12, v11);
goto LABEL_6;
case 8:
case 12:
case 13:
func4(*(_QWORD *)a2, a3);
goto LABEL_6;
case 9:
sub_1F(a2, a3);
goto LABEL_6;
case 11:
goto LABEL_4;
default:
f__fatal(117LL, "unknown type in lio");
LABEL_4:
v9 = *(char *)a2;
LABEL_5:
func1(v9);
LABEL_6:
a2 = (__int16 *)((char *)a2 + a3);
if ( *a1 > ++v8 )
continue;
result = 0LL;
break;
}
return result;
}
}

original_code:
int
l_write(ftnint *number, char *ptr, ftnlen len, ftnint type)
{
 int i;
 long x;
 double y,z;
 real *xx;
 doublereal *yy;
 for(i=0;i< *number; i++)
 {
  switch((int)type)
  {
  default: f__fatal(117,"unknown type in lio");
  case 11:
   x = ((flex *)ptr)->flchar;
   goto xint;
  case 2:
   x=((flex *)ptr)->flshort;
   goto xint;
  case 3:
   x=((flex *)ptr)->flint;
  xint: lwrt_I(x);
   break;
  case 4:
   y=((flex *)ptr)->flreal;
   goto xfloat;
  case 5:
   y=((flex *)ptr)->fldouble;
  xfloat: lwrt_F(y);
   break;
  case 6:
   xx= &((flex *)ptr)->flreal;
   y = *xx++;
   z = *xx;
   goto xcomplex;
  case 7:
   yy = &((flex *)ptr)->fldouble;
   y= *yy++;
   z = *yy;
  xcomplex:
   lwrt_C(y,z);
   break;
  case 12:
   x = ((flex *)ptr)->flchar;
   goto xlog;
  case 13:
   x = ((flex *)ptr)->flshort;
   goto xlog;
  case 8:
   x = ((flex *)ptr)->flint;
  xlog: lwrt_L(((flex *)ptr)->flint, len);
   break;
  case 9:
   lwrt_A(ptr,len);
   break;
  }
  ptr += len;
 }
 return(0);
}

canonical_original_code:
int l_write(long *number, char *ptr, long len, long type)
{
 int i;
 long x;
 double y; double z;
 float *xx;
 double *yy;
 for(i=0;i< *number; i++)
 {
  switch((int)type)
  {
  default: f__fatal(117,"unknown type in lio");
  case 11:
   x = ((union flex *)ptr)->flchar;
   goto xint;
  case 2:
   x=((union flex *)ptr)->flshort;
   goto xint;
  case 3:
   x=((union flex *)ptr)->flint;
  xint: lwrt_I(x);
   break;
  case 4:
   y=((union flex *)ptr)->flreal;
   goto xfloat;
  case 5:
   y=((union flex *)ptr)->fldouble;
  xfloat: lwrt_F(y);
   break;
  case 6:
   xx= &((union flex *)ptr)->flreal;
   y = *xx++;
   z = *xx;
   goto xcomplex;
  case 7:
   yy = &((union flex *)ptr)->fldouble;
   y= *yy++;
   z = *yy;
  xcomplex:
   lwrt_C(y,z);
   break;
  case 12:
   x = ((union flex *)ptr)->flchar;
   goto xlog;
  case 13:
   x = ((union flex *)ptr)->flshort;
   goto xlog;
  case 8:
   x = ((union flex *)ptr)->flint;
  xlog: lwrt_L(((union flex *)ptr)->flint, len);
   break;
  case 9:
   lwrt_A(ptr,len);
   break;
  }
  ptr += len;
 }
 return(0);
}

variable_types:
number
long *

variable_types:
ptr
char *

variable_types: len long

variable_types: type long

variable_types: x long

variable_types: y double

variable_types: z double

variable_types:
xx
float *

variable_types:
yy
double *

user_defined_types: union flex { char flchar; short flshort; long flint; float flreal; double fldouble; }


decompiled_code:
__int64 __fastcall i_sceiling(float *a1)
{
int v1; // eax
_BOOL4 v2; // edx

v1 = (int)*a1;
v2 = 0;
if ( *a1 > 0.0 )
v2 = *a1 != (float)v1;
return v2 + v1;
}

canonical_decompiled_code:
__int64 __fastcall func0(float *a1)
{
int v1; // eax
_BOOL4 v2; // edx

v1 = (int)*a1;
v2 = 0;
if ( *a1 > 0.0 )
v2 = *a1 != (float)v1;
return v2 + v1;
}

original_code:
integer i_sceiling(real *x)
{
    return (integer) ((int)(*x) + ((*x) > 0 && (*x) != (int)(*x)));
}

canonical_original_code:
long i_sceiling(float *x)
{
    return (integer) ((int)(*x) + ((*x) > 0 && (*x) != (int)(*x)));
}

variable_types:
x
float *


decompiled_code:
__int64 __fastcall i_dceiling(double *a1)
{
int v1; // eax
_BOOL4 v2; // edx

v1 = (int)*a1;
v2 = 0;
if ( *a1 > 0.0 )
v2 = *a1 != (double)v1;
return v2 + v1;
}

canonical_decompiled_code:
__int64 __fastcall func1(double *a1)
{
int v1; // eax
_BOOL4 v2; // edx

v1 = (int)*a1;
v2 = 0;
if ( *a1 > 0.0 )
v2 = *a1 != (double)v1;
return v2 + v1;
}

original_code:
integer i_dceiling(doublereal *x)
{
    return (integer) ((int)(*x) + ((*x) > 0 && (*x) != (int)(*x)));
}

canonical_original_code:
long i_dceiling(double *x)
{
    return (integer) ((int)(*x) + ((*x) > 0 && (*x) != (int)(*x)));
}

variable_types:
x
double *


original_code:
double pow_ri(real *ap, integer *bp)
{
double pow, x;
integer n;
unsigned long u;
pow = 1;
x = *ap;
n = *bp;
if(n != 0)
 {
 if(n < 0)
  {
  n = -n;
  x = 1/x;
  }
 for(u = n; ; )
  {
  if(u & 01)
   pow *= x;
  if(u >>= 1)
   x *= x;
  else
   break;
  }
 }
return(pow);
}

canonical_original_code:
double pow_ri(float *ap, long *bp)
{
double pow; double x;
long n;
unsigned long u;
pow = 1;
x = *ap;
n = *bp;
if(n != 0)
 {
 if(n < 0)
  {
  n = -n;
  x = 1/x;
  }
 for(u = n; ; )
  {
  if(u & 01)
   pow *= x;
  if(u >>= 1)
   x *= x;
  else
   break;
  }
 }
return(pow);
}

variable_types:
ap
float *

variable_types:
bp
long *

variable_types: pow double

variable_types: x double

variable_types:
u
unsigned long


decompiled_code:
void __fastcall d_cosh(double *a1)
{
cosh(*a1);
}

canonical_decompiled_code:
void __fastcall func0(double *a1)
{
cosh(*a1);
}

original_code:
double d_cosh(doublereal *x)
{
return( cosh(*x) );
}

canonical_original_code:
double d_cosh(double *x)
{
return( cosh(*x) );
}


original_code:
int
wrt_E(ufloat *p, int w, int d, int e, ftnlen len)
{
 char buf[40 +8 +4], *s, *se;
 int d1, delta, e1, i, sign, signspace;
 double dd;
 int e0 = e;
 if(e <= 0)
  e = 2;
 if(f__scale) {
  if(f__scale >= d + 2 || f__scale <= -d)
   goto nogood;
  }
 if(f__scale <= 0)
  --d;
 if (len == sizeof(real))
  dd = p->pf;
 else
  dd = p->pd;
 if (dd < 0.) {
  signspace = sign = 1;
  dd = -dd;
  }
 else {
  sign = 0;
  signspace = (int)f__cplus;
  if (!dd) {
   dd = 0.;
   }
  }
 delta = w - (2
   + 2 + signspace + d + e);
 if (delta < 0) {
nogood:
  while(--w >= 0)
   (*f__putn)('*');
  return(0);
  }
 if (f__scale < 0)
  d += f__scale;
 if (d > 40) {
  d1 = d - 40;
  d = 40;
  }
 else
  d1 = 0;
 sprintf(buf,"%#.*E", d, dd);
 if (!(My_ctype[(buf[0])+8] & 1)) {
  switch(buf[0]) {
   case 'n':
   case 'N':
    signspace = 0;
   }
  delta = w - strlen(buf) - signspace;
  if (delta < 0)
   goto nogood;
  while(--delta >= 0)
   (*f__putn)(' ');
  if (signspace)
   (*f__putn)(sign ? '-' : '+');
  for(s = buf; *s; s++)
   (*f__putn)(*s);
  return 0;
  }
 se = buf + d + 3;
 if (dd)
  sprintf(se, "%+.2d", atoi(se) + 1 - f__scale);
 else
  strcpy(se, "+00");
 s = ++se;
 if (e < 2) {
  if (*s != '0')
   goto nogood;
  }
 if (s[2]) {
  if (!e0) {
   for(s -= 2, e1 = 2; s[0] = s[1]; s++)
    ;
   }
  else if (e0 >= 0)
   goto shift;
  else
   e1 = e;
  }
 else
 shift:
  for(s += 2, e1 = 2; *s; ++e1, ++s)
   if (e1 >= e)
    goto nogood;
 while(--delta >= 0)
  (*f__putn)(' ');
 if (signspace)
  (*f__putn)(sign ? '-' : '+');
 s = buf;
 i = f__scale;
 if (f__scale <= 0) {
  (*f__putn)('.');
  for(; i < 0; ++i)
   (*f__putn)('0');
  (*f__putn)(*s);
  s += 2;
  }
 else if (f__scale > 1) {
  (*f__putn)(*s);
  s += 2;
  while(--i > 0)
   (*f__putn)(*s++);
  (*f__putn)('.');
  }
 if (d1) {
  se -= 2;
  while(s < se) (*f__putn)(*s++);
  se += 2;
  do (*f__putn)('0'); while(--d1 > 0);
  }
 while(s < se)
  (*f__putn)(*s++);
 if (e < 2)
  (*f__putn)(s[1]);
 else {
  while(++e1 <= e)
   (*f__putn)('0');
  while(*s)
   (*f__putn)(*s++);
  }
 return 0;
 }

canonical_original_code:
int wrt_E(union ufloat *p, int w, int d, int e, long len)
{
 char buf[-1]; char *s; char *se;
 int d1; int delta; int e1; int i; int sign; int signspace;
 double dd;
 int e0 = e;
 if(e <= 0)
  e = 2;
 if(f__scale) {
  if(f__scale >= d + 2 || f__scale <= -d)
   goto nogood;
  }
 if(f__scale <= 0)
  --d;
 if (len == sizeof(real))
  dd = p->pf;
 else
  dd = p->pd;
 if (dd < 0.) {
  signspace = sign = 1;
  dd = -dd;
  }
 else {
  sign = 0;
  signspace = (int)f__cplus;
  if (!dd) {
   dd = 0.;
   }
  }
 delta = w - (2
   + 2 + signspace + d + e);
 if (delta < 0) {
nogood:
  while(--w >= 0)
   (*f__putn)('*');
  return(0);
  }
 if (f__scale < 0)
  d += f__scale;
 if (d > 40) {
  d1 = d - 40;
  d = 40;
  }
 else
  d1 = 0;
 sprintf(buf,"%#.*E", d, dd);
 if (!(My_ctype[(buf[0])+8] & 1)) {
  switch(buf[0]) {
   case 'n':
   case 'N':
    signspace = 0;
   }
  delta = w - strlen(buf) - signspace;
  if (delta < 0)
   goto nogood;
  while(--delta >= 0)
   (*f__putn)(' ');
  if (signspace)
   (*f__putn)(sign ? '-' : '+');
  for(s = buf; *s; s++)
   (*f__putn)(*s);
  return 0;
  }
 se = buf + d + 3;
 if (dd)
  sprintf(se, "%+.2d", atoi(se) + 1 - f__scale);
 else
  strcpy(se, "+00");
 s = ++se;
 if (e < 2) {
  if (*s != '0')
   goto nogood;
  }
 if (s[2]) {
  if (!e0) {
   for(s -= 2, e1 = 2; s[0] = s[1]; s++)
    ;
   }
  else if (e0 >= 0)
   goto shift;
  else
   e1 = e;
  }
 else
 shift:
  for(s += 2, e1 = 2; *s; ++e1, ++s)
   if (e1 >= e)
    goto nogood;
 while(--delta >= 0)
  (*f__putn)(' ');
 if (signspace)
  (*f__putn)(sign ? '-' : '+');
 s = buf;
 i = f__scale;
 if (f__scale <= 0) {
  (*f__putn)('.');
  for(; i < 0; ++i)
   (*f__putn)('0');
  (*f__putn)(*s);
  s += 2;
  }
 else if (f__scale > 1) {
  (*f__putn)(*s);
  s += 2;
  while(--i > 0)
   (*f__putn)(*s++);
  (*f__putn)('.');
  }
 if (d1) {
  se -= 2;
  while(s < se) (*f__putn)(*s++);
  se += 2;
  do (*f__putn)('0'); while(--d1 > 0);
  }
 while(s < se)
  (*f__putn)(*s++);
 if (e < 2)
  (*f__putn)(s[1]);
 else {
  while(++e1 <= e)
   (*f__putn)('0');
  while(*s)
   (*f__putn)(*s++);
  }
 return 0;
 }

variable_types:
p
union ufloat { float pf; double pd; } *

variable_types: w int

variable_types: d int

variable_types: e int

variable_types:
buf
char [-1]

variable_types:
s
char *

variable_types:
se
char *

variable_types: delta int

variable_types: i int

variable_types: sign int

variable_types: signspace int

variable_types: dd double


canonical_original_code:
int wrt_F(union ufloat *p, int w, int d, long len)
{
 int d1; int sign; int n;
 double x;
 char *b; char buf[-1]; char *s;
 x= (len==sizeof(real)?p->pf:p->pd);
 if (d < 344)
  d1 = 0;
 else {
  d1 = d - 344;
  d = 344;
  }
 if (x < 0.)
  { x = -x; sign = 1; }
 else {
  sign = 0;
  if (!x) {
   x = 0.;
   }
  }
 if (n = f__scale)
  if (n > 0)
   do x *= 10.; while(--n > 0);
  else
   do x *= 0.1; while(++n < 0);
 n = sprintf(b = buf, "%#.*f", d, x) + d1;
 if (buf[0] == '0' && d)
  { ++b; --n; }
 if (sign == 1) {
  for(s = b;;) {
   while(*s == '0') s++;
   switch(*s) {
    case '.':
     s++; continue;
    case 0:
     sign = 0;
    }
   break;
   }
  }
 if (sign || f__cplus)
  ++n;
 if (n > w) {
  {
   while(--w >= 0)
    (*f__putn)('*');
   return 0;
   }
  }
 for(w -= n; --w >= 0; )
  (*f__putn)(' ');
 if (sign)
  (*f__putn)('-');
 else if (f__cplus)
  (*f__putn)('+');
 while(n = *b++)
  (*f__putn)(n);
 while(--d1 >= 0)
  (*f__putn)('0');
 return 0;
 }

variable_types: len long

variable_types: n int

variable_types:
b
char *


decompiled_code:
__int64 __fastcall h_dim(__int16 *a1, unsigned __int16 *a2)
{
int v2; // edx
__int64 result; // rax

v2 = *a2;
result = (unsigned int)(unsigned __int16)*a1 - v2;
if ( *a1 <= (__int16)v2 )
result = 0LL;
return result;
}

canonical_decompiled_code:
__int64 __fastcall func0(__int16 *a1, unsigned __int16 *a2)
{
int v2; // edx
__int64 result; // rax

v2 = *a2;
result = (unsigned int)(unsigned __int16)*a1 - v2;
if ( *a1 <= (__int16)v2 )
result = 0LL;
return result;
}

original_code:
shortint h_dim(shortint *a, shortint *b)
{
return( *a > *b ? *a - *b : 0);
}

canonical_original_code:
short h_dim(short *a, short *b)
{
return( *a > *b ? *a - *b : 0);
}

variable_types:
a
short *

variable_types:
b
short *


decompiled_code:
unsigned __int64 __fastcall i_sign(__int64 *a1, __int64 *a2)
{
unsigned __int64 result; // rax

result = abs64(*a1);
if ( *a2 < 0 )
result = -(__int64)result;
return result;
}

canonical_decompiled_code:
unsigned __int64 __fastcall func0(__int64 *a1, __int64 *a2)
{
unsigned __int64 result; // rax

result = abs64(*a1);
if ( *a2 < 0 )
result = -(__int64)result;
return result;
}

original_code:
integer i_sign(integer *a, integer *b)
{
integer x;
x = (*a >= 0 ? *a : - *a);
return( *b >= 0 ? x : -x);
}

canonical_original_code:
long i_sign(long *a, long *b)
{
long x;
x = (*a >= 0 ? *a : - *a);
return( *b >= 0 ? x : -x);
}

variable_types:
a
long *

variable_types:
b
long *

variable_types: x long


decompiled_code:
__int64 __fastcall s_rnge(_BYTE *a1, __int64 a2, _BYTE *a3, __int64 a4)
{
int i; // edi
int j; // edi

fprintf(stderr, "Subscript out of range on file line %ld, procedure ", a4);
for ( i = (char)*a3; *a3; i = (char)*a3 )
{
if ( i == 95 )
break;
if ( i == 32 )
break;
++a3;
putc(i, stderr);
}
fprintf(stderr, ".\nAttempt to access the %ld-th element of variable ", a2 + 1);
for ( j = (char)*a1; (*a1 & 0xDF) != 0; j = (char)*a1 )
{
++a1;
putc(j, stderr);
}
sig_die(".", 1LL);
return 0LL;
}

canonical_decompiled_code:
__int64 __fastcall func0(_BYTE *a1, __int64 a2, _BYTE *a3, __int64 a4)
{
int i; // edi
int j; // edi

fprintf(stderr, "Subscript out of range on file line %ld, procedure ", a4);
for ( i = (char)*a3; *a3; i = (char)*a3 )
{
if ( i == 95 )
break;
if ( i == 32 )
break;
++a3;
putc(i, stderr);
}
fprintf(stderr, ".\nAttempt to access the %ld-th element of variable ", a2 + 1);
for ( j = (char)*a1; (*a1 & 0xDF) != 0; j = (char)*a1 )
{
++a1;
putc(j, stderr);
}
sig_die(".", 1LL);
return 0LL;
}

original_code:
integer s_rnge(char *varn, ftnint offset, char *procn, ftnint line)
{
register int i;
fprintf(stderr, "Subscript out of range on file line %ld, procedure ",
 (long)line);
while((i = *procn) && i != '_' && i != ' ')
 putc(*procn++, stderr);
fprintf(stderr, ".\nAttempt to access the %ld-th element of variable ",
 (long)offset+1);
while((i = *varn) && i != ' ')
 putc(*varn++, stderr);
sig_die(".", 1);
return 0;
}

canonical_original_code:
long s_rnge(char *varn, long offset, char *procn, long line)
{
register int i;
fprintf(stderr, "Subscript out of range on file line %ld, procedure ",
 (long)line);
while((i = *procn) && i != '_' && i != ' ')
 putc(*procn++, stderr);
fprintf(stderr, ".\nAttempt to access the %ld-th element of variable ",
 (long)offset+1);
while((i = *varn) && i != ' ')
 putc(*varn++, stderr);
sig_die(".", 1);
return 0;
}

variable_types:
varn
char *

variable_types: offset long

variable_types:
procn
char *

variable_types: line long


decompiled_code:
void __fastcall pow_dd(double *a1, double *a2)
{
pow(*a1, *a2);
}

canonical_decompiled_code:
void __fastcall func0(double *a1, double *a2)
{
pow(*a1, *a2);
}

original_code:
double pow_dd(doublereal *ap, doublereal *bp)
{
return(pow(*ap, *bp) );
}

canonical_original_code:
double pow_dd(double *ap, double *bp)
{
return(pow(*ap, *bp) );
}

variable_types:
ap
double *

variable_types:
bp
double *


decompiled_code:
void __fastcall z_log(double *a1, double *a2)
{
double v2; // xmm0_8
double (__fastcall *v3)(double *, double *); // rbx
double v4; // [rsp+0h] [rbp-128h] BYREF
double v5; // [rsp+8h] [rbp-120h] BYREF
double v6; // [rsp+10h] [rbp-118h]
double v7; // [rsp+18h] [rbp-110h]
double v8; // [rsp+20h] [rbp-108h]
double x; // [rsp+28h] [rbp-100h]
double y; // [rsp+30h] [rbp-F8h]
double v11; // [rsp+38h] [rbp-F0h]
double v12; // [rsp+40h] [rbp-E8h]
double v13; // [rsp+48h] [rbp-E0h]
double v14; // [rsp+50h] [rbp-D8h]
double v15; // [rsp+58h] [rbp-D0h]
double v16; // [rsp+60h] [rbp-C8h]
double v17; // [rsp+68h] [rbp-C0h]
double v18; // [rsp+70h] [rbp-B8h]
double v19; // [rsp+78h] [rbp-B0h]
double v20; // [rsp+80h] [rbp-A8h]
double v21; // [rsp+88h] [rbp-A0h]
double v22; // [rsp+90h] [rbp-98h]
double v23; // [rsp+98h] [rbp-90h]
double v24; // [rsp+A0h] [rbp-88h]
double v25; // [rsp+A8h] [rbp-80h]
double v26; // [rsp+B0h] [rbp-78h]
double v27; // [rsp+B8h] [rbp-70h]
double v28; // [rsp+C0h] [rbp-68h]
double v29; // [rsp+C8h] [rbp-60h]
double v30; // [rsp+D0h] [rbp-58h]
double v31; // [rsp+D8h] [rbp-50h]
double v32; // [rsp+E8h] [rbp-40h]
double v33; // [rsp+F0h] [rbp-38h]
double v34; // [rsp+F8h] [rbp-30h]
double v35; // [rsp+100h] [rbp-28h]
double v36; // [rsp+108h] [rbp-20h]

y = a2[1];
x = *a2;
v36 = atan2(y, x);
a1[1] = v36;
if ( y < 0.0 )
*(_QWORD *)&y ^= LC2;
if ( x < 0.0 )
*(_QWORD *)&x ^= LC2;
if ( y > x )
{
v2 = y;
y = x;
x = v2;
}
v8 = y / x;
v35 = y / x * (y / x);
v34 = v35 + 1.0;
v33 = sqrt(v35 + 1.0);
v32 = v33 * x;
v5 = v33 * x;
v13 = v33 * x - 1.0;
if ( v13 < 0.0 )
*(_QWORD *)&v13 ^= LC2;
if ( v13 > 0.01 )
{
*a1 = log(v32);
}
else
{
v3 = (double (__fastcall *)(double *, double *))gcc_bug_bypass_diff_F2C;
if ( !gcc_bug_bypass_diff_F2C )
v3 = sub_0;
v31 = x * x;
v30 = x * x - 1.0;
v29 = y * y;
v28 = v30 + y * y;
v27 = v32 + 1.0;
v7 = v28 / (v32 + 1.0);
v6 = v7 * v7;
v26 = v7 * 0.5;
v25 = 1.0 - v7 * 0.5;
v5 = v25;
v11 = *(double *)&LC0;
v12 = *(double *)&LC0;
do
{
do
{
v24 = v5;
v4 = v5;
v12 = v12 * v6;
v11 = v11 + 2.0;
v23 = v12 / v11;
v22 = v7 * v12;
v21 = v11 + 1.0;
v20 = v7 * v12 / (v11 + 1.0);
v19 = v12 / v11 - v20;
v18 = v5 + v19;
v5 = v5 + v19;
v17 = v5 - v24;
}
while ( v5 - v24 > 1.0e-18 );
v16 = v3(&v5, &v4);
}
while ( v16 > 0.0 );
v15 = v5;
v14 = v5 * v7;
*a1 = v5 * v7;
}
}

canonical_decompiled_code:
void __fastcall func1(double *a1, double *a2)
{
double v2; // xmm0_8
double (__fastcall *v3)(double *, double *); // rbx
double v4; // [rsp+0h] [rbp-128h] BYREF
double v5; // [rsp+8h] [rbp-120h] BYREF
double v6; // [rsp+10h] [rbp-118h]
double v7; // [rsp+18h] [rbp-110h]
double v8; // [rsp+20h] [rbp-108h]
double x; // [rsp+28h] [rbp-100h]
double y; // [rsp+30h] [rbp-F8h]
double v11; // [rsp+38h] [rbp-F0h]
double v12; // [rsp+40h] [rbp-E8h]
double v13; // [rsp+48h] [rbp-E0h]
double v14; // [rsp+50h] [rbp-D8h]
double v15; // [rsp+58h] [rbp-D0h]
double v16; // [rsp+60h] [rbp-C8h]
double v17; // [rsp+68h] [rbp-C0h]
double v18; // [rsp+70h] [rbp-B8h]
double v19; // [rsp+78h] [rbp-B0h]
double v20; // [rsp+80h] [rbp-A8h]
double v21; // [rsp+88h] [rbp-A0h]
double v22; // [rsp+90h] [rbp-98h]
double v23; // [rsp+98h] [rbp-90h]
double v24; // [rsp+A0h] [rbp-88h]
double v25; // [rsp+A8h] [rbp-80h]
double v26; // [rsp+B0h] [rbp-78h]
double v27; // [rsp+B8h] [rbp-70h]
double v28; // [rsp+C0h] [rbp-68h]
double v29; // [rsp+C8h] [rbp-60h]
double v30; // [rsp+D0h] [rbp-58h]
double v31; // [rsp+D8h] [rbp-50h]
double v32; // [rsp+E8h] [rbp-40h]
double v33; // [rsp+F0h] [rbp-38h]
double v34; // [rsp+F8h] [rbp-30h]
double v35; // [rsp+100h] [rbp-28h]
double v36; // [rsp+108h] [rbp-20h]

y = a2[1];
x = *a2;
v36 = atan2(y, x);
a1[1] = v36;
if ( y < 0.0 )
*(_QWORD *)&y ^= LC2;
if ( x < 0.0 )
*(_QWORD *)&x ^= LC2;
if ( y > x )
{
v2 = y;
y = x;
x = v2;
}
v8 = y / x;
v35 = y / x * (y / x);
v34 = v35 + 1.0;
v33 = sqrt(v35 + 1.0);
v32 = v33 * x;
v5 = v33 * x;
v13 = v33 * x - 1.0;
if ( v13 < 0.0 )
*(_QWORD *)&v13 ^= LC2;
if ( v13 > 0.01 )
{
*a1 = log(v32);
}
else
{
v3 = (double (__fastcall *)(double *, double *))gcc_bug_bypass_diff_F2C;
if ( !gcc_bug_bypass_diff_F2C )
v3 = sub_0;
v31 = x * x;
v30 = x * x - 1.0;
v29 = y * y;
v28 = v30 + y * y;
v27 = v32 + 1.0;
v7 = v28 / (v32 + 1.0);
v6 = v7 * v7;
v26 = v7 * 0.5;
v25 = 1.0 - v7 * 0.5;
v5 = v25;
v11 = *(double *)&LC0;
v12 = *(double *)&LC0;
do
{
do
{
v24 = v5;
v4 = v5;
v12 = v12 * v6;
v11 = v11 + 2.0;
v23 = v12 / v11;
v22 = v7 * v12;
v21 = v11 + 1.0;
v20 = v7 * v12 / (v11 + 1.0);
v19 = v12 / v11 - v20;
v18 = v5 + v19;
v5 = v5 + v19;
v17 = v5 - v24;
}
while ( v5 - v24 > 1.0e-18 );
v16 = v3(&v5, &v4);
}
while ( v16 > 0.0 );
v15 = v5;
v14 = v5 * v7;
*a1 = v5 * v7;
}
}

original_code:
void z_log(doublecomplex *r, doublecomplex *z)
{
 double s, s0, t, t2, u, v;
 double zi = z->i, zr = z->r;
 double (*diff) (double*,double*);
 r->i = atan2(zi, zr);
 if (zi < 0)
  zi = -zi;
 if (zr < 0)
  zr = -zr;
 if (zr < zi) {
  t = zi;
  zi = zr;
  zr = t;
  }
 t = zi/zr;
 s = zr * sqrt(1 + t*t);
 if ((t = s - 1) < 0)
  t = -t;
 if (t > .01)
  r->r = log(s);
 else {
  if (!(diff = gcc_bug_bypass_diff_F2C))
   diff = diff1;
  t = ((zr*zr - 1.) + zi*zi) / (s + 1);
  t2 = t*t;
  s = 1. - 0.5*t;
  u = v = 1;
  do {
   s0 = s;
   u *= t2;
   v += 2;
   s += u/v - t*u/(v+1);
   }
   while(s - s0 > 1e-18 || (*diff)(&s,&s0) > 0.);
  r->r = s*t;
  }
 }

canonical_original_code:
void z_log(struct doublecomplex *r, struct doublecomplex *z)
{
 double s; double s0; double t; double t2; double u; double v;
 double zi = z->i; double zr = z->r;
 double (*diff)(double *, double *);
 r->i = atan2(zi, zr);
 if (zi < 0)
  zi = -zi;
 if (zr < 0)
  zr = -zr;
 if (zr < zi) {
  t = zi;
  zi = zr;
  zr = t;
  }
 t = zi/zr;
 s = zr * sqrt(1 + t*t);
 if ((t = s - 1) < 0)
  t = -t;
 if (t > .01)
  r->r = log(s);
 else {
  if (!(diff = gcc_bug_bypass_diff_F2C))
   diff = diff1;
  t = ((zr*zr - 1.) + zi*zi) / (s + 1);
  t2 = t*t;
  s = 1. - 0.5*t;
  u = v = 1;
  do {
   s0 = s;
   u *= t2;
   v += 2;
   s += u/v - t*u/(v+1);
   }
   while(s - s0 > 1e-18 || (*diff)(&s,&s0) > 0.);
  r->r = s*t;
  }
 }

variable_types:
r
struct doublecomplex { double r; } *

variable_types:
z
struct doublecomplex *

variable_types: s double

variable_types: t double

variable_types: u double

variable_types: v double

variable_types: zi double

variable_types: zr double

variable_types:
diff
double (*)(double *, double *)


original_code:
void c_sqrt(complex *r, complex *z)
{
 double mag, t;
 double zi = z->i, zr = z->r;
 if( (mag = f__cabs(zr, zi)) == 0.)
  r->r = r->i = 0.;
 else if(zr > 0)
  {
  r->r = t = sqrt(0.5 * (mag + zr) );
  t = zi / t;
  r->i = 0.5 * t;
  }
 else
  {
  t = sqrt(0.5 * (mag - zr) );
  if(zi < 0)
   t = -t;
  r->i = t;
  t = zi / t;
  r->r = 0.5 * t;
  }
 }

canonical_original_code:
void c_sqrt(struct complex *r, struct complex *z)
{
 double mag; double t;
 double zi = z->i; double zr = z->r;
 if( (mag = f__cabs(zr, zi)) == 0.)
  r->r = r->i = 0.;
 else if(zr > 0)
  {
  r->r = t = sqrt(0.5 * (mag + zr) );
  t = zi / t;
  r->i = 0.5 * t;
  }
 else
  {
  t = sqrt(0.5 * (mag - zr) );
  if(zi < 0)
   t = -t;
  r->i = t;
  t = zi / t;
  r->r = 0.5 * t;
  }
 }

variable_types:
r
struct complex { float r; } *

variable_types:
z
struct complex *

variable_types: mag double


decompiled_code:
__int64 __fastcall w_ned(char **a1)
{
__int64 result; // rax

switch ( *(_DWORD *)a1 )
{
case 4:
case 0xE:
f__cursor += *((int *)a1 + 1);
result = 1LL;
break;
case 5:
goto LABEL_3;
case 0xB:
result = sub_640(a1[1]);
break;
case 0xC:
result = sub_6C3(*((_DWORD *)a1 + 1), a1[1]);
break;
case 0xD:
f__cursor -= *((int *)a1 + 1);
result = 1LL;
if ( f__cursor < -f__recpos )
{
f__cursor = -f__recpos;
result = 1LL;
}
break;
case 0xF:
f__cursor = *((_DWORD *)a1 + 1) - f__recpos - 1;
result = 1LL;
break;
default:
fprintf(stderr, "w_ned, unexpected code: %d\n", *(unsigned int *)a1);
sig_die(f__fmtbuf, 1LL);
LABEL_3:
result = f__donewrec();
break;
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func11(char **a1)
{
__int64 result; // rax

switch ( *(_DWORD *)a1 )
{
case 4:
case 0xE:
f__cursor += *((int *)a1 + 1);
result = 1LL;
break;
case 5:
goto LABEL_3;
case 0xB:
result = func5(a1[1]);
break;
case 0xC:
result = func6(*((_DWORD *)a1 + 1), a1[1]);
break;
case 0xD:
f__cursor -= *((int *)a1 + 1);
result = 1LL;
if ( f__cursor < -f__recpos )
{
f__cursor = -f__recpos;
result = 1LL;
}
break;
case 0xF:
f__cursor = *((_DWORD *)a1 + 1) - f__recpos - 1;
result = 1LL;
break;
default:
fprintf(stderr, "w_ned, unexpected code: %d\n", *(unsigned int *)a1);
sig_die(f__fmtbuf, 1LL);
LABEL_3:
result = f__donewrec();
break;
}
return result;
}

original_code:
int
w_ned(struct syl *p)
{
 switch(p->op)
 {
 default: fprintf(stderr,"w_ned, unexpected code: %d\n", p->op);
  sig_die(f__fmtbuf, 1);
 case 5:
  return((*f__donewrec)());
 case 15: f__cursor = p->p1-f__recpos - 1;
  return(1);
 case 13: f__cursor -= p->p1;
  if(f__cursor < -f__recpos)
   f__cursor = -f__recpos;
  return(1);
 case 14:
 case 4:
  f__cursor += p->p1;
  return(1);
 case 11:
  return(wrt_AP(p->p2.s));
 case 12:
  return(wrt_H(p->p1,p->p2.s));
 }
}

variable_types: struct syl { int op; int p1; union { int i[2]; char *s; } p2; } *


decompiled_code:
__int64 __fastcall ef1asc_(__int64 a1, _QWORD *a2, __int64 a3, _QWORD *a4)
{
s_copy(a1, a3, (*a2 + 7LL) & 0xFFFFFFFFFFFFFFF8LL, *a4);
return 0LL;
}

canonical_decompiled_code:
__int64 __fastcall func0(__int64 a1, _QWORD *a2, __int64 a3, _QWORD *a4)
{
s_copy(a1, a3, (*a2 + 7LL) & 0xFFFFFFFFFFFFFFF8LL, *a4);
return 0LL;
}

original_code:
int ef1asc_(ftnint *a, ftnlen *la, ftnint *b, ftnlen *lb)
{
s_copy( (char *)a, (char *)b, ( ( (*la)+ ( (long) (sizeof(long) - 1) )) & (~( (long) (sizeof(long) - 1) )) ), *lb );
return 0;
}

canonical_original_code:
int ef1asc_(long *a, long *la, long *b, long *lb)
{
s_copy( (char *)a, (char *)b, ( ( (*la)+ ( (long) (sizeof(long) - 1) )) & (~( (long) (sizeof(long) - 1) )) ), *lb );
return 0;
}

variable_types:
a
long *

variable_types:
la
long *

variable_types:
b
long *

variable_types:
lb
long *


decompiled_code:
void __fastcall r_tanh(float *a1)
{
tanh(*a1);
}

canonical_decompiled_code:
void __fastcall func0(float *a1)
{
tanh(*a1);
}

original_code:
double r_tanh(real *x)
{
return( tanh(*x) );
}

canonical_original_code:
double r_tanh(float *x)
{
return( tanh(*x) );
}

variable_types:
x
float *


original_code:
integer
system_(register char *s, ftnlen n)
{
 char buff0[256], *buff;
 register char *bp, *blast;
 integer rv;
 buff = bp = n < sizeof(buff0)
   ? buff0 : F77_aloc(n+1, "system_");
 blast = bp + n;
 while(bp < blast && *s)
  *bp++ = *s++;
 *bp = 0;
 rv = system(buff);
 if (buff != buff0)
  free(buff);
 return rv;
 }

canonical_original_code:
long system_(char *s, long n)
{
 char buff0[256]; char *buff;
 register char *bp; register char *blast;
 long rv;
 buff = bp = n < sizeof(buff0)
   ? buff0 : F77_aloc(n+1, "system_");
 blast = bp + n;
 while(bp < blast && *s)
  *bp++ = *s++;
 *bp = 0;
 rv = system(buff);
 if (buff != buff0)
  free(buff);
 return rv;
 }

variable_types:
s
char *

variable_types: n long

variable_types:
buff
char *

variable_types:
bp
char *

variable_types:
blast
char *

variable_types: rv long


decompiled_code:
__int64 __fastcall s_cmp(_BYTE *a1, _BYTE *a2, __int64 a3, __int64 a4)
{
_BYTE *v4; // r8
_BYTE *v5; // r9
__int64 result; // rax
_BYTE *v7; // rcx

v4 = &a1[a3];
v5 = &a2[a4];
if ( a3 > a4 )
{
v7 = &a1[a4];
if ( a2 >= v5 )
{
v7 = a1;
LABEL_15:
if ( v4 <= v7 )
{
result = 0LL;
}
else
{
while ( *v7 == 32 )
{
if ( v4 == ++v7 )
return 0LL;
}
result = (unsigned __int8)*v7 - 32;
}
}
else
{
while ( *a1 == *a2 )
{
++a1;
++a2;
if ( a1 == v7 )
goto LABEL_15;
}
result = (unsigned __int8)*a1 - (unsigned __int8)*a2;
}
}
else if ( a1 >= v4 )
{
LABEL_5:
if ( v5 <= a2 )
{
result = 0LL;
}
else
{
while ( *a2 == 32 )
{
if ( v5 == ++a2 )
return 0LL;
}
result = 32 - (unsigned __int8)*a2;
}
}
else
{
while ( *a1 == *a2 )
{
++a1;
++a2;
if ( v4 == a1 )
goto LABEL_5;
}
result = (unsigned __int8)*a1 - (unsigned __int8)*a2;
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func0(_BYTE *a1, _BYTE *a2, __int64 a3, __int64 a4)
{
_BYTE *v4; // r8
_BYTE *v5; // r9
__int64 result; // rax
_BYTE *v7; // rcx

v4 = &a1[a3];
v5 = &a2[a4];
if ( a3 > a4 )
{
v7 = &a1[a4];
if ( a2 >= v5 )
{
v7 = a1;
LABEL_15:
if ( v4 <= v7 )
{
result = 0LL;
}
else
{
while ( *v7 == 32 )
{
if ( v4 == ++v7 )
return 0LL;
}
result = (unsigned __int8)*v7 - 32;
}
}
else
{
while ( *a1 == *a2 )
{
++a1;
++a2;
if ( a1 == v7 )
goto LABEL_15;
}
result = (unsigned __int8)*a1 - (unsigned __int8)*a2;
}
}
else if ( a1 >= v4 )
{
LABEL_5:
if ( v5 <= a2 )
{
result = 0LL;
}
else
{
while ( *a2 == 32 )
{
if ( v5 == ++a2 )
return 0LL;
}
result = 32 - (unsigned __int8)*a2;
}
}
else
{
while ( *a1 == *a2 )
{
++a1;
++a2;
if ( v4 == a1 )
goto LABEL_5;
}
result = (unsigned __int8)*a1 - (unsigned __int8)*a2;
}
return result;
}

original_code:
integer s_cmp(char *a0, char *b0, ftnlen la, ftnlen lb)
{
register unsigned char *a, *aend, *b, *bend;
a = (unsigned char *)a0;
b = (unsigned char *)b0;
aend = a + la;
bend = b + lb;
if(la <= lb)
 {
 while(a < aend)
  if(*a != *b)
   return( *a - *b );
  else
   { ++a; ++b; }
 while(b < bend)
  if(*b != ' ')
   return( ' ' - *b );
  else ++b;
 }
else
 {
 while(b < bend)
  if(*a == *b)
   { ++a; ++b; }
  else
   return( *a - *b );
 while(a < aend)
  if(*a != ' ')
   return(*a - ' ');
  else ++a;
 }
return(0);
}

canonical_original_code:
long s_cmp(char *a0, char *b0, long la, long lb)
{
register unsigned char *a; register unsigned char *aend; register unsigned char *b; register unsigned char *bend;
a = (unsigned char *)a0;
b = (unsigned char *)b0;
aend = a + la;
bend = b + lb;
if(la <= lb)
 {
 while(a < aend)
  if(*a != *b)
   return( *a - *b );
  else
   { ++a; ++b; }
 while(b < bend)
  if(*b != ' ')
   return( ' ' - *b );
  else ++b;
 }
else
 {
 while(b < bend)
  if(*a == *b)
   { ++a; ++b; }
  else
   return( *a - *b );
 while(a < aend)
  if(*a != ' ')
   return(*a - ' ');
  else ++a;
 }
return(0);
}

variable_types: la long

variable_types: lb long

variable_types:
a
unsigned char *

variable_types:
aend
unsigned char *

variable_types:
b
unsigned char *

variable_types:
bend
unsigned char *


decompiled_code:
double __fastcall r_sign(float *a1, float *a2)
{
double v3; // [rsp+0h] [rbp-10h]
float v4; // [rsp+Ch] [rbp-4h]

v4 = *a1;
if ( *a1 < 0.0 )
LODWORD(v4) ^= LC1;
v3 = v4;
if ( *a2 < 0.0 )
*(_QWORD *)&v3 ^= LC2;
return v3;
}

canonical_decompiled_code:
double __fastcall func0(float *a1, float *a2)
{
double v3; // [rsp+0h] [rbp-10h]
float v4; // [rsp+Ch] [rbp-4h]

v4 = *a1;
if ( *a1 < 0.0 )
LODWORD(v4) ^= LC1;
v3 = v4;
if ( *a2 < 0.0 )
*(_QWORD *)&v3 ^= LC2;
return v3;
}

original_code:
double r_sign(real *a, real *b)
{
double x;
x = (*a >= 0 ? *a : - *a);
return( *b >= 0 ? x : -x);
}

canonical_original_code:
double r_sign(float *a, float *b)
{
double x;
x = (*a >= 0 ? *a : - *a);
return( *b >= 0 ? x : -x);
}

variable_types:
a
float *

variable_types:
b
float *

variable_types: x double


decompiled_code:
__int64 __fastcall s_rsli(_QWORD *a1)
{
f__lioproc = &l_read;
f__lquit = 0LL;
f__lcount = 0;
sub_0(a1);
f__doend = 0LL;
return 0LL;
}

canonical_decompiled_code:
__int64 __fastcall func2(_QWORD *a1)
{
f__lioproc = &l_read;
f__lquit = 0LL;
f__lcount = 0;
sub_0(a1);
f__doend = 0LL;
return 0LL;
}

original_code:
integer s_rsli(icilist *a)
{
 f__lioproc = l_read;
 f__lquit = 0;
 f__lcount = 0;
 c_lir(a);
 f__doend = 0;
 return(0);
 }

canonical_original_code:
long s_rsli(struct icilist *a)
{
 f__lioproc = l_read;
 f__lquit = 0;
 f__lcount = 0;
 c_lir(a);
 f__doend = 0;
 return(0);
 }

variable_types: struct icilist { long icierr; char *iciunit; long iciend; char *icifmt; long icirlen; long icirnum; } *


decompiled_code:
__int64 e_rsli()
{
return 0LL;
}

canonical_decompiled_code:
__int64 func3()
{
return 0LL;
}

original_code:
integer e_rsli(void)
{ return 0; }

canonical_original_code:
long e_rsli()
{ return 0; }


decompiled_code:
__int64 __fastcall s_rsni(__int64 *a1)
{
__int64 result; // rax
__int64 v2[7]; // [rsp+0h] [rbp-38h] BYREF

v2[2] = a1[2];
v2[0] = *a1;
v2[3] = a1[3];
sub_0(a1);
LODWORD(result) = x_rsne(v2);
nml_read = 0;
return (int)result;
}

canonical_decompiled_code:
__int64 __fastcall func4(__int64 *a1)
{
__int64 result; // rax
__int64 v2[7]; // [rsp+0h] [rbp-38h] BYREF

v2[2] = a1[2];
v2[0] = *a1;
v2[3] = a1[3];
sub_0(a1);
LODWORD(result) = x_rsne(v2);
nml_read = 0;
return (int)result;
}

original_code:
integer s_rsni(icilist *a)
{
 extern int nml_read;
 integer rv;
 cilist ca;
 ca.ciend = a->iciend;
 ca.cierr = a->icierr;
 ca.cifmt = a->icifmt;
 c_lir(a);
 rv = x_rsne(&ca);
 nml_read = 0;
 return rv;
 }

canonical_original_code:
long s_rsni(struct icilist *a)
{
 extern int nml_read;
 long rv;
 struct cilist ca;
 ca.ciend = a->iciend;
 ca.cierr = a->icierr;
 ca.cifmt = a->icifmt;
 c_lir(a);
 rv = x_rsne(&ca);
 nml_read = 0;
 return rv;
 }

variable_types: struct cilist { long cierr; long ciunit; long ciend; char *cifmt; long cirec; }

user_defined_types: struct icilist { long icierr; char *iciunit; long iciend; char *icifmt; long icirlen; long icirnum; }


original_code:
double r_mod(real *x, real *y)
{
 double quotient;
 if( (quotient = (double)*x / *y) >= 0)
  quotient = floor(quotient);
 else
  quotient = -floor(-quotient);
 return(*x - (*y) * quotient );
}

canonical_original_code:
double r_mod(float *x, float *y)
{
 double quotient;
 if( (quotient = (double)*x / *y) >= 0)
  quotient = floor(quotient);
 else
  quotient = -floor(-quotient);
 return(*x - (*y) * quotient );
}

variable_types:
x
float *

variable_types:
y
float *

variable_types: quotient double


original_code:
void
getenv_(char *fname, char *value, ftnlen flen, ftnlen vlen)
{
 char buf[256], *ep, *fp;
 integer i;
 if (flen <= 0)
  goto add_blanks;
 for(i = 0; i < sizeof(buf); i++) {
  if (i == flen || (buf[i] = fname[i]) == ' ') {
   buf[i] = 0;
   ep = getenv(buf);
   goto have_ep;
   }
  }
 while(i < flen && fname[i] != ' ')
  i++;
 strncpy(fp = F77_aloc(i+1, "getenv_"), fname, (int)i);
 fp[i] = 0;
 ep = getenv(fp);
 free(fp);
 have_ep:
 if (ep)
  while(*ep && vlen-- > 0)
   *value++ = *ep++;
 add_blanks:
 while(vlen-- > 0)
  *value++ = ' ';
 }

canonical_original_code:
void getenv_(char *fname, char *value, long flen, long vlen)
{
 char buf[256]; char *ep; char *fp;
 long i;
 if (flen <= 0)
  goto add_blanks;
 for(i = 0; i < sizeof(buf); i++) {
  if (i == flen || (buf[i] = fname[i]) == ' ') {
   buf[i] = 0;
   ep = getenv(buf);
   goto have_ep;
   }
  }
 while(i < flen && fname[i] != ' ')
  i++;
 strncpy(fp = F77_aloc(i+1, "getenv_"), fname, (int)i);
 fp[i] = 0;
 ep = getenv(fp);
 free(fp);
 have_ep:
 if (ep)
  while(*ep && vlen-- > 0)
   *value++ = *ep++;
 add_blanks:
 while(vlen-- > 0)
  *value++ = ' ';
 }

variable_types:
fname
char *

variable_types:
value
char *

variable_types: flen long

variable_types: vlen long

variable_types:
buf
char [256]

variable_types:
ep
char *

variable_types:
fp
char *

variable_types: i long


original_code:
double d_int(doublereal *x)
{
return( (*x>0) ? floor(*x) : -floor(- *x) );
}

canonical_original_code:
double d_int(double *x)
{
return( (*x>0) ? floor(*x) : -floor(- *x) );
}

variable_types:
x
double *


original_code:
integer i_dnnt(doublereal *x)
{
return (integer)(*x >= 0. ? floor(*x + .5) : -floor(.5 - *x));
}

canonical_original_code:
long i_dnnt(double *x)
{
return (integer)(*x >= 0. ? floor(*x + .5) : -floor(.5 - *x));
}


decompiled_code:
__int64 __fastcall s_paus(const char *a1, __int64 a2)
{
int v2; // eax
unsigned int v4; // eax

fwrite("PAUSE ", 1uLL, 6uLL, stderr);
if ( a2 > 0 )
fprintf(stderr, " %.*s", a2, a1);
fwrite(" statement executed\n", 1uLL, 0x14uLL, stderr);
v2 = fileno(stdin);
if ( isatty(v2) )
{
sub_1(stdin);
}
else
{
v4 = getpid();
fprintf(stderr, "To resume execution, execute a kill -%d %d command\n", 15LL, v4);
signal(15, (__sighandler_t)handler);
fflush(stderr);
pause();
}
fwrite("Execution resumes after PAUSE.\n", 1uLL, 0x1FuLL, stderr);
fflush(stderr);
return 0LL;
}

canonical_decompiled_code:
__int64 __fastcall func2(const char *a1, __int64 a2)
{
int v2; // eax
unsigned int v4; // eax

fwrite("PAUSE ", 1uLL, 6uLL, stderr);
if ( a2 > 0 )
fprintf(stderr, " %.*s", a2, a1);
fwrite(" statement executed\n", 1uLL, 0x14uLL, stderr);
v2 = fileno(stdin);
if ( isatty(v2) )
{
func1(stdin);
}
else
{
v4 = getpid();
fprintf(stderr, "To resume execution, execute a kill -%d %d command\n", 15LL, v4);
signal(15, (__sighandler_t)handler);
fflush(stderr);
pause();
}
fwrite("Execution resumes after PAUSE.\n", 1uLL, 0x1FuLL, stderr);
fflush(stderr);
return 0LL;
}

original_code:
int
s_paus(char *s, ftnlen n)
{
 fprintf(stderr, "PAUSE ");
 if(n > 0)
  fprintf(stderr, " %.*s", (int)n, s);
 fprintf(stderr, " statement executed\n");
 if( isatty(fileno(stdin)) )
  s_1paus(stdin);
 else {
  fprintf(stderr,
  "To resume execution, execute a   kill -%d %d   command\n",
   15, getpid() );
  signal(15,(sig_pf)waitpause);
  fflush(stderr);
  pause();
  }
 fprintf(stderr, "Execution resumes after PAUSE.\n");
 fflush(stderr);
 return 0;
}

canonical_original_code:
int s_paus(char *s, long n)
{
 fprintf(stderr, "PAUSE ");
 if(n > 0)
  fprintf(stderr, " %.*s", (int)n, s);
 fprintf(stderr, " statement executed\n");
 if( isatty(fileno(stdin)) )
  s_1paus(stdin);
 else {
  fprintf(stderr,
  "To resume execution, execute a   kill -%d %d   command\n",
   15, getpid() );
  signal(15,(void (*)(int))waitpause);
  fflush(stderr);
  pause();
  }
 fprintf(stderr, "Execution resumes after PAUSE.\n");
 fflush(stderr);
 return 0;
}

variable_types:
s
char *

variable_types: n long


decompiled_code:
void __fastcall derfc_(double *a1)
{
erfc(*a1);
}

canonical_decompiled_code:
void __fastcall func0(double *a1)
{
erfc(*a1);
}

original_code:
double derfc_(doublereal *x)
{
return( erfc(*x) );
}

canonical_original_code:
double derfc_(double *x)
{
return( erfc(*x) );
}


decompiled_code:
void __fastcall r_acos(float *a1)
{
acos(*a1);
}

canonical_decompiled_code:
void __fastcall func0(float *a1)
{
acos(*a1);
}

original_code:
double r_acos(real *x)
{
return( acos(*x) );
}

canonical_original_code:
double r_acos(float *x)
{
return( acos(*x) );
}


decompiled_code:
__int64 __fastcall h_abs(__int16 *a1)
{
return ((unsigned __int16)(*a1 >> 15) ^ (unsigned __int16)*a1) - (unsigned int)(unsigned __int16)(*a1 >> 15);
}

canonical_decompiled_code:
__int64 __fastcall func0(__int16 *a1)
{
return ((unsigned __int16)(*a1 >> 15) ^ (unsigned __int16)*a1) - (unsigned int)(unsigned __int16)(*a1 >> 15);
}

original_code:
shortint h_abs(shortint *x)
{
if(*x >= 0)
 return(*x);
return(- *x);
}

canonical_original_code:
short h_abs(short *x)
{
if(*x >= 0)
 return(*x);
return(- *x);
}

variable_types:
x
short *


decompiled_code:
void __fastcall d_atn2(double *a1, double *a2)
{
atan2(*a1, *a2);
}

canonical_decompiled_code:
void __fastcall func0(double *a1, double *a2)
{
atan2(*a1, *a2);
}

original_code:
double d_atn2(doublereal *x, doublereal *y)
{
return( atan2(*x,*y) );
}

canonical_original_code:
double d_atn2(double *x, double *y)
{
return( atan2(*x,*y) );
}

variable_types:
y
double *


decompiled_code:
__int64 __fastcall i_mod(__int64 *a1, _QWORD *a2)
{
return *a1 % *a2;
}

canonical_decompiled_code:
__int64 __fastcall func0(__int64 *a1, _QWORD *a2)
{
return *a1 % *a2;
}

original_code:
integer i_mod(integer *a, integer *b)
{
return( *a % *b);
}

canonical_original_code:
long i_mod(long *a, long *b)
{
return( *a % *b);
}

variable_types:
a
long *

variable_types:
b
long *


decompiled_code:
_BOOL8 hl_ge()
{
return s_cmp() >= 0;
}

canonical_decompiled_code:
_BOOL8 func0()
{
return s_cmp() >= 0;
}

original_code:
shortlogical hl_ge(char *a, char *b, ftnlen la, ftnlen lb)
{
return(s_cmp(a,b,la,lb) >= 0);
}

canonical_original_code:
short hl_ge(char *a, char *b, long la, long lb)
{
return(s_cmp(a,b,la,lb) >= 0);
}

variable_types:
a
char *

variable_types:
b
char *

variable_types: la long

variable_types: lb long


original_code:
void
x_wsne(cilist *a)
{
 Namelist *nl;
 char *s;
 Vardesc *v, **vd, **vde;
 ftnint number, type;
 ftnlen *dims;
 ftnlen size;
 extern ftnlen f__typesize[];
 nl = (Namelist *)a->cifmt;
 (*f__putn)('&');
 for(s = nl->name; *s; s++)
  (*f__putn)(*s);
 (*f__putn)(' ');
 f__Aquote = 1;
 vd = nl->vars;
 vde = vd + nl->nvars;
 while(vd < vde) {
  v = *vd++;
  s = v->name;
   nl_donewrec();
  while(*s)
   (*f__putn)(*s++);
  (*f__putn)(' ');
  (*f__putn)('=');
  number = (dims = v->dims) ? dims[1] : 1;
  type = v->type;
  if (type < 0) {
   size = -type;
   type = 9;
   }
  else
   size = f__typesize[type];
  l_write(&number, v->addr, size, type);
  if (vd < vde) {
   if (f__recpos+2 >= L_len)
    nl_donewrec();
   (*f__putn)(',');
   (*f__putn)(' ');
   }
  else if (f__recpos+1 >= L_len)
   nl_donewrec();
  }
 f__Aquote = 0;
 (*f__putn)('/');
 }

canonical_original_code:
void x_wsne(struct cilist *a)
{
 struct Namelist *nl;
 char *s;
 struct Vardesc *v; struct Vardesc **vd; struct Vardesc **vde;
 long number; long type;
 long *dims;
 long size;
 extern long f__typesize[];
 nl = (struct Namelist *)a->cifmt;
 (*f__putn)('&');
 for(s = nl->name; *s; s++)
  (*f__putn)(*s);
 (*f__putn)(' ');
 f__Aquote = 1;
 vd = nl->vars;
 vde = vd + nl->nvars;
 while(vd < vde) {
  v = *vd++;
  s = v->name;
   nl_donewrec();
  while(*s)
   (*f__putn)(*s++);
  (*f__putn)(' ');
  (*f__putn)('=');
  number = (dims = v->dims) ? dims[1] : 1;
  type = v->type;
  if (type < 0) {
   size = -type;
   type = 9;
   }
  else
   size = f__typesize[type];
  l_write(&number, v->addr, size, type);
  if (vd < vde) {
   if (f__recpos+2 >= L_len)
    nl_donewrec();
   (*f__putn)(',');
   (*f__putn)(' ');
   }
  else if (f__recpos+1 >= L_len)
   nl_donewrec();
  }
 f__Aquote = 0;
 (*f__putn)('/');
 }

variable_types: struct cilist { long cierr; long ciunit; long ciend; char *cifmt; long cirec; } *

variable_types: struct Namelist { char *name; struct Vardesc { char *name; char *addr; long *dims; int type; } **vars; int nvars; } *

variable_types: number long

variable_types: type long

variable_types:
dims
long *

variable_types: size long

user_defined_types: struct Namelist { char *name; struct Vardesc **vars; int nvars; }


decompiled_code:
void __fastcall erfc_(float *a1)
{
erfc(*a1);
}

canonical_decompiled_code:
void __fastcall func0(float *a1)
{
erfc(*a1);
}

original_code:
double erfc_(real *x)
{
return( erfc((double)*x) );
}

canonical_original_code:
double erfc_(float *x)
{
return( erfc((double)*x) );
}

variable_types:
x
float *


decompiled_code:
__int64 __fastcall getarg_(__int64 *a1, __int64 a2, __int64 a3)
{
__int64 v6; // rax
_BYTE *v7; // r9
__int64 result; // rax
_BYTE *v9; // rdx
char v10; // cl
_BYTE *v11; // rsi

v6 = *a1;
v7 = &LC0;
if ( v6 >= 0 && v6 < xargc )
v7 = *(_BYTE **)(xargv + 8 * v6);
result = 0LL;
if ( a3 > 0 )
{
while ( 1 )
{
v9 = (_BYTE *)(a2 + result);
v10 = v7[result];
if ( !v10 )
break;
*(_BYTE *)(a2 + result++) = v10;
if ( result == a3 )
return result;
}
result = (int)result;
if ( a3 > (int)result )
{
v11 = &v9[a3 - (int)result];
do
*v9++ = 32;
while ( v9 != v11 );
}
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func0(__int64 *a1, __int64 a2, __int64 a3)
{
__int64 v6; // rax
_BYTE *v7; // r9
__int64 result; // rax
_BYTE *v9; // rdx
char v10; // cl
_BYTE *v11; // rsi

v6 = *a1;
v7 = &LC0;
if ( v6 >= 0 && v6 < xargc )
v7 = *(_BYTE **)(xargv + 8 * v6);
result = 0LL;
if ( a3 > 0 )
{
while ( 1 )
{
v9 = (_BYTE *)(a2 + result);
v10 = v7[result];
if ( !v10 )
break;
*(_BYTE *)(a2 + result++) = v10;
if ( result == a3 )
return result;
}
result = (int)result;
if ( a3 > (int)result )
{
v11 = &v9[a3 - (int)result];
do
*v9++ = 32;
while ( v9 != v11 );
}
}
return result;
}

original_code:
void getarg_(ftnint *n, char *s, ftnlen ls)
{
 extern int xargc;
 extern char **xargv;
 const char *t;
 int i;
 if(*n>=0 && *n<xargc)
  t = xargv[*n];
 else
  t = "";
 for(i = 0; i<ls && *t!='\0' ; ++i)
  *s++ = *t++;
 for( ; i<ls ; ++i)
  *s++ = ' ';
 }

canonical_original_code:
void getarg_(long *n, char *s, long ls)
{
 extern int xargc;
 extern char **xargv;
 char *t;
 int i;
 if(*n>=0 && *n<xargc)
  t = xargv[*n];
 else
  t = "";
 for(i = 0; i<ls && *t!='\0' ; ++i)
  *s++ = *t++;
 for( ; i<ls ; ++i)
  *s++ = ' ';
 }

variable_types:
n
long *

variable_types:
s
char *

variable_types: ls long

variable_types: xargc int

variable_types:
xargv
char **

variable_types:
t
char *

variable_types: i int


decompiled_code:
unsigned __int64 __fastcall i_abs(__int64 *a1)
{
return abs64(*a1);
}

canonical_decompiled_code:
unsigned __int64 __fastcall func0(__int64 *a1)
{
return abs64(*a1);
}

original_code:
integer i_abs(integer *x)
{
if(*x >= 0)
 return(*x);
return(- *x);
}

canonical_original_code:
long i_abs(long *x)
{
if(*x >= 0)
 return(*x);
return(- *x);
}

variable_types:
x
long *


decompiled_code:
__int64 iargc_()
{
return xargc - 1;
}

canonical_decompiled_code:
__int64 func0()
{
return xargc - 1;
}

original_code:
ftnint iargc_(void)
{
extern int xargc;
return ( xargc - 1 );
}

canonical_original_code:
long iargc_()
{
extern int xargc;
return ( xargc - 1 );
}


decompiled_code:
void __fastcall z_cos(double *a1, double *a2)
{
double v2; // xmm0_8
double x; // [rsp+8h] [rbp-50h]
double v4; // [rsp+10h] [rbp-48h]
double v5; // [rsp+48h] [rbp-10h]

v4 = a2[1];
x = *a2;
v5 = cos(*a2);
*a1 = v5 * cosh(v4);
v2 = sin(x);
a1[1] = COERCE_DOUBLE(*(_QWORD *)&v2 ^ LC0) * sinh(v4);
}

canonical_decompiled_code:
void __fastcall func0(double *a1, double *a2)
{
double v2; // xmm0_8
double x; // [rsp+8h] [rbp-50h]
double v4; // [rsp+10h] [rbp-48h]
double v5; // [rsp+48h] [rbp-10h]

v4 = a2[1];
x = *a2;
v5 = cos(*a2);
*a1 = v5 * cosh(v4);
v2 = sin(x);
a1[1] = COERCE_DOUBLE(*(_QWORD *)&v2 ^ LC0) * sinh(v4);
}

original_code:
void z_cos(doublecomplex *r, doublecomplex *z)
{
 double zi = z->i, zr = z->r;
 r->r = cos(zr) * cosh(zi);
 r->i = - sin(zr) * sinh(zi);
 }

canonical_original_code:
void z_cos(struct doublecomplex *r, struct doublecomplex *z)
{
 double zi = z->i; double zr = z->r;
 r->r = cos(zr) * cosh(zi);
 r->i = - sin(zr) * sinh(zi);
 }

variable_types:
r
struct doublecomplex { double r; } *

variable_types:
z
struct doublecomplex *

variable_types: zi double

variable_types: zr double


decompiled_code:
__int64 __fastcall i_nint(float *a1)
{
double v1; // xmm3_8
__m128d v2; // xmm3
__int64 result; // rax
unsigned __int64 v4; // xmm3_8
__m128d v5; // xmm3
double v6; // [rsp+10h] [rbp-30h]
double v7; // [rsp+28h] [rbp-18h]
float v8; // [rsp+3Ch] [rbp-4h]

v8 = *a1;
if ( *a1 < 0.0 )
{
v6 = 0.5 - v8;
*(double *)&v4 = v6;
if ( COERCE_DOUBLE(*(_QWORD *)&v6 & LC3) < 4.503599627370496e15 )
{
v5.m128d_f64[0] = (double)(int)v6;
v4 = COERCE_UNSIGNED_INT64(v5.m128d_f64[0] - COERCE_DOUBLE(*(_OWORD *)&_mm_cmpgt_sd(
v5,
(__m128d)*(unsigned __int64 *)&v6) & LC4)) | ~LC3 & *(_QWORD *)&v6;
}
result = (unsigned int)(int)COERCE_DOUBLE(v4 ^ LC5);
}
else
{
v7 = v8 + 0.5;
v1 = v7;
if ( COERCE_DOUBLE(*(_QWORD *)&v7 & LC3) < 4.503599627370496e15 )
{
v2.m128d_f64[0] = (double)(int)v7;
*(_QWORD *)&v1 = COERCE_UNSIGNED_INT64(
v2.m128d_f64[0]
- COERCE_DOUBLE(*(_OWORD *)&_mm_cmpgt_sd(v2, (__m128d)*(unsigned __int64 *)&v7) & LC4)) | ~LC3 & *(_QWORD *)&v7;
}
result = (unsigned int)(int)v1;
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func0(float *a1)
{
double v1; // xmm3_8
__m128d v2; // xmm3
__int64 result; // rax
unsigned __int64 v4; // xmm3_8
__m128d v5; // xmm3
double v6; // [rsp+10h] [rbp-30h]
double v7; // [rsp+28h] [rbp-18h]
float v8; // [rsp+3Ch] [rbp-4h]

v8 = *a1;
if ( *a1 < 0.0 )
{
v6 = 0.5 - v8;
*(double *)&v4 = v6;
if ( COERCE_DOUBLE(*(_QWORD *)&v6 & LC3) < 4.503599627370496e15 )
{
v5.m128d_f64[0] = (double)(int)v6;
v4 = COERCE_UNSIGNED_INT64(v5.m128d_f64[0] - COERCE_DOUBLE(*(_OWORD *)&_mm_cmpgt_sd(
v5,
(__m128d)*(unsigned __int64 *)&v6) & LC4)) | ~LC3 & *(_QWORD *)&v6;
}
result = (unsigned int)(int)COERCE_DOUBLE(v4 ^ LC5);
}
else
{
v7 = v8 + 0.5;
v1 = v7;
if ( COERCE_DOUBLE(*(_QWORD *)&v7 & LC3) < 4.503599627370496e15 )
{
v2.m128d_f64[0] = (double)(int)v7;
*(_QWORD *)&v1 = COERCE_UNSIGNED_INT64(
v2.m128d_f64[0]
- COERCE_DOUBLE(*(_OWORD *)&_mm_cmpgt_sd(v2, (__m128d)*(unsigned __int64 *)&v7) & LC4)) | ~LC3 & *(_QWORD *)&v7;
}
result = (unsigned int)(int)v1;
}
return result;
}

original_code:
integer i_nint(real *x)
{
return (integer)(*x >= 0 ? floor(*x + .5) : -floor(.5 - *x));
}

canonical_original_code:
long i_nint(float *x)
{
return (integer)(*x >= 0 ? floor(*x + .5) : -floor(.5 - *x));
}


decompiled_code:
__int64 __fastcall i_dim(_QWORD *a1, _QWORD *a2)
{
__int64 result; // rax

result = *a1 - *a2;
if ( *a1 <= *a2 )
result = 0LL;
return result;
}

canonical_decompiled_code:
__int64 __fastcall func0(_QWORD *a1, _QWORD *a2)
{
__int64 result; // rax

result = *a1 - *a2;
if ( *a1 <= *a2 )
result = 0LL;
return result;
}

original_code:
integer i_dim(integer *a, integer *b)
{
return( *a > *b ? *a - *b : 0);
}

canonical_original_code:
long i_dim(long *a, long *b)
{
return( *a > *b ? *a - *b : 0);
}

variable_types:
a
long *

variable_types:
b
long *


decompiled_code:
double __fastcall d_sign(double *a1, double *a2)
{
double v3; // [rsp+8h] [rbp-8h]

v3 = *a1;
if ( *a1 < 0.0 )
*(_QWORD *)&v3 ^= LC1;
if ( *a2 < 0.0 )
*(_QWORD *)&v3 ^= LC1;
return v3;
}

canonical_decompiled_code:
double __fastcall func0(double *a1, double *a2)
{
double v3; // [rsp+8h] [rbp-8h]

v3 = *a1;
if ( *a1 < 0.0 )
*(_QWORD *)&v3 ^= LC1;
if ( *a2 < 0.0 )
*(_QWORD *)&v3 ^= LC1;
return v3;
}

original_code:
double d_sign(doublereal *a, doublereal *b)
{
double x;
x = (*a >= 0 ? *a : - *a);
return( *b >= 0 ? x : -x);
}

canonical_original_code:
double d_sign(double *a, double *b)
{
double x;
x = (*a >= 0 ? *a : - *a);
return( *b >= 0 ? x : -x);
}

variable_types:
a
double *

variable_types:
b
double *

variable_types: x double


decompiled_code:
unsigned __int64 l_lt()
{
return (unsigned __int64)s_cmp() >> 63;
}

canonical_decompiled_code:
unsigned __int64 func0()
{
return (unsigned __int64)s_cmp() >> 63;
}

original_code:
logical l_lt(char *a, char *b, ftnlen la, ftnlen lb)
{
return(s_cmp(a,b,la,lb) < 0);
}

canonical_original_code:
long l_lt(char *a, char *b, long la, long lb)
{
return(s_cmp(a,b,la,lb) < 0);
}

variable_types:
a
char *

variable_types:
b
char *

variable_types: la long

variable_types: lb long


decompiled_code:
void __fastcall d_sin(double *a1)
{
sin(*a1);
}

canonical_decompiled_code:
void __fastcall func0(double *a1)
{
sin(*a1);
}

original_code:
double d_sin(doublereal *x)
{
return( sin(*x) );
}

canonical_original_code:
double d_sin(double *x)
{
return( sin(*x) );
}

variable_types:
x
double *


decompiled_code:
_BOOL8 l_ge()
{
return s_cmp() >= 0;
}

original_code:
logical l_ge(char *a, char *b, ftnlen la, ftnlen lb)
{
return(s_cmp(a,b,la,lb) >= 0);
}

canonical_original_code:
long l_ge(char *a, char *b, long la, long lb)
{
return(s_cmp(a,b,la,lb) >= 0);
}


decompiled_code:
__int64 __fastcall pow_hh(unsigned __int16 *a1, unsigned __int16 *a2)
{
int v2; // ecx
unsigned int v3; // edx
__int64 result; // rax

v2 = *a1;
v3 = *a2;
if ( (__int16)v3 > 0 )
{
LABEL_2:
v3 = (__int16)v3;
result = 1LL;
while ( 1 )
{
if ( (v3 & 1) != 0 )
result = (unsigned int)(v2 * result);
v3 >>= 1;
if ( !v3 )
break;
v2 *= v2;
}
return result;
}
if ( !(_WORD)v3 || (_WORD)v2 == 1 )
return 1LL;
if ( (_WORD)v2 == 0xFFFF )
{
v3 = -v3;
goto LABEL_2;
}
result = 0LL;
if ( !(_WORD)v2 )
result = 1 / 0;
return result;
}

canonical_decompiled_code:
__int64 __fastcall func0(unsigned __int16 *a1, unsigned __int16 *a2)
{
int v2; // ecx
unsigned int v3; // edx
__int64 result; // rax

v2 = *a1;
v3 = *a2;
if ( (__int16)v3 > 0 )
{
LABEL_2:
v3 = (__int16)v3;
result = 1LL;
while ( 1 )
{
if ( (v3 & 1) != 0 )
result = (unsigned int)(v2 * result);
v3 >>= 1;
if ( !v3 )
break;
v2 *= v2;
}
return result;
}
if ( !(_WORD)v3 || (_WORD)v2 == 1 )
return 1LL;
if ( (_WORD)v2 == 0xFFFF )
{
v3 = -v3;
goto LABEL_2;
}
result = 0LL;
if ( !(_WORD)v2 )
result = 1 / 0;
return result;
}

original_code:
shortint pow_hh(shortint *ap, shortint *bp)
{
 shortint pow, x, n;
 unsigned u;
 x = *ap;
 n = *bp;
 if (n <= 0) {
  if (n == 0 || x == 1)
   return 1;
  if (x != -1)
   return x == 0 ? 1/x : 0;
  n = -n;
  }
 u = n;
 for(pow = 1; ; )
  {
  if(u & 01)
   pow *= x;
  if(u >>= 1)
   x *= x;
  else
   break;
  }
 return(pow);
 }

canonical_original_code:
short pow_hh(short *ap, short *bp)
{
 short pow; short x; short n;
 unsigned int u;
 x = *ap;
 n = *bp;
 if (n <= 0) {
  if (n == 0 || x == 1)
   return 1;
  if (x != -1)
   return x == 0 ? 1/x : 0;
  n = -n;
  }
 u = n;
 for(pow = 1; ; )
  {
  if(u & 01)
   pow *= x;
  if(u >>= 1)
   x *= x;
  else
   break;
  }
 return(pow);
 }

variable_types:
ap
short *

variable_types:
bp
short *

variable_types: pow short

variable_types: x short

variable_types: n short

variable_types:
u
unsigned int


decompiled_code:
void __fastcall z_sin(double *a1, double *a2)
{
double x; // [rsp+0h] [rbp-48h]
double v3; // [rsp+8h] [rbp-40h]
double v4; // [rsp+20h] [rbp-28h]
double v5; // [rsp+38h] [rbp-10h]

v3 = a2[1];
x = *a2;
v5 = sin(*a2);
*a1 = v5 * cosh(v3);
v4 = cos(x);
a1[1] = v4 * sinh(v3);
}

canonical_decompiled_code:
void __fastcall func0(double *a1, double *a2)
{
double x; // [rsp+0h] [rbp-48h]
double v3; // [rsp+8h] [rbp-40h]
double v4; // [rsp+20h] [rbp-28h]
double v5; // [rsp+38h] [rbp-10h]

v3 = a2[1];
x = *a2;
v5 = sin(*a2);
*a1 = v5 * cosh(v3);
v4 = cos(x);
a1[1] = v4 * sinh(v3);
}

original_code:
void z_sin(doublecomplex *r, doublecomplex *z)
{
 double zi = z->i, zr = z->r;
 r->r = sin(zr) * cosh(zi);
 r->i = cos(zr) * sinh(zi);
 }

canonical_original_code:
void z_sin(struct doublecomplex *r, struct doublecomplex *z)
{
 double zi = z->i; double zr = z->r;
 r->r = sin(zr) * cosh(zi);
 r->i = cos(zr) * sinh(zi);
 }

variable_types:
r
struct doublecomplex { double r; } *

variable_types:
z
struct doublecomplex *

variable_types: zi double

variable_types: zr double


decompiled_code:
__int64 e_rsfe()
{
__int64 result; // rax

LODWORD(result) = en_fio();
f__fmtbuf = 0LL;
return (int)result;
}

canonical_decompiled_code:
__int64 func0()
{
__int64 result; // rax

LODWORD(result) = en_fio();
f__fmtbuf = 0LL;
return (int)result;
}

original_code:
integer e_rsfe(void)
{ int n;
 n=en_fio();
 f__fmtbuf=((void *)0);
 return(n);
}

canonical_original_code:
long e_rsfe()
{ int n;
 n=en_fio();
 f__fmtbuf=((void *)0);
 return(n);
}

variable_types: n int


decompiled_code:
__int64 e_wsfe()
{
__int64 result; // rax

LODWORD(result) = en_fio();
f__fmtbuf = 0LL;
return (int)result;
}

canonical_decompiled_code:
__int64 func2()
{
__int64 result; // rax

LODWORD(result) = en_fio();
f__fmtbuf = 0LL;
return (int)result;
}

original_code:
integer e_wsfe(void)
{
 int n = en_fio();
 f__fmtbuf = ((void *)0);
 return n;
}

canonical_original_code:
long e_wsfe()
{
 int n = en_fio();
 f__fmtbuf = ((void *)0);
 return n;
}


original_code:
void pow_zi(doublecomplex *p, doublecomplex *a, integer *b)
{
 integer n;
 unsigned long u;
 double t;
 doublecomplex q, x;
 static doublecomplex one = {1.0, 0.0};
 n = *b;
 q.r = 1;
 q.i = 0;
 if(n == 0)
  goto done;
 if(n < 0)
  {
  n = -n;
  z_div(&x, &one, a);
  }
 else
  {
  x.r = a->r;
  x.i = a->i;
  }
 for(u = n; ; )
  {
  if(u & 01)
   {
   t = q.r * x.r - q.i * x.i;
   q.i = q.r * x.i + q.i * x.r;
   q.r = t;
   }
  if(u >>= 1)
   {
   t = x.r * x.r - x.i * x.i;
   x.i = 2 * x.r * x.i;
   x.r = t;
   }
  else
   break;
  }
 done:
 p->i = q.i;
 p->r = q.r;
 }

canonical_original_code:
void pow_zi(struct doublecomplex *p, struct doublecomplex *a, long *b)
{
 long n;
 unsigned long u;
 double t;
 struct doublecomplex q; struct doublecomplex x;
 static struct doublecomplex one = {1.0, 0.0};
 n = *b;
 q.r = 1;
 q.i = 0;
 if(n == 0)
  goto done;
 if(n < 0)
  {
  n = -n;
  z_div(&x, &one, a);
  }
 else
  {
  x.r = a->r;
  x.i = a->i;
  }
 for(u = n; ; )
  {
  if(u & 01)
   {
   t = q.r * x.r - q.i * x.i;
   q.i = q.r * x.i + q.i * x.r;
   q.r = t;
   }
  if(u >>= 1)
   {
   t = x.r * x.r - x.i * x.i;
   x.i = 2 * x.r * x.i;
   x.r = t;
   }
  else
   break;
  }
 done:
 p->i = q.i;
 p->r = q.r;
 }

variable_types:
p
struct doublecomplex { double r; } *

variable_types:
a
struct doublecomplex *

variable_types:
b
long *

variable_types: n long

variable_types:
u
unsigned long

variable_types: t double

variable_types:
q
struct doublecomplex { double r; }

variable_types:
x
struct doublecomplex { double r; }

variable_types:
one
struct doublecomplex { double r; }


decompiled_code:
void __fastcall __noreturn exit_(_QWORD *a1)
{
exit(*a1);
}

canonical_decompiled_code:
void __fastcall __noreturn func0(_QWORD *a1)
{
exit(*a1);
}

original_code:
void
exit_(integer *rc)
{
 exit(*rc);
 }

canonical_original_code:
void exit_(long *rc)
{
 exit(*rc);
 }

variable_types:
rc
long *


decompiled_code:
void __fastcall z_exp(double *a1, double *a2)
{
double v2; // [rsp+8h] [rbp-40h]
double v3; // [rsp+10h] [rbp-38h]

v3 = a2[1];
v2 = exp(*a2);
*a1 = cos(v3) * v2;
a1[1] = sin(v3) * v2;
}

canonical_decompiled_code:
void __fastcall func0(double *a1, double *a2)
{
double v2; // [rsp+8h] [rbp-40h]
double v3; // [rsp+10h] [rbp-38h]

v3 = a2[1];
v2 = exp(*a2);
*a1 = cos(v3) * v2;
a1[1] = sin(v3) * v2;
}

original_code:
void z_exp(doublecomplex *r, doublecomplex *z)
{
 double expx, zi = z->i;
 expx = exp(z->r);
 r->r = expx * cos(zi);
 r->i = expx * sin(zi);
 }

canonical_original_code:
void z_exp(struct doublecomplex *r, struct doublecomplex *z)
{
 double expx; double zi = z->i;
 expx = exp(z->r);
 r->r = expx * cos(zi);
 r->i = expx * sin(zi);
 }

variable_types: expx double


decompiled_code:
void __fastcall r_sqrt(float *a1)
{
sqrt(*a1);
}

canonical_decompiled_code:
void __fastcall func0(float *a1)
{
sqrt(*a1);
}

original_code:
double r_sqrt(real *x)
{
return( sqrt(*x) );
}

canonical_original_code:
double r_sqrt(float *x)
{
return( sqrt(*x) );
}

variable_types:
x
float *


decompiled_code:
void __fastcall z_abs(double *a1)
{
f__cabs(*a1, a1[1]);
}

canonical_decompiled_code:
void __fastcall func0(double *a1)
{
f__cabs(*a1, a1[1]);
}

original_code:
double z_abs(doublecomplex *z)
{
return( f__cabs( z->r, z->i ) );
}

canonical_original_code:
double z_abs(struct doublecomplex *z)
{
return( f__cabs( z->r, z->i ) );
}

variable_types:
z
struct doublecomplex { double r; } *


original_code:
double pow_di(doublereal *ap, integer *bp)
{
double pow, x;
integer n;
unsigned long u;
pow = 1;
x = *ap;
n = *bp;
if(n != 0)
 {
 if(n < 0)
  {
  n = -n;
  x = 1/x;
  }
 for(u = n; ; )
  {
  if(u & 01)
   pow *= x;
  if(u >>= 1)
   x *= x;
  else
   break;
  }
 }
return(pow);
}

canonical_original_code:
double pow_di(double *ap, long *bp)
{
double pow; double x;
long n;
unsigned long u;
pow = 1;
x = *ap;
n = *bp;
if(n != 0)
 {
 if(n < 0)
  {
  n = -n;
  x = 1/x;
  }
 for(u = n; ; )
  {
  if(u & 01)
   pow *= x;
  if(u >>= 1)
   x *= x;
  else
   break;
  }
 }
return(pow);
}

variable_types:
ap
double *

variable_types:
bp
long *

variable_types: pow double

variable_types: x double


decompiled_code:
void __fastcall d_tan(double *a1)
{
tan(*a1);
}

canonical_decompiled_code:
void __fastcall func0(double *a1)
{
tan(*a1);
}

original_code:
double d_tan(doublereal *x)
{
return( tan(*x) );
}

canonical_original_code:
double d_tan(double *x)
{
return( tan(*x) );
}

variable_types:
x
double *


decompiled_code:
double __fastcall d_prod(float *a1, float *a2)
{
return (float)(*a1 * *a2);
}

canonical_decompiled_code:
double __fastcall func0(float *a1, float *a2)
{
return (float)(*a1 * *a2);
}

original_code:
double d_prod(real *x, real *y)
{
return( (*x) * (*y) );
}

canonical_original_code:
double d_prod(float *x, float *y)
{
return( (*x) * (*y) );
}

variable_types:
y
float *


decompiled_code:
__int64 __fastcall pow_ii(__int64 *a1, unsigned __int64 *a2)
{
__int64 v2; // rcx
unsigned __int64 v3; // rdx
__int64 result; // rax

v2 = *a1;
v3 = *a2;
if ( (__int64)*a2 > 0 )
{
LABEL_2:
result = 1LL;
while ( 1 )
{
if ( (v3 & 1) != 0 )
result *= v2;
v3 >>= 1;
if ( !v3 )
break;
v2 *= v2;
}
return result;
}
if ( !*a2 || v2 == 1 )
return 1LL;
if ( v2 == -1 )
{
v3 = -(__int64)v3;
goto LABEL_2;
}
result = 0LL;
if ( !v2 )
result = 1 / 0LL;
return result;
}

canonical_decompiled_code:
__int64 __fastcall func0(__int64 *a1, unsigned __int64 *a2)
{
__int64 v2; // rcx
unsigned __int64 v3; // rdx
__int64 result; // rax

v2 = *a1;
v3 = *a2;
if ( (__int64)*a2 > 0 )
{
LABEL_2:
result = 1LL;
while ( 1 )
{
if ( (v3 & 1) != 0 )
result *= v2;
v3 >>= 1;
if ( !v3 )
break;
v2 *= v2;
}
return result;
}
if ( !*a2 || v2 == 1 )
return 1LL;
if ( v2 == -1 )
{
v3 = -(__int64)v3;
goto LABEL_2;
}
result = 0LL;
if ( !v2 )
result = 1 / 0LL;
return result;
}

original_code:
integer pow_ii(integer *ap, integer *bp)
{
 integer pow, x, n;
 unsigned long u;
 x = *ap;
 n = *bp;
 if (n <= 0) {
  if (n == 0 || x == 1)
   return 1;
  if (x != -1)
   return x == 0 ? 1/x : 0;
  n = -n;
  }
 u = n;
 for(pow = 1; ; )
  {
  if(u & 01)
   pow *= x;
  if(u >>= 1)
   x *= x;
  else
   break;
  }
 return(pow);
 }

canonical_original_code:
long pow_ii(long *ap, long *bp)
{
 long pow; long x; long n;
 unsigned long u;
 x = *ap;
 n = *bp;
 if (n <= 0) {
  if (n == 0 || x == 1)
   return 1;
  if (x != -1)
   return x == 0 ? 1/x : 0;
  n = -n;
  }
 u = n;
 for(pow = 1; ; )
  {
  if(u & 01)
   pow *= x;
  if(u >>= 1)
   x *= x;
  else
   break;
  }
 return(pow);
 }

variable_types:
ap
long *

variable_types: pow long

variable_types: x long


decompiled_code:
void *__fastcall F77_aloc(size_t size, const char *a2)
{
void *result; // rax

result = malloc((unsigned int)size);
if ( !result )
{
fprintf(stderr, "malloc(%u) failure in %s\n", (unsigned int)size, a2);
exit_((int)&status);
}
return result;
}

canonical_decompiled_code:
void *__fastcall func0(size_t size, const char *a2)
{
void *result; // rax

result = malloc((unsigned int)size);
if ( !result )
{
fprintf(stderr, "malloc(%u) failure in %s\n", (unsigned int)size, a2);
exit_((int)&status);
}
return result;
}

original_code:
char *
F77_aloc(integer Len, const char *whence)
{
 char *rv;
 unsigned int uLen = (unsigned int) Len;
 if (!(rv = (char*)malloc(uLen))) {
  fprintf(stderr, "malloc(%u) failure in %s\n",
   uLen, whence);
  exit_(&memfailure);
  }
 return rv;
 }

canonical_original_code:
char *F77_aloc(long Len, char *whence)
{
 char *rv;
 unsigned int uLen = (unsigned int) Len;
 if (!(rv = (char *)malloc(uLen))) {
  fprintf(stderr, "malloc(%u) failure in %s\n",
   uLen, whence);
  exit_(&memfailure);
  }
 return rv;
 }

variable_types: Len long

variable_types:
whence
char *

variable_types:
rv
char *

variable_types:
uLen
unsigned int

return_type: char *


decompiled_code:
_BOOL8 l_le()
{
return s_cmp() <= 0;
}

canonical_decompiled_code:
_BOOL8 func0()
{
return s_cmp() <= 0;
}

original_code:
logical l_le(char *a, char *b, ftnlen la, ftnlen lb)
{
return(s_cmp(a,b,la,lb) <= 0);
}

canonical_original_code:
long l_le(char *a, char *b, long la, long lb)
{
return(s_cmp(a,b,la,lb) <= 0);
}

variable_types:
a
char *

variable_types:
b
char *

variable_types: la long

variable_types: lb long


canonical_decompiled_code:
double __fastcall func0(double *a1)
{
return 0.4342944819032518 * log(*a1);
}


decompiled_code:
void __fastcall r_sinh(float *a1)
{
sinh(*a1);
}

canonical_decompiled_code:
void __fastcall func0(float *a1)
{
sinh(*a1);
}

original_code:
double r_sinh(real *x)
{
return( sinh(*x) );
}

canonical_original_code:
double r_sinh(float *x)
{
return( sinh(*x) );
}

variable_types:
x
float *


decompiled_code:
double __fastcall d_imag(__int64 a1)
{
return *(double *)(a1 + 8);
}

canonical_decompiled_code:
double __fastcall func0(__int64 a1)
{
return *(double *)(a1 + 8);
}

original_code:
double d_imag(doublecomplex *z)
{
return(z->i);
}

canonical_original_code:
double d_imag(struct doublecomplex *z)
{
return(z->i);
}

variable_types:
z
struct doublecomplex { double r; } *


decompiled_code:
__int64 __fastcall pow_ci(float *a1, int *a2)
{
__int64 result; // rax
float v3; // xmm0_4
float v4; // xmm0_4
__int64 v5[2]; // [rsp+0h] [rbp-68h] BYREF
__int64 v6[7]; // [rsp+10h] [rbp-58h] BYREF
float v7; // [rsp+4Ch] [rbp-1Ch]
double v8; // [rsp+50h] [rbp-18h]
float v9; // [rsp+5Ch] [rbp-Ch]

v9 = *(float *)a2;
v8 = v9;
*(double *)v5 = v9;
v7 = *((float *)a2 + 1);
*(double *)&v6[6] = v7;
*(double *)&v5[1] = v7;
result = pow_zi(v6, v5);
v3 = *(double *)v6;
*a1 = v3;
v4 = *(double *)&v6[1];
a1[1] = v4;
return result;
}

canonical_decompiled_code:
__int64 __fastcall func0(float *a1, int *a2)
{
__int64 result; // rax
float v3; // xmm0_4
float v4; // xmm0_4
__int64 v5[2]; // [rsp+0h] [rbp-68h] BYREF
__int64 v6[7]; // [rsp+10h] [rbp-58h] BYREF
float v7; // [rsp+4Ch] [rbp-1Ch]
double v8; // [rsp+50h] [rbp-18h]
float v9; // [rsp+5Ch] [rbp-Ch]

v9 = *(float *)a2;
v8 = v9;
*(double *)v5 = v9;
v7 = *((float *)a2 + 1);
*(double *)&v6[6] = v7;
*(double *)&v5[1] = v7;
result = pow_zi(v6, v5);
v3 = *(double *)v6;
*a1 = v3;
v4 = *(double *)&v6[1];
a1[1] = v4;
return result;
}

original_code:
void pow_ci(complex *p, complex *a, integer *b)
{
doublecomplex p1, a1;
a1.r = a->r;
a1.i = a->i;
pow_zi(&p1, &a1, b);
p->r = p1.r;
p->i = p1.i;
}

canonical_original_code:
void pow_ci(struct complex *p, struct complex *a, long *b)
{
struct doublecomplex p1; struct doublecomplex a1;
a1.r = a->r;
a1.i = a->i;
pow_zi(&p1, &a1, b);
p->r = p1.r;
p->i = p1.i;
}

variable_types:
p
struct complex { float r; } *

variable_types:
a
struct complex *

variable_types:
b
long *

user_defined_types:
struct doublecomplex { double r; }
struct complex { float r; }


decompiled_code:
void __fastcall c_abs(float *a1)
{
f__cabs(*a1, a1[1]);
}

canonical_decompiled_code:
void __fastcall func0(float *a1)
{
f__cabs(*a1, a1[1]);
}

original_code:
double c_abs(complex *z)
{
return( f__cabs( z->r, z->i ) );
}

canonical_original_code:
double c_abs(struct complex *z)
{
return( f__cabs( z->r, z->i ) );
}

variable_types:
z
struct complex { float r; } *


decompiled_code:
_BOOL8 hl_gt()
{
return s_cmp() > 0;
}

canonical_decompiled_code:
_BOOL8 func0()
{
return s_cmp() > 0;
}

original_code:
shortlogical hl_gt(char *a, char *b, ftnlen la, ftnlen lb)
{
return(s_cmp(a,b,la,lb) > 0);
}

canonical_original_code:
short hl_gt(char *a, char *b, long la, long lb)
{
return(s_cmp(a,b,la,lb) > 0);
}