decompiled_code:
__int64 __fastcall int_parse_expr(__int64 a1, __int64 a2)
{
void *v2; // rbx
__int64 v3; // rbp
struct sockaddr *v4; // r12
__int64 v5; // rdi
struct sockaddr *v6; // rsi
unsigned int v8; // er12
socklen_t *v9; // rdx
__int64 v10; // rax

v2 = (void *)balloc();
bits_disjunct(a1, parser_ops_rela, v2);
v3 = parse_simple_expr((__int64)v2, a2);
v4 = (struct sockaddr *)parser_ops_rela;
v5 = (int)lex_get_s();
v6 = v4;
if ( (unsigned int)bits_belong(v5, v4) )
{
v8 = lex_get_s();
sem_l = syn_line;
sem_c = syn_c;
accept(v8, v6, v9);
v10 = parse_simple_expr((__int64)v2, 0LL);
v3 = mix_types(v3, v10, v8);
}
free(v2);
return v3;
}

canonical_decompiled_code:
__int64 __fastcall func5(__int64 a1, __int64 a2)
{
void *v2; // rbx
__int64 v3; // rbp
struct sockaddr *v4; // r12
__int64 v5; // rdi
struct sockaddr *v6; // rsi
unsigned int v8; // er12
socklen_t *v9; // rdx
__int64 v10; // rax

v2 = (void *)balloc();
bits_disjunct(a1, parser_ops_rela, v2);
v3 = func4((__int64)v2, a2);
v4 = (struct sockaddr *)parser_ops_rela;
v5 = (int)lex_get_s();
v6 = v4;
if ( (unsigned int)bits_belong(v5, v4) )
{
v8 = lex_get_s();
sem_l = syn_line;
sem_c = syn_c;
accept(v8, v6, v9);
v10 = func4((__int64)v2, 0LL);
v3 = mix_types(v3, v10, v8);
}
free(v2);
return v3;
}

original_code:
void *int_parse_expr (unsigned long *folls, unsigned long *ex)
{
    type_table_elem *tp1, *tp2;
    unsigned long *tmp = balloc();
    bits_disjunct(folls, parser_ops_rela, tmp);
    tp1 = parse_simple_expr(tmp, ex);
    if (bits_belong(lex_get_s(), parser_ops_rela))
    {
        int c = lex_get_s();
        sem_l = syn_line;
        sem_c = syn_c;
        accept(c);
        tp2 = parse_simple_expr(tmp, 0);
        tp1 = mix_types(tp1, tp2, c);
    }
    free(tmp);
    return tp1;
}

canonical_original_code:
void *int_parse_expr(unsigned long *folls, unsigned long *ex)
{
    struct _type_table_elem *tp1; struct _type_table_elem *tp2;
    unsigned long *tmp = balloc();
    bits_disjunct(folls, parser_ops_rela, tmp);
    tp1 = parse_simple_expr(tmp, ex);
    if (bits_belong(lex_get_s(), parser_ops_rela))
    {
        int c = lex_get_s();
        sem_l = syn_line;
        sem_c = syn_c;
        accept(c);
        tp2 = parse_simple_expr(tmp, 0);
        tp1 = mix_types(tp1, tp2, c);
    }
    free(tmp);
    return tp1;
}


decompiled_code:
__int64 __fastcall parse_expr(__int64 a1, __int64 a2)
{
return parser_exec(parser_start_expr, a1, a2, int_parse_expr, parser_name_expr);
}

canonical_decompiled_code:
__int64 __fastcall func6(__int64 a1, __int64 a2)
{
return parser_exec(parser_start_expr, a1, a2, int_parse_expr, parser_name_expr);
}

original_code: void *parse_expr (unsigned long *folls, unsigned long *ex) { return parser_exec(parser_start_expr, folls, ex, int_parse_expr, parser_name_expr); }

canonical_original_code: void *parse_expr(unsigned long *folls, unsigned long *ex) { return parser_exec(parser_start_expr, folls, ex, int_parse_expr, parser_name_expr); }

variable_types:
folls
unsigned long *

variable_types:
ex
unsigned long *

return_type: void *


decompiled_code:
__int64 __fastcall int_parse_factor(__int64 a1, struct sockaddr *a2)
{
int v2; // eax
socklen_t *v3; // rdx
__int64 v4; // rbx
void *v5; // rbp
socklen_t *v6; // rdx
unsigned int v8; // ebp
unsigned int v9; // er12
char *v10; // rax
char *v11; // rax

v2 = lex_get_s();
if ( v2 > 1004 )
goto LABEL_18;
if ( v2 > 999 )
{
switch ( v2 )
{
case 1000:
v4 = parse_varuse(a1, 0LL);
break;
case 1001:
v4 = inttype;
accept(1001, a2, v3);
break;
case 1002:
v4 = realtype;
accept(1002, a2, v3);
break;
case 1003:
v4 = stringtype;
accept(1003, a2, v3);
break;
case 1004:
v4 = chartype;
accept(1004, a2, v3);
break;
default:
goto LABEL_18;
}
return v4;
}
if ( v2 != 504 )
{
if ( v2 == 508 )
{
v4 = ptrtype;
accept(508, a2, v3);
return v4;
}
if ( v2 == 40 )
{
accept(40, a2, v3);
v5 = (void *)balloc();
bits_disjunct(a1, parser_factor_aux, v5);
v4 = parse_expr((__int64)v5, 0LL);
free(v5);
accept(41, 0LL, v6);
return v4;
}
LABEL_18:
v11 = dcgettext(0LL, ": error in expression", 5);
parser_unexpected(v11);
return 0LL;
}
accept(504, a2, v3);
v8 = syn_line;
v9 = syn_c;
if ( booltype != parse_factor(a1, 0LL) )
{
v10 = dcgettext(0LL, "boolean expression expected", 5);
err_include(3LL, v10, 0LL, v8, v9);
}
return booltype;
}

canonical_decompiled_code:
__int64 __fastcall func7(__int64 a1, struct sockaddr *a2)
{
int v2; // eax
socklen_t *v3; // rdx
__int64 v4; // rbx
void *v5; // rbp
socklen_t *v6; // rdx
unsigned int v8; // ebp
unsigned int v9; // er12
char *v10; // rax
char *v11; // rax

v2 = lex_get_s();
if ( v2 > 1004 )
goto LABEL_18;
if ( v2 > 999 )
{
switch ( v2 )
{
case 1000:
v4 = parse_varuse(a1, 0LL);
break;
case 1001:
v4 = inttype;
accept(1001, a2, v3);
break;
case 1002:
v4 = realtype;
accept(1002, a2, v3);
break;
case 1003:
v4 = stringtype;
accept(1003, a2, v3);
break;
case 1004:
v4 = chartype;
accept(1004, a2, v3);
break;
default:
goto LABEL_18;
}
return v4;
}
if ( v2 != 504 )
{
if ( v2 == 508 )
{
v4 = ptrtype;
accept(508, a2, v3);
return v4;
}
if ( v2 == 40 )
{
accept(40, a2, v3);
v5 = (void *)balloc();
bits_disjunct(a1, parser_factor_aux, v5);
v4 = func6((__int64)v5, 0LL);
free(v5);
accept(41, 0LL, v6);
return v4;
}
LABEL_18:
v11 = dcgettext(0LL, ": error in expression", 5);
parser_unexpected(v11);
return 0LL;
}
accept(504, a2, v3);
v8 = syn_line;
v9 = syn_c;
if ( booltype != func0(a1, 0LL) )
{
v10 = dcgettext(0LL, "boolean expression expected", 5);
err_include(3LL, v10, 0LL, v8, v9);
}
return booltype;
}

original_code:
void *int_parse_factor (unsigned long *folls, unsigned long *ex)
{
    type_table_elem *res = 0;
    int c = lex_get_s();
    switch (c)
    {
        case L_IDENT:
            res = parse_varuse(folls, 0);
            break;
        case L_NUMERIC:
            res = inttype;
            accept(c);
            break;
        case L_FLOAT:
            res = realtype;
            accept(c);
            break;
        case L_SCONST:
            res = stringtype;
            accept(c);
            break;
        case L_CHARCONST:
            res = chartype;
            accept(c);
            break;
        case L_NIL:
            res = ptrtype;
            accept(c);
            break;
        case L_LPANTH:
            accept(L_LPANTH);
            unsigned long *tmp = balloc();
            bits_disjunct(folls, parser_factor_aux, tmp);
            res = parse_expr(tmp, 0);
            free(tmp);
            accept(L_RPANTH);
            break;
        case L_NOT:
            accept(L_NOT);
            int sl = syn_line;
            int sc = syn_c;
            type_table_elem *ttp = parse_factor(folls, 0);
            if (ttp != booltype)
                err_include(ERROR, gettext("boolean expression expected"), 0, sl, sc);
            res = booltype;
            break;
        default:
            parser_unexpected(gettext(": error in expression"));
    }
    return res;
}

canonical_original_code:
void *int_parse_factor(unsigned long *folls, unsigned long *ex)
{
    struct _type_table_elem *res = 0;
    int c = lex_get_s();
    switch (c)
    {
        case L_IDENT:
            res = parse_varuse(folls, 0);
            break;
        case L_NUMERIC:
            res = inttype;
            accept(c);
            break;
        case L_FLOAT:
            res = realtype;
            accept(c);
            break;
        case L_SCONST:
            res = stringtype;
            accept(c);
            break;
        case L_CHARCONST:
            res = chartype;
            accept(c);
            break;
        case L_NIL:
            res = ptrtype;
            accept(c);
            break;
        case L_LPANTH:
            accept(L_LPANTH);
            unsigned long *tmp = balloc();
            bits_disjunct(folls, parser_factor_aux, tmp);
            res = parse_expr(tmp, 0);
            free(tmp);
            accept(L_RPANTH);
            break;
        case L_NOT:
            accept(L_NOT);
            int sl = syn_line;
            int sc = syn_c;
            struct _type_table_elem *ttp = parse_factor(folls, 0);
            if (ttp != booltype)
                err_include(ERROR, gettext("boolean expression expected"), 0, sl, sc);
            res = booltype;
            break;
        default:
            parser_unexpected(gettext(": error in expression"));
    }
    return res;
}

variable_types: struct _type_table_elem { enum USE_TYPE { UT_SCALAR=5000, UT_LIMITED=5001, UT_ENUM=5002, UT_ARRAY=5003, UT_RECORD=5004, UT_REFERENCE=5005, UT_SET=5006, UT_FILE=5007 } utype; struct _type_table_elem *base; union { struct _list { void *value; struct _list *next; } *constants; struct _list *indexes; struct { unsigned long min; }; }; } *

variable_types: c int

variable_types:
tmp
unsigned long *

variable_types: sl int

variable_types: sc int

user_defined_types: struct _type_table_elem { enum USE_TYPE utype; struct _type_table_elem *base; union { struct _list *constants; struct _list *indexes; struct { unsigned long min; }; }; }


decompiled_code:
__int64 init_parser_expr()
{
parser_name_expr = "expression";
if ( !parser_start_expr )
parser_start_expr = (void *)bits_from_array(&int_start_expr);
if ( !parser_folls_expr )
parser_folls_expr = (void *)bits_from_array(&int_folls_expr);
if ( !parser_ops_rela )
parser_ops_rela = (void *)bits_from_array(&int_ops_rela);
if ( !parser_ops_add )
parser_ops_add = (void *)bits_from_array(&int_ops_add);
if ( !parser_ops_mult )
parser_ops_mult = (void *)bits_from_array(&int_ops_mult);
if ( !parser_factor_aux )
parser_factor_aux = (void *)bits_from_array(&int_factor_aux);
if ( !parser_start_factor )
parser_start_factor = (void *)bits_from_array(&int_start_factor);
if ( !parser_folls_factor )
parser_folls_factor = (void *)bits_from_array(&int_folls_factor);
if ( !parser_start_term )
parser_start_term = (void *)bits_from_array(&int_start_term);
if ( !parser_folls_term )
parser_folls_term = (void *)bits_from_array(&int_folls_term);
if ( !parser_start_simple_expr )
parser_start_simple_expr = (void *)bits_from_array(&int_start_simple_expr);
if ( !parser_folls_simple_expr )
parser_folls_simple_expr = (void *)bits_from_array(&int_folls_simple_expr);
bits_disjunct(parser_start_term, parser_start_factor, parser_start_term);
bits_disjunct(parser_start_simple_expr, parser_start_term, parser_start_simple_expr);
return bits_disjunct(parser_start_expr, parser_start_simple_expr, parser_start_expr);
}

canonical_decompiled_code:
__int64 func8()
{
parser_name_expr = "expression";
if ( !parser_start_expr )
parser_start_expr = (void *)bits_from_array(&int_start_expr);
if ( !parser_folls_expr )
parser_folls_expr = (void *)bits_from_array(&int_folls_expr);
if ( !parser_ops_rela )
parser_ops_rela = (void *)bits_from_array(&int_ops_rela);
if ( !parser_ops_add )
parser_ops_add = (void *)bits_from_array(&int_ops_add);
if ( !parser_ops_mult )
parser_ops_mult = (void *)bits_from_array(&int_ops_mult);
if ( !parser_factor_aux )
parser_factor_aux = (void *)bits_from_array(&int_factor_aux);
if ( !parser_start_factor )
parser_start_factor = (void *)bits_from_array(&int_start_factor);
if ( !parser_folls_factor )
parser_folls_factor = (void *)bits_from_array(&int_folls_factor);
if ( !parser_start_term )
parser_start_term = (void *)bits_from_array(&int_start_term);
if ( !parser_folls_term )
parser_folls_term = (void *)bits_from_array(&int_folls_term);
if ( !parser_start_simple_expr )
parser_start_simple_expr = (void *)bits_from_array(&int_start_simple_expr);
if ( !parser_folls_simple_expr )
parser_folls_simple_expr = (void *)bits_from_array(&int_folls_simple_expr);
bits_disjunct(parser_start_term, parser_start_factor, parser_start_term);
bits_disjunct(parser_start_simple_expr, parser_start_term, parser_start_simple_expr);
return bits_disjunct(parser_start_expr, parser_start_simple_expr, parser_start_expr);
}

original_code:
void init_parser_expr(void)
{
    parser_name_expr = "expression";
    { { if (parser_start_expr == 0) parser_start_expr = bits_from_array(int_start_expr); }; { if (parser_folls_expr == 0) parser_folls_expr = bits_from_array(int_folls_expr); }; };
    { if (parser_ops_rela == 0) parser_ops_rela = bits_from_array(int_ops_rela); };
    { if (parser_ops_add == 0) parser_ops_add = bits_from_array(int_ops_add); };
    { if (parser_ops_mult == 0) parser_ops_mult = bits_from_array(int_ops_mult); };
    { if (parser_factor_aux == 0) parser_factor_aux = bits_from_array(int_factor_aux); };
    { { if (parser_start_factor == 0) parser_start_factor = bits_from_array(int_start_factor); }; { if (parser_folls_factor == 0) parser_folls_factor = bits_from_array(int_folls_factor); }; };
    { { if (parser_start_term == 0) parser_start_term = bits_from_array(int_start_term); }; { if (parser_folls_term == 0) parser_folls_term = bits_from_array(int_folls_term); }; };
    { { if (parser_start_simple_expr == 0) parser_start_simple_expr = bits_from_array(int_start_simple_expr); }; { if (parser_folls_simple_expr == 0) parser_folls_simple_expr = bits_from_array(int_folls_simple_expr); }; };
    { bits_disjunct(parser_start_term, parser_start_factor, parser_start_term); };
    { bits_disjunct(parser_start_simple_expr, parser_start_term, parser_start_simple_expr); };
    { bits_disjunct(parser_start_expr, parser_start_simple_expr, parser_start_expr); };
}

canonical_original_code:
void init_parser_expr()
{
    parser_name_expr = "expression";
    { { if (parser_start_expr == 0) parser_start_expr = bits_from_array(int_start_expr); }; { if (parser_folls_expr == 0) parser_folls_expr = bits_from_array(int_folls_expr); }; };
    { if (parser_ops_rela == 0) parser_ops_rela = bits_from_array(int_ops_rela); };
    { if (parser_ops_add == 0) parser_ops_add = bits_from_array(int_ops_add); };
    { if (parser_ops_mult == 0) parser_ops_mult = bits_from_array(int_ops_mult); };
    { if (parser_factor_aux == 0) parser_factor_aux = bits_from_array(int_factor_aux); };
    { { if (parser_start_factor == 0) parser_start_factor = bits_from_array(int_start_factor); }; { if (parser_folls_factor == 0) parser_folls_factor = bits_from_array(int_folls_factor); }; };
    { { if (parser_start_term == 0) parser_start_term = bits_from_array(int_start_term); }; { if (parser_folls_term == 0) parser_folls_term = bits_from_array(int_folls_term); }; };
    { { if (parser_start_simple_expr == 0) parser_start_simple_expr = bits_from_array(int_start_simple_expr); }; { if (parser_folls_simple_expr == 0) parser_folls_simple_expr = bits_from_array(int_folls_simple_expr); }; };
    { bits_disjunct(parser_start_term, parser_start_factor, parser_start_term); };
    { bits_disjunct(parser_start_simple_expr, parser_start_term, parser_start_simple_expr); };
    { bits_disjunct(parser_start_expr, parser_start_simple_expr, parser_start_expr); };
}

return_type: void


decompiled_code:
void fini_parser_expr()
{
if ( parser_start_expr )
free(parser_start_expr);
if ( parser_folls_expr )
free(parser_folls_expr);
if ( parser_start_factor )
free(parser_start_factor);
if ( parser_folls_factor )
free(parser_folls_factor);
if ( parser_start_term )
free(parser_start_term);
if ( parser_folls_term )
free(parser_folls_term);
if ( parser_start_simple_expr )
free(parser_start_simple_expr);
if ( parser_folls_simple_expr )
free(parser_folls_simple_expr);
if ( parser_ops_rela )
free(parser_ops_rela);
if ( parser_ops_add )
free(parser_ops_add);
if ( parser_ops_mult )
free(parser_ops_mult);
if ( parser_factor_aux )
free(parser_factor_aux);
}

canonical_decompiled_code:
void func9()
{
if ( parser_start_expr )
free(parser_start_expr);
if ( parser_folls_expr )
free(parser_folls_expr);
if ( parser_start_factor )
free(parser_start_factor);
if ( parser_folls_factor )
free(parser_folls_factor);
if ( parser_start_term )
free(parser_start_term);
if ( parser_folls_term )
free(parser_folls_term);
if ( parser_start_simple_expr )
free(parser_start_simple_expr);
if ( parser_folls_simple_expr )
free(parser_folls_simple_expr);
if ( parser_ops_rela )
free(parser_ops_rela);
if ( parser_ops_add )
free(parser_ops_add);
if ( parser_ops_mult )
free(parser_ops_mult);
if ( parser_factor_aux )
free(parser_factor_aux);
}

original_code:
void fini_parser_expr(void)
{
    { { if (parser_start_expr != 0) free(parser_start_expr); }; { if (parser_folls_expr != 0) free(parser_folls_expr); }; };
    { { if (parser_start_factor != 0) free(parser_start_factor); }; { if (parser_folls_factor != 0) free(parser_folls_factor); }; };
    { { if (parser_start_term != 0) free(parser_start_term); }; { if (parser_folls_term != 0) free(parser_folls_term); }; };
    { { if (parser_start_simple_expr != 0) free(parser_start_simple_expr); }; { if (parser_folls_simple_expr != 0) free(parser_folls_simple_expr); }; };
    { if (parser_ops_rela != 0) free(parser_ops_rela); };
    { if (parser_ops_add != 0) free(parser_ops_add); };
    { if (parser_ops_mult != 0) free(parser_ops_mult); };
    { if (parser_factor_aux != 0) free(parser_factor_aux); };
}

canonical_original_code:
void fini_parser_expr()
{
    { { if (parser_start_expr != 0) free(parser_start_expr); }; { if (parser_folls_expr != 0) free(parser_folls_expr); }; };
    { { if (parser_start_factor != 0) free(parser_start_factor); }; { if (parser_folls_factor != 0) free(parser_folls_factor); }; };
    { { if (parser_start_term != 0) free(parser_start_term); }; { if (parser_folls_term != 0) free(parser_folls_term); }; };
    { { if (parser_start_simple_expr != 0) free(parser_start_simple_expr); }; { if (parser_folls_simple_expr != 0) free(parser_folls_simple_expr); }; };
    { if (parser_ops_rela != 0) free(parser_ops_rela); };
    { if (parser_ops_add != 0) free(parser_ops_add); };
    { if (parser_ops_mult != 0) free(parser_ops_mult); };
    { if (parser_factor_aux != 0) free(parser_factor_aux); };
}


decompiled_code:
__int64 __fastcall int_parse_varuse(__int64 a1)
{
void *v1; // r13
char *v2; // rsi
const char *v3; // rbx
socklen_t *v4; // rdx
__int64 v5; // r12
unsigned int v6; // er12
unsigned int v7; // ebp
char *v8; // r14
char *v9; // rax
unsigned int v10; // ebp
unsigned int v11; // ebx
unsigned int v12; // ebp
unsigned int v13; // ebx
socklen_t *v14; // rdx
__int64 v15; // rbx
__int64 *v16; // rbp
char *v17; // r15
__int64 v18; // r14
__int64 v19; // rbx
char *v20; // rax
char *v21; // rax
unsigned int v22; // ebp
unsigned int v23; // ebx
socklen_t *v24; // rdx
unsigned int v25; // er14
unsigned int v26; // er15
__int64 v27; // rbx
char *v28; // r15
__int64 v29; // r14
__int64 v30; // rbx
char *v31; // rax
int v33; // [rsp+Ch] [rbp-5Ch]
__int64 v34; // [rsp+10h] [rbp-58h]
char *v35; // [rsp+18h] [rbp-50h]
__int64 v36[8]; // [rsp+28h] [rbp-40h] BYREF

v1 = (void *)balloc();
v2 = (char *)parser_varuse_aux;
bits_disjunct(a1, parser_varuse_aux, v1);
v3 = (const char *)lex_get_v();
v35 = strdup(v3);
v34 = 0LL;
if ( (unsigned int)lex_get_s() == 1000 )
{
v36[0] = 4006LL;
v2 = (char *)v3;
v34 = search_id_table(0LL, v3, v36);
if ( v34 )
{
if ( (unsigned __int64)(v36[0] - 4002) > 1 )
{
v10 = syn_c;
v11 = syn_line;
v2 = dcgettext(0LL, "not a variable:", 5);
err_include(3LL, v2, v35, v11, v10);
v34 = 0LL;
}
else
{
v34 = *(_QWORD *)(v34 + 24);
}
}
else
{
v6 = syn_c;
v7 = syn_line;
v8 = strdup(v3);
v9 = dcgettext(0LL, "undeclared identifier:", 5);
err_include(3LL, v9, v8, v7, v6);
v2 = strdup(v3);
add_to_id_table(0LL, v2, 4003LL);
}
}
accept(1000, (struct sockaddr *)v2, v4);
v5 = 0LL;
while ( (unsigned int)lex_get_s() == 91 )
{
if ( !v34 )
goto LABEL_9;
if ( *(_DWORD *)v34 != 5003 )
{
v12 = syn_c;
v13 = syn_line;
v2 = dcgettext(0LL, "not an array:", 5);
err_include(3LL, v2, v35, v13, v12);
LABEL_9:
accept(91, (struct sockaddr *)v2, v14);
v15 = parse_expr(v1, 0LL);
v34 = 0LL;
v16 = 0LL;
goto LABEL_21;
}
v16 = *(__int64 **)(v34 + 16);
accept(91, (struct sockaddr *)v2, v14);
v15 = parse_expr(v1, 0LL);
if ( v16 )
{
v5 = *v16;
v16 = (__int64 *)v16[1];
}
LABEL_21:
v2 = (char *)v15;
if ( !(unsigned int)can_assign(v5, v15) )
{
v17 = (char *)malloc(0x400uLL);
v18 = get_type_name(v5);
v19 = get_type_name(v15);
v20 = dcgettext(0LL, "'%s', expected '%s'", 5);
sprintf(v17, v20, v19, v18);
LODWORD(v19) = syn_c;
LODWORD(v18) = syn_line;
v2 = dcgettext(0LL, "illegal array index type:", 5);
err_include(3LL, v2, v17, (unsigned int)v18, (unsigned int)v19);
}
v33 = 0;
while ( (unsigned int)lex_get_s() == 44 )
{
v25 = syn_line;
v26 = syn_c;
accept(44, (struct sockaddr *)v2, v24);
v27 = parse_expr(v1, 0LL);
if ( v16 )
{
v5 = *v16;
v16 = (__int64 *)v16[1];
}
else if ( !v33 )
{
v21 = dcgettext(0LL, "too many indexes for this array type", 5);
err_include(3LL, v21, 0LL, v25, v26);
v5 = 0LL;
v33 = 1;
}
v2 = (char *)v27;
if ( !(unsigned int)can_assign(v5, v27) )
{
v28 = (char *)malloc(0x400uLL);
v29 = get_type_name(v5);
v30 = get_type_name(v27);
v31 = dcgettext(0LL, "'%s', expected '%s'", 5);
sprintf(v28, v31, v30, v29);
LODWORD(v29) = syn_c;
LODWORD(v30) = syn_line;
v2 = dcgettext(0LL, "illegal array index type:", 5);
err_include(3LL, v2, v28, (unsigned int)v30, (unsigned int)v29);
}
}
if ( v16 )
{
v22 = syn_c;
v23 = syn_line;
v2 = dcgettext(0LL, "too few indexes for this array type", 5);
err_include(3LL, v2, 0LL, v23, v22);
}
accept(93, (struct sockaddr *)v2, v24);
if ( v34 )
v34 = *(_QWORD *)(v34 + 8);
}
free(v1);
return v34;
}

canonical_decompiled_code:
__int64 __fastcall func0(__int64 a1)
{
void *v1; // r13
char *v2; // rsi
const char *v3; // rbx
socklen_t *v4; // rdx
__int64 v5; // r12
unsigned int v6; // er12
unsigned int v7; // ebp
char *v8; // r14
char *v9; // rax
unsigned int v10; // ebp
unsigned int v11; // ebx
unsigned int v12; // ebp
unsigned int v13; // ebx
socklen_t *v14; // rdx
__int64 v15; // rbx
__int64 *v16; // rbp
char *v17; // r15
__int64 v18; // r14
__int64 v19; // rbx
char *v20; // rax
char *v21; // rax
unsigned int v22; // ebp
unsigned int v23; // ebx
socklen_t *v24; // rdx
unsigned int v25; // er14
unsigned int v26; // er15
__int64 v27; // rbx
char *v28; // r15
__int64 v29; // r14
__int64 v30; // rbx
char *v31; // rax
int v33; // [rsp+Ch] [rbp-5Ch]
__int64 v34; // [rsp+10h] [rbp-58h]
char *v35; // [rsp+18h] [rbp-50h]
__int64 v36[8]; // [rsp+28h] [rbp-40h] BYREF

v1 = (void *)balloc();
v2 = (char *)parser_varuse_aux;
bits_disjunct(a1, parser_varuse_aux, v1);
v3 = (const char *)lex_get_v();
v35 = strdup(v3);
v34 = 0LL;
if ( (unsigned int)lex_get_s() == 1000 )
{
v36[0] = 4006LL;
v2 = (char *)v3;
v34 = search_id_table(0LL, v3, v36);
if ( v34 )
{
if ( (unsigned __int64)(v36[0] - 4002) > 1 )
{
v10 = syn_c;
v11 = syn_line;
v2 = dcgettext(0LL, "not a variable:", 5);
err_include(3LL, v2, v35, v11, v10);
v34 = 0LL;
}
else
{
v34 = *(_QWORD *)(v34 + 24);
}
}
else
{
v6 = syn_c;
v7 = syn_line;
v8 = strdup(v3);
v9 = dcgettext(0LL, "undeclared identifier:", 5);
err_include(3LL, v9, v8, v7, v6);
v2 = strdup(v3);
add_to_id_table(0LL, v2, 4003LL);
}
}
accept(1000, (struct sockaddr *)v2, v4);
v5 = 0LL;
while ( (unsigned int)lex_get_s() == 91 )
{
if ( !v34 )
goto LABEL_9;
if ( *(_DWORD *)v34 != 5003 )
{
v12 = syn_c;
v13 = syn_line;
v2 = dcgettext(0LL, "not an array:", 5);
err_include(3LL, v2, v35, v13, v12);
LABEL_9:
accept(91, (struct sockaddr *)v2, v14);
v15 = parse_expr(v1, 0LL);
v34 = 0LL;
v16 = 0LL;
goto LABEL_21;
}
v16 = *(__int64 **)(v34 + 16);
accept(91, (struct sockaddr *)v2, v14);
v15 = parse_expr(v1, 0LL);
if ( v16 )
{
v5 = *v16;
v16 = (__int64 *)v16[1];
}
LABEL_21:
v2 = (char *)v15;
if ( !(unsigned int)can_assign(v5, v15) )
{
v17 = (char *)malloc(0x400uLL);
v18 = get_type_name(v5);
v19 = get_type_name(v15);
v20 = dcgettext(0LL, "'%s', expected '%s'", 5);
sprintf(v17, v20, v19, v18);
LODWORD(v19) = syn_c;
LODWORD(v18) = syn_line;
v2 = dcgettext(0LL, "illegal array index type:", 5);
err_include(3LL, v2, v17, (unsigned int)v18, (unsigned int)v19);
}
v33 = 0;
while ( (unsigned int)lex_get_s() == 44 )
{
v25 = syn_line;
v26 = syn_c;
accept(44, (struct sockaddr *)v2, v24);
v27 = parse_expr(v1, 0LL);
if ( v16 )
{
v5 = *v16;
v16 = (__int64 *)v16[1];
}
else if ( !v33 )
{
v21 = dcgettext(0LL, "too many indexes for this array type", 5);
err_include(3LL, v21, 0LL, v25, v26);
v5 = 0LL;
v33 = 1;
}
v2 = (char *)v27;
if ( !(unsigned int)can_assign(v5, v27) )
{
v28 = (char *)malloc(0x400uLL);
v29 = get_type_name(v5);
v30 = get_type_name(v27);
v31 = dcgettext(0LL, "'%s', expected '%s'", 5);
sprintf(v28, v31, v30, v29);
LODWORD(v29) = syn_c;
LODWORD(v30) = syn_line;
v2 = dcgettext(0LL, "illegal array index type:", 5);
err_include(3LL, v2, v28, (unsigned int)v30, (unsigned int)v29);
}
}
if ( v16 )
{
v22 = syn_c;
v23 = syn_line;
v2 = dcgettext(0LL, "too few indexes for this array type", 5);
err_include(3LL, v2, 0LL, v23, v22);
}
accept(93, (struct sockaddr *)v2, v24);
if ( v34 )
v34 = *(_QWORD *)(v34 + 8);
}
free(v1);
return v34;
}

original_code:
void *int_parse_varuse (unsigned long *folls, unsigned long *ex)
{
    unsigned long *tmp = balloc();
    bits_disjunct(folls, parser_varuse_aux, tmp);
    id_table_elem *desc = 0;
    type_table_elem *res = 0;
    lex_val lv = lex_get_v();
    char *name = strdup(lv.string);
    if (lex_get_s() == L_IDENT)
    {
        unsigned long uc = UC_UNK;
        desc = search_id_table(0, lv.string, &uc);
        if (desc == 0)
        {
            err_include(ERROR, gettext("undeclared identifier:"), strdup(lv.string), syn_line, syn_c);
            desc = add_to_id_table(0, strdup(lv.string), UC_VAR);
        } else if ((uc != UC_VAR) && (uc != UC_CONST))
        {
            err_include(ERROR, gettext("not a variable:"), name, syn_line, syn_c);
            desc = 0;
        } else {
            res = desc->type;
        }
    }
    accept(L_IDENT);
    char *err;
    int i = 0;
    type_table_elem *et = 0, *idx = 0;
    list *indexes;
    while (lex_get_s() == L_LBRACKET)
    {
        i = 0;
        et = 0;
        indexes = 0;
        if ((res != 0) && (res->utype != UT_ARRAY))
        {
            err_include(ERROR, gettext("not an array:"), name, syn_line, syn_c);
            res = 0;
        }
        if ((res != 0) && (res->utype == UT_ARRAY))
            indexes = res->indexes;
        accept(L_LBRACKET);
        et = parse_expr(tmp, 0);
        if (indexes != 0)
        {
            idx = indexes -> value;
            indexes = indexes->next;
        }
        if (!can_assign(idx, et))
        {
            err = malloc(1024);
            sprintf(err, gettext("'%s', expected '%s'"), get_type_name(et), get_type_name(idx));
            err_include(ERROR, gettext("illegal array index type:"), err, syn_line, syn_c);
        }
        while (lex_get_s() == L_COMMA)
        {
            int sl = syn_line, sc = syn_c;
            accept(L_COMMA);
            int sl1 = syn_line, sc1 = syn_c;
            et = parse_expr(tmp, 0);
            if (indexes != 0)
            {
                idx = indexes -> value;
                indexes = indexes->next;
            } else if (i == 0) {
                err_include(ERROR, gettext("too many indexes for this array type"), 0, sl, sc);
                i = 1;
                idx = 0;
            }
            if (!can_assign(idx, et))
            {
                err = malloc(1024);
                sprintf(err, gettext("'%s', expected '%s'"), get_type_name(et), get_type_name(idx));
                err_include(ERROR, gettext("illegal array index type:"), err, syn_line, syn_c);
            }
        }
        if (indexes != 0)
            err_include (ERROR, gettext("too few indexes for this array type"), 0, syn_line, syn_c);
        accept(L_RBRACKET);
        if (res != 0)
            res = res->base;
    }
    free(tmp);
    return res;
}

canonical_original_code:
void *int_parse_varuse(unsigned long *folls, unsigned long *ex)
{
    unsigned long *tmp = balloc();
    bits_disjunct(folls, parser_varuse_aux, tmp);
    struct _id_table_elem *desc = 0;
    struct _type_table_elem *res = 0;
    union lex_val lv = lex_get_v();
    char *name = strdup(lv.string);
    if (lex_get_s() == L_IDENT)
    {
        unsigned long uc = UC_UNK;
        desc = search_id_table(0, lv.string, &uc);
        if (desc == 0)
        {
            err_include(ERROR, gettext("undeclared identifier:"), strdup(lv.string), syn_line, syn_c);
            desc = add_to_id_table(0, strdup(lv.string), UC_VAR);
        } else if ((uc != UC_VAR) && (uc != UC_CONST))
        {
            err_include(ERROR, gettext("not a variable:"), name, syn_line, syn_c);
            desc = 0;
        } else {
            res = desc->type;
        }
    }
    accept(L_IDENT);
    char *err;
    int i = 0;
    struct _type_table_elem *et = 0; struct _type_table_elem *idx = 0;
    struct _list *indexes;
    while (lex_get_s() == L_LBRACKET)
    {
        i = 0;
        et = 0;
        indexes = 0;
        if ((res != 0) && (res->utype != UT_ARRAY))
        {
            err_include(ERROR, gettext("not an array:"), name, syn_line, syn_c);
            res = 0;
        }
        if ((res != 0) && (res->utype == UT_ARRAY))
            indexes = res->indexes;
        accept(L_LBRACKET);
        et = parse_expr(tmp, 0);
        if (indexes != 0)
        {
            idx = indexes -> value;
            indexes = indexes->next;
        }
        if (!can_assign(idx, et))
        {
            err = malloc(1024);
            sprintf(err, gettext("'%s', expected '%s'"), get_type_name(et), get_type_name(idx));
            err_include(ERROR, gettext("illegal array index type:"), err, syn_line, syn_c);
        }
        while (lex_get_s() == L_COMMA)
        {
            int sl = syn_line; int sc = syn_c;
            accept(L_COMMA);
            int sl1 = syn_line; int sc1 = syn_c;
            et = parse_expr(tmp, 0);
            if (indexes != 0)
            {
                idx = indexes -> value;
                indexes = indexes->next;
            } else if (i == 0) {
                err_include(ERROR, gettext("too many indexes for this array type"), 0, sl, sc);
                i = 1;
                idx = 0;
            }
            if (!can_assign(idx, et))
            {
                err = malloc(1024);
                sprintf(err, gettext("'%s', expected '%s'"), get_type_name(et), get_type_name(idx));
                err_include(ERROR, gettext("illegal array index type:"), err, syn_line, syn_c);
            }
        }
        if (indexes != 0)
            err_include (ERROR, gettext("too few indexes for this array type"), 0, syn_line, syn_c);
        accept(L_RBRACKET);
        if (res != 0)
            res = res->base;
    }
    free(tmp);
    return res;
}

variable_types: struct _id_table_elem { unsigned long hash; char *name; enum USE_CLASS { UC_PROG=4000, UC_TYPE=4001, UC_CONST=4002, UC_VAR=4003, UC_PROC=4004, UC_FUNC=4005, UC_UNK=4006 } uclass; struct _type_table_elem { enum USE_TYPE { UT_SCALAR=5000, UT_LIMITED=5001, UT_ENUM=5002, UT_ARRAY=5003, UT_RECORD=5004, UT_REFERENCE=5005, UT_SET=5006, UT_FILE=5007 } utype; struct _type_table_elem *base; union { struct _list { void *value; struct _list *next; } *constants; struct _list *indexes; struct { unsigned long min; }; }; } *type; int value; } *

variable_types: union lex_val { long inumber; double fnumber; char *string; char character; }

variable_types:
name
char *

variable_types:
uc
unsigned long

variable_types:
err
char *

variable_types: i int

user_defined_types: struct _id_table_elem { unsigned long hash; char *name; enum USE_CLASS uclass; struct _type_table_elem *type; int value; }


decompiled_code:
__int64 __fastcall parse_varuse(__int64 a1, __int64 a2)
{
return parser_exec(parser_start_varuse, a1, a2, int_parse_varuse, "varuse");
}

canonical_decompiled_code:
__int64 __fastcall func1(__int64 a1, __int64 a2)
{
return parser_exec(parser_start_varuse, a1, a2, int_parse_varuse, "varuse");
}

original_code: void *parse_varuse (unsigned long *folls, unsigned long *ex) { return parser_exec(parser_start_varuse, folls, ex, int_parse_varuse, parser_name_varuse); }

canonical_original_code: void *parse_varuse(unsigned long *folls, unsigned long *ex) { return parser_exec(parser_start_varuse, folls, ex, int_parse_varuse, parser_name_varuse); }


decompiled_code:
void init_parser_varuse()
{
if ( !parser_start_varuse )
parser_start_varuse = (void *)bits_from_array(&int_start_varuse);
if ( !parser_folls_varuse )
parser_folls_varuse = (void *)bits_from_array(&int_folls_varuse);
if ( !parser_varuse_aux )
parser_varuse_aux = (void *)bits_from_array(&int_varuse_aux);
}

canonical_decompiled_code:
void func2()
{
if ( !parser_start_varuse )
parser_start_varuse = (void *)bits_from_array(&int_start_varuse);
if ( !parser_folls_varuse )
parser_folls_varuse = (void *)bits_from_array(&int_folls_varuse);
if ( !parser_varuse_aux )
parser_varuse_aux = (void *)bits_from_array(&int_varuse_aux);
}

original_code:
void init_parser_varuse(void)
{
    { { if (parser_start_varuse == 0) parser_start_varuse = bits_from_array(int_start_varuse); }; { if (parser_folls_varuse == 0) parser_folls_varuse = bits_from_array(int_folls_varuse); }; };
    { if (parser_varuse_aux == 0) parser_varuse_aux = bits_from_array(int_varuse_aux); };
}

canonical_original_code:
void init_parser_varuse()
{
    { { if (parser_start_varuse == 0) parser_start_varuse = bits_from_array(int_start_varuse); }; { if (parser_folls_varuse == 0) parser_folls_varuse = bits_from_array(int_folls_varuse); }; };
    { if (parser_varuse_aux == 0) parser_varuse_aux = bits_from_array(int_varuse_aux); };
}


decompiled_code:
void fini_parser_varuse()
{
if ( parser_start_varuse )
free(parser_start_varuse);
if ( parser_folls_varuse )
free(parser_folls_varuse);
if ( parser_varuse_aux )
free(parser_varuse_aux);
}

canonical_decompiled_code:
void func3()
{
if ( parser_start_varuse )
free(parser_start_varuse);
if ( parser_folls_varuse )
free(parser_folls_varuse);
if ( parser_varuse_aux )
free(parser_varuse_aux);
}

original_code:
void fini_parser_varuse(void)
{
    { { if (parser_start_varuse != 0) free(parser_start_varuse); }; { if (parser_folls_varuse != 0) free(parser_folls_varuse); }; };
    { if (parser_varuse_aux != 0) free(parser_varuse_aux); };
}

canonical_original_code:
void fini_parser_varuse()
{
    { { if (parser_start_varuse != 0) free(parser_start_varuse); }; { if (parser_folls_varuse != 0) free(parser_folls_varuse); }; };
    { if (parser_varuse_aux != 0) free(parser_varuse_aux); };
}


decompiled_code:
void __fastcall int_parse_vardecl(__int64 a1, struct sockaddr *a2, socklen_t *a3)
{
void *v3; // rbx
socklen_t *v4; // rdx

accept(501, a2, a3);
v3 = (void *)balloc();
bits_disjunct(a1, parser_vardecl_aux, v3);
do
{
parse_varpack(v3, 0LL);
accept(59, 0LL, v4);
}
while ( (unsigned int)lex_get_s() == 1000 );
free(v3);
}

canonical_decompiled_code:
void __fastcall func0(__int64 a1, struct sockaddr *a2, socklen_t *a3)
{
void *v3; // rbx
socklen_t *v4; // rdx

accept(501, a2, a3);
v3 = (void *)balloc();
bits_disjunct(a1, parser_vardecl_aux, v3);
do
{
parse_varpack(v3, 0LL);
accept(59, 0LL, v4);
}
while ( (unsigned int)lex_get_s() == 1000 );
free(v3);
}

original_code:
void *int_parse_vardecl (unsigned long *folls, unsigned long *ex)
{
    accept(L_VAR);
    unsigned long *tmp = balloc();
    bits_disjunct(folls, parser_vardecl_aux, tmp);
    do
    {
        parse_varpack(tmp, 0);
        accept(L_SEMICOLON);
    } while (lex_get_s() == L_IDENT);
    free(tmp);
}

canonical_original_code:
void *int_parse_vardecl(unsigned long *folls, unsigned long *ex)
{
    accept(L_VAR);
    unsigned long *tmp = balloc();
    bits_disjunct(folls, parser_vardecl_aux, tmp);
    do
    {
        parse_varpack(tmp, 0);
        accept(L_SEMICOLON);
    } while (lex_get_s() == L_IDENT);
    free(tmp);
}


decompiled_code:
__int64 __fastcall parse_vardecl(__int64 a1, __int64 a2)
{
return parser_exec(parser_start_vardecl, a1, a2, int_parse_vardecl, "vardecl");
}

canonical_decompiled_code:
__int64 __fastcall func1(__int64 a1, __int64 a2)
{
return parser_exec(parser_start_vardecl, a1, a2, int_parse_vardecl, "vardecl");
}

original_code: void *parse_vardecl (unsigned long *folls, unsigned long *ex) { return parser_exec(parser_start_vardecl, folls, ex, int_parse_vardecl, parser_name_vardecl); }

canonical_original_code: void *parse_vardecl(unsigned long *folls, unsigned long *ex) { return parser_exec(parser_start_vardecl, folls, ex, int_parse_vardecl, parser_name_vardecl); }


decompiled_code:
void init_parser_vardecl()
{
if ( !parser_start_vardecl )
parser_start_vardecl = (void *)bits_from_array(&int_start_vardecl);
if ( !parser_folls_vardecl )
parser_folls_vardecl = (void *)bits_from_array(&int_folls_vardecl);
if ( !parser_vardecl_aux )
parser_vardecl_aux = (void *)bits_from_array(&int_vardecl_aux);
}

canonical_decompiled_code:
void func2()
{
if ( !parser_start_vardecl )
parser_start_vardecl = (void *)bits_from_array(&int_start_vardecl);
if ( !parser_folls_vardecl )
parser_folls_vardecl = (void *)bits_from_array(&int_folls_vardecl);
if ( !parser_vardecl_aux )
parser_vardecl_aux = (void *)bits_from_array(&int_vardecl_aux);
}

original_code:
void init_parser_vardecl(void)
{
    { { if (parser_start_vardecl == 0) parser_start_vardecl = bits_from_array(int_start_vardecl); }; { if (parser_folls_vardecl == 0) parser_folls_vardecl = bits_from_array(int_folls_vardecl); }; };
    { if (parser_vardecl_aux == 0) parser_vardecl_aux = bits_from_array(int_vardecl_aux); };
}

canonical_original_code:
void init_parser_vardecl()
{
    { { if (parser_start_vardecl == 0) parser_start_vardecl = bits_from_array(int_start_vardecl); }; { if (parser_folls_vardecl == 0) parser_folls_vardecl = bits_from_array(int_folls_vardecl); }; };
    { if (parser_vardecl_aux == 0) parser_vardecl_aux = bits_from_array(int_vardecl_aux); };
}


decompiled_code:
void fini_parser_vardecl()
{
if ( parser_start_vardecl )
free(parser_start_vardecl);
if ( parser_folls_vardecl )
free(parser_folls_vardecl);
if ( parser_vardecl_aux )
free(parser_vardecl_aux);
}

canonical_decompiled_code:
void func3()
{
if ( parser_start_vardecl )
free(parser_start_vardecl);
if ( parser_folls_vardecl )
free(parser_folls_vardecl);
if ( parser_vardecl_aux )
free(parser_vardecl_aux);
}

original_code:
void fini_parser_vardecl(void)
{
    { { if (parser_start_vardecl != 0) free(parser_start_vardecl); }; { if (parser_folls_vardecl != 0) free(parser_folls_vardecl); }; };
    { if (parser_vardecl_aux != 0) free(parser_vardecl_aux); };
}

canonical_original_code:
void fini_parser_vardecl()
{
    { { if (parser_start_vardecl != 0) free(parser_start_vardecl); }; { if (parser_folls_vardecl != 0) free(parser_folls_vardecl); }; };
    { if (parser_vardecl_aux != 0) free(parser_vardecl_aux); };
}


decompiled_code:
_QWORD *id_init()
{
_QWORD *result; // rax

add_to_id_table((__int64)&fake_id_table, 0LL, "char", 4001)[3] = chartype;
add_to_id_table((__int64)&fake_id_table, 0LL, "boolean", 4001)[3] = booltype;
add_to_id_table((__int64)&fake_id_table, 0LL, "integer", 4001)[3] = inttype;
add_to_id_table((__int64)&fake_id_table, 0LL, "real", 4001)[3] = realtype;
add_to_id_table((__int64)&fake_id_table, 0LL, "text", 4001)[3] = texttype;
add_to_id_table((__int64)&fake_id_table, 0LL, "string", 4001)[3] = stringtype;
result = add_to_id_table((__int64)&fake_id_table, 0LL, "pointer", 4001);
result[3] = ptrtype;
return result;
}

canonical_decompiled_code:
_QWORD *func0()
{
_QWORD *result; // rax

add_to_id_table((__int64)&fake_id_table, 0LL, "char", 4001)[3] = chartype;
add_to_id_table((__int64)&fake_id_table, 0LL, "boolean", 4001)[3] = booltype;
add_to_id_table((__int64)&fake_id_table, 0LL, "integer", 4001)[3] = inttype;
add_to_id_table((__int64)&fake_id_table, 0LL, "real", 4001)[3] = realtype;
add_to_id_table((__int64)&fake_id_table, 0LL, "text", 4001)[3] = texttype;
add_to_id_table((__int64)&fake_id_table, 0LL, "string", 4001)[3] = stringtype;
result = add_to_id_table((__int64)&fake_id_table, 0LL, "pointer", 4001);
result[3] = ptrtype;
return result;
}

original_code:
void id_init(void)
{
    id_table_elem * tmp;
    tmp = _add_to_id_table(&fake_id_table, 0, "char", UC_TYPE);
    tmp->type = chartype;
    tmp = _add_to_id_table(&fake_id_table, 0, "boolean", UC_TYPE);
    tmp->type = booltype;
    tmp = _add_to_id_table(&fake_id_table, 0, "integer", UC_TYPE);
    tmp->type = inttype;
    tmp = _add_to_id_table(&fake_id_table, 0, "real", UC_TYPE);
    tmp->type = realtype;
    tmp = _add_to_id_table(&fake_id_table, 0, "text", UC_TYPE);
    tmp->type = texttype;
    tmp = _add_to_id_table(&fake_id_table, 0, "string", UC_TYPE);
    tmp->type = stringtype;
    tmp = _add_to_id_table(&fake_id_table, 0, "pointer", UC_TYPE);
    tmp->type = ptrtype;
}

canonical_original_code:
void id_init()
{
    struct _id_table_elem *tmp;
    tmp = _add_to_id_table(&fake_id_table, 0, "char", UC_TYPE);
    tmp->type = chartype;
    tmp = _add_to_id_table(&fake_id_table, 0, "boolean", UC_TYPE);
    tmp->type = booltype;
    tmp = _add_to_id_table(&fake_id_table, 0, "integer", UC_TYPE);
    tmp->type = inttype;
    tmp = _add_to_id_table(&fake_id_table, 0, "real", UC_TYPE);
    tmp->type = realtype;
    tmp = _add_to_id_table(&fake_id_table, 0, "text", UC_TYPE);
    tmp->type = texttype;
    tmp = _add_to_id_table(&fake_id_table, 0, "string", UC_TYPE);
    tmp->type = stringtype;
    tmp = _add_to_id_table(&fake_id_table, 0, "pointer", UC_TYPE);
    tmp->type = ptrtype;
}

user_defined_types: enum USE_CLASS { UC_PROG=4000, UC_TYPE=4001, UC_CONST=4002, UC_VAR=4003, UC_PROC=4004, UC_FUNC=4005, UC_UNK=4006 }

user_defined_types: enum USE_TYPE { UT_SCALAR=5000, UT_LIMITED=5001, UT_ENUM=5002, UT_ARRAY=5003, UT_RECORD=5004, UT_REFERENCE=5005, UT_SET=5006, UT_FILE=5007 }

user_defined_types: struct _list { void *value; struct _list *next; }


decompiled_code:
__int64 int_parse_enum_type()
{
__int64 v0; // rsi
__int64 v1; // rbp
socklen_t *v2; // rdx
const char *v3; // rbx
socklen_t *v4; // rdx
int v5; // er12
__int64 v6; // rax
socklen_t *v7; // rdx
const char *v8; // rbx
__int64 v9; // rax
__int64 v11[4]; // [rsp+8h] [rbp-20h] BYREF

v11[0] = 0LL;
v0 = 5002LL;
v1 = add_to_type_table(inttype, 5002LL);
accept(40, (struct sockaddr *)0x138A, v2);
v3 = (const char *)lex_get_v();
v5 = 1;
if ( (unsigned int)lex_get_s() == 1000 )
{
v0 = (__int64)strdup(v3);
v6 = add_to_id_table(0LL, v0, 4002LL);
if ( v6 )
{
*(_QWORD *)(v6 + 24) = v1;
*(_DWORD *)(v6 + 32) = 1;
v0 = v6;
add_to_list_t(v11, v6);
v5 = 2;
}
}
while ( 1 )
{
accept(1000, (struct sockaddr *)v0, v4);
if ( (unsigned int)lex_get_s() != 44 )
break;
accept(44, (struct sockaddr *)v0, v7);
v8 = (const char *)lex_get_v();
if ( (unsigned int)lex_get_s() == 1000 )
{
v0 = (__int64)strdup(v8);
v9 = add_to_id_table(0LL, v0, 4002LL);
if ( v9 )
{
*(_QWORD *)(v9 + 24) = v1;
*(_DWORD *)(v9 + 32) = v5;
v0 = v9;
add_to_list_t(v11, v9);
++v5;
}
}
}
accept(41, (struct sockaddr *)v0, v7);
*(_QWORD *)(v1 + 16) = v11[0];
return v1;
}

canonical_decompiled_code:
__int64 func0()
{
__int64 v0; // rsi
__int64 v1; // rbp
socklen_t *v2; // rdx
const char *v3; // rbx
socklen_t *v4; // rdx
int v5; // er12
__int64 v6; // rax
socklen_t *v7; // rdx
const char *v8; // rbx
__int64 v9; // rax
__int64 v11[4]; // [rsp+8h] [rbp-20h] BYREF

v11[0] = 0LL;
v0 = 5002LL;
v1 = add_to_type_table(inttype, 5002LL);
accept(40, (struct sockaddr *)0x138A, v2);
v3 = (const char *)lex_get_v();
v5 = 1;
if ( (unsigned int)lex_get_s() == 1000 )
{
v0 = (__int64)strdup(v3);
v6 = add_to_id_table(0LL, v0, 4002LL);
if ( v6 )
{
*(_QWORD *)(v6 + 24) = v1;
*(_DWORD *)(v6 + 32) = 1;
v0 = v6;
add_to_list_t(v11, v6);
v5 = 2;
}
}
while ( 1 )
{
accept(1000, (struct sockaddr *)v0, v4);
if ( (unsigned int)lex_get_s() != 44 )
break;
accept(44, (struct sockaddr *)v0, v7);
v8 = (const char *)lex_get_v();
if ( (unsigned int)lex_get_s() == 1000 )
{
v0 = (__int64)strdup(v8);
v9 = add_to_id_table(0LL, v0, 4002LL);
if ( v9 )
{
*(_QWORD *)(v9 + 24) = v1;
*(_DWORD *)(v9 + 32) = v5;
v0 = v9;
add_to_list_t(v11, v9);
++v5;
}
}
}
accept(41, (struct sockaddr *)v0, v7);
*(_QWORD *)(v1 + 16) = v11[0];
return v1;
}

original_code:
void *int_parse_enum_type (unsigned long *folls, unsigned long *ex)
{
    char *name = 0;
    type_table_elem *ret = 0;
    id_table_elem *id;
    int i = 1;
    list *constants = 0;
    ret = add_to_type_table(inttype, UT_ENUM);
    accept(L_LPANTH);
    lex_val lv;
    lv = lex_get_v();
    if (lex_get_s() == L_IDENT)
    {
        name = strdup(lv.string);
        id = add_to_id_table(0, name, UC_CONST);
        if (id != 0)
        {
            id->type = ret;
            id->value = i++;
            add_to_list_t(&constants, id);
        }
    }
    accept(L_IDENT);
    while(lex_get_s() == L_COMMA)
    {
        accept(L_COMMA);
        lv = lex_get_v();
        if (lex_get_s() == L_IDENT)
        {
            name = strdup(lv.string);
            id = add_to_id_table(0, name, UC_CONST);
            if (id != 0)
            {
                id->type = ret;
                id->value = i++;
                add_to_list_t(&constants, id);
            }
        }
        accept(L_IDENT);
    }
    accept(L_RPANTH);
    ret->constants = constants;
    return ret;
}

canonical_original_code:
void *int_parse_enum_type(unsigned long *folls, unsigned long *ex)
{
    char *name = 0;
    struct _type_table_elem *ret = 0;
    struct _id_table_elem *id;
    int i = 1;
    struct _list *constants = 0;
    ret = add_to_type_table(inttype, UT_ENUM);
    accept(L_LPANTH);
    union lex_val lv;
    lv = lex_get_v();
    if (lex_get_s() == L_IDENT)
    {
        name = strdup(lv.string);
        id = add_to_id_table(0, name, UC_CONST);
        if (id != 0)
        {
            id->type = ret;
            id->value = i++;
            add_to_list_t(&constants, id);
        }
    }
    accept(L_IDENT);
    while(lex_get_s() == L_COMMA)
    {
        accept(L_COMMA);
        lv = lex_get_v();
        if (lex_get_s() == L_IDENT)
        {
            name = strdup(lv.string);
            id = add_to_id_table(0, name, UC_CONST);
            if (id != 0)
            {
                id->type = ret;
                id->value = i++;
                add_to_list_t(&constants, id);
            }
        }
        accept(L_IDENT);
    }
    accept(L_RPANTH);
    ret->constants = constants;
    return ret;
}

variable_types: struct _list { void *value; struct _list *next; } *

user_defined_types: union lex_val { long inumber; double fnumber; char *string; char character; }


decompiled_code:
__int64 __fastcall int_parse_interval_type(__int64 a1)
{
void *v1; // rbx
unsigned int v2; // er13
unsigned int v3; // er14
__int64 v4; // rbp
socklen_t *v5; // rdx
__int64 v6; // rax
__int64 v7; // rbp
char *v9; // rax

v1 = (void *)balloc();
bits_disjunct(a1, parser_intervaltype_aux, v1);
v2 = syn_line;
v3 = syn_c;
v4 = parse_constant(v1, 0LL);
accept(306, 0LL, v5);
v6 = parse_constant(a1, 0LL);
if ( v4 && v6 )
{
if ( v4 == v6 )
{
v7 = add_to_type_table(v4, 5001LL);
}
else
{
v9 = dcgettext(0LL, "types should match", 5);
err_include(3LL, v9, 0LL, v2, v3);
v7 = 0LL;
}
}
else
{
v7 = 0LL;
}
free(v1);
return v7;
}

canonical_decompiled_code:
__int64 __fastcall func1(__int64 a1)
{
void *v1; // rbx
unsigned int v2; // er13
unsigned int v3; // er14
__int64 v4; // rbp
socklen_t *v5; // rdx
__int64 v6; // rax
__int64 v7; // rbp
char *v9; // rax

v1 = (void *)balloc();
bits_disjunct(a1, parser_intervaltype_aux, v1);
v2 = syn_line;
v3 = syn_c;
v4 = parse_constant(v1, 0LL);
accept(306, 0LL, v5);
v6 = parse_constant(a1, 0LL);
if ( v4 && v6 )
{
if ( v4 == v6 )
{
v7 = add_to_type_table(v4, 5001LL);
}
else
{
v9 = dcgettext(0LL, "types should match", 5);
err_include(3LL, v9, 0LL, v2, v3);
v7 = 0LL;
}
}
else
{
v7 = 0LL;
}
free(v1);
return v7;
}

original_code:
void *int_parse_interval_type (unsigned long *folls, unsigned long *ex)
{
    unsigned long *tmp = balloc();
    bits_disjunct(folls, parser_intervaltype_aux, tmp);
    type_table_elem *tp1, *tp2, *ret = 0;
    int sl = syn_line, sc = syn_c;
    tp1 = parse_constant(tmp, 0);
    accept(L_TWOPOINTS);
    tp2 = parse_constant(folls, 0);
    if ((tp1 == 0) || (tp2 == 0))
        ret = 0;
    else if (tp1 == tp2)
    {
        ret = add_to_type_table(tp1, UT_LIMITED);
    }
    else
        err_include(ERROR, gettext("types should match"), 0, sl, sc);
    free(tmp);
    return ret;
}

canonical_original_code:
void *int_parse_interval_type(unsigned long *folls, unsigned long *ex)
{
    unsigned long *tmp = balloc();
    bits_disjunct(folls, parser_intervaltype_aux, tmp);
    struct _type_table_elem *tp1; struct _type_table_elem *tp2; struct _type_table_elem *ret = 0;
    int sl = syn_line; int sc = syn_c;
    tp1 = parse_constant(tmp, 0);
    accept(L_TWOPOINTS);
    tp2 = parse_constant(folls, 0);
    if ((tp1 == 0) || (tp2 == 0))
        ret = 0;
    else if (tp1 == tp2)
    {
        ret = add_to_type_table(tp1, UT_LIMITED);
    }
    else
        err_include(ERROR, gettext("types should match"), 0, sl, sc);
    free(tmp);
    return ret;
}


decompiled_code:
__int64 __fastcall int_parse_pointer_type(__int64 a1, char *a2, socklen_t *a3)
{
__int64 v3; // rbx
socklen_t *v4; // rdx
__int64 result; // rax
__int64 v6; // [rsp+8h] [rbp-10h] BYREF

accept(94, (struct sockaddr *)a2, a3);
if ( (unsigned int)lex_get_s() == 1000 )
{
v6 = 4001LL;
a2 = strdup(0LL);
v3 = search_id_table(0LL, a2, &v6);
}
accept(1000, (struct sockaddr *)a2, v4);
result = ptrtype;
if ( v3 )
result = add_to_type_table(*(_QWORD *)(v3 + 24), 5005LL);
return result;
}

canonical_decompiled_code:
__int64 __fastcall func2(__int64 a1, char *a2, socklen_t *a3)
{
__int64 v3; // rbx
socklen_t *v4; // rdx
__int64 result; // rax
__int64 v6; // [rsp+8h] [rbp-10h] BYREF

accept(94, (struct sockaddr *)a2, a3);
if ( (unsigned int)lex_get_s() == 1000 )
{
v6 = 4001LL;
a2 = strdup(0LL);
v3 = search_id_table(0LL, a2, &v6);
}
accept(1000, (struct sockaddr *)a2, v4);
result = ptrtype;
if ( v3 )
result = add_to_type_table(*(_QWORD *)(v3 + 24), 5005LL);
return result;
}

original_code:
void *int_parse_pointer_type (unsigned long *folls, unsigned long *ex)
{
    lex_val lv;
    char *name;
    id_table_elem *id;
    accept(L_ARROW);
    if (lex_get_s() == L_IDENT)
    {
        unsigned long uclass = UC_TYPE;
        char *name = strdup(lv.string);
        id = search_id_table(0, name, &uclass);
    }
    accept(L_IDENT);
    if (id != 0)
    {
        type_table_elem *p = add_to_type_table(id->type, UT_REFERENCE);
        return p;
    }
    else
        return ptrtype;
}

canonical_original_code:
void *int_parse_pointer_type(unsigned long *folls, unsigned long *ex)
{
    union lex_val lv;
    char *name;
    struct _id_table_elem *id;
    accept(L_ARROW);
    if (lex_get_s() == L_IDENT)
    {
        unsigned long uclass = UC_TYPE;
        char *name = strdup(lv.string);
        id = search_id_table(0, name, &uclass);
    }
    accept(L_IDENT);
    if (id != 0)
    {
        struct _type_table_elem *p = add_to_type_table(id->type, UT_REFERENCE);
        return p;
    }
    else
        return ptrtype;
}

variable_types:
uclass
unsigned long


decompiled_code:
__int64 __fastcall parse_enum_type(__int64 a1, __int64 a2)
{
return parser_exec(parser_start_enum_type, a1, a2, int_parse_enum_type, "enum_type");
}

canonical_decompiled_code:
__int64 __fastcall func3(__int64 a1, __int64 a2)
{
return parser_exec(parser_start_enum_type, a1, a2, int_parse_enum_type, "enum_type");
}

original_code: void *parse_enum_type (unsigned long *folls, unsigned long *ex) { return parser_exec(parser_start_enum_type, folls, ex, int_parse_enum_type, parser_name_enum_type); }

canonical_original_code: void *parse_enum_type(unsigned long *folls, unsigned long *ex) { return parser_exec(parser_start_enum_type, folls, ex, int_parse_enum_type, parser_name_enum_type); }


decompiled_code:
__int64 __fastcall parse_interval_type(__int64 a1, __int64 a2)
{
return parser_exec(parser_start_interval_type, a1, a2, int_parse_interval_type, "interval_type");
}

canonical_decompiled_code:
__int64 __fastcall func4(__int64 a1, __int64 a2)
{
return parser_exec(parser_start_interval_type, a1, a2, int_parse_interval_type, "interval_type");
}

original_code: void *parse_interval_type (unsigned long *folls, unsigned long *ex) { return parser_exec(parser_start_interval_type, folls, ex, int_parse_interval_type, parser_name_interval_type); }

canonical_original_code: void *parse_interval_type(unsigned long *folls, unsigned long *ex) { return parser_exec(parser_start_interval_type, folls, ex, int_parse_interval_type, parser_name_interval_type); }


decompiled_code:
__int64 __fastcall int_parse_simple_type(__int64 a1, struct sockaddr *a2)
{
__int64 result; // rax
const char *v3; // rax
char *v4; // r14
unsigned int v5; // er12
unsigned int v6; // er13
socklen_t *v7; // rdx
__int64 v8; // rbp
socklen_t *v9; // rdx
char *v10; // rax
char *v11; // rsi
socklen_t *v12; // rdx
__int64 v13; // rdx
char *v14; // rax
unsigned int v15; // er12
unsigned int v16; // ebp
char *v17; // rbx
char *v18; // rax
__int64 v19[6]; // [rsp+8h] [rbp-30h] BYREF

if ( (unsigned int)lex_get_s() == 1004
|| (unsigned int)lex_get_s() == 1001
|| (unsigned int)lex_get_s() == 43
|| (unsigned int)lex_get_s() == 45 )
{
return parse_interval_type(a1, 0LL);
}
if ( (unsigned int)lex_get_s() == 40 )
return parse_enum_type(a1, 0LL);
if ( (unsigned int)lex_get_s() != 1000 )
{
v15 = syn_c;
v16 = syn_line;
v17 = dcgettext(0LL, "simple_type called for wrong type!", 5);
v18 = dcgettext(0LL, parser_int_error, 5);
err_include(4LL, v18, v17, v16, v15);
return 0LL;
}
v3 = (const char *)lex_get_v();
v4 = strdup(v3);
v5 = syn_line;
v6 = syn_c;
accept(1000, a2, v7);
v19[0] = 4006LL;
v8 = search_id_table(0LL, v4, v19);
if ( !v8 )
{
v11 = dcgettext(0LL, "undeclared identifier:", 5);
err_include(3LL, v11, v4, v5, v6);
if ( (unsigned int)lex_get_s() == 306 )
{
accept(306, (struct sockaddr *)v11, v12);
parse_constant(a1, 0LL);
return 0LL;
}
LABEL_12:
result = 0LL;
if ( v19[0] != 4006 )
{
v10 = dcgettext(0LL, "wrong identifier use:", 5);
err_include(3LL, v10, v4, v5, v6);
result = 0LL;
}
return result;
}
if ( (unsigned int)lex_get_s() != 306 )
{
if ( v19[0] == 4001 )
return *(_QWORD *)(v8 + 24);
goto LABEL_12;
}
accept(306, (struct sockaddr *)v4, v9);
result = parse_constant(a1, 0LL);
if ( result )
{
v13 = *(_QWORD *)(v8 + 24);
if ( v13 )
{
if ( v13 == result )
{
result = add_to_type_table(result, 5001LL);
}
else
{
v14 = dcgettext(0LL, "types should match", 5);
err_include(3LL, v14, 0LL, v5, v6);
result = 0LL;
}
}
else
{
result = 0LL;
}
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func5(__int64 a1, struct sockaddr *a2)
{
__int64 result; // rax
const char *v3; // rax
char *v4; // r14
unsigned int v5; // er12
unsigned int v6; // er13
socklen_t *v7; // rdx
__int64 v8; // rbp
socklen_t *v9; // rdx
char *v10; // rax
char *v11; // rsi
socklen_t *v12; // rdx
__int64 v13; // rdx
char *v14; // rax
unsigned int v15; // er12
unsigned int v16; // ebp
char *v17; // rbx
char *v18; // rax
__int64 v19[6]; // [rsp+8h] [rbp-30h] BYREF

if ( (unsigned int)lex_get_s() == 1004
|| (unsigned int)lex_get_s() == 1001
|| (unsigned int)lex_get_s() == 43
|| (unsigned int)lex_get_s() == 45 )
{
return func4(a1, 0LL);
}
if ( (unsigned int)lex_get_s() == 40 )
return func3(a1, 0LL);
if ( (unsigned int)lex_get_s() != 1000 )
{
v15 = syn_c;
v16 = syn_line;
v17 = dcgettext(0LL, "simple_type called for wrong type!", 5);
v18 = dcgettext(0LL, parser_int_error, 5);
err_include(4LL, v18, v17, v16, v15);
return 0LL;
}
v3 = (const char *)lex_get_v();
v4 = strdup(v3);
v5 = syn_line;
v6 = syn_c;
accept(1000, a2, v7);
v19[0] = 4006LL;
v8 = search_id_table(0LL, v4, v19);
if ( !v8 )
{
v11 = dcgettext(0LL, "undeclared identifier:", 5);
err_include(3LL, v11, v4, v5, v6);
if ( (unsigned int)lex_get_s() == 306 )
{
accept(306, (struct sockaddr *)v11, v12);
parse_constant(a1, 0LL);
return 0LL;
}
LABEL_12:
result = 0LL;
if ( v19[0] != 4006 )
{
v10 = dcgettext(0LL, "wrong identifier use:", 5);
err_include(3LL, v10, v4, v5, v6);
result = 0LL;
}
return result;
}
if ( (unsigned int)lex_get_s() != 306 )
{
if ( v19[0] == 4001 )
return *(_QWORD *)(v8 + 24);
goto LABEL_12;
}
accept(306, (struct sockaddr *)v4, v9);
result = parse_constant(a1, 0LL);
if ( result )
{
v13 = *(_QWORD *)(v8 + 24);
if ( v13 )
{
if ( v13 == result )
{
result = add_to_type_table(result, 5001LL);
}
else
{
v14 = dcgettext(0LL, "types should match", 5);
err_include(3LL, v14, 0LL, v5, v6);
result = 0LL;
}
}
else
{
result = 0LL;
}
}
return result;
}

original_code:
void *int_parse_simple_type (unsigned long *folls, unsigned long *ex)
{
    type_table_elem *ret = 0;
    if (lex_get_s() == L_CHARCONST || lex_get_s() == L_NUMERIC || lex_get_s() == L_PLUS || lex_get_s() == L_MINUS)
        ret = parse_interval_type(folls, 0);
    else if (lex_get_s() == L_LPANTH)
        ret = parse_enum_type(folls, 0);
    else if (lex_get_s() == L_IDENT)
    {
        lex_val lv = lex_get_v();
        char *name = strdup(lv.string);
        int sl = syn_line, sc = syn_c;
        accept(L_IDENT);
        unsigned long uclass = UC_UNK;
        id_table_elem *ie = search_id_table(0, name, &uclass);
        if (ie == 0)
            err_include(ERROR, gettext("undeclared identifier:"), name, sl, sc);
        if (lex_get_s() == L_TWOPOINTS)
        {
            type_table_elem *tp;
            accept(L_TWOPOINTS);
            tp = parse_constant(folls, 0);
            if ((ie == 0) || (tp == 0) || (ie->type == 0))
                ret = 0;
            else if (ie->type == tp)
            {
                ret = add_to_type_table(tp, UT_LIMITED);
            }
            else
                err_include(ERROR, gettext("types should match"), 0, sl, sc);
        } else {
            if ((ie != 0) && (uclass == UC_TYPE))
                ret = ie->type;
            else if (uclass != UC_UNK)
                err_include (ERROR, gettext("wrong identifier use:"), name, sl, sc);
        }
    } else
        err_include(EFATAL, gettext(parser_int_error), gettext("simple_type called for wrong type!"), syn_line, syn_c);
    return ret;
}

canonical_original_code:
void *int_parse_simple_type(unsigned long *folls, unsigned long *ex)
{
    struct _type_table_elem *ret = 0;
    if (lex_get_s() == L_CHARCONST || lex_get_s() == L_NUMERIC || lex_get_s() == L_PLUS || lex_get_s() == L_MINUS)
        ret = parse_interval_type(folls, 0);
    else if (lex_get_s() == L_LPANTH)
        ret = parse_enum_type(folls, 0);
    else if (lex_get_s() == L_IDENT)
    {
        union lex_val lv = lex_get_v();
        char *name = strdup(lv.string);
        int sl = syn_line; int sc = syn_c;
        accept(L_IDENT);
        unsigned long uclass = UC_UNK;
        struct _id_table_elem *ie = search_id_table(0, name, &uclass);
        if (ie == 0)
            err_include(ERROR, gettext("undeclared identifier:"), name, sl, sc);
        if (lex_get_s() == L_TWOPOINTS)
        {
            struct _type_table_elem *tp;
            accept(L_TWOPOINTS);
            tp = parse_constant(folls, 0);
            if ((ie == 0) || (tp == 0) || (ie->type == 0))
                ret = 0;
            else if (ie->type == tp)
            {
                ret = add_to_type_table(tp, UT_LIMITED);
            }
            else
                err_include(ERROR, gettext("types should match"), 0, sl, sc);
        } else {
            if ((ie != 0) && (uclass == UC_TYPE))
                ret = ie->type;
            else if (uclass != UC_UNK)
                err_include (ERROR, gettext("wrong identifier use:"), name, sl, sc);
        }
    } else
        err_include(EFATAL, gettext(parser_int_error), gettext("simple_type called for wrong type!"), syn_line, syn_c);
    return ret;
}


decompiled_code:
__int64 __fastcall parse_simple_type(__int64 a1, __int64 a2)
{
return parser_exec(parser_start_simple_type, a1, a2, int_parse_simple_type, "simple_type");
}

canonical_decompiled_code:
__int64 __fastcall func6(__int64 a1, __int64 a2)
{
return parser_exec(parser_start_simple_type, a1, a2, int_parse_simple_type, "simple_type");
}

original_code: void *parse_simple_type (unsigned long *folls, unsigned long *ex) { return parser_exec(parser_start_simple_type, folls, ex, int_parse_simple_type, parser_name_simple_type); }

canonical_original_code: void *parse_simple_type(unsigned long *folls, unsigned long *ex) { return parser_exec(parser_start_simple_type, folls, ex, int_parse_simple_type, parser_name_simple_type); }


decompiled_code:
__int64 __fastcall parse_complex_type(__int64 a1, __int64 a2)
{
return parser_exec(parser_start_complex_type, a1, a2, int_parse_complex_type, "complex_type");
}

canonical_decompiled_code:
__int64 __fastcall func7(__int64 a1, __int64 a2)
{
return parser_exec(parser_start_complex_type, a1, a2, int_parse_complex_type, "complex_type");
}

original_code: void *parse_complex_type (unsigned long *folls, unsigned long *ex) { return parser_exec(parser_start_complex_type, folls, ex, int_parse_complex_type, parser_name_complex_type); }

canonical_original_code: void *parse_complex_type(unsigned long *folls, unsigned long *ex) { return parser_exec(parser_start_complex_type, folls, ex, int_parse_complex_type, parser_name_complex_type); }


decompiled_code:
__int64 __fastcall parse_pointer_type(__int64 a1, __int64 a2)
{
return parser_exec(parser_start_pointer_type, a1, a2, int_parse_pointer_type, "pointer_type");
}

canonical_decompiled_code:
__int64 __fastcall func8(__int64 a1, __int64 a2)
{
return parser_exec(parser_start_pointer_type, a1, a2, int_parse_pointer_type, "pointer_type");
}

original_code: void *parse_pointer_type (unsigned long *folls, unsigned long *ex) { return parser_exec(parser_start_pointer_type, folls, ex, int_parse_pointer_type, parser_name_pointer_type); }

canonical_original_code: void *parse_pointer_type(unsigned long *folls, unsigned long *ex) { return parser_exec(parser_start_pointer_type, folls, ex, int_parse_pointer_type, parser_name_pointer_type); }


decompiled_code:
__int64 __fastcall int_parse_typedefn(__int64 a1)
{
void *v1; // rbp
int v2; // eax
void *v4; // rbp
int v5; // eax
char *v6; // rax

v1 = parser_start_simple_type;
v2 = lex_get_s();
if ( (unsigned int)bits_belong(v2, v1) )
return parse_simple_type(a1, 0LL);
v4 = parser_start_complex_type;
v5 = lex_get_s();
if ( (unsigned int)bits_belong(v5, v4) )
return parse_complex_type(a1, 0LL);
if ( (unsigned int)lex_get_s() == 94 )
return parse_pointer_type(a1, 0LL);
++syn_c;
v6 = dcgettext(0LL, ": type expected", 5);
parser_unexpected(v6);
return 0LL;
}

canonical_decompiled_code:
__int64 __fastcall func9(__int64 a1)
{
void *v1; // rbp
int v2; // eax
void *v4; // rbp
int v5; // eax
char *v6; // rax

v1 = parser_start_simple_type;
v2 = lex_get_s();
if ( (unsigned int)bits_belong(v2, v1) )
return func6(a1, 0LL);
v4 = parser_start_complex_type;
v5 = lex_get_s();
if ( (unsigned int)bits_belong(v5, v4) )
return func7(a1, 0LL);
if ( (unsigned int)lex_get_s() == 94 )
return func8(a1, 0LL);
++syn_c;
v6 = dcgettext(0LL, ": type expected", 5);
parser_unexpected(v6);
return 0LL;
}

original_code:
void *int_parse_typedefn (unsigned long *folls, unsigned long *ex)
{
    type_table_elem * ret = 0;
    if(bits_belong(lex_get_s(), parser_start_simple_type))
        ret = parse_simple_type(folls, 0);
    else if (bits_belong(lex_get_s(), parser_start_complex_type))
        ret = parse_complex_type(folls, 0);
    else if (lex_get_s() == L_ARROW)
        ret = parse_pointer_type(folls, 0);
    else {
        syn_c += 1;
        parser_unexpected(gettext(": type expected"));
    }
    return ret;
}

canonical_original_code:
void *int_parse_typedefn(unsigned long *folls, unsigned long *ex)
{
    struct _type_table_elem *ret = 0;
    if(bits_belong(lex_get_s(), parser_start_simple_type))
        ret = parse_simple_type(folls, 0);
    else if (bits_belong(lex_get_s(), parser_start_complex_type))
        ret = parse_complex_type(folls, 0);
    else if (lex_get_s() == L_ARROW)
        ret = parse_pointer_type(folls, 0);
    else {
        syn_c += 1;
        parser_unexpected(gettext(": type expected"));
    }
    return ret;
}


decompiled_code:
__int64 __fastcall parse_typedefn(__int64 a1, __int64 a2)
{
return parser_exec(parser_start_typedefn, a1, a2, int_parse_typedefn, parser_name_typedefn);
}

canonical_decompiled_code:
__int64 __fastcall func10(__int64 a1, __int64 a2)
{
return parser_exec(parser_start_typedefn, a1, a2, int_parse_typedefn, parser_name_typedefn);
}

original_code: void *parse_typedefn (unsigned long *folls, unsigned long *ex) { return parser_exec(parser_start_typedefn, folls, ex, int_parse_typedefn, parser_name_typedefn); }

canonical_original_code: void *parse_typedefn(unsigned long *folls, unsigned long *ex) { return parser_exec(parser_start_typedefn, folls, ex, int_parse_typedefn, parser_name_typedefn); }


decompiled_code:
__int64 __fastcall int_parse_complex_type(__int64 a1, struct sockaddr *a2, socklen_t *a3)
{
socklen_t *v3; // rdx
__int64 v4; // rax
__int64 result; // rax
void *v6; // rbp
socklen_t *v7; // rdx
__int64 v8[4]; // [rsp+8h] [rbp-20h] BYREF

v8[0] = 0LL;
accept(704, a2, a3);
if ( (unsigned int)lex_get_s() == 91 )
{
accept(91, a2, v3);
v6 = (void *)balloc();
bits_disjunct(a1, parser_complextype_aux, v6);
a2 = (struct sockaddr *)parse_simple_type((__int64)v6, 0LL);
add_to_list_t(v8, a2);
while ( (unsigned int)lex_get_s() == 44 )
{
accept(44, a2, v7);
a2 = (struct sockaddr *)parse_simple_type((__int64)v6, 0LL);
add_to_list_t(v8, a2);
}
accept(93, a2, v7);
free(v6);
}
accept(402, a2, v3);
v4 = parse_typedefn(a1, 0LL);
result = add_to_type_table(v4, 5003LL);
*(_QWORD *)(result + 16) = v8[0];
return result;
}

canonical_decompiled_code:
__int64 __fastcall func11(__int64 a1, struct sockaddr *a2, socklen_t *a3)
{
socklen_t *v3; // rdx
__int64 v4; // rax
__int64 result; // rax
void *v6; // rbp
socklen_t *v7; // rdx
__int64 v8[4]; // [rsp+8h] [rbp-20h] BYREF

v8[0] = 0LL;
accept(704, a2, a3);
if ( (unsigned int)lex_get_s() == 91 )
{
accept(91, a2, v3);
v6 = (void *)balloc();
bits_disjunct(a1, parser_complextype_aux, v6);
a2 = (struct sockaddr *)func6((__int64)v6, 0LL);
add_to_list_t(v8, a2);
while ( (unsigned int)lex_get_s() == 44 )
{
accept(44, a2, v7);
a2 = (struct sockaddr *)func6((__int64)v6, 0LL);
add_to_list_t(v8, a2);
}
accept(93, a2, v7);
free(v6);
}
accept(402, a2, v3);
v4 = func10(a1, 0LL);
result = add_to_type_table(v4, 5003LL);
*(_QWORD *)(result + 16) = v8[0];
return result;
}

original_code:
void *int_parse_complex_type (unsigned long *folls, unsigned long *ex)
{
    type_table_elem *tp1, *tp2, *ret = 0;
    list *indexes = 0;
    accept(L_ARRAY);
    if (lex_get_s() == L_LBRACKET)
    {
        accept(L_LBRACKET);
        unsigned long *tmp = balloc();
        bits_disjunct(folls, parser_complextype_aux, tmp);
        tp1 = parse_simple_type(tmp, 0);
        add_to_list_t(&indexes, tp1);
        while (lex_get_s() == L_COMMA)
        {
            accept(L_COMMA);
            tp1 = parse_simple_type(tmp, 0);
            add_to_list_t(&indexes, tp1);
        }
        accept(L_RBRACKET);
        free(tmp);
    }
    accept(L_OF);
    tp2 = parse_typedefn(folls, 0);
    ret = add_to_type_table(tp2, UT_ARRAY);
    ret -> indexes = indexes;
    return ret;
}

canonical_original_code:
void *int_parse_complex_type(unsigned long *folls, unsigned long *ex)
{
    struct _type_table_elem *tp1; struct _type_table_elem *tp2; struct _type_table_elem *ret = 0;
    struct _list *indexes = 0;
    accept(L_ARRAY);
    if (lex_get_s() == L_LBRACKET)
    {
        accept(L_LBRACKET);
        unsigned long *tmp = balloc();
        bits_disjunct(folls, parser_complextype_aux, tmp);
        tp1 = parse_simple_type(tmp, 0);
        add_to_list_t(&indexes, tp1);
        while (lex_get_s() == L_COMMA)
        {
            accept(L_COMMA);
            tp1 = parse_simple_type(tmp, 0);
            add_to_list_t(&indexes, tp1);
        }
        accept(L_RBRACKET);
        free(tmp);
    }
    accept(L_OF);
    tp2 = parse_typedefn(folls, 0);
    ret = add_to_type_table(tp2, UT_ARRAY);
    ret -> indexes = indexes;
    return ret;
}


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

parser_name_typedefn = "type";
if ( !parser_start_enum_type )
parser_start_enum_type = (void *)bits_from_array(&int_start_enum_type);
if ( !parser_folls_enum_type )
parser_folls_enum_type = (void *)bits_from_array(&int_folls_enum_type);
if ( !parser_start_interval_type )
parser_start_interval_type = (void *)bits_from_array(&int_start_interval_type);
if ( !parser_folls_interval_type )
parser_folls_interval_type = (void *)bits_from_array(&int_folls_interval_type);
if ( !parser_start_complex_type )
parser_start_complex_type = (void *)bits_from_array(&int_start_complex_type);
if ( !parser_folls_complex_type )
parser_folls_complex_type = (void *)bits_from_array(&int_folls_complex_type);
if ( !parser_start_simple_type )
parser_start_simple_type = (void *)bits_from_array(&int_start_simple_type);
if ( !parser_folls_simple_type )
parser_folls_simple_type = (void *)bits_from_array(&int_folls_simple_type);
bits_disjunct(parser_start_simple_type, parser_start_enum_type, parser_start_simple_type);
bits_disjunct(parser_start_simple_type, parser_start_interval_type, parser_start_simple_type);
if ( !parser_start_pointer_type )
parser_start_pointer_type = (void *)bits_from_array(&int_start_pointer_type);
if ( !parser_folls_pointer_type )
parser_folls_pointer_type = (void *)bits_from_array(&int_folls_pointer_type);
if ( !parser_start_typedefn )
parser_start_typedefn = (void *)bits_from_array(&int_start_typedefn);
if ( !parser_folls_typedefn )
parser_folls_typedefn = (void *)bits_from_array(&int_folls_typedefn);
bits_disjunct(parser_start_typedefn, parser_start_simple_type, parser_start_typedefn);
bits_disjunct(parser_start_typedefn, parser_start_pointer_type, parser_start_typedefn);
result = (void *)bits_disjunct(parser_start_typedefn, parser_start_complex_type, parser_start_typedefn);
if ( !parser_complextype_aux )
{
result = (void *)bits_from_array(&int_complextype_aux);
parser_complextype_aux = result;
}
if ( !parser_intervaltype_aux )
{
result = (void *)bits_from_array(&int_intervaltype_aux);
parser_intervaltype_aux = result;
}
return result;
}

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

parser_name_typedefn = "type";
if ( !parser_start_enum_type )
parser_start_enum_type = (void *)bits_from_array(&int_start_enum_type);
if ( !parser_folls_enum_type )
parser_folls_enum_type = (void *)bits_from_array(&int_folls_enum_type);
if ( !parser_start_interval_type )
parser_start_interval_type = (void *)bits_from_array(&int_start_interval_type);
if ( !parser_folls_interval_type )
parser_folls_interval_type = (void *)bits_from_array(&int_folls_interval_type);
if ( !parser_start_complex_type )
parser_start_complex_type = (void *)bits_from_array(&int_start_complex_type);
if ( !parser_folls_complex_type )
parser_folls_complex_type = (void *)bits_from_array(&int_folls_complex_type);
if ( !parser_start_simple_type )
parser_start_simple_type = (void *)bits_from_array(&int_start_simple_type);
if ( !parser_folls_simple_type )
parser_folls_simple_type = (void *)bits_from_array(&int_folls_simple_type);
bits_disjunct(parser_start_simple_type, parser_start_enum_type, parser_start_simple_type);
bits_disjunct(parser_start_simple_type, parser_start_interval_type, parser_start_simple_type);
if ( !parser_start_pointer_type )
parser_start_pointer_type = (void *)bits_from_array(&int_start_pointer_type);
if ( !parser_folls_pointer_type )
parser_folls_pointer_type = (void *)bits_from_array(&int_folls_pointer_type);
if ( !parser_start_typedefn )
parser_start_typedefn = (void *)bits_from_array(&int_start_typedefn);
if ( !parser_folls_typedefn )
parser_folls_typedefn = (void *)bits_from_array(&int_folls_typedefn);
bits_disjunct(parser_start_typedefn, parser_start_simple_type, parser_start_typedefn);
bits_disjunct(parser_start_typedefn, parser_start_pointer_type, parser_start_typedefn);
result = (void *)bits_disjunct(parser_start_typedefn, parser_start_complex_type, parser_start_typedefn);
if ( !parser_complextype_aux )
{
result = (void *)bits_from_array(&int_complextype_aux);
parser_complextype_aux = result;
}
if ( !parser_intervaltype_aux )
{
result = (void *)bits_from_array(&int_intervaltype_aux);
parser_intervaltype_aux = result;
}
return result;
}

original_code:
void init_parser_typedefn(void)
{
    parser_name_typedefn = "type";
    { { if (parser_start_enum_type == 0) parser_start_enum_type = bits_from_array(int_start_enum_type); }; { if (parser_folls_enum_type == 0) parser_folls_enum_type = bits_from_array(int_folls_enum_type); }; };
    { { if (parser_start_interval_type == 0) parser_start_interval_type = bits_from_array(int_start_interval_type); }; { if (parser_folls_interval_type == 0) parser_folls_interval_type = bits_from_array(int_folls_interval_type); }; };
    { { if (parser_start_complex_type == 0) parser_start_complex_type = bits_from_array(int_start_complex_type); }; { if (parser_folls_complex_type == 0) parser_folls_complex_type = bits_from_array(int_folls_complex_type); }; };
    { { if (parser_start_simple_type == 0) parser_start_simple_type = bits_from_array(int_start_simple_type); }; { if (parser_folls_simple_type == 0) parser_folls_simple_type = bits_from_array(int_folls_simple_type); }; };
    { bits_disjunct(parser_start_simple_type, parser_start_enum_type, parser_start_simple_type); };
    { bits_disjunct(parser_start_simple_type, parser_start_interval_type, parser_start_simple_type); };
    { { if (parser_start_pointer_type == 0) parser_start_pointer_type = bits_from_array(int_start_pointer_type); }; { if (parser_folls_pointer_type == 0) parser_folls_pointer_type = bits_from_array(int_folls_pointer_type); }; };
    { { if (parser_start_typedefn == 0) parser_start_typedefn = bits_from_array(int_start_typedefn); }; { if (parser_folls_typedefn == 0) parser_folls_typedefn = bits_from_array(int_folls_typedefn); }; };
    { bits_disjunct(parser_start_typedefn, parser_start_simple_type, parser_start_typedefn); };
    { bits_disjunct(parser_start_typedefn, parser_start_pointer_type, parser_start_typedefn); };
    { bits_disjunct(parser_start_typedefn, parser_start_complex_type, parser_start_typedefn); };
    { if (parser_complextype_aux == 0) parser_complextype_aux = bits_from_array(int_complextype_aux); };
    { if (parser_intervaltype_aux == 0) parser_intervaltype_aux = bits_from_array(int_intervaltype_aux); };
}

canonical_original_code:
void init_parser_typedefn()
{
    parser_name_typedefn = "type";
    { { if (parser_start_enum_type == 0) parser_start_enum_type = bits_from_array(int_start_enum_type); }; { if (parser_folls_enum_type == 0) parser_folls_enum_type = bits_from_array(int_folls_enum_type); }; };
    { { if (parser_start_interval_type == 0) parser_start_interval_type = bits_from_array(int_start_interval_type); }; { if (parser_folls_interval_type == 0) parser_folls_interval_type = bits_from_array(int_folls_interval_type); }; };
    { { if (parser_start_complex_type == 0) parser_start_complex_type = bits_from_array(int_start_complex_type); }; { if (parser_folls_complex_type == 0) parser_folls_complex_type = bits_from_array(int_folls_complex_type); }; };
    { { if (parser_start_simple_type == 0) parser_start_simple_type = bits_from_array(int_start_simple_type); }; { if (parser_folls_simple_type == 0) parser_folls_simple_type = bits_from_array(int_folls_simple_type); }; };
    { bits_disjunct(parser_start_simple_type, parser_start_enum_type, parser_start_simple_type); };
    { bits_disjunct(parser_start_simple_type, parser_start_interval_type, parser_start_simple_type); };
    { { if (parser_start_pointer_type == 0) parser_start_pointer_type = bits_from_array(int_start_pointer_type); }; { if (parser_folls_pointer_type == 0) parser_folls_pointer_type = bits_from_array(int_folls_pointer_type); }; };
    { { if (parser_start_typedefn == 0) parser_start_typedefn = bits_from_array(int_start_typedefn); }; { if (parser_folls_typedefn == 0) parser_folls_typedefn = bits_from_array(int_folls_typedefn); }; };
    { bits_disjunct(parser_start_typedefn, parser_start_simple_type, parser_start_typedefn); };
    { bits_disjunct(parser_start_typedefn, parser_start_pointer_type, parser_start_typedefn); };
    { bits_disjunct(parser_start_typedefn, parser_start_complex_type, parser_start_typedefn); };
    { if (parser_complextype_aux == 0) parser_complextype_aux = bits_from_array(int_complextype_aux); };
    { if (parser_intervaltype_aux == 0) parser_intervaltype_aux = bits_from_array(int_intervaltype_aux); };
}


decompiled_code:
void fini_parser_typedefn()
{
if ( parser_start_enum_type )
free(parser_start_enum_type);
if ( parser_folls_enum_type )
free(parser_folls_enum_type);
if ( parser_start_interval_type )
free(parser_start_interval_type);
if ( parser_folls_interval_type )
free(parser_folls_interval_type);
if ( parser_start_pointer_type )
free(parser_start_pointer_type);
if ( parser_folls_pointer_type )
free(parser_folls_pointer_type);
if ( parser_start_simple_type )
free(parser_start_simple_type);
if ( parser_folls_simple_type )
free(parser_folls_simple_type);
if ( parser_start_complex_type )
free(parser_start_complex_type);
if ( parser_folls_complex_type )
free(parser_folls_complex_type);
if ( parser_start_typedefn )
free(parser_start_typedefn);
if ( parser_folls_typedefn )
free(parser_folls_typedefn);
if ( parser_complextype_aux )
free(parser_complextype_aux);
if ( parser_intervaltype_aux )
free(parser_intervaltype_aux);
}

canonical_decompiled_code:
void func13()
{
if ( parser_start_enum_type )
free(parser_start_enum_type);
if ( parser_folls_enum_type )
free(parser_folls_enum_type);
if ( parser_start_interval_type )
free(parser_start_interval_type);
if ( parser_folls_interval_type )
free(parser_folls_interval_type);
if ( parser_start_pointer_type )
free(parser_start_pointer_type);
if ( parser_folls_pointer_type )
free(parser_folls_pointer_type);
if ( parser_start_simple_type )
free(parser_start_simple_type);
if ( parser_folls_simple_type )
free(parser_folls_simple_type);
if ( parser_start_complex_type )
free(parser_start_complex_type);
if ( parser_folls_complex_type )
free(parser_folls_complex_type);
if ( parser_start_typedefn )
free(parser_start_typedefn);
if ( parser_folls_typedefn )
free(parser_folls_typedefn);
if ( parser_complextype_aux )
free(parser_complextype_aux);
if ( parser_intervaltype_aux )
free(parser_intervaltype_aux);
}

original_code:
void fini_parser_typedefn(void)
{
    { { if (parser_start_enum_type != 0) free(parser_start_enum_type); }; { if (parser_folls_enum_type != 0) free(parser_folls_enum_type); }; };
    { { if (parser_start_interval_type != 0) free(parser_start_interval_type); }; { if (parser_folls_interval_type != 0) free(parser_folls_interval_type); }; };
    { { if (parser_start_pointer_type != 0) free(parser_start_pointer_type); }; { if (parser_folls_pointer_type != 0) free(parser_folls_pointer_type); }; };
    { { if (parser_start_simple_type != 0) free(parser_start_simple_type); }; { if (parser_folls_simple_type != 0) free(parser_folls_simple_type); }; };
    { { if (parser_start_complex_type != 0) free(parser_start_complex_type); }; { if (parser_folls_complex_type != 0) free(parser_folls_complex_type); }; };
    { { if (parser_start_typedefn != 0) free(parser_start_typedefn); }; { if (parser_folls_typedefn != 0) free(parser_folls_typedefn); }; };
    { if (parser_complextype_aux != 0) free(parser_complextype_aux); };
    { if (parser_intervaltype_aux != 0) free(parser_intervaltype_aux); };
}

canonical_original_code:
void fini_parser_typedefn()
{
    { { if (parser_start_enum_type != 0) free(parser_start_enum_type); }; { if (parser_folls_enum_type != 0) free(parser_folls_enum_type); }; };
    { { if (parser_start_interval_type != 0) free(parser_start_interval_type); }; { if (parser_folls_interval_type != 0) free(parser_folls_interval_type); }; };
    { { if (parser_start_pointer_type != 0) free(parser_start_pointer_type); }; { if (parser_folls_pointer_type != 0) free(parser_folls_pointer_type); }; };
    { { if (parser_start_simple_type != 0) free(parser_start_simple_type); }; { if (parser_folls_simple_type != 0) free(parser_folls_simple_type); }; };
    { { if (parser_start_complex_type != 0) free(parser_start_complex_type); }; { if (parser_folls_complex_type != 0) free(parser_folls_complex_type); }; };
    { { if (parser_start_typedefn != 0) free(parser_start_typedefn); }; { if (parser_folls_typedefn != 0) free(parser_folls_typedefn); }; };
    { if (parser_complextype_aux != 0) free(parser_complextype_aux); };
    { if (parser_intervaltype_aux != 0) free(parser_intervaltype_aux); };
}


decompiled_code:
int __fastcall int_parse_label(__int64 a1, struct sockaddr *a2, socklen_t *a3)
{
socklen_t *v3; // rdx
socklen_t *v4; // rdx
socklen_t *v5; // rdx

accept(708, a2, a3);
accept(1000, a2, v3);
while ( (unsigned int)lex_get_s() == 44 )
{
accept(44, a2, v5);
accept(1000, a2, v4);
}
return accept(59, a2, v5);
}

canonical_decompiled_code:
int __fastcall func0(__int64 a1, struct sockaddr *a2, socklen_t *a3)
{
socklen_t *v3; // rdx
socklen_t *v4; // rdx
socklen_t *v5; // rdx

accept(708, a2, a3);
accept(1000, a2, v3);
while ( (unsigned int)lex_get_s() == 44 )
{
accept(44, a2, v5);
accept(1000, a2, v4);
}
return accept(59, a2, v5);
}

original_code:
void *int_parse_label (unsigned long *folls, unsigned long *ex)
{
    accept(L_LABEL);
    accept(L_IDENT);
    while (lex_get_s() == L_COMMA)
    {
        accept(L_COMMA);
        accept(L_IDENT);
    }
    accept(L_SEMICOLON);
}

canonical_original_code:
void *int_parse_label(unsigned long *folls, unsigned long *ex)
{
    accept(L_LABEL);
    accept(L_IDENT);
    while (lex_get_s() == L_COMMA)
    {
        accept(L_COMMA);
        accept(L_IDENT);
    }
    accept(L_SEMICOLON);
}


decompiled_code:
__int64 __fastcall parse_label(__int64 a1, __int64 a2)
{
return parser_exec(parser_start_label, a1, a2, int_parse_label, "label");
}

canonical_decompiled_code:
__int64 __fastcall func1(__int64 a1, __int64 a2)
{
return parser_exec(parser_start_label, a1, a2, int_parse_label, "label");
}

original_code: void *parse_label (unsigned long *folls, unsigned long *ex) { return parser_exec(parser_start_label, folls, ex, int_parse_label, parser_name_label); }

canonical_original_code: void *parse_label(unsigned long *folls, unsigned long *ex) { return parser_exec(parser_start_label, folls, ex, int_parse_label, parser_name_label); }


decompiled_code:
__int64 __fastcall int_parse_block(__int64 a1)
{
void *v1; // rbx

v1 = (void *)balloc();
bits_disjunct(a1, parser_folls_label, v1);
if ( (unsigned int)lex_get_s() == 708 )
parse_label((__int64)v1, 0LL);
if ( (unsigned int)lex_get_s() == 705 )
parse_constdecl(v1, 0LL);
if ( (unsigned int)lex_get_s() == 600 )
parse_typedecl(v1, 0LL);
if ( (unsigned int)lex_get_s() == 501 )
parse_vardecl(v1, 0LL);
if ( (unsigned int)lex_get_s() != 700 )
{
parser_unexpected(0LL);
skip1(parser_start_complex_operator);
}
free(v1);
return parse_complex_operator(a1, 0LL);
}

canonical_decompiled_code:
__int64 __fastcall func2(__int64 a1)
{
void *v1; // rbx

v1 = (void *)balloc();
bits_disjunct(a1, parser_folls_label, v1);
if ( (unsigned int)lex_get_s() == 708 )
func1((__int64)v1, 0LL);
if ( (unsigned int)lex_get_s() == 705 )
parse_constdecl(v1, 0LL);
if ( (unsigned int)lex_get_s() == 600 )
parse_typedecl(v1, 0LL);
if ( (unsigned int)lex_get_s() == 501 )
parse_vardecl(v1, 0LL);
if ( (unsigned int)lex_get_s() != 700 )
{
parser_unexpected(0LL);
skip1(parser_start_complex_operator);
}
free(v1);
return parse_complex_operator(a1, 0LL);
}

original_code:
void *int_parse_block (unsigned long *folls, unsigned long *ex)
{
    unsigned long *tmp = balloc();
    bits_disjunct(folls, parser_folls_label, tmp);
    if (lex_get_s() == L_LABEL)
        parse_label(tmp, 0);
    if (lex_get_s() == L_CONST)
        parse_constdecl(tmp, 0);
    if (lex_get_s() == L_TYPE)
        parse_typedecl(tmp, 0);
    if (lex_get_s() == L_VAR)
        parse_vardecl(tmp, 0);
    if (lex_get_s() != L_BEGIN)
    {
        parser_unexpected(0);
        skip1(parser_start_complex_operator);
    }
    free(tmp);
    parse_complex_operator(folls, 0);
}

canonical_original_code:
void *int_parse_block(unsigned long *folls, unsigned long *ex)
{
    unsigned long *tmp = balloc();
    bits_disjunct(folls, parser_folls_label, tmp);
    if (lex_get_s() == L_LABEL)
        parse_label(tmp, 0);
    if (lex_get_s() == L_CONST)
        parse_constdecl(tmp, 0);
    if (lex_get_s() == L_TYPE)
        parse_typedecl(tmp, 0);
    if (lex_get_s() == L_VAR)
        parse_vardecl(tmp, 0);
    if (lex_get_s() != L_BEGIN)
    {
        parser_unexpected(0);
        skip1(parser_start_complex_operator);
    }
    free(tmp);
    parse_complex_operator(folls, 0);
}


decompiled_code:
__int64 __fastcall parse_block(__int64 a1, __int64 a2)
{
return parser_exec(parser_start_block, a1, a2, int_parse_block, "block");
}

canonical_decompiled_code:
__int64 __fastcall func3(__int64 a1, __int64 a2)
{
return parser_exec(parser_start_block, a1, a2, int_parse_block, "block");
}

original_code: void *parse_block (unsigned long *folls, unsigned long *ex) { return parser_exec(parser_start_block, folls, ex, int_parse_block, parser_name_block); }

canonical_original_code: void *parse_block(unsigned long *folls, unsigned long *ex) { return parser_exec(parser_start_block, folls, ex, int_parse_block, parser_name_block); }


decompiled_code:
__int64 init_parser_block()
{
if ( !parser_start_label )
parser_start_label = (void *)bits_from_array(&int_start_label);
if ( !parser_folls_label )
parser_folls_label = (void *)bits_from_array(&int_folls_label);
if ( !parser_start_block )
parser_start_block = (void *)bits_from_array(&int_start_block);
if ( !parser_folls_block )
parser_folls_block = (void *)bits_from_array(&int_folls_block);
bits_disjunct(parser_start_block, parser_start_label, parser_start_block);
bits_disjunct(parser_start_block, parser_start_vardecl, parser_start_block);
return bits_disjunct(parser_start_block, parser_start_typedecl, parser_start_block);
}

canonical_decompiled_code:
__int64 func4()
{
if ( !parser_start_label )
parser_start_label = (void *)bits_from_array(&int_start_label);
if ( !parser_folls_label )
parser_folls_label = (void *)bits_from_array(&int_folls_label);
if ( !parser_start_block )
parser_start_block = (void *)bits_from_array(&int_start_block);
if ( !parser_folls_block )
parser_folls_block = (void *)bits_from_array(&int_folls_block);
bits_disjunct(parser_start_block, parser_start_label, parser_start_block);
bits_disjunct(parser_start_block, parser_start_vardecl, parser_start_block);
return bits_disjunct(parser_start_block, parser_start_typedecl, parser_start_block);
}

original_code:
void init_parser_block(void)
{
    { { if (parser_start_label == 0) parser_start_label = bits_from_array(int_start_label); }; { if (parser_folls_label == 0) parser_folls_label = bits_from_array(int_folls_label); }; };
    { { if (parser_start_block == 0) parser_start_block = bits_from_array(int_start_block); }; { if (parser_folls_block == 0) parser_folls_block = bits_from_array(int_folls_block); }; };
    { bits_disjunct(parser_start_block, parser_start_label, parser_start_block); };
    { bits_disjunct(parser_start_block, parser_start_vardecl, parser_start_block); };
    { bits_disjunct(parser_start_block, parser_start_typedecl, parser_start_block); };
}

canonical_original_code:
void init_parser_block()
{
    { { if (parser_start_label == 0) parser_start_label = bits_from_array(int_start_label); }; { if (parser_folls_label == 0) parser_folls_label = bits_from_array(int_folls_label); }; };
    { { if (parser_start_block == 0) parser_start_block = bits_from_array(int_start_block); }; { if (parser_folls_block == 0) parser_folls_block = bits_from_array(int_folls_block); }; };
    { bits_disjunct(parser_start_block, parser_start_label, parser_start_block); };
    { bits_disjunct(parser_start_block, parser_start_vardecl, parser_start_block); };
    { bits_disjunct(parser_start_block, parser_start_typedecl, parser_start_block); };
}


decompiled_code:
void fini_parser_block()
{
if ( parser_start_label )
free(parser_start_label);
if ( parser_folls_label )
free(parser_folls_label);
if ( parser_start_block )
free(parser_start_block);
if ( parser_folls_block )
free(parser_folls_block);
}

canonical_decompiled_code:
void func5()
{
if ( parser_start_label )
free(parser_start_label);
if ( parser_folls_label )
free(parser_folls_label);
if ( parser_start_block )
free(parser_start_block);
if ( parser_folls_block )
free(parser_folls_block);
}

original_code:
void fini_parser_block(void)
{
    { { if (parser_start_label != 0) free(parser_start_label); }; { if (parser_folls_label != 0) free(parser_folls_label); }; };
    { { if (parser_start_block != 0) free(parser_start_block); }; { if (parser_folls_block != 0) free(parser_folls_block); }; };
}

canonical_original_code:
void fini_parser_block()
{
    { { if (parser_start_label != 0) free(parser_start_label); }; { if (parser_folls_label != 0) free(parser_folls_label); }; };
    { { if (parser_start_block != 0) free(parser_start_block); }; { if (parser_folls_block != 0) free(parser_folls_block); }; };
}


isnum

decompiled_code:
__int64 __fastcall isnum(char *a1)
{
char v1; // bl
char *v2; // rbp
int v3; // er12
char *v4; // rax
const unsigned __int16 **v5; // rdx

v1 = *a1;
if ( !*a1 )
return 1LL;
v2 = a1 + 1;
v3 = 0;
while ( 1 )
{
if ( ((v1 - 43) & 0xFD) == 0 )
{
if ( v3 )
return 0LL;
v4 = v2;
v3 = 1;
goto LABEL_5;
}
v5 = _ctype_b_loc();
v4 = v2;
if ( ((*v5)[v1] & 0x800) == 0 )
return 0LL;
LABEL_5:
v1 = *v4;
++v2;
if ( !*v4 )
return 1LL;
}
}

canonical_decompiled_code:
__int64 __fastcall func0(char *a1)
{
char v1; // bl
char *v2; // rbp
int v3; // er12
char *v4; // rax
const unsigned __int16 **v5; // rdx

v1 = *a1;
if ( !*a1 )
return 1LL;
v2 = a1 + 1;
v3 = 0;
while ( 1 )
{
if ( ((v1 - 43) & 0xFD) == 0 )
{
if ( v3 )
return 0LL;
v4 = v2;
v3 = 1;
goto LABEL_5;
}
v5 = _ctype_b_loc();
v4 = v2;
if ( ((*v5)[v1] & 0x800) == 0 )
return 0LL;
LABEL_5:
v1 = *v4;
++v2;
if ( !*v4 )
return 1LL;
}
}

original_code:
static int isnum(const char *s)
{
 int si = 0;
 while(*s)
 {
  if((*s == '-') || (*s == '+'))
  {
   if(!si)
   {
    si = 1;
    s++;
    continue;
   }
   else return 0;
  }
  if(!((*__ctype_b_loc ())[(int) ((*s++))] & (unsigned short int) _ISdigit))
   return 0;
 }
 return 1;
}

canonical_original_code:
static int isnum(char *s)
{
 int si = 0;
 while(*s)
 {
  if((*s == '-') || (*s == '+'))
  {
   if(!si)
   {
    si = 1;
    s++;
    continue;
   }
   else return 0;
  }
  if(!((*__ctype_b_loc ())[(int) ((*s++))] & (unsigned short) _ISdigit))
   return 0;
 }
 return 1;
}

variable_types:
s
char *

variable_types: si int

return_type: int


isidsym

decompiled_code:
__int64 __fastcall isidsym(char a1)
{
return ((a1 == 95) | (unsigned __int8)((*_ctype_b_loc())[a1] >> 3)) & 1;
}

canonical_decompiled_code:
__int64 __fastcall func1(char a1)
{
return ((a1 == 95) | (unsigned __int8)((*_ctype_b_loc())[a1] >> 3)) & 1;
}

original_code:
static int isidsym(char c)
{
 return (((*__ctype_b_loc ())[(int) ((c))] & (unsigned short int) _ISalnum)||(c == '_'));
}

canonical_original_code:
static int isidsym(char c)
{
 return (((*__ctype_b_loc ())[(int) ((c))] & (unsigned short) _ISalnum)||(c == '_'));
}

variable_types: c char


isident

decompiled_code:
__int64 __fastcall isident(char *a1)
{
__int64 result; // rax
_BYTE *v2; // rbx
char v3; // di

if ( ((*_ctype_b_loc())[*a1] & 0x400) != 0 || (result = 0LL, *a1 == 95) )
{
v2 = a1 + 1;
v3 = a1[1];
if ( v3 )
{
while ( 1 )
{
result = isidsym(v3);
if ( !(_DWORD)result )
break;
v3 = *++v2;
if ( !*v2 )
return 1LL;
}
}
else
{
result = 1LL;
}
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func2(char *a1)
{
__int64 result; // rax
_BYTE *v2; // rbx
char v3; // di

if ( ((*_ctype_b_loc())[*a1] & 0x400) != 0 || (result = 0LL, *a1 == 95) )
{
v2 = a1 + 1;
v3 = a1[1];
if ( v3 )
{
while ( 1 )
{
result = func1(v3);
if ( !(_DWORD)result )
break;
v3 = *++v2;
if ( !*v2 )
return 1LL;
}
}
else
{
result = 1LL;
}
}
return result;
}

original_code:
static int isident(const char *s)
{
 if ((!((*__ctype_b_loc ())[(int) ((*s))] & (unsigned short int) _ISalpha)) && (*s != '_'))
  return 0;
 s++;
 while(*s)
 {
  if(!isidsym(*s))
   return 0;
  s++;
 }
 return 1;
}

canonical_original_code:
static int isident(char *s)
{
 if ((!((*__ctype_b_loc ())[(int) ((*s))] & (unsigned short) _ISalpha)) && (*s != '_'))
  return 0;
 s++;
 while(*s)
 {
  if(!isidsym(*s))
   return 0;
  s++;
 }
 return 1;
}


isfloat

decompiled_code:
__int64 __fastcall isfloat(char *a1)
{
char v1; // bp
char *v2; // rbx
int v3; // er14
int v4; // er15
int v5; // er12
const __int32_t *v6; // rdx
char v7; // al
int v9; // [rsp+Ch] [rbp-3Ch]

v1 = *a1;
if ( !*a1 )
return 1LL;
v2 = a1;
v3 = 0;
v9 = 0;
v4 = 0;
v5 = 0;
while ( 1 )
{
if ( (unsigned __int8)get_dec_point() == v1 )
{
if ( v3 || !v5 )
return 0LL;
v5 = 1;
v3 = 1;
goto LABEL_6;
}
v6 = *_ctype_tolower_loc();
v7 = *v2;
if ( v6[*v2] == 101 && v5 )
{
if ( v4 )
return 0LL;
v5 = 1;
v4 = 1;
goto LABEL_6;
}
if ( ((v7 - 43) & 0xFD) != 0 )
break;
if ( v9 || !v4 )
return 0LL;
if ( v6[*(v2 - 1)] != 101 )
return 0LL;
v9 = 1;
LABEL_6:
v1 = *++v2;
if ( !*v2 )
return 1LL;
}
if ( ((*_ctype_b_loc())[v7] & 0x800) != 0 )
{
v5 = 1;
goto LABEL_6;
}
return 0LL;
}

canonical_decompiled_code:
__int64 __fastcall func3(char *a1)
{
char v1; // bp
char *v2; // rbx
int v3; // er14
int v4; // er15
int v5; // er12
const __int32_t *v6; // rdx
char v7; // al
int v9; // [rsp+Ch] [rbp-3Ch]

v1 = *a1;
if ( !*a1 )
return 1LL;
v2 = a1;
v3 = 0;
v9 = 0;
v4 = 0;
v5 = 0;
while ( 1 )
{
if ( (unsigned __int8)get_dec_point() == v1 )
{
if ( v3 || !v5 )
return 0LL;
v5 = 1;
v3 = 1;
goto LABEL_6;
}
v6 = *_ctype_tolower_loc();
v7 = *v2;
if ( v6[*v2] == 101 && v5 )
{
if ( v4 )
return 0LL;
v5 = 1;
v4 = 1;
goto LABEL_6;
}
if ( ((v7 - 43) & 0xFD) != 0 )
break;
if ( v9 || !v4 )
return 0LL;
if ( v6[*(v2 - 1)] != 101 )
return 0LL;
v9 = 1;
LABEL_6:
v1 = *++v2;
if ( !*v2 )
return 1LL;
}
if ( ((*_ctype_b_loc())[v7] & 0x800) != 0 )
{
v5 = 1;
goto LABEL_6;
}
return 0LL;
}

original_code:
static int isfloat(const char *s)
{
 int p = 0;
 int e = 0;
 int si = 0;
 int n = 0;
 while(*s)
 {
  if(*s == get_dec_point())
  {
   if((p == 0)&&(n == 1))
    p = 1;
   else
    return 0;
  } else if((tolower(*s) == 'e')&&(n == 1)) {
   if(e == 0)
    e = 1;
   else
    return 0;
  } else if((*s == '-')||(*s == '+')) {
   if((si == 0) && (e != 0) && (tolower(*(s - 1)) == 'e'))
    si = 1;
   else
    return 0;
  } else if(!((*__ctype_b_loc ())[(int) ((*s))] & (unsigned short int) _ISdigit)) {
   return 0;
  } else n = 1;
  s++;
 }
 return 1;
}

canonical_original_code:
static int isfloat(char *s)
{
 int p = 0;
 int e = 0;
 int si = 0;
 int n = 0;
 while(*s)
 {
  if(*s == get_dec_point())
  {
   if((p == 0)&&(n == 1))
    p = 1;
   else
    return 0;
  } else if((tolower(*s) == 'e')&&(n == 1)) {
   if(e == 0)
    e = 1;
   else
    return 0;
  } else if((*s == '-')||(*s == '+')) {
   if((si == 0) && (e != 0) && (tolower(*(s - 1)) == 'e'))
    si = 1;
   else
    return 0;
  } else if(!((*__ctype_b_loc ())[(int) ((*s))] & (unsigned short) _ISdigit)) {
   return 0;
  } else n = 1;
  s++;
 }
 return 1;
}

variable_types: p int

variable_types: e int

variable_types: n int


decompiled_code:
__int64 __fastcall sym_get_code(char *s1)
{
__int64 i; // rbx
unsigned int v2; // ebx

for ( i = 0LL; i != 71; ++i )
{
if ( !strncasecmp(s1, (&off_488)[2 * i], 0x64uLL) )
return (unsigned int)sym_bols[4 * (int)i];
}
v2 = 1001;
if ( !(unsigned int)isnum(s1) )
{
v2 = 1002;
if ( !(unsigned int)isfloat(s1) )
{
v2 = isident(s1);
if ( v2 )
v2 = 1000;
else
err_include(3LL, "SYM : unknown symbol", 0LL, lex_line, lex_c);
}
}
return v2;
}

canonical_decompiled_code:
__int64 __fastcall func4(char *s1)
{
__int64 i; // rbx
unsigned int v2; // ebx

for ( i = 0LL; i != 71; ++i )
{
if ( !strncasecmp(s1, (&off_488)[2 * i], 0x64uLL) )
return (unsigned int)sym_bols[4 * (int)i];
}
v2 = 1001;
if ( !(unsigned int)func0(s1) )
{
v2 = 1002;
if ( !(unsigned int)func3(s1) )
{
v2 = func2(s1);
if ( v2 )
v2 = 1000;
else
err_include(3LL, "SYM : unknown symbol", 0LL, lex_line, lex_c);
}
}
return v2;
}

original_code:
int sym_get_code(const char *sym)
{
 int i;
 for(i = 0; i < sym_count; i++)
 {
  if(!strncasecmp(sym, sym_bols[i].sym, 100))
  {
   return sym_bols[i].code;
  }
 }
 if(isnum(sym))
  return L_NUMERIC;
 if(isfloat(sym))
  return L_FLOAT;
 if(isident(sym))
  return L_IDENT;
 err_include(ERROR, "SYM : unknown symbol", 0, lex_line, lex_c);
 return 0;
}

canonical_original_code:
int sym_get_code(char *sym)
{
 int i;
 for(i = 0; i < sym_count; i++)
 {
  if(!strncasecmp(sym, sym_bols[i].sym, 100))
  {
   return sym_bols[i].code;
  }
 }
 if(isnum(sym))
  return L_NUMERIC;
 if(isfloat(sym))
  return L_FLOAT;
 if(isident(sym))
  return L_IDENT;
 err_include(ERROR, "SYM : unknown symbol", 0, lex_line, lex_c);
 return 0;
}

variable_types:
sym
char *


decompiled_code:
char *__fastcall sym_get_sym(int a1)
{
__int64 v1; // rax

v1 = 0LL;
while ( sym_bols[4 * v1] != a1 )
{
if ( ++v1 == 71 )
{
err_include(3LL, "SYM : unknown code", 0LL, lex_line, lex_c);
return 0LL;
}
}
return (&off_488)[2 * (int)v1];
}

canonical_decompiled_code:
char *__fastcall func5(int a1)
{
__int64 v1; // rax

v1 = 0LL;
while ( sym_bols[4 * v1] != a1 )
{
if ( ++v1 == 71 )
{
err_include(3LL, "SYM : unknown code", 0LL, lex_line, lex_c);
return 0LL;
}
}
return (&off_488)[2 * (int)v1];
}

original_code:
char *sym_get_sym(int code)
{
 int i;
 for(i = 0; i < sym_count; i++)
 {
  if(code == sym_bols[i].code)
  {
   return sym_bols[i].sym;
  }
 }
 err_include(ERROR, "SYM : unknown code", 0, lex_line, lex_c);
 return 0;
}

variable_types: code int

return_type: char *


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

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

canonical_original_code:
struct _type_table_elem *search_type_table()
{
    return 0;
}

return_type: struct _type_table_elem { enum USE_TYPE { UT_SCALAR=5000, UT_LIMITED=5001, UT_ENUM=5002, UT_ARRAY=5003, UT_RECORD=5004, UT_REFERENCE=5005, UT_SET=5006, UT_FILE=5007 } utype; struct _type_table_elem *base; union { struct _list { void *value; struct _list *next; } *constants; struct _list *indexes; struct { unsigned long min; }; }; } *