decompiled_code:
void __fastcall destroy_context(void *ptr)
{
void *v2; // rdi

if ( ptr )
{
v2 = (void *)*((_QWORD *)ptr + 124);
if ( v2 )
free(v2);
free(ptr);
}
}

canonical_decompiled_code:
void __fastcall func7(void *ptr)
{
void *v2; // rdi

if ( ptr )
{
v2 = (void *)*((_QWORD *)ptr + 124);
if ( v2 )
free(v2);
free(ptr);
}
}

original_code:
void destroy_context( cr_context* context )
{
  if( context ){
    if( context->to.uc_stack.ss_sp ){
      free( context->to.uc_stack.ss_sp );
    }
    free( context );
  }
}

canonical_original_code:
void destroy_context(struct tag_cr_context *context)
{
  if( context ){
    if( context->to.uc_stack.ss_sp ){
      free( context->to.uc_stack.ss_sp );
    }
    free( context );
  }
}

user_defined_types: struct stack_t { void *ss_sp; int ss_flags; unsigned long ss_size; }

user_defined_types: struct __sigset_t { unsigned long __val[-1]; }

user_defined_types: struct _libc_fpxreg { unsigned short significand[4]; unsigned short exponent; unsigned short __glibc_reserved1[3]; }

user_defined_types: struct _libc_xmmreg { unsigned int element[4]; }


resume

repo: kimito/libcr

decompiled_code:
int __fastcall resume(__int64 a1)
{
now_context = a1;
return swapcontext((ucontext_t *)(a1 + 8), (const ucontext_t *)(a1 + 976));
}

canonical_decompiled_code:
int __fastcall func8(__int64 a1)
{
now_context = a1;
return swapcontext((ucontext_t *)(a1 + 8), (const ucontext_t *)(a1 + 976));
}

original_code:
void resume( cr_context *context )
{
  now_context = context;
  swapcontext( &(context->from), &(context->to) );
}

canonical_original_code:
void resume(struct tag_cr_context *context)
{
  now_context = context;
  swapcontext( &(context->from), &(context->to) );
}

variable_types: struct tag_cr_context { struct tag_cr_context *parent; struct ucontext_t { unsigned long uc_flags; struct ucontext_t *uc_link; struct stack_t { void *ss_sp; int ss_flags; unsigned long ss_size; } uc_stack; struct mcontext_t { long long gregs[23]; struct _libc_fpstate { unsigned short cwd; unsigned short swd; unsigned short ftw; unsigned short fop; unsigned long rip; unsigned long rdp; unsigned int mxcsr; unsigned int mxcr_mask; struct _libc_fpxreg { unsigned short significand[4]; unsigned short exponent; unsigned short __glibc_reserved1[3]; } _st[8]; struct _libc_xmmreg { unsigned int element[4]; } _xmm[16]; unsigned int __glibc_reserved1[24]; } *fpregs; unsigned long long __reserved1[8]; } uc_mcontext; struct __sigset_t { unsigned long __val[-1]; } uc_sigmask; struct _libc_fpstate __fpregs_mem; unsigned long long __ssp[4]; } from; struct ucontext_t to; } *

return_type: void

user_defined_types: struct tag_cr_context { struct tag_cr_context *parent; struct ucontext_t from; struct ucontext_t to; }

user_defined_types: struct ucontext_t { unsigned long uc_flags; struct ucontext_t *uc_link; struct stack_t uc_stack; struct mcontext_t uc_mcontext; struct __sigset_t uc_sigmask; struct _libc_fpstate __fpregs_mem; unsigned long long __ssp[4]; }

user_defined_types: struct mcontext_t { long long gregs[23]; struct _libc_fpstate *fpregs; unsigned long long __reserved1[8]; }

user_defined_types: struct _libc_fpstate { unsigned short cwd; unsigned short swd; unsigned short ftw; unsigned short fop; unsigned long rip; unsigned long rdp; unsigned int mxcsr; unsigned int mxcr_mask; struct _libc_fpxreg _st[8]; struct _libc_xmmreg _xmm[16]; unsigned int __glibc_reserved1[24]; }


yield

decompiled_code:
int yield()
{
const ucontext_t *v0; // rsi
ucontext_t *v1; // rdi
int result; // eax

if ( now_context )
{
v0 = (const ucontext_t *)(now_context + 8);
v1 = (ucontext_t *)(now_context + 976);
now_context = *(_QWORD *)now_context;
result = swapcontext(v1, v0);
}
return result;
}

canonical_decompiled_code:
int func9()
{
const ucontext_t *v0; // rsi
ucontext_t *v1; // rdi
int result; // eax

if ( now_context )
{
v0 = (const ucontext_t *)(now_context + 8);
v1 = (ucontext_t *)(now_context + 976);
now_context = *(_QWORD *)now_context;
result = swapcontext(v1, v0);
}
return result;
}

original_code:
void yield()
{
  if( now_context ){
    cr_context *tmp = now_context;
    now_context = tmp->parent;
    swapcontext( &(tmp->to), &(tmp->from) );
  }
}

canonical_original_code:
void yield()
{
  if( now_context ){
    struct tag_cr_context *tmp = now_context;
    now_context = tmp->parent;
    swapcontext( &(tmp->to), &(tmp->from) );
  }
}


repo: kimtang/qml

decompiled_code:
void __fastcall r_atan(float *a1)
{
atan(*a1);
}

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

original_code:
double r_atan(real *x)
{
return( atan(*x) );
}

canonical_original_code:
double r_atan(float *x)
{
return( atan(*x) );
}

variable_types:
x
float *

return_type: double


decompiled_code:
__int64 __fastcall f__fatal(unsigned int a1, const char *a2)
{
const char *v2; // rsi
const char *v3; // r9
const char *v4; // r8
const char *v5; // rcx
const char *v6; // rdx

if ( a1 <= 0x63 )
{
perror(a2);
}
else if ( a1 + 1 > 0x84 )
{
fprintf(stderr, "%s: illegal error number %d\n", a2, a1);
}
else if ( a1 == -1 )
{
fprintf(stderr, "%s: end of file\n", a2);
}
else
{
fprintf(stderr, "%s: %s\n", a2, (&F_err)[a1 - 100]);
}
if ( f__curunit )
{
fprintf(stderr, "apparent state: unit %d ", 0x2E8BA2E8BA2E8BA3LL * ((__int64)(f__curunit - (_QWORD)&f__units) >> 3));
v2 = "named %s\n";
if ( !*(_QWORD *)(f__curunit + 8LL) )
v2 = "(unnamed)\n";
fprintf(stderr, v2);
}
else
{
fwrite("apparent state: internal I/O\n", 1uLL, 0x1DuLL, stderr);
}
if ( f__fmtbuf )
fprintf(stderr, "last format: %s\n", f__fmtbuf);
v3 = "external";
v4 = "formatted";
v5 = "sequential";
v6 = "reading";
if ( !f__external )
v3 = "internal";
if ( !f__formatted )
v4 = "unformatted";
if ( !f__sequential )
v5 = "direct";
if ( !f__reading )
v6 = "writing";
fprintf(stderr, "lately %s %s %s %s", v6, v5, v4, v3);
return sig_die(" IO", 1LL);
}

canonical_decompiled_code:
__int64 __fastcall func1(unsigned int a1, const char *a2)
{
const char *v2; // rsi
const char *v3; // r9
const char *v4; // r8
const char *v5; // rcx
const char *v6; // rdx

if ( a1 <= 0x63 )
{
perror(a2);
}
else if ( a1 + 1 > 0x84 )
{
fprintf(stderr, "%s: illegal error number %d\n", a2, a1);
}
else if ( a1 == -1 )
{
fprintf(stderr, "%s: end of file\n", a2);
}
else
{
fprintf(stderr, "%s: %s\n", a2, (&F_err)[a1 - 100]);
}
if ( f__curunit )
{
fprintf(stderr, "apparent state: unit %d ", 0x2E8BA2E8BA2E8BA3LL * ((__int64)(f__curunit - (_QWORD)&f__units) >> 3));
v2 = "named %s\n";
if ( !*(_QWORD *)(f__curunit + 8LL) )
v2 = "(unnamed)\n";
fprintf(stderr, v2);
}
else
{
fwrite("apparent state: internal I/O\n", 1uLL, 0x1DuLL, stderr);
}
if ( f__fmtbuf )
fprintf(stderr, "last format: %s\n", f__fmtbuf);
v3 = "external";
v4 = "formatted";
v5 = "sequential";
v6 = "reading";
if ( !f__external )
v3 = "internal";
if ( !f__formatted )
v4 = "unformatted";
if ( !f__sequential )
v5 = "direct";
if ( !f__reading )
v6 = "writing";
fprintf(stderr, "lately %s %s %s %s", v6, v5, v4, v3);
return sig_die(" IO", 1LL);
}

original_code:
void
f__fatal(int n, const char *s)
{
 if(n<100 && n>=0) perror(s);
 else if(n >= (int)(sizeof(F_err)/sizeof(char *)+100) || n < -1)
 { fprintf(stderr,"%s: illegal error number %d\n",s,n);
 }
 else if(n == -1) fprintf(stderr,"%s: end of file\n",s);
 else
  fprintf(stderr,"%s: %s\n",s,F_err[n-100]);
 if (f__curunit) {
  fprintf(stderr,"apparent state: unit %d ",
   (int)(f__curunit-f__units));
  fprintf(stderr, f__curunit->ufnm ? "named %s\n" : "(unnamed)\n",
   f__curunit->ufnm);
  }
 else
  fprintf(stderr,"apparent state: internal I/O\n");
 if (f__fmtbuf)
  fprintf(stderr,"last format: %s\n",f__fmtbuf);
 fprintf(stderr,"lately %s %s %s %s",f__reading?"reading":"writing",
  f__sequential?"sequential":"direct",f__formatted?"formatted":"unformatted",
  f__external?"external":"internal");
 sig_die(" IO", 1);
}

canonical_original_code:
void f__fatal(int n, char *s)
{
 if(n<100 && n>=0) perror(s);
 else if(n >= (int)(sizeof(F_err)/sizeof(char *)+100) || n < -1)
 { fprintf(stderr,"%s: illegal error number %d\n",s,n);
 }
 else if(n == -1) fprintf(stderr,"%s: end of file\n",s);
 else
  fprintf(stderr,"%s: %s\n",s,F_err[n-100]);
 if (f__curunit) {
  fprintf(stderr,"apparent state: unit %d ",
   (int)(f__curunit-f__units));
  fprintf(stderr, f__curunit->ufnm ? "named %s\n" : "(unnamed)\n",
   f__curunit->ufnm);
  }
 else
  fprintf(stderr,"apparent state: internal I/O\n");
 if (f__fmtbuf)
  fprintf(stderr,"last format: %s\n",f__fmtbuf);
 fprintf(stderr,"lately %s %s %s %s",f__reading?"reading":"writing",
  f__sequential?"sequential":"direct",f__formatted?"formatted":"unformatted",
  f__external?"external":"internal");
 sig_die(" IO", 1);
}

variable_types: n int

variable_types:
s
char *


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


decompiled_code:
void __fastcall d_log(double *a1)
{
log(*a1);
}

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

original_code:
double d_log(doublereal *x)
{
return( log(*x) );
}

canonical_original_code:
double d_log(double *x)
{
return( log(*x) );
}

variable_types:
x
double *


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

canonical_original_code:
void z_sqrt(struct doublecomplex *r, struct doublecomplex *z)
{
 double mag; 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 = sqrt(0.5 * (mag + zr) );
  r->i = zi / r->r / 2;
  }
 else
  {
  r->i = sqrt(0.5 * (mag - zr) );
  if(zi < 0)
   r->i = - r->i;
  r->r = zi / r->i / 2;
  }
 }

variable_types:
r
struct doublecomplex { double r; } *

variable_types:
z
struct doublecomplex *

variable_types: mag double

variable_types: zi double

variable_types: zr double


decompiled_code:
void __fastcall c_sin(float *a1, float *a2)
{
float v2; // xmm0_4
float v3; // xmm0_4
double v4; // [rsp+10h] [rbp-48h]
double v5; // [rsp+28h] [rbp-30h]
double v6; // [rsp+40h] [rbp-18h]
double x; // [rsp+48h] [rbp-10h]

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

canonical_decompiled_code:
void __fastcall func0(float *a1, float *a2)
{
float v2; // xmm0_4
float v3; // xmm0_4
double v4; // [rsp+10h] [rbp-48h]
double v5; // [rsp+28h] [rbp-30h]
double v6; // [rsp+40h] [rbp-18h]
double x; // [rsp+48h] [rbp-10h]

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

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

canonical_original_code:
void c_sin(struct complex *r, struct complex *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 complex { float r; } *

variable_types:
z
struct complex *


decompiled_code:
double __fastcall r_abs(float *a1)
{
double result; // xmm0_8

if ( *a1 >= 0.0 )
result = *a1;
else
result = COERCE_FLOAT(*(_DWORD *)a1 ^ LC1);
return result;
}

canonical_decompiled_code:
double __fastcall func0(float *a1)
{
double result; // xmm0_8

if ( *a1 >= 0.0 )
result = *a1;
else
result = COERCE_FLOAT(*(_DWORD *)a1 ^ LC1);
return result;
}

original_code:
double r_abs(real *x)
{
if(*x >= 0)
 return(*x);
return(- *x);
}

canonical_original_code:
double r_abs(float *x)
{
if(*x >= 0)
 return(*x);
return(- *x);
}


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

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


decompiled_code:
__sighandler_t __fastcall signal_(_QWORD *a1, void (*a2)(int))
{
return signal(*a1, a2);
}

canonical_decompiled_code:
__sighandler_t __fastcall func0(_QWORD *a1, void (*a2)(int))
{
return signal(*a1, a2);
}

original_code:
ftnint
signal_(integer *sigp, sig_pf proc)
{
 int sig;
 sig = (int)*sigp;
 return (ftnint)signal(sig, proc);
 }

canonical_original_code:
long signal_(long *sigp, void (*proc)(int))
{
 int sig;
 sig = (int)*sigp;
 return (long)signal(sig, proc);
 }

variable_types:
sigp
long *

variable_types:
proc
void (*)(int)

variable_types: sig int

return_type: long


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

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

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

canonical_original_code:
long l_gt(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:
__int64 y_rsk()
{
int v0; // eax

if ( !*(_QWORD *)(f__curunit + 64LL) )
{
v0 = *(_DWORD *)(f__curunit + 28LL);
if ( v0 > f__recpos && v0 != 1 )
{
do
{
getc((FILE *)f);
++f__recpos;
}
while ( f__recpos < *(_DWORD *)(f__curunit + 28LL) );
}
}
return 0LL;
}

canonical_decompiled_code:
__int64 func0()
{
int v0; // eax

if ( !*(_QWORD *)(f__curunit + 64LL) )
{
v0 = *(_DWORD *)(f__curunit + 28LL);
if ( v0 > f__recpos && v0 != 1 )
{
do
{
getc((FILE *)f);
++f__recpos;
}
while ( f__recpos < *(_DWORD *)(f__curunit + 28LL) );
}
}
return 0LL;
}

original_code:
int
y_rsk(void)
{
 if(f__curunit->uend || f__curunit->url <= f__recpos
  || f__curunit->url == 1) return 0;
 do {
  getc(f__cf);
 } while(++f__recpos < f__curunit->url);
 return 0;
}

canonical_original_code:
int y_rsk()
{
 if(f__curunit->uend || f__curunit->url <= f__recpos
  || f__curunit->url == 1) return 0;
 do {
  getc(f__cf);
 } while(++f__recpos < f__curunit->url);
 return 0;
}

return_type: int


decompiled_code:
__int64 y_getc()
{
unsigned int v0; // er12
int v1; // edx
int v3; // er13
int *v4; // rbp

if ( *(_QWORD *)(f__curunit + 64LL) )
return (unsigned int)-1;
v0 = getc((FILE *)f);
if ( v0 != -1 )
{
++f__recpos;
v1 = *(_DWORD *)(f__curunit + 28LL);
if ( f__recpos > v1 && v1 != 1 )
v0 = 32;
return v0;
}
v3 = feof((FILE *)f);
v4 = _errno_location();
if ( v3 )
{
*(_QWORD *)(f__curunit + 64LL) = 1LL;
*v4 = 0;
return v0;
}
if ( !*f__elist )
f__fatal((unsigned int)*v4, "readingd");
return (unsigned int)*v4;
}

canonical_decompiled_code:
__int64 func1()
{
unsigned int v0; // er12
int v1; // edx
int v3; // er13
int *v4; // rbp

if ( *(_QWORD *)(f__curunit + 64LL) )
return (unsigned int)-1;
v0 = getc((FILE *)f);
if ( v0 != -1 )
{
++f__recpos;
v1 = *(_DWORD *)(f__curunit + 28LL);
if ( f__recpos > v1 && v1 != 1 )
v0 = 32;
return v0;
}
v3 = feof((FILE *)f);
v4 = _errno_location();
if ( v3 )
{
*(_QWORD *)(f__curunit + 64LL) = 1LL;
*v4 = 0;
return v0;
}
if ( !*f__elist )
f__fatal((unsigned int)*v4, "readingd");
return (unsigned int)*v4;
}

original_code:
int
y_getc(void)
{
 int ch;
 if(f__curunit->uend) return(-1);
 if((ch=getc(f__cf))!=(-1))
 {
  f__recpos++;
  if(f__curunit->url>=f__recpos ||
   f__curunit->url==1)
   return(ch);
  else return(' ');
 }
 if(feof(f__cf))
 {
  f__curunit->uend=1;
  (*__errno_location ())=0;
  return(-1);
 }
 {if(f__elist->cierr) (*__errno_location ())= (*__errno_location ()); else f__fatal((*__errno_location ()),"readingd"); return((*__errno_location ()));};
}

canonical_original_code:
int y_getc()
{
 int ch;
 if(f__curunit->uend) return(-1);
 if((ch=getc(f__cf))!=(-1))
 {
  f__recpos++;
  if(f__curunit->url>=f__recpos ||
   f__curunit->url==1)
   return(ch);
  else return(' ');
 }
 if(feof(f__cf))
 {
  f__curunit->uend=1;
  (*__errno_location ())=0;
  return(-1);
 }
 {if(f__elist->cierr) (*__errno_location ())= (*__errno_location ()); else f__fatal((*__errno_location ()),"readingd"); return((*__errno_location ()));};
}

variable_types: ch int


decompiled_code:
__int64 __fastcall c_dfe(_QWORD *a1)
{
unsigned __int64 v2; // rdx
char *v3; // rax
FILE *v4; // rdi
bool v5; // zf
__int64 v6; // rsi
__int64 result; // rax

v2 = a1[1];
f__sequential = 0LL;
f__external = 1LL;
f__formatted = 1LL;
f__elist = a1;
f__recpos = 0;
f__scale = 0;
f__cursor = 0LL;
v3 = (char *)&f__units + 88 * v2;
f__curunit = v3;
if ( v2 > 0x64 )
{
if ( *a1 )
*_errno_location() = 101;
else
f__fatal(101LL, "startchk");
result = 101LL;
}
else
{
if ( !*(_QWORD *)v3 )
{
if ( (unsigned int)fk_open(4LL, 5LL) )
{
LABEL_10:
if ( *a1 )
*_errno_location() = 104;
else
f__fatal(104LL, "dfe");
return 104LL;
}
v3 = (char *)f__curunit;
}
v4 = *(FILE **)v3;
v5 = *((_QWORD *)v3 + 5) == 0LL;
f = *(_QWORD (__fastcall **)(char, float))v3;
if ( !v5 )
{
if ( *((_QWORD *)v3 + 4) )
{
v6 = a1[4];
f__fmtbuf = a1[3];
if ( v6 <= 0 )
{
if ( *a1 )
*_errno_location() = 130;
else
f__fatal(130LL, "dfe");
result = 130LL;
}
else
{
fseeko64(v4, *((int *)v3 + 7) * (v6 - 1), 0);
*(_QWORD *)(f__curunit + 64LL) = 0LL;
result = 0LL;
}
return result;
}
goto LABEL_10;
}
if ( *a1 )
*_errno_location() = 102;
else
f__fatal(102LL, "dfe");
result = 102LL;
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func5(_QWORD *a1)
{
unsigned __int64 v2; // rdx
char *v3; // rax
FILE *v4; // rdi
bool v5; // zf
__int64 v6; // rsi
__int64 result; // rax

v2 = a1[1];
f__sequential = 0LL;
f__external = 1LL;
f__formatted = 1LL;
f__elist = a1;
f__recpos = 0;
f__scale = 0;
f__cursor = 0LL;
v3 = (char *)&f__units + 88 * v2;
f__curunit = v3;
if ( v2 > 0x64 )
{
if ( *a1 )
*_errno_location() = 101;
else
f__fatal(101LL, "startchk");
result = 101LL;
}
else
{
if ( !*(_QWORD *)v3 )
{
if ( (unsigned int)fk_open(4LL, 5LL) )
{
LABEL_10:
if ( *a1 )
*_errno_location() = 104;
else
f__fatal(104LL, "dfe");
return 104LL;
}
v3 = (char *)f__curunit;
}
v4 = *(FILE **)v3;
v5 = *((_QWORD *)v3 + 5) == 0LL;
f = *(_QWORD (__fastcall **)(char, float))v3;
if ( !v5 )
{
if ( *((_QWORD *)v3 + 4) )
{
v6 = a1[4];
f__fmtbuf = a1[3];
if ( v6 <= 0 )
{
if ( *a1 )
*_errno_location() = 130;
else
f__fatal(130LL, "dfe");
result = 130LL;
}
else
{
fseeko64(v4, *((int *)v3 + 7) * (v6 - 1), 0);
*(_QWORD *)(f__curunit + 64LL) = 0LL;
result = 0LL;
}
return result;
}
goto LABEL_10;
}
if ( *a1 )
*_errno_location() = 102;
else
f__fatal(102LL, "dfe");
result = 102LL;
}
return result;
}

original_code:
int
c_dfe(cilist *a)
{
 f__sequential=0;
 f__formatted=f__external=1;
 f__elist=a;
 f__cursor=f__scale=f__recpos=0;
 f__curunit = &f__units[a->ciunit];
 if(a->ciunit>100 || a->ciunit<0)
  {if(a->cierr) (*__errno_location ())= 101; else f__fatal(101,"startchk"); return(101);};
 if(f__curunit->ufd==((void *)0) && fk_open(4,5,a->ciunit))
  {if(a->cierr) (*__errno_location ())= 104; else f__fatal(104,"dfe"); return(104);};
 f__cf=f__curunit->ufd;
 if(!f__curunit->ufmt) {if(a->cierr) (*__errno_location ())= 102; else f__fatal(102,"dfe"); return(102);}
 if(!f__curunit->useek) {if(a->cierr) (*__errno_location ())= 104; else f__fatal(104,"dfe"); return(104);}
 f__fmtbuf=a->cifmt;
 if(a->cirec <= 0)
  {if(a->cierr) (*__errno_location ())= 130; else f__fatal(130,"dfe"); return(130);}
 fseeko64(f__cf,(__off64_t)f__curunit->url * (a->cirec-1),0);
 f__curunit->uend = 0;
 return(0);
}

canonical_original_code:
int c_dfe(struct cilist *a)
{
 f__sequential=0;
 f__formatted=f__external=1;
 f__elist=a;
 f__cursor=f__scale=f__recpos=0;
 f__curunit = &f__units[a->ciunit];
 if(a->ciunit>100 || a->ciunit<0)
  {if(a->cierr) (*__errno_location ())= 101; else f__fatal(101,"startchk"); return(101);};
 if(f__curunit->ufd==((void *)0) && fk_open(4,5,a->ciunit))
  {if(a->cierr) (*__errno_location ())= 104; else f__fatal(104,"dfe"); return(104);};
 f__cf=f__curunit->ufd;
 if(!f__curunit->ufmt) {if(a->cierr) (*__errno_location ())= 102; else f__fatal(102,"dfe"); return(102);}
 if(!f__curunit->useek) {if(a->cierr) (*__errno_location ())= 104; else f__fatal(104,"dfe"); return(104);}
 f__fmtbuf=a->cifmt;
 if(a->cirec <= 0)
  {if(a->cierr) (*__errno_location ())= 130; else f__fatal(130,"dfe"); return(130);}
 fseeko64(f__cf,(long)f__curunit->url * (a->cirec-1),0);
 f__curunit->uend = 0;
 return(0);
}

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


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

if ( !f__init )
f_init();
f__reading = 1LL;
LODWORD(result) = c_dfe(a1);
if ( (_DWORD)result )
return (int)result;
if ( *(_QWORD *)(f__curunit + 72LL) && (unsigned int)f__nowreading() )
{
v2 = _errno_location();
v3 = v2;
if ( !*a1 )
f__fatal((unsigned int)*v2, "read start");
result = *v3;
}
else
{
f__getn = y_getc;
f__doed = &rd_ed;
f__doned = &rd_ned;
f__donewrec = sub_140;
f__dorevert = sub_140;
f__doend = y_rsk;
if ( (int)pars_f(f__fmtbuf) < 0 )
{
if ( *a1 )
*_errno_location() = 100;
else
f__fatal(100LL, "read start");
result = 100LL;
}
else
{
fmt_bg();
result = 0LL;
}
}
return result;
}

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

if ( !f__init )
f_init();
f__reading = 1LL;
LODWORD(result) = func5(a1);
if ( (_DWORD)result )
return (int)result;
if ( *(_QWORD *)(f__curunit + 72LL) && (unsigned int)f__nowreading() )
{
v2 = _errno_location();
v3 = v2;
if ( !*a1 )
f__fatal((unsigned int)*v2, "read start");
result = *v3;
}
else
{
f__getn = y_getc;
f__doed = &rd_ed;
f__doned = &rd_ned;
f__donewrec = sub_140;
f__dorevert = sub_140;
f__doend = y_rsk;
if ( (int)pars_f(f__fmtbuf) < 0 )
{
if ( *a1 )
*_errno_location() = 100;
else
f__fatal(100LL, "read start");
result = 100LL;
}
else
{
fmt_bg();
result = 0LL;
}
}
return result;
}

original_code:
integer s_rdfe(cilist *a)
{
 int n;
 if(!f__init) f_init();
 f__reading=1;
 if(n=c_dfe(a))return(n);
 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 ()));};
 f__getn = y_getc;
 f__doed = rd_ed;
 f__doned = rd_ned;
 f__dorevert = f__donewrec = y_err;
 f__doend = y_rsk;
 if(pars_f(f__fmtbuf)<0)
  {if(a->cierr) (*__errno_location ())= 100; else f__fatal(100,"read start"); return(100);};
 fmt_bg();
 return(0);
}

canonical_original_code:
long s_rdfe(struct cilist *a)
{
 int n;
 if(!f__init) f_init();
 f__reading=1;
 if(n=c_dfe(a))return(n);
 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 ()));};
 f__getn = y_getc;
 f__doed = rd_ed;
 f__doned = rd_ned;
 f__dorevert = f__donewrec = y_err;
 f__doend = y_rsk;
 if(pars_f(f__fmtbuf)<0)
  {if(a->cierr) (*__errno_location ())= 100; else f__fatal(100,"read start"); return(100);};
 fmt_bg();
 return(0);
}

variable_types: n int

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


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

if ( !f__init )
f_init();
f__reading = 0LL;
LODWORD(result) = c_dfe(a1);
if ( (_DWORD)result )
return (int)result;
if ( *(_QWORD *)(f__curunit + 72LL) != 1LL && (unsigned int)f__nowwriting() )
{
v2 = _errno_location();
v3 = v2;
if ( !*a1 )
f__fatal((unsigned int)*v2, "startwrt");
result = *v3;
}
else
{
f__putn = (__int64 (__fastcall *)(_QWORD))&x_putc;
f__doed = &w_ed;
f__doned = &w_ned;
f__dorevert = sub_140;
f__donewrec = sub_220;
f__doend = sub_190;
if ( (int)pars_f(f__fmtbuf) < 0 )
{
if ( *a1 )
*_errno_location() = 100;
else
f__fatal(100LL, "startwrt");
result = 100LL;
}
else
{
fmt_bg();
result = 0LL;
}
}
return result;
}

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

if ( !f__init )
f_init();
f__reading = 0LL;
LODWORD(result) = func5(a1);
if ( (_DWORD)result )
return (int)result;
if ( *(_QWORD *)(f__curunit + 72LL) != 1LL && (unsigned int)f__nowwriting() )
{
v2 = _errno_location();
v3 = v2;
if ( !*a1 )
f__fatal((unsigned int)*v2, "startwrt");
result = *v3;
}
else
{
f__putn = (__int64 (__fastcall *)(_QWORD))&x_putc;
f__doed = &w_ed;
f__doned = &w_ned;
f__dorevert = sub_140;
f__donewrec = sub_220;
f__doend = sub_190;
if ( (int)pars_f(f__fmtbuf) < 0 )
{
if ( *a1 )
*_errno_location() = 100;
else
f__fatal(100LL, "startwrt");
result = 100LL;
}
else
{
fmt_bg();
result = 0LL;
}
}
return result;
}

original_code:
integer s_wdfe(cilist *a)
{
 int n;
 if(!f__init) f_init();
 f__reading=0;
 if(n=c_dfe(a)) return(n);
 if(f__curunit->uwrt != 1 && f__nowwriting(f__curunit))
  {if(a->cierr) (*__errno_location ())= (*__errno_location ()); else f__fatal((*__errno_location ()),"startwrt"); return((*__errno_location ()));};
 f__putn = x_putc;
 f__doed = w_ed;
 f__doned= w_ned;
 f__dorevert = y_err;
 f__donewrec = y_newrec;
 f__doend = y_rev;
 if(pars_f(f__fmtbuf)<0)
  {if(a->cierr) (*__errno_location ())= 100; else f__fatal(100,"startwrt"); return(100);};
 fmt_bg();
 return(0);
}

canonical_original_code:
long s_wdfe(struct cilist *a)
{
 int n;
 if(!f__init) f_init();
 f__reading=0;
 if(n=c_dfe(a)) return(n);
 if(f__curunit->uwrt != 1 && f__nowwriting(f__curunit))
  {if(a->cierr) (*__errno_location ())= (*__errno_location ()); else f__fatal((*__errno_location ()),"startwrt"); return((*__errno_location ()));};
 f__putn = x_putc;
 f__doed = w_ed;
 f__doned= w_ned;
 f__dorevert = y_err;
 f__donewrec = y_newrec;
 f__doend = y_rev;
 if(pars_f(f__fmtbuf)<0)
  {if(a->cierr) (*__errno_location ())= 100; else f__fatal(100,"startwrt"); return(100);};
 fmt_bg();
 return(0);
}


decompiled_code:
__int64 e_rdfe()
{
en_fio();
return 0LL;
}

canonical_decompiled_code:
__int64 func8()
{
en_fio();
return 0LL;
}

original_code:
integer e_rdfe(void)
{
 en_fio();
 return 0;
}

canonical_original_code:
long e_rdfe()
{
 en_fio();
 return 0;
}


decompiled_code:
__int64 e_wdfe()
{
return (int)en_fio();
}

canonical_decompiled_code:
__int64 func9()
{
return (int)en_fio();
}

original_code:
integer e_wdfe(void)
{
 return en_fio();
}

canonical_original_code:
long e_wdfe()
{
 return en_fio();
}


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

canonical_original_code:
short h_nint(float *x)
{
return (shortint)(*x >= 0 ? floor(*x + .5) : -floor(.5 - *x));
}

variable_types:
x
float *

return_type: short


decompiled_code:
void __fastcall d_acos(double *a1)
{
acos(*a1);
}

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

original_code:
double d_acos(doublereal *x)
{
return( acos(*x) );
}

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

variable_types:
x
double *


decompiled_code:
__int64 __fastcall c_due(_QWORD *a1)
{
unsigned __int64 v2; // rdx
char *v3; // rax
FILE *v4; // rdi
bool v5; // zf
__int64 v6; // rsi
__int64 result; // rax

if ( !f__init )
f_init();
v2 = a1[1];
f__recpos = 0;
f__formatted = 0LL;
f__sequential = 0LL;
f__external = 1LL;
v3 = (char *)&f__units + 88 * v2;
f__curunit = v3;
if ( v2 > 0x63 )
{
if ( *a1 )
*_errno_location() = 101;
else
f__fatal(101LL, "startio");
result = 101LL;
}
else
{
f__elist = a1;
if ( !*(_QWORD *)v3 )
{
if ( (unsigned int)fk_open(4LL, 6LL) )
{
if ( !*a1 )
{
f__fatal(104LL, "due");
return 104LL;
}
goto LABEL_14;
}
v3 = (char *)f__curunit;
}
v4 = *(FILE **)v3;
v5 = *((_QWORD *)v3 + 5) == 0LL;
f = *(_QWORD (__fastcall **)(char, float))v3;
if ( v5 )
{
if ( *((_QWORD *)v3 + 4) )
{
if ( v4 )
{
v6 = a1[4];
if ( v6 <= 0 )
{
if ( *a1 )
*_errno_location() = 130;
else
f__fatal(130LL, "due");
result = 130LL;
}
else
{
fseeko64(v4, *((int *)v3 + 7) * (v6 - 1), 0);
*(_QWORD *)(f__curunit + 64LL) = 0LL;
result = 0LL;
}
}
else
{
if ( *a1 )
*_errno_location() = 114;
else
f__fatal(114LL, "cdue");
result = 114LL;
}
return result;
}
if ( !*a1 )
{
f__fatal(104LL, "cdue");
return 104LL;
}
LABEL_14:
*_errno_location() = 104;
return 104LL;
}
if ( *a1 )
*_errno_location() = 102;
else
f__fatal(102LL, "cdue");
result = 102LL;
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func0(_QWORD *a1)
{
unsigned __int64 v2; // rdx
char *v3; // rax
FILE *v4; // rdi
bool v5; // zf
__int64 v6; // rsi
__int64 result; // rax

if ( !f__init )
f_init();
v2 = a1[1];
f__recpos = 0;
f__formatted = 0LL;
f__sequential = 0LL;
f__external = 1LL;
v3 = (char *)&f__units + 88 * v2;
f__curunit = v3;
if ( v2 > 0x63 )
{
if ( *a1 )
*_errno_location() = 101;
else
f__fatal(101LL, "startio");
result = 101LL;
}
else
{
f__elist = a1;
if ( !*(_QWORD *)v3 )
{
if ( (unsigned int)fk_open(4LL, 6LL) )
{
if ( !*a1 )
{
f__fatal(104LL, "due");
return 104LL;
}
goto LABEL_14;
}
v3 = (char *)f__curunit;
}
v4 = *(FILE **)v3;
v5 = *((_QWORD *)v3 + 5) == 0LL;
f = *(_QWORD (__fastcall **)(char, float))v3;
if ( v5 )
{
if ( *((_QWORD *)v3 + 4) )
{
if ( v4 )
{
v6 = a1[4];
if ( v6 <= 0 )
{
if ( *a1 )
*_errno_location() = 130;
else
f__fatal(130LL, "due");
result = 130LL;
}
else
{
fseeko64(v4, *((int *)v3 + 7) * (v6 - 1), 0);
*(_QWORD *)(f__curunit + 64LL) = 0LL;
result = 0LL;
}
}
else
{
if ( *a1 )
*_errno_location() = 114;
else
f__fatal(114LL, "cdue");
result = 114LL;
}
return result;
}
if ( !*a1 )
{
f__fatal(104LL, "cdue");
return 104LL;
}
LABEL_14:
*_errno_location() = 104;
return 104LL;
}
if ( *a1 )
*_errno_location() = 102;
else
f__fatal(102LL, "cdue");
result = 102LL;
}
return result;
}

original_code:
int
c_due(cilist *a)
{
 if(!f__init) f_init();
 f__sequential=f__formatted=f__recpos=0;
 f__external=1;
 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(4,6,a->ciunit) ) {if(a->cierr) (*__errno_location ())= 104; else f__fatal(104,"due"); return(104);};
 f__cf=f__curunit->ufd;
 if(f__curunit->ufmt) {if(a->cierr) (*__errno_location ())= 102; else f__fatal(102,"cdue"); return(102);}
 if(!f__curunit->useek) {if(a->cierr) (*__errno_location ())= 104; else f__fatal(104,"cdue"); return(104);}
 if(f__curunit->ufd==((void *)0)) {if(a->cierr) (*__errno_location ())= 114; else f__fatal(114,"cdue"); return(114);}
 if(a->cirec <= 0)
  {if(a->cierr) (*__errno_location ())= 130; else f__fatal(130,"due"); return(130);}
 fseeko64(f__cf,(__off64_t)(a->cirec-1)*f__curunit->url,0);
 f__curunit->uend = 0;
 return(0);
}

canonical_original_code:
int c_due(struct cilist *a)
{
 if(!f__init) f_init();
 f__sequential=f__formatted=f__recpos=0;
 f__external=1;
 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(4,6,a->ciunit) ) {if(a->cierr) (*__errno_location ())= 104; else f__fatal(104,"due"); return(104);};
 f__cf=f__curunit->ufd;
 if(f__curunit->ufmt) {if(a->cierr) (*__errno_location ())= 102; else f__fatal(102,"cdue"); return(102);}
 if(!f__curunit->useek) {if(a->cierr) (*__errno_location ())= 104; else f__fatal(104,"cdue"); return(104);}
 if(f__curunit->ufd==((void *)0)) {if(a->cierr) (*__errno_location ())= 114; else f__fatal(114,"cdue"); return(114);}
 if(a->cirec <= 0)
  {if(a->cierr) (*__errno_location ())= 130; else f__fatal(130,"due"); return(130);}
 fseeko64(f__cf,(__off64_t)(a->cirec-1)*f__curunit->url,0);
 f__curunit->uend = 0;
 return(0);
}


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

f__reading = 1LL;
LODWORD(result) = c_due(a1);
if ( (_DWORD)result )
return (int)result;
if ( !*(_QWORD *)(f__curunit + 72LL) || !(unsigned int)f__nowreading() )
return 0LL;
v2 = _errno_location();
v3 = v2;
if ( !*a1 )
f__fatal((unsigned int)*v2, "read start");
return *v3;
}

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

f__reading = 1LL;
LODWORD(result) = func0(a1);
if ( (_DWORD)result )
return (int)result;
if ( !*(_QWORD *)(f__curunit + 72LL) || !(unsigned int)f__nowreading() )
return 0LL;
v2 = _errno_location();
v3 = v2;
if ( !*a1 )
f__fatal((unsigned int)*v2, "read start");
return *v3;
}

original_code:
integer s_rdue(cilist *a)
{
 int n;
 f__reading=1;
 if(n=c_due(a)) return(n);
 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 ()));};
 return(0);
}

canonical_original_code:
long s_rdue(struct cilist *a)
{
 int n;
 f__reading=1;
 if(n=c_due(a)) return(n);
 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 ()));};
 return(0);
}


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

f__reading = 0LL;
LODWORD(result) = c_due(a1);
if ( (_DWORD)result )
return (int)result;
if ( *(_QWORD *)(f__curunit + 72LL) == 1LL || !(unsigned int)f__nowwriting() )
return 0LL;
v2 = _errno_location();
v3 = v2;
if ( !*a1 )
f__fatal((unsigned int)*v2, "write start");
return *v3;
}

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

f__reading = 0LL;
LODWORD(result) = func0(a1);
if ( (_DWORD)result )
return (int)result;
if ( *(_QWORD *)(f__curunit + 72LL) == 1LL || !(unsigned int)f__nowwriting() )
return 0LL;
v2 = _errno_location();
v3 = v2;
if ( !*a1 )
f__fatal((unsigned int)*v2, "write start");
return *v3;
}

original_code:
integer s_wdue(cilist *a)
{
 int n;
 f__reading=0;
 if(n=c_due(a)) return(n);
 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 ()));};
 return(0);
}

canonical_original_code:
long s_wdue(struct cilist *a)
{
 int n;
 f__reading=0;
 if(n=c_due(a)) return(n);
 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 ()));};
 return(0);
}


decompiled_code:
__int64 e_rdue()
{
int v0; // esi

v0 = *(_DWORD *)(f__curunit + 28LL);
if ( v0 == 1 )
return 0LL;
if ( v0 == f__recpos )
return 0LL;
fseeko64((FILE *)f, v0 - f__recpos, 1);
if ( !(ftello64((FILE *)f) % *(int *)(f__curunit + 28LL)) )
return 0LL;
if ( *f__elist )
*_errno_location() = 200;
else
f__fatal(200LL, "syserr");
return 200LL;
}

canonical_decompiled_code:
__int64 func3()
{
int v0; // esi

v0 = *(_DWORD *)(f__curunit + 28LL);
if ( v0 == 1 )
return 0LL;
if ( v0 == f__recpos )
return 0LL;
fseeko64((FILE *)f, v0 - f__recpos, 1);
if ( !(ftello64((FILE *)f) % *(int *)(f__curunit + 28LL)) )
return 0LL;
if ( *f__elist )
*_errno_location() = 200;
else
f__fatal(200LL, "syserr");
return 200LL;
}

original_code:
integer e_rdue(void)
{
 if(f__curunit->url==1 || f__recpos==f__curunit->url)
  return(0);
 fseeko64(f__cf,(__off64_t)(f__curunit->url-f__recpos),1);
 if(ftello64(f__cf)%f__curunit->url)
  {if(f__elist->cierr) (*__errno_location ())= 200; else f__fatal(200,"syserr"); return(200);};
 return(0);
}

canonical_original_code:
long e_rdue()
{
 if(f__curunit->url==1 || f__recpos==f__curunit->url)
  return(0);
 fseeko64(f__cf,(__off64_t)(f__curunit->url-f__recpos),1);
 if(ftello64(f__cf)%f__curunit->url)
  {if(f__elist->cierr) (*__errno_location ())= 200; else f__fatal(200,"syserr"); return(200);};
 return(0);
}


decompiled_code:
// attributes: thunk
__int64 e_wdue()
{
return e_rdue();
}

canonical_decompiled_code:
__int64 func4()
{
return func3();
}

original_code:
integer e_wdue(void)
{
 return(e_rdue());
}

canonical_original_code:
long e_wdue()
{
 return(e_rdue());
}


original_code:
integer i_indx(char *a, char *b, ftnlen la, ftnlen lb)
{
ftnlen i, n;
char *s, *t, *bend;
n = la - lb + 1;
bend = b + lb;
for(i = 0 ; i < n ; ++i)
 {
 s = a + i;
 t = b;
 while(t < bend)
  if(*s++ != *t++)
   goto no;
 return(i+1);
 no: ;
 }
return(0);
}

canonical_original_code:
long i_indx(char *a, char *b, long la, long lb)
{
long i; long n;
char *s; char *t; char *bend;
n = la - lb + 1;
bend = b + lb;
for(i = 0 ; i < n ; ++i)
 {
 s = a + i;
 t = b;
 while(t < bend)
  if(*s++ != *t++)
   goto no;
 return(i+1);
 no: ;
 }
return(0);
}

variable_types: i long

variable_types: n long

variable_types:
s
char *

variable_types:
t
char *

variable_types:
bend
char *


decompiled_code:
__int64 __fastcall i_len(__int64 a1, __int64 a2)
{
return a2;
}

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

original_code:
integer i_len(char *s, ftnlen n)
{
return(n);
}

canonical_original_code:
long i_len(char *s, long n)
{
return(n);
}


decompiled_code:
__int64 z_rnew()
{
++f__icnum;
f__icptr = *(_QWORD *)(f + 8LL) + *(_QWORD *)(f + 32LL) * f__icnum;
f__recpos = 0;
f__cursor = 0LL;
f__hiwater = 0LL;
return 1LL;
}

canonical_decompiled_code:
__int64 func0()
{
++f__icnum;
f__icptr = *(_QWORD *)(f + 8LL) + *(_QWORD *)(f + 32LL) * f__icnum;
f__recpos = 0;
f__cursor = 0LL;
f__hiwater = 0LL;
return 1LL;
}

original_code:
int
z_rnew(void)
{
 f__icptr = f__svic->iciunit + (++f__icnum)*f__svic->icirlen;
 f__recpos = 0;
 f__cursor = 0;
 f__hiwater = 0;
 return 1;
}

canonical_original_code:
int z_rnew()
{
 f__icptr = f__svic->iciunit + (++f__icnum)*f__svic->icirlen;
 f__recpos = 0;
 f__cursor = 0;
 f__hiwater = 0;
 return 1;
}


decompiled_code:
__int64 iw_rev()
{
if ( f__workdone )
sub_B0();
f__workdone = 0LL;
f__cursor = 0LL;
f__recpos = 0;
f__hiwater = 0LL;
return 0LL;
}

canonical_decompiled_code:
__int64 func2()
{
if ( f__workdone )
func1();
f__workdone = 0LL;
f__cursor = 0LL;
f__recpos = 0;
f__hiwater = 0LL;
return 0LL;
}

original_code:
int
iw_rev(void)
{
 if(f__workdone)
  z_endp();
 f__hiwater = f__recpos = f__cursor = 0;
 return(f__workdone=0);
 }

canonical_original_code:
int iw_rev()
{
 if(f__workdone)
  z_endp();
 f__hiwater = f__recpos = f__cursor = 0;
 return(f__workdone=0);
 }


decompiled_code:
__int64 z_wnew()
{
__int64 v0; // rsi
int v1; // eax
_BYTE *v2; // rax
__int64 v3; // rax

v0 = f__recpos;
v1 = f__recpos;
if ( f__recpos < f__hiwater )
{
v0 = (int)f__hiwater;
f__icptr += f__hiwater - f__recpos;
v1 = f__hiwater;
}
f__recpos = v1 + 1;
if ( *(_QWORD *)(f + 32LL) > v0 )
{
do
{
v2 = (_BYTE *)f__icptr++;
*v2 = 32;
v3 = f__recpos++;
}
while ( v3 < *(_QWORD *)(f + 32LL) );
}
f__recpos = 0;
f__hiwater = 0LL;
f__cursor = 0LL;
++f__icnum;
return 1LL;
}

canonical_decompiled_code:
__int64 func3()
{
__int64 v0; // rsi
int v1; // eax
_BYTE *v2; // rax
__int64 v3; // rax

v0 = f__recpos;
v1 = f__recpos;
if ( f__recpos < f__hiwater )
{
v0 = (int)f__hiwater;
f__icptr += f__hiwater - f__recpos;
v1 = f__hiwater;
}
f__recpos = v1 + 1;
if ( *(_QWORD *)(f + 32LL) > v0 )
{
do
{
v2 = (_BYTE *)f__icptr++;
*v2 = 32;
v3 = f__recpos++;
}
while ( v3 < *(_QWORD *)(f + 32LL) );
}
f__recpos = 0;
f__hiwater = 0LL;
f__cursor = 0LL;
++f__icnum;
return 1LL;
}

original_code:
int
z_wnew(void)
{
 if (f__recpos < f__hiwater) {
  f__icptr += f__hiwater - f__recpos;
  f__recpos = f__hiwater;
  }
 while(f__recpos++ < f__svic->icirlen)
  *f__icptr++ = ' ';
 f__recpos = 0;
 f__cursor = 0;
 f__hiwater = 0;
 f__icnum++;
 return 1;
}

canonical_original_code:
int z_wnew()
{
 if (f__recpos < f__hiwater) {
  f__icptr += f__hiwater - f__recpos;
  f__recpos = f__hiwater;
  }
 while(f__recpos++ < f__svic->icirlen)
  *f__icptr++ = ' ';
 f__recpos = 0;
 f__cursor = 0;
 f__hiwater = 0;
 f__icnum++;
 return 1;
}


decompiled_code:
__int64 z_getc()
{
unsigned int v0; // er8
__int64 v1; // rax
unsigned __int8 *v2; // rax

v0 = 10;
v1 = f__recpos++;
if ( v1 >= *(_QWORD *)(f + 32LL) )
return v0;
v2 = (unsigned __int8 *)f__icptr;
if ( f__icptr < f__icend )
{
++f__icptr;
return *v2;
}
if ( *(_QWORD *)(f + 16LL) )
*_errno_location() = -1;
else
f__fatal(0xFFFFFFFFLL, "endfile", f, &f__icptr, 10LL);
return 0xFFFFFFFFLL;
}

canonical_decompiled_code:
__int64 func4()
{
unsigned int v0; // er8
__int64 v1; // rax
unsigned __int8 *v2; // rax

v0 = 10;
v1 = f__recpos++;
if ( v1 >= *(_QWORD *)(f + 32LL) )
return v0;
v2 = (unsigned __int8 *)f__icptr;
if ( f__icptr < f__icend )
{
++f__icptr;
return *v2;
}
if ( *(_QWORD *)(f + 16LL) )
*_errno_location() = -1;
else
f__fatal(0xFFFFFFFFLL, "endfile", f, &f__icptr, 10LL);
return 0xFFFFFFFFLL;
}

original_code:
int
z_getc(void)
{
 if(f__recpos++ < f__svic->icirlen) {
  if(f__icptr >= f__icend) {if(f__svic->iciend) (*__errno_location ())= ((-1)); else f__fatal(((-1)),"endfile"); return(((-1)));};
  return(*(unsigned char *)f__icptr++);
  }
 return '\n';
}

canonical_original_code:
int z_getc()
{
 if(f__recpos++ < f__svic->icirlen) {
  if(f__icptr >= f__icend) {if(f__svic->iciend) (*__errno_location ())= ((-1)); else f__fatal(((-1)),"endfile"); return(((-1)));};
  return(*(unsigned char *)f__icptr++);
  }
 return '\n';
}


decompiled_code:
__int64 __fastcall c_si(_QWORD *a1)
{
__int64 v1; // rdx
__int64 v2; // rcx
__int64 v3; // r8
__int64 result; // rax

f__elist = a1;
f__fmtbuf = a1[3];
f__curunit = 0LL;
f__formatted = 1LL;
f__sequential = 1LL;
f__external = 0LL;
if ( (int)pars_f() < 0 )
{
if ( *a1 )
*_errno_location() = 100;
else
f__fatal(100LL, "startint", v1, v2, v3);
result = 100LL;
}
else
{
fmt_bg();
f__scale = 0;
f__cplus = 0LL;
f__cblank = 0LL;
f = a1;
f__recpos = 0;
f__icnum = 0;
f__cursor = 0LL;
f__hiwater = 0LL;
f__icptr = a1[1];
f__icend = a1[5] * a1[4] + f__icptr;
f = 0LL;
result = 0LL;
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func5(_QWORD *a1)
{
__int64 v1; // rdx
__int64 v2; // rcx
__int64 v3; // r8
__int64 result; // rax

f__elist = a1;
f__fmtbuf = a1[3];
f__curunit = 0LL;
f__formatted = 1LL;
f__sequential = 1LL;
f__external = 0LL;
if ( (int)pars_f() < 0 )
{
if ( *a1 )
*_errno_location() = 100;
else
f__fatal(100LL, "startint", v1, v2, v3);
result = 100LL;
}
else
{
fmt_bg();
f__scale = 0;
f__cplus = 0LL;
f__cblank = 0LL;
f = a1;
f__recpos = 0;
f__icnum = 0;
f__cursor = 0LL;
f__hiwater = 0LL;
f__icptr = a1[1];
f__icend = a1[5] * a1[4] + f__icptr;
f = 0LL;
result = 0LL;
}
return result;
}

original_code:
int
c_si(icilist *a)
{
 f__elist = (cilist *)a;
 f__fmtbuf=a->icifmt;
 f__curunit = 0;
 f__sequential=f__formatted=1;
 f__external=0;
 if(pars_f(f__fmtbuf)<0)
  {if(a->icierr) (*__errno_location ())= 100; else f__fatal(100,"startint"); return(100);};
 fmt_bg();
 f__cblank=f__cplus=f__scale=0;
 f__svic=a;
 f__icnum=f__recpos=0;
 f__cursor = 0;
 f__hiwater = 0;
 f__icptr = a->iciunit;
 f__icend = f__icptr + a->icirlen*a->icirnum;
 f__cf = 0;
 return(0);
}

canonical_original_code:
int c_si(struct icilist *a)
{
 f__elist = (struct cilist *)a;
 f__fmtbuf=a->icifmt;
 f__curunit = 0;
 f__sequential=f__formatted=1;
 f__external=0;
 if(pars_f(f__fmtbuf)<0)
  {if(a->icierr) (*__errno_location ())= 100; else f__fatal(100,"startint"); return(100);};
 fmt_bg();
 f__cblank=f__cplus=f__scale=0;
 f__svic=a;
 f__icnum=f__recpos=0;
 f__cursor = 0;
 f__hiwater = 0;
 f__icptr = a->iciunit;
 f__icend = f__icptr + a->icirlen*a->icirnum;
 f__cf = 0;
 return(0);
}

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


decompiled_code:
__int64 __fastcall s_rsfi(_QWORD *a1)
{
__int64 result; // rax

LODWORD(result) = c_si(a1);
if ( (_DWORD)result )
return (int)result;
f__reading = 1LL;
f__doed = &rd_ed;
f__doned = &rd_ned;
f__getn = z_getc;
f__dorevert = sub_B0;
f__donewrec = z_rnew;
f__doend = sub_B0;
return 0LL;
}

canonical_decompiled_code:
__int64 __fastcall func6(_QWORD *a1)
{
__int64 result; // rax

LODWORD(result) = func5(a1);
if ( (_DWORD)result )
return (int)result;
f__reading = 1LL;
f__doed = &rd_ed;
f__doned = &rd_ned;
f__getn = z_getc;
f__dorevert = sub_B0;
f__donewrec = z_rnew;
f__doend = sub_B0;
return 0LL;
}

original_code:
integer s_rsfi(icilist *a)
{ int n;
 if(n=c_si(a)) return(n);
 f__reading=1;
 f__doed=rd_ed;
 f__doned=rd_ned;
 f__getn=z_getc;
 f__dorevert = z_endp;
 f__donewrec = z_rnew;
 f__doend = z_endp;
 return(0);
}

canonical_original_code:
long s_rsfi(struct icilist *a)
{ int n;
 if(n=c_si(a)) return(n);
 f__reading=1;
 f__doed=rd_ed;
 f__doned=rd_ned;
 f__getn=z_getc;
 f__dorevert = z_endp;
 f__donewrec = z_rnew;
 f__doend = z_endp;
 return(0);
}

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


decompiled_code:
__int64 __fastcall s_wsfi(_QWORD *a1)
{
__int64 result; // rax

LODWORD(result) = c_si(a1);
if ( (_DWORD)result )
return (int)result;
f__reading = 0LL;
f__doed = &w_ed;
f__doned = &w_ned;
f__putn = z_putc;
f__dorevert = iw_rev;
f__donewrec = z_wnew;
f__doend = sub_B0;
return 0LL;
}

canonical_decompiled_code:
__int64 __fastcall func7(_QWORD *a1)
{
__int64 result; // rax

LODWORD(result) = func5(a1);
if ( (_DWORD)result )
return (int)result;
f__reading = 0LL;
f__doed = &w_ed;
f__doned = &w_ned;
f__putn = z_putc;
f__dorevert = iw_rev;
f__donewrec = z_wnew;
f__doend = sub_B0;
return 0LL;
}

original_code:
integer s_wsfi(icilist *a)
{ int n;
 if(n=c_si(a)) return(n);
 f__reading=0;
 f__doed=w_ed;
 f__doned=w_ned;
 f__putn=z_putc;
 f__dorevert = iw_rev;
 f__donewrec = z_wnew;
 f__doend = z_endp;
 return(0);
}

canonical_original_code:
long s_wsfi(struct icilist *a)
{ int n;
 if(n=c_si(a)) return(n);
 f__reading=0;
 f__doed=w_ed;
 f__doned=w_ned;
 f__putn=z_putc;
 f__dorevert = iw_rev;
 f__donewrec = z_wnew;
 f__doend = z_endp;
 return(0);
}


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

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

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

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

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

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


decompiled_code:
__int64 e_wsfi()
{
int v0; // eax
int *v1; // rdx
unsigned __int64 v2; // rcx
__int64 *v3; // r8
__int64 v4; // r9
__int64 v5; // r8
_BYTE *v6; // rax
__int64 v7; // rax

v0 = en_fio();
f__fmtbuf = 0LL;
v1 = (int *)f[5];
if ( v1 == (int *)((char *)z_putc + 1) )
{
LABEL_4:
v4 = f__recpos;
v5 = f__hiwater;
v2 = f__recpos;
if ( f__recpos < f__hiwater )
{
f__recpos = f__hiwater;
v2 = (unsigned int)f__hiwater;
v4 = (int)f__hiwater;
}
if ( f[4] > v4 )
{
v5 = v0;
if ( (_DWORD)v2 )
goto LABEL_8;
goto LABEL_11;
}
goto LABEL_15;
}
v2 = (unsigned __int64)&f__icnum;
v3 = (__int64 *)f__icnum;
if ( (__int64)v1 < f__icnum )
goto LABEL_22;
if ( v1 != (int *)f__icnum )
goto LABEL_4;
v1 = &f__recpos;
v3 = &f__hiwater;
if ( f__hiwater | f__recpos )
{
LABEL_22:
if ( *f )
goto LABEL_16;
f__fatal(110LL, "inwrite", v1, &f__icnum, v3);
return 110LL;
}
v5 = v0;
if ( (__int64)f[4] <= 0 )
{
LABEL_15:
if ( *f )
{
LABEL_16:
*_errno_location() = 110;
return 110LL;
}
f__fatal(110LL, "recend", &f__recpos, v2, v5);
return 110LL;
}
LABEL_11:
LODWORD(v2) = f__icnum;
if ( !f__icnum )
{
LABEL_8:
f__recpos = v2 + 1;
do
{
v6 = (_BYTE *)f__icptr++;
*v6 = 32;
v7 = f__recpos++;
}
while ( v7 < f[4] );
return v5;
}
return v5;
}

canonical_decompiled_code:
__int64 func9()
{
int v0; // eax
int *v1; // rdx
unsigned __int64 v2; // rcx
__int64 *v3; // r8
__int64 v4; // r9
__int64 v5; // r8
_BYTE *v6; // rax
__int64 v7; // rax

v0 = en_fio();
f__fmtbuf = 0LL;
v1 = (int *)f[5];
if ( v1 == (int *)((char *)z_putc + 1) )
{
LABEL_4:
v4 = f__recpos;
v5 = f__hiwater;
v2 = f__recpos;
if ( f__recpos < f__hiwater )
{
f__recpos = f__hiwater;
v2 = (unsigned int)f__hiwater;
v4 = (int)f__hiwater;
}
if ( f[4] > v4 )
{
v5 = v0;
if ( (_DWORD)v2 )
goto LABEL_8;
goto LABEL_11;
}
goto LABEL_15;
}
v2 = (unsigned __int64)&f__icnum;
v3 = (__int64 *)f__icnum;
if ( (__int64)v1 < f__icnum )
goto LABEL_22;
if ( v1 != (int *)f__icnum )
goto LABEL_4;
v1 = &f__recpos;
v3 = &f__hiwater;
if ( f__hiwater | f__recpos )
{
LABEL_22:
if ( *f )
goto LABEL_16;
f__fatal(110LL, "inwrite", v1, &f__icnum, v3);
return 110LL;
}
v5 = v0;
if ( (__int64)f[4] <= 0 )
{
LABEL_15:
if ( *f )
{
LABEL_16:
*_errno_location() = 110;
return 110LL;
}
f__fatal(110LL, "recend", &f__recpos, v2, v5);
return 110LL;
}
LABEL_11:
LODWORD(v2) = f__icnum;
if ( !f__icnum )
{
LABEL_8:
f__recpos = v2 + 1;
do
{
v6 = (_BYTE *)f__icptr++;
*v6 = 32;
v7 = f__recpos++;
}
while ( v7 < f[4] );
return v5;
}
return v5;
}

original_code:
integer e_wsfi(void)
{
 int n;
 n = en_fio();
 f__fmtbuf = ((void *)0);
 if(f__svic->icirnum != 1
  && (f__icnum > f__svic->icirnum
  || (f__icnum == f__svic->icirnum && (f__recpos | f__hiwater))))
  {if(f__svic->icierr) (*__errno_location ())= 110; else f__fatal(110,"inwrite"); return(110);};
 if (f__recpos < f__hiwater)
  f__recpos = f__hiwater;
 if (f__recpos >= f__svic->icirlen)
  {if(f__svic->icierr) (*__errno_location ())= 110; else f__fatal(110,"recend"); return(110);};
 if (!f__recpos && f__icnum)
  return n;
 while(f__recpos++ < f__svic->icirlen)
  *f__icptr++ = ' ';
 return n;
}

canonical_original_code:
long e_wsfi()
{
 int n;
 n = en_fio();
 f__fmtbuf = ((void *)0);
 if(f__svic->icirnum != 1
  && (f__icnum > f__svic->icirnum
  || (f__icnum == f__svic->icirnum && (f__recpos | f__hiwater))))
  {if(f__svic->icierr) (*__errno_location ())= 110; else f__fatal(110,"inwrite"); return(110);};
 if (f__recpos < f__hiwater)
  f__recpos = f__hiwater;
 if (f__recpos >= f__svic->icirlen)
  {if(f__svic->icierr) (*__errno_location ())= 110; else f__fatal(110,"recend"); return(110);};
 if (!f__recpos && f__icnum)
  return n;
 while(f__recpos++ < f__svic->icirlen)
  *f__icptr++ = ' ';
 return n;
}


decompiled_code:
void __fastcall r_atn2(float *a1, float *a2)
{
atan2(*a1, *a2);
}

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

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

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

variable_types:
y
float *


original_code:
void
s_cat(char *lp, char *rpp[], ftnint rnp[], ftnint *np, ftnlen ll)
{
 ftnlen i, nc;
 char *rp;
 ftnlen n = *np;
 ftnlen L, m;
 char *lp0, *lp1;
 lp0 = 0;
 lp1 = lp;
 L = ll;
 i = 0;
 while(i < n) {
  rp = rpp[i];
  m = rnp[i++];
  if (rp >= lp1 || rp + m <= lp) {
   if ((L -= m) <= 0) {
    n = i;
    break;
    }
   lp1 += m;
   continue;
   }
  lp0 = lp;
  lp = lp1 = F77_aloc(L = ll, "s_cat");
  break;
  }
 lp1 = lp;
 for(i = 0 ; i < n ; ++i) {
  nc = ll;
  if(rnp[i] < nc)
   nc = rnp[i];
  ll -= nc;
  rp = rpp[i];
  while(--nc >= 0)
   *lp++ = *rp++;
  }
 while(--ll >= 0)
  *lp++ = ' ';
 if (lp0) {
  memcpy(lp0, lp1, L);
  free(lp1);
  }
 }

canonical_original_code:
void s_cat(char *lp, char *rpp[], long rnp[], long *np, long ll)
{
 long i; long nc;
 char *rp;
 long n = *np;
 long L; long m;
 char *lp0; char *lp1;
 lp0 = 0;
 lp1 = lp;
 L = ll;
 i = 0;
 while(i < n) {
  rp = rpp[i];
  m = rnp[i++];
  if (rp >= lp1 || rp + m <= lp) {
   if ((L -= m) <= 0) {
    n = i;
    break;
    }
   lp1 += m;
   continue;
   }
  lp0 = lp;
  lp = lp1 = F77_aloc(L = ll, "s_cat");
  break;
  }
 lp1 = lp;
 for(i = 0 ; i < n ; ++i) {
  nc = ll;
  if(rnp[i] < nc)
   nc = rnp[i];
  ll -= nc;
  rp = rpp[i];
  while(--nc >= 0)
   *lp++ = *rp++;
  }
 while(--ll >= 0)
  *lp++ = ' ';
 if (lp0) {
  memcpy(lp0, lp1, L);
  free(lp1);
  }
 }

variable_types:
lp
char *

variable_types:
rpp
char *[]

variable_types:
rnp
long []

variable_types:
np
long *

variable_types: ll long

variable_types: nc long

variable_types:
rp
char *

variable_types: L long

variable_types: m long


decompiled_code:
__int64 f_exit()
{
__int64 v0; // rbx
__int64 result; // rax

if ( !qword_250 )
{
v0 = 0LL;
qword_250 = 1LL;
qword_260 = 0LL;
do
{
qword_258 = v0++;
result = f_clos((__int64)&qword_250);
}
while ( v0 != 100 );
}
return result;
}

canonical_decompiled_code:
__int64 func1()
{
__int64 v0; // rbx
__int64 result; // rax

if ( !qword_250 )
{
v0 = 0LL;
qword_250 = 1LL;
qword_260 = 0LL;
do
{
qword_258 = v0++;
result = func0((__int64)&qword_250);
}
while ( v0 != 100 );
}
return result;
}

original_code:
void
f_exit(void)
{ int i;
 static cllist xx;
 if (!xx.cerr) {
  xx.cerr=1;
  xx.csta=((void *)0);
  for(i=0;i<100;i++)
  {
   xx.cunit=i;
   (void) f_clos(&xx);
  }
 }
}

canonical_original_code:
void f_exit()
{ int i;
 static struct cllist xx;
 if (!xx.cerr) {
  xx.cerr=1;
  xx.csta=((void *)0);
  for(i=0;i<100;i++)
  {
   xx.cunit=i;
   (void) f_clos(&xx);
  }
 }
}

variable_types: i int

variable_types: struct cllist { long cerr; long cunit; char *csta; }


original_code:
int
flush_(void)
{ int i;
 for(i=0;i<100;i++)
  if(f__units[i].ufd != ((void *)0) && f__units[i].uwrt)
   fflush(f__units[i].ufd);
return 0;
}

canonical_original_code:
int flush_()
{ int i;
 for(i=0;i<100;i++)
  if(f__units[i].ufd != ((void *)0) && f__units[i].uwrt)
   fflush(f__units[i].ufd);
return 0;
}


decompiled_code:
__int64 xrd_SL()
{
int v0; // eax

if ( !*(_QWORD *)(f__curunit + 64LL) )
{
while ( 1 )
{
v0 = getc((FILE *)f);
if ( v0 == 10 )
break;
if ( v0 == -1 )
{
*(_QWORD *)(f__curunit + 64LL) = 1LL;
break;
}
}
}
f__recpos = 0;
f__cursor = 0LL;
return 1LL;
}

canonical_decompiled_code:
__int64 func0()
{
int v0; // eax

if ( !*(_QWORD *)(f__curunit + 64LL) )
{
while ( 1 )
{
v0 = getc((FILE *)f);
if ( v0 == 10 )
break;
if ( v0 == -1 )
{
*(_QWORD *)(f__curunit + 64LL) = 1LL;
break;
}
}
}
f__recpos = 0;
f__cursor = 0LL;
return 1LL;
}

original_code:
int
xrd_SL(void)
{ int ch;
 if(!f__curunit->uend)
  while((ch=getc(f__cf))!='\n')
   if (ch == (-1)) {
    f__curunit->uend = 1;
    break;
    }
 f__cursor=f__recpos=0;
 return(1);
}

canonical_original_code:
int xrd_SL()
{ int ch;
 if(!f__curunit->uend)
  while((ch=getc(f__cf))!='\n')
   if (ch == (-1)) {
    f__curunit->uend = 1;
    break;
    }
 f__cursor=f__recpos=0;
 return(1);
}

variable_types: ch int


decompiled_code:
__int64 x_endp()
{
xrd_SL();
return (unsigned int)-(*(_QWORD *)(f__curunit + 64LL) == 1LL);
}

canonical_decompiled_code:
__int64 func1()
{
func0();
return (unsigned int)-(*(_QWORD *)(f__curunit + 64LL) == 1LL);
}

original_code:
int
x_endp(void)
{
 xrd_SL();
 return f__curunit->uend == 1 ? (-1) : 0;
}

canonical_original_code:
int x_endp()
{
 xrd_SL();
 return f__curunit->uend == 1 ? (-1) : 0;
}


decompiled_code:
__int64 x_rev()
{
xrd_SL();
return 0LL;
}

canonical_decompiled_code:
__int64 func2()
{
func0();
return 0LL;
}

original_code:
int
x_rev(void)
{
 (void) xrd_SL();
 return(0);
}

canonical_original_code:
int x_rev()
{
 (void) xrd_SL();
 return(0);
}


decompiled_code:
__int64 x_getc()
{
__int64 result; // rax
unsigned int v1; // er12

if ( *(_QWORD *)(f__curunit + 64LL) )
return (unsigned int)-1;
LODWORD(result) = getc((FILE *)f);
v1 = result;
if ( (_DWORD)result == -1 )
{
if ( *(_QWORD *)(f__curunit + 64LL) || feof((FILE *)f) )
{
*_errno_location() = 0;
*(_QWORD *)(f__curunit + 64LL) = 1LL;
}
return (unsigned int)-1;
}
if ( (_DWORD)result != 10 )
{
++f__recpos;
return (unsigned int)result;
}
ungetc(10, (FILE *)f);
return v1;
}

canonical_decompiled_code:
__int64 func3()
{
__int64 result; // rax
unsigned int v1; // er12

if ( *(_QWORD *)(f__curunit + 64LL) )
return (unsigned int)-1;
LODWORD(result) = getc((FILE *)f);
v1 = result;
if ( (_DWORD)result == -1 )
{
if ( *(_QWORD *)(f__curunit + 64LL) || feof((FILE *)f) )
{
*_errno_location() = 0;
*(_QWORD *)(f__curunit + 64LL) = 1LL;
}
return (unsigned int)-1;
}
if ( (_DWORD)result != 10 )
{
++f__recpos;
return (unsigned int)result;
}
ungetc(10, (FILE *)f);
return v1;
}

original_code:
int
x_getc(void)
{ int ch;
 if(f__curunit->uend) return((-1));
 ch = getc(f__cf);
 if(ch!=(-1) && ch!='\n')
 { f__recpos++;
  return(ch);
 }
 if(ch=='\n')
 { (void) ungetc(ch,f__cf);
  return(ch);
 }
 if(f__curunit->uend || feof(f__cf))
 { (*__errno_location ())=0;
  f__curunit->uend=1;
  return(-1);
 }
 return(-1);
}

canonical_original_code:
int x_getc()
{ int ch;
 if(f__curunit->uend) return((-1));
 ch = getc(f__cf);
 if(ch!=(-1) && ch!='\n')
 { f__recpos++;
  return(ch);
 }
 if(ch=='\n')
 { (void) ungetc(ch,f__cf);
  return(ch);
 }
 if(f__curunit->uend || feof(f__cf))
 { (*__errno_location ())=0;
  f__curunit->uend=1;
  return(-1);
 }
 return(-1);
}


decompiled_code:
__int64 __fastcall s_rsfe(_QWORD *a1)
{
__int64 result; // rax
__int64 v3; // rdi
_QWORD *v4; // rdi
bool v5; // zf
int *v6; // rax
int *v7; // rbp

if ( !f__init )
f_init();
f__reading = 1LL;
f__sequential = 1LL;
f__formatted = 1LL;
f__external = 1LL;
LODWORD(result) = c_sfe(a1);
if ( (_DWORD)result )
return (int)result;
v3 = a1[3];
f__recpos = 0;
f__elist = a1;
f__cursor = 0LL;
f__scale = 0;
f__fmtbuf = v3;
f = (_QWORD (__fastcall *)(char, float))*f__curunit;
if ( (int)pars_f() < 0 )
{
if ( *a1 )
*_errno_location() = 100;
else
f__fatal(100LL, "startio");
return 100LL;
}
f__getn = x_getc;
f__doed = &rd_ed;
f__doned = &rd_ned;
fmt_bg();
v4 = f__curunit;
f__doend = x_endp;
v5 = f__curunit[9] == 0LL;
f__donewrec = xrd_SL;
f__dorevert = x_rev;
f__cblank = f__curunit[7];
f__cplus = 0LL;
if ( v5 )
goto LABEL_8;
if ( !(unsigned int)f__nowreading() )
{
v4 = f__curunit;
LABEL_8:
result = v4[8];
if ( result )
{
if ( *(_QWORD *)(f__elist + 16LL) )
*_errno_location() = -1;
else
f__fatal(0xFFFFFFFFLL, "read start");
result = -1LL;
}
return result;
}
v6 = _errno_location();
v7 = v6;
if ( !*a1 )
f__fatal((unsigned int)*v6, "read start");
return *v7;
}

canonical_decompiled_code:
__int64 __fastcall func4(_QWORD *a1)
{
__int64 result; // rax
__int64 v3; // rdi
_QWORD *v4; // rdi
bool v5; // zf
int *v6; // rax
int *v7; // rbp

if ( !f__init )
f_init();
f__reading = 1LL;
f__sequential = 1LL;
f__formatted = 1LL;
f__external = 1LL;
LODWORD(result) = c_sfe(a1);
if ( (_DWORD)result )
return (int)result;
v3 = a1[3];
f__recpos = 0;
f__elist = a1;
f__cursor = 0LL;
f__scale = 0;
f__fmtbuf = v3;
f = (_QWORD (__fastcall *)(char, float))*f__curunit;
if ( (int)pars_f() < 0 )
{
if ( *a1 )
*_errno_location() = 100;
else
f__fatal(100LL, "startio");
return 100LL;
}
f__getn = x_getc;
f__doed = &rd_ed;
f__doned = &rd_ned;
fmt_bg();
v4 = f__curunit;
f__doend = x_endp;
v5 = f__curunit[9] == 0LL;
f__donewrec = xrd_SL;
f__dorevert = x_rev;
f__cblank = f__curunit[7];
f__cplus = 0LL;
if ( v5 )
goto LABEL_8;
if ( !(unsigned int)f__nowreading() )
{
v4 = f__curunit;
LABEL_8:
result = v4[8];
if ( result )
{
if ( *(_QWORD *)(f__elist + 16LL) )
*_errno_location() = -1;
else
f__fatal(0xFFFFFFFFLL, "read start");
result = -1LL;
}
return result;
}
v6 = _errno_location();
v7 = v6;
if ( !*a1 )
f__fatal((unsigned int)*v6, "read start");
return *v7;
}

original_code:
integer s_rsfe(cilist *a)
{ int n;
 if(!f__init) f_init();
 f__reading=1;
 f__sequential=1;
 f__formatted=1;
 f__external=1;
 if(n=c_sfe(a)) return(n);
 f__elist=a;
 f__cursor=f__recpos=0;
 f__scale=0;
 f__fmtbuf=a->cifmt;
 f__cf=f__curunit->ufd;
 if(pars_f(f__fmtbuf)<0) {if(a->cierr) (*__errno_location ())= 100; else f__fatal(100,"startio"); return(100);};
 f__getn= x_getc;
 f__doed= rd_ed;
 f__doned= rd_ned;
 fmt_bg();
 f__doend=x_endp;
 f__donewrec=xrd_SL;
 f__dorevert=x_rev;
 f__cblank=f__curunit->ublnk;
 f__cplus=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(f__curunit->uend)
  {if(f__elist->ciend) (*__errno_location ())= ((-1)); else f__fatal(((-1)),"read start"); return(((-1)));};
 return(0);
}

canonical_original_code:
long s_rsfe(struct cilist *a)
{ int n;
 if(!f__init) f_init();
 f__reading=1;
 f__sequential=1;
 f__formatted=1;
 f__external=1;
 if(n=c_sfe(a)) return(n);
 f__elist=a;
 f__cursor=f__recpos=0;
 f__scale=0;
 f__fmtbuf=a->cifmt;
 f__cf=f__curunit->ufd;
 if(pars_f(f__fmtbuf)<0) {if(a->cierr) (*__errno_location ())= 100; else f__fatal(100,"startio"); return(100);};
 f__getn= x_getc;
 f__doed= rd_ed;
 f__doned= rd_ned;
 fmt_bg();
 f__doend=x_endp;
 f__donewrec=xrd_SL;
 f__dorevert=x_rev;
 f__cblank=f__curunit->ublnk;
 f__cplus=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(f__curunit->uend)
  {if(f__elist->ciend) (*__errno_location ())= ((-1)); else f__fatal(((-1)),"read start"); return(((-1)));};
 return(0);
}

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

variable_types: n int


decompiled_code:
__int64 __fastcall do_us(int *a1, void *a2, __int64 a3)
{
__int64 v3; // rax
__int64 v4; // rdx
__int64 v5; // rcx
size_t v6; // r8
__int64 result; // rax

v3 = *(_QWORD *)a1;
if ( f__reading )
{
f__recpos += a3 * v3;
if ( f__recpos > f__reclen )
{
if ( *f__elist )
*_errno_location() = 110;
else
f__fatal(110LL, "do_us", a3, &f__recpos, f__reclen);
result = 110LL;
}
else
{
v6 = fread(a2, (int)a3, *a1, (FILE *)f);
result = 0LL;
if ( v6 != *(_QWORD *)a1 )
{
if ( f__elist[2] )
*_errno_location() = -1;
else
f__fatal(0xFFFFFFFFLL, "do_us", v4, v5, v6);
result = 0xFFFFFFFFLL;
}
}
}
else
{
f__reclen += a3 * v3;
fwrite(a2, (int)a3, *a1, (FILE *)f);
result = 0LL;
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func0(int *a1, void *a2, __int64 a3)
{
__int64 v3; // rax
__int64 v4; // rdx
__int64 v5; // rcx
size_t v6; // r8
__int64 result; // rax

v3 = *(_QWORD *)a1;
if ( f__reading )
{
f__recpos += a3 * v3;
if ( f__recpos > f__reclen )
{
if ( *f__elist )
*_errno_location() = 110;
else
f__fatal(110LL, "do_us", a3, &f__recpos, f__reclen);
result = 110LL;
}
else
{
v6 = fread(a2, (int)a3, *a1, (FILE *)f);
result = 0LL;
if ( v6 != *(_QWORD *)a1 )
{
if ( f__elist[2] )
*_errno_location() = -1;
else
f__fatal(0xFFFFFFFFLL, "do_us", v4, v5, v6);
result = 0xFFFFFFFFLL;
}
}
}
else
{
f__reclen += a3 * v3;
fwrite(a2, (int)a3, *a1, (FILE *)f);
result = 0LL;
}
return result;
}

original_code:
int
do_us(ftnint *number, char *ptr, ftnlen len)
{
 if(f__reading)
 {
  f__recpos += (int)(*number * len);
  if(f__recpos>f__reclen)
   {if(f__elist->cierr) (*__errno_location ())= 110; else f__fatal(110,"do_us"); return(110);};
  if (fread(ptr,(int)len,(int)(*number),f__cf) != *number)
   {if(f__elist->ciend) (*__errno_location ())= (-1); else f__fatal((-1),"do_us"); return((-1));};
  return(0);
 }
 else
 {
  f__reclen += *number * len;
  (void) fwrite(ptr,(int)len,(int)(*number),f__cf);
  return(0);
 }
}

canonical_original_code:
int do_us(long *number, char *ptr, long len)
{
 if(f__reading)
 {
  f__recpos += (int)(*number * len);
  if(f__recpos>f__reclen)
   {if(f__elist->cierr) (*__errno_location ())= 110; else f__fatal(110,"do_us"); return(110);};
  if (fread(ptr,(int)len,(int)(*number),f__cf) != *number)
   {if(f__elist->ciend) (*__errno_location ())= (-1); else f__fatal((-1),"do_us"); return((-1));};
  return(0);
 }
 else
 {
  f__reclen += *number * len;
  (void) fwrite(ptr,(int)len,(int)(*number),f__cf);
  return(0);
 }
}

variable_types:
number
long *

variable_types:
ptr
char *

variable_types: len long


decompiled_code:
__int64 __fastcall do_ud(int *a1, void *a2, __int64 a3, __int64 a4, __int64 a5)
{
int v7; // eax
__int64 v8; // rcx
size_t v9; // rsi
__int64 v10; // r12
size_t v11; // rdx
__int64 v13; // rdx
__int64 v14; // rcx
__int64 v15; // r8

v7 = f__recpos + a3 * *a1;
f__recpos = v7;
v8 = *(unsigned int *)(f__curunit + 28LL);
if ( (_DWORD)v8 == 1 || v7 <= (int)v8 )
{
v9 = (int)a3;
v10 = f__reading;
v11 = *a1;
if ( f__reading )
{
v10 = 0LL;
if ( fread(a2, v9, v11, (FILE *)f) != *(_QWORD *)a1 )
{
v10 = -1LL;
if ( *f__elist )
*_errno_location() = -1;
else
f__fatal(0xFFFFFFFFLL, "do_ud", v13, v14, v15);
}
}
else
{
fwrite(a2, v9, v11, (FILE *)f);
}
return v10;
}
if ( !*f__elist )
{
v10 = 110LL;
f__fatal(110LL, "do_ud", a3, v8, a5);
return v10;
}
*_errno_location() = 110;
return 110LL;
}

canonical_decompiled_code:
__int64 __fastcall func1(int *a1, void *a2, __int64 a3, __int64 a4, __int64 a5)
{
int v7; // eax
__int64 v8; // rcx
size_t v9; // rsi
__int64 v10; // r12
size_t v11; // rdx
__int64 v13; // rdx
__int64 v14; // rcx
__int64 v15; // r8

v7 = f__recpos + a3 * *a1;
f__recpos = v7;
v8 = *(unsigned int *)(f__curunit + 28LL);
if ( (_DWORD)v8 == 1 || v7 <= (int)v8 )
{
v9 = (int)a3;
v10 = f__reading;
v11 = *a1;
if ( f__reading )
{
v10 = 0LL;
if ( fread(a2, v9, v11, (FILE *)f) != *(_QWORD *)a1 )
{
v10 = -1LL;
if ( *f__elist )
*_errno_location() = -1;
else
f__fatal(0xFFFFFFFFLL, "do_ud", v13, v14, v15);
}
}
else
{
fwrite(a2, v9, v11, (FILE *)f);
}
return v10;
}
if ( !*f__elist )
{
v10 = 110LL;
f__fatal(110LL, "do_ud", a3, v8, a5);
return v10;
}
*_errno_location() = 110;
return 110LL;
}

original_code:
integer do_ud(ftnint *number, char *ptr, ftnlen len)
{
 f__recpos += (int)(*number * len);
 if(f__recpos > f__curunit->url && f__curunit->url!=1)
  {if(f__elist->cierr) (*__errno_location ())= 110; else f__fatal(110,"do_ud"); return(110);};
 if(f__reading)
 {
  if(fread(ptr,(int)len,(int)(*number),f__cf) != *number)
   {if(f__elist->cierr) (*__errno_location ())= (-1); else f__fatal((-1),"do_ud"); return((-1));}
  else return(0);
 }
 (void) fwrite(ptr,(int)len,(int)(*number),f__cf);
 return(0);
}

canonical_original_code:
long do_ud(long *number, char *ptr, long len)
{
 f__recpos += (int)(*number * len);
 if(f__recpos > f__curunit->url && f__curunit->url!=1)
  {if(f__elist->cierr) (*__errno_location ())= 110; else f__fatal(110,"do_ud"); return(110);};
 if(f__reading)
 {
  if(fread(ptr,(int)len,(int)(*number),f__cf) != *number)
   {if(f__elist->cierr) (*__errno_location ())= (-1); else f__fatal((-1),"do_ud"); return((-1));}
  else return(0);
 }
 (void) fwrite(ptr,(int)len,(int)(*number),f__cf);
 return(0);
}


decompiled_code:
__int64 __fastcall do_uio(int *a1, void *a2, __int64 a3, __int64 a4, __int64 a5)
{
__int64 result; // rax

if ( f__sequential )
result = (int)do_us(a1, a2, a3);
else
result = do_ud(a1, a2, a3, a4, a5);
return result;
}

canonical_decompiled_code:
__int64 __fastcall func2(int *a1, void *a2, __int64 a3, __int64 a4, __int64 a5)
{
__int64 result; // rax

if ( f__sequential )
result = (int)func0(a1, a2, a3);
else
result = func1(a1, a2, a3, a4, a5);
return result;
}

original_code:
integer do_uio(ftnint *number, char *ptr, ftnlen len)
{
 if(f__sequential)
  return(do_us(number,ptr,len));
 else return(do_ud(number,ptr,len));
}

canonical_original_code:
long do_uio(long *number, char *ptr, long len)
{
 if(f__sequential)
  return(do_us(number,ptr,len));
 else return(do_ud(number,ptr,len));
}


decompiled_code:
void __fastcall r_asin(float *a1)
{
asin(*a1);
}

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

original_code:
double r_asin(real *x)
{
return( asin(*x) );
}

canonical_original_code:
double r_asin(float *x)
{
return( asin(*x) );
}

variable_types:
x
float *


decompiled_code:
void __fastcall r_cosh(float *a1)
{
cosh(*a1);
}

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

original_code:
double r_cosh(real *x)
{
return( cosh(*x) );
}

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


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

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

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

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

original_code:
integer s_wsle(cilist *a)
{
 int n;
 if(n=c_le(a)) return(n);
 f__reading=0;
 f__external=1;
 f__formatted=1;
 f__putn = x_putc;
 f__lioproc = l_write;
 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 ()),"list output start"); return((*__errno_location ()));};
 return(0);
 }

canonical_original_code:
long s_wsle(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;
 f__lioproc = l_write;
 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 ()),"list output start"); return((*__errno_location ()));};
 return(0);
 }


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

result = (int)f__putbuf(10LL);
f__recpos = 0;
return result;
}

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

result = (int)f__putbuf(10LL);
f__recpos = 0;
return result;
}

original_code:
integer e_wsle(void)
{
 int n = f__putbuf('\n');
 f__recpos=0;
 return(n);
 }

canonical_original_code:
long e_wsle()
{
 int n = f__putbuf('\n');
 f__recpos=0;
 return(n);
 }


decompiled_code:
void __fastcall d_sqrt(double *a1)
{
sqrt(*a1);
}

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

original_code:
double d_sqrt(doublereal *x)
{
return( sqrt(*x) );
}

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

variable_types:
x
double *


decompiled_code:
__int64 __fastcall lbit_shift(unsigned __int64 a1, __int64 a2)
{
__int64 result; // rax
unsigned __int64 v3; // rdi

result = a1 << a2;
v3 = a1 >> -(char)a2;
if ( a2 < 0 )
result = v3;
return result;
}

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

result = a1 << a2;
v3 = a1 >> -(char)a2;
if ( a2 < 0 )
result = v3;
return result;
}

original_code:
integer
lbit_shift(integer a, integer b)
{
 return b >= 0 ? a << b : (integer)((uinteger)a >> -b);
 }

canonical_original_code:
long lbit_shift(long a, long b)
{
 return b >= 0 ? a << b : (integer)((unsigned long)a >> -b);
 }

variable_types: a long

variable_types: b long


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

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

variable_types:
y
double *

variable_types: quotient double


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

sub_0(a1);
v2[3] = a1[3];
x_wsne(v2);
sub_E0();
return 0LL;
}

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

sub_0(a1);
v2[3] = a1[3];
x_wsne(v2);
func0();
return 0LL;
}

original_code:
integer
s_wsni(icilist *a)
{
 cilist ca;
 c_liw(a);
 ca.cifmt = a->icifmt;
 x_wsne(&ca);
 z_wSL();
 return 0;
 }

canonical_original_code:
long s_wsni(struct icilist *a)
{
 struct cilist ca;
 c_liw(a);
 ca.cifmt = a->icifmt;
 x_wsne(&ca);
 z_wSL();
 return 0;
 }

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

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


decompiled_code:
__int64 __fastcall s_wsli(_QWORD *a1)
{
f__lioproc = &l_write;
sub_0(a1);
return 0LL;
}

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

original_code:
integer
s_wsli(icilist *a)
{
 f__lioproc = l_write;
 c_liw(a);
 return(0);
 }

canonical_original_code:
long s_wsli(struct icilist *a)
{
 f__lioproc = l_write;
 c_liw(a);
 return(0);
 }


decompiled_code:
__int64 e_wsli()
{
sub_E0();
return 0LL;
}

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

original_code:
integer e_wsli(void)
{
 z_wSL();
 return(0);
 }

canonical_original_code:
long e_wsli()
{
 z_wSL();
 return(0);
 }


decompiled_code:
double __fastcall d_abs(double *a1)
{
double result; // xmm0_8

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

canonical_decompiled_code:
double __fastcall func0(double *a1)
{
double result; // xmm0_8

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

original_code:
double d_abs(doublereal *x)
{
if(*x >= 0)
 return(*x);
return(- *x);
}

canonical_original_code:
double d_abs(double *x)
{
if(*x >= 0)
 return(*x);
return(- *x);
}


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


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

canonical_decompiled_code:
__int64 __fastcall func8(_BYTE *a1)
{
f = 0;
f__revloc = 0;
f__parenlvl = 0;
return (unsigned int)-(func7(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 *


decompiled_code:
__int64 __fastcall do_fio(__int64 *a1, __int64 a2, __int64 a3, float a4)
{
__int64 v5; // r15
int v6; // ecx
__int64 v7; // rsi
int v8; // ecx
__int64 v9; // r8
unsigned int v10; // er9
__int64 v11; // rdx
__int64 v12; // rcx
__int64 result; // rax
int v14; // edx
int v15; // esi
int v16; // esi
int v17; // esi
int v18; // eax
__int64 v19; // rdx
int v20; // esi
int v21; // eax
__int64 v22; // rdx
__int64 v23; // rcx

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

canonical_decompiled_code:
__int64 __fastcall func9(__int64 *a1, __int64 a2, __int64 a3, float a4)
{
__int64 v5; // r15
int v6; // ecx
__int64 v7; // rsi
int v8; // ecx
__int64 v9; // r8
unsigned int v10; // er9
__int64 v11; // rdx
__int64 v12; // rcx
__int64 result; // rax
int v14; // edx
int v15; // esi
int v16; // esi
int v17; // esi
int v18; // eax
__int64 v19; // rdx
int v20; // esi
int v21; // eax
__int64 v22; // rdx
__int64 v23; // rcx

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

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


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 func10(float a1)
{
__int64 v2; // [rsp+8h] [rbp-10h] BYREF

v2 = 1LL;
return func9(&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 *func11()
{
_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;
}


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 *


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
int *v3; // rbx

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() )
{
v2 = _errno_location();
v3 = v2;
if ( !*a1 )
f__fatal((unsigned int)*v2, "namelist output start");
result = *v3;
}
else
{
x_wsne(a1);
result = e_wsle();
}
return result;
}

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

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() )
{
v2 = _errno_location();
v3 = v2;
if ( !*a1 )
f__fatal((unsigned int)*v2, "namelist output start");
result = *v3;
}
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:
char *__fastcall b_char(__int64 a1, __int64 a2, __int64 a3)
{
char *result; // rax
char v5; // dl

result = 0LL;
if ( a3 > 0 )
{
while ( 1 )
{
v5 = result[a1];
if ( !v5 )
break;
(result++)[a2] = v5;
if ( (char *)a3 == result )
return result;
}
if ( a3 > (int)result )
result = (char *)memset(&result[a2], 32, a3 - (int)result);
}
return result;
}

canonical_decompiled_code:
char *__fastcall func1(__int64 a1, __int64 a2, __int64 a3)
{
char *result; // rax
char v5; // dl

result = 0LL;
if ( a3 > 0 )
{
while ( 1 )
{
v5 = result[a1];
if ( !v5 )
break;
(result++)[a2] = v5;
if ( (char *)a3 == result )
return result;
}
if ( a3 > (int)result )
result = (char *)memset(&result[a2], 32, a3 - (int)result);
}
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 func2(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
_QWORD *v2; // rax
bool v3; // zf
unsigned int v4; // er8
__int64 result; // rax
int *v6; // rax

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

canonical_decompiled_code:
__int64 __fastcall func0(_QWORD *a1)
{
unsigned __int64 v1; // rdx
_QWORD *v2; // rax
bool v3; // zf
unsigned int v4; // er8
__int64 result; // rax
int *v6; // rax

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

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);
}