foldcmp

decompiled_code:
__int64 __fastcall foldcmp(const char *a1, const char *a2)
{
size_t v3; // rbp
unsigned __int64 v4; // rbx
size_t v5; // rax
const __int32_t *v6; // rcx
__int64 v7; // rax
__int32_t v8; // esi
__int32_t v9; // edx

v3 = pos2;
v4 = pos1;
if ( !pos2 )
{
v3 = strlen(a1);
v5 = strlen(a2);
if ( v5 <= v3 )
v3 = v5;
}
v6 = *_ctype_tolower_loc();
while ( 1 )
{
v7 = a1[v4];
v8 = v6[a2[v4]];
v9 = v6[v7];
if ( v9 != v8 || v3 <= v4 )
return (unsigned int)(v9 - v8);
if ( !(_BYTE)v7 )
break;
++v4;
}
return 0LL;
}

canonical_decompiled_code:
__int64 __fastcall func3(const char *a1, const char *a2)
{
size_t v3; // rbp
unsigned __int64 v4; // rbx
size_t v5; // rax
const __int32_t *v6; // rcx
__int64 v7; // rax
__int32_t v8; // esi
__int32_t v9; // edx

v3 = pos2;
v4 = pos1;
if ( !pos2 )
{
v3 = strlen(a1);
v5 = strlen(a2);
if ( v5 <= v3 )
v3 = v5;
}
v6 = *_ctype_tolower_loc();
while ( 1 )
{
v7 = a1[v4];
v8 = v6[a2[v4]];
v9 = v6[v7];
if ( v9 != v8 || v3 <= v4 )
return (unsigned int)(v9 - v8);
if ( !(_BYTE)v7 )
break;
++v4;
}
return 0LL;
}

original_code:
static int foldcmp(const char *s, const char *t) {
    size_t i = pos1;
    size_t j = pos1;
    size_t endpos;
    if (pos2 > 0)
        endpos = pos2;
    else if ((endpos = strlen(s)) > strlen(t))
        endpos = strlen(t);
    for ( ; tolower(s[i]) == tolower(t[j]) && i < endpos && j < endpos; i++, j++)
        if (s[i] == '\0')
            return 0;
    return tolower(s[i]) - tolower(t[j]);
}

canonical_original_code:
static int foldcmp(char *s, char *t) {
    unsigned long i = pos1;
    unsigned long j = pos1;
    unsigned long endpos;
    if (pos2 > 0)
        endpos = pos2;
    else if ((endpos = strlen(s)) > strlen(t))
        endpos = strlen(t);
    for ( ; tolower(s[i]) == tolower(t[j]) && i < endpos && j < endpos; i++, j++)
        if (s[i] == '\0')
            return 0;
    return tolower(s[i]) - tolower(t[j]);
}


folddircmp

repo: ptdecker/cbasics

original_code:
static int folddircmp(const char *s, const char *t) {
    char a;
    char b;
    size_t i = pos1;
    size_t j = pos1;
    size_t endpos;
    if (pos2 > 0)
        endpos = pos2;
    else if ((endpos = strlen(s)) > strlen(t))
        endpos = strlen(t);
    do {
        while (i < endpos && !((*__ctype_b_loc ())[(int) ((s[i]))] & (unsigned short int) _ISalnum) && s[i] != ' ' && s[i] != '\0')
            i++;
        while (j < endpos && !((*__ctype_b_loc ())[(int) ((t[j]))] & (unsigned short int) _ISalnum) && t[j] != ' ' && t[j] != '\0')
            j++;
        a = tolower(s[i++]);
        b = tolower(t[j++]);
        if (a == '\0' && b == '\0')
            return 0;
    } while (a == b && i < endpos && j < endpos);
    return a - b;
}

canonical_original_code:
static int folddircmp(char *s, char *t) {
    char a;
    char b;
    unsigned long i = pos1;
    unsigned long j = pos1;
    unsigned long endpos;
    if (pos2 > 0)
        endpos = pos2;
    else if ((endpos = strlen(s)) > strlen(t))
        endpos = strlen(t);
    do {
        while (i < endpos && !((*__ctype_b_loc ())[(int) ((s[i]))] & (unsigned short) _ISalnum) && s[i] != ' ' && s[i] != '\0')
            i++;
        while (j < endpos && !((*__ctype_b_loc ())[(int) ((t[j]))] & (unsigned short) _ISalnum) && t[j] != ' ' && t[j] != '\0')
            j++;
        a = tolower(s[i++]);
        b = tolower(t[j++]);
        if (a == '\0' && b == '\0')
            return 0;
    } while (a == b && i < endpos && j < endpos);
    return a - b;
}

variable_types:
s
char *

variable_types:
t
char *

variable_types: a char

variable_types: b char

variable_types:
i
unsigned long

variable_types:
j
unsigned long

variable_types:
endpos
unsigned long

return_type: int


numcmp

decompiled_code:
__int64 __fastcall numcmp(char *nptr, char *a2)
{
double v2; // xmm0_8
__int64 result; // rax
double v4; // [rsp+8h] [rbp-410h]
char v5[1032]; // [rsp+10h] [rbp-408h] BYREF

substr(nptr, v5);
v4 = atof(nptr);
substr(a2, v5);
v2 = atof(a2);
result = 0xFFFFFFFFLL;
if ( v2 <= v4 )
result = v4 > v2;
return result;
}

canonical_decompiled_code:
__int64 __fastcall func5(char *nptr, char *a2)
{
double v2; // xmm0_8
__int64 result; // rax
double v4; // [rsp+8h] [rbp-410h]
char v5[1032]; // [rsp+10h] [rbp-408h] BYREF

substr(nptr, v5);
v4 = atof(nptr);
substr(a2, v5);
v2 = atof(a2);
result = 0xFFFFFFFFLL;
if ( v2 <= v4 )
result = v4 > v2;
return result;
}

original_code:
static int numcmp(const char *s1, const char *s2) {
    double v1;
    double v2;
    char str[1000];
    substr(s1, str);
    v1 = atof(s1);
    substr(s2, str);
    v2 = atof(s2);
    if (v1 < v2)
        return -1;
    else if (v1 > v2)
        return 1;
    else
        return 0;
}

canonical_original_code:
static int numcmp(char *s1, char *s2) {
    double v1;
    double v2;
    char str[1000];
    substr(s1, str);
    v1 = atof(s1);
    substr(s2, str);
    v2 = atof(s2);
    if (v1 < v2)
        return -1;
    else if (v1 > v2)
        return 1;
    else
        return 0;
}

variable_types:
str
char [1000]


main

canonical_name: main

decompiled_code:
int __cdecl main(int argc, const char **argv, const char **envp)
{
int v3; // eax
int v4; // ebp
int v5; // esi

readargs(argc, argv);
v3 = readlines_constprop_0();
if ( v3 < 0 )
{
puts("Input is too big to sort");
exit(1);
}
v4 = v3;
v5 = v3 - 1;
if ( numeric )
{
myqsort_constprop_0(0, v5, (int (__fastcall *)(__int64, __int64))numcmp);
}
else if ( fold )
{
if ( dir )
myqsort_constprop_0(0, v5, (int (__fastcall *)(__int64, __int64))folddircmp);
else
myqsort_constprop_0(0, v5, (int (__fastcall *)(__int64, __int64))foldcmp);
}
else if ( dir )
{
myqsort_constprop_0(0, v5, (int (__fastcall *)(__int64, __int64))dircmp);
}
else
{
myqsort_constprop_0(0, v5, (int (__fastcall *)(__int64, __int64))&strcmp);
}
writelines_constprop_0(v4, descend);
return 0;
}

canonical_decompiled_code:
int __cdecl main(int argc, const char **argv, const char **envp)
{
int v3; // eax
int v4; // ebp
int v5; // esi

func6(argc, argv);
v3 = func11();
if ( v3 < 0 )
{
puts("Input is too big to sort");
exit(1);
}
v4 = v3;
v5 = v3 - 1;
if ( numeric )
{
func8(0, v5, (int (__fastcall *)(__int64, __int64))numcmp);
}
else if ( fold )
{
if ( dir )
func8(0, v5, (int (__fastcall *)(__int64, __int64))folddircmp);
else
func8(0, v5, (int (__fastcall *)(__int64, __int64))foldcmp);
}
else if ( dir )
{
func8(0, v5, (int (__fastcall *)(__int64, __int64))dircmp);
}
else
{
func8(0, v5, (int (__fastcall *)(__int64, __int64))&strcmp);
}
func9(v4, descend);
return 0;
}

original_code:
int main(int argc, char *argv[]) {
    int nlines;
    readargs(argc, argv);
    if ((nlines = readlines(lineptr, 10000)) < 0) {
        printf("Input is too big to sort\n");
        exit(1);
    }
    if (numeric)
        myqsort(
                (void **) lineptr,
                0,
                nlines - 1,
                (int (*)(void*, void*))numcmp
            );
    else if (fold && dir)
        myqsort(
                (void **) lineptr,
                0,
                nlines - 1,
                (int (*)(void*, void*))folddircmp
            );
    else if (fold)
        myqsort(
                (void **) lineptr,
                0,
                nlines - 1,
                (int (*)(void*, void*))foldcmp
            );
    else if (dir)
        myqsort(
                (void **) lineptr,
                0,
                nlines - 1,
                (int (*)(void*, void*))dircmp
            );
    else
        myqsort(
                (void **) lineptr,
                0,
                nlines - 1,
                (int (*)(void*, void*))strcmp
            );
    writelines(lineptr, nlines, descend);
    return 0;
}

canonical_original_code:
int main(int argc, char *argv[]) {
    int nlines;
    readargs(argc, argv);
    if ((nlines = readlines(lineptr, 10000)) < 0) {
        printf("Input is too big to sort\n");
        exit(1);
    }
    if (numeric)
        myqsort(
                (void **) lineptr,
                0,
                nlines - 1,
                (int (*)(void *, void *))numcmp
            );
    else if (fold && dir)
        myqsort(
                (void **) lineptr,
                0,
                nlines - 1,
                (int (*)(void *, void *))folddircmp
            );
    else if (fold)
        myqsort(
                (void **) lineptr,
                0,
                nlines - 1,
                (int (*)(void *, void *))foldcmp
            );
    else if (dir)
        myqsort(
                (void **) lineptr,
                0,
                nlines - 1,
                (int (*)(void *, void *))dircmp
            );
    else
        myqsort(
                (void **) lineptr,
                0,
                nlines - 1,
                (int (*)(void *, void *))strcmp
            );
    writelines(lineptr, nlines, descend);
    return 0;
}

variable_types: argc int

variable_types:
argv
char *[]

variable_types: nlines int


strcat

decompiled_code:
__int64 __fastcall strcat(_BYTE *a1, __int64 a2)
{
__int64 result; // rax
char v3; // dl

while ( *a1 )
++a1;
result = 0LL;
do
{
v3 = *(_BYTE *)(a2 + result);
a1[result++] = v3;
}
while ( v3 );
return result;
}

canonical_decompiled_code:
__int64 __fastcall func0(_BYTE *a1, __int64 a2)
{
__int64 result; // rax
char v3; // dl

while ( *a1 )
++a1;
result = 0LL;
do
{
v3 = *(_BYTE *)(a2 + result);
a1[result++] = v3;
}
while ( v3 );
return result;
}

original_code:
static void strcat(char *leftstr, char *rightstr) {
    while (*leftstr != '\0')
        leftstr++;
    while ((*leftstr++ = *rightstr++) != '\0')
        ;
}

variable_types:
leftstr
char *

variable_types:
rightstr
char *

return_type: void


main

original_code:
int main(void) {
    char string1[1000] = "This is the first string";
    char string2[1000] = "And this is a second";
    printf("Adding \"%s\" to the end of \"%s\" results in: ", string2, string1);
    strcat(string1, string2);
    printf("\"%s\"\n", string1);
    return 0;
}

canonical_original_code:
int main() {
    char string1[1000] = "This is the first string";
    char string2[1000] = "And this is a second";
    printf("Adding \"%s\" to the end of \"%s\" results in: ", string2, string1);
    strcat(string1, string2);
    printf("\"%s\"\n", string1);
    return 0;
}


header

decompiled_code:
__int64 __fastcall header(const char *a1, unsigned int a2)
{
fprintf(stdout, "\n\n%s\t(page %d)\n", a1, a2);
fputc(10, stdout);
fputc(10, stdout);
return 6LL;
}

canonical_decompiled_code:
__int64 __fastcall func0(const char *a1, unsigned int a2)
{
fprintf(stdout, "\n\n%s\t(page %d)\n", a1, a2);
fputc(10, stdout);
fputc(10, stdout);
return 6LL;
}

original_code:
static int header(char *fname, int pageno) {
    int ln = 3;
    fprintf(stdout, "\n\n%s\t(page %d)\n", fname, pageno);
    while (ln++ < 5)
        fprintf(stdout, "\n");
    return ln;
}

variable_types:
fname
char *

variable_types: pageno int

variable_types: ln int


footer

decompiled_code:
int footer()
{
return fputc(12, stdout);
}

canonical_decompiled_code:
int func1()
{
return fputc(12, stdout);
}

original_code:
static void footer(void) {
    fprintf(stdout, "\f");
}

canonical_original_code:
static void footer() {
    fprintf(stdout, "\f");
}


bitcount

decompiled_code:
__int64 __fastcall bitcount(int a1)
{
unsigned int i; // er8

for ( i = 0; a1; a1 &= a1 - 1 )
++i;
return i;
}

canonical_decompiled_code:
__int64 __fastcall func0(int a1)
{
unsigned int i; // er8

for ( i = 0; a1; a1 &= a1 - 1 )
++i;
return i;
}

original_code:
static unsigned bitcount(int x) {
        unsigned bits;
        unsigned ux;
        ux = (unsigned)x;
        for (bits = 0; ux != 0; ux &= (ux - 1))
            bits++;
        return bits;
    }

canonical_original_code:
static unsigned int bitcount(int x) {
        unsigned int bits;
        unsigned int ux;
        ux = (unsigned int)x;
        for (bits = 0; ux != 0; ux &= (ux - 1))
            bits++;
        return bits;
    }

variable_types: x int

variable_types:
bits
unsigned int

variable_types:
ux
unsigned int

return_type: unsigned int


printbits

decompiled_code:
int __fastcall printbits(int a1)
{
int v1; // ebx
int result; // eax

v1 = 32;
printf("0b");
do
{
while ( (a1 & (1 << --v1)) != 0 )
{
result = putchar(49);
if ( !v1 )
return result;
}
result = putchar(48);
}
while ( v1 );
return result;
}

canonical_decompiled_code:
int __fastcall func1(int a1)
{
int v1; // ebx
int result; // eax

v1 = 32;
printf("0b");
do
{
while ( (a1 & (1 << --v1)) != 0 )
{
result = putchar(49);
if ( !v1 )
return result;
}
result = putchar(48);
}
while ( v1 );
return result;
}

original_code:
static void printbits(unsigned x) {
    unsigned i;
    printf("0b");
    for(i = (unsigned)(8 * sizeof(int)); i > 0; i--)
        (_Bool)(x & (1 << (i - 1))) ? putchar('1') : putchar('0');
}

canonical_original_code:
static void printbits(unsigned int x) {
    unsigned int i;
    printf("0b");
    for(i = (unsigned int)(8 * sizeof(int)); i > 0; i--)
        (_Bool)(x & (1 << (i - 1))) ? putchar('1') : putchar('0');
}

variable_types:
x
unsigned int

variable_types:
i
unsigned int


makepoint

decompiled_code:
__int64 __fastcall makepoint(unsigned int a1, __int64 a2)
{
return (a2 << 32) | a1;
}

canonical_decompiled_code:
__int64 __fastcall func0(unsigned int a1, __int64 a2)
{
return (a2 << 32) | a1;
}

original_code:
static struct point makepoint(const int x, const int y) {
    struct point temp;
    temp.x = x;
    temp.y = y;
    return temp;
}

canonical_original_code:
static struct point makepoint(int x, int y) {
    struct point temp;
    temp.x = x;
    temp.y = y;
    return temp;
}

variable_types: y int

variable_types:
temp
struct point { int x; int y; }

return_type: struct point { int x; int y; }


canonrect

decompiled_code:
__int64 __fastcall canonrect(__int64 a1, __int64 a2)
{
unsigned int v2; // ecx
__int64 v3; // r8

v2 = a2;
if ( (int)a1 <= (int)a2 )
v2 = a1;
v3 = HIDWORD(a2);
if ( SHIDWORD(a1) <= SHIDWORD(a2) )
v3 = HIDWORD(a1);
return (v3 << 32) | v2;
}

canonical_decompiled_code:
__int64 __fastcall func1(__int64 a1, __int64 a2)
{
unsigned int v2; // ecx
__int64 v3; // r8

v2 = a2;
if ( (int)a1 <= (int)a2 )
v2 = a1;
v3 = HIDWORD(a2);
if ( SHIDWORD(a1) <= SHIDWORD(a2) )
v3 = HIDWORD(a1);
return (v3 << 32) | v2;
}

original_code:
static struct rect canonrect(const struct rect r) {
    struct rect temp;
    temp.p1.x = ((r.p1.x) < (r.p2.x) ? (r.p1.x) : (r.p2.x));
    temp.p1.y = ((r.p1.y) < (r.p2.y) ? (r.p1.y) : (r.p2.y));
    temp.p2.x = ((r.p1.x) > (r.p2.x) ? (r.p1.x) : (r.p2.x));
    temp.p2.y = ((r.p1.y) > (r.p2.y) ? (r.p1.y) : (r.p2.y));
    return temp;
}

canonical_original_code:
static struct rect canonrect(struct rect r) {
    struct rect temp;
    temp.p1.x = ((r.p1.x) < (r.p2.x) ? (r.p1.x) : (r.p2.x));
    temp.p1.y = ((r.p1.y) < (r.p2.y) ? (r.p1.y) : (r.p2.y));
    temp.p2.x = ((r.p1.x) > (r.p2.x) ? (r.p1.x) : (r.p2.x));
    temp.p2.y = ((r.p1.y) > (r.p2.y) ? (r.p1.y) : (r.p2.y));
    return temp;
}

variable_types:
r
struct rect

variable_types: struct rect { struct point { int x; int y; } p1; struct point p2; }

user_defined_types: struct rect { struct point p1; struct point p2; }


origindist

decompiled_code:
void __fastcall origindist(__int64 a1)
{
double v1; // xmm0_8

v1 = (double)(int)a1 * (double)(int)a1 + (double)SHIDWORD(a1) * (double)SHIDWORD(a1);
if ( v1 < 0.0 )
sqrt(v1);
}

canonical_decompiled_code:
void __fastcall func2(__int64 a1)
{
double v1; // xmm0_8

v1 = (double)(int)a1 * (double)(int)a1 + (double)SHIDWORD(a1) * (double)SHIDWORD(a1);
if ( v1 < 0.0 )
sqrt(v1);
}

original_code:
static double origindist(const struct point pt) {
    return sqrt((double)pt.x * pt.x + (double)pt.y * pt.y);
}

canonical_original_code:
static double origindist(struct point pt) {
    return sqrt((double)pt.x * pt.x + (double)pt.y * pt.y);
}

variable_types:
pt
struct point { int x; int y; }

return_type: double


main

decompiled_code:
int __cdecl main(int argc, const char **argv, const char **envp)
{
double v3; // xmm0_8
__int64 v4; // r14
__int64 v5; // rbp
unsigned __int64 v6; // r12
__int64 v7; // r13
__int64 v8; // rbx
__int64 v9; // rax
unsigned __int64 v10; // rdx
void *v11; // rsi
char v12; // al
void *v13; // rcx
unsigned __int64 v15; // [rsp+10h] [rbp-48h]
__int64 v16; // [rsp+18h] [rbp-40h]

v4 = makepoint(0xAu, 20LL);
v5 = makepoint(0xC8u, 400LL);
v6 = makepoint(0x71u, 42LL);
v7 = makepoint(0xA0u, 100LL);
v8 = addpoint_constprop_0(0xC800000140LL, 0xC800000140LL);
v9 = canonrect(v5, v6);
v15 = v10;
v16 = v9;
printf("Point 'pt' is at coordinates (%d, %d)\n", (unsigned int)v4, v4 >> 32);
printf("Point 'origin' is at coordinate (%d, %d)\n", 0LL, 0LL);
printf("Or, when we access it another way with '->' it is still at (%d, %d)\n", 0LL, 0LL);
printf("Point 'maxpt' is at coordinates (%d, %d)\n", 320LL, 200LL);
printf("This point added with itself is (%d, %d)\n", (unsigned int)v8, HIDWORD(v8));
origindist(v4);
printf("The distance between 'pt' and the origin is %f\n", v3);
printf("Rectangle 'screen' is defined by points (%d, %d) and (%d, %d)\n", 0LL, 0LL, 320LL, 200LL);
printf("The midpoint between these two points is (%d, %d)\n", (unsigned int)v7, v7 >> 32);
v11 = &unk_F1;
if ( (unsigned __int8)ptinrect_constprop_0(v7, 0LL, 0xC800000140LL) )
v11 = &unk_ED;
printf("Is the midpoint inside the rectangle 'screen'? %s\n", v11);
v12 = ptinrect_constprop_0(v8, 0LL, 0xC800000140LL);
v13 = &unk_F1;
if ( v12 )
v13 = &unk_ED;
printf("Is point (%d, %d) inside the rectangle 'screen'? %s\n", (unsigned int)v8, HIDWORD(v8), v13);
printf(
"A non-canonical rectange example is defined by (%d, %d) and (%d, %d)\n",
(unsigned int)v5,
v5 >> 32,
(unsigned int)v6,
HIDWORD(v6));
printf(
"And it's canonical version is (%d, %d) and (%d, %d)\n",
(unsigned int)v16,
v16 >> 32,
(unsigned int)v15,
HIDWORD(v15));
return 0;
}

canonical_decompiled_code:
int __cdecl main(int argc, const char **argv, const char **envp)
{
double v3; // xmm0_8
__int64 v4; // r14
__int64 v5; // rbp
unsigned __int64 v6; // r12
__int64 v7; // r13
__int64 v8; // rbx
__int64 v9; // rax
unsigned __int64 v10; // rdx
void *v11; // rsi
char v12; // al
void *v13; // rcx
unsigned __int64 v15; // [rsp+10h] [rbp-48h]
__int64 v16; // [rsp+18h] [rbp-40h]

v4 = func0(0xAu, 20LL);
v5 = func0(0xC8u, 400LL);
v6 = func0(0x71u, 42LL);
v7 = func0(0xA0u, 100LL);
v8 = func4(0xC800000140LL, 0xC800000140LL);
v9 = func1(v5, v6);
v15 = v10;
v16 = v9;
printf("Point 'pt' is at coordinates (%d, %d)\n", (unsigned int)v4, v4 >> 32);
printf("Point 'origin' is at coordinate (%d, %d)\n", 0LL, 0LL);
printf("Or, when we access it another way with '->' it is still at (%d, %d)\n", 0LL, 0LL);
printf("Point 'maxpt' is at coordinates (%d, %d)\n", 320LL, 200LL);
printf("This point added with itself is (%d, %d)\n", (unsigned int)v8, HIDWORD(v8));
func2(v4);
printf("The distance between 'pt' and the origin is %f\n", v3);
printf("Rectangle 'screen' is defined by points (%d, %d) and (%d, %d)\n", 0LL, 0LL, 320LL, 200LL);
printf("The midpoint between these two points is (%d, %d)\n", (unsigned int)v7, v7 >> 32);
v11 = &unk_F1;
if ( (unsigned __int8)func3(v7, 0LL, 0xC800000140LL) )
v11 = &unk_ED;
printf("Is the midpoint inside the rectangle 'screen'? %s\n", v11);
v12 = func3(v8, 0LL, 0xC800000140LL);
v13 = &unk_F1;
if ( v12 )
v13 = &unk_ED;
printf("Is point (%d, %d) inside the rectangle 'screen'? %s\n", (unsigned int)v8, HIDWORD(v8), v13);
printf(
"A non-canonical rectange example is defined by (%d, %d) and (%d, %d)\n",
(unsigned int)v5,
v5 >> 32,
(unsigned int)v6,
HIDWORD(v6));
printf(
"And it's canonical version is (%d, %d) and (%d, %d)\n",
(unsigned int)v16,
v16 >> 32,
(unsigned int)v15,
HIDWORD(v15));
return 0;
}

original_code:
int main(void) {
    struct point pt;
    struct point origin = { 0, 0 };
    struct point maxpt = { 320, 200 };
    struct point middle;
    struct point outside;
    struct rect screen;
    struct rect noncanon;
    struct rect canon;
    struct point *porigin;
    pt = makepoint(10, 20);
    screen.p1.x = 0;
    screen.p1.y = 0;
    screen.p2 = maxpt;
    noncanon.p1 = makepoint(200, 400);
    noncanon.p2 = makepoint(113, 42);
    middle = makepoint((screen.p1.x + screen.p2.x) / 2,
                       (screen.p1.y + screen.p2.y) / 2);
    outside = addpoint(maxpt, maxpt);
    canon = canonrect(noncanon);
    porigin = &origin;
    printf("Point 'pt' is at coordinates (%d, %d)\n", pt.x, pt.y);
    printf("Point 'origin' is at coordinate (%d, %d)\n", (*porigin).x, (*porigin).y);
    printf("Or, when we access it another way with '->' it is still at (%d, %d)\n", porigin->x, porigin->y);
    printf("Point 'maxpt' is at coordinates (%d, %d)\n", maxpt.x, maxpt.y);
    printf("This point added with itself is (%d, %d)\n", outside.x, outside.y);
    printf("The distance between 'pt' and the origin is %f\n", origindist(pt));
    printf("Rectangle 'screen' is defined by points (%d, %d) and (%d, %d)\n", screen.p1.x, screen.p1.y, screen.p2.x, screen.p2.y);
    printf("The midpoint between these two points is (%d, %d)\n", middle.x, middle.y);
    printf("Is the midpoint inside the rectangle 'screen'?  %s\n", ptinrect(middle, screen) ? "Yes" : "No");
    printf("Is point (%d, %d) inside the rectangle 'screen'?  %s\n", outside.x, outside.y, ptinrect(outside, screen) ? "Yes" : "No");
    printf("A non-canonical rectange example is defined by (%d, %d) and (%d, %d)\n", noncanon.p1.x, noncanon.p1.y, noncanon.p2.x, noncanon.p2.y);
    printf("And it's canonical version is (%d, %d) and (%d, %d)\n", canon.p1.x, canon.p1.y, canon.p2.x, canon.p2.y);
    return 0;
}

canonical_original_code:
int main() {
    struct point pt;
    struct point origin = { 0, 0 };
    struct point maxpt = { 320, 200 };
    struct point middle;
    struct point outside;
    struct rect screen;
    struct rect noncanon;
    struct rect canon;
    struct point *porigin;
    pt = makepoint(10, 20);
    screen.p1.x = 0;
    screen.p1.y = 0;
    screen.p2 = maxpt;
    noncanon.p1 = makepoint(200, 400);
    noncanon.p2 = makepoint(113, 42);
    middle = makepoint((screen.p1.x + screen.p2.x) / 2,
                       (screen.p1.y + screen.p2.y) / 2);
    outside = addpoint(maxpt, maxpt);
    canon = canonrect(noncanon);
    porigin = &origin;
    printf("Point 'pt' is at coordinates (%d, %d)\n", pt.x, pt.y);
    printf("Point 'origin' is at coordinate (%d, %d)\n", (*porigin).x, (*porigin).y);
    printf("Or, when we access it another way with '->' it is still at (%d, %d)\n", porigin->x, porigin->y);
    printf("Point 'maxpt' is at coordinates (%d, %d)\n", maxpt.x, maxpt.y);
    printf("This point added with itself is (%d, %d)\n", outside.x, outside.y);
    printf("The distance between 'pt' and the origin is %f\n", origindist(pt));
    printf("Rectangle 'screen' is defined by points (%d, %d) and (%d, %d)\n", screen.p1.x, screen.p1.y, screen.p2.x, screen.p2.y);
    printf("The midpoint between these two points is (%d, %d)\n", middle.x, middle.y);
    printf("Is the midpoint inside the rectangle 'screen'?  %s\n", ptinrect(middle, screen) ? "Yes" : "No");
    printf("Is point (%d, %d) inside the rectangle 'screen'?  %s\n", outside.x, outside.y, ptinrect(outside, screen) ? "Yes" : "No");
    printf("A non-canonical rectange example is defined by (%d, %d) and (%d, %d)\n", noncanon.p1.x, noncanon.p1.y, noncanon.p2.x, noncanon.p2.y);
    printf("And it's canonical version is (%d, %d) and (%d, %d)\n", canon.p1.x, canon.p1.y, canon.p2.x, canon.p2.y);
    return 0;
}

variable_types:
origin
struct point { int x; int y; }

variable_types:
maxpt
struct point { int x; int y; }

variable_types:
middle
struct point { int x; int y; }

variable_types:
outside
struct point { int x; int y; }

variable_types:
porigin
struct point { int x; int y; } *


gettoken

decompiled_code:
__int64 gettoken()
{
int v0; // eax
unsigned int v1; // er12
const unsigned __int16 **v2; // rbx
__int64 result; // rax
char *v4; // rbx
char v5; // al
char *i; // r12
const unsigned __int16 *v7; // rbp
int v8; // eax
int v9; // eax

if ( prevtoken )
{
prevtoken = 0;
result = (unsigned int)tokentype;
}
else
{
do
{
do
{
v0 = getch();
v1 = v0;
}
while ( v0 == 32 );
}
while ( v0 == 9 );
if ( v0 == 40 )
{
v9 = getch();
if ( v9 == 41 )
{
v1 = 1;
strcpy(token, "()");
tokentype = 1;
}
else
{
ungetch(v9);
tokentype = 40;
}
return v1;
}
if ( v0 == 91 )
{
token[0] = 91;
v4 = &token[1];
do
{
v5 = getch();
*v4++ = v5;
}
while ( v5 != 93 );
*v4 = 0;
v1 = 2;
tokentype = 2;
return v1;
}
v2 = _ctype_b_loc();
if ( ((*v2)[v1] & 0x400) == 0 )
{
tokentype = v1;
return v1;
}
token[0] = v1;
for ( i = &token[1]; ; ++i )
{
v7 = *v2;
v8 = getch();
if ( (v7[v8] & 8) == 0 )
break;
*i = v8;
}
*i = 0;
ungetch(v8);
result = 0LL;
tokentype = 0;
}
return result;
}

canonical_decompiled_code:
__int64 func2()
{
int v0; // eax
unsigned int v1; // er12
const unsigned __int16 **v2; // rbx
__int64 result; // rax
char *v4; // rbx
char v5; // al
char *i; // r12
const unsigned __int16 *v7; // rbp
int v8; // eax
int v9; // eax

if ( prevtoken )
{
prevtoken = 0;
result = (unsigned int)tokentype;
}
else
{
do
{
do
{
v0 = func0();
v1 = v0;
}
while ( v0 == 32 );
}
while ( v0 == 9 );
if ( v0 == 40 )
{
v9 = func0();
if ( v9 == 41 )
{
v1 = 1;
strcpy(token, "()");
tokentype = 1;
}
else
{
func1(v9);
tokentype = 40;
}
return v1;
}
if ( v0 == 91 )
{
token[0] = 91;
v4 = &token[1];
do
{
v5 = func0();
*v4++ = v5;
}
while ( v5 != 93 );
*v4 = 0;
v1 = 2;
tokentype = 2;
return v1;
}
v2 = _ctype_b_loc();
if ( ((*v2)[v1] & 0x400) == 0 )
{
tokentype = v1;
return v1;
}
token[0] = v1;
for ( i = &token[1]; ; ++i )
{
v7 = *v2;
v8 = func0();
if ( (v7[v8] & 8) == 0 )
break;
*i = v8;
}
*i = 0;
func1(v8);
result = 0LL;
tokentype = 0;
}
return result;
}

original_code:
static int gettoken(void) {
    int c;
    char *p = token;
    if (prevtoken) {
        prevtoken = 0;
        return tokentype;
    }
    while ((c = getch()) == ' ' || c == '\t')
        ;
    if (c == '(') {
        if ((c = getch()) == ')') {
            strcpy(token, "()");
            return (tokentype = PARENS);
        }
        ungetch(c);
        return (tokentype = '(');
    }
    if (c == '[') {
        for (*p++ = c; (*p++ = getch()) != ']'; )
            ;
        *p = '\0';
        return (tokentype = BRACKETS);
    }
    if (((*__ctype_b_loc ())[(int) ((c))] & (unsigned short int) _ISalpha)) {
        for (*p++ = c; ((*__ctype_b_loc ())[(int) ((c = getch()))] & (unsigned short int) _ISalnum); )
            *p++ = c;
        *p = '\0';
        ungetch(c);
        return (tokentype = NAME);
    }
    return (tokentype = c);
}

canonical_original_code:
static int gettoken() {
    int c;
    char *p = token;
    if (prevtoken) {
        prevtoken = 0;
        return tokentype;
    }
    while ((c = getch()) == ' ' || c == '\t')
        ;
    if (c == '(') {
        if ((c = getch()) == ')') {
            strcpy(token, "()");
            return (tokentype = PARENS);
        }
        ungetch(c);
        return (tokentype = '(');
    }
    if (c == '[') {
        for (*p++ = c; (*p++ = getch()) != ']'; )
            ;
        *p = '\0';
        return (tokentype = BRACKETS);
    }
    if (((*__ctype_b_loc ())[(int) ((c))] & (unsigned short) _ISalpha)) {
        for (*p++ = c; ((*__ctype_b_loc ())[(int) ((c = getch()))] & (unsigned short) _ISalnum); )
            *p++ = c;
        *p = '\0';
        ungetch(c);
        return (tokentype = NAME);
    }
    return (tokentype = c);
}

variable_types: c int

variable_types:
p
char *


nexttoken

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

result = gettoken();
prevtoken = 1;
return result;
}

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

result = func2();
prevtoken = 1;
return result;
}

original_code:
static int nexttoken(void) {
    int type;
    type = gettoken();
    prevtoken = 1;
    return type;
}

canonical_original_code:
static int nexttoken() {
    int type;
    type = gettoken();
    prevtoken = 1;
    return type;
}

variable_types: type int


bfree

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

fprintf(stderr, "bfree(): attempting to free block at %px of %lu bytes\n", a1, a2);
result = 0LL;
if ( a2 > 0xF )
{
a1[1] = a2 >> 4;
free(a1 + 2);
result = a1[1];
}
return result;
}

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

fprintf(stderr, "bfree(): attempting to free block at %px of %lu bytes\n", a1, a2);
result = 0LL;
if ( a2 > 0xF )
{
a1[1] = a2 >> 4;
func0(a1 + 2);
result = a1[1];
}
return result;
}

original_code:
unsigned long bfree(char *p, unsigned long n) {
    Header *hp;
    fprintf(stderr, "bfree(): attempting to free block at %px of %lu bytes\n", p, n);
    if (n < sizeof(Header))
        return 0;
    hp = (Header *) p;
    hp->s.size = n / sizeof(Header);
    free((void *)(hp + 1));
    return hp->s.size;
}

canonical_original_code:
unsigned long bfree(char *p, unsigned long n) {
    union header *hp;
    fprintf(stderr, "bfree(): attempting to free block at %px of %lu bytes\n", p, n);
    if (n < sizeof(Header))
        return 0;
    hp = (union header *) p;
    hp->s.size = n / sizeof(Header);
    free((void *)(hp + 1));
    return hp->s.size;
}

variable_types:
n
unsigned long

variable_types: union header { struct { union header *ptr; unsigned long size; } s; long x; } *

return_type: unsigned long


isnottab

decompiled_code:
bool __fastcall isnottab(int a1, __int64 a2)
{
bool result; // al

result = 0;
if ( a1 <= 250 )
result = *(_BYTE *)(a2 + a1) == 0;
return result;
}

canonical_decompiled_code:
bool __fastcall func0(int a1, __int64 a2)
{
bool result; // al

result = 0;
if ( a1 <= 250 )
result = *(_BYTE *)(a2 + a1) == 0;
return result;
}

original_code:
static _Bool isnottab(int pos, char *tabstop) {
    return (pos < (250 + 1)) && (tabstop[pos] == 0);
}

variable_types: pos int

variable_types:
tabstop
char *


entab

decompiled_code:
int __fastcall entab(__int64 a1)
{
int v2; // er13
int v3; // ebp
int v4; // ebx
int result; // eax
char v6; // r12
int v7; // edi
int v8; // edi

v2 = 1;
v3 = 0;
v4 = 0;
LABEL_2:
while ( 1 )
{
result = getchar();
v6 = result;
if ( (_BYTE)result == 0xFF )
return result;
while ( v6 != 32 )
{
for ( ; v4; --v4 )
putchar(9);
if ( v6 == 9 )
{
putchar(9);
do
v8 = v2++;
while ( isnottab(v8, a1) );
}
else
{
for ( ; v3; --v3 )
putchar(32);
putchar(v6);
if ( v6 != 10 )
{
++v2;
v4 = 0;
v3 = 0;
goto LABEL_2;
}
v2 = 1;
}
result = getchar();
v4 = 0;
v3 = 0;
v6 = result;
if ( (_BYTE)result == 0xFF )
return result;
}
v7 = v2++;
++v3;
if ( !isnottab(v7, a1) )
{
++v4;
v3 = 0;
}
}
}

canonical_decompiled_code:
int __fastcall func2(__int64 a1)
{
int v2; // er13
int v3; // ebp
int v4; // ebx
int result; // eax
char v6; // r12
int v7; // edi
int v8; // edi

v2 = 1;
v3 = 0;
v4 = 0;
LABEL_2:
while ( 1 )
{
result = getchar();
v6 = result;
if ( (_BYTE)result == 0xFF )
return result;
while ( v6 != 32 )
{
for ( ; v4; --v4 )
putchar(9);
if ( v6 == 9 )
{
putchar(9);
do
v8 = v2++;
while ( func0(v8, a1) );
}
else
{
for ( ; v3; --v3 )
putchar(32);
putchar(v6);
if ( v6 != 10 )
{
++v2;
v4 = 0;
v3 = 0;
goto LABEL_2;
}
v2 = 1;
}
result = getchar();
v4 = 0;
v3 = 0;
v6 = result;
if ( (_BYTE)result == 0xFF )
return result;
}
v7 = v2++;
++v3;
if ( !func0(v7, a1) )
{
++v4;
v3 = 0;
}
}
}

original_code:
static void entab(char *tab) {
    char c;
    int pos = 1;
    int ns = 0;
    int nt = 0;
    for ( ; (c = getchar()) != (-1); pos++) {
        if (c == ' ') {
            if (isnottab(pos, tab))
                ++ns;
            else {
                ns = 0;
                ++nt;
            }
            continue;
        }
        for ( ; nt > 0; nt--)
            (void)putchar('\t');
        for (ns = (c == '\t') ? 0 : ns; ns > 0; ns--)
            (void)putchar(' ');
        (void)putchar(c);
        if (c == '\n')
            pos = 0;
        if (c == '\t')
            while (isnottab(pos, tab))
                ++pos;
    }
}

variable_types:
tab
char *

variable_types: c char

variable_types: ns int

variable_types: nt int


findblank

decompiled_code:
__int64 __fastcall findblank(__int64 a1)
{
if ( !a1 )
return 20LL;
while ( line[a1] != 32 )
{
if ( !--a1 )
return 20LL;
}
return a1 + 1;
}

canonical_decompiled_code:
__int64 __fastcall func0(__int64 a1)
{
if ( !a1 )
return 20LL;
while ( line[a1] != 32 )
{
if ( !--a1 )
return 20LL;
}
return a1 + 1;
}

original_code:
static size_t findblank(size_t pos) {
    while (pos > 0 && line[pos] != ' ')
        pos--;
    if (pos == 0)
        return 20;
    else
        return (pos + 1);
}

canonical_original_code:
static unsigned long findblank(unsigned long pos) {
    while (pos > 0 && line[pos] != ' ')
        pos--;
    if (pos == 0)
        return 20;
    else
        return (pos + 1);
}

variable_types:
pos
unsigned long


squish

original_code:
static size_t squish(size_t pos) {
    size_t i = 0;
    size_t j;
    if (pos == 0 || pos >= 20)
        return 0;
    for (j = pos; j < 20; ++j) {
        line[i] = line[j];
        i++;
    }
    return i;
}

canonical_original_code:
static unsigned long squish(unsigned long pos) {
    unsigned long i = 0;
    unsigned long j;
    if (pos == 0 || pos >= 20)
        return 0;
    for (j = pos; j < 20; ++j) {
        line[i] = line[j];
        i++;
    }
    return i;
}

variable_types:
i
unsigned long

variable_types:
j
unsigned long


printline

decompiled_code:
int __fastcall printline(__int64 a1)
{
__int64 i; // rbx
int v3; // edi
int result; // eax

if ( a1 )
{
for ( i = 0LL; i != a1; ++i )
{
v3 = line[i];
putchar(v3);
}
result = putchar(10);
}
return result;
}

canonical_decompiled_code:
int __fastcall func2(__int64 a1)
{
__int64 i; // rbx
int v3; // edi
int result; // eax

if ( a1 )
{
for ( i = 0LL; i != a1; ++i )
{
v3 = line[i];
putchar(v3);
}
result = putchar(10);
}
return result;
}

original_code:
static void printline(size_t pos) {
    size_t i;
    for (i = 0; i < pos; i++)
        (void)putchar(line[i]);
    if (pos > 0)
        (void)putchar('\n');
}

canonical_original_code:
static void printline(unsigned long pos) {
    unsigned long i;
    for (i = 0; i < pos; i++)
        (void)putchar(line[i]);
    if (pos > 0)
        (void)putchar('\n');
}


expandtab

decompiled_code:
__int64 __fastcall expandtab(__int64 a1)
{
__int64 result; // rax

result = a1 + 1;
line[a1] = 32;
if ( (unsigned __int64)(a1 + 1) > 0x13 )
{
LABEL_6:
printline(result);
return 0LL;
}
if ( (result & 3) != 0 )
{
while ( 1 )
{
line[result++] = 32;
if ( result == 20 )
break;
if ( (result & 3) == 0 )
return result;
}
goto LABEL_6;
}
return result;
}

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

result = a1 + 1;
line[a1] = 32;
if ( (unsigned __int64)(a1 + 1) > 0x13 )
{
LABEL_6:
func2(result);
return 0LL;
}
if ( (result & 3) != 0 )
{
while ( 1 )
{
line[result++] = 32;
if ( result == 20 )
break;
if ( (result & 3) == 0 )
return result;
}
goto LABEL_6;
}
return result;
}

original_code:
static size_t expandtab(size_t pos) {
    line[pos] = ' ';
    for (++pos; pos < 20 && pos % 4 != 0; pos++)
        line[pos] = ' ';
    if (pos < 20)
        return pos;
    else {
        printline(pos);
        return 0;
    }
}

canonical_original_code:
static unsigned long expandtab(unsigned long pos) {
    line[pos] = ' ';
    for (++pos; pos < 20 && pos % 4 != 0; pos++)
        line[pos] = ' ';
    if (pos < 20)
        return pos;
    else {
        printline(pos);
        return 0;
    }
}


main

decompiled_code:
int __cdecl main(int argc, const char **argv, const char **envp)
{
__int64 i; // rbp
int v4; // eax
__int64 v5; // rbp
__int64 v7; // rdi

LABEL_2:
for ( i = 0LL; ; i = 0LL )
{
v4 = getchar();
if ( v4 == -1 )
break;
while ( 1 )
{
line[i] = v4;
if ( v4 == 9 )
{
i = expandtab(i);
goto LABEL_2;
}
if ( v4 == 10 )
break;
if ( (unsigned __int64)++i <= 0x13 )
goto LABEL_2;
v5 = findblank(i);
printline(v5);
i = squish(v5);
v4 = getchar();
if ( v4 == -1 )
return 0;
}
v7 = i;
printline(v7);
}
return 0;
}

canonical_decompiled_code:
int __cdecl main(int argc, const char **argv, const char **envp)
{
__int64 i; // rbp
int v4; // eax
__int64 v5; // rbp
__int64 v7; // rdi

LABEL_2:
for ( i = 0LL; ; i = 0LL )
{
v4 = getchar();
if ( v4 == -1 )
break;
while ( 1 )
{
line[i] = v4;
if ( v4 == 9 )
{
i = func3(i);
goto LABEL_2;
}
if ( v4 == 10 )
break;
if ( (unsigned __int64)++i <= 0x13 )
goto LABEL_2;
v5 = func0(i);
func2(v5);
i = func1(v5);
v4 = getchar();
if ( v4 == -1 )
return 0;
}
v7 = i;
func2(v7);
}
return 0;
}

original_code:
int main(void) {
    int c;
    size_t pos = 0;
    while ((c = getchar()) != (-1)) {
        line[pos] = c;
        if (c == '\t') {
            pos = expandtab(pos);
        } else if (c == '\n') {
            printline(pos);
            pos = 0;
        } else if (++pos >= 20) {
            pos = findblank(pos);
            printline(pos);
            pos = squish(pos);
        }
    }
    return 0;
}

canonical_original_code:
int main() {
    int c;
    unsigned long pos = 0;
    while ((c = getchar()) != (-1)) {
        line[pos] = c;
        if (c == '\t') {
            pos = expandtab(pos);
        } else if (c == '\n') {
            printline(pos);
            pos = 0;
        } else if (++pos >= 20) {
            pos = findblank(pos);
            printline(pos);
            pos = squish(pos);
        }
    }
    return 0;
}


lowerstr

decompiled_code:
void __fastcall lowerstr(char *a1)
{
__int64 v1; // rbx
char *v2; // rbp
const __int32_t **v3; // rdx

v1 = *a1;
if ( (_BYTE)v1 )
{
v2 = a1;
v3 = _ctype_tolower_loc();
do
{
*v2++ = (*v3)[v1];
v1 = *v2;
}
while ( (_BYTE)v1 );
}
}

canonical_decompiled_code:
void __fastcall func0(char *a1)
{
__int64 v1; // rbx
char *v2; // rbp
const __int32_t **v3; // rdx

v1 = *a1;
if ( (_BYTE)v1 )
{
v2 = a1;
v3 = _ctype_tolower_loc();
do
{
*v2++ = (*v3)[v1];
v1 = *v2;
}
while ( (_BYTE)v1 );
}
}

original_code:
static void lowerstr(char *s) {
    for ( ; *s != '\0'; s++)
        *s = tolower(*s);
}

variable_types:
s
char *


isnotstopword

decompiled_code:
bool __fastcall isnotstopword(__int64 a1)
{
__int64 key; // [rsp+8h] [rbp-10h] BYREF

key = a1;
return bsearch(&key, &stopwords_0, 0xAEuLL, 8uLL, scompare) == 0LL;
}

canonical_decompiled_code:
bool __fastcall func1(__int64 a1)
{
__int64 key; // [rsp+8h] [rbp-10h] BYREF

key = a1;
return bsearch(&key, &stopwords_0, 0xAEuLL, 8uLL, scompare) == 0LL;
}

original_code:
static _Bool isnotstopword(char *w) {
    static char *stopwords[] = {
        "a","about","above","after","again","against","all","am","an","and","any","are","aren't","as","at","be",
        "because","been","before","being","below","between","both","but","by","can't","cannot","could","couldn't",
        "did","didn't","do","does","doesn't","doing","don't","down","during","each","few","for","from","further",
        "had","hadn't","has","hasn't","have","haven't","having","he","he'd","he'll","he's","her","here","here's",
        "hers","herself","him","himself","his","how","how's","i","i'd","i'll","i'm","i've","if","in","into","is",
        "isn't","it","it's","its","itself","let's","me","more","most","mustn't","my","myself","no","nor","not","of",
        "off","on","once","only","or","other","ought","our","ours","ourselves","out","over","own","same","shan't",
        "she","she'd","she'll","she's","should","shouldn't","so","some","such","than","that","that's","the","their",
        "theirs","them","themselves","then","there","there's","these","they","they'd","they'll","they're","they've",
        "this","those","through","to","too","under","until","up","very","was","wasn't","we","we'd","we'll","we're",
        "we've","were","weren't","what","what's","when","when's","where","where's","which","while","who","who's",
        "whom","why","why's","with","won't","would","wouldn't","you","you'd","you'll","you're","you've","your",
        "yours","yourself","yourselves"
    };
    char **result;
    result = (char **)bsearch( (char *) &w, (char *)stopwords, sizeof(stopwords)/sizeof(stopwords[0]),
                              sizeof( char * ), (int (*)(const void*, const void*))scompare);
    return result == ((void *)0);
}

canonical_original_code:
static _Bool isnotstopword(char *w) {
    static char *stopwords[] = {
        "a","about","above","after","again","against","all","am","an","and","any","are","aren't","as","at","be",
        "because","been","before","being","below","between","both","but","by","can't","cannot","could","couldn't",
        "did","didn't","do","does","doesn't","doing","don't","down","during","each","few","for","from","further",
        "had","hadn't","has","hasn't","have","haven't","having","he","he'd","he'll","he's","her","here","here's",
        "hers","herself","him","himself","his","how","how's","i","i'd","i'll","i'm","i've","if","in","into","is",
        "isn't","it","it's","its","itself","let's","me","more","most","mustn't","my","myself","no","nor","not","of",
        "off","on","once","only","or","other","ought","our","ours","ourselves","out","over","own","same","shan't",
        "she","she'd","she'll","she's","should","shouldn't","so","some","such","than","that","that's","the","their",
        "theirs","them","themselves","then","there","there's","these","they","they'd","they'll","they're","they've",
        "this","those","through","to","too","under","until","up","very","was","wasn't","we","we'd","we'll","we're",
        "we've","were","weren't","what","what's","when","when's","where","where's","which","while","who","who's",
        "whom","why","why's","with","won't","would","wouldn't","you","you'd","you'll","you're","you've","your",
        "yours","yourself","yourselves"
    };
    char **result;
    result = (char **)bsearch( (char *) &w, (char *)stopwords, sizeof(stopwords)/sizeof(stopwords[0]),
                              sizeof( char * ), (int (*)(void *, void *))scompare);
    return result == ((void *)0);
}

variable_types:
w
char *

variable_types:
stopwords
char *[]

variable_types:
result
char **


scompare

decompiled_code:
int __fastcall scompare(const void *a1, const void *a2)
{
return strcmp(*(const char **)a1, *(const char **)a2);
}

canonical_decompiled_code:
int __fastcall func2(const void *a1, const void *a2)
{
return strcmp(*(const char **)a1, *(const char **)a2);
}

original_code:
static int scompare(char **s, char **t) {
    return strcmp(*s, *t);
}

variable_types:
s
char **

variable_types:
t
char **


talloc

decompiled_code:
void *talloc()
{
void *result; // rax

result = malloc(0x20uLL);
if ( !result )
{
printf("Error: ran out of memory");
exit(1);
}
return result;
}

canonical_decompiled_code:
void *func3()
{
void *result; // rax

result = malloc(0x20uLL);
if ( !result )
{
printf("Error: ran out of memory");
exit(1);
}
return result;
}

original_code:
static struct tnode *talloc(void) {
    struct tnode *p = (struct tnode *)malloc(sizeof(struct tnode));
    if (p == ((void *)0)) {
        printf("Error: ran out of memory");
        exit(1);
    }
    return p;
}

canonical_original_code:
static struct tnode *talloc() {
    struct tnode *p = (struct tnode *)malloc(sizeof(struct tnode));
    if (p == ((void *)0)) {
        printf("Error: ran out of memory");
        exit(1);
    }
    return p;
}

variable_types: struct tnode { char *word; int count; struct tnode *left; struct tnode *right; } *


lalloc

decompiled_code:
void *lalloc()
{
void *result; // rax

result = malloc(0x10uLL);
if ( !result )
{
printf("Error: ran out of memory");
exit(1);
}
return result;
}

canonical_decompiled_code:
void *func4()
{
void *result; // rax

result = malloc(0x10uLL);
if ( !result )
{
printf("Error: ran out of memory");
exit(1);
}
return result;
}

original_code:
static struct linklist *lalloc(void) {
    struct linklist *p = (struct linklist *)malloc(sizeof(struct linklist));
    if (p == ((void *)0)) {
        printf("Error: ran out of memory");
        exit(1);
    }
    return p;
}

canonical_original_code:
static struct linklist *lalloc() {
    struct linklist *p = (struct linklist *)malloc(sizeof(struct linklist));
    if (p == ((void *)0)) {
        printf("Error: ran out of memory");
        exit(1);
    }
    return p;
}

variable_types: struct linklist { int linenum; struct linklist *next; } *


mystrdup

decompiled_code:
void *__fastcall mystrdup(void *src)
{
size_t v1; // r12
void *v2; // rax

v1 = strlen((const char *)src) + 1;
v2 = malloc(v1);
if ( !v2 )
{
printf("Error: ran out of memory");
exit(1);
}
return memcpy(v2, src, v1);
}

canonical_decompiled_code:
void *__fastcall func5(void *src)
{
size_t v1; // r12
void *v2; // rax

v1 = strlen((const char *)src) + 1;
v2 = malloc(v1);
if ( !v2 )
{
printf("Error: ran out of memory");
exit(1);
}
return memcpy(v2, src, v1);
}

original_code:
static char *mystrdup(char *s) {
    char *p = (char *)malloc(strlen(s) + 1);
    if (p == ((void *)0)) {
        printf("Error: ran out of memory");
        exit(1);
    }
    strcpy(p, s);
    return p;
}

variable_types:
p
char *

return_type: char *


eatchar

decompiled_code:
int eatchar()
{
int result; // eax

prior = current;
current = next;
result = getchar();
next = result;
return result;
}

canonical_decompiled_code:
int func0()
{
int result; // eax

prior = current;
current = next;
result = getchar();
next = result;
return result;
}

original_code:
static void eatchar(void) {
    prior = current;
    current = next;
    next = getchar();
}

canonical_original_code:
static void eatchar() {
    prior = current;
    current = next;
    next = getchar();
}


mathfun

decompiled_code:
int __fastcall mathfun(char *s1)
{
__int64 v2; // rcx
_BYTE *v3; // rdi
char *v4; // rsi
bool v5; // cf
bool v6; // zf
char v7; // al
bool v8; // cf
bool v9; // zf
const char *v10; // rdi
__int64 v11; // rcx
char *v12; // rsi
char v13; // al
bool v14; // cf
bool v15; // zf
const char *v16; // rdi
__int64 v17; // rcx
char *v18; // rsi
char v19; // al
bool v20; // cf
bool v21; // zf
const char *v22; // rdi
__int64 v23; // rcx
char *v24; // rsi
char v25; // al
bool v26; // cf
bool v27; // zf
const char *v28; // rdi
__int64 v29; // rcx
char *v30; // rsi
char v31; // al
bool v32; // cf
bool v33; // zf
const char *v34; // rdi
__int64 v35; // rcx
char *v36; // rsi
char v37; // al
bool v38; // cf
bool v39; // zf
const char *v40; // rdi
__int64 v41; // rcx
char *v42; // rsi
char v43; // al
bool v44; // cf
bool v45; // zf
const char *v46; // rdi
__int64 v47; // rcx
char *v48; // rsi
char v49; // al
bool v50; // cf
bool v51; // zf
const char *v52; // rdi
__int64 v53; // rcx
char *v54; // rsi
char v55; // al
bool v56; // cf
bool v57; // zf
const char *v58; // rdi
__int64 v59; // rcx
char *v60; // rsi
char v61; // al
bool v62; // cf
bool v63; // zf
const char *v64; // rdi
__int64 v65; // rcx
char *v66; // rsi
char v67; // al
bool v68; // cf
bool v69; // zf
const char *v70; // rdi
__int64 v71; // rcx
char *v72; // rsi
char v73; // al
bool v74; // cf
bool v75; // zf
const char *v76; // rdi
__int64 v77; // rcx
char *v78; // rsi
char v79; // al
bool v80; // cf
bool v81; // zf
const char *v82; // rdi
__int64 v83; // rcx
char *v84; // rsi
char v85; // al
bool v86; // cf
bool v87; // zf
const char *v88; // rdi
__int64 v89; // rcx
char *v90; // rsi
char v91; // al
bool v92; // cf
bool v93; // zf
const char *v94; // rdi
__int64 v95; // rcx
char *v96; // rsi
double v98; // xmm0_8
double v99; // xmm0_8
double v100; // xmm0_8
double v101; // xmm0_8
double v102; // xmm0_8
double v103; // xmm0_8
double v104; // xmm0_8
double v105; // xmm0_8
double v106; // xmm0_8
double v107; // xmm0_8
double v108; // xmm0_8
__m128d v109; // xmm0
double v110; // xmm0_8
double v111; // xmm0_8
__m128d v112; // xmm3
__m128d v113; // xmm1
__m128d v114; // xmm3
double v115; // xmm0_8
double v116; // xmm0_8
double v117; // xmm0_8
double v118; // xmm0_8
double v119; // xmm0_8
double v120; // xmm0_8
double v121; // xmm0_8
double v122; // xmm0_8
double v123; // xmm0_8
double v124; // xmm0_8
double v125; // xmm0_8
double v126; // xmm0_8
double v127; // xmm0_8
double v128; // xmm0_8
double v129; // xmm0_8
double v130; // xmm0_8
double x; // [rsp+8h] [rbp-10h]
double xa; // [rsp+8h] [rbp-10h]

v2 = 4LL;
v3 = &unk_5BA;
v4 = s1;
v5 = 0;
v6 = 0;
do
{
if ( !v2 )
break;
v5 = (unsigned __int8)*v4 < *v3;
v6 = *v4++ == *v3++;
--v2;
}
while ( v6 );
v7 = (!v5 && !v6) - v5;
v8 = 0;
v9 = v7 == 0;
if ( !v7 )
{
if ( dasize(v3, v4) )
{
v100 = dapop();
v101 = sin(v100);
return dapush(v101);
}
return puts("Stack is empty");
}
v10 = "cos";
v11 = 4LL;
v12 = s1;
do
{
if ( !v11 )
break;
v8 = (unsigned __int8)*v12 < (unsigned int)*v10;
v9 = *v12++ == *v10++;
--v11;
}
while ( v9 );
v13 = (!v8 && !v9) - v8;
v14 = 0;
v15 = v13 == 0;
if ( !v13 )
{
if ( dasize(v10, v12) )
{
v98 = dapop();
v99 = cos(v98);
return dapush(v99);
}
return puts("Stack is empty");
}
v16 = "acos";
v17 = 5LL;
v18 = s1;
do
{
if ( !v17 )
break;
v14 = (unsigned __int8)*v18 < (unsigned int)*v16;
v15 = *v18++ == *v16++;
--v17;
}
while ( v15 );
v19 = (!v14 && !v15) - v14;
v20 = 0;
v21 = v19 == 0;
if ( !v19 )
{
if ( dasize(v16, v18) )
{
v104 = dapop();
v105 = acos(v104);
return dapush(v105);
}
return puts("Stack is empty");
}
v22 = "asin";
v23 = 5LL;
v24 = s1;
do
{
if ( !v23 )
break;
v20 = (unsigned __int8)*v24 < (unsigned int)*v22;
v21 = *v24++ == *v22++;
--v23;
}
while ( v21 );
v25 = (!v20 && !v21) - v20;
v26 = 0;
v27 = v25 == 0;
if ( !v25 )
{
if ( dasize(v22, v24) )
{
v106 = dapop();
v107 = asin(v106);
return dapush(v107);
}
return puts("Stack is empty");
}
v28 = "atan2";
v29 = 6LL;
v30 = s1;
do
{
if ( !v29 )
break;
v26 = (unsigned __int8)*v30 < (unsigned int)*v28;
v27 = *v30++ == *v28++;
--v29;
}
while ( v27 );
v31 = (!v26 && !v27) - v26;
v32 = 0;
v33 = v31 == 0;
if ( !v31 )
{
if ( (unsigned __int64)dasize(v28, v30) > 1 )
{
x = dapop();
v102 = dapop();
v103 = atan2(v102, x);
return dapush(v103);
}
return puts("Less than two items are on the stack");
}
v34 = "atan";
v35 = 5LL;
v36 = s1;
do
{
if ( !v35 )
break;
v32 = (unsigned __int8)*v36 < (unsigned int)*v34;
v33 = *v36++ == *v34++;
--v35;
}
while ( v33 );
v37 = (!v32 && !v33) - v32;
v38 = 0;
v39 = v37 == 0;
if ( !v37 )
{
if ( dasize(v34, v36) )
{
v110 = dapop();
v111 = atan(v110);
return dapush(v111);
}
return puts("Stack is empty");
}
v40 = "ceil";
v41 = 5LL;
v42 = s1;
do
{
if ( !v41 )
break;
v38 = (unsigned __int8)*v42 < (unsigned int)*v40;
v39 = *v42++ == *v40++;
--v41;
}
while ( v39 );
v43 = (!v38 && !v39) - v38;
v44 = 0;
v45 = v43 == 0;
if ( !v43 )
{
if ( !dasize(v40, v42) )
return puts("Stack is empty");
v109.m128d_f64[0] = dapop();
if ( COERCE_DOUBLE(*(_QWORD *)&v109.m128d_f64[0] & LC10) < 4.503599627370496e15 )
{
v112.m128d_f64[0] = v109.m128d_f64[0];
v113.m128d_f64[0] = (double)(int)v109.m128d_f64[0];
return dapush(COERCE_DOUBLE(COERCE_UNSIGNED_INT64(v113.m128d_f64[0] + COERCE_DOUBLE(*(_OWORD *)&_mm_cmpgt_sd(v112, v113) & LC11)) | ~(_QWORD)LC10 & *(_QWORD *)&v109.m128d_f64[0]));
}
return dapush(v109.m128d_f64[0]);
}
v46 = "cosh";
v47 = 5LL;
v48 = s1;
do
{
if ( !v47 )
break;
v44 = (unsigned __int8)*v48 < (unsigned int)*v46;
v45 = *v48++ == *v46++;
--v47;
}
while ( v45 );
v49 = (!v44 && !v45) - v44;
v50 = 0;
v51 = v49 == 0;
if ( !v49 )
{
if ( !dasize(v46, v48) )
return puts("Stack is empty");
v108 = dapop();
v109.m128d_f64[0] = cosh(v108);
return dapush(v109.m128d_f64[0]);
}
v52 = "floor";
v53 = 6LL;
v54 = s1;
do
{
if ( !v53 )
break;
v50 = (unsigned __int8)*v54 < (unsigned int)*v52;
v51 = *v54++ == *v52++;
--v53;
}
while ( v51 );
v55 = (!v50 && !v51) - v50;
v56 = 0;
v57 = v55 == 0;
if ( !v55 )
{
if ( !dasize(v52, v54) )
return puts("Stack is empty");
v109.m128d_f64[0] = dapop();
if ( COERCE_DOUBLE(*(_QWORD *)&v109.m128d_f64[0] & LC10) < 4.503599627370496e15 )
{
v114.m128d_f64[0] = (double)(int)v109.m128d_f64[0];
return dapush(COERCE_DOUBLE(COERCE_UNSIGNED_INT64(v114.m128d_f64[0] - COERCE_DOUBLE(*(_OWORD *)&_mm_cmpgt_sd(v114, v109) & LC11)) | ~(_QWORD)LC10 & *(_QWORD *)&v109.m128d_f64[0]));
}
return dapush(v109.m128d_f64[0]);
}
v58 = "log";
v59 = 4LL;
v60 = s1;
do
{
if ( !v59 )
break;
v56 = (unsigned __int8)*v60 < (unsigned int)*v58;
v57 = *v60++ == *v58++;
--v59;
}
while ( v57 );
v61 = (!v56 && !v57) - v56;
v62 = 0;
v63 = v61 == 0;
if ( !v61 )
{
if ( dasize(v58, v60) )
{
v115 = dapop();
v116 = log(v115);
return dapush(v116);
}
return puts("Stack is empty");
}
v64 = "log10";
v65 = 6LL;
v66 = s1;
do
{
if ( !v65 )
break;
v62 = (unsigned __int8)*v66 < (unsigned int)*v64;
v63 = *v66++ == *v64++;
--v65;
}
while ( v63 );
v67 = (!v62 && !v63) - v62;
v68 = 0;
v69 = v67 == 0;
if ( !v67 )
{
if ( dasize(v64, v66) )
{
v117 = dapop();
v118 = log10(v117);
return dapush(v118);
}
return puts("Stack is empty");
}
v70 = "sinh";
v71 = 5LL;
v72 = s1;
do
{
if ( !v71 )
break;
v68 = (unsigned __int8)*v72 < (unsigned int)*v70;
v69 = *v72++ == *v70++;
--v71;
}
while ( v69 );
v73 = (!v68 && !v69) - v68;
v74 = 0;
v75 = v73 == 0;
if ( !v73 )
{
if ( dasize(v70, v72) )
{
v119 = dapop();
v120 = sinh(v119);
return dapush(v120);
}
return puts("Stack is empty");
}
v76 = "sqrt";
v77 = 5LL;
v78 = s1;
do
{
if ( !v77 )
break;
v74 = (unsigned __int8)*v78 < (unsigned int)*v76;
v75 = *v78++ == *v76++;
--v77;
}
while ( v75 );
v79 = (!v74 && !v75) - v74;
v80 = 0;
v81 = v79 == 0;
if ( !v79 )
{
if ( dasize(v76, v78) )
{
v121 = dapop();
if ( v121 >= 0.0 )
return dapush(sqrt(v121));
v130 = sqrt(v121);
return dapush(v130);
}
return puts("Stack is empty");
}
v82 = "tan";
v83 = 4LL;
v84 = s1;
do
{
if ( !v83 )
break;
v80 = (unsigned __int8)*v84 < (unsigned int)*v82;
v81 = *v84++ == *v82++;
--v83;
}
while ( v81 );
v85 = (!v80 && !v81) - v80;
v86 = 0;
v87 = v85 == 0;
if ( !v85 )
{
if ( dasize(v82, v84) )
{
v122 = dapop();
v123 = tan(v122);
return dapush(v123);
}
return puts("Stack is empty");
}
v88 = "tanh";
v89 = 5LL;
v90 = s1;
do
{
if ( !v89 )
break;
v86 = (unsigned __int8)*v90 < (unsigned int)*v88;
v87 = *v90++ == *v88++;
--v89;
}
while ( v87 );
v91 = (!v86 && !v87) - v86;
v92 = 0;
v93 = v91 == 0;
if ( !v91 )
{
if ( dasize(v88, v90) )
{
v124 = dapop();
v125 = tanh(v124);
return dapush(v125);
}
return puts("Stack is empty");
}
v94 = "exp";
v95 = 4LL;
v96 = s1;
do
{
if ( !v95 )
break;
v92 = (unsigned __int8)*v96 < (unsigned int)*v94;
v93 = *v96++ == *v94++;
--v95;
}
while ( v93 );
if ( (!v92 && !v93) == v92 )
{
if ( dasize(v94, v96) )
{
v128 = dapop();
v129 = exp(v128);
return dapush(v129);
}
return puts("Stack is empty");
}
if ( *s1 == 112 && s1[1] == 105 && !s1[2] )
return dapush(3.14159265);
if ( !strcmp(s1, "phi") )
return dapush(1.61803399);
if ( !strcmp(s1, "quit") )
exit(0);
if ( !strcmp(s1, "pow") )
{
if ( (unsigned __int64)dasize(s1, "pow") > 1 )
{
xa = dapop();
v126 = dapop();
v127 = pow(v126, xa);
return dapush(v127);
}
return puts("Less than two items are on the stack");
}
return printf("Error: Unknown function name '%s'\n", s1);
}

canonical_decompiled_code:
int __fastcall func0(char *s1)
{
__int64 v2; // rcx
_BYTE *v3; // rdi
char *v4; // rsi
bool v5; // cf
bool v6; // zf
char v7; // al
bool v8; // cf
bool v9; // zf
const char *v10; // rdi
__int64 v11; // rcx
char *v12; // rsi
char v13; // al
bool v14; // cf
bool v15; // zf
const char *v16; // rdi
__int64 v17; // rcx
char *v18; // rsi
char v19; // al
bool v20; // cf
bool v21; // zf
const char *v22; // rdi
__int64 v23; // rcx
char *v24; // rsi
char v25; // al
bool v26; // cf
bool v27; // zf
const char *v28; // rdi
__int64 v29; // rcx
char *v30; // rsi
char v31; // al
bool v32; // cf
bool v33; // zf
const char *v34; // rdi
__int64 v35; // rcx
char *v36; // rsi
char v37; // al
bool v38; // cf
bool v39; // zf
const char *v40; // rdi
__int64 v41; // rcx
char *v42; // rsi
char v43; // al
bool v44; // cf
bool v45; // zf
const char *v46; // rdi
__int64 v47; // rcx
char *v48; // rsi
char v49; // al
bool v50; // cf
bool v51; // zf
const char *v52; // rdi
__int64 v53; // rcx
char *v54; // rsi
char v55; // al
bool v56; // cf
bool v57; // zf
const char *v58; // rdi
__int64 v59; // rcx
char *v60; // rsi
char v61; // al
bool v62; // cf
bool v63; // zf
const char *v64; // rdi
__int64 v65; // rcx
char *v66; // rsi
char v67; // al
bool v68; // cf
bool v69; // zf
const char *v70; // rdi
__int64 v71; // rcx
char *v72; // rsi
char v73; // al
bool v74; // cf
bool v75; // zf
const char *v76; // rdi
__int64 v77; // rcx
char *v78; // rsi
char v79; // al
bool v80; // cf
bool v81; // zf
const char *v82; // rdi
__int64 v83; // rcx
char *v84; // rsi
char v85; // al
bool v86; // cf
bool v87; // zf
const char *v88; // rdi
__int64 v89; // rcx
char *v90; // rsi
char v91; // al
bool v92; // cf
bool v93; // zf
const char *v94; // rdi
__int64 v95; // rcx
char *v96; // rsi
double v98; // xmm0_8
double v99; // xmm0_8
double v100; // xmm0_8
double v101; // xmm0_8
double v102; // xmm0_8
double v103; // xmm0_8
double v104; // xmm0_8
double v105; // xmm0_8
double v106; // xmm0_8
double v107; // xmm0_8
double v108; // xmm0_8
__m128d v109; // xmm0
double v110; // xmm0_8
double v111; // xmm0_8
__m128d v112; // xmm3
__m128d v113; // xmm1
__m128d v114; // xmm3
double v115; // xmm0_8
double v116; // xmm0_8
double v117; // xmm0_8
double v118; // xmm0_8
double v119; // xmm0_8
double v120; // xmm0_8
double v121; // xmm0_8
double v122; // xmm0_8
double v123; // xmm0_8
double v124; // xmm0_8
double v125; // xmm0_8
double v126; // xmm0_8
double v127; // xmm0_8
double v128; // xmm0_8
double v129; // xmm0_8
double v130; // xmm0_8
double x; // [rsp+8h] [rbp-10h]
double xa; // [rsp+8h] [rbp-10h]

v2 = 4LL;
v3 = &unk_5BA;
v4 = s1;
v5 = 0;
v6 = 0;
do
{
if ( !v2 )
break;
v5 = (unsigned __int8)*v4 < *v3;
v6 = *v4++ == *v3++;
--v2;
}
while ( v6 );
v7 = (!v5 && !v6) - v5;
v8 = 0;
v9 = v7 == 0;
if ( !v7 )
{
if ( dasize(v3, v4) )
{
v100 = dapop();
v101 = sin(v100);
return dapush(v101);
}
return puts("Stack is empty");
}
v10 = "cos";
v11 = 4LL;
v12 = s1;
do
{
if ( !v11 )
break;
v8 = (unsigned __int8)*v12 < (unsigned int)*v10;
v9 = *v12++ == *v10++;
--v11;
}
while ( v9 );
v13 = (!v8 && !v9) - v8;
v14 = 0;
v15 = v13 == 0;
if ( !v13 )
{
if ( dasize(v10, v12) )
{
v98 = dapop();
v99 = cos(v98);
return dapush(v99);
}
return puts("Stack is empty");
}
v16 = "acos";
v17 = 5LL;
v18 = s1;
do
{
if ( !v17 )
break;
v14 = (unsigned __int8)*v18 < (unsigned int)*v16;
v15 = *v18++ == *v16++;
--v17;
}
while ( v15 );
v19 = (!v14 && !v15) - v14;
v20 = 0;
v21 = v19 == 0;
if ( !v19 )
{
if ( dasize(v16, v18) )
{
v104 = dapop();
v105 = acos(v104);
return dapush(v105);
}
return puts("Stack is empty");
}
v22 = "asin";
v23 = 5LL;
v24 = s1;
do
{
if ( !v23 )
break;
v20 = (unsigned __int8)*v24 < (unsigned int)*v22;
v21 = *v24++ == *v22++;
--v23;
}
while ( v21 );
v25 = (!v20 && !v21) - v20;
v26 = 0;
v27 = v25 == 0;
if ( !v25 )
{
if ( dasize(v22, v24) )
{
v106 = dapop();
v107 = asin(v106);
return dapush(v107);
}
return puts("Stack is empty");
}
v28 = "atan2";
v29 = 6LL;
v30 = s1;
do
{
if ( !v29 )
break;
v26 = (unsigned __int8)*v30 < (unsigned int)*v28;
v27 = *v30++ == *v28++;
--v29;
}
while ( v27 );
v31 = (!v26 && !v27) - v26;
v32 = 0;
v33 = v31 == 0;
if ( !v31 )
{
if ( (unsigned __int64)dasize(v28, v30) > 1 )
{
x = dapop();
v102 = dapop();
v103 = atan2(v102, x);
return dapush(v103);
}
return puts("Less than two items are on the stack");
}
v34 = "atan";
v35 = 5LL;
v36 = s1;
do
{
if ( !v35 )
break;
v32 = (unsigned __int8)*v36 < (unsigned int)*v34;
v33 = *v36++ == *v34++;
--v35;
}
while ( v33 );
v37 = (!v32 && !v33) - v32;
v38 = 0;
v39 = v37 == 0;
if ( !v37 )
{
if ( dasize(v34, v36) )
{
v110 = dapop();
v111 = atan(v110);
return dapush(v111);
}
return puts("Stack is empty");
}
v40 = "ceil";
v41 = 5LL;
v42 = s1;
do
{
if ( !v41 )
break;
v38 = (unsigned __int8)*v42 < (unsigned int)*v40;
v39 = *v42++ == *v40++;
--v41;
}
while ( v39 );
v43 = (!v38 && !v39) - v38;
v44 = 0;
v45 = v43 == 0;
if ( !v43 )
{
if ( !dasize(v40, v42) )
return puts("Stack is empty");
v109.m128d_f64[0] = dapop();
if ( COERCE_DOUBLE(*(_QWORD *)&v109.m128d_f64[0] & LC10) < 4.503599627370496e15 )
{
v112.m128d_f64[0] = v109.m128d_f64[0];
v113.m128d_f64[0] = (double)(int)v109.m128d_f64[0];
return dapush(COERCE_DOUBLE(COERCE_UNSIGNED_INT64(v113.m128d_f64[0] + COERCE_DOUBLE(*(_OWORD *)&_mm_cmpgt_sd(v112, v113) & LC11)) | ~(_QWORD)LC10 & *(_QWORD *)&v109.m128d_f64[0]));
}
return dapush(v109.m128d_f64[0]);
}
v46 = "cosh";
v47 = 5LL;
v48 = s1;
do
{
if ( !v47 )
break;
v44 = (unsigned __int8)*v48 < (unsigned int)*v46;
v45 = *v48++ == *v46++;
--v47;
}
while ( v45 );
v49 = (!v44 && !v45) - v44;
v50 = 0;
v51 = v49 == 0;
if ( !v49 )
{
if ( !dasize(v46, v48) )
return puts("Stack is empty");
v108 = dapop();
v109.m128d_f64[0] = cosh(v108);
return dapush(v109.m128d_f64[0]);
}
v52 = "floor";
v53 = 6LL;
v54 = s1;
do
{
if ( !v53 )
break;
v50 = (unsigned __int8)*v54 < (unsigned int)*v52;
v51 = *v54++ == *v52++;
--v53;
}
while ( v51 );
v55 = (!v50 && !v51) - v50;
v56 = 0;
v57 = v55 == 0;
if ( !v55 )
{
if ( !dasize(v52, v54) )
return puts("Stack is empty");
v109.m128d_f64[0] = dapop();
if ( COERCE_DOUBLE(*(_QWORD *)&v109.m128d_f64[0] & LC10) < 4.503599627370496e15 )
{
v114.m128d_f64[0] = (double)(int)v109.m128d_f64[0];
return dapush(COERCE_DOUBLE(COERCE_UNSIGNED_INT64(v114.m128d_f64[0] - COERCE_DOUBLE(*(_OWORD *)&_mm_cmpgt_sd(v114, v109) & LC11)) | ~(_QWORD)LC10 & *(_QWORD *)&v109.m128d_f64[0]));
}
return dapush(v109.m128d_f64[0]);
}
v58 = "log";
v59 = 4LL;
v60 = s1;
do
{
if ( !v59 )
break;
v56 = (unsigned __int8)*v60 < (unsigned int)*v58;
v57 = *v60++ == *v58++;
--v59;
}
while ( v57 );
v61 = (!v56 && !v57) - v56;
v62 = 0;
v63 = v61 == 0;
if ( !v61 )
{
if ( dasize(v58, v60) )
{
v115 = dapop();
v116 = log(v115);
return dapush(v116);
}
return puts("Stack is empty");
}
v64 = "log10";
v65 = 6LL;
v66 = s1;
do
{
if ( !v65 )
break;
v62 = (unsigned __int8)*v66 < (unsigned int)*v64;
v63 = *v66++ == *v64++;
--v65;
}
while ( v63 );
v67 = (!v62 && !v63) - v62;
v68 = 0;
v69 = v67 == 0;
if ( !v67 )
{
if ( dasize(v64, v66) )
{
v117 = dapop();
v118 = log10(v117);
return dapush(v118);
}
return puts("Stack is empty");
}
v70 = "sinh";
v71 = 5LL;
v72 = s1;
do
{
if ( !v71 )
break;
v68 = (unsigned __int8)*v72 < (unsigned int)*v70;
v69 = *v72++ == *v70++;
--v71;
}
while ( v69 );
v73 = (!v68 && !v69) - v68;
v74 = 0;
v75 = v73 == 0;
if ( !v73 )
{
if ( dasize(v70, v72) )
{
v119 = dapop();
v120 = sinh(v119);
return dapush(v120);
}
return puts("Stack is empty");
}
v76 = "sqrt";
v77 = 5LL;
v78 = s1;
do
{
if ( !v77 )
break;
v74 = (unsigned __int8)*v78 < (unsigned int)*v76;
v75 = *v78++ == *v76++;
--v77;
}
while ( v75 );
v79 = (!v74 && !v75) - v74;
v80 = 0;
v81 = v79 == 0;
if ( !v79 )
{
if ( dasize(v76, v78) )
{
v121 = dapop();
if ( v121 >= 0.0 )
return dapush(sqrt(v121));
v130 = sqrt(v121);
return dapush(v130);
}
return puts("Stack is empty");
}
v82 = "tan";
v83 = 4LL;
v84 = s1;
do
{
if ( !v83 )
break;
v80 = (unsigned __int8)*v84 < (unsigned int)*v82;
v81 = *v84++ == *v82++;
--v83;
}
while ( v81 );
v85 = (!v80 && !v81) - v80;
v86 = 0;
v87 = v85 == 0;
if ( !v85 )
{
if ( dasize(v82, v84) )
{
v122 = dapop();
v123 = tan(v122);
return dapush(v123);
}
return puts("Stack is empty");
}
v88 = "tanh";
v89 = 5LL;
v90 = s1;
do
{
if ( !v89 )
break;
v86 = (unsigned __int8)*v90 < (unsigned int)*v88;
v87 = *v90++ == *v88++;
--v89;
}
while ( v87 );
v91 = (!v86 && !v87) - v86;
v92 = 0;
v93 = v91 == 0;
if ( !v91 )
{
if ( dasize(v88, v90) )
{
v124 = dapop();
v125 = tanh(v124);
return dapush(v125);
}
return puts("Stack is empty");
}
v94 = "exp";
v95 = 4LL;
v96 = s1;
do
{
if ( !v95 )
break;
v92 = (unsigned __int8)*v96 < (unsigned int)*v94;
v93 = *v96++ == *v94++;
--v95;
}
while ( v93 );
if ( (!v92 && !v93) == v92 )
{
if ( dasize(v94, v96) )
{
v128 = dapop();
v129 = exp(v128);
return dapush(v129);
}
return puts("Stack is empty");
}
if ( *s1 == 112 && s1[1] == 105 && !s1[2] )
return dapush(3.14159265);
if ( !strcmp(s1, "phi") )
return dapush(1.61803399);
if ( !strcmp(s1, "quit") )
exit(0);
if ( !strcmp(s1, "pow") )
{
if ( (unsigned __int64)dasize(s1, "pow") > 1 )
{
xa = dapop();
v126 = dapop();
v127 = pow(v126, xa);
return dapush(v127);
}
return puts("Less than two items are on the stack");
}
return printf("Error: Unknown function name '%s'\n", s1);
}

original_code:
static void mathfun(char s[]) {
    double operand;
    if (strcmp(s, "sin") == 0)
        if (dasize() > 0)
            dapush(sin(dapop()));
        else
            printf("Stack is empty\n");
    else if (strcmp(s, "cos") == 0)
        if (dasize() > 0)
            dapush(cos(dapop()));
        else
            printf("Stack is empty\n");
    else if (strcmp(s, "acos") == 0)
        if (dasize() > 0)
            dapush(acos(dapop()));
        else
            printf("Stack is empty\n");
    else if (strcmp(s, "asin") == 0)
        if (dasize() > 0)
            dapush(asin(dapop()));
        else
            printf("Stack is empty\n");
    else if (strcmp(s, "atan2") == 0)
        if (dasize() > 1) {
            operand = dapop();
            dapush(atan2(dapop(), operand));
        } else
            printf("Less than two items are on the stack\n");
    else if (strcmp(s, "atan") == 0)
        if (dasize() > 0)
            dapush(atan(dapop()));
        else
            printf("Stack is empty\n");
    else if (strcmp(s, "ceil") == 0)
        if (dasize() > 0)
            dapush(ceil(dapop()));
        else
            printf("Stack is empty\n");
    else if (strcmp(s, "cosh") == 0)
        if (dasize() > 0)
            dapush(cosh(dapop()));
        else
            printf("Stack is empty\n");
    else if (strcmp(s, "floor") == 0)
        if (dasize() > 0)
            dapush(floor(dapop()));
        else
            printf("Stack is empty\n");
    else if (strcmp(s, "log") == 0)
        if (dasize() > 0)
            dapush(log(dapop()));
        else
            printf("Stack is empty\n");
    else if (strcmp(s, "log10") == 0)
        if (dasize() > 0)
            dapush(log10(dapop()));
        else
            printf("Stack is empty\n");
    else if (strcmp(s, "sinh") == 0)
        if (dasize() > 0)
            dapush(sinh(dapop()));
        else
            printf("Stack is empty\n");
    else if (strcmp(s, "sqrt") == 0)
        if (dasize() > 0)
            dapush(sqrt(dapop()));
        else
            printf("Stack is empty\n");
    else if (strcmp(s, "tan") == 0)
        if (dasize() > 0)
            dapush(tan(dapop()));
        else
            printf("Stack is empty\n");
    else if (strcmp(s, "tanh") == 0)
        if (dasize() > 0)
            dapush(tanh(dapop()));
        else
            printf("Stack is empty\n");
    else if (strcmp(s, "exp") == 0)
        if (dasize() > 0)
            dapush(exp(dapop()));
        else
            printf("Stack is empty\n");
    else if (strcmp(s, "pi") == 0)
        dapush(3.14159265L);
    else if (strcmp(s, "phi") == 0)
        dapush(1.61803399L);
    else if (strcmp(s, "quit") == 0)
        exit(0);
    else if (strcmp(s, "pow") == 0) {
        if (dasize() > 1) {
            operand = dapop();
            dapush(pow(dapop(), operand));
        } else
            printf("Less than two items are on the stack\n");
    } else
        printf("Error: Unknown function name '%s'\n", s);
}

variable_types:
s
char []

variable_types: operand double


ftoc

decompiled_code:
__int64 __fastcall ftoc(int a1)
{
return (unsigned int)((5 * a1 - 160) / 9);
}

canonical_decompiled_code:
__int64 __fastcall func0(int a1)
{
return (unsigned int)((5 * a1 - 160) / 9);
}

original_code:
static int ftoc(int ftemp) {
    return 5 * (ftemp - 32) / 9;
}

variable_types: ftemp int


main

decompiled_code:
int __cdecl main(int argc, const char **argv, const char **envp)
{
unsigned int i; // ebx
int v4; // edi
__int64 v5; // rsi
unsigned int v6; // eax

for ( i = 0; i != 320; i += 20 )
{
v4 = i;
v5 = i;
v6 = ftoc(v4);
printf("%d\t%d\n", v5, v6);
}
return 0;
}

canonical_decompiled_code:
int __cdecl main(int argc, const char **argv, const char **envp)
{
unsigned int i; // ebx
int v4; // edi
__int64 v5; // rsi
unsigned int v6; // eax

for ( i = 0; i != 320; i += 20 )
{
v4 = i;
v5 = i;
v6 = func0(v4);
printf("%d\t%d\n", v5, v6);
}
return 0;
}

original_code:
int main(void) {
    int fahr;
    int lower = 0;
    int upper = 300;
    int step = 20;
    for (fahr = lower; fahr <= upper; fahr += step)
        printf("%d\t%d\n", fahr, ftoc(fahr));
    return 0;
}

canonical_original_code:
int main() {
    int fahr;
    int lower = 0;
    int upper = 300;
    int step = 20;
    for (fahr = lower; fahr <= upper; fahr += step)
        printf("%d\t%d\n", fahr, ftoc(fahr));
    return 0;
}

variable_types: fahr int

variable_types: lower int

variable_types: upper int

variable_types: step int


finfo

decompiled_code:
int __fastcall finfo(char *s)
{
char *v1; // r12
time_t timer; // [rsp+8h] [rbp-B0h] BYREF
struct stat v4; // [rsp+10h] [rbp-A8h] BYREF

if ( stat(s, &v4) == -1 )
return fprintf(stderr, "finfo: cannot access %s\n", s);
if ( (v4.st_mode & 0xF000) == 0x4000 )
dirwalk_constprop_0(s);
timer = v4.st_mtim.tv_sec;
v1 = ctime(&timer);
v1[strlen(v1) - 1] = 0;
return printf("%8lld %s (modified %s)\n", v4.st_size, s, v1);
}

canonical_decompiled_code:
int __fastcall func1(char *s)
{
char *v1; // r12
time_t timer; // [rsp+8h] [rbp-B0h] BYREF
struct stat v4; // [rsp+10h] [rbp-A8h] BYREF

if ( stat(s, &v4) == -1 )
return fprintf(stderr, "finfo: cannot access %s\n", s);
if ( (v4.st_mode & 0xF000) == 0x4000 )
func0(s);
timer = v4.st_mtim.tv_sec;
v1 = ctime(&timer);
v1[strlen(v1) - 1] = 0;
return printf("%8lld %s (modified %s)\n", v4.st_size, s, v1);
}

original_code:
static void finfo(char *name) {
    struct stat stbuf;
    time_t filetime;
    char *timestr;
    if (stat(name, &stbuf) == -1) {
        fprintf(stderr, "finfo: cannot access %s\n", name);
        return;
    }
    if (((((stbuf.st_mode)) & 0170000) == (0040000)))
        dirwalk(name, finfo);
    filetime = stbuf.st_mtime;
    timestr = ctime(&filetime);
    timestr[strlen(timestr)-1] = '\0';
    printf("%8lld %s (modified %s)\n", (long long)stbuf.st_size, name, timestr);
}

canonical_original_code:
static void finfo(char *name) {
    struct stat stbuf;
    long filetime;
    char *timestr;
    if (stat(name, &stbuf) == -1) {
        fprintf(stderr, "finfo: cannot access %s\n", name);
        return;
    }
    if (((((stbuf.st_mode)) & 0170000) == (0040000)))
        dirwalk(name, finfo);
    filetime = stbuf.st_mtime;
    timestr = ctime(&filetime);
    timestr[strlen(timestr)-1] = '\0';
    printf("%8lld %s (modified %s)\n", (long long)stbuf.st_size, name, timestr);
}

variable_types:
name
char *

variable_types: struct stat { unsigned long st_dev; unsigned long st_ino; unsigned long st_nlink; unsigned int st_mode; unsigned int st_uid; unsigned int st_gid; int __pad0; unsigned long st_rdev; long st_size; long st_blksize; long st_blocks; long st_atime; unsigned long st_atimensec; long st_mtime; unsigned long st_mtimensec; long st_ctime; unsigned long st_ctimensec; long __glibc_reserved[3]; }

variable_types: filetime long

variable_types:
timestr
char *


main

decompiled_code:
int __cdecl __noreturn main(int argc, const char **argv, const char **envp)
{
const char **v3; // rbx
const char **v4; // rbp
char *v5; // rdi

if ( argc == 1 )
{
finfo(".");
}
else if ( argc > 1 )
{
v3 = argv;
v4 = &argv[argc - 1];
do
{
v5 = (char *)v3[1];
++v3;
finfo(v5);
}
while ( v3 != v4 );
}
exit(0);
}

canonical_decompiled_code:
int __cdecl __noreturn main(int argc, const char **argv, const char **envp)
{
const char **v3; // rbx
const char **v4; // rbp
char *v5; // rdi

if ( argc == 1 )
{
func1(".");
}
else if ( argc > 1 )
{
v3 = argv;
v4 = &argv[argc - 1];
do
{
v5 = (char *)v3[1];
++v3;
func1(v5);
}
while ( v3 != v4 );
}
exit(0);
}

original_code:
int main(int argc, char **argv) {
    if (argc == 1)
        finfo(".");
    else
        while (--argc > 0)
            finfo(*++argv);
    exit(0);
}

variable_types: argc int

variable_types:
argv
char **


lower

decompiled_code:
__int64 __fastcall lower(unsigned int a1)
{
__int64 result; // rax

result = a1 + 32;
if ( (unsigned __int8)(a1 - 65) >= 0x1Au )
result = a1;
return result;
}

canonical_decompiled_code:
__int64 __fastcall func0(unsigned int a1)
{
__int64 result; // rax

result = a1 + 32;
if ( (unsigned __int8)(a1 - 65) >= 0x1Au )
result = a1;
return result;
}

original_code:
static char lower(char c) {
    return (c >= 'A' && c <= 'Z') ? c + 'a' - 'A' : c;
}

variable_types: c char

return_type: char


main

decompiled_code:
int __cdecl main(int argc, const char **argv, const char **envp)
{
char v3; // al
char v4; // al

v3 = lower(0x54u);
putchar(v3);
v4 = lower(0x74u);
putchar(v4);
putchar(10);
return 0;
}

canonical_decompiled_code:
int __cdecl main(int argc, const char **argv, const char **envp)
{
char v3; // al
char v4; // al

v3 = func0(0x54u);
putchar(v3);
v4 = func0(0x74u);
putchar(v4);
putchar(10);
return 0;
}

original_code:
int main(void) {
    (void)putchar(lower('T'));
    (void)putchar(lower('t'));
    (void)putchar('\n');
    return 0;
}

canonical_original_code:
int main() {
    (void)putchar(lower('T'));
    (void)putchar(lower('t'));
    (void)putchar('\n');
    return 0;
}


isnottab

decompiled_code:
bool __fastcall isnottab(int a1, __int64 a2)
{
bool result; // al

result = 0;
if ( a1 <= 250 )
result = *(_BYTE *)(a2 + a1) == 0;
return result;
}

canonical_decompiled_code:
bool __fastcall func0(int a1, __int64 a2)
{
bool result; // al

result = 0;
if ( a1 <= 250 )
result = *(_BYTE *)(a2 + a1) == 0;
return result;
}

original_code:
static _Bool isnottab(int pos, char *tabstop) {
    return (pos < (250 + 1)) && (tabstop[pos] == 0);
}

variable_types: pos int

variable_types:
tabstop
char *


detab

decompiled_code:
int __fastcall detab(__int64 a1)
{
int v2; // ebx
int result; // eax
char v4; // bp
int v5; // edi

v2 = 1;
while ( 1 )
{
result = getchar();
v4 = result;
if ( (_BYTE)result == 0xFF )
break;
while ( v4 != 9 )
{
++v2;
putchar(v4);
if ( v4 == 10 )
v2 = 1;
result = getchar();
v4 = result;
if ( (_BYTE)result == 0xFF )
return result;
}
do
{
putchar(32);
v5 = v2++;
}
while ( isnottab(v5, a1) );
}
return result;
}

canonical_decompiled_code:
int __fastcall func2(__int64 a1)
{
int v2; // ebx
int result; // eax
char v4; // bp
int v5; // edi

v2 = 1;
while ( 1 )
{
result = getchar();
v4 = result;
if ( (_BYTE)result == 0xFF )
break;
while ( v4 != 9 )
{
++v2;
putchar(v4);
if ( v4 == 10 )
v2 = 1;
result = getchar();
v4 = result;
if ( (_BYTE)result == 0xFF )
return result;
}
do
{
putchar(32);
v5 = v2++;
}
while ( func0(v5, a1) );
}
return result;
}

original_code:
static void detab(char *tabstop) {
    char c;
    int pos = 1;
    while ((c = getchar()) != (-1))
        if (c == '\t')
            do
                (void)putchar(' ');
            while (isnottab(pos++, tabstop));
        else {
            (void)putchar(c);
            if (c == '\n')
                pos = 1;
            else
                pos++;
        }
}


cons

decompiled_code:
__int64 __fastcall cons(__int64 a1)
{
__int64 result; // rax

switch ( *(_BYTE *)(b + a1) )
{
case 'a':
case 'e':
case 'i':
case 'o':
case 'u':
result = 0LL;
break;
case 'y':
result = 1LL;
if ( qword_CF0 != a1 )
result = (unsigned int)cons(a1 - 1) ^ 1;
break;
default:
result = 1LL;
break;
}
return result;
}

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

switch ( *(_BYTE *)(b + a1) )
{
case 'a':
case 'e':
case 'i':
case 'o':
case 'u':
result = 0LL;
break;
case 'y':
result = 1LL;
if ( qword_CF0 != a1 )
result = (unsigned int)func0(a1 - 1) ^ 1;
break;
default:
result = 1LL;
break;
}
return result;
}

original_code:
static _Bool cons(size_t i) {
    switch (b[i]) {
        case 'a':
        case 'e':
        case 'i':
        case 'o':
        case 'u':
            return 0;
        case 'y':
            return (i == k0) ? 1 : !cons(i - 1);
        default:
            return 1;
    }
}

canonical_original_code:
static _Bool cons(unsigned long i) {
    switch (b[i]) {
        case 'a':
        case 'e':
        case 'i':
        case 'o':
        case 'u':
            return 0;
        case 'y':
            return (i == k0) ? 1 : !cons(i - 1);
        default:
            return 1;
    }
}

variable_types:
i
unsigned long


m

decompiled_code:
__int64 m()
{
unsigned __int64 v0; // rdx
unsigned __int64 v1; // rcx
__int64 v2; // r8
unsigned __int64 v3; // rcx

v0 = qword_CF0;
if ( qword_CF0 > (unsigned __int64)j )
return 0LL;
while ( (unsigned __int8)cons(v0) )
{
if ( v0 > v1 )
return 0LL;
}
v2 = 0LL;
if ( v0 <= v1 )
{
while ( !(unsigned __int8)cons(v0) )
{
LABEL_7:
if ( v0 > v3 )
return v2;
}
++v2;
while ( v0 <= v3 )
{
if ( !(unsigned __int8)cons(v0) )
goto LABEL_7;
}
}
return v2;
}

canonical_decompiled_code:
__int64 func1()
{
unsigned __int64 v0; // rdx
unsigned __int64 v1; // rcx
__int64 v2; // r8
unsigned __int64 v3; // rcx

v0 = qword_CF0;
if ( qword_CF0 > (unsigned __int64)j )
return 0LL;
while ( (unsigned __int8)func0(v0) )
{
if ( v0 > v1 )
return 0LL;
}
v2 = 0LL;
if ( v0 <= v1 )
{
while ( !(unsigned __int8)func0(v0) )
{
LABEL_7:
if ( v0 > v3 )
return v2;
}
++v2;
while ( v0 <= v3 )
{
if ( !(unsigned __int8)func0(v0) )
goto LABEL_7;
}
}
return v2;
}

original_code:
static size_t m() {
    size_t n = 0;
    size_t i = k0;
    while (1) {
        if (i > j)
            return n;
        if (! cons(i))
            break;
        i++;
    }
    i++;
    while (1) {
        while (1) {
            if (i > j)
                return n;
            if (cons(i))
                break;
            i++;
        }
        i++;
        n++;
        while (1) {
            if (i > j)
                return n;
            if (! cons(i))
                break;
            i++;
        }
        i++;
    }
}

canonical_original_code:
static unsigned long m() {
    unsigned long n = 0;
    unsigned long i = k0;
    while (1) {
        if (i > j)
            return n;
        if (! cons(i))
            break;
        i++;
    }
    i++;
    while (1) {
        while (1) {
            if (i > j)
                return n;
            if (cons(i))
                break;
            i++;
        }
        i++;
        n++;
        while (1) {
            if (i > j)
                return n;
            if (! cons(i))
                break;
            i++;
        }
        i++;
    }
}

variable_types:
n
unsigned long


vowelinstem

decompiled_code:
__int64 vowelinstem()
{
unsigned __int64 v0; // rdx
__int64 v1; // rdx
unsigned __int64 v2; // rcx

v0 = qword_CF0;
if ( qword_CF0 > (unsigned __int64)j )
return 0LL;
do
{
if ( !(unsigned __int8)cons(v0) )
return 1LL;
v0 = v1 + 1;
}
while ( v0 <= v2 );
return 0LL;
}

canonical_decompiled_code:
__int64 func2()
{
unsigned __int64 v0; // rdx
__int64 v1; // rdx
unsigned __int64 v2; // rcx

v0 = qword_CF0;
if ( qword_CF0 > (unsigned __int64)j )
return 0LL;
do
{
if ( !(unsigned __int8)func0(v0) )
return 1LL;
v0 = v1 + 1;
}
while ( v0 <= v2 );
return 0LL;
}

original_code:
static _Bool vowelinstem() {
    size_t i;
    for (i = k0; i <= j; i++)
        if (! cons(i))
            return 1;
    return 0;
}

canonical_original_code:
static _Bool vowelinstem() {
    unsigned long i;
    for (i = k0; i <= j; i++)
        if (! cons(i))
            return 1;
    return 0;
}


doublec

decompiled_code:
__int64 __fastcall doublec(__int64 a1)
{
__int64 result; // rax

if ( qword_CF0 + 1 <= (unsigned __int64)a1 && *(_BYTE *)(b + a1) == *(_BYTE *)(b + a1 - 1) )
result = cons(a1);
else
result = 0LL;
return result;
}

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

if ( qword_CF0 + 1 <= (unsigned __int64)a1 && *(_BYTE *)(b + a1) == *(_BYTE *)(b + a1 - 1) )
result = func0(a1);
else
result = 0LL;
return result;
}

original_code:
static _Bool doublec(size_t j) {
    if (j < k0+1)
        return 0;
    if (b[j] != b[j-1])
        return 0;
    return cons(j);
}

canonical_original_code:
static _Bool doublec(unsigned long j) {
    if (j < k0+1)
        return 0;
    if (b[j] != b[j-1])
        return 0;
    return cons(j);
}

variable_types:
j
unsigned long


cvc

decompiled_code:
char __fastcall cvc(unsigned __int64 a1)
{
char result; // al
__int64 v2; // rdx
__int64 v3; // rdx
char v4; // r8
__int64 v5; // rdx

result = 0;
if ( qword_CF0 + 2 <= a1 )
{
result = cons(a1);
if ( result )
{
v4 = cons(v2 - 1);
result = 0;
if ( !v4 )
{
result = cons(v3 - 2);
if ( result )
result = (unsigned int)(*(char *)(b + v5) - 119) > 2;
}
}
}
return result;
}

canonical_decompiled_code:
char __fastcall func4(unsigned __int64 a1)
{
char result; // al
__int64 v2; // rdx
__int64 v3; // rdx
char v4; // r8
__int64 v5; // rdx

result = 0;
if ( qword_CF0 + 2 <= a1 )
{
result = func0(a1);
if ( result )
{
v4 = func0(v2 - 1);
result = 0;
if ( !v4 )
{
result = func0(v3 - 2);
if ( result )
result = (unsigned int)(*(char *)(b + v5) - 119) > 2;
}
}
}
return result;
}

original_code:
static _Bool cvc(size_t i) {
    int ch;
    if (i < k0 + 2 || !cons(i) || cons(i - 1) || !cons(i - 2))
        return 0;
    ch = b[i];
    if (ch == 'w' || ch == 'x' || ch == 'y')
        return 0;
    return 1;
}

canonical_original_code:
static _Bool cvc(unsigned long i) {
    int ch;
    if (i < k0 + 2 || !cons(i) || cons(i - 1) || !cons(i - 2))
        return 0;
    ch = b[i];
    if (ch == 'w' || ch == 'x' || ch == 'y')
        return 0;
    return 1;
}

variable_types: ch int


decompiled_code:
char step5()
{
__int64 v0; // rsi
unsigned __int64 v1; // rax
__int64 v2; // r9

v0 = k;
LOBYTE(v1) = *(_BYTE *)(b + k);
j = k;
if ( (_BYTE)v1 == 101 )
{
v1 = m();
if ( v1 <= 1 )
{
if ( v1 != 1 )
return v1;
LOBYTE(v1) = cvc(--v0);
if ( (_BYTE)v1 )
return v1;
}
else
{
--v0;
}
LOBYTE(v1) = *(_BYTE *)(v2 + v0);
k = v0;
if ( (_BYTE)v1 != 108 )
return v1;
}
else if ( (_BYTE)v1 != 108 )
{
return v1;
}
LOBYTE(v1) = doublec(v0);
if ( (_BYTE)v1 )
{
v1 = m();
if ( v1 > 1 )
k = v0 - 1;
}
return v1;
}

canonical_decompiled_code:
char func5()
{
__int64 v0; // rsi
unsigned __int64 v1; // rax
__int64 v2; // r9

v0 = k;
LOBYTE(v1) = *(_BYTE *)(b + k);
j = k;
if ( (_BYTE)v1 == 101 )
{
v1 = func1();
if ( v1 <= 1 )
{
if ( v1 != 1 )
return v1;
LOBYTE(v1) = func4(--v0);
if ( (_BYTE)v1 )
return v1;
}
else
{
--v0;
}
LOBYTE(v1) = *(_BYTE *)(v2 + v0);
k = v0;
if ( (_BYTE)v1 != 108 )
return v1;
}
else if ( (_BYTE)v1 != 108 )
{
return v1;
}
LOBYTE(v1) = func3(v0);
if ( (_BYTE)v1 )
{
v1 = func1();
if ( v1 > 1 )
k = v0 - 1;
}
return v1;
}

variable_types:
a
unsigned long


ends

decompiled_code:
__int64 __fastcall ends(char *a1)
{
unsigned int v1; // er12
unsigned __int64 v2; // rbp
unsigned __int64 v3; // rbx
__int64 v4; // r13

v1 = 0;
v2 = k;
v3 = *a1;
if ( a1[v3] == *(_BYTE *)(b + k) && k + 1 - qword_CF0 >= v3 )
{
v4 = k - v3;
if ( !memcmp((const void *)(b + k - v3 + 1), a1 + 1, *a1) )
{
v1 = 1;
if ( v2 < v3 )
v4 = 0LL;
j = v4;
}
}
return v1;
}

canonical_decompiled_code:
__int64 __fastcall func6(char *a1)
{
unsigned int v1; // er12
unsigned __int64 v2; // rbp
unsigned __int64 v3; // rbx
__int64 v4; // r13

v1 = 0;
v2 = k;
v3 = *a1;
if ( a1[v3] == *(_BYTE *)(b + k) && k + 1 - qword_CF0 >= v3 )
{
v4 = k - v3;
if ( !memcmp((const void *)(b + k - v3 + 1), a1 + 1, *a1) )
{
v1 = 1;
if ( v2 < v3 )
v4 = 0LL;
j = v4;
}
}
return v1;
}

original_code:
static _Bool ends(char *s) {
    size_t length = (size_t)s[0];
    if (s[length] != b[k])
        return 0;
    if (length > k - k0 + 1)
        return 0;
    if (memcmp(b + k - length + 1, s + 1, length) != 0)
        return 0;
    j = (length > k) ? 0 : (k - length);
    return 1;
}

canonical_original_code:
static _Bool ends(char *s) {
    unsigned long length = (size_t)s[0];
    if (s[length] != b[k])
        return 0;
    if (length > k - k0 + 1)
        return 0;
    if (memcmp(b + k - length + 1, s + 1, length) != 0)
        return 0;
    j = (length > k) ? 0 : (k - length);
    return 1;
}

variable_types:
s
char *

variable_types:
length
unsigned long


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

result = ends(byte_F42);
if ( (_BYTE)result )
{
result = vowelinstem();
if ( (_BYTE)result )
{
result = k;
*(_BYTE *)(b + k) = 105;
}
}
return result;
}

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

result = func6(byte_F42);
if ( (_BYTE)result )
{
result = func2();
if ( (_BYTE)result )
{
result = k;
*(_BYTE *)(b + k) = 105;
}
}
return result;
}

original_code:
static void step1c() {
    if (ends("\01" "y") && vowelinstem())
        b[k] = 'i';
}


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

v0 = b;
result = (unsigned __int8)(*(_BYTE *)(b + k - 1) - 97);
switch ( *(_BYTE *)(b + k - 1) )
{
case 'a':
result = ends(byte_F45);
if ( (_BYTE)result )
goto LABEL_3;
break;
case 'c':
if ( (unsigned __int8)ends(byte_F49) )
goto LABEL_3;
result = ends(byte_F4F);
if ( (_BYTE)result )
goto LABEL_3;
break;
case 'e':
result = ends(byte_F55);
if ( (_BYTE)result )
goto LABEL_3;
break;
case 'i':
result = ends(byte_F59);
if ( (_BYTE)result )
goto LABEL_3;
break;
case 'l':
if ( (unsigned __int8)ends(byte_F5D) )
goto LABEL_3;
result = ends(byte_F63);
if ( (_BYTE)result )
goto LABEL_3;
break;
case 'n':
if ( (unsigned __int8)ends(byte_F69) )
goto LABEL_3;
if ( (unsigned __int8)ends(byte_F6E) )
goto LABEL_3;
if ( (unsigned __int8)ends(byte_F75) )
goto LABEL_3;
result = ends(byte_F7B);
if ( (_BYTE)result )
goto LABEL_3;
break;
case 'o':
if ( (unsigned __int8)ends(byte_F80)
&& j >= (unsigned __int64)qword_CF0
&& (unsigned __int8)(*(_BYTE *)(v0 + j) - 115) <= 1u )
{
goto LABEL_3;
}
result = ends(byte_F85);
if ( (_BYTE)result )
goto LABEL_3;
break;
case 's':
result = ends(byte_F89);
if ( (_BYTE)result )
goto LABEL_3;
break;
case 't':
if ( (unsigned __int8)ends(byte_F8E) )
goto LABEL_3;
result = ends(byte_F93);
if ( (_BYTE)result )
goto LABEL_3;
break;
case 'u':
result = ends(byte_F98);
if ( (_BYTE)result )
goto LABEL_3;
break;
case 'v':
result = ends(byte_F9D);
if ( (_BYTE)result )
goto LABEL_3;
break;
case 'z':
result = ends(byte_FA2);
if ( (_BYTE)result )
{
LABEL_3:
result = m();
if ( result > 1 )
{
result = j;
k = j;
}
}
break;
default:
return result;
}
return result;
}

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

v0 = b;
result = (unsigned __int8)(*(_BYTE *)(b + k - 1) - 97);
switch ( *(_BYTE *)(b + k - 1) )
{
case 'a':
result = func6(byte_F45);
if ( (_BYTE)result )
goto LABEL_3;
break;
case 'c':
if ( (unsigned __int8)func6(byte_F49) )
goto LABEL_3;
result = func6(byte_F4F);
if ( (_BYTE)result )
goto LABEL_3;
break;
case 'e':
result = func6(byte_F55);
if ( (_BYTE)result )
goto LABEL_3;
break;
case 'i':
result = func6(byte_F59);
if ( (_BYTE)result )
goto LABEL_3;
break;
case 'l':
if ( (unsigned __int8)func6(byte_F5D) )
goto LABEL_3;
result = func6(byte_F63);
if ( (_BYTE)result )
goto LABEL_3;
break;
case 'n':
if ( (unsigned __int8)func6(byte_F69) )
goto LABEL_3;
if ( (unsigned __int8)func6(byte_F6E) )
goto LABEL_3;
if ( (unsigned __int8)func6(byte_F75) )
goto LABEL_3;
result = func6(byte_F7B);
if ( (_BYTE)result )
goto LABEL_3;
break;
case 'o':
if ( (unsigned __int8)func6(byte_F80)
&& j >= (unsigned __int64)qword_CF0
&& (unsigned __int8)(*(_BYTE *)(v0 + j) - 115) <= 1u )
{
goto LABEL_3;
}
result = func6(byte_F85);
if ( (_BYTE)result )
goto LABEL_3;
break;
case 's':
result = func6(byte_F89);
if ( (_BYTE)result )
goto LABEL_3;
break;
case 't':
if ( (unsigned __int8)func6(byte_F8E) )
goto LABEL_3;
result = func6(byte_F93);
if ( (_BYTE)result )
goto LABEL_3;
break;
case 'u':
result = func6(byte_F98);
if ( (_BYTE)result )
goto LABEL_3;
break;
case 'v':
result = func6(byte_F9D);
if ( (_BYTE)result )
goto LABEL_3;
break;
case 'z':
result = func6(byte_FA2);
if ( (_BYTE)result )
{
LABEL_3:
result = func1();
if ( result > 1 )
{
result = j;
k = j;
}
}
break;
default:
return result;
}
return result;
}

original_code:
static void step4() {
    switch (b[k-1]) {
        case 'a':
            if (ends("\02" "al"))
                break;
            return;
        case 'c':
            if (ends("\04" "ance"))
                break;
            if (ends("\04" "ence"))
                break;
            return;
        case 'e':
            if (ends("\02" "er"))
                break;
            return;
        case 'i':
            if (ends("\02" "ic"))
                break;
            return;
        case 'l':
            if (ends("\04" "able"))
                break;
            if (ends("\04" "ible"))
                break;
            return;
        case 'n':
            if (ends("\03" "ant"))
                break;
            if (ends("\05" "ement"))
                break;
            if (ends("\04" "ment"))
                break;
            if (ends("\03" "ent"))
                break;
            return;
        case 'o':
            if (ends("\03" "ion") && j >= k0 && (b[j] == 's' || b[j] == 't'))
                break;
            if (ends("\02" "ou"))
                break;
            return;
        case 's':
            if (ends("\03" "ism"))
                break;
            return;
        case 't':
            if (ends("\03" "ate"))
                break;
            if (ends("\03" "iti"))
                break;
            return;
        case 'u':
            if (ends("\03" "ous"))
                break;
            return;
        case 'v':
            if (ends("\03" "ive"))
                break;
            return;
        case 'z':
            if (ends("\03" "ize"))
                break;
            return;
        default:
            return;
    }
    if (m() > 1)
        k = j;
}


setto

decompiled_code:
void *__fastcall setto(char *a1)
{
size_t v1; // rdx
__int64 v2; // rbx
void *result; // rax

v1 = *a1;
v2 = v1 + j;
result = memmove((void *)(b + j + 1), a1 + 1, v1);
k = v2;
return result;
}

canonical_decompiled_code:
void *__fastcall func9(char *a1)
{
size_t v1; // rdx
__int64 v2; // rbx
void *result; // rax

v1 = *a1;
v2 = v1 + j;
result = memmove((void *)(b + j + 1), a1 + 1, v1);
k = v2;
return result;
}

original_code:
static void setto(char *s) {
    size_t length = (size_t)s[0];
    memmove(b + j + 1, s + 1, length);
    k = j + length;
}

canonical_original_code:
static void setto(char *s) {
    unsigned long length = (size_t)s[0];
    memmove(b + j + 1, s + 1, length);
    k = j + length;
}


r

decompiled_code:
void *__fastcall r(__int64 a1, __int64 a2, __int64 a3, __int64 a4, __int64 a5)
{
void *result; // rax
char *v6; // r9

result = (void *)m(a1, a2, a3, a4, a5, a1);
if ( result )
result = setto(v6);
return result;
}

canonical_decompiled_code:
void *__fastcall func11(__int64 a1, __int64 a2, __int64 a3, __int64 a4, __int64 a5)
{
void *result; // rax
char *v6; // r9

result = (void *)func1(a1, a2, a3, a4, a5, a1);
if ( result )
result = func9(v6);
return result;
}

original_code:
static void r(char *s) {
    if (m() > 0)
        setto(s);
}


decompiled_code:
__int64 __fastcall step2(__int64 a1, __int64 a2)
{
__int64 result; // rax
__int64 v3; // rdx
__int64 v4; // rcx
__int64 v5; // r8
__int64 v6; // rdx
__int64 v7; // rcx
__int64 v8; // r8
__int64 v9; // rdx
__int64 v10; // rcx
__int64 v11; // r8
__int64 v12; // rdx
__int64 v13; // rcx
__int64 v14; // r8
__int64 v15; // rdx
__int64 v16; // rcx
__int64 v17; // r8
__int64 v18; // rdx
__int64 v19; // rcx
__int64 v20; // r8
__int64 v21; // rdx
__int64 v22; // rcx
__int64 v23; // r8
__int64 v24; // rdx
__int64 v25; // rcx
__int64 v26; // r8
__int64 v27; // rdx
__int64 v28; // rcx
__int64 v29; // r8
__int64 v30; // rdx
__int64 v31; // rcx
__int64 v32; // r8
__int64 v33; // rdx
__int64 v34; // rcx
__int64 v35; // r8
__int64 v36; // rdx
__int64 v37; // rcx
__int64 v38; // r8
__int64 v39; // rdx
__int64 v40; // rcx
__int64 v41; // r8

result = (unsigned __int8)(*(_BYTE *)(b + k - 1) - 97);
switch ( *(_BYTE *)(b + k - 1) )
{
case 'a':
if ( (unsigned __int8)ends("\aational") )
goto LABEL_16;
result = ends(byte_FE0);
if ( (_BYTE)result )
result = (__int64)r((__int64)&unk_FE8, a2, v15, v16, v17);
break;
case 'c':
if ( (unsigned __int8)ends(byte_FEE) )
{
result = (__int64)r((__int64)byte_F4F, a2, v18, v19, v20);
}
else
{
result = ends(byte_FF4);
if ( (_BYTE)result )
result = (__int64)r((__int64)byte_F49, a2, v33, v34, v35);
}
break;
case 'e':
result = ends(byte_FFA);
if ( (_BYTE)result )
goto LABEL_13;
break;
case 'g':
result = ends(byte_1071);
if ( (_BYTE)result )
result = (__int64)r((__int64)&unk_1077, a2, v3, v4, v5);
break;
case 'l':
if ( (unsigned __int8)ends(byte_1000) )
goto LABEL_27;
if ( (unsigned __int8)ends(byte_1005) )
goto LABEL_25;
if ( (unsigned __int8)ends(byte_100B) )
{
result = (__int64)r((__int64)byte_F7B, a2, v27, v28, v29);
}
else if ( (unsigned __int8)ends(byte_1012) )
{
result = (__int64)r((__int64)byte_FD4, a2, v39, v40, v41);
}
else
{
result = ends(byte_1017);
if ( (_BYTE)result )
goto LABEL_34;
}
break;
case 'o':
if ( (unsigned __int8)ends("\aization") )
{
LABEL_13:
result = (__int64)r((__int64)byte_FA2, a2, v21, v22, v23);
}
else if ( (unsigned __int8)ends(byte_1027) || (result = ends(byte_102E), (_BYTE)result) )
{
LABEL_16:
result = (__int64)r((__int64)byte_F8E, a2, v12, v13, v14);
}
break;
case 's':
if ( (unsigned __int8)ends(byte_1034) )
goto LABEL_25;
if ( (unsigned __int8)ends("\aiveness") )
goto LABEL_6;
if ( (unsigned __int8)ends("\afulness") )
{
result = (__int64)r((__int64)&unk_104D, a2, v30, v31, v32);
}
else
{
result = ends("\aousness");
if ( (_BYTE)result )
LABEL_34:
result = (__int64)r((__int64)byte_F98, a2, v36, v37, v38);
}
break;
case 't':
if ( (unsigned __int8)ends(byte_105B) )
{
LABEL_25:
result = (__int64)r((__int64)byte_F45, a2, v6, v7, v8);
}
else if ( (unsigned __int8)ends(byte_1062) )
{
LABEL_6:
result = (__int64)r((__int64)byte_F9D, a2, v9, v10, v11);
}
else
{
result = ends(byte_1069);
if ( (_BYTE)result )
LABEL_27:
result = (__int64)r((__int64)byte_FCB, a2, v24, v25, v26);
}
break;
default:
return result;
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func12(__int64 a1, __int64 a2)
{
__int64 result; // rax
__int64 v3; // rdx
__int64 v4; // rcx
__int64 v5; // r8
__int64 v6; // rdx
__int64 v7; // rcx
__int64 v8; // r8
__int64 v9; // rdx
__int64 v10; // rcx
__int64 v11; // r8
__int64 v12; // rdx
__int64 v13; // rcx
__int64 v14; // r8
__int64 v15; // rdx
__int64 v16; // rcx
__int64 v17; // r8
__int64 v18; // rdx
__int64 v19; // rcx
__int64 v20; // r8
__int64 v21; // rdx
__int64 v22; // rcx
__int64 v23; // r8
__int64 v24; // rdx
__int64 v25; // rcx
__int64 v26; // r8
__int64 v27; // rdx
__int64 v28; // rcx
__int64 v29; // r8
__int64 v30; // rdx
__int64 v31; // rcx
__int64 v32; // r8
__int64 v33; // rdx
__int64 v34; // rcx
__int64 v35; // r8
__int64 v36; // rdx
__int64 v37; // rcx
__int64 v38; // r8
__int64 v39; // rdx
__int64 v40; // rcx
__int64 v41; // r8

result = (unsigned __int8)(*(_BYTE *)(b + k - 1) - 97);
switch ( *(_BYTE *)(b + k - 1) )
{
case 'a':
if ( (unsigned __int8)func6("\aational") )
goto LABEL_16;
result = func6(byte_FE0);
if ( (_BYTE)result )
result = (__int64)func11((__int64)&unk_FE8, a2, v15, v16, v17);
break;
case 'c':
if ( (unsigned __int8)func6(byte_FEE) )
{
result = (__int64)func11((__int64)byte_F4F, a2, v18, v19, v20);
}
else
{
result = func6(byte_FF4);
if ( (_BYTE)result )
result = (__int64)func11((__int64)byte_F49, a2, v33, v34, v35);
}
break;
case 'e':
result = func6(byte_FFA);
if ( (_BYTE)result )
goto LABEL_13;
break;
case 'g':
result = func6(byte_1071);
if ( (_BYTE)result )
result = (__int64)func11((__int64)&unk_1077, a2, v3, v4, v5);
break;
case 'l':
if ( (unsigned __int8)func6(byte_1000) )
goto LABEL_27;
if ( (unsigned __int8)func6(byte_1005) )
goto LABEL_25;
if ( (unsigned __int8)func6(byte_100B) )
{
result = (__int64)func11((__int64)byte_F7B, a2, v27, v28, v29);
}
else if ( (unsigned __int8)func6(byte_1012) )
{
result = (__int64)func11((__int64)byte_FD4, a2, v39, v40, v41);
}
else
{
result = func6(byte_1017);
if ( (_BYTE)result )
goto LABEL_34;
}
break;
case 'o':
if ( (unsigned __int8)func6("\aization") )
{
LABEL_13:
result = (__int64)func11((__int64)byte_FA2, a2, v21, v22, v23);
}
else if ( (unsigned __int8)func6(byte_1027) || (result = func6(byte_102E), (_BYTE)result) )
{
LABEL_16:
result = (__int64)func11((__int64)byte_F8E, a2, v12, v13, v14);
}
break;
case 's':
if ( (unsigned __int8)func6(byte_1034) )
goto LABEL_25;
if ( (unsigned __int8)func6("\aiveness") )
goto LABEL_6;
if ( (unsigned __int8)func6("\afulness") )
{
result = (__int64)func11((__int64)&unk_104D, a2, v30, v31, v32);
}
else
{
result = func6("\aousness");
if ( (_BYTE)result )
LABEL_34:
result = (__int64)func11((__int64)byte_F98, a2, v36, v37, v38);
}
break;
case 't':
if ( (unsigned __int8)func6(byte_105B) )
{
LABEL_25:
result = (__int64)func11((__int64)byte_F45, a2, v6, v7, v8);
}
else if ( (unsigned __int8)func6(byte_1062) )
{
LABEL_6:
result = (__int64)func11((__int64)byte_F9D, a2, v9, v10, v11);
}
else
{
result = func6(byte_1069);
if ( (_BYTE)result )
LABEL_27:
result = (__int64)func11((__int64)byte_FCB, a2, v24, v25, v26);
}
break;
default:
return result;
}
return result;
}


decompiled_code:
__int64 __fastcall step3(__int64 a1, __int64 a2)
{
__int64 result; // rax
__int64 v3; // rdx
__int64 v4; // rcx
__int64 v5; // r8
__int64 v6; // rdx
__int64 v7; // rcx
__int64 v8; // r8
__int64 v9; // rdx
__int64 v10; // rcx
__int64 v11; // r8

result = *(unsigned __int8 *)(b + k);
if ( (_BYTE)result == 108 )
{
if ( (unsigned __int8)ends(byte_1098) )
return (__int64)r((__int64)byte_F59, a2, v3, v4, v5);
result = ends(byte_104D);
if ( !(_BYTE)result )
return result;
return (__int64)r((__int64)&unk_F40, a2, v6, v7, v8);
}
if ( (char)result > 108 )
{
if ( (_BYTE)result != 115 )
return result;
result = ends(byte_109E);
if ( !(_BYTE)result )
return result;
return (__int64)r((__int64)&unk_F40, a2, v6, v7, v8);
}
if ( (_BYTE)result != 101 )
{
if ( (_BYTE)result != 105 )
return result;
result = ends(byte_1091);
if ( !(_BYTE)result )
return result;
return (__int64)r((__int64)byte_F59, a2, v3, v4, v5);
}
if ( (unsigned __int8)ends(byte_107C) )
return (__int64)r((__int64)byte_F59, a2, v3, v4, v5);
if ( (unsigned __int8)ends(byte_1083) )
return (__int64)r((__int64)&unk_F40, a2, v6, v7, v8);
result = ends(byte_108A);
if ( (_BYTE)result )
result = (__int64)r((__int64)byte_F45, a2, v9, v10, v11);
return result;
}

canonical_decompiled_code:
__int64 __fastcall func13(__int64 a1, __int64 a2)
{
__int64 result; // rax
__int64 v3; // rdx
__int64 v4; // rcx
__int64 v5; // r8
__int64 v6; // rdx
__int64 v7; // rcx
__int64 v8; // r8
__int64 v9; // rdx
__int64 v10; // rcx
__int64 v11; // r8

result = *(unsigned __int8 *)(b + k);
if ( (_BYTE)result == 108 )
{
if ( (unsigned __int8)func6(byte_1098) )
return (__int64)func11((__int64)byte_F59, a2, v3, v4, v5);
result = func6(byte_104D);
if ( !(_BYTE)result )
return result;
return (__int64)func11((__int64)&unk_F40, a2, v6, v7, v8);
}
if ( (char)result > 108 )
{
if ( (_BYTE)result != 115 )
return result;
result = func6(byte_109E);
if ( !(_BYTE)result )
return result;
return (__int64)func11((__int64)&unk_F40, a2, v6, v7, v8);
}
if ( (_BYTE)result != 101 )
{
if ( (_BYTE)result != 105 )
return result;
result = func6(byte_1091);
if ( !(_BYTE)result )
return result;
return (__int64)func11((__int64)byte_F59, a2, v3, v4, v5);
}
if ( (unsigned __int8)func6(byte_107C) )
return (__int64)func11((__int64)byte_F59, a2, v3, v4, v5);
if ( (unsigned __int8)func6(byte_1083) )
return (__int64)func11((__int64)&unk_F40, a2, v6, v7, v8);
result = func6(byte_108A);
if ( (_BYTE)result )
result = (__int64)func11((__int64)byte_F45, a2, v9, v10, v11);
return result;
}