grow

original_code:
int grow(float *p, float *q, int c, int n)
{
    const int s = (n + 2) * c;
    const int a = (c - 1);
    float *P;
    float *Q;
    int N = 0;
    int i;
    int j;
    int d;
    memcpy(q, p, (size_t) (n + 2) * (n + 2) * c * sizeof (float));
#pragma omp parallel for private(j, P, Q, d) reduction(+:N)
    for (i = 1; i <= n; i++)
        for (j = 1; j <= n; j++)
        {
            P = p + ((n + 2) * i + j) * c;
            Q = q + ((n + 2) * i + j) * c;
            if (Q[a] == 0)
            {
                d = 0;
                if ((Q - s - c)[a]) { accumulate(P, Q - s - c, a); d++; }
                if ((Q - s )[a]) { accumulate(P, Q - s , a); d++; }
                if ((Q - s + c)[a]) { accumulate(P, Q - s + c, a); d++; }
                if ((Q - c)[a]) { accumulate(P, Q - c, a); d++; }
                if ((Q + c)[a]) { accumulate(P, Q + c, a); d++; }
                if ((Q + s - c)[a]) { accumulate(P, Q + s - c, a); d++; }
                if ((Q + s )[a]) { accumulate(P, Q + s , a); d++; }
                if ((Q + s + c)[a]) { accumulate(P, Q + s + c, a); d++; }
                if (d)
                {
                    divide(P, (float) d, a);
                    N++;
                }
            }
        }
    return N;
}

canonical_original_code:
int grow(float *p, float *q, int c, int n)
{
    int s = (n + 2) * c;
    int a = (c - 1);
    float *P;
    float *Q;
    int N = 0;
    int i;
    int j;
    int d;
    memcpy(q, p, (unsigned long) (n + 2) * (n + 2) * c * sizeof (float));
#pragma omp parallel for private(j, P, Q, d) reduction(+:N)
    for (i = 1; i <= n; i++)
        for (j = 1; j <= n; j++)
        {
            P = p + ((n + 2) * i + j) * c;
            Q = q + ((n + 2) * i + j) * c;
            if (Q[a] == 0)
            {
                d = 0;
                if ((Q - s - c)[a]) { accumulate(P, Q - s - c, a); d++; }
                if ((Q - s )[a]) { accumulate(P, Q - s , a); d++; }
                if ((Q - s + c)[a]) { accumulate(P, Q - s + c, a); d++; }
                if ((Q - c)[a]) { accumulate(P, Q - c, a); d++; }
                if ((Q + c)[a]) { accumulate(P, Q + c, a); d++; }
                if ((Q + s - c)[a]) { accumulate(P, Q + s - c, a); d++; }
                if ((Q + s )[a]) { accumulate(P, Q + s , a); d++; }
                if ((Q + s + c)[a]) { accumulate(P, Q + s + c, a); d++; }
                if (d)
                {
                    divide(P, (float) d, a);
                    N++;
                }
            }
        }
    return N;
}

variable_types:
p
float *

variable_types:
q
float *

variable_types: c int

variable_types: n int

variable_types: s int

variable_types: a int

variable_types:
P
float *

variable_types:
Q
float *

variable_types: N int

variable_types: i int

variable_types: d int


hms

repo: rlk/scmtiff

decompiled_code:
int __fastcall hms(char *a1, int a2)
{
if ( a2 <= 60 )
return sprintf(a1, "%ds", (unsigned int)a2);
if ( a2 <= 3600 )
return sprintf(a1, "%dm %ds", (unsigned int)(a2 / 60), (unsigned int)(a2 % 60));
return sprintf(
a1,
"%dh %dm %ds",
(unsigned int)(a2 / 3600),
(unsigned int)(a2 % 3600 / 60),
(unsigned int)(a2 % 3600 % 60));
}

canonical_decompiled_code:
int __fastcall func11(char *a1, int a2)
{
if ( a2 <= 60 )
return sprintf(a1, "%ds", (unsigned int)a2);
if ( a2 <= 3600 )
return sprintf(a1, "%dm %ds", (unsigned int)(a2 / 60), (unsigned int)(a2 % 60));
return sprintf(
a1,
"%dh %dm %ds",
(unsigned int)(a2 / 3600),
(unsigned int)(a2 % 3600 / 60),
(unsigned int)(a2 % 3600 % 60));
}

original_code:
void hms(char *str, int s)
{
    int h = 0;
    int m = 0;
    if (s > 60.0)
    {
        if (s > 3600.0)
        {
            h = (int) s / 3600;
            s -= (int) h * 3600;
        }
        m = (int) s / 60;
        s -= (int) m * 60;
    }
    if (h) sprintf(str, "%dh %dm %ds", h, m, s);
    else if (m) sprintf(str, "%dm %ds", m, s);
    else sprintf(str, "%ds", s);
}

variable_types:
str
char *

variable_types: h int

variable_types: m int

return_type: void


decompiled_code:
void __fastcall report_init(int a1)
{
report_done = 0;
report_todo = a1;
}

canonical_decompiled_code:
void __fastcall func12(int a1)
{
report_done = 0;
report_todo = a1;
}

original_code:
void report_init(int n)
{
    report_done = 0;
    report_todo = n;
}


decompiled_code:
void report_step()
{
size_t v0; // rbx
double v1; // xmm0_8
double v2; // xmm1_8
int v3; // esi
double v4; // [rsp+0h] [rbp-210h]
char v5[256]; // [rsp+8h] [rbp-208h] BYREF
char v6[264]; // [rsp+108h] [rbp-108h] BYREF

++report_done;
if ( report_todo )
{
v0 = 0LL;
if ( dirty_2 )
{
while ( strlen(str_1) > v0 )
{
++v0;
putchar(8);
}
v2 = *(double *)&start_0;
}
else
{
v1 = now();
dirty_2 = 1;
v2 = v1;
start_0 = *(_QWORD *)&v1;
}
v4 = now() - v2;
hms(v5, (int)v4);
v3 = report_done;
if ( report_done )
v3 = (int)((double)report_todo * v4 / (double)report_done - v4);
hms(v6, v3);
sprintf(
str_1,
"Processed %d of %d (%.2f%%) %s passed, estimated %s remaining. ",
(unsigned int)report_done,
(unsigned int)report_todo,
(double)report_done * 100.0 / (double)report_todo,
v5,
v6);
if ( report_done >= report_todo )
puts(str_1);
else
printf("%s", str_1);
fflush(stdout);
}
}

canonical_decompiled_code:
void func13()
{
size_t v0; // rbx
double v1; // xmm0_8
double v2; // xmm1_8
int v3; // esi
double v4; // [rsp+0h] [rbp-210h]
char v5[256]; // [rsp+8h] [rbp-208h] BYREF
char v6[264]; // [rsp+108h] [rbp-108h] BYREF

++report_done;
if ( report_todo )
{
v0 = 0LL;
if ( dirty_2 )
{
while ( strlen(str_1) > v0 )
{
++v0;
putchar(8);
}
v2 = *(double *)&start_0;
}
else
{
v1 = func2();
dirty_2 = 1;
v2 = v1;
start_0 = *(_QWORD *)&v1;
}
v4 = func2() - v2;
func11(v5, (int)v4);
v3 = report_done;
if ( report_done )
v3 = (int)((double)report_todo * v4 / (double)report_done - v4);
func11(v6, v3);
sprintf(
str_1,
"Processed %d of %d (%.2f%%) %s passed, estimated %s remaining. ",
(unsigned int)report_done,
(unsigned int)report_todo,
(double)report_done * 100.0 / (double)report_todo,
v5,
v6);
if ( report_done >= report_todo )
puts(str_1);
else
printf("%s", str_1);
fflush(stdout);
}
}

original_code:
void report_step(void)
{
    report_done++;
    if (report_todo)
    {
        static char str[256];
        static int dirty = 0;
        static double start = 0;
        char passed[256];
        char remain[256];
        if (dirty)
        {
            for (int i = 0; i < strlen(str); i++)
                printf("\b");
        }
        else
        {
            start = now();
            dirty = 1;
        }
        double d = now() - start;
        hms(passed, d);
        hms(remain, report_done ? d * report_todo / report_done - d : 0);
        sprintf(str, "Processed %d of %d (%.2f%%) %s passed, "
                                     "estimated %s remaining. ",
                    report_done,
                    report_todo, 100.0 * report_done / report_todo,
                    passed, remain);
        if (report_done < report_todo)
            printf("%s", str);
        else
            printf("%s\n", str);
        fflush(stdout);
    }
}

canonical_original_code:
void report_step()
{
    report_done++;
    if (report_todo)
    {
        static char str[256];
        static int dirty = 0;
        static double start = 0;
        char passed[256];
        char remain[256];
        if (dirty)
        {
            for (int i = 0; i < strlen(str); i++)
                printf("\b");
        }
        else
        {
            start = now();
            dirty = 1;
        }
        double d = now() - start;
        hms(passed, d);
        hms(remain, report_done ? d * report_todo / report_done - d : 0);
        sprintf(str, "Processed %d of %d (%.2f%%) %s passed, "
                                     "estimated %s remaining. ",
                    report_done,
                    report_todo, 100.0 * report_done / report_todo,
                    passed, remain);
        if (report_done < report_todo)
            printf("%s", str);
        else
            printf("%s\n", str);
        fflush(stdout);
    }
}

variable_types:
str
char [256]

variable_types: dirty int

variable_types: start double

variable_types:
passed
char [256]

variable_types:
remain
char [256]

variable_types: d double


original_code:
static inline long long log2i(long long n)
{
    unsigned long long v = (unsigned long long) n;
    unsigned long long r;
    unsigned long long s;
    r = (v > 0xFFFFFFFFULL) << 5; v >>= r;
    s = (v > 0xFFFFULL ) << 4; v >>= s; r |= s;
    s = (v > 0xFFULL ) << 3; v >>= s; r |= s;
    s = (v > 0xFULL ) << 2; v >>= s; r |= s;
    s = (v > 0x3ULL ) << 1; v >>= s; r |= s;
    return (long long) (r | (v >> 1));
}

variable_types:
n
long long

variable_types:
v
unsigned long long

variable_types:
r
unsigned long long

variable_types:
s
unsigned long long

return_type: long long


decompiled_code:
__int64 __fastcall scm_page_count(char a1)
{
return (1LL << (2 * a1 + 3)) - 2;
}

canonical_decompiled_code:
__int64 __fastcall func1(char a1)
{
return (1LL << (2 * a1 + 3)) - 2;
}

original_code:
static inline long long scm_page_count(long long d)
{
    return (1LL << (2 * d + 3)) - 2;
}

variable_types:
d
long long


decompiled_code:
__int64 __fastcall scm_page_level(__int64 a1)
{
return (__int64)(log2i(a1 + 2) - 1) / 2;
}

original_code:
static inline long long scm_page_level(long long i)
{
    return (log2i(i + 2) - 1) / 2;
}

variable_types:
i
long long


original_code:
static inline long long scm_page_root(long long i)
{
    long long n = 1LL << (2 * scm_page_level(i));
    return (i - 2 * (n - 1)) / n;
}


original_code:
static inline long long scm_page_rank(long long i)
{
    long long n = 1LL << (2 * scm_page_level(i));
    return (i - 2 * (n - 1)) % n;
}


decompiled_code:
__int64 __fastcall scm_page_row(__int64 a1)
{
__int64 v1; // rsi
__int64 v2; // r8

v1 = scm_page_rank(a1);
return v1 / (1LL << scm_page_level(v2));
}

original_code:
static inline long long scm_page_row(long long i)
{
    return scm_page_rank(i) / (1LL << scm_page_level(i));
}


decompiled_code:
__int64 __fastcall scm_page_col(__int64 a1)
{
__int64 v1; // rsi
__int64 v2; // r8

v1 = scm_page_rank(a1);
return v1 % (1LL << scm_page_level(v2));
}

original_code:
static inline long long scm_page_col(long long i)
{
    return scm_page_rank(i) % (1LL << scm_page_level(i));
}


original_code:
static inline long long scm_page_index(long long a, long long l,
                                       long long r, long long c)
{
    return scm_page_count(l - 1) + (a << (2 * l)) + (r << l) + c;
}

variable_types:
a
long long

variable_types:
l
long long

variable_types:
r
long long

variable_types:
c
long long


decompiled_code:
__int64 __fastcall scm_page_child(__int64 a1)
{
__int64 v1; // r9
__int64 v2; // r9
__int64 v3; // r9
__int64 v4; // rax
char v5; // r8

scm_page_col(a1);
scm_page_row(v1);
scm_page_level(v2);
v4 = scm_page_root(v3);
return scm_page_index(v4, v5 + 1);
}

original_code:
static inline long long scm_page_child(long long i, long long k)
{
    return scm_page_index(scm_page_root(i), scm_page_level(i) + 1,
                                            scm_page_row (i) * 2 + k / 2,
                                            scm_page_col (i) * 2 + k % 2);
}

variable_types:
k
long long


decompiled_code:
__int64 __fastcall init_tap(unsigned int a1, unsigned int a2, unsigned int a3, unsigned int *a4)
{
unsigned int i; // ebx
unsigned int v8; // er14
__int64 v9; // rdi
__int64 result; // rax

for ( i = a3; i != 1; a4 += (int)i )
{
v8 = a2;
a2 *= 2;
v9 = a1;
a1 += v8;
i = (int)i / 2;
init_tap(v9, a2, i, a4);
result = (int)i;
}
*a4 = a1;
return result;
}

canonical_decompiled_code:
__int64 __fastcall func9(unsigned int a1, unsigned int a2, unsigned int a3, unsigned int *a4)
{
unsigned int i; // ebx
unsigned int v8; // er14
__int64 v9; // rdi
__int64 result; // rax

for ( i = a3; i != 1; a4 += (int)i )
{
v8 = a2;
a2 *= 2;
v9 = a1;
a1 += v8;
i = (int)i / 2;
func9(v9, a2, i, a4);
result = (int)i;
}
*a4 = a1;
return result;
}

original_code:
static void init_tap(int a, int d, int n, int *x)
{
    if (n == 1)
        *x = a;
    else
    {
        init_tap(a, d * 2, n / 2, x );
        init_tap(a + d, d * 2, n / 2, x + n / 2);
    }
}

variable_types: a int

variable_types: d int

variable_types: n int

variable_types:
x
int *


overlap

original_code:
static _Bool overlap(img *p, int f, long u, long v, long w)
{
    for (int t = 0; t < (1024 * 1024); ++t)
    {
        int i = tap[t] / 1024;
        int j = tap[t] % 1024;
        double c[3];
        scm_get_sample_center(f, 1024 * u + i, 1024 * v + j, 1024 * w, c);
        if (img_locate(p, c))
            return 1;
    }
    return 0;
}

canonical_original_code:
static _Bool overlap(struct img *p, int f, long u, long v, long w)
{
    for (int t = 0; t < (1024 * 1024); ++t)
    {
        int i = tap[t] / 1024;
        int j = tap[t] % 1024;
        double c[3];
        scm_get_sample_center(f, 1024 * u + i, 1024 * v + j, 1024 * w, c);
        if (img_locate(p, c))
            return 1;
    }
    return 0;
}

variable_types: struct img { void *p; unsigned long n; int w; int h; int c; int b; int g; int o; int d; void *q; float norm0; float norm1; double maximum_latitude; double minimum_latitude; double center_latitude; double easternmost_longitude; double westernmost_longitude; double center_longitude; double line_projection_offset; double sample_projection_offset; double map_resolution; double map_scale; double a_axis_radius; float scaling_factor; float offset; double latc; double lonc; int (*project)(struct img *, double *, double, double, double *); } *

variable_types: f int

variable_types: u long

variable_types: v long

variable_types: w long

variable_types: t int

variable_types: i int

variable_types: j int

variable_types:
c
double [3]


multisample

original_code:
static int multisample(img *p, int f, int i, int j, int n,
                                 long u, long v, long w, float *d)
{
    double c[12];
    double C[15];
    int N = 0;
    scm_get_sample_corners(f, n * u + i, n * v + j, n * w, c);
    quincunx(C, c);
    for (int l = 0; l < 5; l++)
    {
        float t[4];
        if (img_sample(p, C + l * 3, t))
        {
            switch (p->c)
            {
                case 4: d[3] += t[3];
                case 3: d[2] += t[2];
                case 2: d[1] += t[1];
                case 1: d[0] += t[0];
            }
            N += 1;
        }
    }
    if (N)
    {
        switch (p->c)
        {
            case 4: d[3] /= N;
            case 3: d[2] /= N;
            case 2: d[1] /= N;
            case 1: d[0] /= N;
        }
    }
    return N;
}

canonical_original_code:
static int multisample(struct img *p, int f, int i, int j, int n, long u, long v, long w, float *d)
{
    double c[12];
    double C[15];
    int N = 0;
    scm_get_sample_corners(f, n * u + i, n * v + j, n * w, c);
    quincunx(C, c);
    for (int l = 0; l < 5; l++)
    {
        float t[4];
        if (img_sample(p, C + l * 3, t))
        {
            switch (p->c)
            {
                case 4: d[3] += t[3];
                case 3: d[2] += t[2];
                case 2: d[1] += t[1];
                case 1: d[0] += t[0];
            }
            N += 1;
        }
    }
    if (N)
    {
        switch (p->c)
        {
            case 4: d[3] /= N;
            case 3: d[2] /= N;
            case 2: d[1] /= N;
            case 1: d[0] /= N;
        }
    }
    return N;
}

variable_types:
d
float *

variable_types:
c
double [12]

variable_types:
C
double [15]

variable_types: N int

variable_types: l int

variable_types:
t
float [4]

return_type: int

user_defined_types: struct img { void *p; unsigned long n; int w; int h; int c; int b; int g; int o; int d; void *q; float norm0; float norm1; double maximum_latitude; double minimum_latitude; double center_latitude; double easternmost_longitude; double westernmost_longitude; double center_longitude; double line_projection_offset; double sample_projection_offset; double map_resolution; double map_scale; double a_axis_radius; float scaling_factor; float offset; double latc; double lonc; int (*project)(struct img *, double *, double, double, double *); }


divide

original_code:
static void divide(float *p, float d, int c)
{
    switch (c)
    {
        case 4: p[3] /= d;
        case 3: p[2] /= d;
        case 2: p[1] /= d;
        case 1: p[0] /= d;
    }
}

variable_types:
p
float *

variable_types: d float

variable_types: c int


decompiled_code:
__int64 __fastcall get_int(const char *a1)
{
return strtol(a1, 0LL, 0);
}

canonical_decompiled_code:
__int64 __fastcall func0(const char *a1)
{
return strtol(a1, 0LL, 0);
}

original_code:
static int get_int(const char *v)
{
    return (int) strtol(v, ((void *)0), 0);
}

canonical_original_code:
static int get_int(char *v)
{
    return (int) strtol(v, ((void *)0), 0);
}

variable_types:
v
char *


decompiled_code:
void __fastcall get_double(const char *a1)
{
strtod(a1, 0LL);
}

canonical_decompiled_code:
void __fastcall func1(const char *a1)
{
strtod(a1, 0LL);
}

original_code:
static double get_double(const char *v)
{
    return strtod(v, ((void *)0));
}

canonical_original_code:
static double get_double(char *v)
{
    return strtod(v, ((void *)0));
}

return_type: double


decompiled_code:
float __fastcall get_float(const char *a1)
{
return strtod(a1, 0LL);
}

canonical_decompiled_code:
float __fastcall func2(const char *a1)
{
return strtod(a1, 0LL);
}

original_code:
static float get_float(const char *v)
{
    return (float) strtod(v, ((void *)0));
}

canonical_original_code:
static float get_float(char *v)
{
    return (float) strtod(v, ((void *)0));
}

return_type: float


equals

decompiled_code:
_BOOL8 __fastcall equals(const char *a1, const char *a2)
{
return strcasecmp(a1, a2) == 0;
}

canonical_decompiled_code:
_BOOL8 __fastcall func3(const char *a1, const char *a2)
{
return strcasecmp(a1, a2) == 0;
}

original_code:
static int equals(const char *a, const char *b)
{
    return (strcasecmp(a, b) == 0) ? 1 : 0;
}

canonical_original_code:
static int equals(char *a, char *b)
{
    return (strcasecmp(a, b) == 0) ? 1 : 0;
}

variable_types:
a
char *

variable_types:
b
char *


decompiled_code:
void __fastcall get_scale(const char *a1, const char *a2)
{
if ( !equals(a2, "M/PIX") && (equals(a2, "KM/PIX") || !equals(a2, "M/PIXEL") && equals(a2, "KM/PIXEL")) )
get_double(a1);
else
get_double(a1);
}

canonical_decompiled_code:
void __fastcall func4(const char *a1, const char *a2)
{
if ( !func3(a2, "M/PIX") && (func3(a2, "KM/PIX") || !func3(a2, "M/PIXEL") && func3(a2, "KM/PIXEL")) )
func1(a1);
else
func1(a1);
}

original_code:
static double get_scale(const char *v, const char *u)
{
    if (equals(u, "M/PIX")) return get_double(v);
    if (equals(u, "KM/PIX")) return get_double(v) * 1000.0;
    if (equals(u, "M/PIXEL")) return get_double(v);
    if (equals(u, "KM/PIXEL")) return get_double(v) * 1000.0;
    return get_double(v);
}

canonical_original_code:
static double get_scale(char *v, char *u)
{
    if (equals(u, "M/PIX")) return get_double(v);
    if (equals(u, "KM/PIX")) return get_double(v) * 1000.0;
    if (equals(u, "M/PIXEL")) return get_double(v);
    if (equals(u, "KM/PIXEL")) return get_double(v) * 1000.0;
    return get_double(v);
}

variable_types:
u
char *


start

decompiled_code:
// positive sp value has been detected, the output may be wrong!
void __fastcall __noreturn start(__int64 a1, __int64 a2, void (*a3)(void))
{
__int64 v3; // rax
int v4; // esi
__int64 v5; // [rsp-8h] [rbp-8h] BYREF
char *retaddr; // [rsp+0h] [rbp+0h] BYREF

v4 = v5;
v5 = v3;
_libc_start_main(
(int (__fastcall *)(int, char **, char **))main,
v4,
&retaddr,
_libc_csu_init,
_libc_csu_fini,
a3,
&v5);
__halt();
}

canonical_decompiled_code:
void __fastcall __noreturn func1(__int64 a1, __int64 a2, void (*a3)(void))
{
__int64 v3; // rax
int v4; // esi
__int64 v5; // [rsp-8h] [rbp-8h] BYREF
char *retaddr; // [rsp+0h] [rbp+0h] BYREF

v4 = v5;
v5 = v3;
_libc_start_main(
(int (__fastcall *)(int, char **, char **))main,
v4,
&retaddr,
_libc_csu_init,
_libc_csu_fini,
a3,
&v5);
__halt();
}

original_code:
static int start(int argc, char **argv)
{
    if (data_init(argc, argv))
    {
        glDisable(0x0B50);
        glDisable(0x0B71);
        glEnable(0x0DE1);
        glEnable(0x0BE2);
        glPixelStorei(0x0CF5, 1);
        glBlendFunc(0x0302, 0x0303);
        prog_color = prog_init(vert_color, frag_color);
        cmap_color = cmap_init(prog_color);
        __glewUseProgram(0);
        jump(0);
        return 1;
    }
    return 0;
}

variable_types: argc int

variable_types:
argv
char **


setexe

decompiled_code:
void __fastcall setexe(__int64 a1)
{
executable = a1;
}

canonical_decompiled_code:
void __fastcall func7(__int64 a1)
{
executable = a1;
}

original_code:
void setexe(const char *str)
{
    executable = str;
}

canonical_original_code:
void setexe(char *str)
{
    executable = str;
}

variable_types:
str
char *


printerr

decompiled_code:
int printerr(const char *a1, unsigned int a2, int a3, const char *a4, ...)
{
char *v6; // rax
gcc_va_list arg; // [rsp+8h] [rbp-E0h] BYREF

va_start(arg, a4);
if ( executable )
fprintf(stderr, "%s (%s:%d) : ", (const char *)executable, a1, a2);
else
fprintf(stderr, "(%s:%d) : ", a1, a2);
if ( a4 )
vfprintf(stderr, a4, arg);
if ( !a3 )
return fputc(10, stderr);
v6 = strerror(a3);
return fprintf(stderr, " : %s\n", v6);
}

canonical_decompiled_code:
int func8(const char *a1, unsigned int a2, int a3, const char *a4, ...)
{
char *v6; // rax
gcc_va_list arg; // [rsp+8h] [rbp-E0h] BYREF

va_start(arg, a4);
if ( executable )
fprintf(stderr, "%s (%s:%d) : ", (const char *)executable, a1, a2);
else
fprintf(stderr, "(%s:%d) : ", a1, a2);
if ( a4 )
vfprintf(stderr, a4, arg);
if ( !a3 )
return fputc(10, stderr);
v6 = strerror(a3);
return fprintf(stderr, " : %s\n", v6);
}

original_code:
void printerr(const char *file, int line, int err, const char *fmt, ...)
{
    va_list ap;
    __builtin_va_start(ap,fmt);
    {
        if (executable)
            fprintf(stderr, "%s (%s:%d) : ", executable, file, line);
        else
            fprintf(stderr, "(%s:%d) : ", file, line);
        if (fmt)
           vfprintf(stderr, fmt, ap);
        if (err)
            fprintf(stderr, " : %s\n", strerror(err));
        else
            fprintf(stderr, "\n");
    }
    __builtin_va_end(ap);
}

canonical_original_code:
void printerr(char *file, int line, int err, char *fmt, ...)
{
    __builtin_va_list ap;
    __builtin_va_start(ap,fmt);
    {
        if (executable)
            fprintf(stderr, "%s (%s:%d) : ", executable, file, line);
        else
            fprintf(stderr, "(%s:%d) : ", file, line);
        if (fmt)
           vfprintf(stderr, fmt, ap);
        if (err)
            fprintf(stderr, " : %s\n", strerror(err));
        else
            fprintf(stderr, "\n");
    }
    __builtin_va_end(ap);
}

variable_types:
file
char *

variable_types: line int

variable_types: err int

variable_types:
fmt
char *


usage

decompiled_code:
__int64 __fastcall usage(const char *a1)
{
fprintf(stderr, "%s [-j n] [-z n] <src.tif> <dst.tif>\n", a1);
return 0xFFFFFFFFLL;
}

canonical_decompiled_code:
__int64 __fastcall func10(const char *a1)
{
fprintf(stderr, "%s [-j n] [-z n] <src.tif> <dst.tif>\n", a1);
return 0xFFFFFFFFLL;
}

original_code:
static int usage(const char *exe)
{
    fprintf(stderr, "%s [-j n] [-z n] <src.tif> <dst.tif>\n", exe);
    return -1;
}

canonical_original_code:
static int usage(char *exe)
{
    fprintf(stderr, "%s [-j n] [-z n] <src.tif> <dst.tif>\n", exe);
    return -1;
}

variable_types:
exe
char *


lerp

decompiled_code:
double __fastcall lerp(double a1, double a2, double a3)
{
return (1.0 - a3) * a1 + a3 * a2;
}

canonical_decompiled_code:
double __fastcall func0(double a1, double a2, double a3)
{
return (1.0 - a3) * a1 + a3 * a2;
}

original_code:
static double lerp(double a, double b, double t)
{
    return b * t + a * (1.0 - t);
}

variable_types: a double

variable_types: b double

variable_types: t double


rectify

variable_types:
o
char *

variable_types: n int

variable_types:
N
float *

variable_types:
E
double *

variable_types:
L
double *

variable_types:
P
double *

variable_types: struct img { void *p; unsigned long n; int w; int h; int c; int b; int g; int o; int d; void *q; float norm0; float norm1; double maximum_latitude; double minimum_latitude; double center_latitude; double easternmost_longitude; double westernmost_longitude; double center_longitude; double line_projection_offset; double sample_projection_offset; double map_resolution; double map_scale; double a_axis_radius; float scaling_factor; float offset; double latc; double lonc; int (*project)(struct img *, double *, double, double, double *); } *

variable_types:
e
char *

variable_types:
out
char [256]

variable_types: i int

variable_types:
in
char *


accumulate

decompiled_code:
__int64 __fastcall accumulate(__int64 a1, float *a2, int a3, double a4, double a5)
{
__int64 result; // rax
double v7; // [rsp+8h] [rbp-70h]
double v8; // [rsp+10h] [rbp-68h]
double cosx; // [rsp+20h] [rbp-58h] BYREF
double sinx; // [rsp+28h] [rbp-50h] BYREF
int v11[4]; // [rsp+30h] [rbp-48h] BYREF
__int64 v12[7]; // [rsp+40h] [rbp-38h] BYREF

sincos(a4, &sinx, &cosx);
v8 = cosx;
v7 = sinx;
sincos(a5, &sinx, &cosx);
*(double *)&v12[1] = v7;
*(double *)v12 = sinx * v8;
*(double *)&v12[2] = v8 * cosx;
result = img_sample(a1, v12, v11);
if ( (_DWORD)result )
{
if ( a3 != 3 )
{
if ( a3 <= 3 )
{
if ( a3 == 1 )
{
LABEL_8:
*a2 = *a2 + *(float *)v11;
return 1LL;
}
if ( a3 != 2 )
return 1LL;
LABEL_7:
a2[1] = a2[1] + *(float *)&v11[1];
goto LABEL_8;
}
result = 1LL;
if ( a3 != 4 )
return result;
a2[3] = a2[3] + *(float *)&v11[3];
}
a2[2] = a2[2] + *(float *)&v11[2];
goto LABEL_7;
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func1(__int64 a1, float *a2, int a3, double a4, double a5)
{
__int64 result; // rax
double v7; // [rsp+8h] [rbp-70h]
double v8; // [rsp+10h] [rbp-68h]
double cosx; // [rsp+20h] [rbp-58h] BYREF
double sinx; // [rsp+28h] [rbp-50h] BYREF
int v11[4]; // [rsp+30h] [rbp-48h] BYREF
__int64 v12[7]; // [rsp+40h] [rbp-38h] BYREF

sincos(a4, &sinx, &cosx);
v8 = cosx;
v7 = sinx;
sincos(a5, &sinx, &cosx);
*(double *)&v12[1] = v7;
*(double *)v12 = sinx * v8;
*(double *)&v12[2] = v8 * cosx;
result = img_sample(a1, v12, v11);
if ( (_DWORD)result )
{
if ( a3 != 3 )
{
if ( a3 <= 3 )
{
if ( a3 == 1 )
{
LABEL_8:
*a2 = *a2 + *(float *)v11;
return 1LL;
}
if ( a3 != 2 )
return 1LL;
LABEL_7:
a2[1] = a2[1] + *(float *)&v11[1];
goto LABEL_8;
}
result = 1LL;
if ( a3 != 4 )
return result;
a2[3] = a2[3] + *(float *)&v11[3];
}
a2[2] = a2[2] + *(float *)&v11[2];
goto LABEL_7;
}
return result;
}

original_code:
static int accumulate(img *p, double lat, double lon, float *b, int c)
{
    double v[3];
    float t[4];
    v[0] = sin(lon) * cos(lat);
    v[1] = sin(lat);
    v[2] = cos(lon) * cos(lat);
    if (img_sample(p, v, t))
    {
        switch (c)
        {
            case 4: b[3] += t[3];
            case 3: b[2] += t[2];
            case 2: b[1] += t[1];
            case 1: b[0] += t[0];
        }
        return 1;
    }
    return 0;
}

canonical_original_code:
static int accumulate(struct img *p, double lat, double lon, float *b, int c)
{
    double v[3];
    float t[4];
    v[0] = sin(lon) * cos(lat);
    v[1] = sin(lat);
    v[2] = cos(lon) * cos(lat);
    if (img_sample(p, v, t))
    {
        switch (c)
        {
            case 4: b[3] += t[3];
            case 3: b[2] += t[2];
            case 2: b[1] += t[1];
            case 1: b[0] += t[0];
        }
        return 1;
    }
    return 0;
}

variable_types: lat double

variable_types: lon double

variable_types:
b
float *

variable_types: c int

variable_types:
v
double [3]

variable_types:
t
float [4]


extrema

decompiled_code:
__int64 __fastcall extrema(int a1, _QWORD *a2)
{
_QWORD *v2; // r13
int *v3; // rbx
__int64 v4; // rbp
unsigned __int64 v5; // rbp
unsigned __int64 v6; // r12
float v7; // xmm1_4
float v8; // xmm0_4
unsigned __int64 v9; // r15
int v10; // eax
double v11; // xmm1_8
double v12; // xmm0_8
__int64 v14; // [rsp+8h] [rbp-50h]
float v15; // [rsp+10h] [rbp-48h] BYREF
float v16; // [rsp+14h] [rbp-44h]
float v17; // [rsp+18h] [rbp-40h]
float v18; // [rsp+1Ch] [rbp-3Ch]

if ( a1 > 0 )
{
v2 = a2;
v3 = 0LL;
v14 = (__int64)&a2[(unsigned int)(a1 - 1) + 1];
while ( 1 )
{
v4 = *v2;
if ( !(unsigned int)extcmp(*v2, ".jpg") )
break;
if ( (unsigned int)extcmp(v4, ".png") )
{
if ( (unsigned int)extcmp(v4, ".tif") )
{
if ( !(unsigned int)extcmp(v4, ".img") || !(unsigned int)extcmp(v4, ".lbl") )
v3 = (int *)pds_load(v4);
}
else
{
v3 = (int *)tif_load(v4);
}
LABEL_4:
if ( v3 )
goto LABEL_9;
LABEL_5:
if ( (_QWORD *)v14 == ++v2 )
return 0LL;
}
else
{
v3 = (int *)png_load(v4);
if ( !v3 )
goto LABEL_5;
LABEL_9:
v5 = v3[4];
v6 = v5 * v3[5];
if ( v6 )
{
v7 = *(float *)&LC0;
v8 = *(float *)&LC1;
v9 = 0LL;
while ( 1 )
{
if ( !(unsigned int)img_pixel(v3, (unsigned int)(v9 / v5), v9 % v5, &v15) )
goto LABEL_15;
v10 = v3[6];
if ( v10 == 3 )
goto LABEL_21;
if ( v10 > 3 )
break;
if ( v10 == 1 )
goto LABEL_14;
if ( v10 == 2 )
goto LABEL_13;
LABEL_15:
v9 += v6 >> 20;
if ( v9 >= v6 )
{
v11 = v7;
v12 = v8;
goto LABEL_23;
}
}
if ( v10 != 4 )
goto LABEL_15;
v8 = fminf(v8, v18);
v7 = fmaxf(v7, v18);
LABEL_21:
v8 = fminf(v8, v17);
v7 = fmaxf(v7, v17);
LABEL_13:
v8 = fminf(v8, v16);
v7 = fmaxf(v7, v16);
LABEL_14:
v8 = fminf(v8, v15);
v7 = fmaxf(v7, v15);
goto LABEL_15;
}
v11 = *(double *)&LC3;
v12 = *(double *)&LC2;
LABEL_23:
++v2;
printf("%f\t%f\n", v12, v11);
img_close(v3);
if ( (_QWORD *)v14 == v2 )
return 0LL;
}
}
v3 = (int *)jpg_load(v4);
goto LABEL_4;
}
return 0LL;
}

canonical_decompiled_code:
__int64 __fastcall func0(int a1, _QWORD *a2)
{
_QWORD *v2; // r13
int *v3; // rbx
__int64 v4; // rbp
unsigned __int64 v5; // rbp
unsigned __int64 v6; // r12
float v7; // xmm1_4
float v8; // xmm0_4
unsigned __int64 v9; // r15
int v10; // eax
double v11; // xmm1_8
double v12; // xmm0_8
__int64 v14; // [rsp+8h] [rbp-50h]
float v15; // [rsp+10h] [rbp-48h] BYREF
float v16; // [rsp+14h] [rbp-44h]
float v17; // [rsp+18h] [rbp-40h]
float v18; // [rsp+1Ch] [rbp-3Ch]

if ( a1 > 0 )
{
v2 = a2;
v3 = 0LL;
v14 = (__int64)&a2[(unsigned int)(a1 - 1) + 1];
while ( 1 )
{
v4 = *v2;
if ( !(unsigned int)extcmp(*v2, ".jpg") )
break;
if ( (unsigned int)extcmp(v4, ".png") )
{
if ( (unsigned int)extcmp(v4, ".tif") )
{
if ( !(unsigned int)extcmp(v4, ".img") || !(unsigned int)extcmp(v4, ".lbl") )
v3 = (int *)pds_load(v4);
}
else
{
v3 = (int *)tif_load(v4);
}
LABEL_4:
if ( v3 )
goto LABEL_9;
LABEL_5:
if ( (_QWORD *)v14 == ++v2 )
return 0LL;
}
else
{
v3 = (int *)png_load(v4);
if ( !v3 )
goto LABEL_5;
LABEL_9:
v5 = v3[4];
v6 = v5 * v3[5];
if ( v6 )
{
v7 = *(float *)&LC0;
v8 = *(float *)&LC1;
v9 = 0LL;
while ( 1 )
{
if ( !(unsigned int)img_pixel(v3, (unsigned int)(v9 / v5), v9 % v5, &v15) )
goto LABEL_15;
v10 = v3[6];
if ( v10 == 3 )
goto LABEL_21;
if ( v10 > 3 )
break;
if ( v10 == 1 )
goto LABEL_14;
if ( v10 == 2 )
goto LABEL_13;
LABEL_15:
v9 += v6 >> 20;
if ( v9 >= v6 )
{
v11 = v7;
v12 = v8;
goto LABEL_23;
}
}
if ( v10 != 4 )
goto LABEL_15;
v8 = fminf(v8, v18);
v7 = fmaxf(v7, v18);
LABEL_21:
v8 = fminf(v8, v17);
v7 = fmaxf(v7, v17);
LABEL_13:
v8 = fminf(v8, v16);
v7 = fmaxf(v7, v16);
LABEL_14:
v8 = fminf(v8, v15);
v7 = fmaxf(v7, v15);
goto LABEL_15;
}
v11 = *(double *)&LC3;
v12 = *(double *)&LC2;
LABEL_23:
++v2;
printf("%f\t%f\n", v12, v11);
img_close(v3);
if ( (_QWORD *)v14 == v2 )
return 0LL;
}
}
v3 = (int *)jpg_load(v4);
goto LABEL_4;
}
return 0LL;
}

variable_types: argc int

variable_types:
argv
char **

variable_types:
w
unsigned long

variable_types:
h
unsigned long

variable_types:
n
unsigned long

variable_types: a float

variable_types: z float

variable_types:
c
float [4]

variable_types:
s
unsigned long


original_code:
static inline long long log2i(long long n)
{
    unsigned long long v = (unsigned long long) n;
    unsigned long long r;
    unsigned long long s;
    r = (v > 0xFFFFFFFFULL) << 5; v >>= r;
    s = (v > 0xFFFFULL ) << 4; v >>= s; r |= s;
    s = (v > 0xFFULL ) << 3; v >>= s; r |= s;
    s = (v > 0xFULL ) << 2; v >>= s; r |= s;
    s = (v > 0x3ULL ) << 1; v >>= s; r |= s;
    return (long long) (r | (v >> 1));
}

variable_types:
n
long long

variable_types:
v
unsigned long long

variable_types:
r
unsigned long long

variable_types:
s
unsigned long long


decompiled_code:
__int64 __fastcall scm_page_count(char a1)
{
return (1LL << (2 * a1 + 3)) - 2;
}

original_code:
static inline long long scm_page_count(long long d)
{
    return (1LL << (2 * d + 3)) - 2;
}

variable_types:
d
long long


decompiled_code:
__int64 __fastcall scm_page_level(__int64 a1)
{
return (__int64)(log2i(a1 + 2) - 1) / 2;
}

original_code:
static inline long long scm_page_level(long long i)
{
    return (log2i(i + 2) - 1) / 2;
}

variable_types:
i
long long


original_code:
static inline long long scm_page_root(long long i)
{
    long long n = 1LL << (2 * scm_page_level(i));
    return (i - 2 * (n - 1)) / n;
}


original_code:
static inline long long scm_page_rank(long long i)
{
    long long n = 1LL << (2 * scm_page_level(i));
    return (i - 2 * (n - 1)) % n;
}


decompiled_code:
__int64 __fastcall scm_page_row(__int64 a1)
{
__int64 v1; // rsi
__int64 v2; // r8

v1 = scm_page_rank(a1);
return v1 / (1LL << scm_page_level(v2));
}

original_code:
static inline long long scm_page_row(long long i)
{
    return scm_page_rank(i) / (1LL << scm_page_level(i));
}


decompiled_code:
__int64 __fastcall scm_page_col(__int64 a1)
{
__int64 v1; // rsi
__int64 v2; // r8

v1 = scm_page_rank(a1);
return v1 % (1LL << scm_page_level(v2));
}

original_code:
static inline long long scm_page_col(long long i)
{
    return scm_page_rank(i) % (1LL << scm_page_level(i));
}


original_code:
static inline long long scm_page_index(long long a, long long l,
                                       long long r, long long c)
{
    return scm_page_count(l - 1) + (a << (2 * l)) + (r << l) + c;
}

variable_types:
a
long long

variable_types:
l
long long

variable_types:
r
long long

variable_types:
c
long long


decompiled_code:
__int64 __fastcall scm_page_child(__int64 a1)
{
__int64 v1; // r9
__int64 v2; // r9
__int64 v3; // r9
__int64 v4; // rax
char v5; // r8

scm_page_col(a1);
scm_page_row(v1);
scm_page_level(v2);
v4 = scm_page_root(v3);
return scm_page_index(v4, v5 + 1);
}

original_code:
static inline long long scm_page_child(long long i, long long k)
{
    return scm_page_index(scm_page_root(i), scm_page_level(i) + 1,
                                            scm_page_row (i) * 2 + k / 2,
                                            scm_page_col (i) * 2 + k % 2);
}

variable_types:
k
long long


isleaf

decompiled_code:
__int64 __fastcall isleaf(__int64 a1, __int64 a2)
{
__int64 v3; // rbp
__int64 v4; // r12
__int64 v5; // rax
__int64 v6; // rsi

if ( ((__int64 (*)(void))scm_get_offset)() )
{
v3 = 0LL;
v4 = scm_get_index(a1, a2);
while ( 1 )
{
v5 = scm_page_child(v4);
v6 = scm_search(a1, v5);
if ( v6 != -1 && scm_get_offset(a1, v6) > 0 )
break;
if ( ++v3 == 4 )
return 1LL;
}
}
return 0LL;
}

canonical_decompiled_code:
__int64 __fastcall func9(__int64 a1, __int64 a2)
{
__int64 v3; // rbp
__int64 v4; // r12
__int64 v5; // rax
__int64 v6; // rsi

if ( ((__int64 (*)(void))scm_get_offset)() )
{
v3 = 0LL;
v4 = scm_get_index(a1, a2);
while ( 1 )
{
v5 = func8(v4);
v6 = scm_search(a1, v5);
if ( v6 != -1 && scm_get_offset(a1, v6) > 0 )
break;
if ( ++v3 == 4 )
return 1LL;
}
}
return 0LL;
}

original_code:
static _Bool isleaf(long long x, long long c, const long long *v)
{
    if (llsearch(scm_page_child(x, 0), c, v) >= 0) return 0;
    else if (llsearch(scm_page_child(x, 1), c, v) >= 0) return 0;
    else if (llsearch(scm_page_child(x, 2), c, v) >= 0) return 0;
    else if (llsearch(scm_page_child(x, 3), c, v) >= 0) return 0;
    else return 1;
}

canonical_original_code:
static _Bool isleaf(long long x, long long c, long long *v)
{
    if (llsearch(scm_page_child(x, 0), c, v) >= 0) return 0;
    else if (llsearch(scm_page_child(x, 1), c, v) >= 0) return 0;
    else if (llsearch(scm_page_child(x, 2), c, v) >= 0) return 0;
    else if (llsearch(scm_page_child(x, 3), c, v) >= 0) return 0;
    else return 1;
}

variable_types:
x
long long

variable_types:
v
long long *


canonical_original_code:
static inline long long log2i(long long n)
{
    unsigned long long v = (unsigned long long) n;
    unsigned long long r;
    unsigned long long s;
    r = (v > 0xFFFFFFFFULL) << 5; v >>= r;
    s = (v > 0xFFFFULL ) << 4; v >>= s; r |= s;
    s = (v > 0xFFULL ) << 3; v >>= s; r |= s;
    s = (v > 0xFULL ) << 2; v >>= s; r |= s;
    s = (v > 0x3ULL ) << 1; v >>= s; r |= s;
    return (long long) (r | (v >> 1));
}


canonical_original_code:
static inline long long scm_page_count(long long d)
{
    return (1LL << (2 * d + 3)) - 2;
}


canonical_original_code:
static inline long long scm_page_level(long long i)
{
    return (log2i(i + 2) - 1) / 2;
}


canonical_original_code:
static inline long long scm_page_root(long long i)
{
    long long n = 1LL << (2 * scm_page_level(i));
    return (i - 2 * (n - 1)) / n;
}


canonical_original_code:
static inline long long scm_page_rank(long long i)
{
    long long n = 1LL << (2 * scm_page_level(i));
    return (i - 2 * (n - 1)) % n;
}


canonical_original_code:
static inline long long scm_page_row(long long i)
{
    return scm_page_rank(i) / (1LL << scm_page_level(i));
}


canonical_original_code:
static inline long long scm_page_col(long long i)
{
    return scm_page_rank(i) % (1LL << scm_page_level(i));
}


canonical_original_code:
static inline long long scm_page_index(long long a, long long l, long long r, long long c)
{
    return scm_page_count(l - 1) + (a << (2 * l)) + (r << l) + c;
}


canonical_original_code:
static inline long long scm_page_child(long long i, long long k)
{
    return scm_page_index(scm_page_root(i), scm_page_level(i) + 1,
                                            scm_page_row (i) * 2 + k / 2,
                                            scm_page_col (i) * 2 + k % 2);
}


facenorm

variable_types:
a
double *

variable_types:
b
double *

variable_types:
c
double *

variable_types:
n
double *

variable_types:
u
double [3]

variable_types:
v
double [3]


sampnorm

original_code:
static void sampnorm(int f, int i, int j, int n, int c,
                     long u, long v, long w, const float *r, const float *p, float *q)
{
    const float dr = r[1] - r[0];
    double vn[3];
    double vs[3];
    double ve[3];
    double vw[3];
    double vc[3];
    scm_get_sample_center(f, n * u + i, n * v + j, n * w, vc);
    scm_get_sample_center(f, n * u + i - 1, n * v + j, n * w, vn);
    scm_get_sample_center(f, n * u + i + 1, n * v + j, n * w, vs);
    scm_get_sample_center(f, n * u + i, n * v + j - 1, n * w, ve);
    scm_get_sample_center(f, n * u + i, n * v + j + 1, n * w, vw);
    double rc = p[((n + 2) * (i + 1) + (j + 1)) * c] * dr + r[0];
    double rn = p[((n + 2) * (i + 0) + (j + 1)) * c] * dr + r[0];
    double rs = p[((n + 2) * (i + 2) + (j + 1)) * c] * dr + r[0];
    double re = p[((n + 2) * (i + 1) + (j + 0)) * c] * dr + r[0];
    double rw = p[((n + 2) * (i + 1) + (j + 2)) * c] * dr + r[0];
    vn[0] *= rn; vn[1] *= rn; vn[2] *= rn;
    vs[0] *= rs; vs[1] *= rs; vs[2] *= rs;
    ve[0] *= re; ve[1] *= re; ve[2] *= re;
    vw[0] *= rw; vw[1] *= rw; vw[2] *= rw;
    vc[0] *= rc; vc[1] *= rc; vc[2] *= rc;
    double na[3];
    double nb[3];
    double nc[3];
    double nd[3];
    double nn[3];
    facenorm(vc, vn, ve, na);
    facenorm(vc, ve, vs, nb);
    facenorm(vc, vs, vw, nc);
    facenorm(vc, vw, vn, nd);
    nn[0] = na[0] + nb[0] + nc[0] + nd[0];
    nn[1] = na[1] + nb[1] + nc[1] + nd[1];
    nn[2] = na[2] + nb[2] + nc[2] + nd[2];
    normalize(nn);
    float *o = q + 3 * ((n + 2) * (i + 1) + (j + 1));
    o[0] = ((float) nn[0] + 1.f) / 2.f;
    o[1] = ((float) nn[1] + 1.f) / 2.f;
    o[2] = ((float) nn[2] + 1.f) / 2.f;
}

canonical_original_code:
static void sampnorm(int f, int i, int j, int n, int c, long u, long v, long w, float *r, float *p, float *q)
{
    float dr = r[1] - r[0];
    double vn[3];
    double vs[3];
    double ve[3];
    double vw[3];
    double vc[3];
    scm_get_sample_center(f, n * u + i, n * v + j, n * w, vc);
    scm_get_sample_center(f, n * u + i - 1, n * v + j, n * w, vn);
    scm_get_sample_center(f, n * u + i + 1, n * v + j, n * w, vs);
    scm_get_sample_center(f, n * u + i, n * v + j - 1, n * w, ve);
    scm_get_sample_center(f, n * u + i, n * v + j + 1, n * w, vw);
    double rc = p[((n + 2) * (i + 1) + (j + 1)) * c] * dr + r[0];
    double rn = p[((n + 2) * (i + 0) + (j + 1)) * c] * dr + r[0];
    double rs = p[((n + 2) * (i + 2) + (j + 1)) * c] * dr + r[0];
    double re = p[((n + 2) * (i + 1) + (j + 0)) * c] * dr + r[0];
    double rw = p[((n + 2) * (i + 1) + (j + 2)) * c] * dr + r[0];
    vn[0] *= rn; vn[1] *= rn; vn[2] *= rn;
    vs[0] *= rs; vs[1] *= rs; vs[2] *= rs;
    ve[0] *= re; ve[1] *= re; ve[2] *= re;
    vw[0] *= rw; vw[1] *= rw; vw[2] *= rw;
    vc[0] *= rc; vc[1] *= rc; vc[2] *= rc;
    double na[3];
    double nb[3];
    double nc[3];
    double nd[3];
    double nn[3];
    facenorm(vc, vn, ve, na);
    facenorm(vc, ve, vs, nb);
    facenorm(vc, vs, vw, nc);
    facenorm(vc, vw, vn, nd);
    nn[0] = na[0] + nb[0] + nc[0] + nd[0];
    nn[1] = na[1] + nb[1] + nc[1] + nd[1];
    nn[2] = na[2] + nb[2] + nc[2] + nd[2];
    normalize(nn);
    float *o = q + 3 * ((n + 2) * (i + 1) + (j + 1));
    o[0] = ((float) nn[0] + 1.f) / 2.f;
    o[1] = ((float) nn[1] + 1.f) / 2.f;
    o[2] = ((float) nn[2] + 1.f) / 2.f;
}

variable_types: f int

variable_types: i int

variable_types: j int

variable_types: n int

variable_types: c int

variable_types: u long

variable_types: v long

variable_types: w long

variable_types:
r
float *

variable_types:
p
float *

variable_types:
q
float *

variable_types: dr float

variable_types:
vn
double [3]

variable_types:
vs
double [3]

variable_types:
ve
double [3]

variable_types:
vw
double [3]

variable_types:
vc
double [3]

variable_types: rc double

variable_types: rn double

variable_types: rs double

variable_types: re double

variable_types: rw double

variable_types:
nb
double [3]

variable_types:
nc
double [3]

variable_types:
nd
double [3]

variable_types:
nn
double [3]

variable_types:
o
float *


divide

original_code:
static void divide(float *p, float d, int c)
{
    switch (c)
    {
        case 4: p[3] /= d;
        case 3: p[2] /= d;
        case 2: p[1] /= d;
        case 1: p[0] /= d;
    }
}

variable_types:
p
float *

variable_types: d float

variable_types: c int


ExeV

repo: rmblair/tecoc

decompiled_code:
__int64 ExeV()
{
__int64 v0; // rbp
__int64 v1; // rax
__int64 v2; // rbp
__int64 v3; // rax
__int64 result; // rax
__int64 v5; // rbp
__int64 v6; // rax
__int64 v7; // rbp
__int64 v8; // rax

if ( EStTop == EStBot )
{
NArgmt = 1LL;
goto LABEL_3;
}
UMinus();
result = GetNmA();
if ( (_DWORD)result != -1 )
{
LABEL_3:
if ( (CmdMod & 8) != 0 )
{
if ( 1LL - MArgmt > 0 )
{
LABEL_5:
v0 = GapEnd;
v1 = Ln2Chr();
TypBuf(GapEnd + 1LL, v0 + v1 + 1);
if ( NArgmt > 0 )
{
LABEL_6:
v2 = GapEnd;
v3 = Ln2Chr();
TypBuf(GapEnd + 1LL, v2 + v3 + 1);
LABEL_7:
result = 0LL;
CmdMod = 0;
return result;
}
LABEL_10:
v7 = GapBeg;
v8 = Ln2Chr();
TypBuf(v7 + v8, v7);
goto LABEL_7;
}
}
else if ( 1LL - NArgmt > 0 )
{
goto LABEL_5;
}
v5 = GapBeg;
v6 = Ln2Chr();
TypBuf(v5 + v6, v5);
if ( NArgmt > 0 )
goto LABEL_6;
goto LABEL_10;
}
return result;
}

canonical_decompiled_code:
__int64 func0()
{
__int64 v0; // rbp
__int64 v1; // rax
__int64 v2; // rbp
__int64 v3; // rax
__int64 result; // rax
__int64 v5; // rbp
__int64 v6; // rax
__int64 v7; // rbp
__int64 v8; // rax

if ( EStTop == EStBot )
{
NArgmt = 1LL;
goto LABEL_3;
}
UMinus();
result = GetNmA();
if ( (_DWORD)result != -1 )
{
LABEL_3:
if ( (CmdMod & 8) != 0 )
{
if ( 1LL - MArgmt > 0 )
{
LABEL_5:
v0 = GapEnd;
v1 = Ln2Chr();
TypBuf(GapEnd + 1LL, v0 + v1 + 1);
if ( NArgmt > 0 )
{
LABEL_6:
v2 = GapEnd;
v3 = Ln2Chr();
TypBuf(GapEnd + 1LL, v2 + v3 + 1);
LABEL_7:
result = 0LL;
CmdMod = 0;
return result;
}
LABEL_10:
v7 = GapBeg;
v8 = Ln2Chr();
TypBuf(v7 + v8, v7);
goto LABEL_7;
}
}
else if ( 1LL - NArgmt > 0 )
{
goto LABEL_5;
}
v5 = GapBeg;
v6 = Ln2Chr();
TypBuf(v5 + v6, v5);
if ( NArgmt > 0 )
goto LABEL_6;
goto LABEL_10;
}
return result;
}

original_code:
DEFAULT ExeV()
{
 LONG firstarg;
 ;
 if (EStTop == EStBot) {
  NArgmt = 1;
 } else {
  UMinus();
  if (GetNmA() == (-1)) {
   ;
   return (-1);
  }
 }
 firstarg = 1 - ((CmdMod & '\10') ? MArgmt : NArgmt);
 if (firstarg <= 0) {
  TypBuf(GapBeg+Ln2Chr(firstarg), GapBeg);
 } else {
  TypBuf(GapEnd+1, GapEnd+Ln2Chr(firstarg)+1);
 }
 if (NArgmt <= 0) {
  TypBuf(GapBeg+Ln2Chr(NArgmt), GapBeg);
 } else {
  TypBuf(GapEnd+1, GapEnd+Ln2Chr(NArgmt)+1);
 }
 CmdMod = '\0';
 ;
 return 0;
}

canonical_original_code:
int ExeV()
{
 long firstarg;
 ;
 if (EStTop == EStBot) {
  NArgmt = 1;
 } else {
  UMinus();
  if (GetNmA() == (-1)) {
   ;
   return (-1);
  }
 }
 firstarg = 1 - ((CmdMod & '\10') ? MArgmt : NArgmt);
 if (firstarg <= 0) {
  TypBuf(GapBeg+Ln2Chr(firstarg), GapBeg);
 } else {
  TypBuf(GapEnd+1, GapEnd+Ln2Chr(firstarg)+1);
 }
 if (NArgmt <= 0) {
  TypBuf(GapBeg+Ln2Chr(NArgmt), GapBeg);
 } else {
  TypBuf(GapEnd+1, GapEnd+Ln2Chr(NArgmt)+1);
 }
 CmdMod = '\0';
 ;
 return 0;
}

variable_types: firstarg long


SkpSkp

decompiled_code:
__int64 SkpSkp()
{
CmdMod = 0;
return 0LL;
}

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

original_code:
static DEFAULT SkpSkp()
{
 CmdMod = '\0';
 return 0;
}

canonical_original_code:
static int SkpSkp()
{
 CmdMod = '\0';
 return 0;
}


SkpOne

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

if ( CBfPtr == CStEnd )
{
if ( MStTop < 0 )
{
ErrUTC();
result = 0xFFFFFFFFLL;
}
else
{
result = 0LL;
}
}
else
{
++CBfPtr;
result = 0LL;
}
return result;
}

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

if ( CBfPtr == CStEnd )
{
if ( MStTop < 0 )
{
ErrUTC();
result = 0xFFFFFFFFLL;
}
else
{
result = 0LL;
}
}
else
{
++CBfPtr;
result = 0LL;
}
return result;
}

original_code:
static DEFAULT SkpOne()
{
 if (CBfPtr == CStEnd) {
  if (MStTop < 0) {
   ErrUTC();
   ;
   return (-1);
  } else {
   ;
   return 0;
  }
 }
 ++CBfPtr;
 return 0;
}

canonical_original_code:
static int SkpOne()
{
 if (CBfPtr == CStEnd) {
  if (MStTop < 0) {
   ErrUTC();
   ;
   return (-1);
  } else {
   ;
   return 0;
  }
 }
 ++CBfPtr;
 return 0;
}


SkpCrt

decompiled_code:
__int64 SkpCrt()
{
__int64 v0; // rax
__int16 v1; // ax
__int16 v2; // ax
__int64 result; // rax

v0 = CBfPtr;
if ( CBfPtr == CStEnd )
{
if ( MStTop < 0 )
{
ErrUTC();
result = 0xFFFFFFFFLL;
}
else
{
result = 0LL;
}
}
else
{
++CBfPtr;
v1 = *(unsigned __int8 *)(v0 + 1);
if ( (unsigned __int8)(v1 - 65) <= 0x1Eu )
{
v2 = v1 - 65;
return FCAray_1[v2]();
}
if ( (*((_BYTE *)&ChrMsk + (unsigned __int8)v1) & 0x40) != 0 )
{
v2 = v1 - 97;
return FCAray_1[v2]();
}
ErrMsg(16LL);
result = 0xFFFFFFFFLL;
}
return result;
}

canonical_decompiled_code:
__int64 func2()
{
__int64 v0; // rax
__int16 v1; // ax
__int16 v2; // ax
__int64 result; // rax

v0 = CBfPtr;
if ( CBfPtr == CStEnd )
{
if ( MStTop < 0 )
{
ErrUTC();
result = 0xFFFFFFFFLL;
}
else
{
result = 0LL;
}
}
else
{
++CBfPtr;
v1 = *(unsigned __int8 *)(v0 + 1);
if ( (unsigned __int8)(v1 - 65) <= 0x1Eu )
{
v2 = v1 - 65;
return FCAray_1[v2]();
}
if ( (*((_BYTE *)&ChrMsk + (unsigned __int8)v1) & 0x40) != 0 )
{
v2 = v1 - 97;
return FCAray_1[v2]();
}
ErrMsg(16LL);
result = 0xFFFFFFFFLL;
}
return result;
}

original_code:
static DEFAULT SkpCrt()
{
 static DEFAULT (*FCAray[])(void) = {
        SkpCtA, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpArg, ExeNul, SkpSkp, SkpSkp,
        ExeNul, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpCtU, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpOne, SkpSkp
 };
 WORD CDummy;
 if (CBfPtr == CStEnd)
  if (MStTop < 0)
   {
   ErrUTC();
   return (-1);
   }
  else
   return 0;
 ++CBfPtr;
 if ((*CBfPtr >= 'A') && (*CBfPtr <= '_'))
  CDummy = *CBfPtr - 'A';
 else if ((ChrMsk[(*CBfPtr)] & '\100'))
  CDummy = *CBfPtr - 'a';
 else {
  ErrMsg(16);
  return (-1);
 }
 return (*FCAray[CDummy])();
}

canonical_original_code:
static int SkpCrt()
{
 static int (*FCAray[])() = {
        SkpCtA, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpArg, ExeNul, SkpSkp, SkpSkp,
        ExeNul, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpCtU, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpOne, SkpSkp
 };
 short CDummy;
 if (CBfPtr == CStEnd)
  if (MStTop < 0)
   {
   ErrUTC();
   return (-1);
   }
  else
   return 0;
 ++CBfPtr;
 if ((*CBfPtr >= 'A') && (*CBfPtr <= '_'))
  CDummy = *CBfPtr - 'A';
 else if ((ChrMsk[(*CBfPtr)] & '\100'))
  CDummy = *CBfPtr - 'a';
 else {
  ErrMsg(16);
  return (-1);
 }
 return (*FCAray[CDummy])();
}

variable_types:
FCAray
int (*[])()

variable_types: CDummy short


SkpDqu

decompiled_code:
__int64 SkpDqu()
{
__int64 v0; // rax
__int64 v1; // rcx
int v2; // eax
__int64 result; // rax

v0 = CBfPtr;
if ( CBfPtr == CStEnd )
{
if ( MStTop < 0 )
{
ErrUTC();
result = 0xFFFFFFFFLL;
}
else
{
result = 0LL;
}
}
else
{
++CBfPtr;
v1 = *(unsigned __int8 *)(v0 + 1);
v2 = *(unsigned __int8 *)(v0 + 1);
if ( (*((_BYTE *)&ChrMsk + v1) & 0x40) != 0 )
v2 = v1 - 32;
switch ( v2 )
{
case '<':
case '=':
case '>':
case 'A':
case 'C':
case 'D':
case 'E':
case 'F':
case 'G':
case 'L':
case 'N':
case 'R':
case 'S':
case 'T':
case 'U':
case 'V':
case 'W':
CmdMod = 0;
result = 0LL;
break;
default:
ErrMsg(11LL);
result = 0xFFFFFFFFLL;
break;
}
}
return result;
}

canonical_decompiled_code:
__int64 func3()
{
__int64 v0; // rax
__int64 v1; // rcx
int v2; // eax
__int64 result; // rax

v0 = CBfPtr;
if ( CBfPtr == CStEnd )
{
if ( MStTop < 0 )
{
ErrUTC();
result = 0xFFFFFFFFLL;
}
else
{
result = 0LL;
}
}
else
{
++CBfPtr;
v1 = *(unsigned __int8 *)(v0 + 1);
v2 = *(unsigned __int8 *)(v0 + 1);
if ( (*((_BYTE *)&ChrMsk + v1) & 0x40) != 0 )
v2 = v1 - 32;
switch ( v2 )
{
case '<':
case '=':
case '>':
case 'A':
case 'C':
case 'D':
case 'E':
case 'F':
case 'G':
case 'L':
case 'N':
case 'R':
case 'S':
case 'T':
case 'U':
case 'V':
case 'W':
CmdMod = 0;
result = 0LL;
break;
default:
ErrMsg(11LL);
result = 0xFFFFFFFFLL;
break;
}
}
return result;
}

original_code:
static DEFAULT SkpDqu()
{
 ;
 if (CBfPtr == CStEnd)
  if (MStTop < 0)
   {
   ErrUTC();
   return (-1);
   }
  else
   return 0;
 ++CBfPtr;
 switch (((ChrMsk[(*CBfPtr)] & '\100') ? (*CBfPtr)-' ' : (*CBfPtr) )) {
  case 'A':
  case 'C':
  case 'D':
  case 'E':
  case 'F':
  case 'U':
  case '=':
  case 'G':
  case '>':
  case 'L':
  case 'S':
  case 'T':
  case '<':
  case 'N':
  case 'R':
  case 'V':
  case 'W':
   break;
  default:
   ErrMsg(11);
   ;
   return (-1);
 }
 CmdMod = '\0';
 ;
 return 0;
}

canonical_original_code:
static int SkpDqu()
{
 ;
 if (CBfPtr == CStEnd)
  if (MStTop < 0)
   {
   ErrUTC();
   return (-1);
   }
  else
   return 0;
 ++CBfPtr;
 switch (((ChrMsk[(*CBfPtr)] & '\100') ? (*CBfPtr)-' ' : (*CBfPtr) )) {
  case 'A':
  case 'C':
  case 'D':
  case 'E':
  case 'F':
  case 'U':
  case '=':
  case 'G':
  case '>':
  case 'L':
  case 'S':
  case 'T':
  case '<':
  case 'N':
  case 'R':
  case 'V':
  case 'W':
   break;
  default:
   ErrMsg(11);
   ;
   return (-1);
 }
 CmdMod = '\0';
 ;
 return 0;
}


SkpDAr

decompiled_code:
__int64 SkpDAr()
{
int v0; // ebx
__int64 result; // rax

v0 = TraceM;
TraceM = 0;
result = FindES(27LL);
if ( (_DWORD)result == -1 )
{
TraceM = v0;
}
else
{
if ( (CmdMod & 1) != 0 )
--CBfPtr;
result = FindES(27LL);
TraceM = v0;
if ( (_DWORD)result != -1 )
result = 0LL;
}
return result;
}

canonical_decompiled_code:
__int64 func4()
{
int v0; // ebx
__int64 result; // rax

v0 = TraceM;
TraceM = 0;
result = FindES(27LL);
if ( (_DWORD)result == -1 )
{
TraceM = v0;
}
else
{
if ( (CmdMod & 1) != 0 )
--CBfPtr;
result = FindES(27LL);
TraceM = v0;
if ( (_DWORD)result != -1 )
result = 0LL;
}
return result;
}

original_code:
static DEFAULT SkpDAr()
{
 BOOLEAN TTrace;
 TTrace = TraceM;
 TraceM = 0;
 if (FindES('\033') == (-1))
  {
  TraceM = TTrace;
  return (-1);
  }
 if (CmdMod & '\1')
  --CBfPtr;
 if (FindES('\033') == (-1))
  {
  TraceM = TTrace;
  return (-1);
  }
 TraceM = TTrace;
 return 0;
}

canonical_original_code:
static int SkpDAr()
{
 int TTrace;
 TTrace = TraceM;
 TraceM = 0;
 if (FindES('\033') == (-1))
  {
  TraceM = TTrace;
  return (-1);
  }
 if (CmdMod & '\1')
  --CBfPtr;
 if (FindES('\033') == (-1))
  {
  TraceM = TTrace;
  return (-1);
  }
 TraceM = TTrace;
 return 0;
}

variable_types: TTrace int


SkpExc

decompiled_code:
__int64 SkpExc()
{
int v0; // ebx
__int64 result; // rax

v0 = TraceM;
TraceM = 0;
result = FindES(33LL);
TraceM = v0;
if ( (_DWORD)result != -1 )
{
CmdMod = 0;
result = 0LL;
}
return result;
}

canonical_decompiled_code:
__int64 func5()
{
int v0; // ebx
__int64 result; // rax

v0 = TraceM;
TraceM = 0;
result = FindES(33LL);
TraceM = v0;
if ( (_DWORD)result != -1 )
{
CmdMod = 0;
result = 0LL;
}
return result;
}

original_code:
static DEFAULT SkpExc()
{
 BOOLEAN TTrace;
 TTrace = TraceM;
 TraceM = 0;
 if (FindES('!') == (-1))
  {
  TraceM = TTrace;
  return (-1);
  }
 TraceM = TTrace;
 CmdMod = '\0';
 return 0;
}

canonical_original_code:
static int SkpExc()
{
 int TTrace;
 TTrace = TraceM;
 TraceM = 0;
 if (FindES('!') == (-1))
  {
  TraceM = TTrace;
  return (-1);
  }
 TraceM = TTrace;
 CmdMod = '\0';
 return 0;
}


SkpCtU

decompiled_code:
__int64 SkpCtU()
{
int v0; // ebx
__int64 result; // rax

if ( CBfPtr == CStEnd )
{
if ( MStTop < 0 )
{
ErrUTC();
result = 0xFFFFFFFFLL;
}
else
{
result = 0LL;
}
}
else
{
v0 = TraceM;
TraceM = 0;
++CBfPtr;
result = FindES(27LL);
TraceM = v0;
if ( (_DWORD)result != -1 )
{
CmdMod = 0;
result = 0LL;
}
}
return result;
}

canonical_decompiled_code:
__int64 func6()
{
int v0; // ebx
__int64 result; // rax

if ( CBfPtr == CStEnd )
{
if ( MStTop < 0 )
{
ErrUTC();
result = 0xFFFFFFFFLL;
}
else
{
result = 0LL;
}
}
else
{
v0 = TraceM;
TraceM = 0;
++CBfPtr;
result = FindES(27LL);
TraceM = v0;
if ( (_DWORD)result != -1 )
{
CmdMod = 0;
result = 0LL;
}
}
return result;
}

original_code:
static DEFAULT SkpCtU()
{
 BOOLEAN TTrace;
 if (CBfPtr == CStEnd)
  if (MStTop < 0)
   {
   ErrUTC();
   return (-1);
   }
  else
   return 0;
 ++CBfPtr;
 TTrace = TraceM;
 TraceM = 0;
 if (FindES('\033') == (-1))
  {
  TraceM = TTrace;
  return (-1);
  }
 TraceM = TTrace;
 CmdMod = '\0';
 return 0;
}

canonical_original_code:
static int SkpCtU()
{
 int TTrace;
 if (CBfPtr == CStEnd)
  if (MStTop < 0)
   {
   ErrUTC();
   return (-1);
   }
  else
   return 0;
 ++CBfPtr;
 TTrace = TraceM;
 TraceM = 0;
 if (FindES('\033') == (-1))
  {
  TraceM = TTrace;
  return (-1);
  }
 TraceM = TTrace;
 CmdMod = '\0';
 return 0;
}


SkpArg

decompiled_code:
__int64 SkpArg()
{
int v0; // ebx
__int64 result; // rax

v0 = TraceM;
TraceM = 0;
result = FindES(27LL);
TraceM = v0;
if ( (_DWORD)result != -1 )
{
CmdMod = 0;
result = 0LL;
}
return result;
}

canonical_decompiled_code:
__int64 func7()
{
int v0; // ebx
__int64 result; // rax

v0 = TraceM;
TraceM = 0;
result = FindES(27LL);
TraceM = v0;
if ( (_DWORD)result != -1 )
{
CmdMod = 0;
result = 0LL;
}
return result;
}

original_code:
static DEFAULT SkpArg()
{
 BOOLEAN TTrace;
 TTrace = TraceM;
 TraceM = 0;
 if (FindES('\033') == (-1))
  {
  TraceM = TTrace;
  return (-1);
  }
 TraceM = TTrace;
 CmdMod = '\0';
 return 0;
}

canonical_original_code:
static int SkpArg()
{
 int TTrace;
 TTrace = TraceM;
 TraceM = 0;
 if (FindES('\033') == (-1))
  {
  TraceM = TTrace;
  return (-1);
  }
 TraceM = TTrace;
 CmdMod = '\0';
 return 0;
}


SkpF

decompiled_code:
__int64 __fastcall SkpF(__int64 a1)
{
__int64 v1; // rax
__int64 v2; // rdx
int v3; // eax
__int64 result; // rax

v1 = CBfPtr;
if ( CBfPtr == CStEnd )
{
if ( MStTop < 0 )
{
ErrUTC();
result = 0xFFFFFFFFLL;
}
else
{
result = 0LL;
}
}
else
{
++CBfPtr;
v2 = *(unsigned __int8 *)(v1 + 1);
v3 = v2 - 32;
if ( (*((_BYTE *)&ChrMsk + v2) & 0x40) == 0 )
v3 = v2;
switch ( v3 )
{
case '\'':
case '<':
case '>':
case '|':
result = SkpSkp(a1, v2);
break;
case 'B':
case 'D':
case 'K':
case 'R':
result = SkpArg(a1, v2);
break;
case 'C':
case 'N':
case 'S':
case '_':
result = SkpDAr(a1, v2);
break;
default:
ErrChr(6LL, v2);
result = 0xFFFFFFFFLL;
break;
}
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func8(__int64 a1)
{
__int64 v1; // rax
__int64 v2; // rdx
int v3; // eax
__int64 result; // rax

v1 = CBfPtr;
if ( CBfPtr == CStEnd )
{
if ( MStTop < 0 )
{
ErrUTC();
result = 0xFFFFFFFFLL;
}
else
{
result = 0LL;
}
}
else
{
++CBfPtr;
v2 = *(unsigned __int8 *)(v1 + 1);
v3 = v2 - 32;
if ( (*((_BYTE *)&ChrMsk + v2) & 0x40) == 0 )
v3 = v2;
switch ( v3 )
{
case '\'':
case '<':
case '>':
case '|':
result = func0(a1, v2);
break;
case 'B':
case 'D':
case 'K':
case 'R':
result = func7(a1, v2);
break;
case 'C':
case 'N':
case 'S':
case '_':
result = func4(a1, v2);
break;
default:
ErrChr(6LL, v2);
result = 0xFFFFFFFFLL;
break;
}
}
return result;
}

original_code:
static DEFAULT SkpF()
{
 if (CBfPtr == CStEnd)
  if (MStTop < 0)
   {
   ErrUTC();
   return (-1);
   }
  else
   return 0;
 ++CBfPtr;
 switch (((ChrMsk[(*CBfPtr)] & '\100') ? (*CBfPtr)-' ' : (*CBfPtr) )) {
  case 'S':
  case 'N':
  case 'C':
  case '_': return SkpDAr();
  case 'D':
  case 'R':
  case 'B':
  case 'K': return SkpArg();
  case '>':
  case '<':
  case '\'':
  case '|': return SkpSkp();
  default:
      ErrChr(6, *CBfPtr);
    return (-1);
 }
}

canonical_original_code:
static int SkpF()
{
 if (CBfPtr == CStEnd)
  if (MStTop < 0)
   {
   ErrUTC();
   return (-1);
   }
  else
   return 0;
 ++CBfPtr;
 switch (((ChrMsk[(*CBfPtr)] & '\100') ? (*CBfPtr)-' ' : (*CBfPtr) )) {
  case 'S':
  case 'N':
  case 'C':
  case '_': return SkpDAr();
  case 'D':
  case 'R':
  case 'B':
  case 'K': return SkpArg();
  case '>':
  case '<':
  case '\'':
  case '|': return SkpSkp();
  default:
      ErrChr(6, *CBfPtr);
    return (-1);
 }
}


SkpE

decompiled_code:
__int64 __fastcall SkpE(__int64 a1)
{
__int64 v1; // rax
__int64 v2; // rsi
unsigned __int8 v3; // al
__int64 result; // rax

v1 = CBfPtr;
if ( CBfPtr == CStEnd )
{
if ( MStTop < 0 )
{
ErrUTC();
result = 0xFFFFFFFFLL;
}
else
{
result = 0LL;
}
}
else
{
++CBfPtr;
v3 = *(_BYTE *)(v1 + 1);
v2 = v3;
if ( (*((_BYTE *)&ChrMsk + v3) & 0x40) != 0 )
v3 -= 32;
if ( v3 == 37 )
{
result = SkpOne();
}
else if ( v3 == 95 )
{
result = SkpArg(a1, v2);
}
else if ( *((char *)&ChrMsk + v3) >= 0 || v3 == 69 )
{
ErrChr(5LL, v2);
result = 0xFFFFFFFFLL;
}
else
{
result = FEAray_0[v3 - 65]();
}
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func9(__int64 a1)
{
__int64 v1; // rax
__int64 v2; // rsi
unsigned __int8 v3; // al
__int64 result; // rax

v1 = CBfPtr;
if ( CBfPtr == CStEnd )
{
if ( MStTop < 0 )
{
ErrUTC();
result = 0xFFFFFFFFLL;
}
else
{
result = 0LL;
}
}
else
{
++CBfPtr;
v3 = *(_BYTE *)(v1 + 1);
v2 = v3;
if ( (*((_BYTE *)&ChrMsk + v3) & 0x40) != 0 )
v3 -= 32;
if ( v3 == 37 )
{
result = func1();
}
else if ( v3 == 95 )
{
result = func7(a1, v2);
}
else if ( *((char *)&ChrMsk + v3) >= 0 || v3 == 69 )
{
ErrChr(5LL, v2);
result = 0xFFFFFFFFLL;
}
else
{
result = FEAray_0[v3 - 65]();
}
}
return result;
}

original_code:
static DEFAULT SkpE()
{
 unsigned char TmpChr;
 static DEFAULT (*FEAray[])(void) = {
        SkpSkp, SkpArg, SkpSkp, SkpSkp,
        0, SkpSkp, SkpArg, SkpSkp,
        SkpArg, SkpSkp, SkpSkp, SkpArg,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpOne, SkpArg, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpArg, SkpSkp,
        SkpSkp, SkpSkp
 };
 if (CBfPtr == CStEnd)
  if (MStTop < 0)
   {
   ErrUTC();
   return (-1);
   }
  else
   return 0;
 ++CBfPtr;
 TmpChr = ((ChrMsk[(*CBfPtr)] & '\100') ? (*CBfPtr)-' ' : (*CBfPtr) );
 if (TmpChr == '%')
  return SkpOne();
 else if (TmpChr == '_')
  return SkpArg();
 else if (!(ChrMsk[(TmpChr)] & '\200') || (TmpChr=='E'))
  {
  ErrChr(5, *CBfPtr);
  return (-1);
  }
 return (*FEAray[TmpChr-'A'])();
}

canonical_original_code:
static int SkpE()
{
 unsigned char TmpChr;
 static int (*FEAray[])() = {
        SkpSkp, SkpArg, SkpSkp, SkpSkp,
        0, SkpSkp, SkpArg, SkpSkp,
        SkpArg, SkpSkp, SkpSkp, SkpArg,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpOne, SkpArg, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpArg, SkpSkp,
        SkpSkp, SkpSkp
 };
 if (CBfPtr == CStEnd)
  if (MStTop < 0)
   {
   ErrUTC();
   return (-1);
   }
  else
   return 0;
 ++CBfPtr;
 TmpChr = ((ChrMsk[(*CBfPtr)] & '\100') ? (*CBfPtr)-' ' : (*CBfPtr) );
 if (TmpChr == '%')
  return SkpOne();
 else if (TmpChr == '_')
  return SkpArg();
 else if (!(ChrMsk[(TmpChr)] & '\200') || (TmpChr=='E'))
  {
  ErrChr(5, *CBfPtr);
  return (-1);
  }
 return (*FEAray[TmpChr-'A'])();
}

variable_types:
TmpChr
unsigned char

variable_types:
FEAray
int (*[])()


SkpCtA

decompiled_code:
__int64 SkpCtA()
{
int v0; // ebx
__int64 result; // rax

v0 = TraceM;
TraceM = 0;
result = FindES(1LL);
TraceM = v0;
if ( (_DWORD)result != -1 )
{
CmdMod = 0;
result = 0LL;
}
return result;
}

canonical_decompiled_code:
__int64 func10()
{
int v0; // ebx
__int64 result; // rax

v0 = TraceM;
TraceM = 0;
result = FindES(1LL);
TraceM = v0;
if ( (_DWORD)result != -1 )
{
CmdMod = 0;
result = 0LL;
}
return result;
}

original_code:
static DEFAULT SkpCtA()
{
 BOOLEAN TTrace;
 TTrace = TraceM;
 TraceM = 0;
 if (FindES('\001') == (-1))
  {
  TraceM = TTrace;
  return (-1);
  }
 TraceM = TTrace;
 CmdMod = '\0';
 return 0;
}

canonical_original_code:
static int SkpCtA()
{
 int TTrace;
 TTrace = TraceM;
 TraceM = 0;
 if (FindES('\001') == (-1))
  {
  TraceM = TTrace;
  return (-1);
  }
 TraceM = TTrace;
 CmdMod = '\0';
 return 0;
}


SkpCmd

decompiled_code:
__int64 SkpCmd()
{
return ((__int64 (__fastcall *)())FSAray_2[(unsigned __int8)*CBfPtr])();
}

canonical_decompiled_code:
__int64 func11()
{
return ((__int64 (__fastcall *)())FSAray_2[(unsigned __int8)*CBfPtr])();
}

original_code:
DEFAULT SkpCmd()
{
 static DEFAULT (*FSAray[])(void) = {
        ExeNul, SkpCtA, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpArg, ExeNul, SkpSkp,
        SkpSkp, ExeNul, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpCtU, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpOne, SkpSkp,
        ExeNul, SkpExc, SkpDqu, SkpSkp,
        SkpSkp, SkpOne, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        ExeAtS, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpE, SkpF, SkpOne,
        SkpSkp, SkpArg, SkpSkp, SkpSkp,
        SkpSkp, SkpOne, SkpArg, SkpArg,
        SkpSkp, SkpOne, SkpSkp, SkpArg,
        SkpSkp, SkpOne, SkpSkp, SkpSkp,
        SkpOne, SkpSkp, SkpSkp, SkpOne,
        SkpSkp, SkpOne, SkpCrt, SkpArg,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpE, SkpF, SkpOne,
        SkpSkp, SkpArg, SkpSkp, SkpSkp,
        SkpSkp, SkpOne, SkpArg, SkpArg,
        SkpSkp, SkpOne, SkpSkp, SkpArg,
        SkpSkp, SkpOne, SkpSkp, SkpSkp,
        SkpOne, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp
 };
 DEFAULT Status;
 Status = (*FSAray[*CBfPtr])();
 return Status;
}

canonical_original_code:
int SkpCmd()
{
 static int (*FSAray[])() = {
        ExeNul, SkpCtA, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpArg, ExeNul, SkpSkp,
        SkpSkp, ExeNul, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpCtU, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpOne, SkpSkp,
        ExeNul, SkpExc, SkpDqu, SkpSkp,
        SkpSkp, SkpOne, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        ExeAtS, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpE, SkpF, SkpOne,
        SkpSkp, SkpArg, SkpSkp, SkpSkp,
        SkpSkp, SkpOne, SkpArg, SkpArg,
        SkpSkp, SkpOne, SkpSkp, SkpArg,
        SkpSkp, SkpOne, SkpSkp, SkpSkp,
        SkpOne, SkpSkp, SkpSkp, SkpOne,
        SkpSkp, SkpOne, SkpCrt, SkpArg,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpE, SkpF, SkpOne,
        SkpSkp, SkpArg, SkpSkp, SkpSkp,
        SkpSkp, SkpOne, SkpArg, SkpArg,
        SkpSkp, SkpOne, SkpSkp, SkpArg,
        SkpSkp, SkpOne, SkpSkp, SkpSkp,
        SkpOne, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp,
        SkpSkp, SkpSkp, SkpSkp, SkpSkp
 };
 int Status;
 Status = (*FSAray[*CBfPtr])();
 return Status;
}

variable_types:
FSAray
int (*[])()

variable_types: Status int


ExeCtR

decompiled_code:
__int64 ExeCtR()
{
unsigned int v0; // er12

if ( EStTop == EStBot )
return PushEx(Radix, 0LL);
v0 = EStack[4 * EStTop + 2];
if ( v0 )
return PushEx(Radix, 0LL);
if ( (unsigned int)GetNmA() == -1 )
return (unsigned int)-1;
if ( (NArgmt & 0xFFFFFFFFFFFFFFFDLL) == 8 || NArgmt == 16LL )
{
Radix = NArgmt;
}
else
{
v0 = -1;
ErrMsg(13LL);
}
return v0;
}

canonical_decompiled_code:
__int64 func0()
{
unsigned int v0; // er12

if ( EStTop == EStBot )
return PushEx(Radix, 0LL);
v0 = EStack[4 * EStTop + 2];
if ( v0 )
return PushEx(Radix, 0LL);
if ( (unsigned int)GetNmA() == -1 )
return (unsigned int)-1;
if ( (NArgmt & 0xFFFFFFFFFFFFFFFDLL) == 8 || NArgmt == 16LL )
{
Radix = NArgmt;
}
else
{
v0 = -1;
ErrMsg(13LL);
}
return v0;
}

original_code:
DEFAULT ExeCtR()
{
 ;
 if ((EStTop == EStBot) ||
     (EStack[EStTop].ElType != 0)) {
  ;
  return PushEx((LONG)Radix, 0);
 }
 if (GetNmA() == (-1)) {
  ;
  return (-1);
 }
 if ((NArgmt != 8) && (NArgmt != 10) && (NArgmt != 16)) {
  ErrMsg(13);
  ;
  return (-1);
 }
 Radix = (DEFAULT)NArgmt;
 ;
 return 0;
}

canonical_original_code:
int ExeCtR()
{
 ;
 if ((EStTop == EStBot) ||
     (EStack[EStTop].ElType != 0)) {
  ;
  return PushEx((long)Radix, 0);
 }
 if (GetNmA() == (-1)) {
  ;
  return (-1);
 }
 if ((NArgmt != 8) && (NArgmt != 10) && (NArgmt != 16)) {
  ErrMsg(13);
  ;
  return (-1);
 }
 Radix = (int)NArgmt;
 ;
 return 0;
}


ExeK

decompiled_code:
__int64 ExeK()
{
__int64 v0; // rdi
const char *v1; // rsi
__int64 result; // rax
__int64 v3; // rdx
__int64 v4; // rax
int v5; // ebx

if ( EStTop == EStBot )
{
NArgmt = 1LL;
v0 = 1LL;
if ( (CmdMod & 8) != 0 )
goto LABEL_3;
LABEL_16:
v4 = Ln2Chr(v0);
NArgmt = v4;
if ( v4 <= 0 )
GapBeg += v4;
else
GapEnd += v4;
result = 0LL;
CmdMod = 0;
return result;
}
UMinus();
if ( (unsigned int)GetNmA() == -1 )
return 0xFFFFFFFFLL;
v0 = NArgmt;
if ( (CmdMod & 8) == 0 )
goto LABEL_16;
LABEL_3:
if ( MArgmt == v0 )
{
LABEL_10:
CmdMod = 0;
return 0LL;
}
v1 = "m,nD";
if ( (*CBfPtr & 0xDF) != 68 )
v1 = "m,nK";
ZCpyBl(&ErrTxt, v1, 5LL);
if ( (unsigned int)GetAra() == -1 )
return 0xFFFFFFFFLL;
if ( AraBeg < GapBeg && GapEnd < AraEnd )
{
GapBeg = AraBeg;
GapEnd = AraEnd;
goto LABEL_10;
}
if ( GapEnd <= AraEnd )
{
v5 = AraBeg - (GapEnd + 1);
ZCpyBl(GapBeg, GapEnd + 1LL, (unsigned int)v5);
GapBeg += v5;
CmdMod = 0;
GapEnd = AraEnd;
}
else
{
v3 = GapBeg - 1LL - AraEnd;
GapEnd -= (int)v3;
GapBeg -= (int)v3;
ZCpyBl(GapEnd + 1LL, GapBeg, v3);
CmdMod = 0;
GapBeg = AraBeg;
}
return 0LL;
}

canonical_decompiled_code:
__int64 func0()
{
__int64 v0; // rdi
const char *v1; // rsi
__int64 result; // rax
__int64 v3; // rdx
__int64 v4; // rax
int v5; // ebx

if ( EStTop == EStBot )
{
NArgmt = 1LL;
v0 = 1LL;
if ( (CmdMod & 8) != 0 )
goto LABEL_3;
LABEL_16:
v4 = Ln2Chr(v0);
NArgmt = v4;
if ( v4 <= 0 )
GapBeg += v4;
else
GapEnd += v4;
result = 0LL;
CmdMod = 0;
return result;
}
UMinus();
if ( (unsigned int)GetNmA() == -1 )
return 0xFFFFFFFFLL;
v0 = NArgmt;
if ( (CmdMod & 8) == 0 )
goto LABEL_16;
LABEL_3:
if ( MArgmt == v0 )
{
LABEL_10:
CmdMod = 0;
return 0LL;
}
v1 = "m,nD";
if ( (*CBfPtr & 0xDF) != 68 )
v1 = "m,nK";
ZCpyBl(&ErrTxt, v1, 5LL);
if ( (unsigned int)GetAra() == -1 )
return 0xFFFFFFFFLL;
if ( AraBeg < GapBeg && GapEnd < AraEnd )
{
GapBeg = AraBeg;
GapEnd = AraEnd;
goto LABEL_10;
}
if ( GapEnd <= AraEnd )
{
v5 = AraBeg - (GapEnd + 1);
ZCpyBl(GapBeg, GapEnd + 1LL, (unsigned int)v5);
GapBeg += v5;
CmdMod = 0;
GapEnd = AraEnd;
}
else
{
v3 = GapBeg - 1LL - AraEnd;
GapEnd -= (int)v3;
GapBeg -= (int)v3;
ZCpyBl(GapEnd + 1LL, GapBeg, v3);
CmdMod = 0;
GapBeg = AraBeg;
}
return 0LL;
}

original_code:
DEFAULT ExeK()
{
 int HowFar;
 ;
 if (EStTop == EStBot) {
  NArgmt = 1;
 } else {
  UMinus();
  if (GetNmA() == (-1)) {
   ;
   return (-1);
  }
 }
 if (CmdMod & '\10') {
  if (NArgmt == MArgmt) {
   CmdMod = '\0';
   ;
   return 0;
  }
  ZCpyBl((ErrTxt),((*CBfPtr == 'D' || *CBfPtr=='d') ? "m,nD" : "m,nK"),(5));
  if (GetAra() == (-1)) {
   ;
   return (-1);
  }
  if ((AraBeg < GapBeg) && (AraEnd > GapEnd)) {
   GapBeg = AraBeg;
   GapEnd = AraEnd;
  } else {
   if (AraEnd < GapEnd) {
    HowFar = (GapBeg-1) - AraEnd;
    GapBeg -= HowFar;
    GapEnd -= HowFar;
    ZCpyBl((GapEnd+1),(GapBeg),((SIZE_T)HowFar));
    GapBeg = AraBeg;
   } else {
    HowFar = AraBeg - (GapEnd+1);
    ZCpyBl((GapBeg),(GapEnd+1),((SIZE_T)HowFar));
    GapBeg += HowFar;
    GapEnd = AraEnd;
   }
  }
 } else {
  NArgmt = Ln2Chr(NArgmt);
  if (NArgmt > 0) {
   GapEnd += NArgmt;
  } else {
   GapBeg += NArgmt;
  }
 }
 CmdMod = '\0';
 ;
 return 0;
}

canonical_original_code:
int ExeK()
{
 int HowFar;
 ;
 if (EStTop == EStBot) {
  NArgmt = 1;
 } else {
  UMinus();
  if (GetNmA() == (-1)) {
   ;
   return (-1);
  }
 }
 if (CmdMod & '\10') {
  if (NArgmt == MArgmt) {
   CmdMod = '\0';
   ;
   return 0;
  }
  ZCpyBl((ErrTxt),((*CBfPtr == 'D' || *CBfPtr=='d') ? "m,nD" : "m,nK"),(5));
  if (GetAra() == (-1)) {
   ;
   return (-1);
  }
  if ((AraBeg < GapBeg) && (AraEnd > GapEnd)) {
   GapBeg = AraBeg;
   GapEnd = AraEnd;
  } else {
   if (AraEnd < GapEnd) {
    HowFar = (GapBeg-1) - AraEnd;
    GapBeg -= HowFar;
    GapEnd -= HowFar;
    ZCpyBl((GapEnd+1),(GapBeg),((unsigned int)HowFar));
    GapBeg = AraBeg;
   } else {
    HowFar = AraBeg - (GapEnd+1);
    ZCpyBl((GapBeg),(GapEnd+1),((unsigned int)HowFar));
    GapBeg += HowFar;
    GapEnd = AraEnd;
   }
  }
 } else {
  NArgmt = Ln2Chr(NArgmt);
  if (NArgmt > 0) {
   GapEnd += NArgmt;
  } else {
   GapBeg += NArgmt;
  }
 }
 CmdMod = '\0';
 ;
 return 0;
}

variable_types: HowFar int


ExeDgt

decompiled_code:
__int64 ExeDgt()
{
__int64 v0; // rcx
__int64 v1; // rax
__int64 v2; // rdx
__int64 v3; // rbp
__int64 v4; // rbp
int v5; // eax
char v6; // dl

v0 = CBfPtr;
v1 = Radix;
v2 = (unsigned __int8)*CBfPtr;
if ( Radix == 8 && (unsigned __int8)v2 > 0x37u )
{
ErrMsg(9LL);
return 0xFFFFFFFFLL;
}
v3 = 0LL;
while ( 1 )
{
v4 = v1 * v3;
v5 = (unsigned __int8)v2;
v6 = *((_BYTE *)&ChrMsk + v2);
if ( (v6 & 0x10) != 0 )
{
v3 = v5 - 48 + v4;
goto LABEL_4;
}
if ( (v6 & 0x80) == 0 )
{
v3 = v5 - 87 + v4;
LABEL_4:
if ( CStEnd == v0 )
return PushEx(v3, 0LL);
goto LABEL_5;
}
v3 = v5 - 55 + v4;
if ( CStEnd == v0 )
return PushEx(v3, 0LL);
LABEL_5:
CBfPtr = v0 + 1;
if ( (unsigned int)IsRadx(*(unsigned __int8 *)(v0 + 1)) )
{
if ( TraceM )
EchoIt((unsigned __int8)*CBfPtr);
}
if ( !(unsigned int)IsRadx((unsigned __int8)*CBfPtr) )
break;
v0 = CBfPtr;
v1 = Radix;
v2 = (unsigned __int8)*CBfPtr;
}
--CBfPtr;
return PushEx(v3, 0LL);
}

canonical_decompiled_code:
__int64 func0()
{
__int64 v0; // rcx
__int64 v1; // rax
__int64 v2; // rdx
__int64 v3; // rbp
__int64 v4; // rbp
int v5; // eax
char v6; // dl

v0 = CBfPtr;
v1 = Radix;
v2 = (unsigned __int8)*CBfPtr;
if ( Radix == 8 && (unsigned __int8)v2 > 0x37u )
{
ErrMsg(9LL);
return 0xFFFFFFFFLL;
}
v3 = 0LL;
while ( 1 )
{
v4 = v1 * v3;
v5 = (unsigned __int8)v2;
v6 = *((_BYTE *)&ChrMsk + v2);
if ( (v6 & 0x10) != 0 )
{
v3 = v5 - 48 + v4;
goto LABEL_4;
}
if ( (v6 & 0x80) == 0 )
{
v3 = v5 - 87 + v4;
LABEL_4:
if ( CStEnd == v0 )
return PushEx(v3, 0LL);
goto LABEL_5;
}
v3 = v5 - 55 + v4;
if ( CStEnd == v0 )
return PushEx(v3, 0LL);
LABEL_5:
CBfPtr = v0 + 1;
if ( (unsigned int)IsRadx(*(unsigned __int8 *)(v0 + 1)) )
{
if ( TraceM )
EchoIt((unsigned __int8)*CBfPtr);
}
if ( !(unsigned int)IsRadx((unsigned __int8)*CBfPtr) )
break;
v0 = CBfPtr;
v1 = Radix;
v2 = (unsigned __int8)*CBfPtr;
}
--CBfPtr;
return PushEx(v3, 0LL);
}

original_code:
DEFAULT ExeDgt()
{
 LONG TmpLng;
 ;
 if ((Radix == 8) && (*CBfPtr > '7')) {
  ErrMsg(9);
  ;
  return (-1);
 }
 TmpLng = 0;
 do {
  TmpLng *= Radix;
  if ((ChrMsk[(*CBfPtr)] & '\20')) {
   TmpLng += *CBfPtr - '0';
  } else if ((ChrMsk[(*CBfPtr)] & '\200')) {
   TmpLng += *CBfPtr - '\67';
  } else {
   TmpLng += *CBfPtr - '\127';
  }
  if (CBfPtr == CStEnd) {
   return PushEx(TmpLng, 0);
  }
  ++CBfPtr;
  if (IsRadx(*CBfPtr) && TraceM) {
   EchoIt(*CBfPtr);
  }
 } while (IsRadx(*CBfPtr));
 --CBfPtr;
 return PushEx(TmpLng, 0);
}

canonical_original_code:
int ExeDgt()
{
 long TmpLng;
 ;
 if ((Radix == 8) && (*CBfPtr > '7')) {
  ErrMsg(9);
  ;
  return (-1);
 }
 TmpLng = 0;
 do {
  TmpLng *= Radix;
  if ((ChrMsk[(*CBfPtr)] & '\20')) {
   TmpLng += *CBfPtr - '0';
  } else if ((ChrMsk[(*CBfPtr)] & '\200')) {
   TmpLng += *CBfPtr - '\67';
  } else {
   TmpLng += *CBfPtr - '\127';
  }
  if (CBfPtr == CStEnd) {
   return PushEx(TmpLng, 0);
  }
  ++CBfPtr;
  if (IsRadx(*CBfPtr) && TraceM) {
   EchoIt(*CBfPtr);
  }
 } while (IsRadx(*CBfPtr));
 --CBfPtr;
 return PushEx(TmpLng, 0);
}

variable_types: TmpLng long


ExeFLs

decompiled_code:
__int64 ExeFLs()
{
CmdMod = 0;
EStTop = EStBot;
if ( LStTop == LStBot )
CBfPtr = CStBeg - 1LL;
else
CBfPtr = LStack[2 * LStTop + 1];
return 0LL;
}

canonical_decompiled_code:
__int64 func0()
{
CmdMod = 0;
EStTop = EStBot;
if ( LStTop == LStBot )
CBfPtr = CStBeg - 1LL;
else
CBfPtr = LStack[2 * LStTop + 1];
return 0LL;
}

original_code:
static DEFAULT ExeFLs()
{
 ;
 CmdMod = '\0';
 EStTop = EStBot;
 CBfPtr = (LStTop == LStBot) ? CStBeg-1 : LStack[LStTop].LAddr;
 ;
 return 0;
}

canonical_original_code:
static int ExeFLs()
{
 ;
 CmdMod = '\0';
 EStTop = EStBot;
 CBfPtr = (LStTop == LStBot) ? CStBeg-1 : LStack[LStTop].LAddr;
 ;
 return 0;
}


ExeFN

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

if ( (CmdMod & 8) != 0 )
{
ErrStr(8LL, "m,nFN");
result = 0xFFFFFFFFLL;
}
else if ( (CmdMod & 4) != 0 )
{
ErrStr(8LL, "::FN");
result = 0xFFFFFFFFLL;
}
else
{
SrcTyp = 4;
result = Replac();
if ( (_DWORD)result != -1 )
{
CmdMod = 0;
result = 0LL;
}
}
return result;
}

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

if ( (CmdMod & 8) != 0 )
{
ErrStr(8LL, "m,nFN");
result = 0xFFFFFFFFLL;
}
else if ( (CmdMod & 4) != 0 )
{
ErrStr(8LL, "::FN");
result = 0xFFFFFFFFLL;
}
else
{
SrcTyp = 4;
result = Replac();
if ( (_DWORD)result != -1 )
{
CmdMod = 0;
result = 0LL;
}
}
return result;
}

original_code:
static DEFAULT ExeFN()
{
 ;
 if (CmdMod & '\10') {
  ErrStr(8, "m,nFN");
  ;
  return (-1);
 }
 if (CmdMod & '\4') {
  ErrStr(8, "::FN");
  ;
  return (-1);
 }
 SrcTyp = 4;
 if (Replac() == (-1)) {
  ;
  return (-1);
 }
 CmdMod = '\0';
 ;
 return 0;
}

canonical_original_code:
static int ExeFN()
{
 ;
 if (CmdMod & '\10') {
  ErrStr(8, "m,nFN");
  ;
  return (-1);
 }
 if (CmdMod & '\4') {
  ErrStr(8, "::FN");
  ;
  return (-1);
 }
 SrcTyp = 4;
 if (Replac() == (-1)) {
  ;
  return (-1);
 }
 CmdMod = '\0';
 ;
 return 0;
}


ExeFC

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

if ( (CmdMod & 4) != 0 )
{
ErrStr(8LL, "::FC");
result = 0xFFFFFFFFLL;
}
else
{
SrcTyp = 2;
result = Replac();
if ( (_DWORD)result != -1 )
{
CmdMod = 0;
result = 0LL;
}
}
return result;
}

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

if ( (CmdMod & 4) != 0 )
{
ErrStr(8LL, "::FC");
result = 0xFFFFFFFFLL;
}
else
{
SrcTyp = 2;
result = Replac();
if ( (_DWORD)result != -1 )
{
CmdMod = 0;
result = 0LL;
}
}
return result;
}

original_code:
static DEFAULT ExeFC()
{
 ;
 if (CmdMod & '\4') {
  ErrStr(8, "::FC");
  ;
  return (-1);
 }
 SrcTyp = 2;
 if (Replac() == (-1)) {
  ;
  return (-1);
 }
 CmdMod = '\0';
 ;
 return 0;
}

canonical_original_code:
static int ExeFC()
{
 ;
 if (CmdMod & '\4') {
  ErrStr(8, "::FC");
  ;
  return (-1);
 }
 SrcTyp = 2;
 if (Replac() == (-1)) {
  ;
  return (-1);
 }
 CmdMod = '\0';
 ;
 return 0;
}


ExeFS

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

if ( (CmdMod & 8) != 0 )
{
ErrStr(8LL, "m,nFS");
result = 0xFFFFFFFFLL;
}
else
{
if ( (CmdMod & 4) == 0 )
{
SrcTyp = 5;
if ( (unsigned int)Replac() != -1 )
{
CmdMod = 0;
return 0LL;
}
return 0xFFFFFFFFLL;
}
if ( EStTop <= EStBot )
{
if ( GapEnd == EBfEnd )
{
CmdMod = 0;
return PushEx(0LL, 0LL);
}
MArgmt = GapBeg - EBfBeg;
CmdMod = CmdMod & 0xFB | 0xA;
if ( (unsigned int)PushEx(GapBeg - EBfBeg + 1LL, 0LL) != -1 )
return ExeFC();
return 0xFFFFFFFFLL;
}
ErrStr(8LL, "n::FS");
result = 0xFFFFFFFFLL;
}
return result;
}

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

if ( (CmdMod & 8) != 0 )
{
ErrStr(8LL, "m,nFS");
result = 0xFFFFFFFFLL;
}
else
{
if ( (CmdMod & 4) == 0 )
{
SrcTyp = 5;
if ( (unsigned int)Replac() != -1 )
{
CmdMod = 0;
return 0LL;
}
return 0xFFFFFFFFLL;
}
if ( EStTop <= EStBot )
{
if ( GapEnd == EBfEnd )
{
CmdMod = 0;
return PushEx(0LL, 0LL);
}
MArgmt = GapBeg - EBfBeg;
CmdMod = CmdMod & 0xFB | 0xA;
if ( (unsigned int)PushEx(GapBeg - EBfBeg + 1LL, 0LL) != -1 )
return func2();
return 0xFFFFFFFFLL;
}
ErrStr(8LL, "n::FS");
result = 0xFFFFFFFFLL;
}
return result;
}

original_code:
static DEFAULT ExeFS()
{
 ;
 if (CmdMod & '\10') {
  ErrStr(8, "m,nFS");
  ;
  return (-1);
 }
 if (CmdMod & '\4') {
  if (CmdMod & '\10') {
   ErrStr(8, "m,n::FS");
   ;
   return (-1);
  }
  if (EStTop > EStBot) {
   ErrStr(8, "n::FS");
   ;
   return (-1);
  }
  if (GapEnd == EBfEnd) {
   CmdMod = '\0';
   ;
   return PushEx(0L,0);
  }
  CmdMod &= ~'\4';
  CmdMod |= '\2';
  CmdMod |= '\10';
  MArgmt = GapBeg - EBfBeg;
  if (PushEx((LONG)((GapBeg-EBfBeg)+1),0) == (-1)) {
   ;
   return (-1);
  }
  ;
  return ExeFC();
 }
 SrcTyp = 5;
 if (Replac() == (-1)) {
  ;
  return (-1);
 }
 CmdMod = '\0';
 ;
 return 0;
}

canonical_original_code:
static int ExeFS()
{
 ;
 if (CmdMod & '\10') {
  ErrStr(8, "m,nFS");
  ;
  return (-1);
 }
 if (CmdMod & '\4') {
  if (CmdMod & '\10') {
   ErrStr(8, "m,n::FS");
   ;
   return (-1);
  }
  if (EStTop > EStBot) {
   ErrStr(8, "n::FS");
   ;
   return (-1);
  }
  if (GapEnd == EBfEnd) {
   CmdMod = '\0';
   ;
   return PushEx(0L,0);
  }
  CmdMod &= ~'\4';
  CmdMod |= '\2';
  CmdMod |= '\10';
  MArgmt = GapBeg - EBfBeg;
  if (PushEx((LONG)((GapBeg-EBfBeg)+1),0) == (-1)) {
   ;
   return (-1);
  }
  ;
  return ExeFC();
 }
 SrcTyp = 5;
 if (Replac() == (-1)) {
  ;
  return (-1);
 }
 CmdMod = '\0';
 ;
 return 0;
}


ExeFUn

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

if ( (CmdMod & 8) != 0 )
{
ErrStr(8LL, "m,nF_");
result = 0xFFFFFFFFLL;
}
else if ( (CmdMod & 4) != 0 )
{
ErrStr(8LL, "::F_");
result = 0xFFFFFFFFLL;
}
else
{
SrcTyp = 6;
result = Replac();
if ( (_DWORD)result != -1 )
{
CmdMod = 0;
result = 0LL;
}
}
return result;
}

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

if ( (CmdMod & 8) != 0 )
{
ErrStr(8LL, "m,nF_");
result = 0xFFFFFFFFLL;
}
else if ( (CmdMod & 4) != 0 )
{
ErrStr(8LL, "::F_");
result = 0xFFFFFFFFLL;
}
else
{
SrcTyp = 6;
result = Replac();
if ( (_DWORD)result != -1 )
{
CmdMod = 0;
result = 0LL;
}
}
return result;
}

original_code:
static DEFAULT ExeFUn()
{
 ;
 if (CmdMod & '\10') {
  ErrStr(8, "m,nF_");
  ;
  return (-1);
 }
 if (CmdMod & '\4') {
  ErrStr(8, "::F_");
  ;
  return (-1);
 }
 SrcTyp = 6;
 if (Replac() == (-1)) {
  ;
  return (-1);
 }
 CmdMod = '\0';
 ;
 return 0;
}

canonical_original_code:
static int ExeFUn()
{
 ;
 if (CmdMod & '\10') {
  ErrStr(8, "m,nF_");
  ;
  return (-1);
 }
 if (CmdMod & '\4') {
  ErrStr(8, "::F_");
  ;
  return (-1);
 }
 SrcTyp = 6;
 if (Replac() == (-1)) {
  ;
  return (-1);
 }
 CmdMod = '\0';
 ;
 return 0;
}


ExeFD

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

if ( (CmdMod & 8) != 0 )
{
ErrStr(8LL, "m,nFD");
result = 0xFFFFFFFFLL;
}
else if ( (CmdMod & 4) != 0 )
{
ErrStr(8LL, "::FD");
result = 0xFFFFFFFFLL;
}
else
{
SrcTyp = 5;
result = Search(0LL);
if ( (_DWORD)result != -1 )
{
if ( Matchd )
GapBeg += RefLen;
CmdMod = 0;
result = 0LL;
}
}
return result;
}

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

if ( (CmdMod & 8) != 0 )
{
ErrStr(8LL, "m,nFD");
result = 0xFFFFFFFFLL;
}
else if ( (CmdMod & 4) != 0 )
{
ErrStr(8LL, "::FD");
result = 0xFFFFFFFFLL;
}
else
{
SrcTyp = 5;
result = Search(0LL);
if ( (_DWORD)result != -1 )
{
if ( Matchd )
GapBeg += RefLen;
CmdMod = 0;
result = 0LL;
}
}
return result;
}

original_code:
static DEFAULT ExeFD()
{
 ;
 if (CmdMod & '\10') {
  ErrStr(8, "m,nFD");
  ;
  return (-1);
 }
 if (CmdMod & '\4') {
  ErrStr(8, "::FD");
  ;
  return (-1);
 }
 SrcTyp = 5;
 if (Search(0) == (-1)) {
  ;
  return (-1);
 }
 if (Matchd) {
  GapBeg += RefLen;
 }
 CmdMod = '\0';
 ;
 return 0;
}

canonical_original_code:
static int ExeFD()
{
 ;
 if (CmdMod & '\10') {
  ErrStr(8, "m,nFD");
  ;
  return (-1);
 }
 if (CmdMod & '\4') {
  ErrStr(8, "::FD");
  ;
  return (-1);
 }
 SrcTyp = 5;
 if (Search(0) == (-1)) {
  ;
  return (-1);
 }
 if (Matchd) {
  GapBeg += RefLen;
 }
 CmdMod = '\0';
 ;
 return 0;
}


ExeFK

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

if ( (CmdMod & 8) != 0 )
{
ErrStr(8LL, "m,nFK");
result = 0xFFFFFFFFLL;
}
else if ( (CmdMod & 4) != 0 )
{
ErrStr(8LL, "::FK");
result = 0xFFFFFFFFLL;
}
else
{
SrcTyp = 3;
result = Search(0LL);
if ( (_DWORD)result != -1 )
{
CmdMod = 0;
result = 0LL;
}
}
return result;
}

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

if ( (CmdMod & 8) != 0 )
{
ErrStr(8LL, "m,nFK");
result = 0xFFFFFFFFLL;
}
else if ( (CmdMod & 4) != 0 )
{
ErrStr(8LL, "::FK");
result = 0xFFFFFFFFLL;
}
else
{
SrcTyp = 3;
result = Search(0LL);
if ( (_DWORD)result != -1 )
{
CmdMod = 0;
result = 0LL;
}
}
return result;
}

original_code:
static DEFAULT ExeFK()
{
 ;
 if (CmdMod & '\10') {
  ErrStr(8, "m,nFK");
  ;
  return (-1);
 }
 if (CmdMod & '\4') {
  ErrStr(8, "::FK");
  ;
  return (-1);
 }
 SrcTyp = 3;
 if (Search(0) == (-1)) {
  ;
  return (-1);
 }
 CmdMod = '\0';
 ;
 return 0;
}

canonical_original_code:
static int ExeFK()
{
 ;
 if (CmdMod & '\10') {
  ErrStr(8, "m,nFK");
  ;
  return (-1);
 }
 if (CmdMod & '\4') {
  ErrStr(8, "::FK");
  ;
  return (-1);
 }
 SrcTyp = 3;
 if (Search(0) == (-1)) {
  ;
  return (-1);
 }
 CmdMod = '\0';
 ;
 return 0;
}


ExeFR

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

if ( EBfBeg > GapBeg - RefLen )
{
ErrMsg(2LL);
result = 0xFFFFFFFFLL;
}
else
{
CmdMod &= 2u;
GapBeg += RefLen;
EStTop = EStBot;
result = ExeI();
}
return result;
}

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

if ( EBfBeg > GapBeg - RefLen )
{
ErrMsg(2LL);
result = 0xFFFFFFFFLL;
}
else
{
CmdMod &= 2u;
GapBeg += RefLen;
EStTop = EStBot;
result = ExeI();
}
return result;
}

original_code:
static DEFAULT ExeFR()
{
 ;
 if ((GapBeg-RefLen) < EBfBeg) {
  ErrMsg(2);
  ;
  return (-1);
 }
 GapBeg += RefLen;
 CmdMod = (CmdMod & '\2');
 EStTop = EStBot;
 ;
 return ExeI();
}

canonical_original_code:
static int ExeFR()
{
 ;
 if ((GapBeg-RefLen) < EBfBeg) {
  ErrMsg(2);
  ;
  return (-1);
 }
 GapBeg += RefLen;
 CmdMod = (CmdMod & '\2');
 EStTop = EStBot;
 ;
 return ExeI();
}


ExeFGt

decompiled_code:
__int64 ExeFGt()
{
if ( LStTop == LStBot )
return 0xFFFFFFFFLL;
if ( (unsigned int)FlowEL() == -1 )
return 0xFFFFFFFFLL;
--CBfPtr;
++LStTop;
CmdMod = 0;
EStTop = EStBot;
return 0LL;
}

canonical_decompiled_code:
__int64 func8()
{
if ( LStTop == LStBot )
return 0xFFFFFFFFLL;
if ( (unsigned int)FlowEL() == -1 )
return 0xFFFFFFFFLL;
--CBfPtr;
++LStTop;
CmdMod = 0;
EStTop = EStBot;
return 0LL;
}

original_code:
static DEFAULT ExeFGt()
{
 ;
 if (LStTop == LStBot) {
  ;
  return (-1);
 }
 if (FlowEL() == (-1)) {
  ;
  return (-1);
 }
 CBfPtr--;
 LStTop++;
 CmdMod = '\0';
 EStTop = EStBot;
 ;
 return 0;
}

canonical_original_code:
static int ExeFGt()
{
 ;
 if (LStTop == LStBot) {
  ;
  return (-1);
 }
 if (FlowEL() == (-1)) {
  ;
  return (-1);
 }
 CBfPtr--;
 LStTop++;
 CmdMod = '\0';
 EStTop = EStBot;
 ;
 return 0;
}


ExeFSQ

decompiled_code:
__int64 ExeFSQ()
{
CmdMod = 0;
EStTop = EStBot;
return FlowEC();
}

canonical_decompiled_code:
__int64 func9()
{
CmdMod = 0;
EStTop = EStBot;
return FlowEC();
}

original_code:
static DEFAULT ExeFSQ()
{
 ;
 CmdMod = '\0';
 EStTop = EStBot;
 ;
 return FlowEC();
}

canonical_original_code:
static int ExeFSQ()
{
 ;
 CmdMod = '\0';
 EStTop = EStBot;
 ;
 return FlowEC();
}


ExeFBr

decompiled_code:
__int64 ExeFBr()
{
CmdMod = 0;
EStTop = EStBot;
return FlowEE();
}

canonical_decompiled_code:
__int64 func10()
{
CmdMod = 0;
EStTop = EStBot;
return FlowEE();
}

original_code:
static DEFAULT ExeFBr()
{
 ;
 CmdMod = '\0';
 EStTop = EStBot;
 ;
 return FlowEE();
}

canonical_original_code:
static int ExeFBr()
{
 ;
 CmdMod = '\0';
 EStTop = EStBot;
 ;
 return FlowEE();
}


ExeF

decompiled_code:
__int64 __fastcall ExeF(__int64 a1)
{
__int64 v1; // rdx
int v2; // eax
__int64 result; // rax

if ( (unsigned int)IncCBP() == -1 )
return 0xFFFFFFFFLL;
v1 = (unsigned __int8)*CBfPtr;
v2 = v1 - 32;
if ( (*((_BYTE *)&ChrMsk + v1) & 0x40) == 0 )
v2 = v1;
switch ( v2 )
{
case '\'':
result = ExeFSQ(a1, v1);
break;
case '<':
result = ExeFLs(a1, v1);
break;
case '>':
result = ExeFGt(a1, v1);
break;
case 'B':
result = ExeFB(a1, v1);
break;
case 'C':
result = ExeFC(a1, v1);
break;
case 'D':
result = ExeFD(a1, v1);
break;
case 'K':
result = ExeFK(a1, v1);
break;
case 'N':
result = ExeFN(a1, v1);
break;
case 'R':
result = ExeFR(a1, v1);
break;
case 'S':
result = ExeFS(a1, v1);
break;
case '_':
result = ExeFUn(a1, v1);
break;
case '|':
result = ExeFBr(a1, v1);
break;
default:
ErrChr(6LL, v1);
return 0xFFFFFFFFLL;
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func11(__int64 a1)
{
__int64 v1; // rdx
int v2; // eax
__int64 result; // rax

if ( (unsigned int)IncCBP() == -1 )
return 0xFFFFFFFFLL;
v1 = (unsigned __int8)*CBfPtr;
v2 = v1 - 32;
if ( (*((_BYTE *)&ChrMsk + v1) & 0x40) == 0 )
v2 = v1;
switch ( v2 )
{
case '\'':
result = func9(a1, v1);
break;
case '<':
result = func0(a1, v1);
break;
case '>':
result = func8(a1, v1);
break;
case 'B':
result = ExeFB(a1, v1);
break;
case 'C':
result = func2(a1, v1);
break;
case 'D':
result = func5(a1, v1);
break;
case 'K':
result = func6(a1, v1);
break;
case 'N':
result = func1(a1, v1);
break;
case 'R':
result = func7(a1, v1);
break;
case 'S':
result = func3(a1, v1);
break;
case '_':
result = func4(a1, v1);
break;
case '|':
result = func10(a1, v1);
break;
default:
ErrChr(6LL, v1);
return 0xFFFFFFFFLL;
}
return result;
}

original_code:
DEFAULT ExeF()
{
 if (IncCBP() == (-1)) {
  return (-1);
 }
 switch (((ChrMsk[(*CBfPtr)] & '\100') ? (*CBfPtr)-' ' : (*CBfPtr) )) {
          case 'S': return ExeFS();
   case 'N': return ExeFN();
   case 'D': return ExeFD();
   case 'R': return ExeFR();
   case 'B': return ExeFB();
   case 'C': return ExeFC();
   case 'K': return ExeFK();
   case '_': return ExeFUn();
   case '>': return ExeFGt();
   case '<': return ExeFLs();
   case '\'': return ExeFSQ();
   case '|': return ExeFBr();
   default: ErrChr(6, *CBfPtr);
       return (-1);
 }
}

canonical_original_code:
int ExeF()
{
 if (IncCBP() == (-1)) {
  return (-1);
 }
 switch (((ChrMsk[(*CBfPtr)] & '\100') ? (*CBfPtr)-' ' : (*CBfPtr) )) {
          case 'S': return ExeFS();
   case 'N': return ExeFN();
   case 'D': return ExeFD();
   case 'R': return ExeFR();
   case 'B': return ExeFB();
   case 'C': return ExeFC();
   case 'K': return ExeFK();
   case '_': return ExeFUn();
   case '>': return ExeFGt();
   case '<': return ExeFLs();
   case '\'': return ExeFSQ();
   case '|': return ExeFBr();
   default: ErrChr(6, *CBfPtr);
       return (-1);
 }
}


ExePW

decompiled_code:
__int64 ExePW()
{
__int64 v1; // rax

if ( (CmdMod & 8) == 0 )
{
while ( 1 )
{
v1 = NArgmt--;
if ( v1 <= 0 )
break;
if ( (unsigned int)WrPage(CurOut, EBfBeg, EBfEnd, -1LL) == -1 )
return 0xFFFFFFFFLL;
}
goto LABEL_7;
}
if ( MArgmt == NArgmt
|| ((*CBfPtr & 0xDF) == 87 ? ZCpyBl(&ErrTxt, "m,nPW", 6LL) : ZCpyBl(&ErrTxt, "m,nP", 5LL),
(unsigned int)GetAra() != -1 && (unsigned int)WrPage(CurOut, AraBeg, AraEnd, 0LL) != -1) )
{
LABEL_7:
CmdMod = 0;
EStTop = EStBot;
return 0LL;
}
return 0xFFFFFFFFLL;
}

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

if ( (CmdMod & 8) == 0 )
{
while ( 1 )
{
v1 = NArgmt--;
if ( v1 <= 0 )
break;
if ( (unsigned int)WrPage(CurOut, EBfBeg, EBfEnd, -1LL) == -1 )
return 0xFFFFFFFFLL;
}
goto LABEL_7;
}
if ( MArgmt == NArgmt
|| ((*CBfPtr & 0xDF) == 87 ? ZCpyBl(&ErrTxt, "m,nPW", 6LL) : ZCpyBl(&ErrTxt, "m,nP", 5LL),
(unsigned int)GetAra() != -1 && (unsigned int)WrPage(CurOut, AraBeg, AraEnd, 0LL) != -1) )
{
LABEL_7:
CmdMod = 0;
EStTop = EStBot;
return 0LL;
}
return 0xFFFFFFFFLL;
}

original_code:
DEFAULT ExePW()
{
 ;
 if (CmdMod & '\10') {
  if (MArgmt != NArgmt) {
      if ((*CBfPtr == 'W') || (*CBfPtr == 'w')) {
   ZCpyBl((ErrTxt),("m,nPW"),(6));
      } else {
   ZCpyBl((ErrTxt),("m,nP"),(5));
      }
      if (GetAra() == (-1)) {
   ;
   return (-1);
      }
      if (WrPage(CurOut,AraBeg,AraEnd,0L) == (-1)) {
   ;
   return (-1);
      }
  }
 } else {
  while (NArgmt-- > 0)
   if (WrPage(CurOut,EBfBeg,EBfEnd,-1L) == (-1)) {
    ;
    return (-1);
   }
 }
 CmdMod = '\0';
 EStTop = EStBot;
 ;
 return 0;
}

canonical_original_code:
int ExePW()
{
 ;
 if (CmdMod & '\10') {
  if (MArgmt != NArgmt) {
      if ((*CBfPtr == 'W') || (*CBfPtr == 'w')) {
   ZCpyBl((ErrTxt),("m,nPW"),(6));
      } else {
   ZCpyBl((ErrTxt),("m,nP"),(5));
      }
      if (GetAra() == (-1)) {
   ;
   return (-1);
      }
      if (WrPage(CurOut,AraBeg,AraEnd,0L) == (-1)) {
   ;
   return (-1);
      }
  }
 } else {
  while (NArgmt-- > 0)
   if (WrPage(CurOut,EBfBeg,EBfEnd,-1L) == (-1)) {
    ;
    return (-1);
   }
 }
 CmdMod = '\0';
 EStTop = EStBot;
 ;
 return 0;
}


RdPage

decompiled_code:
__int64 RdPage()
{
__int64 result; // rax
int v1[3]; // [rsp+Ch] [rbp-Ch] BYREF

v1[0] = 0;
while ( 1 )
{
result = RdLine(v1);
if ( (_DWORD)result == -1 )
break;
if ( FFPage || v1[0] | *((_DWORD *)&IsEofI + CurInp) )
return 0LL;
}
return result;
}

canonical_decompiled_code:
__int64 func0()
{
__int64 result; // rax
int v1[3]; // [rsp+Ch] [rbp-Ch] BYREF

v1[0] = 0;
while ( 1 )
{
result = RdLine(v1);
if ( (_DWORD)result == -1 )
break;
if ( FFPage || v1[0] | *((_DWORD *)&IsEofI + CurInp) )
return 0LL;
}
return result;
}

original_code:
DEFAULT RdPage()
{
 BOOLEAN EBfFul;
 ;
 EBfFul = 0;
 do {
  if (RdLine(&EBfFul) == (-1)) {
   ;
   return (-1);
  }
 } while (!IsEofI[CurInp] && !FFPage && !EBfFul);
 ;
 return 0;
}

canonical_original_code:
int RdPage()
{
 int EBfFul;
 ;
 EBfFul = 0;
 do {
  if (RdLine(&EBfFul) == (-1)) {
   ;
   return (-1);
  }
 } while (!IsEofI[CurInp] && !FFPage && !EBfFul);
 ;
 return 0;
}

variable_types: EBfFul int


ExeS

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

if ( (CmdMod & 8) != 0 )
{
ErrStr(8LL, "m,nS");
result = 0xFFFFFFFFLL;
}
else
{
if ( (CmdMod & 4) == 0 )
{
SrcTyp = 5;
if ( (unsigned int)Search(0LL) != -1 )
{
CmdMod = 0;
return 0LL;
}
return 0xFFFFFFFFLL;
}
if ( EStTop <= EStBot )
{
if ( GapEnd == EBfEnd )
{
if ( (unsigned int)FindES(27LL) != -1 )
return PushEx(0LL, 0LL);
}
else
{
MArgmt = GapBeg - EBfBeg;
CmdMod = CmdMod & 0xFB | 0xA;
if ( (unsigned int)PushEx(GapBeg - EBfBeg + 1LL, 0LL) != -1 )
return ExeFB();
}
return 0xFFFFFFFFLL;
}
ErrStr(8LL, "n::S");
result = 0xFFFFFFFFLL;
}
return result;
}

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

if ( (CmdMod & 8) != 0 )
{
ErrStr(8LL, "m,nS");
result = 0xFFFFFFFFLL;
}
else
{
if ( (CmdMod & 4) == 0 )
{
SrcTyp = 5;
if ( (unsigned int)Search(0LL) != -1 )
{
CmdMod = 0;
return 0LL;
}
return 0xFFFFFFFFLL;
}
if ( EStTop <= EStBot )
{
if ( GapEnd == EBfEnd )
{
if ( (unsigned int)FindES(27LL) != -1 )
return PushEx(0LL, 0LL);
}
else
{
MArgmt = GapBeg - EBfBeg;
CmdMod = CmdMod & 0xFB | 0xA;
if ( (unsigned int)PushEx(GapBeg - EBfBeg + 1LL, 0LL) != -1 )
return ExeFB();
}
return 0xFFFFFFFFLL;
}
ErrStr(8LL, "n::S");
result = 0xFFFFFFFFLL;
}
return result;
}

original_code:
DEFAULT ExeS()
{
 ;
 if (CmdMod & '\10') {
  ErrStr(8, "m,nS");
  ;
  return (-1);
 }
 if (CmdMod & '\4') {
  if (CmdMod & '\10') {
   ErrStr(8, "m,n::S");
   ;
   return (-1);
  }
  if (EStTop > EStBot) {
   ErrStr(8, "n::S");
   ;
   return (-1);
  }
  if (GapEnd == EBfEnd) {
   if (FindES('\033') == (-1)) {
    ;
    return (-1);
   }
   ;
   return PushEx(0L,0);
  }
  CmdMod &= ~'\4';
  CmdMod |= '\2';
  CmdMod |= '\10';
  MArgmt = GapBeg - EBfBeg;
  if (PushEx((LONG)((GapBeg-EBfBeg)+1),0) == (-1)) {
   ;
   return (-1);
  }
  ;
  return ExeFB();
 }
 SrcTyp = 5;
 if (Search(0) == (-1)) {
  ;
  return (-1);
 }
 CmdMod = '\0';
 ;
 return 0;
}

canonical_original_code:
int ExeS()
{
 ;
 if (CmdMod & '\10') {
  ErrStr(8, "m,nS");
  ;
  return (-1);
 }
 if (CmdMod & '\4') {
  if (CmdMod & '\10') {
   ErrStr(8, "m,n::S");
   ;
   return (-1);
  }
  if (EStTop > EStBot) {
   ErrStr(8, "n::S");
   ;
   return (-1);
  }
  if (GapEnd == EBfEnd) {
   if (FindES('\033') == (-1)) {
    ;
    return (-1);
   }
   ;
   return PushEx(0L,0);
  }
  CmdMod &= ~'\4';
  CmdMod |= '\2';
  CmdMod |= '\10';
  MArgmt = GapBeg - EBfBeg;
  if (PushEx((LONG)((GapBeg-EBfBeg)+1),0) == (-1)) {
   ;
   return (-1);
  }
  ;
  return ExeFB();
 }
 SrcTyp = 5;
 if (Search(0) == (-1)) {
  ;
  return (-1);
 }
 CmdMod = '\0';
 ;
 return 0;
}


ExeCtY

decompiled_code:
__int64 ExeCtY()
{
CmdMod |= 8u;
MArgmt = GapBeg - EBfBeg + RefLen;
return PushEx(GapBeg - EBfBeg, 0LL);
}

canonical_decompiled_code:
__int64 func0()
{
CmdMod |= 8u;
MArgmt = GapBeg - EBfBeg + RefLen;
return PushEx(GapBeg - EBfBeg, 0LL);
}

original_code:
DEFAULT ExeCtY()
{
 ;
 MArgmt = (GapBeg-EBfBeg) + RefLen;
 CmdMod |= '\10';
 ;
 return PushEx((LONG)(GapBeg-EBfBeg), 0);
}

canonical_original_code:
int ExeCtY()
{
 ;
 MArgmt = (GapBeg-EBfBeg) + RefLen;
 CmdMod |= '\10';
 ;
 return PushEx((LONG)(GapBeg-EBfBeg), 0);
}


GetNmA

decompiled_code:
__int64 __fastcall GetNmA(__int64 a1, __int64 a2)
{
__int64 v2; // rax
__int64 result; // rax

if ( *((_DWORD *)&EStack + 4 * EStTop + 2) )
{
ErrMsg(43LL, a2, EStTop);
result = 0xFFFFFFFFLL;
}
else
{
v2 = *((_QWORD *)&EStack + 2 * EStTop);
--EStTop;
NArgmt = v2;
result = 0LL;
}
return result;
}

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

if ( *((_DWORD *)&EStack + 4 * EStTop + 2) )
{
ErrMsg(43LL, a2, EStTop);
result = 0xFFFFFFFFLL;
}
else
{
v2 = *((_QWORD *)&EStack + 2 * EStTop);
--EStTop;
NArgmt = v2;
result = 0LL;
}
return result;
}

original_code:
DEFAULT GetNmA()
{
    ;
    if (EStack[EStTop].ElType == 0) {
 NArgmt = EStack[EStTop].Elemnt;
 --EStTop;
 return 0;
    }
    ErrMsg(43);
    ;
    return (-1);
}

canonical_original_code:
int GetNmA()
{
    ;
    if (EStack[EStTop].ElType == 0) {
 NArgmt = EStack[EStTop].Elemnt;
 --EStTop;
 return 0;
    }
    ErrMsg(43);
    ;
    return (-1);
}


ExeCtO

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

Radix = 8;
result = 0LL;
CmdMod = 0;
return result;
}

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

Radix = 8;
result = 0LL;
CmdMod = 0;
return result;
}

original_code:
DEFAULT ExeCtO()
{
 ;
 Radix = 8;
 CmdMod = '\0';
 ;
 return 0;
}

canonical_original_code:
int ExeCtO()
{
 ;
 Radix = 8;
 CmdMod = '\0';
 ;
 return 0;
}