decompiled_code:
__int64 __fastcall call_doubledoubleref(__int64 (__fastcall *a1)(_QWORD, double), __int64 a2)
{
return a1(**(_QWORD **)(a2 + 8), **(double **)a2);
}

canonical_decompiled_code:
__int64 __fastcall func17(__int64 (__fastcall *a1)(_QWORD, double), __int64 a2)
{
return a1(**(_QWORD **)(a2 + 8), **(double **)a2);
}

original_code:
static int call_doubledoubleref(int (*fcal)(), void **args)
{
   return (*fcal)(*((double*)args[0]), *((double**)args[1]));
}

canonical_original_code:
static int call_doubledoubleref(int (*fcal)(), void **args)
{
   return (*fcal)(*((double *)args[0]), *((double **)args[1]));
}


repo: jff/mathspad

decompiled_code:
__int64 __fastcall call_doubleresdouble(double (__fastcall *a1)(double), __int64 a2)
{
double *v2; // rbx
double v3; // xmm0_8
__int64 result; // rax

v2 = **(double ***)(a2 + 8);
v3 = a1(**(double **)a2);
result = 0LL;
*v2 = v3;
return result;
}

canonical_decompiled_code:
__int64 __fastcall func18(double (__fastcall *a1)(double), __int64 a2)
{
double *v2; // rbx
double v3; // xmm0_8
__int64 result; // rax

v2 = **(double ***)(a2 + 8);
v3 = a1(**(double **)a2);
result = 0LL;
*v2 = v3;
return result;
}

original_code:
static int call_doubleresdouble(double (*fcal)(), void **args)
{
   *(*((double**)args[1]))= (*fcal)(*((double*)args[0]));
   return 0;
}

canonical_original_code:
static int call_doubleresdouble(double (*fcal)(), void **args)
{
   *(*((double **)args[1]))= (*fcal)(*((double *)args[0]));
   return 0;
}

variable_types:
fcal
double (*)()

variable_types:
args
void **

return_type: int


decompiled_code:
void __fastcall call_doubledoubleresdouble(double (__fastcall *a1)(double, double), __int64 a2)
{
double *v2; // rbx

v2 = **(double ***)(a2 + 16);
*v2 = a1(**(double **)a2, **(double **)(a2 + 8));
}

canonical_decompiled_code:
void __fastcall func19(double (__fastcall *a1)(double, double), __int64 a2)
{
double *v2; // rbx

v2 = **(double ***)(a2 + 16);
*v2 = a1(**(double **)a2, **(double **)(a2 + 8));
}

original_code:
static int call_doubledoubleresdouble(double (*fcal)(), void **args)
{
   *(*((double**)args[2]))= (*fcal)(*((double*)args[0]), *((double*)args[1]));
}

canonical_original_code:
static int call_doubledoubleresdouble(double (*fcal)(), void **args)
{
   *(*((double **)args[2]))= (*fcal)(*((double *)args[0]), *((double *)args[1]));
}


decompiled_code:
__int64 __fastcall call_strdouble(__int64 (__fastcall *a1)(_QWORD, double), __int64 a2)
{
return a1(**(_QWORD **)a2, **(double **)(a2 + 8));
}

canonical_decompiled_code:
__int64 __fastcall func20(__int64 (__fastcall *a1)(_QWORD, double), __int64 a2)
{
return a1(**(_QWORD **)a2, **(double **)(a2 + 8));
}

original_code:
static int call_strdouble(int (*fcal)(), void **args)
{
   return (*fcal)(*((Uchar**)args[0]), *((double*)args[1]));
}

canonical_original_code:
static int call_strdouble(int (*fcal)(), void **args)
{
   return (*fcal)(*((unsigned short **)args[0]), *((double *)args[1]));
}

variable_types:
fcal
int (*)()


doubleshiftright

decompiled_code:
double __fastcall doubleshiftright(double a1, double a2)
{
return pow(0.5, a2) * a1;
}

canonical_decompiled_code:
double __fastcall func21(double a1, double a2)
{
return pow(0.5, a2) * a1;
}

original_code:
static double doubleshiftright(double i, double j)
{
  return i*pow(0.5,j);
}

variable_types: i double

variable_types: j double

return_type: double


doubleshiftleft

decompiled_code:
double __fastcall doubleshiftleft(double a1, double a2)
{
return pow(2.0, a2) * a1;
}

canonical_decompiled_code:
double __fastcall func22(double a1, double a2)
{
return pow(2.0, a2) * a1;
}

original_code:
static double doubleshiftleft(double i, double j)
{
  return i*pow(2.0,j);
}


doublexor

decompiled_code:
// attributes: thunk
double doublexor(double x, double y)
{
return pow(x, y);
}

canonical_decompiled_code:
double func23(double x, double y)
{
return pow(x, y);
}

original_code:
static double doublexor(double i, double j)
{
  return pow(i,j);
}


doubleremain

decompiled_code:
// attributes: thunk
double doubleremain(double x, double y)
{
return fmod(x, y);
}

canonical_decompiled_code:
double func24(double x, double y)
{
return fmod(x, y);
}

original_code:
static double doubleremain(double i, double j)
{
  return fmod(i,j);
}


printdouble

decompiled_code:
int __fastcall printdouble(double a1)
{
const char *v1; // rax

v1 = (const char *)UstrtoLocale();
return printf("%s: %lg\n", v1, a1);
}

canonical_decompiled_code:
int __fastcall func25(double a1)
{
const char *v1; // rax

v1 = (const char *)UstrtoLocale();
return printf("%s: %lg\n", v1, a1);
}

original_code:
static void printdouble(Uchar *str, double x)
{
    printf("%s: %lg\n", UstrtoLocale(str), x);
}

canonical_original_code:
static void printdouble(unsigned short *str, double x)
{
    printf("%s: %lg\n", UstrtoLocale(str), x);
}

variable_types:
str
unsigned short *

variable_types: x double

return_type: void


updateeditdouble

decompiled_code:
int __fastcall updateeditdouble(const void *a1)
{
return printf("Updated editfield for %p\n", a1);
}

canonical_decompiled_code:
int __fastcall func26(const void *a1)
{
return printf("Updated editfield for %p\n", a1);
}

original_code:
static void updateeditdouble(double *x)
{
    printf("Updated editfield for %p\n", x);
}

variable_types:
x
double *


updatevardouble

decompiled_code:
int __fastcall updatevardouble(const void *a1)
{
return printf("Updated variable %p\n", a1);
}

canonical_decompiled_code:
int __fastcall func27(const void *a1)
{
return printf("Updated variable %p\n", a1);
}

original_code:
static void updatevardouble(double *x)
{
    printf("Updated variable %p\n", x);
}


decompiled_code:
__int64 init_library()
{
__int64 v0; // r12
__int64 v1; // rax
__int64 v2; // rax
__int64 v3; // rax
__int64 v4; // r12
__int64 v5; // rax
__int64 v6; // rax
__int64 v7; // r12
__int64 v8; // rax
__int64 v9; // rax
__int64 v10; // rax
__int64 v11; // rax
__int64 v12; // rax
__int64 v13; // rax
__int64 v14; // rax
__int64 v15; // rax
__int64 v16; // rax
__int64 v17; // rax
__int64 v18; // rax
__int64 v19; // rax
__int64 v20; // rax
__int64 v21; // rax
__int64 v22; // rax
__int64 v23; // rax
__int64 v24; // rax

v0 = define_prototype(&tlist, 1LL, 0LL, call_doubleref);
define_function("UpdateVarReal", &unk_789, v0, updatevardouble);
define_function("UpdateEditReal", &unk_789, v0, updateeditdouble);
v1 = define_prototype(&unk_710, 2LL, 0LL, call_strdouble);
define_function("PrintReal", &unk_789, v1, printdouble);
v2 = define_prototype(&tlist, 2LL, 0LL, call_doubledoubleref);
v3 = define_function("AssignReal", &unk_789, v2, assigndouble);
define_operator(1LL, v3);
v4 = define_prototype(&unk_740, 1LL, 3LL, call_doubleresdouble);
v5 = define_function("RealNot", &unk_789, v4, doublenot);
define_operator(44LL, v5);
v6 = define_function("RealLogicNot", &unk_789, v4, doublelnot);
define_operator(24LL, v6);
v7 = define_prototype(&unk_730, 2LL, 3LL, call_doubledoubleresdouble);
v8 = define_function("RealAdd", &unk_789, v7, doubleadd);
define_operator(11LL, v8);
v9 = define_function("RealMin", &unk_789, v7, doubleminus);
define_operator(12LL, v9);
v10 = define_function("RealMult", &unk_789, v7, doublemult);
define_operator(13LL, v10);
v11 = define_function("RealDivide", &unk_789, v7, doubledivide);
define_operator(14LL, v11);
v12 = define_function("RealRemain", &unk_789, v7, doubleremain);
define_operator(15LL, v12);
v13 = define_function("RealXor", &unk_789, v7, doublexor);
define_operator(43LL, v13);
v14 = define_function("RealLogicAnd", &unk_789, v7, doubleland);
define_operator(21LL, v14);
v15 = define_function("RealLogicOr", &unk_789, v7, doublelor);
define_operator(22LL, v15);
v16 = define_function("RealLogicXor", &unk_789, v7, doublelxor);
define_operator(23LL, v16);
v17 = define_function("RealEqual", &unk_789, v7, doubleequal);
define_operator(25LL, v17);
v18 = define_function("RealNotEqual", &unk_789, v7, doublenotequal);
define_operator(26LL, v18);
v19 = define_function("RealGreater", &unk_789, v7, doublegreater);
define_operator(27LL, v19);
v20 = define_function("RealLess", &unk_789, v7, doubleless);
define_operator(28LL, v20);
v21 = define_function("RealLessEqual", &unk_789, v7, doublelessequal);
define_operator(29LL, v21);
v22 = define_function("RealGreaterEqual", &unk_789, v7, doublegreaterequal);
define_operator(30LL, v22);
v23 = define_function("RealShiftLeft", &unk_789, v7, doubleshiftleft);
define_operator(45LL, v23);
v24 = define_function("RealShiftRight", &unk_789, v7, doubleshiftright);
define_operator(46LL, v24);
return 1LL;
}

canonical_decompiled_code:
__int64 func28()
{
__int64 v0; // r12
__int64 v1; // rax
__int64 v2; // rax
__int64 v3; // rax
__int64 v4; // r12
__int64 v5; // rax
__int64 v6; // rax
__int64 v7; // r12
__int64 v8; // rax
__int64 v9; // rax
__int64 v10; // rax
__int64 v11; // rax
__int64 v12; // rax
__int64 v13; // rax
__int64 v14; // rax
__int64 v15; // rax
__int64 v16; // rax
__int64 v17; // rax
__int64 v18; // rax
__int64 v19; // rax
__int64 v20; // rax
__int64 v21; // rax
__int64 v22; // rax
__int64 v23; // rax
__int64 v24; // rax

v0 = define_prototype(&tlist, 1LL, 0LL, call_doubleref);
define_function("UpdateVarReal", &unk_789, v0, updatevardouble);
define_function("UpdateEditReal", &unk_789, v0, updateeditdouble);
v1 = define_prototype(&unk_710, 2LL, 0LL, call_strdouble);
define_function("PrintReal", &unk_789, v1, printdouble);
v2 = define_prototype(&tlist, 2LL, 0LL, call_doubledoubleref);
v3 = define_function("AssignReal", &unk_789, v2, assigndouble);
define_operator(1LL, v3);
v4 = define_prototype(&unk_740, 1LL, 3LL, call_doubleresdouble);
v5 = define_function("RealNot", &unk_789, v4, doublenot);
define_operator(44LL, v5);
v6 = define_function("RealLogicNot", &unk_789, v4, doublelnot);
define_operator(24LL, v6);
v7 = define_prototype(&unk_730, 2LL, 3LL, call_doubledoubleresdouble);
v8 = define_function("RealAdd", &unk_789, v7, doubleadd);
define_operator(11LL, v8);
v9 = define_function("RealMin", &unk_789, v7, doubleminus);
define_operator(12LL, v9);
v10 = define_function("RealMult", &unk_789, v7, doublemult);
define_operator(13LL, v10);
v11 = define_function("RealDivide", &unk_789, v7, doubledivide);
define_operator(14LL, v11);
v12 = define_function("RealRemain", &unk_789, v7, doubleremain);
define_operator(15LL, v12);
v13 = define_function("RealXor", &unk_789, v7, doublexor);
define_operator(43LL, v13);
v14 = define_function("RealLogicAnd", &unk_789, v7, doubleland);
define_operator(21LL, v14);
v15 = define_function("RealLogicOr", &unk_789, v7, doublelor);
define_operator(22LL, v15);
v16 = define_function("RealLogicXor", &unk_789, v7, doublelxor);
define_operator(23LL, v16);
v17 = define_function("RealEqual", &unk_789, v7, doubleequal);
define_operator(25LL, v17);
v18 = define_function("RealNotEqual", &unk_789, v7, doublenotequal);
define_operator(26LL, v18);
v19 = define_function("RealGreater", &unk_789, v7, doublegreater);
define_operator(27LL, v19);
v20 = define_function("RealLess", &unk_789, v7, doubleless);
define_operator(28LL, v20);
v21 = define_function("RealLessEqual", &unk_789, v7, doublelessequal);
define_operator(29LL, v21);
v22 = define_function("RealGreaterEqual", &unk_789, v7, doublegreaterequal);
define_operator(30LL, v22);
v23 = define_function("RealShiftLeft", &unk_789, v7, doubleshiftleft);
define_operator(45LL, v23);
v24 = define_function("RealShiftRight", &unk_789, v7, doubleshiftright);
define_operator(46LL, v24);
return 1LL;
}

original_code:
int init_library(void)
{
    Prototype *pt;
    FuncRef fr;
    pt=define_prototype(tlist[0], 1, 0, call_doubleref);
    define_function("UpdateVarReal", "", pt, (Function) updatevardouble);
    define_function("UpdateEditReal", "", pt, (Function) updateeditdouble);
    pt=define_prototype(tlist[1], 2, 0, call_strdouble);
    define_function("PrintReal", "", pt, printdouble);
    pt=define_prototype(tlist[0], 2, 0, call_doubledoubleref);
    fr = define_function("AssignReal", "", pt, (Function) assigndouble);
    define_operator(1, fr);
    pt=define_prototype(tlist[4], 1, 3, call_doubleresdouble);
    fr = define_function("RealNot", "", pt, (Function) doublenot);
    define_operator(44, fr);
    fr = define_function("RealLogicNot", "", pt, (Function) doublelnot);
    define_operator(24, fr);
    pt=define_prototype(tlist[3], 2, 3, call_doubledoubleresdouble);
    fr = define_function("RealAdd", "", pt, (Function) doubleadd);
    define_operator(11, fr);
    fr = define_function("RealMin", "", pt, (Function) doubleminus);
    define_operator(12, fr);
    fr = define_function("RealMult", "", pt, (Function) doublemult);
    define_operator(13, fr);
    fr = define_function("RealDivide", "", pt, (Function) doubledivide);
    define_operator(14, fr);
    fr = define_function("RealRemain", "", pt, (Function) doubleremain);
    define_operator(15, fr);
    fr = define_function("RealXor", "", pt, (Function) doublexor);
    define_operator(43, fr);
    fr = define_function("RealLogicAnd", "", pt, (Function) doubleland);
    define_operator(21, fr);
    fr = define_function("RealLogicOr", "", pt, (Function) doublelor);
    define_operator(22, fr);
    fr = define_function("RealLogicXor", "", pt, (Function) doublelxor);
    define_operator(23, fr);
    fr = define_function("RealEqual", "", pt, (Function) doubleequal);
    define_operator(25, fr);
    fr = define_function("RealNotEqual", "", pt, (Function) doublenotequal);
    define_operator(26, fr);
    fr = define_function("RealGreater", "", pt, (Function) doublegreater);
    define_operator(27, fr);
    fr = define_function("RealLess", "", pt, (Function) doubleless);
    define_operator(28, fr);
    fr = define_function("RealLessEqual", "", pt, (Function) doublelessequal);
    define_operator(29, fr);
    fr = define_function("RealGreaterEqual", "", pt, (Function) doublegreaterequal);
    define_operator(30, fr);
    fr = define_function("RealShiftLeft", "", pt, (Function) doubleshiftleft);
    define_operator(45, fr);
    fr = define_function("RealShiftRight", "", pt, (Function) doubleshiftright);
    define_operator(46, fr);
    return 1;
}

canonical_original_code:
int init_library()
{
    struct Prototype *pt;
    struct FuncDef *fr;
    pt=define_prototype(tlist[0], 1, 0, call_doubleref);
    define_function("UpdateVarReal", "", pt, (void (*)()) updatevardouble);
    define_function("UpdateEditReal", "", pt, (void (*)()) updateeditdouble);
    pt=define_prototype(tlist[1], 2, 0, call_strdouble);
    define_function("PrintReal", "", pt, printdouble);
    pt=define_prototype(tlist[0], 2, 0, call_doubledoubleref);
    fr = define_function("AssignReal", "", pt, (void (*)()) assigndouble);
    define_operator(1, fr);
    pt=define_prototype(tlist[4], 1, 3, call_doubleresdouble);
    fr = define_function("RealNot", "", pt, (void (*)()) doublenot);
    define_operator(44, fr);
    fr = define_function("RealLogicNot", "", pt, (void (*)()) doublelnot);
    define_operator(24, fr);
    pt=define_prototype(tlist[3], 2, 3, call_doubledoubleresdouble);
    fr = define_function("RealAdd", "", pt, (void (*)()) doubleadd);
    define_operator(11, fr);
    fr = define_function("RealMin", "", pt, (void (*)()) doubleminus);
    define_operator(12, fr);
    fr = define_function("RealMult", "", pt, (void (*)()) doublemult);
    define_operator(13, fr);
    fr = define_function("RealDivide", "", pt, (void (*)()) doubledivide);
    define_operator(14, fr);
    fr = define_function("RealRemain", "", pt, (void (*)()) doubleremain);
    define_operator(15, fr);
    fr = define_function("RealXor", "", pt, (void (*)()) doublexor);
    define_operator(43, fr);
    fr = define_function("RealLogicAnd", "", pt, (void (*)()) doubleland);
    define_operator(21, fr);
    fr = define_function("RealLogicOr", "", pt, (void (*)()) doublelor);
    define_operator(22, fr);
    fr = define_function("RealLogicXor", "", pt, (void (*)()) doublelxor);
    define_operator(23, fr);
    fr = define_function("RealEqual", "", pt, (void (*)()) doubleequal);
    define_operator(25, fr);
    fr = define_function("RealNotEqual", "", pt, (void (*)()) doublenotequal);
    define_operator(26, fr);
    fr = define_function("RealGreater", "", pt, (void (*)()) doublegreater);
    define_operator(27, fr);
    fr = define_function("RealLess", "", pt, (void (*)()) doubleless);
    define_operator(28, fr);
    fr = define_function("RealLessEqual", "", pt, (void (*)()) doublelessequal);
    define_operator(29, fr);
    fr = define_function("RealGreaterEqual", "", pt, (void (*)()) doublegreaterequal);
    define_operator(30, fr);
    fr = define_function("RealShiftLeft", "", pt, (void (*)()) doubleshiftleft);
    define_operator(45, fr);
    fr = define_function("RealShiftRight", "", pt, (void (*)()) doubleshiftright);
    define_operator(46, fr);
    return 1;
}

variable_types: struct Prototype { unsigned int *type; int n; unsigned int restype; int max; int (*caller)(); } *

variable_types: struct FuncDef { char *name; char *description; char nr_args; char functype; unsigned int rettype; void *prototype; } *


original_code:
static Uchar *color_handle(int lowvalue, Attribute *attr, RedirectFunc *func)
{
    int color=attr->fgcolor;
    switch (lowvalue&0x300) {
    case 0x000: color=(((color)&0x00ffff)|(((lowvalue&0xff)&0xff)<<16)); break;
    case 0x100: color=(((color)&0xff00ff)|(((lowvalue&0xff)&0xff)<<8)); break;
    case 0x200: color=(((color)&0xffff00)|((lowvalue&0xff)&0xff)); break;
    case 0x300: color=(((((lowvalue&0xff)/36)*0x33)<<16)| (((((lowvalue&0xff)/6)%6)*0x33)<<8)| ((((lowvalue&0xff)%6)*0x33))); break;
    default: break;
    }
    attr->fgcolor=color;
    return 0;
}

canonical_original_code:
static unsigned short *color_handle(int lowvalue, struct _attribs *attr, int (**func)(unsigned short))
{
    int color = attr->fgcolor;
    switch (lowvalue&0x300) {
    case 0x000: color=(((color)&0x00ffff)|(((lowvalue&0xff)&0xff)<<16)); break;
    case 0x100: color=(((color)&0xff00ff)|(((lowvalue&0xff)&0xff)<<8)); break;
    case 0x200: color=(((color)&0xffff00)|((lowvalue&0xff)&0xff)); break;
    case 0x300: color=(((((lowvalue&0xff)/36)*0x33)<<16)| (((((lowvalue&0xff)/6)%6)*0x33)<<8)| ((((lowvalue&0xff)%6)*0x33))); break;
    default: break;
    }
    attr->fgcolor=color;
    return 0;
}

variable_types: lowvalue int

variable_types: struct _attribs { int font; int fgcolor; int bgcolor; int language; int country; int direction; int text; int plane; void *object; int pos; int posdelta; } *

variable_types:
func
int (**)(unsigned short)

variable_types: color int

return_type: unsigned short *


decompiled_code:
int color_markup_init()
{
int result; // eax
__int64 v1; // rax
const char *v2; // rax

result = add_markup_handler(56195LL, color_print, color_handle);
if ( !result )
{
v1 = translate("Unable to add color handler.\n");
v2 = (const char *)UstrtoLocale(v1);
result = fprintf(stderr, v2);
}
return result;
}

canonical_decompiled_code:
int func1()
{
int result; // eax
__int64 v1; // rax
const char *v2; // rax

result = add_markup_handler(56195LL, color_print, color_handle);
if ( !result )
{
v1 = translate("Unable to add color handler.\n");
v2 = (const char *)UstrtoLocale(v1);
result = fprintf(stderr, v2);
}
return result;
}

original_code:
void color_markup_init(void)
{
    if (!add_markup_handler(ColorAttrib, color_print, color_handle)) {
 fprintf(stderr, UstrtoLocale(translate("Unable to add color handler.\n")));
    }
}

canonical_original_code:
void color_markup_init()
{
    if (!add_markup_handler(ColorAttrib, color_print, color_handle)) {
 fprintf(stderr, UstrtoLocale(translate("Unable to add color handler.\n")));
    }
}


decompiled_code:
__int64 __fastcall parse_key(const char *a1, _DWORD *a2, int *a3)
{
int v3; // er15
char *v6; // rbx
char *v7; // rax
char *v8; // r14
int v9; // er8
char *v10; // r9
char v11; // cl
__int64 v12; // rax
__int64 v13; // rsi
char v14; // dl
int v15; // edx
int v16; // eax
int v17; // edx
int v18; // er13
__int64 result; // rax
int v20; // [rsp+Ch] [rbp-3Ch]

v3 = 0xFFFF;
v6 = (char *)a1;
v7 = strchr(a1, 45);
if ( v7 )
{
v8 = v7;
if ( a1 != v7 )
{
if ( a1 < v7 )
{
v9 = 0;
v10 = &byte_384[-4];
do
{
while ( 1 )
{
v11 = *v6;
v12 = 0LL;
if ( *v6 != 126 )
break;
v9 = 1;
LABEL_6:
if ( v8 == ++v6 )
goto LABEL_13;
}
v13 = 0LL;
if ( v11 != 83 )
{
while ( 1 )
{
++v12;
v14 = byte_384[8 * v12];
if ( !v14 )
break;
v13 = (int)v12;
if ( v11 == v14 )
goto LABEL_11;
}
v20 = v9;
fprintf(stderr, "Unknown modifier code '%c'.\n", (unsigned int)v11);
v9 = v20;
v10 = (char *)&modifier;
goto LABEL_6;
}
LABEL_11:
v15 = *(_DWORD *)&v10[8 * v13];
v16 = ~v15;
v17 = v15 << 16;
if ( !v9 )
{
v3 = v16 & (v17 | v3);
goto LABEL_6;
}
++v6;
v3 &= v16 & ~v17;
}
while ( v8 != v6 );
}
LABEL_13:
v6 = v8 + 1;
}
}
v18 = StringToKey(v6);
result = 1LL;
if ( !v18 )
{
fprintf(stderr, "Unknown key: %s\n", v6);
result = 0LL;
if ( *v6 )
{
if ( !v6[1] )
{
v18 = *v6;
result = 1LL;
}
}
}
*a2 = v18;
*a3 = v3;
return result;
}

original_code:
int parse_key(char *keystr, KeyNum *keyres, KeyMode *moderes)
{
    int i;
    int ignore=0;
    KeyMode m;
    KeyNum k;
    char *c,*h;
    h=strchr(keystr, '-');
    m=0xffff;
    if (h && h!=keystr) {
 c=keystr;
 while (c<h) {
     if (*c=='~') {
  ignore=1;
     } else {
  i=0;
  while (modifier[i].code && modifier[i].code!=*c) i++;
  if (modifier[i].code) {
      if (ignore) {
   m=(((m)&(~((modifier[i].mode)<<16)))&(~(modifier[i].mode)));
      } else {
   m=(((m)|((modifier[i].mode)<<16))&(~(modifier[i].mode)));
      }
  } else {
      fprintf(stderr, "Unknown modifier code '%c'.\n", *c);
  }
     }
     c++;
 }
 h++;
    } else {
 h=keystr;
    }
    k=StringToKey(h);
    if (!k) {
      fprintf(stderr, "Unknown key: %s\n", h);
 if (h[0] && !h[1]) {
     k=*h;
 }
    }
    *keyres=k;
    *moderes=m;
    return (k>0);
}

canonical_original_code:
int parse_key(char *keystr, unsigned int *keyres, unsigned int *moderes)
{
    int i;
    int ignore = 0;
    unsigned int m;
    unsigned int k;
    char *c; char *h;
    h=strchr(keystr, '-');
    m=0xffff;
    if (h && h!=keystr) {
 c=keystr;
 while (c<h) {
     if (*c=='~') {
  ignore=1;
     } else {
  i=0;
  while (modifier[i].code && modifier[i].code!=*c) i++;
  if (modifier[i].code) {
      if (ignore) {
   m=(((m)&(~((modifier[i].mode)<<16)))&(~(modifier[i].mode)));
      } else {
   m=(((m)|((modifier[i].mode)<<16))&(~(modifier[i].mode)));
      }
  } else {
      fprintf(stderr, "Unknown modifier code '%c'.\n", *c);
  }
     }
     c++;
 }
 h++;
    } else {
 h=keystr;
    }
    k=StringToKey(h);
    if (!k) {
      fprintf(stderr, "Unknown key: %s\n", h);
 if (h[0] && !h[1]) {
     k=*h;
 }
    }
    *keyres=k;
    *moderes=m;
    return (k>0);
}

variable_types:
keystr
char *

variable_types:
keyres
unsigned int *

variable_types:
moderes
unsigned int *

variable_types: i int

variable_types: ignore int

variable_types:
m
unsigned int

variable_types:
k
unsigned int

variable_types:
c
char *

variable_types:
h
char *


original_code:
int print_key(char *keystr, int len, KeyNum key, KeyMode mode)
{
    int m,i,j;
    char *c;
    j=0;
    m=(mode>>16);
    i=0;
    while (modifier[i].code && j<len) {
 if (modifier[i].mode&m) keystr[j++]=modifier[i].code;
 i++;
    }
    m=(m^(mode&0xffff));
    if (m && j<len) {
 keystr[j++]='~';
 i=0;
 while (modifier[i].code && j<len) {
     if (modifier[i].mode&m) keystr[j++]=modifier[i].code;
     i++;
 }
    }
    if (j && j<len) keystr[j++]='-';
    c=KeyToString(key);
    if (c) {
 while (*c && j<len) keystr[j++]=*c++;
    } else {
 if (0x20<=key && key<=0xff && j<len) keystr[j++]=key;
    }
    if (j<len) keystr[j]='\0';
    return j;
}

canonical_original_code:
int print_key(char *keystr, int len, unsigned int key, unsigned int mode)
{
    int m; int i; int j;
    char *c;
    j=0;
    m=(mode>>16);
    i=0;
    while (modifier[i].code && j<len) {
 if (modifier[i].mode&m) keystr[j++]=modifier[i].code;
 i++;
    }
    m=(m^(mode&0xffff));
    if (m && j<len) {
 keystr[j++]='~';
 i=0;
 while (modifier[i].code && j<len) {
     if (modifier[i].mode&m) keystr[j++]=modifier[i].code;
     i++;
 }
    }
    if (j && j<len) keystr[j++]='-';
    c=KeyToString(key);
    if (c) {
 while (*c && j<len) keystr[j++]=*c++;
    } else {
 if (0x20<=key && key<=0xff && j<len) keystr[j++]=key;
    }
    if (j<len) keystr[j]='\0';
    return j;
}

variable_types: len int

variable_types:
key
unsigned int

variable_types:
mode
unsigned int

variable_types: m int

variable_types: j int


decompiled_code:
// attributes: thunk
__int64 convert_event()
{
return EventToKeyAndMode();
}

canonical_decompiled_code:
__int64 func2()
{
return EventToKeyAndMode();
}

original_code:
int convert_event(void *event, KeyNum *keyres, KeyMode *moderes)
{
  return EventToKeyAndMode(event, keyres, moderes);
}

canonical_original_code:
int convert_event(void *event, unsigned int *keyres, unsigned int *moderes)
{
  return EventToKeyAndMode(event, keyres, moderes);
}

variable_types:
event
void *


decompiled_code:
// attributes: thunk
__int64 is_key_modifier()
{
return IsModifier();
}

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

original_code:
int is_key_modifier(KeyNum key)
{
  return IsModifier(key);
}

canonical_original_code:
int is_key_modifier(unsigned int key)
{
  return IsModifier(key);
}


decompiled_code:
void buffer_iconize()
{
buffer_iconized = 1;
}

canonical_decompiled_code:
void func0()
{
buffer_iconized = 1;
}

original_code:
static void buffer_iconize(void *data __attribute__((unused)))
{
    buffer_iconized = 1;
}

canonical_original_code:
static void buffer_iconize(void *data)
{
    buffer_iconized = 1;
}

variable_types:
data
void *


decompiled_code:
void buffer_deiconize()
{
buffer_iconized = 0;
}

canonical_decompiled_code:
void func1()
{
buffer_iconized = 0;
}

original_code:
static void buffer_deiconize(void *data __attribute__((unused)))
{
    buffer_iconized = 0;
}

canonical_original_code:
static void buffer_deiconize(void *data)
{
    buffer_iconized = 0;
}


decompiled_code:
__int64 __fastcall buffer_last_pos(_DWORD *a1, _DWORD *a2, _DWORD *a3, _DWORD *a4)
{
*a1 = last_xpos;
*a2 = last_ypos;
*a3 = last_width;
*a4 = last_height;
return 0LL;
}

canonical_decompiled_code:
__int64 __fastcall func2(_DWORD *a1, _DWORD *a2, _DWORD *a3, _DWORD *a4)
{
*a1 = last_xpos;
*a2 = last_ypos;
*a3 = last_width;
*a4 = last_height;
return 0LL;
}

original_code:
static int buffer_last_pos(int *x, int *y, int *w, int *h)
{
    *x = last_xpos;
    *y = last_ypos;
    *w = last_width;
    *h = last_height;
    return 0;
}

variable_types:
x
int *

variable_types:
y
int *

variable_types:
w
int *

variable_types:
h
int *


decompiled_code:
void __fastcall buffer_set_last_pos(int a1, int a2, int a3, int a4)
{
last_xpos = a1;
last_ypos = a2;
last_width = a3;
last_height = a4;
}

canonical_decompiled_code:
void __fastcall func3(int a1, int a2, int a3, int a4)
{
last_xpos = a1;
last_ypos = a2;
last_width = a3;
last_height = a4;
}

original_code:
static void buffer_set_last_pos(int x, int y, int w, int h)
{
    last_xpos = x;
    last_ypos = y;
    last_width = w;
    last_height = h;
}

variable_types: x int

variable_types: y int

variable_types: w int

variable_types: h int


decompiled_code:
void __fastcall buffer_set_number_of_lines(_QWORD *a1, unsigned int a2)
{
unsigned int v2; // eax

if ( a1 )
{
if ( *a1 == bufdrawwin )
{
v2 = line_number(buffer_info);
scrollbar_set(scrollver, v2, a2);
}
}
}

canonical_decompiled_code:
void __fastcall func4(_QWORD *a1, unsigned int a2)
{
unsigned int v2; // eax

if ( a1 )
{
if ( *a1 == bufdrawwin )
{
v2 = line_number(buffer_info);
scrollbar_set(scrollver, v2, a2);
}
}
}

original_code:
void buffer_set_number_of_lines(void *data __attribute__((unused)), int numlin)
{
    if (!data || *((Window*)data)!=bufdrawwin) return;
    scrollbar_set(scrollver,
                  line_number(buffer_info),
                  numlin);
}

canonical_original_code:
void buffer_set_number_of_lines(void *data, int numlin)
{
    if (!data || *((unsigned long *)data)!=bufdrawwin) return;
    scrollbar_set(scrollver,
                  line_number(buffer_info),
                  numlin);
}

variable_types: numlin int


decompiled_code:
void buffer_layout_change()
{
unsigned int v0; // eax

if ( buffer_is_open )
{
if ( !buffer_iconized )
XClearArea(display, bufdrawwin, 0, 0, 0, 0, 1);
v0 = line_height();
scrollbar_linesize(scrollver, v0);
}
}

canonical_decompiled_code:
void func5()
{
unsigned int v0; // eax

if ( buffer_is_open )
{
if ( !buffer_iconized )
XClearArea(display, bufdrawwin, 0, 0, 0, 0, 1);
v0 = line_height();
scrollbar_linesize(scrollver, v0);
}
}

original_code:
static void buffer_layout_change(void *data __attribute__((unused)))
{
    if (buffer_is_open) {
 if (!buffer_iconized)
     XClearArea(display, bufdrawwin, 0, 0, 0, 0, 1);
 scrollbar_linesize(scrollver, line_height());
    }
}

canonical_original_code:
static void buffer_layout_change(void *data)
{
    if (buffer_is_open) {
 if (!buffer_iconized)
     XClearArea(display, bufdrawwin, 0, 0, 0, 0, 1);
 scrollbar_linesize(scrollver, line_height());
    }
}


decompiled_code:
__int64 buffer_bad_end()
{
close_scratchwindow();
buffer_iconized = 0;
buffer_is_open = 0;
return destroy_window(bufwin);
}

canonical_decompiled_code:
__int64 func7()
{
close_scratchwindow();
buffer_iconized = 0;
buffer_is_open = 0;
return destroy_window(bufwin);
}

original_code:
static void buffer_bad_end(void *data __attribute__((unused)))
{
    close_scratchwindow();
    buffer_iconized = 0;
    buffer_is_open = 0;
    destroy_window(bufwin);
}

canonical_original_code:
static void buffer_bad_end(void *data)
{
    close_scratchwindow();
    buffer_iconized = 0;
    buffer_is_open = 0;
    destroy_window(bufwin);
}


decompiled_code:
__int64 buffer_margin()
{
int v0; // ebx

v0 = scrollbar_line(scrollhor, 0LL);
return (unsigned int)((__int16)font_width() * -v0 + 3);
}

canonical_decompiled_code:
__int64 func9()
{
int v0; // ebx

v0 = scrollbar_line(scrollhor, 0LL);
return (unsigned int)((__int16)font_width() * -v0 + 3);
}

original_code:
static int buffer_margin(void *data __attribute__((unused)))
{
    return -scrollbar_line(scrollhor, 0)*font_width()+3;
}

canonical_original_code:
static int buffer_margin(void *data)
{
    return -scrollbar_line(scrollhor, 0)*font_width()+3;
}


decompiled_code:
__int64 __fastcall buffer_motion(__int64 a1, int a2, unsigned int a3)
{
int v4; // eax

v4 = buffer_margin(0LL);
return mouse_move((unsigned int)(a2 - v4), a3);
}

canonical_decompiled_code:
__int64 __fastcall func10(__int64 a1, int a2, unsigned int a3)
{
int v4; // eax

v4 = func9(0LL);
return mouse_move((unsigned int)(a2 - v4), a3);
}

original_code:
static void buffer_motion(void *data __attribute__((unused)), int x, int y)
{
    mouse_move(x-buffer_margin(((void *)0)), y);
}

canonical_original_code:
static void buffer_motion(void *data, int x, int y)
{
    mouse_move(x-buffer_margin(((void *)0)), y);
}


decompiled_code:
__int64 buffer_draw()
{
return redraw_window(buffer_info);
}

canonical_decompiled_code:
__int64 func13()
{
return redraw_window(buffer_info);
}

original_code:
static void buffer_draw(void *data __attribute__((unused)))
{
    redraw_window(buffer_info);
}

canonical_original_code:
static void buffer_draw(void *data)
{
    redraw_window(buffer_info);
}


decompiled_code:
__int64 __fastcall buffer_scrollto(__int64 a1, int a2)
{
__int64 result; // rax
unsigned int v3; // eax

if ( a2 )
{
v3 = scrollbar_line(scrollver, 0LL);
result = editwindow_line(buffer_info, v3);
}
else
{
XClearWindow(display, bufdrawwin);
result = redraw_window(buffer_info);
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func14(__int64 a1, int a2)
{
__int64 result; // rax
unsigned int v3; // eax

if ( a2 )
{
v3 = scrollbar_line(scrollver, 0LL);
result = editwindow_line(buffer_info, v3);
}
else
{
XClearWindow(display, bufdrawwin);
result = redraw_window(buffer_info);
}
return result;
}

original_code:
static void buffer_scrollto(void *data __attribute__((unused)), int kind)
{
    if (!kind) {
 XClearWindow(display, bufdrawwin);
 redraw_window(buffer_info);
    } else {
 int line_nr = scrollbar_line(scrollver, 0);
 editwindow_line(buffer_info, line_nr);
    }
}

canonical_original_code:
static void buffer_scrollto(void *data, int kind)
{
    if (!kind) {
 XClearWindow(display, bufdrawwin);
 redraw_window(buffer_info);
    } else {
 int line_nr = scrollbar_line(scrollver, 0);
 editwindow_line(buffer_info, line_nr);
    }
}

variable_types: kind int


decompiled_code:
int buffer_init()
{
int result; // eax
__int64 v1; // rax
__int64 v2; // rax

win_width = display_width >> 1;
win_height = display_height / 3u;
if ( !XStringListToTextProperty(&buffername, 1, &buffer_name) )
{
v1 = translate("Can't set the name for the buffer.");
message(999LL, v1);
}
result = XStringListToTextProperty(&iconname, 1, &icon_name);
if ( !result )
{
v2 = translate("Can't set iconname for the buffer.");
result = message(999LL, v2);
}
return result;
}

canonical_decompiled_code:
int func15()
{
int result; // eax
__int64 v1; // rax
__int64 v2; // rax

win_width = display_width >> 1;
win_height = display_height / 3u;
if ( !XStringListToTextProperty(&buffername, 1, &buffer_name) )
{
v1 = translate("Can't set the name for the buffer.");
message(999LL, v1);
}
result = XStringListToTextProperty(&iconname, 1, &icon_name);
if ( !result )
{
v2 = translate("Can't set iconname for the buffer.");
result = message(999LL, v2);
}
return result;
}

original_code:
void buffer_init(void)
{
    win_width = display_width/2;
    win_height= display_height/3;
    if (!XStringListToTextProperty(&buffername, 1, &buffer_name))
 message(1000 -1,translate("Can't set the name for the buffer."));
    if (!XStringListToTextProperty(&iconname, 1, &icon_name))
 message(1000 -1, translate("Can't set iconname for the buffer."));
}

canonical_original_code:
void buffer_init()
{
    win_width = display_width/2;
    win_height= display_height/3;
    if (!XStringListToTextProperty(&buffername, 1, &buffer_name))
 message(1000 -1,translate("Can't set the name for the buffer."));
    if (!XStringListToTextProperty(&iconname, 1, &icon_name))
 message(1000 -1, translate("Can't set iconname for the buffer."));
}


decompiled_code:
__int64 __fastcall buffer_use_state(int a1, int a2, int a3, int a4, int a5, __int64 a6, __int64 a7)
{
last_xpos = a1;
as_icon = a5;
state_open = 1;
last_ypos = a2;
last_width = a3;
last_height = a4;
buffer_open();
state_open = 0;
as_icon = 0;
return mm_free(a7);
}

canonical_decompiled_code:
__int64 __fastcall func17(int a1, int a2, int a3, int a4, int a5, __int64 a6, __int64 a7)
{
last_xpos = a1;
as_icon = a5;
state_open = 1;
last_ypos = a2;
last_width = a3;
last_height = a4;
func16();
state_open = 0;
as_icon = 0;
return mm_free(a7);
}

original_code:
static void buffer_use_state( int x, int y, int w, int h,
         int i, int s __attribute__((unused)), Uchar *str)
{
    as_icon = i;
    state_open = 1;
    last_xpos = x;
    last_ypos = y;
    last_width = w;
    last_height = h;
    buffer_open();
    state_open = 0;
    as_icon = 0;
    mm_free(str);
}

canonical_original_code:
static void buffer_use_state(int x, int y, int w, int h, int i, int s, unsigned short *str)
{
    as_icon = i;
    state_open = 1;
    last_xpos = x;
    last_ypos = y;
    last_width = w;
    last_height = h;
    buffer_open();
    state_open = 0;
    as_icon = 0;
    mm_free(str);
}

variable_types: i int

variable_types: s int

variable_types:
str
unsigned short *


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

close_scratchwindow();
buffer_iconized = 0;
buffer_is_open = 0;
XDestroyWindow(display, bufwin);
result = destroy_window(bufwin);
bufwin = 0LL;
bufdrawwin = 0LL;
return result;
}

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

close_scratchwindow();
buffer_iconized = 0;
buffer_is_open = 0;
XDestroyWindow(display, bufwin);
result = destroy_window(bufwin);
bufwin = 0LL;
bufdrawwin = 0LL;
return result;
}

original_code:
void buffer_close(void)
{
    close_scratchwindow();
    buffer_iconized = 0;
    buffer_is_open = 0;
    XDestroyWindow(display, bufwin);
    destroy_window(bufwin);
    bufwin = 0;
    bufdrawwin = 0;
}

canonical_original_code:
void buffer_close()
{
    close_scratchwindow();
    buffer_iconized = 0;
    buffer_is_open = 0;
    XDestroyWindow(display, bufwin);
    destroy_window(bufwin);
    bufwin = 0;
    bufdrawwin = 0;
}


decompiled_code:
__int64 __fastcall buffer_handle_button(__int64 a1, int a2)
{
__int64 result; // rax

if ( a2 )
{
if ( a2 == 1 && buffer_is_open )
{
result = remark_is_open;
if ( !remark_is_open )
result = buffer_close();
}
}
else
{
XClearWindow(display, bufdrawwin);
clear_window(buffer_info);
redraw_window(buffer_info);
result = scrollbar_set(scrollver, 0LL, 1LL);
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func19(__int64 a1, int a2)
{
__int64 result; // rax

if ( a2 )
{
if ( a2 == 1 && buffer_is_open )
{
result = remark_is_open;
if ( !remark_is_open )
result = func18();
}
}
else
{
XClearWindow(display, bufdrawwin);
clear_window(buffer_info);
redraw_window(buffer_info);
result = scrollbar_set(scrollver, 0LL, 1LL);
}
return result;
}

original_code:
static void buffer_handle_button(void *data __attribute__((unused)), int b_num)
{
    switch (b_num) {
    case KILLBUTTON:
 XClearWindow(display, bufdrawwin);
 clear_window(buffer_info);
 redraw_window(buffer_info);
 scrollbar_set(scrollver,0, 1);
 break;
    case DONEBUTTON:
 if ((buffer_is_open && !remark_is_open)) buffer_close();
 break;
    }
}

canonical_original_code:
static void buffer_handle_button(void *data, int b_num)
{
    switch (b_num) {
    case KILLBUTTON:
 XClearWindow(display, bufdrawwin);
 clear_window(buffer_info);
 redraw_window(buffer_info);
 scrollbar_set(scrollver,0, 1);
 break;
    case DONEBUTTON:
 if ((buffer_is_open && !remark_is_open)) buffer_close();
 break;
    }
}


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

if ( bufdrawwin )
{
dbl_click();
result = get_motion_hints(bufdrawwin, 0LL);
}
return result;
}

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

if ( bufdrawwin )
{
dbl_click();
result = get_motion_hints(bufdrawwin, 0LL);
}
return result;
}

original_code:
static void double_click_func(void *data __attribute__((unused)))
{
    if (bufdrawwin) {
 dbl_click();
 get_motion_hints(bufdrawwin,0);
    }
}

canonical_original_code:
static void double_click_func(void *data)
{
    if (bufdrawwin) {
 dbl_click();
 get_motion_hints(bufdrawwin,0);
    }
}


decompiled_code:
_BOOL8 __fastcall key_match_exact(_DWORD *a1, int a2, int a3)
{
_BOOL8 result; // rax

result = 0LL;
if ( *a1 == a2 )
result = a1[1] == a3;
return result;
}

canonical_decompiled_code:
_BOOL8 __fastcall func0(_DWORD *a1, int a2, int a3)
{
_BOOL8 result; // rax

result = 0LL;
if ( *a1 == a2 )
result = a1[1] == a3;
return result;
}

original_code:
static int key_match_exact(Key *k1, KeyNum num, KeyMode mode)
{
    return k1->keysym==num && k1->mode==mode;
}

canonical_original_code:
static int key_match_exact(struct Key *k1, unsigned int num, unsigned int mode)
{
    return k1->keysym==num && k1->mode==mode;
}

variable_types: struct Key { unsigned int keysym; unsigned int mode; struct keymap { char storage_type; int numdef; void *map; unsigned short *name; unsigned short *comment; } *prefix; void *func; } *

variable_types:
num
unsigned int

variable_types:
mode
unsigned int

user_defined_types: struct Key { unsigned int keysym; unsigned int mode; struct keymap *prefix; void *func; }


decompiled_code:
_BOOL8 __fastcall key_match_pressed(_DWORD *a1, int a2, int a3)
{
_BOOL8 result; // rax
int v4; // ecx
int v5; // edx

result = 0LL;
if ( *a1 == a2 )
{
v4 = a1[1];
v5 = v4 & a3;
if ( !(_WORD)v5 )
{
LOWORD(v4) = 0;
result = v4 == v5;
}
}
return result;
}

canonical_decompiled_code:
_BOOL8 __fastcall func1(_DWORD *a1, int a2, int a3)
{
_BOOL8 result; // rax
int v4; // ecx
int v5; // edx

result = 0LL;
if ( *a1 == a2 )
{
v4 = a1[1];
v5 = v4 & a3;
if ( !(_WORD)v5 )
{
LOWORD(v4) = 0;
result = v4 == v5;
}
}
return result;
}

original_code:
static int key_match_pressed(Key *k1, KeyNum num, KeyMode mode)
{
    KeyMode tr;
    if (k1->keysym!=num) return 0;
    tr=k1->mode&mode;
    return (!(tr&0xffff) && ((k1->mode&0xffff0000)==tr));
}

canonical_original_code:
static int key_match_pressed(struct Key *k1, unsigned int num, unsigned int mode)
{
    unsigned int tr;
    if (k1->keysym!=num) return 0;
    tr=k1->mode&mode;
    return (!(tr&0xffff) && ((k1->mode&0xffff0000)==tr));
}

variable_types:
tr
unsigned int

user_defined_types: struct keymap { char storage_type; int numdef; void *map; unsigned short *name; unsigned short *comment; }


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

result = mm_malloc(32LL);
*(_BYTE *)result = 0;
*(_QWORD *)(result + 8) = 0LL;
*(_QWORD *)(result + 16) = 0LL;
*(_QWORD *)(result + 24) = 0LL;
return result;
}

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

result = mm_malloc(32LL);
*(_BYTE *)result = 0;
*(_QWORD *)(result + 8) = 0LL;
*(_QWORD *)(result + 16) = 0LL;
*(_QWORD *)(result + 24) = 0LL;
return result;
}

original_code:
static KeyMap *new_keymap(void)
{
    KeyMap *km=mm_malloc(sizeof(KeyMap));
    km->storage_type=0;
    km->map=0;
    km->name=0;
    km->comment=0;
    return km;
}

canonical_original_code:
static struct keymap *new_keymap()
{
    struct keymap *km = mm_malloc(sizeof(KeyMap));
    km->storage_type=0;
    km->map=0;
    km->name=0;
    km->comment=0;
    return km;
}

variable_types: struct keymap { char storage_type; int numdef; void *map; unsigned short *name; unsigned short *comment; } *


decompiled_code:
__int64 __fastcall get_map(__int64 a1)
{
__int64 v1; // rax
__int64 *v2; // rbx
bool v3; // zf
__int64 *v4; // rax
_QWORD *v6; // rax
_QWORD *v7; // r12
__int64 v8; // rax
__int64 v9; // rbx

v1 = allkeymaps;
v2 = &allkeymaps;
if ( allkeymaps )
{
while ( 1 )
{
v3 = (unsigned int)Ustrcmp(*(_QWORD *)(*(_QWORD *)v1 + 16LL), a1) == 0;
v4 = (__int64 *)*v2;
if ( v3 )
break;
v2 = v4 + 1;
v1 = v4[1];
if ( !v1 )
goto LABEL_7;
}
if ( v4 )
return *v4;
}
LABEL_7:
v6 = (_QWORD *)mm_malloc(16LL);
*v2 = (__int64)v6;
v7 = v6;
v6[1] = 0LL;
*v6 = new_keymap();
v8 = Ustrlen(a1);
v9 = *v7;
*(_QWORD *)(v9 + 16) = mm_malloc(8 * v8 + 8);
Ustrcpy(*(_QWORD *)(*v7 + 16LL), a1);
return *v7;
}

canonical_decompiled_code:
__int64 __fastcall func5(__int64 a1)
{
__int64 v1; // rax
__int64 *v2; // rbx
bool v3; // zf
__int64 *v4; // rax
_QWORD *v6; // rax
_QWORD *v7; // r12
__int64 v8; // rax
__int64 v9; // rbx

v1 = allkeymaps;
v2 = &allkeymaps;
if ( allkeymaps )
{
while ( 1 )
{
v3 = (unsigned int)Ustrcmp(*(_QWORD *)(*(_QWORD *)v1 + 16LL), a1) == 0;
v4 = (__int64 *)*v2;
if ( v3 )
break;
v2 = v4 + 1;
v1 = v4[1];
if ( !v1 )
goto LABEL_7;
}
if ( v4 )
return *v4;
}
LABEL_7:
v6 = (_QWORD *)mm_malloc(16LL);
*v2 = (__int64)v6;
v7 = v6;
v6[1] = 0LL;
*v6 = func3();
v8 = Ustrlen(a1);
v9 = *v7;
*(_QWORD *)(v9 + 16) = mm_malloc(8 * v8 + 8);
Ustrcpy(*(_QWORD *)(*v7 + 16LL), a1);
return *v7;
}

original_code:
KeyMap *get_map(Uchar *name)
{
    KeyMapList **kml=&allkeymaps;
    KeyMapList *km;
    while (*kml && (Ustrcmp((*kml)->keymap->name,name))) kml=&(*kml)->next;
    if (*kml) return (*kml)->keymap;
    *kml=km=mm_malloc(sizeof(KeyMapList));
    km->next=0;
    km->keymap=new_keymap();
    km->keymap->name=mm_malloc(sizeof(Uchar*)*(Ustrlen(name)+1));
    Ustrcpy(km->keymap->name, name);
    return km->keymap;
}

canonical_original_code:
struct keymap *get_map(unsigned short *name)
{
    struct KeyMapList **kml = &allkeymaps;
    struct KeyMapList *km;
    while (*kml && (Ustrcmp((*kml)->keymap->name,name))) kml=&(*kml)->next;
    if (*kml) return (*kml)->keymap;
    *kml=km=mm_malloc(sizeof(KeyMapList));
    km->next=0;
    km->keymap=new_keymap();
    km->keymap->name=mm_malloc(sizeof(unsigned short *)*(Ustrlen(name)+1));
    Ustrcpy(km->keymap->name, name);
    return km->keymap;
}

variable_types:
name
unsigned short *

variable_types: struct KeyMapList { struct keymap { char storage_type; int numdef; void *map; unsigned short *name; unsigned short *comment; } *keymap; struct KeyMapList *next; } **

user_defined_types: struct KeyMapList { struct keymap *keymap; struct KeyMapList *next; }


decompiled_code:
void clear_keymap()
{
;
}

canonical_decompiled_code:
void func6()
{
;
}

original_code:
void clear_keymap(KeyMap *map)
{
}

canonical_original_code:
void clear_keymap(struct keymap *map)
{
}


decompiled_code:
__int64 __fastcall set_keymap_help(__int64 a1, __int64 a2)
{
__int64 v2; // rax
__int64 v3; // rax

v2 = Ustrlen(a2);
v3 = mm_malloc(2 * v2 + 2);
*(_QWORD *)(a1 + 24) = v3;
return Ustrcpy(v3, a2);
}

canonical_decompiled_code:
__int64 __fastcall func8(__int64 a1, __int64 a2)
{
__int64 v2; // rax
__int64 v3; // rax

v2 = Ustrlen(a2);
v3 = mm_malloc(2 * v2 + 2);
*(_QWORD *)(a1 + 24) = v3;
return Ustrcpy(v3, a2);
}

original_code:
void set_keymap_help(KeyMap *map, Uchar *help)
{
    map->comment=mm_malloc((Ustrlen(help)+1)*sizeof(Uchar));
    Ustrcpy(map->comment,help);
}

canonical_original_code:
void set_keymap_help(struct keymap *map, unsigned short *help)
{
    map->comment=mm_malloc((Ustrlen(help)+1)*sizeof(Uchar));
    Ustrcpy(map->comment,help);
}

variable_types:
help
unsigned short *


decompiled_code:
__int64 __fastcall push_keymap(__int64 a1)
{
__int64 result; // rax
__int64 *v2; // rdx
__int64 v3; // rcx

clear_state();
result = mm_malloc(48LL);
v2 = (__int64 *)currentstack;
v3 = *(_QWORD *)currentstack;
*(_QWORD *)(result + 8) = a1;
*(_QWORD *)(result + 16) = a1;
*(_QWORD *)result = v3;
*(_QWORD *)(result + 24) = 0LL;
*(_QWORD *)(result + 32) = 0LL;
*(_DWORD *)(result + 40) = 0;
*v2 = result;
return result;
}

canonical_decompiled_code:
__int64 __fastcall func11(__int64 a1)
{
__int64 result; // rax
__int64 *v2; // rdx
__int64 v3; // rcx

func2();
result = mm_malloc(48LL);
v2 = (__int64 *)currentstack;
v3 = *(_QWORD *)currentstack;
*(_QWORD *)(result + 8) = a1;
*(_QWORD *)(result + 16) = a1;
*(_QWORD *)result = v3;
*(_QWORD *)(result + 24) = 0LL;
*(_QWORD *)(result + 32) = 0LL;
*(_DWORD *)(result + 40) = 0;
*v2 = result;
return result;
}

original_code:
void push_keymap(KeyMap *map)
{
    KeyStack *k;
    clear_state();
    k=mm_malloc(sizeof(KeyStack));
    k->next=currentstack->stack;
    k->prefix=k->keymap=map;
    k->tempremovebefore=0;
    k->tempremoveafter=0;
    k->temporary=0;
    currentstack->stack=k;
}

canonical_original_code:
void push_keymap(struct keymap *map)
{
    struct KeyStack *k;
    clear_state();
    k=mm_malloc(sizeof(KeyStack));
    k->next=currentstack->stack;
    k->prefix=k->keymap=map;
    k->tempremovebefore=0;
    k->tempremoveafter=0;
    k->temporary=0;
    currentstack->stack=k;
}

variable_types: struct KeyStack { struct KeyStack *next; struct keymap { char storage_type; int numdef; void *map; unsigned short *name; unsigned short *comment; } *keymap; struct keymap *prefix; void *tempremovebefore; void *tempremoveafter; int temporary; } *

user_defined_types: struct KeyStack { struct KeyStack *next; struct keymap *keymap; struct keymap *prefix; void *tempremovebefore; void *tempremoveafter; int temporary; }


decompiled_code:
__int64 __fastcall push_temporary_keymap(__int64 a1, __int64 a2, __int64 a3)
{
__int64 result; // rax

push_keymap(a1);
result = *(_QWORD *)currentstack;
*(_DWORD *)(result + 40) = 1;
*(_QWORD *)(result + 24) = a2;
*(_QWORD *)(result + 32) = a3;
return result;
}

canonical_decompiled_code:
__int64 __fastcall func12(__int64 a1, __int64 a2, __int64 a3)
{
__int64 result; // rax

func11(a1);
result = *(_QWORD *)currentstack;
*(_DWORD *)(result + 40) = 1;
*(_QWORD *)(result + 24) = a2;
*(_QWORD *)(result + 32) = a3;
return result;
}

original_code:
void push_temporary_keymap(KeyMap *map, void *beforelazyfunc,
      void *afterlazyfunc)
{
    push_keymap(map);
    currentstack->stack->temporary=1;
    currentstack->stack->tempremovebefore=beforelazyfunc;
    currentstack->stack->tempremoveafter=afterlazyfunc;
}

canonical_original_code:
void push_temporary_keymap(struct keymap *map, void *beforelazyfunc, void *afterlazyfunc)
{
    push_keymap(map);
    currentstack->stack->temporary=1;
    currentstack->stack->tempremovebefore=beforelazyfunc;
    currentstack->stack->tempremoveafter=afterlazyfunc;
}

variable_types:
beforelazyfunc
void *

variable_types:
afterlazyfunc
void *


decompiled_code:
__int64 pop_keymap()
{
__int64 v0; // r12
_QWORD *v1; // rdi

v0 = 0LL;
clear_state();
v1 = *(_QWORD **)currentstack;
if ( *(_QWORD *)currentstack )
{
v0 = v1[1];
*(_QWORD *)currentstack = *v1;
mm_free();
}
return v0;
}

canonical_decompiled_code:
__int64 func13()
{
__int64 v0; // r12
_QWORD *v1; // rdi

v0 = 0LL;
func2();
v1 = *(_QWORD **)currentstack;
if ( *(_QWORD *)currentstack )
{
v0 = v1[1];
*(_QWORD *)currentstack = *v1;
mm_free();
}
return v0;
}

original_code:
KeyMap *pop_keymap(void)
{
    KeyStack *k;
    KeyMap *km;
    clear_state();
    k=currentstack->stack;
    if (k) {
 currentstack->stack=k->next;
 km=k->keymap;
 mm_free(k);
    } else km=0;
    return km;
}

canonical_original_code:
struct keymap *pop_keymap()
{
    struct KeyStack *k;
    struct keymap *km;
    clear_state();
    k=currentstack->stack;
    if (k) {
 currentstack->stack=k->next;
 km=k->keymap;
 mm_free(k);
    } else km=0;
    return km;
}

return_type: struct keymap { char storage_type; int numdef; void *map; unsigned short *name; unsigned short *comment; } *


decompiled_code:
__int64 __fastcall multi_press(__int64 a1, int a2)
{
__int64 result; // rax

if ( ++prdiff > 1 )
return 0xFFFFFFFFLL;
result = 0LL;
if ( (unsigned __int64)(a1 - lasttime) <= 0x12B )
result = (unsigned int)(seqcount + 1);
seqcount = result;
buttonnum = a2;
lasttime = a1;
return result;
}

canonical_decompiled_code:
__int64 __fastcall func14(__int64 a1, int a2)
{
__int64 result; // rax

if ( ++prdiff > 1 )
return 0xFFFFFFFFLL;
result = 0LL;
if ( (unsigned __int64)(a1 - lasttime) <= 0x12B )
result = (unsigned int)(seqcount + 1);
seqcount = result;
buttonnum = a2;
lasttime = a1;
return result;
}

original_code:
int multi_press(unsigned long t, int button)
{
    prdiff++;
    if (prdiff>1) return -1;
    if (t-lasttime<doublediff) {
 seqcount++;
    } else seqcount=0;
    buttonnum=button;
    lasttime=t;
    return seqcount;
}

variable_types:
t
unsigned long

variable_types: button int


decompiled_code:
__int64 __fastcall multi_release(__int64 a1)
{
int v1; // eax

v1 = prdiff;
if ( !prdiff )
return 0xFFFFFFFFLL;
--prdiff;
if ( v1 != 1 )
return 0xFFFFFFFFLL;
lasttime = a1;
return (unsigned int)seqcount;
}

canonical_decompiled_code:
__int64 __fastcall func15(__int64 a1)
{
int v1; // eax

v1 = prdiff;
if ( !prdiff )
return 0xFFFFFFFFLL;
--prdiff;
if ( v1 != 1 )
return 0xFFFFFFFFLL;
lasttime = a1;
return (unsigned int)seqcount;
}

original_code:
int multi_release(unsigned long t)
{
    if (!prdiff) return -1;
    prdiff--;
    if (prdiff) return -1;
    lasttime=t;
    return seqcount;
}


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

result = (unsigned int)prdiff;
if ( prdiff )
{
result = 0xFFFFFFFFLL;
if ( (unsigned __int64)(a1 - lasttime) > 0x12C )
result = (unsigned int)buttonnum;
}
return result;
}

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

result = (unsigned int)prdiff;
if ( prdiff )
{
result = 0xFFFFFFFFLL;
if ( (unsigned __int64)(a1 - lasttime) > 0x12C )
result = (unsigned int)buttonnum;
}
return result;
}

original_code:
int multi_drag(unsigned long t)
{
    if (!prdiff) {
 return 0;
    }
    if (t-lasttime>dragdiff) {
 return buttonnum;
    }
    return -1;
}


decompiled_code:
void set_window_position()
{
;
}

canonical_decompiled_code:
void func17()
{
;
}

original_code:
void set_window_position(unsigned long window, int x, int y,
    unsigned long time)
{
    cur_window=window;
    cur_x=x;
    cur_y=y;
    cur_time=time;
}

variable_types:
window
unsigned long

variable_types: x int

variable_types: y int

variable_types:
time
unsigned long


decompiled_code:
void keyboard_init()
{
;
}

canonical_decompiled_code:
void func18()
{
;
}

original_code: void keyboard_init(void) { }

canonical_original_code: void keyboard_init() { }


decompiled_code:
__int64 __fastcall destroy_keyboard_stack(_QWORD *a1)
{
_QWORD *v2; // rdi
__int64 result; // rax

if ( a1 )
{
if ( currentstack == a1 )
{
clear_state();
currentstack = &defaultkeystack;
}
while ( 1 )
{
v2 = (_QWORD *)*a1;
if ( !*a1 )
break;
*a1 = *v2;
mm_free(v2);
}
result = mm_free(a1);
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func19(_QWORD *a1)
{
_QWORD *v2; // rdi
__int64 result; // rax

if ( a1 )
{
if ( currentstack == a1 )
{
func2();
currentstack = &defaultkeystack;
}
while ( 1 )
{
v2 = (_QWORD *)*a1;
if ( !*a1 )
break;
*a1 = *v2;
mm_free(v2);
}
result = mm_free(a1);
}
return result;
}

original_code:
void destroy_keyboard_stack(void *stack)
{
  KeyStackInfo *ksi;
  KeyStack *ks;
  if (!stack) return;
  ksi = (KeyStackInfo*) stack;
  if (ksi==currentstack) {
    clear_state();
    currentstack = &defaultkeystack;
  }
  while (ksi->stack) {
    ks = ksi->stack;
    ksi->stack = ks->next;
    mm_free(ks);
  }
  mm_free(ksi);
}

canonical_original_code:
void destroy_keyboard_stack(void *stack)
{
  struct KeyStackInfoRec *ksi;
  struct KeyStack *ks;
  if (!stack) return;
  ksi = (struct KeyStackInfoRec *) stack;
  if (ksi==currentstack) {
    clear_state();
    currentstack = &defaultkeystack;
  }
  while (ksi->stack) {
    ks = ksi->stack;
    ksi->stack = ks->next;
    mm_free(ks);
  }
  mm_free(ksi);
}

variable_types:
stack
void *

variable_types: struct KeyStackInfoRec { struct KeyStack { struct KeyStack *next; struct keymap { char storage_type; int numdef; void *map; unsigned short *name; unsigned short *comment; } *keymap; struct keymap *prefix; void *tempremovebefore; void *tempremoveafter; int temporary; } *stack; int inprefix; } *

user_defined_types: struct KeyStackInfoRec { struct KeyStack *stack; int inprefix; }


decompiled_code:
_QWORD *clear_state()
{
_DWORD *v0; // rcx
_QWORD *result; // rax

v0 = currentstack;
result = *(_QWORD **)currentstack;
if ( *(_QWORD *)currentstack )
{
do
{
result[2] = result[1];
result = (_QWORD *)*result;
}
while ( result );
}
v0[2] = 0;
return result;
}

canonical_decompiled_code:
_QWORD *func2()
{
_DWORD *v0; // rcx
_QWORD *result; // rax

v0 = currentstack;
result = *(_QWORD **)currentstack;
if ( *(_QWORD *)currentstack )
{
do
{
result[2] = result[1];
result = (_QWORD *)*result;
}
while ( result );
}
v0[2] = 0;
return result;
}

original_code:
static void clear_state(void)
{
    KeyStack *k;
    k=currentstack->stack;
    while (k) {
 k->prefix=k->keymap;
 k=k->next;
    }
    currentstack->inprefix=0;
}

canonical_original_code:
static void clear_state()
{
    struct KeyStack *k;
    k=currentstack->stack;
    while (k) {
 k->prefix=k->keymap;
 k=k->next;
    }
    currentstack->inprefix=0;
}


decompiled_code:
__int64 str_input()
{
int v0; // eax
__int64 result; // rax
__int64 v2; // rax

if ( !input_string )
return 0LL;
v0 = unput_pos;
if ( unput_pos )
{
--unput_pos;
result = (unsigned int)unput_buffer[v0 - 1];
}
else
{
v2 = is_pos++;
result = (unsigned int)*(char *)(input_string + v2);
}
return result;
}

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

if ( !input_string )
return 0LL;
v0 = unput_pos;
if ( unput_pos )
{
--unput_pos;
result = (unsigned int)unput_buffer[v0 - 1];
}
else
{
v2 = is_pos++;
result = (unsigned int)*(char *)(input_string + v2);
}
return result;
}

original_code:
static int str_input(void)
{
  if (input_string) {
    if (unput_pos)
      return unput_buffer[--unput_pos];
    else
      return input_string[is_pos++];
  } else {
    return 0;
  }
}

canonical_original_code:
static int str_input()
{
  if (input_string) {
    if (unput_pos)
      return unput_buffer[--unput_pos];
    else
      return input_string[is_pos++];
  } else {
    return 0;
  }
}


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

if ( input_string )
{
result = unput_pos++;
unput_buffer[result] = a1;
}
return result;
}

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

if ( input_string )
{
result = unput_pos++;
unput_buffer[result] = a1;
}
return result;
}

original_code:
static void str_unput(char c)
{
  if (input_string) {
    unput_buffer[unput_pos++]=c;
  }
}

variable_types: c char


decompiled_code:
__int64 str_wrapup()
{
lastchar = 32;
return 1LL;
}

canonical_decompiled_code:
__int64 func2()
{
lastchar = 32;
return 1LL;
}

original_code:
static int str_wrapup(void)
{
  lastchar=' ';
  return 1;
}

canonical_original_code:
static int str_wrapup()
{
  lastchar=' ';
  return 1;
}


decompiled_code:
int __fastcall str_output(char a1)
{
return IO_putc(a1, stdout);
}

canonical_decompiled_code:
int __fastcall func3(char a1)
{
return IO_putc(a1, stdout);
}

original_code:
static void str_output(char c)
{
  _IO_putc (c, stdout);
}


decompiled_code:
unsigned __int64 __fastcall gnu_dev_major(unsigned __int64 a1)
{
return HIDWORD(a1) & 0xFFFFF000 | (a1 >> 8) & 0xFFF;
}

canonical_decompiled_code:
unsigned __int64 __fastcall func4(unsigned __int64 a1)
{
return HIDWORD(a1) & 0xFFFFF000 | (a1 >> 8) & 0xFFF;
}

original_code:
__extension__ extern __inline unsigned int
__attribute__ ((__nothrow__)) gnu_dev_major (unsigned long long int __dev)
{
  return ((__dev >> 8) & 0xfff) | ((unsigned int) (__dev >> 32) & ~0xfff);
}

canonical_original_code:
extern __inline unsigned int gnu_dev_major(unsigned long long __dev)
{
  return ((__dev >> 8) & 0xfff) | ((unsigned int) (__dev >> 32) & ~0xfff);
}

return_type: unsigned int


decompiled_code:
__int64 __fastcall gnu_dev_minor(unsigned __int64 a1)
{
int v1; // edx

v1 = a1 >> 12;
LOBYTE(v1) = 0;
return v1 | (unsigned int)(unsigned __int8)a1;
}

canonical_decompiled_code:
__int64 __fastcall func5(unsigned __int64 a1)
{
int v1; // edx

v1 = a1 >> 12;
LOBYTE(v1) = 0;
return v1 | (unsigned int)(unsigned __int8)a1;
}

original_code:
__extension__ extern __inline unsigned int
__attribute__ ((__nothrow__)) gnu_dev_minor (unsigned long long int __dev)
{
  return (__dev & 0xff) | ((unsigned int) (__dev >> 12) & ~0xff);
}

canonical_original_code:
extern __inline unsigned int gnu_dev_minor(unsigned long long __dev)
{
  return (__dev & 0xff) | ((unsigned int) (__dev >> 12) & ~0xff);
}


decompiled_code:
unsigned __int64 __fastcall gnu_dev_makedev(__int64 a1, __int64 a2)
{
return (a1 << 32) & 0xFFFFF00000000000LL | (a2 << 12) & 0xFFFFFF00000LL | (unsigned __int8)a2 | ((_DWORD)a1 << 8) & 0xFFF00u;
}

canonical_decompiled_code:
unsigned __int64 __fastcall func6(__int64 a1, __int64 a2)
{
return (a1 << 32) & 0xFFFFF00000000000LL | (a2 << 12) & 0xFFFFFF00000LL | (unsigned __int8)a2 | ((_DWORD)a1 << 8) & 0xFFF00u;
}

original_code:
__extension__ extern __inline unsigned long long int
__attribute__ ((__nothrow__)) gnu_dev_makedev (unsigned int __major, unsigned int __minor)
{
  return ((__minor & 0xff) | ((__major & 0xfff) << 8)
   | (((unsigned long long int) (__minor & ~0xff)) << 12)
   | (((unsigned long long int) (__major & ~0xfff)) << 32));
}

canonical_original_code:
extern __inline unsigned long long gnu_dev_makedev(unsigned int __major, unsigned int __minor)
{
  return ((__minor & 0xff) | ((__major & 0xfff) << 8)
   | (((unsigned long long) (__minor & ~0xff)) << 12)
   | (((unsigned long long) (__major & ~0xfff)) << 32));
}

return_type: unsigned long long


MakeBinOpNode

decompiled_code:
__int64 MakeBinOpNode()
{
__int64 v1; // [rsp+8h] [rbp-10h] BYREF

v1 = 0xF700F710F700LL;
return make_node(63232LL, &v1, 3LL, 0LL, 0x3FFFLL);
}

canonical_decompiled_code:
__int64 func7()
{
__int64 v1; // [rsp+8h] [rbp-10h] BYREF

v1 = 0xF700F710F700LL;
return make_node(63232LL, &v1, 3LL, 0LL, 0x3FFFLL);
}

original_code:
void MakeBinOpNode(void)
{
  Uchar buffer[4];
  buffer[0]=buffer[2]=0xF700;
  buffer[1]=0xF710;
  buffer[3]=0;
  make_node(0xF700, buffer, 3,0,0x3fff);
}

canonical_original_code:
void MakeBinOpNode()
{
  unsigned short buffer[4];
  buffer[0]=buffer[2]=0xF700;
  buffer[1]=0xF710;
  buffer[3]=0;
  make_node(0xF700, buffer, 3,0,0x3fff);
}

variable_types:
buffer
unsigned short [4]


MakeSubscriptNode

decompiled_code:
__int64 MakeSubscriptNode()
{
unsigned int v0; // eax
int v2; // [rsp+Ah] [rbp-Eh] BYREF
__int16 v3; // [rsp+Eh] [rbp-Ah]

v3 = 0;
v2 = -150800639;
v0 = notation_with_number(3407435781LL);
return make_node(63248LL, &v2, 2LL, v0, 0LL);
}

canonical_decompiled_code:
__int64 func8()
{
unsigned int v0; // eax
int v2; // [rsp+Ah] [rbp-Eh] BYREF
__int16 v3; // [rsp+Eh] [rbp-Ah]

v3 = 0;
v2 = -150800639;
v0 = notation_with_number(3407435781LL);
return make_node(63248LL, &v2, 2LL, v0, 0LL);
}

original_code:
void MakeSubscriptNode(void)
{
   Uchar buffer[3];
   buffer[0]=((0xF700) | (1));
   buffer[1]=((0xF700) | (2));
   buffer[2]=0;
   make_node(0xF710, buffer, 2, notation_with_number(subscript_uid), 0);
}

canonical_original_code:
void MakeSubscriptNode()
{
   unsigned short buffer[3];
   buffer[0]=((0xF700) | (1));
   buffer[1]=((0xF700) | (2));
   buffer[2]=0;
   make_node(0xF710, buffer, 2, notation_with_number(subscript_uid), 0);
}

variable_types:
buffer
unsigned short [3]


decompiled_code:
__int64 __fastcall pvs_yyerror(const char *a1)
{
fprintf(stderr, "%s\n", a1);
return 0LL;
}

canonical_decompiled_code:
__int64 __fastcall func9(const char *a1)
{
fprintf(stderr, "%s\n", a1);
return 0LL;
}

original_code:
int pvs_yyerror(char *c)
{
  fprintf(stderr, "%s\n", c);
  return 0;
}

variable_types:
c
char *


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

if ( !a1 )
return 0LL;
while ( 1 )
{
result = *a1;
if ( !(_DWORD)result )
break;
++a1;
if ( (_DWORD)result == a2 )
return 1LL;
}
return result;
}

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

if ( !a1 )
return 0LL;
while ( 1 )
{
result = *a1;
if ( !(_DWORD)result )
break;
++a1;
if ( (_DWORD)result == a2 )
return 1LL;
}
return result;
}

original_code:
int pvs_yyback(int *p, int m)
{
 if (p==0) return(0);
 while (*p) {
  if (*p++ == m)
   return(1);
 }
 return(0);
}

variable_types:
p
int *

variable_types: m int


decompiled_code:
__int64 pvs_yylook()
{
char *v0; // rbx
int v1; // er12
__int64 v2; // rdi
__int64 v3; // rsi
int v4; // eax
__int64 v5; // r10
unsigned __int64 v6; // r11
char v7; // r13
__int64 v8; // r9
int v9; // edx
unsigned __int8 *v10; // r10
char *v11; // rax
char *v12; // r10
char *v13; // rax
unsigned __int64 v14; // r8
unsigned __int64 v15; // r13
__int64 v16; // rax
unsigned int *v17; // rdi
int v18; // eax
char *v19; // rcx
char v20; // al
void **v21; // rax
int v22; // esi
char v23; // di
int v24; // eax
void **v26; // rax

if ( pvs_yymorfg )
{
pvs_yymorfg = 0;
v0 = (char *)&pvs_yytext + pvs_yyleng;
}
else
{
v0 = (char *)&pvs_yytext;
}
v1 = 1;
while ( 2 )
{
v2 = pvs_yyprevious;
LABEL_5:
v3 = (__int64)pvs_yybgin;
pvs_yyestate = pvs_yybgin;
if ( (_DWORD)v2 == 10 )
v3 = (__int64)(pvs_yybgin + 3);
if ( *(_UNKNOWN **)v3 == &pvs_yycrank && !v1 )
{
v21 = *(void ***)(v3 + 8);
if ( !v21 || *v21 == &pvs_yycrank )
goto LABEL_28;
}
do
{
while ( 2 )
{
v4 = ((__int64 (*)(void))str_input)();
v7 = v4;
*v0 = v4;
if ( v0 + 1 > (char *)&pvs_yytext + 0x2000 )
{
LABEL_55:
fprintf(pvs_yyout, "Input string too long, limit %d\n", 0x2000LL);
exit(1);
}
v8 = v4;
v9 = (unsigned int)&pvs_yycrank;
v2 = 2LL * v4;
while ( (int)v5 > v9 )
{
v10 = (unsigned __int8 *)(v2 + v5);
if ( pvs_yytop >= v10 && (_UNKNOWN *)v3 == (_UNKNOWN *)((char *)&pvs_yysvec + 24 * *v10) )
{
v3 = 24LL * v10[1];
if ( v3 )
{
v3 += (__int64)&pvs_yysvec;
goto LABEL_45;
}
LABEL_22:
v2 = (unsigned int)v7;
str_unput(v7);
goto LABEL_23;
}
LABEL_12:
v3 = *(_QWORD *)(v3 + 8);
if ( v3 )
{
v5 = *(_QWORD *)v3;
if ( *(_UNKNOWN **)v3 != &pvs_yycrank )
continue;
}
goto LABEL_22;
}
if ( (int)v5 >= v9 )
goto LABEL_12;
v11 = (char *)&pvs_yycrank + (_QWORD)&pvs_yycrank - v5;
v12 = &v11[v2];
if ( pvs_yytop < &v11[v2] || (_UNKNOWN *)v3 != (_UNKNOWN *)((char *)&pvs_yysvec + 24 * (unsigned __int8)*v12) )
{
v13 = &v11[2 * pvs_yymatch[v8]];
if ( pvs_yytop >= v13 && (_UNKNOWN *)v3 == (_UNKNOWN *)((char *)&pvs_yysvec + 24 * (unsigned __int8)*v13) )
{
v3 = 24LL * (unsigned __int8)v13[1];
if ( v3 )
{
v3 += (__int64)&pvs_yysvec;
goto LABEL_45;
}
goto LABEL_22;
}
goto LABEL_12;
}
v3 = 24LL * (unsigned __int8)v12[1];
if ( !v3 )
goto LABEL_22;
v3 += (__int64)&pvs_yysvec;
LABEL_45:
*(_QWORD *)(v6 - 8) = v3;
v14 = v6;
if ( v6 > (unsigned __int64)&pvs_yylstate + 0x10000 )
goto LABEL_55;
if ( *(_UNKNOWN **)v3 != &pvs_yycrank )
{
++v0;
continue;
}
break;
}
v26 = *(void ***)(v3 + 8);
if ( !v26 )
{
++v0;
break;
}
++v0;
}
while ( *v26 != &pvs_yycrank );
LABEL_23:
v15 = v14 - 8;
if ( v14 <= (unsigned __int64)&pvs_yylstate )
{
LABEL_28:
if ( !pvs_yytext )
{
pvs_yysptr = &pvs_yysbuf;
return 0LL;
}
v20 = str_input(v2, v3);
v0 = (char *)&pvs_yytext;
v1 = 0;
v2 = (unsigned int)v20;
pvs_yytext = v20;
pvs_yyprevious = v2;
if ( (int)v2 > 0 )
{
str_output(v20);
continue;
}
goto LABEL_5;
}
break;
}
while ( 1 )
{
v16 = *(_QWORD *)v15;
*v0-- = 0;
if ( v16 )
{
v17 = *(unsigned int **)(v16 + 16);
pvs_yyfnd = v17;
if ( v17 )
{
v18 = *v17;
if ( (int)*v17 > 0 )
break;
}
}
v2 = (unsigned int)*v0;
v15 -= 8LL;
str_unput(*v0);
if ( v19 == v0 )
goto LABEL_28;
}
pvs_yyolsp = v15;
if ( pvs_yyextra[v18] )
{
v22 = v18;
while ( 1 )
{
v24 = pvs_yyback(v17, -v22);
if ( v15 <= (unsigned __int64)&pvs_yylstate || v24 == 1 )
break;
v23 = *v0;
v15 -= 8LL;
--v0;
str_unput(v23);
v22 = *pvs_yyfnd;
v17 = *(unsigned int **)(*(_QWORD *)v15 + 16LL);
}
v17 = (unsigned int *)pvs_yyfnd;
}
pvs_yyprevious = *v0;
pvs_yylsp = v15;
pvs_yyleng = (_DWORD)v0 - (unsigned int)&pvs_yytext + 1;
*((_BYTE *)&pvs_yytext + pvs_yyleng) = 0;
pvs_yyfnd = v17 + 1;
return *v17;
}

canonical_decompiled_code:
__int64 func11()
{
char *v0; // rbx
int v1; // er12
__int64 v2; // rdi
__int64 v3; // rsi
int v4; // eax
__int64 v5; // r10
unsigned __int64 v6; // r11
char v7; // r13
__int64 v8; // r9
int v9; // edx
unsigned __int8 *v10; // r10
char *v11; // rax
char *v12; // r10
char *v13; // rax
unsigned __int64 v14; // r8
unsigned __int64 v15; // r13
__int64 v16; // rax
unsigned int *v17; // rdi
int v18; // eax
char *v19; // rcx
char v20; // al
void **v21; // rax
int v22; // esi
char v23; // di
int v24; // eax
void **v26; // rax

if ( pvs_yymorfg )
{
pvs_yymorfg = 0;
v0 = (char *)&pvs_yytext + pvs_yyleng;
}
else
{
v0 = (char *)&pvs_yytext;
}
v1 = 1;
while ( 2 )
{
v2 = pvs_yyprevious;
LABEL_5:
v3 = (__int64)pvs_yybgin;
pvs_yyestate = pvs_yybgin;
if ( (_DWORD)v2 == 10 )
v3 = (__int64)(pvs_yybgin + 3);
if ( *(_UNKNOWN **)v3 == &pvs_yycrank && !v1 )
{
v21 = *(void ***)(v3 + 8);
if ( !v21 || *v21 == &pvs_yycrank )
goto LABEL_28;
}
do
{
while ( 2 )
{
v4 = ((__int64 (*)(void))str_input)();
v7 = v4;
*v0 = v4;
if ( v0 + 1 > (char *)&pvs_yytext + 0x2000 )
{
LABEL_55:
fprintf(pvs_yyout, "Input string too long, limit %d\n", 0x2000LL);
exit(1);
}
v8 = v4;
v9 = (unsigned int)&pvs_yycrank;
v2 = 2LL * v4;
while ( (int)v5 > v9 )
{
v10 = (unsigned __int8 *)(v2 + v5);
if ( pvs_yytop >= v10 && (_UNKNOWN *)v3 == (_UNKNOWN *)((char *)&pvs_yysvec + 24 * *v10) )
{
v3 = 24LL * v10[1];
if ( v3 )
{
v3 += (__int64)&pvs_yysvec;
goto LABEL_45;
}
LABEL_22:
v2 = (unsigned int)v7;
func1(v7);
goto LABEL_23;
}
LABEL_12:
v3 = *(_QWORD *)(v3 + 8);
if ( v3 )
{
v5 = *(_QWORD *)v3;
if ( *(_UNKNOWN **)v3 != &pvs_yycrank )
continue;
}
goto LABEL_22;
}
if ( (int)v5 >= v9 )
goto LABEL_12;
v11 = (char *)&pvs_yycrank + (_QWORD)&pvs_yycrank - v5;
v12 = &v11[v2];
if ( pvs_yytop < &v11[v2] || (_UNKNOWN *)v3 != (_UNKNOWN *)((char *)&pvs_yysvec + 24 * (unsigned __int8)*v12) )
{
v13 = &v11[2 * pvs_yymatch[v8]];
if ( pvs_yytop >= v13 && (_UNKNOWN *)v3 == (_UNKNOWN *)((char *)&pvs_yysvec + 24 * (unsigned __int8)*v13) )
{
v3 = 24LL * (unsigned __int8)v13[1];
if ( v3 )
{
v3 += (__int64)&pvs_yysvec;
goto LABEL_45;
}
goto LABEL_22;
}
goto LABEL_12;
}
v3 = 24LL * (unsigned __int8)v12[1];
if ( !v3 )
goto LABEL_22;
v3 += (__int64)&pvs_yysvec;
LABEL_45:
*(_QWORD *)(v6 - 8) = v3;
v14 = v6;
if ( v6 > (unsigned __int64)&pvs_yylstate + 0x10000 )
goto LABEL_55;
if ( *(_UNKNOWN **)v3 != &pvs_yycrank )
{
++v0;
continue;
}
break;
}
v26 = *(void ***)(v3 + 8);
if ( !v26 )
{
++v0;
break;
}
++v0;
}
while ( *v26 != &pvs_yycrank );
LABEL_23:
v15 = v14 - 8;
if ( v14 <= (unsigned __int64)&pvs_yylstate )
{
LABEL_28:
if ( !pvs_yytext )
{
pvs_yysptr = &pvs_yysbuf;
return 0LL;
}
v20 = func0(v2, v3);
v0 = (char *)&pvs_yytext;
v1 = 0;
v2 = (unsigned int)v20;
pvs_yytext = v20;
pvs_yyprevious = v2;
if ( (int)v2 > 0 )
{
func3(v20);
continue;
}
goto LABEL_5;
}
break;
}
while ( 1 )
{
v16 = *(_QWORD *)v15;
*v0-- = 0;
if ( v16 )
{
v17 = *(unsigned int **)(v16 + 16);
pvs_yyfnd = v17;
if ( v17 )
{
v18 = *v17;
if ( (int)*v17 > 0 )
break;
}
}
v2 = (unsigned int)*v0;
v15 -= 8LL;
func1(*v0);
if ( v19 == v0 )
goto LABEL_28;
}
pvs_yyolsp = v15;
if ( pvs_yyextra[v18] )
{
v22 = v18;
while ( 1 )
{
v24 = func10(v17, -v22);
if ( v15 <= (unsigned __int64)&pvs_yylstate || v24 == 1 )
break;
v23 = *v0;
v15 -= 8LL;
--v0;
func1(v23);
v22 = *pvs_yyfnd;
v17 = *(unsigned int **)(*(_QWORD *)v15 + 16LL);
}
v17 = (unsigned int *)pvs_yyfnd;
}
pvs_yyprevious = *v0;
pvs_yylsp = v15;
pvs_yyleng = (_DWORD)v0 - (unsigned int)&pvs_yytext + 1;
*((_BYTE *)&pvs_yytext + pvs_yyleng) = 0;
pvs_yyfnd = v17 + 1;
return *v17;
}

original_code:
int pvs_yylook(void)
{
 register struct pvs_yysvf *pvs_yystate, **lsp;
 register struct pvs_yywork *pvs_yyt;
 struct pvs_yysvf *pvs_yyz;
 int pvs_yych, pvs_yyfirst;
 struct pvs_yywork *pvs_yyr;
 char *pvs_yylastch;
 pvs_yyfirst=1;
 if (!pvs_yymorfg)
  pvs_yylastch = pvs_yytext;
 else {
  pvs_yymorfg=0;
  pvs_yylastch = pvs_yytext+pvs_yyleng;
  }
 for(;;){
  lsp = pvs_yylstate;
  pvs_yyestate = pvs_yystate = pvs_yybgin;
  if (pvs_yyprevious==10) pvs_yystate++;
  for (;;){
   pvs_yyt = pvs_yystate->pvs_yystoff;
   if(pvs_yyt == pvs_yycrank && !pvs_yyfirst){
    pvs_yyz = pvs_yystate->pvs_yyother;
    if(pvs_yyz == 0)break;
    if(pvs_yyz->pvs_yystoff == pvs_yycrank)break;
    }
   *pvs_yylastch++ = pvs_yych = str_input();
   if(pvs_yylastch > &pvs_yytext[8192]) {
    fprintf(pvs_yyout,"Input string too long, limit %d\n",8192);
    exit(1);
   }
   pvs_yyfirst=0;
  tryagain:
   pvs_yyr = pvs_yyt;
   if ( (int)pvs_yyt > (int)pvs_yycrank){
    pvs_yyt = pvs_yyr + pvs_yych;
    if (pvs_yyt <= pvs_yytop && pvs_yyt->verify+pvs_yysvec == pvs_yystate){
     if(pvs_yyt->advance+pvs_yysvec == pvs_yysvec)
      {str_unput(*--pvs_yylastch);break;}
     *lsp++ = pvs_yystate = pvs_yyt->advance+pvs_yysvec;
     if(lsp > &pvs_yylstate[8192]) {
      fprintf(pvs_yyout,"Input string too long, limit %d\n",8192);
      exit(1);
     }
     goto contin;
     }
    }
   else if((int)pvs_yyt < (int)pvs_yycrank) {
    pvs_yyt = pvs_yyr = pvs_yycrank+(pvs_yycrank-pvs_yyt);
    pvs_yyt = pvs_yyt + pvs_yych;
    if(pvs_yyt <= pvs_yytop && pvs_yyt->verify+pvs_yysvec == pvs_yystate){
     if(pvs_yyt->advance+pvs_yysvec == pvs_yysvec)
      {str_unput(*--pvs_yylastch);break;}
     *lsp++ = pvs_yystate = pvs_yyt->advance+pvs_yysvec;
     if(lsp > &pvs_yylstate[8192]) {
      fprintf(pvs_yyout,"Input string too long, limit %d\n",8192);
      exit(1);
     }
     goto contin;
     }
    pvs_yyt = pvs_yyr + pvs_yymatch[pvs_yych];
    if(pvs_yyt <= pvs_yytop && pvs_yyt->verify+pvs_yysvec == pvs_yystate){
     if(pvs_yyt->advance+pvs_yysvec == pvs_yysvec)
      {str_unput(*--pvs_yylastch);break;}
     *lsp++ = pvs_yystate = pvs_yyt->advance+pvs_yysvec;
     if(lsp > &pvs_yylstate[8192]) {
      fprintf(pvs_yyout,"Input string too long, limit %d\n",8192);
      exit(1);
     }
     goto contin;
     }
    }
   if ((pvs_yystate = pvs_yystate->pvs_yyother) && (pvs_yyt= pvs_yystate->pvs_yystoff) != pvs_yycrank){
    goto tryagain;
    }
   else
    {str_unput(*--pvs_yylastch);break;}
  contin:
   ;
   }
  while (lsp-- > pvs_yylstate){
   *pvs_yylastch-- = 0;
   if (*lsp != 0 && (pvs_yyfnd= (*lsp)->pvs_yystops) && *pvs_yyfnd > 0){
    pvs_yyolsp = lsp;
    if(pvs_yyextra[*pvs_yyfnd]){
     while(pvs_yyback((*lsp)->pvs_yystops,-*pvs_yyfnd) != 1 && lsp > pvs_yylstate){
      lsp--;
      str_unput(*pvs_yylastch--);
      }
     }
    pvs_yyprevious = *pvs_yylastch;
    pvs_yylsp = lsp;
    pvs_yyleng = pvs_yylastch-pvs_yytext+1;
    pvs_yytext[pvs_yyleng] = 0;
    return(*pvs_yyfnd++);
    }
   str_unput(*pvs_yylastch);
   }
  if (pvs_yytext[0] == 0 )
   {
   pvs_yysptr=pvs_yysbuf;
   return(0);
   }
  pvs_yyprevious = pvs_yytext[0] = str_input();
  if (pvs_yyprevious>0)
   str_output(pvs_yyprevious);
  pvs_yylastch=pvs_yytext;
  }
 }

canonical_original_code:
int pvs_yylook()
{
 register struct pvs_yysvf *pvs_yystate; register struct pvs_yysvf **lsp;
 register struct pvs_yywork *pvs_yyt;
 struct pvs_yysvf *pvs_yyz;
 int pvs_yych; int pvs_yyfirst;
 struct pvs_yywork *pvs_yyr;
 char *pvs_yylastch;
 pvs_yyfirst=1;
 if (!pvs_yymorfg)
  pvs_yylastch = pvs_yytext;
 else {
  pvs_yymorfg=0;
  pvs_yylastch = pvs_yytext+pvs_yyleng;
  }
 for(;;){
  lsp = pvs_yylstate;
  pvs_yyestate = pvs_yystate = pvs_yybgin;
  if (pvs_yyprevious==10) pvs_yystate++;
  for (;;){
   pvs_yyt = pvs_yystate->pvs_yystoff;
   if(pvs_yyt == pvs_yycrank && !pvs_yyfirst){
    pvs_yyz = pvs_yystate->pvs_yyother;
    if(pvs_yyz == 0)break;
    if(pvs_yyz->pvs_yystoff == pvs_yycrank)break;
    }
   *pvs_yylastch++ = pvs_yych = str_input();
   if(pvs_yylastch > &pvs_yytext[8192]) {
    fprintf(pvs_yyout,"Input string too long, limit %d\n",8192);
    exit(1);
   }
   pvs_yyfirst=0;
  tryagain:
   pvs_yyr = pvs_yyt;
   if ( (int)pvs_yyt > (int)pvs_yycrank){
    pvs_yyt = pvs_yyr + pvs_yych;
    if (pvs_yyt <= pvs_yytop && pvs_yyt->verify+pvs_yysvec == pvs_yystate){
     if(pvs_yyt->advance+pvs_yysvec == pvs_yysvec)
      {str_unput(*--pvs_yylastch);break;}
     *lsp++ = pvs_yystate = pvs_yyt->advance+pvs_yysvec;
     if(lsp > &pvs_yylstate[8192]) {
      fprintf(pvs_yyout,"Input string too long, limit %d\n",8192);
      exit(1);
     }
     goto contin;
     }
    }
   else if((int)pvs_yyt < (int)pvs_yycrank) {
    pvs_yyt = pvs_yyr = pvs_yycrank+(pvs_yycrank-pvs_yyt);
    pvs_yyt = pvs_yyt + pvs_yych;
    if(pvs_yyt <= pvs_yytop && pvs_yyt->verify+pvs_yysvec == pvs_yystate){
     if(pvs_yyt->advance+pvs_yysvec == pvs_yysvec)
      {str_unput(*--pvs_yylastch);break;}
     *lsp++ = pvs_yystate = pvs_yyt->advance+pvs_yysvec;
     if(lsp > &pvs_yylstate[8192]) {
      fprintf(pvs_yyout,"Input string too long, limit %d\n",8192);
      exit(1);
     }
     goto contin;
     }
    pvs_yyt = pvs_yyr + pvs_yymatch[pvs_yych];
    if(pvs_yyt <= pvs_yytop && pvs_yyt->verify+pvs_yysvec == pvs_yystate){
     if(pvs_yyt->advance+pvs_yysvec == pvs_yysvec)
      {str_unput(*--pvs_yylastch);break;}
     *lsp++ = pvs_yystate = pvs_yyt->advance+pvs_yysvec;
     if(lsp > &pvs_yylstate[8192]) {
      fprintf(pvs_yyout,"Input string too long, limit %d\n",8192);
      exit(1);
     }
     goto contin;
     }
    }
   if ((pvs_yystate = pvs_yystate->pvs_yyother) && (pvs_yyt= pvs_yystate->pvs_yystoff) != pvs_yycrank){
    goto tryagain;
    }
   else
    {str_unput(*--pvs_yylastch);break;}
  contin:
   ;
   }
  while (lsp-- > pvs_yylstate){
   *pvs_yylastch-- = 0;
   if (*lsp != 0 && (pvs_yyfnd= (*lsp)->pvs_yystops) && *pvs_yyfnd > 0){
    pvs_yyolsp = lsp;
    if(pvs_yyextra[*pvs_yyfnd]){
     while(pvs_yyback((*lsp)->pvs_yystops,-*pvs_yyfnd) != 1 && lsp > pvs_yylstate){
      lsp--;
      str_unput(*pvs_yylastch--);
      }
     }
    pvs_yyprevious = *pvs_yylastch;
    pvs_yylsp = lsp;
    pvs_yyleng = pvs_yylastch-pvs_yytext+1;
    pvs_yytext[pvs_yyleng] = 0;
    return(*pvs_yyfnd++);
    }
   str_unput(*pvs_yylastch);
   }
  if (pvs_yytext[0] == 0 )
   {
   pvs_yysptr=pvs_yysbuf;
   return(0);
   }
  pvs_yyprevious = pvs_yytext[0] = str_input();
  if (pvs_yyprevious>0)
   str_output(pvs_yyprevious);
  pvs_yylastch=pvs_yytext;
  }
 }

variable_types: struct pvs_yysvf { struct pvs_yywork { unsigned char verify; } *pvs_yystoff; struct pvs_yysvf *pvs_yyother; int *pvs_yystops; } **

user_defined_types: struct pvs_yysvf { struct pvs_yywork *pvs_yystoff; struct pvs_yysvf *pvs_yyother; int *pvs_yystops; }


decompiled_code:
__int64 pvs_yyparse()
{
void *v0; // rdi
unsigned int v1; // edx
__int64 v2; // rcx
unsigned int v3; // er15
char *v4; // r12
__int16 *v5; // rbx
__int16 *v6; // r13
__int64 v7; // rsi
int v8; // eax
int v9; // eax
char *v10; // rsi
__int64 v12; // rax
signed int v13; // edx
unsigned __int8 v14; // al
__int64 v15; // r9
int v16; // ecx
__int64 v17; // r10
__int64 v18; // rdx
__int64 v19; // rdi
__int64 v20; // rdi
unsigned int v21; // eax
int v22; // ecx
__int64 v23; // rax
signed int v24; // edx
unsigned int v25; // eax
__int16 *v26; // rsi
__int64 v27; // r12
size_t v28; // r13
void *v29; // rsp
char *v30; // rax
__int16 *v31; // r8
__int64 v32; // [rsp+0h] [rbp-520h] BYREF
__int64 v33; // [rsp+8h] [rbp-518h]
__int64 v34; // [rsp+10h] [rbp-510h]
__int16 *v35; // [rsp+18h] [rbp-508h]
int v36; // [rsp+24h] [rbp-4FCh]
void *v37; // [rsp+28h] [rbp-4F8h]
char v38[2]; // [rsp+3Eh] [rbp-4E2h] BYREF
__int16 src[200]; // [rsp+40h] [rbp-4E0h] BYREF
char v40[848]; // [rsp+1D0h] [rbp-350h] BYREF

v0 = 0LL;
v1 = 0;
v2 = 0LL;
v3 = 200;
v4 = v40;
v5 = src;
v6 = src;
src[0] = 0;
v36 = 0;
pvs_yynerrs = 0;
v37 = v40;
pvs_yychar = -2;
while ( 1 )
{
v7 = v1;
if ( v1 == -10 )
break;
v8 = pvs_yychar;
if ( pvs_yychar == -2 )
{
LODWORD(v33) = v2;
LODWORD(v34) = v1;
LODWORD(v35) = v1;
v8 = pvs_yylex(v0, v1);
v2 = (int)v33;
v1 = v34;
v7 = (unsigned int)v35;
pvs_yychar = v8;
}
if ( v8 <= 0 )
{
pvs_yychar = 0;
v9 = 0;
}
else if ( v8 <= 266 )
{
v9 = pvs_yytranslate[v8];
v7 = v1 + v9;
}
else
{
v7 = v1 + 2;
v9 = 2;
}
if ( (unsigned int)v7 > 0x2F )
break;
v7 = (int)v7;
if ( pvs_yycheck[(int)v7] != v9 )
break;
v2 = pvs_yytable[(int)v7];
if ( !pvs_yytable[(int)v7] )
goto LABEL_15;
if ( (_DWORD)v2 == 7 )
return 0LL;
if ( pvs_yychar )
pvs_yychar = -2;
v10 = v4 + 4;
*((_DWORD *)v4 + 1) = pvs_yylval;
v36 = (v36 == 0) + v36 - 1;
LABEL_33:
v5[1] = v2;
if ( v5 + 1 < &v6[v3 - 1] )
{
v0 = v37;
v4 = v10;
++v5;
v31 = v6;
}
else
{
v25 = v5 + 1 - v6 + 1;
if ( v3 > 0x270F )
{
pvs_yyerror("parser stack overflow");
return 2LL;
}
v3 *= 2;
v26 = v6;
v27 = v25;
LODWORD(v33) = v2;
v28 = 4LL * v25;
if ( v3 > 0x2710 )
v3 = 10000;
v34 = 2LL * v3;
v29 = alloca(16 * ((6 * (unsigned __int64)v3 + 26) >> 4));
v35 = (__int16 *)memcpy(&v32, v26, 2LL * v25);
v30 = (char *)memcpy(&v35[2 * ((2 * v3 + 3) >> 2)], v37, v28);
v31 = v35;
v0 = v30;
v2 = (int)v33;
v5 = &v35[v27 - 1];
v4 = &v30[v28 - 4];
if ( v5 >= (__int16 *)((char *)v35 + v34 - 2) )
return 1LL;
}
v37 = v0;
v6 = v31;
v1 = pvs_yypact[(int)v2];
}
v14 = pvs_yydefact[v2];
if ( v14 )
{
v15 = pvs_yydefact[v2];
v16 = pvs_yyr2[v15];
v17 = pvs_yyr2[(int)v15];
v18 = 1 - v16;
v19 = *(unsigned int *)&v4[4 * v18];
LODWORD(v35) = *(_DWORD *)&v4[4 * v18];
switch ( v14 )
{
case 2u:
v33 = (int)v15;
v20 = 3407510727LL;
LOBYTE(v34) = v16;
goto LABEL_30;
case 3u:
case 5u:
case 7u:
case 9u:
case 0xBu:
case 0xDu:
v33 = (int)v15;
LOBYTE(v34) = v16;
MakeBinOpNode(v19, v7);
v17 = (unsigned __int8)v34;
v15 = v33;
break;
case 4u:
v33 = (int)v15;
v20 = 3407510728LL;
LOBYTE(v34) = v16;
goto LABEL_30;
case 6u:
v33 = (int)v15;
v20 = 3406469154LL;
LOBYTE(v34) = v16;
goto LABEL_30;
case 8u:
v33 = (int)v15;
v20 = 3383944400LL;
LOBYTE(v34) = v16;
goto LABEL_30;
case 0xAu:
v33 = (int)v15;
v20 = 2666975502LL;
LOBYTE(v34) = v16;
goto LABEL_30;
case 0xCu:
v33 = (int)v15;
v20 = 2946556517LL;
LOBYTE(v34) = v16;
LABEL_30:
v21 = notation_with_number(v20);
make_node(63248LL, v38, 0LL, v21, 0LL);
v17 = (unsigned __int8)v34;
v15 = v33;
break;
case 0xEu:
v33 = (int)v15;
LOBYTE(v34) = v16;
MakeSubscriptNode(v19, v7);
v15 = v33;
v17 = (unsigned __int8)v34;
break;
default:
break;
}
v5 -= v17;
v22 = *v5;
v10 = &v4[-4 * v17 + 4];
*(_DWORD *)v10 = (_DWORD)v35;
v23 = pvs_yyr1[v15] - 14;
v24 = v22 + pvs_yypgoto[v23];
if ( (unsigned int)v24 <= 0x2F && v22 == pvs_yycheck[v24] )
v2 = pvs_yytable[v24];
else
v2 = pvs_yydefgoto[v23];
goto LABEL_33;
}
LABEL_15:
if ( !v36 )
{
v36 = v1;
++pvs_yynerrs;
pvs_yyerror("syntax error");
v1 = v36;
goto LABEL_23;
}
if ( v36 == 3 )
{
if ( pvs_yychar > 0 )
{
pvs_yychar = -2;
goto LABEL_23;
}
if ( !pvs_yychar )
return 1LL;
}
LABEL_23:
while ( 1 )
{
if ( v1 != -10 )
{
v13 = v1 + 1;
if ( (unsigned int)v13 <= 0x2F && pvs_yycheck[v13] == 1 )
{
v2 = pvs_yytable[v13];
if ( pvs_yytable[v13] )
break;
}
}
if ( v6 == v5 )
return 1LL;
v12 = *--v5;
v4 -= 4;
v1 = pvs_yypact[v12];
}
if ( (_DWORD)v2 != 7 )
{
v10 = v4 + 4;
v36 = 3;
*((_DWORD *)v4 + 1) = pvs_yylval;
goto LABEL_33;
}
return 0LL;
}

canonical_decompiled_code:
__int64 func13()
{
void *v0; // rdi
unsigned int v1; // edx
__int64 v2; // rcx
unsigned int v3; // er15
char *v4; // r12
__int16 *v5; // rbx
__int16 *v6; // r13
__int64 v7; // rsi
int v8; // eax
int v9; // eax
char *v10; // rsi
__int64 v12; // rax
signed int v13; // edx
unsigned __int8 v14; // al
__int64 v15; // r9
int v16; // ecx
__int64 v17; // r10
__int64 v18; // rdx
__int64 v19; // rdi
__int64 v20; // rdi
unsigned int v21; // eax
int v22; // ecx
__int64 v23; // rax
signed int v24; // edx
unsigned int v25; // eax
__int16 *v26; // rsi
__int64 v27; // r12
size_t v28; // r13
void *v29; // rsp
char *v30; // rax
__int16 *v31; // r8
__int64 v32; // [rsp+0h] [rbp-520h] BYREF
__int64 v33; // [rsp+8h] [rbp-518h]
__int64 v34; // [rsp+10h] [rbp-510h]
__int16 *v35; // [rsp+18h] [rbp-508h]
int v36; // [rsp+24h] [rbp-4FCh]
void *v37; // [rsp+28h] [rbp-4F8h]
char v38[2]; // [rsp+3Eh] [rbp-4E2h] BYREF
__int16 src[200]; // [rsp+40h] [rbp-4E0h] BYREF
char v40[848]; // [rsp+1D0h] [rbp-350h] BYREF

v0 = 0LL;
v1 = 0;
v2 = 0LL;
v3 = 200;
v4 = v40;
v5 = src;
v6 = src;
src[0] = 0;
v36 = 0;
pvs_yynerrs = 0;
v37 = v40;
pvs_yychar = -2;
while ( 1 )
{
v7 = v1;
if ( v1 == -10 )
break;
v8 = pvs_yychar;
if ( pvs_yychar == -2 )
{
LODWORD(v33) = v2;
LODWORD(v34) = v1;
LODWORD(v35) = v1;
v8 = func12(v0, v1);
v2 = (int)v33;
v1 = v34;
v7 = (unsigned int)v35;
pvs_yychar = v8;
}
if ( v8 <= 0 )
{
pvs_yychar = 0;
v9 = 0;
}
else if ( v8 <= 266 )
{
v9 = pvs_yytranslate[v8];
v7 = v1 + v9;
}
else
{
v7 = v1 + 2;
v9 = 2;
}
if ( (unsigned int)v7 > 0x2F )
break;
v7 = (int)v7;
if ( pvs_yycheck[(int)v7] != v9 )
break;
v2 = pvs_yytable[(int)v7];
if ( !pvs_yytable[(int)v7] )
goto LABEL_15;
if ( (_DWORD)v2 == 7 )
return 0LL;
if ( pvs_yychar )
pvs_yychar = -2;
v10 = v4 + 4;
*((_DWORD *)v4 + 1) = pvs_yylval;
v36 = (v36 == 0) + v36 - 1;
LABEL_33:
v5[1] = v2;
if ( v5 + 1 < &v6[v3 - 1] )
{
v0 = v37;
v4 = v10;
++v5;
v31 = v6;
}
else
{
v25 = v5 + 1 - v6 + 1;
if ( v3 > 0x270F )
{
func9("parser stack overflow");
return 2LL;
}
v3 *= 2;
v26 = v6;
v27 = v25;
LODWORD(v33) = v2;
v28 = 4LL * v25;
if ( v3 > 0x2710 )
v3 = 10000;
v34 = 2LL * v3;
v29 = alloca(16 * ((6 * (unsigned __int64)v3 + 26) >> 4));
v35 = (__int16 *)memcpy(&v32, v26, 2LL * v25);
v30 = (char *)memcpy(&v35[2 * ((2 * v3 + 3) >> 2)], v37, v28);
v31 = v35;
v0 = v30;
v2 = (int)v33;
v5 = &v35[v27 - 1];
v4 = &v30[v28 - 4];
if ( v5 >= (__int16 *)((char *)v35 + v34 - 2) )
return 1LL;
}
v37 = v0;
v6 = v31;
v1 = pvs_yypact[(int)v2];
}
v14 = pvs_yydefact[v2];
if ( v14 )
{
v15 = pvs_yydefact[v2];
v16 = pvs_yyr2[v15];
v17 = pvs_yyr2[(int)v15];
v18 = 1 - v16;
v19 = *(unsigned int *)&v4[4 * v18];
LODWORD(v35) = *(_DWORD *)&v4[4 * v18];
switch ( v14 )
{
case 2u:
v33 = (int)v15;
v20 = 3407510727LL;
LOBYTE(v34) = v16;
goto LABEL_30;
case 3u:
case 5u:
case 7u:
case 9u:
case 0xBu:
case 0xDu:
v33 = (int)v15;
LOBYTE(v34) = v16;
func7(v19, v7);
v17 = (unsigned __int8)v34;
v15 = v33;
break;
case 4u:
v33 = (int)v15;
v20 = 3407510728LL;
LOBYTE(v34) = v16;
goto LABEL_30;
case 6u:
v33 = (int)v15;
v20 = 3406469154LL;
LOBYTE(v34) = v16;
goto LABEL_30;
case 8u:
v33 = (int)v15;
v20 = 3383944400LL;
LOBYTE(v34) = v16;
goto LABEL_30;
case 0xAu:
v33 = (int)v15;
v20 = 2666975502LL;
LOBYTE(v34) = v16;
goto LABEL_30;
case 0xCu:
v33 = (int)v15;
v20 = 2946556517LL;
LOBYTE(v34) = v16;
LABEL_30:
v21 = notation_with_number(v20);
make_node(63248LL, v38, 0LL, v21, 0LL);
v17 = (unsigned __int8)v34;
v15 = v33;
break;
case 0xEu:
v33 = (int)v15;
LOBYTE(v34) = v16;
func8(v19, v7);
v15 = v33;
v17 = (unsigned __int8)v34;
break;
default:
break;
}
v5 -= v17;
v22 = *v5;
v10 = &v4[-4 * v17 + 4];
*(_DWORD *)v10 = (_DWORD)v35;
v23 = pvs_yyr1[v15] - 14;
v24 = v22 + pvs_yypgoto[v23];
if ( (unsigned int)v24 <= 0x2F && v22 == pvs_yycheck[v24] )
v2 = pvs_yytable[v24];
else
v2 = pvs_yydefgoto[v23];
goto LABEL_33;
}
LABEL_15:
if ( !v36 )
{
v36 = v1;
++pvs_yynerrs;
func9("syntax error");
v1 = v36;
goto LABEL_23;
}
if ( v36 == 3 )
{
if ( pvs_yychar > 0 )
{
pvs_yychar = -2;
goto LABEL_23;
}
if ( !pvs_yychar )
return 1LL;
}
LABEL_23:
while ( 1 )
{
if ( v1 != -10 )
{
v13 = v1 + 1;
if ( (unsigned int)v13 <= 0x2F && pvs_yycheck[v13] == 1 )
{
v2 = pvs_yytable[v13];
if ( pvs_yytable[v13] )
break;
}
}
if ( v6 == v5 )
return 1LL;
v12 = *--v5;
v4 -= 4;
v1 = pvs_yypact[v12];
}
if ( (_DWORD)v2 != 7 )
{
v10 = v4 + 4;
v36 = 3;
*((_DWORD *)v4 + 1) = pvs_yylval;
goto LABEL_33;
}
return 0LL;
}

original_code:
int
pvs_yyparse (void)
{
  register int pvs_yystate;
  register int pvs_yyn;
  int pvs_yyresult;
  int pvs_yyerrstatus;
  int pvs_yytoken = 0;
  short pvs_yyssa[200];
  short *pvs_yyss = pvs_yyssa;
  register short *pvs_yyssp;
  YYSTYPE pvs_yyvsa[200];
  YYSTYPE *pvs_yyvs = pvs_yyvsa;
  register YYSTYPE *pvs_yyvsp;
  unsigned int pvs_yystacksize = 200;
  YYSTYPE pvs_yyval;
  int pvs_yylen;
  ;
  pvs_yystate = 0;
  pvs_yyerrstatus = 0;
  pvs_yynerrs = 0;
  pvs_yychar = (-2);
  pvs_yyssp = pvs_yyss;
  pvs_yyvsp = pvs_yyvs;
  goto pvs_yysetstate;
 pvs_yynewstate:
  pvs_yyssp++;
 pvs_yysetstate:
  *pvs_yyssp = pvs_yystate;
  if (pvs_yyss + pvs_yystacksize - 1 <= pvs_yyssp)
    {
      unsigned int pvs_yysize = pvs_yyssp - pvs_yyss + 1;
      if (10000 <= pvs_yystacksize)
 goto pvs_yyoverflowlab;
      pvs_yystacksize *= 2;
      if (10000 < pvs_yystacksize)
 pvs_yystacksize = 10000;
      {
 short *pvs_yyss1 = pvs_yyss;
 union pvs_yyalloc *pvs_yyptr =
   (union pvs_yyalloc *) __builtin_alloca (((pvs_yystacksize) * (sizeof (short) + sizeof (YYSTYPE)) + (sizeof (union pvs_yyalloc) - 1)));
 if (! pvs_yyptr)
   goto pvs_yyoverflowlab;
 do { unsigned int pvs_yynewbytes; __builtin_memcpy (&pvs_yyptr->pvs_yyss, pvs_yyss, (pvs_yysize) * sizeof (*(pvs_yyss))); pvs_yyss = &pvs_yyptr->pvs_yyss; pvs_yynewbytes = pvs_yystacksize * sizeof (*pvs_yyss) + (sizeof (union pvs_yyalloc) - 1); pvs_yyptr += pvs_yynewbytes / sizeof (*pvs_yyptr); } while (0);
 do { unsigned int pvs_yynewbytes; __builtin_memcpy (&pvs_yyptr->pvs_yyvs, pvs_yyvs, (pvs_yysize) * sizeof (*(pvs_yyvs))); pvs_yyvs = &pvs_yyptr->pvs_yyvs; pvs_yynewbytes = pvs_yystacksize * sizeof (*pvs_yyvs) + (sizeof (union pvs_yyalloc) - 1); pvs_yyptr += pvs_yynewbytes / sizeof (*pvs_yyptr); } while (0);
 if (pvs_yyss1 != pvs_yyssa)
   do { ; } while (0);
      }
      pvs_yyssp = pvs_yyss + pvs_yysize - 1;
      pvs_yyvsp = pvs_yyvs + pvs_yysize - 1;
      ;
      if (pvs_yyss + pvs_yystacksize - 1 <= pvs_yyssp)
 goto pvs_yyabortlab;
    }
  ;
  goto pvs_yybackup;
pvs_yybackup:
  pvs_yyn = pvs_yypact[pvs_yystate];
  if (pvs_yyn == -10)
    goto pvs_yydefault;
  if (pvs_yychar == (-2))
    {
      ;
      pvs_yychar = pvs_yylex ();
    }
  if (pvs_yychar <= 0)
    {
      pvs_yychar = pvs_yytoken = 0;
      ;
    }
  else
    {
      pvs_yytoken = ((unsigned int) (pvs_yychar) <= 266 ? pvs_yytranslate[pvs_yychar] : 2);
      ;
    }
  pvs_yyn += pvs_yytoken;
  if (pvs_yyn < 0 || 47 < pvs_yyn || pvs_yycheck[pvs_yyn] != pvs_yytoken)
    goto pvs_yydefault;
  pvs_yyn = pvs_yytable[pvs_yyn];
  if (pvs_yyn <= 0)
    {
      if (pvs_yyn == 0 || pvs_yyn == -1)
 goto pvs_yyerrlab;
      pvs_yyn = -pvs_yyn;
      goto pvs_yyreduce;
    }
  if (pvs_yyn == 7)
    goto pvs_yyacceptlab;
  ;
  if (pvs_yychar != 0)
    pvs_yychar = (-2);
  *++pvs_yyvsp = pvs_yylval;
  if (pvs_yyerrstatus)
    pvs_yyerrstatus--;
  pvs_yystate = pvs_yyn;
  goto pvs_yynewstate;
pvs_yydefault:
  pvs_yyn = pvs_yydefact[pvs_yystate];
  if (pvs_yyn == 0)
    goto pvs_yyerrlab;
  goto pvs_yyreduce;
pvs_yyreduce:
  pvs_yylen = pvs_yyr2[pvs_yyn];
  pvs_yyval = pvs_yyvsp[1-pvs_yylen];
  ;
  switch (pvs_yyn)
    {
        case 2:
    { Uchar buffer[1];
                  make_node(0xF710,buffer,0,notation_with_number(plus_uid),0);
               }
    break;
  case 3:
    { MakeBinOpNode(); }
    break;
  case 4:
    { Uchar buffer[1];
                  make_node(0xF710,buffer,0,notation_with_number(times_uid),0);
               }
    break;
  case 5:
    { MakeBinOpNode(); }
    break;
  case 6:
    { Uchar buffer[1];
                 make_node(0xF710,buffer,0,notation_with_number(compose_uid),0);
               }
    break;
  case 7:
    { MakeBinOpNode(); }
    break;
  case 8:
    { Uchar buffer[1];
                  make_node(0xF710,buffer,0,notation_with_number(equal_uid),0);
               }
    break;
  case 9:
    { MakeBinOpNode(); }
    break;
  case 10:
    { Uchar buffer[1];
                  make_node(0xF710,buffer,0,notation_with_number(and_uid),0);
               }
    break;
  case 11:
    { MakeBinOpNode(); }
    break;
  case 12:
    { Uchar buffer[1];
                  make_node(0xF710,buffer,0,notation_with_number(apply_uid),0);
               }
    break;
  case 13:
    { MakeBinOpNode(); }
    break;
  case 14:
    { MakeSubscriptNode(); }
    break;
  case 15:
    { }
    break;
  case 16:
    { ; }
    break;
  case 17:
    { ; }
    break;
    }
  pvs_yyvsp -= pvs_yylen;
  pvs_yyssp -= pvs_yylen;
  ;
  *++pvs_yyvsp = pvs_yyval;
  pvs_yyn = pvs_yyr1[pvs_yyn];
  pvs_yystate = pvs_yypgoto[pvs_yyn - 14] + *pvs_yyssp;
  if (0 <= pvs_yystate && pvs_yystate <= 47 && pvs_yycheck[pvs_yystate] == *pvs_yyssp)
    pvs_yystate = pvs_yytable[pvs_yystate];
  else
    pvs_yystate = pvs_yydefgoto[pvs_yyn - 14];
  goto pvs_yynewstate;
pvs_yyerrlab:
  if (!pvs_yyerrstatus)
    {
      ++pvs_yynerrs;
 pvs_yyerror ("syntax error");
    }
  if (pvs_yyerrstatus == 3)
    {
      if (pvs_yychar <= 0)
        {
   if (pvs_yychar == 0)
      for (;;)
        {
   (pvs_yyvsp--, pvs_yyssp--);
   if (pvs_yyssp == pvs_yyss)
     goto pvs_yyabortlab;
   ;
   pvs_yydestruct (pvs_yystos[*pvs_yyssp], pvs_yyvsp);
        }
        }
      else
 {
   ;
   pvs_yydestruct (pvs_yytoken, &pvs_yylval);
   pvs_yychar = (-2);
 }
    }
  goto pvs_yyerrlab1;
pvs_yyerrorlab:
  if (0)
     goto pvs_yyerrorlab;
  pvs_yyvsp -= pvs_yylen;
  pvs_yyssp -= pvs_yylen;
  pvs_yystate = *pvs_yyssp;
  goto pvs_yyerrlab1;
pvs_yyerrlab1:
  pvs_yyerrstatus = 3;
  for (;;)
    {
      pvs_yyn = pvs_yypact[pvs_yystate];
      if (pvs_yyn != -10)
 {
   pvs_yyn += 1;
   if (0 <= pvs_yyn && pvs_yyn <= 47 && pvs_yycheck[pvs_yyn] == 1)
     {
       pvs_yyn = pvs_yytable[pvs_yyn];
       if (0 < pvs_yyn)
  break;
     }
 }
      if (pvs_yyssp == pvs_yyss)
 goto pvs_yyabortlab;
      ;
      pvs_yydestruct (pvs_yystos[pvs_yystate], pvs_yyvsp);
      (pvs_yyvsp--, pvs_yyssp--);
      pvs_yystate = *pvs_yyssp;
      ;
    }
  if (pvs_yyn == 7)
    goto pvs_yyacceptlab;
  ;
  *++pvs_yyvsp = pvs_yylval;
  pvs_yystate = pvs_yyn;
  goto pvs_yynewstate;
pvs_yyacceptlab:
  pvs_yyresult = 0;
  goto pvs_yyreturn;
pvs_yyabortlab:
  pvs_yyresult = 1;
  goto pvs_yyreturn;
pvs_yyoverflowlab:
  pvs_yyerror ("parser stack overflow");
  pvs_yyresult = 2;
pvs_yyreturn:
  if (pvs_yyss != pvs_yyssa)
    do { ; } while (0);
  return pvs_yyresult;
}

canonical_original_code:
int pvs_yyparse()
{
  register int pvs_yystate;
  register int pvs_yyn;
  int pvs_yyresult;
  int pvs_yyerrstatus;
  int pvs_yytoken = 0;
  short pvs_yyssa[200];
  short *pvs_yyss = pvs_yyssa;
  register short *pvs_yyssp;
  int pvs_yyvsa[200];
  int *pvs_yyvs = pvs_yyvsa;
  register int *pvs_yyvsp;
  unsigned int pvs_yystacksize = 200;
  int pvs_yyval;
  int pvs_yylen;
  ;
  pvs_yystate = 0;
  pvs_yyerrstatus = 0;
  pvs_yynerrs = 0;
  pvs_yychar = (-2);
  pvs_yyssp = pvs_yyss;
  pvs_yyvsp = pvs_yyvs;
  goto pvs_yysetstate;
 pvs_yynewstate:
  pvs_yyssp++;
 pvs_yysetstate:
  *pvs_yyssp = pvs_yystate;
  if (pvs_yyss + pvs_yystacksize - 1 <= pvs_yyssp)
    {
      unsigned int pvs_yysize = pvs_yyssp - pvs_yyss + 1;
      if (10000 <= pvs_yystacksize)
 goto pvs_yyoverflowlab;
      pvs_yystacksize *= 2;
      if (10000 < pvs_yystacksize)
 pvs_yystacksize = 10000;
      {
 short *pvs_yyss1 = pvs_yyss;
 union pvs_yyalloc *pvs_yyptr = (union pvs_yyalloc *) __builtin_alloca (((pvs_yystacksize) * (sizeof (short) + sizeof (YYSTYPE)) + (sizeof (union pvs_yyalloc) - 1)));
 if (! pvs_yyptr)
   goto pvs_yyoverflowlab;
 do { unsigned int pvs_yynewbytes; __builtin_memcpy (&pvs_yyptr->pvs_yyss, pvs_yyss, (pvs_yysize) * sizeof (*(pvs_yyss))); pvs_yyss = &pvs_yyptr->pvs_yyss; pvs_yynewbytes = pvs_yystacksize * sizeof (*pvs_yyss) + (sizeof (union pvs_yyalloc) - 1); pvs_yyptr += pvs_yynewbytes / sizeof (*pvs_yyptr); } while (0);
 do { unsigned int pvs_yynewbytes; __builtin_memcpy (&pvs_yyptr->pvs_yyvs, pvs_yyvs, (pvs_yysize) * sizeof (*(pvs_yyvs))); pvs_yyvs = &pvs_yyptr->pvs_yyvs; pvs_yynewbytes = pvs_yystacksize * sizeof (*pvs_yyvs) + (sizeof (union pvs_yyalloc) - 1); pvs_yyptr += pvs_yynewbytes / sizeof (*pvs_yyptr); } while (0);
 if (pvs_yyss1 != pvs_yyssa)
   do { ; } while (0);
      }
      pvs_yyssp = pvs_yyss + pvs_yysize - 1;
      pvs_yyvsp = pvs_yyvs + pvs_yysize - 1;
      ;
      if (pvs_yyss + pvs_yystacksize - 1 <= pvs_yyssp)
 goto pvs_yyabortlab;
    }
  ;
  goto pvs_yybackup;
pvs_yybackup:
  pvs_yyn = pvs_yypact[pvs_yystate];
  if (pvs_yyn == -10)
    goto pvs_yydefault;
  if (pvs_yychar == (-2))
    {
      ;
      pvs_yychar = pvs_yylex ();
    }
  if (pvs_yychar <= 0)
    {
      pvs_yychar = pvs_yytoken = 0;
      ;
    }
  else
    {
      pvs_yytoken = ((unsigned int) (pvs_yychar) <= 266 ? pvs_yytranslate[pvs_yychar] : 2);
      ;
    }
  pvs_yyn += pvs_yytoken;
  if (pvs_yyn < 0 || 47 < pvs_yyn || pvs_yycheck[pvs_yyn] != pvs_yytoken)
    goto pvs_yydefault;
  pvs_yyn = pvs_yytable[pvs_yyn];
  if (pvs_yyn <= 0)
    {
      if (pvs_yyn == 0 || pvs_yyn == -1)
 goto pvs_yyerrlab;
      pvs_yyn = -pvs_yyn;
      goto pvs_yyreduce;
    }
  if (pvs_yyn == 7)
    goto pvs_yyacceptlab;
  ;
  if (pvs_yychar != 0)
    pvs_yychar = (-2);
  *++pvs_yyvsp = pvs_yylval;
  if (pvs_yyerrstatus)
    pvs_yyerrstatus--;
  pvs_yystate = pvs_yyn;
  goto pvs_yynewstate;
pvs_yydefault:
  pvs_yyn = pvs_yydefact[pvs_yystate];
  if (pvs_yyn == 0)
    goto pvs_yyerrlab;
  goto pvs_yyreduce;
pvs_yyreduce:
  pvs_yylen = pvs_yyr2[pvs_yyn];
  pvs_yyval = pvs_yyvsp[1-pvs_yylen];
  ;
  switch (pvs_yyn)
    {
        case 2:
    { unsigned short buffer[1];
                  make_node(0xF710,buffer,0,notation_with_number(plus_uid),0);
               }
    break;
  case 3:
    { MakeBinOpNode(); }
    break;
  case 4:
    { unsigned short buffer[1];
                  make_node(0xF710,buffer,0,notation_with_number(times_uid),0);
               }
    break;
  case 5:
    { MakeBinOpNode(); }
    break;
  case 6:
    { unsigned short buffer[1];
                 make_node(0xF710,buffer,0,notation_with_number(compose_uid),0);
               }
    break;
  case 7:
    { MakeBinOpNode(); }
    break;
  case 8:
    { unsigned short buffer[1];
                  make_node(0xF710,buffer,0,notation_with_number(equal_uid),0);
               }
    break;
  case 9:
    { MakeBinOpNode(); }
    break;
  case 10:
    { unsigned short buffer[1];
                  make_node(0xF710,buffer,0,notation_with_number(and_uid),0);
               }
    break;
  case 11:
    { MakeBinOpNode(); }
    break;
  case 12:
    { unsigned short buffer[1];
                  make_node(0xF710,buffer,0,notation_with_number(apply_uid),0);
               }
    break;
  case 13:
    { MakeBinOpNode(); }
    break;
  case 14:
    { MakeSubscriptNode(); }
    break;
  case 15:
    { }
    break;
  case 16:
    { ; }
    break;
  case 17:
    { ; }
    break;
    }
  pvs_yyvsp -= pvs_yylen;
  pvs_yyssp -= pvs_yylen;
  ;
  *++pvs_yyvsp = pvs_yyval;
  pvs_yyn = pvs_yyr1[pvs_yyn];
  pvs_yystate = pvs_yypgoto[pvs_yyn - 14] + *pvs_yyssp;
  if (0 <= pvs_yystate && pvs_yystate <= 47 && pvs_yycheck[pvs_yystate] == *pvs_yyssp)
    pvs_yystate = pvs_yytable[pvs_yystate];
  else
    pvs_yystate = pvs_yydefgoto[pvs_yyn - 14];
  goto pvs_yynewstate;
pvs_yyerrlab:
  if (!pvs_yyerrstatus)
    {
      ++pvs_yynerrs;
 pvs_yyerror ("syntax error");
    }
  if (pvs_yyerrstatus == 3)
    {
      if (pvs_yychar <= 0)
        {
   if (pvs_yychar == 0)
      for (;;)
        {
   (pvs_yyvsp--, pvs_yyssp--);
   if (pvs_yyssp == pvs_yyss)
     goto pvs_yyabortlab;
   ;
   pvs_yydestruct (pvs_yystos[*pvs_yyssp], pvs_yyvsp);
        }
        }
      else
 {
   ;
   pvs_yydestruct (pvs_yytoken, &pvs_yylval);
   pvs_yychar = (-2);
 }
    }
  goto pvs_yyerrlab1;
pvs_yyerrorlab:
  if (0)
     goto pvs_yyerrorlab;
  pvs_yyvsp -= pvs_yylen;
  pvs_yyssp -= pvs_yylen;
  pvs_yystate = *pvs_yyssp;
  goto pvs_yyerrlab1;
pvs_yyerrlab1:
  pvs_yyerrstatus = 3;
  for (;;)
    {
      pvs_yyn = pvs_yypact[pvs_yystate];
      if (pvs_yyn != -10)
 {
   pvs_yyn += 1;
   if (0 <= pvs_yyn && pvs_yyn <= 47 && pvs_yycheck[pvs_yyn] == 1)
     {
       pvs_yyn = pvs_yytable[pvs_yyn];
       if (0 < pvs_yyn)
  break;
     }
 }
      if (pvs_yyssp == pvs_yyss)
 goto pvs_yyabortlab;
      ;
      pvs_yydestruct (pvs_yystos[pvs_yystate], pvs_yyvsp);
      (pvs_yyvsp--, pvs_yyssp--);
      pvs_yystate = *pvs_yyssp;
      ;
    }
  if (pvs_yyn == 7)
    goto pvs_yyacceptlab;
  ;
  *++pvs_yyvsp = pvs_yylval;
  pvs_yystate = pvs_yyn;
  goto pvs_yynewstate;
pvs_yyacceptlab:
  pvs_yyresult = 0;
  goto pvs_yyreturn;
pvs_yyabortlab:
  pvs_yyresult = 1;
  goto pvs_yyreturn;
pvs_yyoverflowlab:
  pvs_yyerror ("parser stack overflow");
  pvs_yyresult = 2;
pvs_yyreturn:
  if (pvs_yyss != pvs_yyssa)
    do { ; } while (0);
  return pvs_yyresult;
}

variable_types: union pvs_yyalloc { short pvs_yyss; int pvs_yyvs; } *

variable_types:
buffer
unsigned short [1]


decompiled_code:
__int64 __fastcall pvs_parse_string(__int64 a1)
{
input_string = a1;
is_pos = 0;
unput_pos = 0;
lastchar = 32;
pvs_yyparse();
return 1LL;
}

canonical_decompiled_code:
__int64 __fastcall func14(__int64 a1)
{
input_string = a1;
is_pos = 0;
unput_pos = 0;
lastchar = 32;
func13();
return 1LL;
}

original_code:
int pvs_parse_string(char *str)
{
  input_string=str;
  is_pos=0;
  unput_pos=0;
  lastchar=' ';
  pvs_yyparse();
  return 1;
}

variable_types:
str
char *


decompiled_code:
// attributes: thunk
__int64 __fastcall pvs_yyinput(__int64 a1, __int64 a2)
{
return str_input(a1, a2);
}

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

original_code:
int pvs_yyinput(void)
{
 return(str_input());
 }

canonical_original_code:
int pvs_yyinput()
{
 return(str_input());
 }


decompiled_code:
int __fastcall pvs_yyoutput(char a1)
{
return str_output(a1);
}

canonical_decompiled_code:
int __fastcall func16(char a1)
{
return func3(a1);
}

original_code:
void pvs_yyoutput(int c)
{
 str_output(c);
 }

variable_types: c int


decompiled_code:
__int64 __fastcall pvs_yyunput(char a1)
{
return str_unput(a1);
}

canonical_decompiled_code:
__int64 __fastcall func17(char a1)
{
return func1(a1);
}

original_code:
void pvs_yyunput(int c)
{
 str_unput(c);
 }