decompiled_code:
__int64 __fastcall event_kind(__int64 a1, int *a2)
{
unsigned int v2; // eax
const char ***v3; // rdx
const char **v4; // r12
void *v5; // r13
__int64 result; // rax
unsigned int v7; // eax
_QWORD *v8; // rdx
void *v9; // r13
unsigned int v10; // eax
const void **v11; // rdx
const void *v12; // r12
unsigned int v13; // eax
const void **v14; // rdx
__int64 v15; // r12
unsigned int v16; // edx
__int64 v17; // rax
__int64 v18; // rcx
const void *v19; // r13
const void **v20; // rax
__int64 v21; // r12
const void **v22; // rdx

fprintf(
stderr,
"%p event_kind {actor:%p, msg:%p}\n",
(const void *)a1,
*(const void **)(a1 + 8),
*(const void **)(a1 + 16));
v2 = *a2;
if ( (unsigned int)*a2 > 0x2F )
{
v3 = (const char ***)*((_QWORD *)a2 + 1);
*((_QWORD *)a2 + 1) = v3 + 1;
}
else
{
v3 = (const char ***)(*((_QWORD *)a2 + 2) + v2);
*a2 = v2 + 8;
}
v4 = *v3;
fprintf(stderr, " %p: cmd=%p \"%s\"\n", (const void *)a1, v4, v4[1]);
if ( v4 == (const char **)&eq_p_symbol )
{
v7 = *a2;
if ( (unsigned int)*a2 > 0x2F )
{
v8 = (_QWORD *)*((_QWORD *)a2 + 1);
*((_QWORD *)a2 + 1) = v8 + 1;
}
else
{
v8 = (_QWORD *)(*((_QWORD *)a2 + 2) + v7);
*a2 = v7 + 8;
}
v9 = &t_symbol;
if ( a1 != *v8 )
v9 = &f_symbol;
result = (__int64)v9;
}
else
{
if ( v4 != (const char **)&dispatch_x_symbol )
{
if ( v4 == (const char **)&create_x_symbol )
{
v13 = *a2;
if ( (unsigned int)*a2 > 0x2F )
{
v14 = (const void **)*((_QWORD *)a2 + 1);
*((_QWORD *)a2 + 1) = v14 + 1;
}
else
{
v14 = (const void **)(*((_QWORD *)a2 + 2) + v13);
*a2 = v13 + 8;
}
v15 = (__int64)*v14;
fprintf(stderr, " %p: create {beh:%p}\n", (const void *)a1, *v14);
v5 = (void *)actor_new(v15);
*(_QWORD *)(a1 + 24) = object_call(*(_QWORD *)(a1 + 24), &push_symbol);
return (__int64)v5;
}
if ( v4 != (const char **)&send_x_symbol )
{
v5 = &undef_object;
if ( v4 == (const char **)&become_x_symbol )
{
v10 = *a2;
if ( (unsigned int)*a2 > 0x2F )
{
v11 = (const void **)*((_QWORD *)a2 + 1);
*((_QWORD *)a2 + 1) = v11 + 1;
}
else
{
v11 = (const void **)(*((_QWORD *)a2 + 2) + v10);
*a2 = v10 + 8;
}
v5 = (void *)*v11;
fprintf(stderr, " %p: become {beh:%p}\n", (const void *)a1, *v11);
*(_QWORD *)(a1 + 40) = v5;
}
return (__int64)v5;
}
v16 = *a2;
if ( (unsigned int)*a2 > 0x2F )
{
v22 = (const void **)*((_QWORD *)a2 + 1);
v20 = v22 + 1;
*((_QWORD *)a2 + 1) = v22 + 1;
v19 = *v22;
}
else
{
v17 = *((_QWORD *)a2 + 2);
v18 = v16 + 8;
*a2 = v18;
v19 = *(const void **)(v17 + v16);
if ( (unsigned int)v18 <= 0x2F )
{
v20 = (const void **)(v18 + v17);
*a2 = v16 + 16;
LABEL_26:
v21 = (__int64)*v20;
fprintf(stderr, " %p: send {actor:%p, msg:%p}\n", (const void *)a1, v19, *v20);
v5 = (void *)event_new((__int64)v19, v21);
*(_QWORD *)(a1 + 32) = object_call(*(_QWORD *)(a1 + 32), &push_symbol);
return (__int64)v5;
}
v20 = (const void **)*((_QWORD *)a2 + 1);
}
*((_QWORD *)a2 + 1) = v20 + 1;
goto LABEL_26;
}
v12 = *(const void **)(*(_QWORD *)(a1 + 8) + 8LL);
fprintf(stderr, " %p: dispatch {beh:%p}\n", (const void *)a1, v12);
*(_QWORD *)(a1 + 40) = v12;
*(_QWORD *)(a1 + 24) = &nil_object;
*(_QWORD *)(a1 + 32) = &nil_object;
result = object_call(v12, a1);
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func7(__int64 a1, int *a2)
{
unsigned int v2; // eax
const char ***v3; // rdx
const char **v4; // r12
void *v5; // r13
__int64 result; // rax
unsigned int v7; // eax
_QWORD *v8; // rdx
void *v9; // r13
unsigned int v10; // eax
const void **v11; // rdx
const void *v12; // r12
unsigned int v13; // eax
const void **v14; // rdx
__int64 v15; // r12
unsigned int v16; // edx
__int64 v17; // rax
__int64 v18; // rcx
const void *v19; // r13
const void **v20; // rax
__int64 v21; // r12
const void **v22; // rdx

fprintf(
stderr,
"%p event_kind {actor:%p, msg:%p}\n",
(const void *)a1,
*(const void **)(a1 + 8),
*(const void **)(a1 + 16));
v2 = *a2;
if ( (unsigned int)*a2 > 0x2F )
{
v3 = (const char ***)*((_QWORD *)a2 + 1);
*((_QWORD *)a2 + 1) = v3 + 1;
}
else
{
v3 = (const char ***)(*((_QWORD *)a2 + 2) + v2);
*a2 = v2 + 8;
}
v4 = *v3;
fprintf(stderr, " %p: cmd=%p \"%s\"\n", (const void *)a1, v4, v4[1]);
if ( v4 == (const char **)&eq_p_symbol )
{
v7 = *a2;
if ( (unsigned int)*a2 > 0x2F )
{
v8 = (_QWORD *)*((_QWORD *)a2 + 1);
*((_QWORD *)a2 + 1) = v8 + 1;
}
else
{
v8 = (_QWORD *)(*((_QWORD *)a2 + 2) + v7);
*a2 = v7 + 8;
}
v9 = &t_symbol;
if ( a1 != *v8 )
v9 = &f_symbol;
result = (__int64)v9;
}
else
{
if ( v4 != (const char **)&dispatch_x_symbol )
{
if ( v4 == (const char **)&create_x_symbol )
{
v13 = *a2;
if ( (unsigned int)*a2 > 0x2F )
{
v14 = (const void **)*((_QWORD *)a2 + 1);
*((_QWORD *)a2 + 1) = v14 + 1;
}
else
{
v14 = (const void **)(*((_QWORD *)a2 + 2) + v13);
*a2 = v13 + 8;
}
v15 = (__int64)*v14;
fprintf(stderr, " %p: create {beh:%p}\n", (const void *)a1, *v14);
v5 = (void *)func5(v15);
*(_QWORD *)(a1 + 24) = object_call(*(_QWORD *)(a1 + 24), &push_symbol);
return (__int64)v5;
}
if ( v4 != (const char **)&send_x_symbol )
{
v5 = &undef_object;
if ( v4 == (const char **)&become_x_symbol )
{
v10 = *a2;
if ( (unsigned int)*a2 > 0x2F )
{
v11 = (const void **)*((_QWORD *)a2 + 1);
*((_QWORD *)a2 + 1) = v11 + 1;
}
else
{
v11 = (const void **)(*((_QWORD *)a2 + 2) + v10);
*a2 = v10 + 8;
}
v5 = (void *)*v11;
fprintf(stderr, " %p: become {beh:%p}\n", (const void *)a1, *v11);
*(_QWORD *)(a1 + 40) = v5;
}
return (__int64)v5;
}
v16 = *a2;
if ( (unsigned int)*a2 > 0x2F )
{
v22 = (const void **)*((_QWORD *)a2 + 1);
v20 = v22 + 1;
*((_QWORD *)a2 + 1) = v22 + 1;
v19 = *v22;
}
else
{
v17 = *((_QWORD *)a2 + 2);
v18 = v16 + 8;
*a2 = v18;
v19 = *(const void **)(v17 + v16);
if ( (unsigned int)v18 <= 0x2F )
{
v20 = (const void **)(v18 + v17);
*a2 = v16 + 16;
LABEL_26:
v21 = (__int64)*v20;
fprintf(stderr, " %p: send {actor:%p, msg:%p}\n", (const void *)a1, v19, *v20);
v5 = (void *)func6((__int64)v19, v21);
*(_QWORD *)(a1 + 32) = object_call(*(_QWORD *)(a1 + 32), &push_symbol);
return (__int64)v5;
}
v20 = (const void **)*((_QWORD *)a2 + 1);
}
*((_QWORD *)a2 + 1) = v20 + 1;
goto LABEL_26;
}
v12 = *(const void **)(*(_QWORD *)(a1 + 8) + 8LL);
fprintf(stderr, " %p: dispatch {beh:%p}\n", (const void *)a1, v12);
*(_QWORD *)(a1 + 40) = v12;
*(_QWORD *)(a1 + 24) = &nil_object;
*(_QWORD *)(a1 + 32) = &nil_object;
result = object_call(v12, a1);
}
return result;
}

original_code:
OOP event_kind(OOP self, va_list args)
{
    struct event * this = ((struct event *)(self));
    fprintf(stderr, "%p event_kind {actor:%p, msg:%p}\n", this, this->actor, this->msg);
    OOP cmd = __builtin_va_arg(args,OOP);
    fprintf(stderr, "  %p: cmd=%p \"%s\"\n", this, cmd, ((struct symbol *)(cmd))->s);
    if (cmd == ((OOP)&eq_p_symbol)) {
        OOP other = __builtin_va_arg(args,OOP);
        if (other == self) {
            return ((OOP)&_t_symbol);
        }
        return ((OOP)&_f_symbol);
    } else if (cmd == ((OOP)&dispatch_x_symbol)) {
        OOP beh = ((struct actor *)(this->actor))->beh;
        fprintf(stderr, "  %p: dispatch {beh:%p}\n", this, beh);
        this->actors = ((OOP)&nil_object);
        this->events = ((OOP)&nil_object);
        this->beh = beh;
        return object_call(beh, this);
    } else if (cmd == ((OOP)&create_x_symbol)) {
        OOP beh = __builtin_va_arg(args,OOP);
        fprintf(stderr, "  %p: create {beh:%p}\n", this, beh);
        OOP actor = actor_new(beh);
        this->actors = object_call(this->actors, ((OOP)&push_symbol), actor);
        return actor;
    } else if (cmd == ((OOP)&send_x_symbol)) {
        OOP actor = __builtin_va_arg(args,OOP);
        OOP msg = __builtin_va_arg(args,OOP);
        fprintf(stderr, "  %p: send {actor:%p, msg:%p}\n", this, actor, msg);
        OOP event = event_new(actor, msg);
        this->events = object_call(this->events, ((OOP)&push_symbol), event);
        return event;
    } else if (cmd == ((OOP)&become_x_symbol)) {
        OOP beh = __builtin_va_arg(args,OOP);
        fprintf(stderr, "  %p: become {beh:%p}\n", this, beh);
        this->beh = beh;
        return beh;
    }
    return ((OOP)&undef_object);
}

canonical_original_code:
struct object *event_kind(struct object *self, __builtin_va_list args)
{
    struct event *this = ((struct event *)(self));
    fprintf(stderr, "%p event_kind {actor:%p, msg:%p}\n", this, this->actor, this->msg);
    struct object *cmd = __builtin_va_arg(args,OOP);
    fprintf(stderr, "  %p: cmd=%p \"%s\"\n", this, cmd, ((struct symbol *)(cmd))->s);
    if (cmd == ((OOP)&eq_p_symbol)) {
        struct object *other = __builtin_va_arg(args,OOP);
        if (other == self) {
            return ((OOP)&_t_symbol);
        }
        return ((OOP)&_f_symbol);
    } else if (cmd == ((OOP)&dispatch_x_symbol)) {
        struct object *beh = ((struct actor *)(this->actor))->beh;
        fprintf(stderr, "  %p: dispatch {beh:%p}\n", this, beh);
        this->actors = ((OOP)&nil_object);
        this->events = ((OOP)&nil_object);
        this->beh = beh;
        return object_call(beh, this);
    } else if (cmd == ((OOP)&create_x_symbol)) {
        struct object *beh = __builtin_va_arg(args,OOP);
        fprintf(stderr, "  %p: create {beh:%p}\n", this, beh);
        struct object *actor = actor_new(beh);
        this->actors = object_call(this->actors, ((OOP)&push_symbol), actor);
        return actor;
    } else if (cmd == ((OOP)&send_x_symbol)) {
        struct object *actor = __builtin_va_arg(args,OOP);
        struct object *msg = __builtin_va_arg(args,OOP);
        fprintf(stderr, "  %p: send {actor:%p, msg:%p}\n", this, actor, msg);
        struct object *event = event_new(actor, msg);
        this->events = object_call(this->events, ((OOP)&push_symbol), event);
        return event;
    } else if (cmd == ((OOP)&become_x_symbol)) {
        struct object *beh = __builtin_va_arg(args,OOP);
        fprintf(stderr, "  %p: become {beh:%p}\n", this, beh);
        this->beh = beh;
        return beh;
    }
    return ((OOP)&undef_object);
}


repo: organix/art

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

result = object_new(forward_beh_kind, 16LL);
*(_QWORD *)(result + 8) = a1;
return result;
}

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

result = object_new(forward_beh_kind, 16LL);
*(_QWORD *)(result + 8) = a1;
return result;
}

original_code:
OOP
forward_beh_new(OOP target)
{
    struct forward_beh * this = ((struct forward_beh *)object_new((forward_beh_kind), sizeof(struct forward_beh)));
    this->target = target;
    return (OOP)this;
}

canonical_original_code:
struct object *forward_beh_new(struct object *target)
{
    struct forward_beh *this = ((struct forward_beh *)object_new((forward_beh_kind), sizeof(struct forward_beh)));
    this->target = target;
    return (struct object *)this;
}

variable_types:
target
struct object *

variable_types: struct forward_beh { struct object { struct object *(*kind)(struct object *self, __builtin_va_list args); } o; struct object *target; } *

return_type: struct object { struct object *(*kind)(struct object *self, __builtin_va_list args); } *

user_defined_types: struct forward_beh { struct object o; struct object *target; }


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

result = object_new(one_shot_beh_kind, 16LL);
*(_QWORD *)(result + 8) = a1;
return result;
}

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

result = object_new(one_shot_beh_kind, 16LL);
*(_QWORD *)(result + 8) = a1;
return result;
}

original_code:
OOP
one_shot_beh_new(OOP target)
{
    struct forward_beh * this = ((struct forward_beh *)object_new((one_shot_beh_kind), sizeof(struct forward_beh)));
    this->target = target;
    return (OOP)this;
}

canonical_original_code:
struct object *one_shot_beh_new(struct object *target)
{
    struct forward_beh *this = ((struct forward_beh *)object_new((one_shot_beh_kind), sizeof(struct forward_beh)));
    this->target = target;
    return (struct object *)this;
}

user_defined_types: struct object { struct object *(*kind)(struct object *self, __builtin_va_list args); }


decompiled_code:
__int64 config_new()
{
__int64 v0; // r12
__int64 v1; // rax

v0 = object_new(config_kind, 24LL);
v1 = queue_new();
*(_QWORD *)(v0 + 16) = &0_integer;
*(_QWORD *)(v0 + 8) = v1;
return v0;
}

canonical_decompiled_code:
__int64 func10()
{
__int64 v0; // r12
__int64 v1; // rax

v0 = object_new(config_kind, 24LL);
v1 = queue_new();
*(_QWORD *)(v0 + 16) = &0_integer;
*(_QWORD *)(v0 + 8) = v1;
return v0;
}

original_code:
OOP
config_new()
{
    struct config * this = ((struct config *)object_new((config_kind), sizeof(struct config)));
    this->events = queue_new();
    this->remain = ((OOP)&_0_integer);
    return (OOP)this;
}

canonical_original_code:
struct object *config_new()
{
    struct config *this = ((struct config *)object_new((config_kind), sizeof(struct config)));
    this->events = queue_new();
    this->remain = ((OOP)&_0_integer);
    return (struct object *)this;
}

variable_types: struct config { struct object { struct object *(*kind)(struct object *self, __builtin_va_list args); } o; struct object *events; struct object *remain; } *

user_defined_types: struct config { struct object o; struct object *events; struct object *remain; }


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

result = object_new(pair_kind, 24LL);
*(_QWORD *)(result + 8) = a1;
*(_QWORD *)(result + 16) = a2;
return result;
}

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

result = object_new(pair_kind, 24LL);
*(_QWORD *)(result + 8) = a1;
*(_QWORD *)(result + 16) = a2;
return result;
}

original_code:
OOP
pair_new(OOP h, OOP t)
{
    struct pair * this = ((struct pair *)object_new((pair_kind), sizeof(struct pair)));
    this->h = h;
    this->t = t;
    return (OOP)this;
}

canonical_original_code:
struct object *pair_new(struct object *h, struct object *t)
{
    struct pair *this = ((struct pair *)object_new((pair_kind), sizeof(struct pair)));
    this->h = h;
    this->t = t;
    return (struct object *)this;
}

variable_types:
h
struct object *

variable_types:
t
struct object *

variable_types: struct pair { struct object { struct object *(*kind)(struct object *self, __builtin_va_list args); } o; struct object *h; struct object *t; } *

user_defined_types: struct pair { struct object o; struct object *h; struct object *t; }


decompiled_code:
void *__fastcall nil_kind(__int64 a1, int *a2)
{
unsigned int v2; // eax
__int64 v3; // rcx
__int64 v4; // r8
void **v5; // rdx
void *result; // rax
void **v7; // rax
_QWORD *v8; // rcx
unsigned int v9; // eax
__int64 *v10; // rdx

v2 = *a2;
if ( (unsigned int)*a2 <= 0x2F )
{
v3 = *((_QWORD *)a2 + 2);
v4 = v2 + 8;
*a2 = v4;
v5 = *(void ***)(v3 + v2);
if ( v5 != (void **)&eq_p_symbol )
goto LABEL_3;
if ( (unsigned int)v4 <= 0x2F )
{
v8 = (_QWORD *)(v4 + v3);
*a2 = v2 + 16;
LABEL_8:
result = &f_symbol;
if ( a1 != *v8 )
return result;
return &t_symbol;
}
v8 = (_QWORD *)*((_QWORD *)a2 + 1);
LABEL_7:
*((_QWORD *)a2 + 1) = v8 + 1;
goto LABEL_8;
}
v7 = (void **)*((_QWORD *)a2 + 1);
v8 = v7 + 1;
*((_QWORD *)a2 + 1) = v7 + 1;
v5 = (void **)*v7;
if ( *v7 == &eq_p_symbol )
goto LABEL_7;
LABEL_3:
if ( v5 == &empty_p_symbol )
return &t_symbol;
result = &undef_object;
if ( v5 == &push_symbol )
{
v9 = *a2;
if ( (unsigned int)*a2 > 0x2F )
{
v10 = (__int64 *)*((_QWORD *)a2 + 1);
*((_QWORD *)a2 + 1) = v10 + 1;
}
else
{
v10 = (__int64 *)(*((_QWORD *)a2 + 2) + v9);
*a2 = v9 + 8;
}
result = (void *)pair_new(*v10, a1);
}
return result;
}

canonical_decompiled_code:
void *__fastcall func1(__int64 a1, int *a2)
{
unsigned int v2; // eax
__int64 v3; // rcx
__int64 v4; // r8
void **v5; // rdx
void *result; // rax
void **v7; // rax
_QWORD *v8; // rcx
unsigned int v9; // eax
__int64 *v10; // rdx

v2 = *a2;
if ( (unsigned int)*a2 <= 0x2F )
{
v3 = *((_QWORD *)a2 + 2);
v4 = v2 + 8;
*a2 = v4;
v5 = *(void ***)(v3 + v2);
if ( v5 != (void **)&eq_p_symbol )
goto LABEL_3;
if ( (unsigned int)v4 <= 0x2F )
{
v8 = (_QWORD *)(v4 + v3);
*a2 = v2 + 16;
LABEL_8:
result = &f_symbol;
if ( a1 != *v8 )
return result;
return &t_symbol;
}
v8 = (_QWORD *)*((_QWORD *)a2 + 1);
LABEL_7:
*((_QWORD *)a2 + 1) = v8 + 1;
goto LABEL_8;
}
v7 = (void **)*((_QWORD *)a2 + 1);
v8 = v7 + 1;
*((_QWORD *)a2 + 1) = v7 + 1;
v5 = (void **)*v7;
if ( *v7 == &eq_p_symbol )
goto LABEL_7;
LABEL_3:
if ( v5 == &empty_p_symbol )
return &t_symbol;
result = &undef_object;
if ( v5 == &push_symbol )
{
v9 = *a2;
if ( (unsigned int)*a2 > 0x2F )
{
v10 = (__int64 *)*((_QWORD *)a2 + 1);
*((_QWORD *)a2 + 1) = v10 + 1;
}
else
{
v10 = (__int64 *)(*((_QWORD *)a2 + 2) + v9);
*a2 = v9 + 8;
}
result = (void *)func0(*v10, a1);
}
return result;
}

original_code:
static OOP nil_kind(OOP self, va_list args)
{
    OOP cmd = __builtin_va_arg(args,OOP);
    if (cmd == ((OOP)&eq_p_symbol)) {
        OOP other = __builtin_va_arg(args,OOP);
        if (other == self) {
            return ((OOP)&_t_symbol);
        }
        return ((OOP)&_f_symbol);
    } else if (cmd == ((OOP)&empty_p_symbol)) {
        return ((OOP)&_t_symbol);
    } else if (cmd == ((OOP)&push_symbol)) {
        OOP x = __builtin_va_arg(args,OOP);
        return pair_new(x, self);
    }
    return ((OOP)&undef_object);
}

canonical_original_code:
static struct object *nil_kind(struct object *self, __builtin_va_list args)
{
    struct object *cmd = __builtin_va_arg(args,OOP);
    if (cmd == ((OOP)&eq_p_symbol)) {
        struct object *other = __builtin_va_arg(args,OOP);
        if (other == self) {
            return ((OOP)&_t_symbol);
        }
        return ((OOP)&_f_symbol);
    } else if (cmd == ((OOP)&empty_p_symbol)) {
        return ((OOP)&_t_symbol);
    } else if (cmd == ((OOP)&push_symbol)) {
        struct object *x = __builtin_va_arg(args,OOP);
        return pair_new(x, self);
    }
    return ((OOP)&undef_object);
}

variable_types:
self
struct object *

variable_types: struct object { struct object *(*kind)(struct object *self, __builtin_va_list args); } *


decompiled_code:
void *__fastcall pair_kind(__int64 a1, int *a2)
{
unsigned int v2; // edx
__int64 v3; // rcx
__int64 v4; // r8
void **v5; // rax
void *v6; // r8
void **v8; // rax
_QWORD *v9; // rcx
_QWORD *v10; // rcx
unsigned int v11; // eax
__int64 *v12; // rdx

v2 = *a2;
if ( (unsigned int)*a2 <= 0x2F )
{
v3 = *((_QWORD *)a2 + 2);
v4 = v2 + 8;
*a2 = v4;
v5 = *(void ***)(v3 + v2);
if ( v5 != (void **)&eq_p_symbol )
goto LABEL_3;
if ( (unsigned int)v4 <= 0x2F )
{
v10 = (_QWORD *)(v4 + v3);
v6 = &t_symbol;
*a2 = v2 + 16;
if ( a1 == *v10 )
return v6;
return &f_symbol;
}
v9 = (_QWORD *)*((_QWORD *)a2 + 1);
LABEL_8:
v6 = &t_symbol;
*((_QWORD *)a2 + 1) = v9 + 1;
if ( a1 == *v9 )
return v6;
return &f_symbol;
}
v8 = (void **)*((_QWORD *)a2 + 1);
v9 = v8 + 1;
*((_QWORD *)a2 + 1) = v8 + 1;
v5 = (void **)*v8;
if ( v5 == (void **)&eq_p_symbol )
goto LABEL_8;
LABEL_3:
if ( v5 == &empty_p_symbol )
return &f_symbol;
if ( v5 == &pop_symbol )
return (void *)a1;
v6 = &undef_object;
if ( v5 != &push_symbol )
return v6;
v11 = *a2;
if ( (unsigned int)*a2 > 0x2F )
{
v12 = (__int64 *)*((_QWORD *)a2 + 1);
*((_QWORD *)a2 + 1) = v12 + 1;
}
else
{
v12 = (__int64 *)(*((_QWORD *)a2 + 2) + v11);
*a2 = v11 + 8;
}
return (void *)pair_new(*v12, a1);
}

canonical_decompiled_code:
void *__fastcall func2(__int64 a1, int *a2)
{
unsigned int v2; // edx
__int64 v3; // rcx
__int64 v4; // r8
void **v5; // rax
void *v6; // r8
void **v8; // rax
_QWORD *v9; // rcx
_QWORD *v10; // rcx
unsigned int v11; // eax
__int64 *v12; // rdx

v2 = *a2;
if ( (unsigned int)*a2 <= 0x2F )
{
v3 = *((_QWORD *)a2 + 2);
v4 = v2 + 8;
*a2 = v4;
v5 = *(void ***)(v3 + v2);
if ( v5 != (void **)&eq_p_symbol )
goto LABEL_3;
if ( (unsigned int)v4 <= 0x2F )
{
v10 = (_QWORD *)(v4 + v3);
v6 = &t_symbol;
*a2 = v2 + 16;
if ( a1 == *v10 )
return v6;
return &f_symbol;
}
v9 = (_QWORD *)*((_QWORD *)a2 + 1);
LABEL_8:
v6 = &t_symbol;
*((_QWORD *)a2 + 1) = v9 + 1;
if ( a1 == *v9 )
return v6;
return &f_symbol;
}
v8 = (void **)*((_QWORD *)a2 + 1);
v9 = v8 + 1;
*((_QWORD *)a2 + 1) = v8 + 1;
v5 = (void **)*v8;
if ( v5 == (void **)&eq_p_symbol )
goto LABEL_8;
LABEL_3:
if ( v5 == &empty_p_symbol )
return &f_symbol;
if ( v5 == &pop_symbol )
return (void *)a1;
v6 = &undef_object;
if ( v5 != &push_symbol )
return v6;
v11 = *a2;
if ( (unsigned int)*a2 > 0x2F )
{
v12 = (__int64 *)*((_QWORD *)a2 + 1);
*((_QWORD *)a2 + 1) = v12 + 1;
}
else
{
v12 = (__int64 *)(*((_QWORD *)a2 + 2) + v11);
*a2 = v11 + 8;
}
return (void *)func0(*v12, a1);
}

original_code:
OOP pair_kind(OOP self, va_list args)
{
    OOP cmd = __builtin_va_arg(args,OOP);
    if (cmd == ((OOP)&eq_p_symbol)) {
        OOP other = __builtin_va_arg(args,OOP);
        if (other == self) {
            return ((OOP)&_t_symbol);
        }
        return ((OOP)&_f_symbol);
    } else if (cmd == ((OOP)&empty_p_symbol)) {
        return ((OOP)&_f_symbol);
    } else if (cmd == ((OOP)&pop_symbol)) {
        return self;
    } else if (cmd == ((OOP)&push_symbol)) {
        OOP x = __builtin_va_arg(args,OOP);
        return pair_new(x, self);
    }
    return ((OOP)&undef_object);
}

canonical_original_code:
struct object *pair_kind(struct object *self, __builtin_va_list args)
{
    struct object *cmd = __builtin_va_arg(args,OOP);
    if (cmd == ((OOP)&eq_p_symbol)) {
        struct object *other = __builtin_va_arg(args,OOP);
        if (other == self) {
            return ((OOP)&_t_symbol);
        }
        return ((OOP)&_f_symbol);
    } else if (cmd == ((OOP)&empty_p_symbol)) {
        return ((OOP)&_f_symbol);
    } else if (cmd == ((OOP)&pop_symbol)) {
        return self;
    } else if (cmd == ((OOP)&push_symbol)) {
        struct object *x = __builtin_va_arg(args,OOP);
        return pair_new(x, self);
    }
    return ((OOP)&undef_object);
}


original_code:
OOP queue_kind(OOP self, va_list args)
{
    struct pair * this = ((struct pair *)(self));
    OOP cmd = __builtin_va_arg(args,OOP);
    if (cmd == ((OOP)&eq_p_symbol)) {
        OOP other = __builtin_va_arg(args,OOP);
        if (other == self) {
            return ((OOP)&_t_symbol);
        }
        return ((OOP)&_f_symbol);
    } else if (cmd == ((OOP)&empty_p_symbol)) {
        if (this->h == ((OOP)&nil_object)) {
            return ((OOP)&_t_symbol);
        }
        return ((OOP)&_f_symbol);
    } else if (cmd == ((OOP)&take_x_symbol)) {
        if (this->h != ((OOP)&nil_object)) {
            struct pair * entry = ((struct pair *)(this->h));
            this->h = entry->t;
            OOP item = entry->h;
            return item;
        }
    } else if (cmd == ((OOP)&give_x_symbol)) {
        OOP item = __builtin_va_arg(args,OOP);
        OOP oop = pair_new(item, ((OOP)&nil_object));
        if (this->h == ((OOP)&nil_object)) {
            this->h = oop;
        } else {
            ((struct pair *)(this->t))->t = oop;
        }
        this->t = oop;
        return self;
    }
    return ((OOP)&undef_object);
}

canonical_original_code:
struct object *queue_kind(struct object *self, __builtin_va_list args)
{
    struct pair *this = ((struct pair *)(self));
    struct object *cmd = __builtin_va_arg(args,OOP);
    if (cmd == ((OOP)&eq_p_symbol)) {
        struct object *other = __builtin_va_arg(args,OOP);
        if (other == self) {
            return ((OOP)&_t_symbol);
        }
        return ((OOP)&_f_symbol);
    } else if (cmd == ((OOP)&empty_p_symbol)) {
        if (this->h == ((OOP)&nil_object)) {
            return ((OOP)&_t_symbol);
        }
        return ((OOP)&_f_symbol);
    } else if (cmd == ((OOP)&take_x_symbol)) {
        if (this->h != ((OOP)&nil_object)) {
            struct pair *entry = ((struct pair *)(this->h));
            this->h = entry->t;
            struct object *item = entry->h;
            return item;
        }
    } else if (cmd == ((OOP)&give_x_symbol)) {
        struct object *item = __builtin_va_arg(args,OOP);
        struct object *oop = pair_new(item, ((OOP)&nil_object));
        if (this->h == ((OOP)&nil_object)) {
            this->h = oop;
        } else {
            ((struct pair *)(this->t))->t = oop;
        }
        this->t = oop;
        return self;
    }
    return ((OOP)&undef_object);
}


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

result = object_new(queue_kind, 24LL);
*(_QWORD *)(result + 8) = nil_object;
*(_QWORD *)(result + 16) = nil_object;
return result;
}

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

result = object_new(queue_kind, 24LL);
*(_QWORD *)(result + 8) = nil_object;
*(_QWORD *)(result + 16) = nil_object;
return result;
}

original_code:
OOP
queue_new()
{
    struct pair * this = ((struct pair *)object_new((queue_kind), sizeof(struct pair)));
    this->h = ((OOP)&nil_object);
    this->t = ((OOP)&nil_object);
    return (OOP)this;
}

canonical_original_code:
struct object *queue_new()
{
    struct pair *this = ((struct pair *)object_new((queue_kind), sizeof(struct pair)));
    this->h = ((OOP)&nil_object);
    this->t = ((OOP)&nil_object);
    return (struct object *)this;
}


decompiled_code:
void **__fastcall empty_dict_kind(const void *a1, int *a2)
{
unsigned int v2; // eax
const char ***v3; // rdx
const char **v4; // rbp
void **result; // rax
unsigned int v6; // eax
const void **v7; // rdx
unsigned int v8; // eax
const void **v9; // rdx
unsigned int v10; // edx
__int64 v11; // rax
__int64 v12; // rcx
const char **v13; // rbp
const void **v14; // rax
__int64 v15; // r13
const char ***v16; // rdx

fprintf(stderr, "%p(empty_dict_kind)\n", a1);
v2 = *a2;
if ( (unsigned int)*a2 > 0x2F )
{
v3 = (const char ***)*((_QWORD *)a2 + 1);
*((_QWORD *)a2 + 1) = v3 + 1;
}
else
{
v3 = (const char ***)(*((_QWORD *)a2 + 2) + v2);
*a2 = v2 + 8;
}
v4 = *v3;
fprintf(stderr, " %p: cmd=%p \"%s\"\n", a1, v4, v4[1]);
if ( v4 == (const char **)&eq_p_symbol )
{
v6 = *a2;
if ( (unsigned int)*a2 > 0x2F )
{
v7 = (const void **)*((_QWORD *)a2 + 1);
*((_QWORD *)a2 + 1) = v7 + 1;
}
else
{
v7 = (const void **)(*((_QWORD *)a2 + 2) + v6);
*a2 = v6 + 8;
}
result = (void **)&t_symbol;
if ( a1 != *v7 )
result = (void **)&f_symbol;
}
else
{
if ( v4 != (const char **)&lookup_symbol )
{
result = (void **)&undef_object;
if ( v4 != (const char **)&bind_symbol )
return result;
v10 = *a2;
if ( (unsigned int)*a2 > 0x2F )
{
v16 = (const char ***)*((_QWORD *)a2 + 1);
v14 = (const void **)(v16 + 1);
*((_QWORD *)a2 + 1) = v16 + 1;
v13 = *v16;
}
else
{
v11 = *((_QWORD *)a2 + 2);
v12 = v10 + 8;
*a2 = v12;
v13 = *(const char ***)(v11 + v10);
if ( (unsigned int)v12 <= 0x2F )
{
v14 = (const void **)(v12 + v11);
*a2 = v10 + 16;
LABEL_20:
v15 = (__int64)*v14;
fprintf(stderr, " %p: name=%p \"%s\" value=%p\n", a1, v13, v13[1], *v14);
return (void **)dict_new((__int64)v13, v15, (__int64)a1);
}
v14 = (const void **)*((_QWORD *)a2 + 1);
}
*((_QWORD *)a2 + 1) = v14 + 1;
goto LABEL_20;
}
v8 = *a2;
if ( (unsigned int)*a2 > 0x2F )
{
v9 = (const void **)*((_QWORD *)a2 + 1);
*((_QWORD *)a2 + 1) = v9 + 1;
}
else
{
v9 = (const void **)(*((_QWORD *)a2 + 2) + v8);
*a2 = v8 + 8;
}
fprintf(stderr, " %p: name=%p \"%s\"\n", a1, *v9, *((const char **)*v9 + 1));
result = &fail_object;
}
return result;
}

canonical_decompiled_code:
void **__fastcall func5(const void *a1, int *a2)
{
unsigned int v2; // eax
const char ***v3; // rdx
const char **v4; // rbp
void **result; // rax
unsigned int v6; // eax
const void **v7; // rdx
unsigned int v8; // eax
const void **v9; // rdx
unsigned int v10; // edx
__int64 v11; // rax
__int64 v12; // rcx
const char **v13; // rbp
const void **v14; // rax
__int64 v15; // r13
const char ***v16; // rdx

fprintf(stderr, "%p(empty_dict_kind)\n", a1);
v2 = *a2;
if ( (unsigned int)*a2 > 0x2F )
{
v3 = (const char ***)*((_QWORD *)a2 + 1);
*((_QWORD *)a2 + 1) = v3 + 1;
}
else
{
v3 = (const char ***)(*((_QWORD *)a2 + 2) + v2);
*a2 = v2 + 8;
}
v4 = *v3;
fprintf(stderr, " %p: cmd=%p \"%s\"\n", a1, v4, v4[1]);
if ( v4 == (const char **)&eq_p_symbol )
{
v6 = *a2;
if ( (unsigned int)*a2 > 0x2F )
{
v7 = (const void **)*((_QWORD *)a2 + 1);
*((_QWORD *)a2 + 1) = v7 + 1;
}
else
{
v7 = (const void **)(*((_QWORD *)a2 + 2) + v6);
*a2 = v6 + 8;
}
result = (void **)&t_symbol;
if ( a1 != *v7 )
result = (void **)&f_symbol;
}
else
{
if ( v4 != (const char **)&lookup_symbol )
{
result = (void **)&undef_object;
if ( v4 != (const char **)&bind_symbol )
return result;
v10 = *a2;
if ( (unsigned int)*a2 > 0x2F )
{
v16 = (const char ***)*((_QWORD *)a2 + 1);
v14 = (const void **)(v16 + 1);
*((_QWORD *)a2 + 1) = v16 + 1;
v13 = *v16;
}
else
{
v11 = *((_QWORD *)a2 + 2);
v12 = v10 + 8;
*a2 = v12;
v13 = *(const char ***)(v11 + v10);
if ( (unsigned int)v12 <= 0x2F )
{
v14 = (const void **)(v12 + v11);
*a2 = v10 + 16;
LABEL_20:
v15 = (__int64)*v14;
fprintf(stderr, " %p: name=%p \"%s\" value=%p\n", a1, v13, v13[1], *v14);
return (void **)dict_new((__int64)v13, v15, (__int64)a1);
}
v14 = (const void **)*((_QWORD *)a2 + 1);
}
*((_QWORD *)a2 + 1) = v14 + 1;
goto LABEL_20;
}
v8 = *a2;
if ( (unsigned int)*a2 > 0x2F )
{
v9 = (const void **)*((_QWORD *)a2 + 1);
*((_QWORD *)a2 + 1) = v9 + 1;
}
else
{
v9 = (const void **)(*((_QWORD *)a2 + 2) + v8);
*a2 = v8 + 8;
}
fprintf(stderr, " %p: name=%p \"%s\"\n", a1, *v9, *((const char **)*v9 + 1));
result = &fail_object;
}
return result;
}

original_code:
static OOP empty_dict_kind(OOP self, va_list args)
{
    fprintf(stderr, "%p(empty_dict_kind)\n", self);
    OOP cmd = __builtin_va_arg(args,OOP);
    fprintf(stderr, "  %p: cmd=%p \"%s\"\n", self, cmd, ((struct symbol *)(cmd))->s);
    if (cmd == ((OOP)&eq_p_symbol)) {
        OOP other = __builtin_va_arg(args,OOP);
        if (other == self) {
            return ((OOP)&_t_symbol);
        }
        return ((OOP)&_f_symbol);
    } else if (cmd == ((OOP)&lookup_symbol)) {
        OOP name = __builtin_va_arg(args,OOP);
        fprintf(stderr, "  %p: name=%p \"%s\"\n", self, name, ((struct symbol *)(name))->s);
        return ((OOP)&fail_object);
    } else if (cmd == ((OOP)&bind_symbol)) {
        OOP name = __builtin_va_arg(args,OOP);
        OOP value = __builtin_va_arg(args,OOP);
        fprintf(stderr, "  %p: name=%p \"%s\" value=%p\n", self, name, ((struct symbol *)(name))->s, value);
        return dict_new(name, value, self);
    }
    return ((OOP)&undef_object);
}

canonical_original_code:
static struct object *empty_dict_kind(struct object *self, __builtin_va_list args)
{
    fprintf(stderr, "%p(empty_dict_kind)\n", self);
    struct object *cmd = __builtin_va_arg(args,OOP);
    fprintf(stderr, "  %p: cmd=%p \"%s\"\n", self, cmd, ((struct symbol *)(cmd))->s);
    if (cmd == ((OOP)&eq_p_symbol)) {
        struct object *other = __builtin_va_arg(args,OOP);
        if (other == self) {
            return ((OOP)&_t_symbol);
        }
        return ((OOP)&_f_symbol);
    } else if (cmd == ((OOP)&lookup_symbol)) {
        struct object *name = __builtin_va_arg(args,OOP);
        fprintf(stderr, "  %p: name=%p \"%s\"\n", self, name, ((struct symbol *)(name))->s);
        return ((OOP)&fail_object);
    } else if (cmd == ((OOP)&bind_symbol)) {
        struct object *name = __builtin_va_arg(args,OOP);
        struct object *value = __builtin_va_arg(args,OOP);
        fprintf(stderr, "  %p: name=%p \"%s\" value=%p\n", self, name, ((struct symbol *)(name))->s, value);
        return dict_new(name, value, self);
    }
    return ((OOP)&undef_object);
}

user_defined_types: struct symbol { struct object o; char *s; }


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

result = object_new(integer_kind, 16LL);
*(_DWORD *)(result + 8) = a1;
return result;
}

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

result = object_new(integer_kind, 16LL);
*(_DWORD *)(result + 8) = a1;
return result;
}

original_code:
OOP
integer_new(int value)
{
    struct integer * this = ((struct integer *)object_new((integer_kind), sizeof(struct integer)));
    this->n = value;
    return (OOP)this;
}

canonical_original_code:
struct object *integer_new(int value)
{
    struct integer *this = ((struct integer *)object_new((integer_kind), sizeof(struct integer)));
    this->n = value;
    return (struct object *)this;
}

variable_types: value int

variable_types: struct integer { struct object { struct object *(*kind)(struct object *self, __builtin_va_list args); } o; int n; } *

user_defined_types: struct integer { struct object o; int n; }


decompiled_code:
void *__fastcall integer_kind(__int64 a1, int *a2)
{
unsigned int v2; // ecx
__int64 v4; // rdi
__int64 v5; // rdx
void **v6; // rax
__int64 *v7; // rax
__int64 v8; // rax
void *result; // rax
void ***v10; // rcx
__int64 *v11; // rdx
void **v12; // rcx
__int64 v13; // rdx

v2 = *a2;
if ( (unsigned int)*a2 > 0x2F )
{
v10 = (void ***)*((_QWORD *)a2 + 1);
v11 = (__int64 *)(v10 + 1);
*((_QWORD *)a2 + 1) = v10 + 1;
v12 = *v10;
v7 = v11;
if ( v12 != (void **)&eq_p_symbol )
{
if ( v12 == &add_symbol )
goto LABEL_22;
return &undef_object;
}
goto LABEL_12;
}
v4 = *((_QWORD *)a2 + 2);
v5 = v2 + 8;
*a2 = v5;
v6 = *(void ***)(v4 + v2);
if ( v6 != (void **)&eq_p_symbol )
{
if ( v6 == &add_symbol )
{
if ( (unsigned int)v5 <= 0x2F )
{
*a2 = v2 + 16;
v7 = (__int64 *)(v4 + (unsigned int)v5);
goto LABEL_6;
}
v7 = (__int64 *)*((_QWORD *)a2 + 1);
LABEL_22:
*((_QWORD *)a2 + 1) = v7 + 1;
LABEL_6:
v8 = *v7;
if ( *(__int64 (__fastcall **)())v8 == integer_kind )
return (void *)integer_new(*(_DWORD *)(a1 + 8) + *(_DWORD *)(v8 + 8));
}
return &undef_object;
}
if ( (unsigned int)v5 > 0x2F )
{
v11 = (__int64 *)*((_QWORD *)a2 + 1);
LABEL_12:
*((_QWORD *)a2 + 1) = v11 + 1;
goto LABEL_13;
}
v11 = (__int64 *)(v4 + v5);
*a2 = v2 + 16;
LABEL_13:
v13 = *v11;
if ( a1 == v13 )
return &t_symbol;
result = &f_symbol;
if ( *(__int64 (__fastcall **)())v13 == integer_kind && *(_DWORD *)(v13 + 8) == *(_DWORD *)(a1 + 8) )
result = &t_symbol;
return result;
}

canonical_decompiled_code:
void *__fastcall func7(__int64 a1, int *a2)
{
unsigned int v2; // ecx
__int64 v4; // rdi
__int64 v5; // rdx
void **v6; // rax
__int64 *v7; // rax
__int64 v8; // rax
void *result; // rax
void ***v10; // rcx
__int64 *v11; // rdx
void **v12; // rcx
__int64 v13; // rdx

v2 = *a2;
if ( (unsigned int)*a2 > 0x2F )
{
v10 = (void ***)*((_QWORD *)a2 + 1);
v11 = (__int64 *)(v10 + 1);
*((_QWORD *)a2 + 1) = v10 + 1;
v12 = *v10;
v7 = v11;
if ( v12 != (void **)&eq_p_symbol )
{
if ( v12 == &add_symbol )
goto LABEL_22;
return &undef_object;
}
goto LABEL_12;
}
v4 = *((_QWORD *)a2 + 2);
v5 = v2 + 8;
*a2 = v5;
v6 = *(void ***)(v4 + v2);
if ( v6 != (void **)&eq_p_symbol )
{
if ( v6 == &add_symbol )
{
if ( (unsigned int)v5 <= 0x2F )
{
*a2 = v2 + 16;
v7 = (__int64 *)(v4 + (unsigned int)v5);
goto LABEL_6;
}
v7 = (__int64 *)*((_QWORD *)a2 + 1);
LABEL_22:
*((_QWORD *)a2 + 1) = v7 + 1;
LABEL_6:
v8 = *v7;
if ( *(__int64 (__fastcall **)())v8 == integer_kind )
return (void *)func6(*(_DWORD *)(a1 + 8) + *(_DWORD *)(v8 + 8));
}
return &undef_object;
}
if ( (unsigned int)v5 > 0x2F )
{
v11 = (__int64 *)*((_QWORD *)a2 + 1);
LABEL_12:
*((_QWORD *)a2 + 1) = v11 + 1;
goto LABEL_13;
}
v11 = (__int64 *)(v4 + v5);
*a2 = v2 + 16;
LABEL_13:
v13 = *v11;
if ( a1 == v13 )
return &t_symbol;
result = &f_symbol;
if ( *(__int64 (__fastcall **)())v13 == integer_kind && *(_DWORD *)(v13 + 8) == *(_DWORD *)(a1 + 8) )
result = &t_symbol;
return result;
}

original_code:
OOP integer_kind(OOP self, va_list args)
{
    struct integer * this = ((struct integer *)(self));
    OOP cmd = __builtin_va_arg(args,OOP);
    if (cmd == ((OOP)&eq_p_symbol)) {
        OOP other = __builtin_va_arg(args,OOP);
        if (other == self) {
            return ((OOP)&_t_symbol);
        }
        if (integer_kind == other->kind) {
            struct integer * that = ((struct integer *)(other));
            if (that->n == this->n) {
                return ((OOP)&_t_symbol);
            }
        }
        return ((OOP)&_f_symbol);
    } else if (cmd == ((OOP)&add_symbol)) {
        OOP other = __builtin_va_arg(args,OOP);
        if (integer_kind == other->kind) {
            struct integer * that = ((struct integer *)(other));
            return integer_new(this->n + that->n);
        }
    }
    return ((OOP)&undef_object);
}

canonical_original_code:
struct object *integer_kind(struct object *self, __builtin_va_list args)
{
    struct integer *this = ((struct integer *)(self));
    struct object *cmd = __builtin_va_arg(args,OOP);
    if (cmd == ((OOP)&eq_p_symbol)) {
        struct object *other = __builtin_va_arg(args,OOP);
        if (other == self) {
            return ((OOP)&_t_symbol);
        }
        if (integer_kind == other->kind) {
            struct integer *that = ((struct integer *)(other));
            if (that->n == this->n) {
                return ((OOP)&_t_symbol);
            }
        }
        return ((OOP)&_f_symbol);
    } else if (cmd == ((OOP)&add_symbol)) {
        struct object *other = __builtin_va_arg(args,OOP);
        if (integer_kind == other->kind) {
            struct integer *that = ((struct integer *)(other));
            return integer_new(this->n + that->n);
        }
    }
    return ((OOP)&undef_object);
}


decompiled_code:
int run_tests()
{
const char **v0; // r13
void *v1; // rbx
unsigned int *v2; // rbx
const void *v3; // rbp
const char **v4; // r14
const void *v5; // rbp
const char **v6; // r12
void *v7; // rbx
__int64 v8; // rbp
__int64 v9; // rbx
const void *v10; // r12
__int64 v11; // rdx
__int64 i; // r15
__int64 v13; // rdx
__int64 v14; // r15
__int64 v15; // rdx
const void *v16; // rbx
const void *v17; // rbp
__int64 v18; // rax
__int64 v19; // rax
__int64 v20; // rax
const void *v21; // rbp
__int64 v22; // rax
__int64 v23; // rbp
__int64 v24; // rax
__int64 v25; // r12
__int64 v26; // rax
__int64 v27; // rax
__int64 v28; // rbp
__int64 v29; // rax
__int64 v30; // rax
__int64 v31; // rax
void *v32; // rbx
__int64 v33; // rbp
const void *v34; // r12
__int64 v35; // rax
const void *v36; // r12
const void *v37; // r13
const void *v38; // r13
const void *v39; // r12
const void *v40; // r12
__int64 v41; // rax
const void *v42; // rbp
const void *v43; // rbp
const void *v44; // r12
const void *v45; // r12
void **v46; // rbx
int result; // eax
unsigned int *v48; // [rsp+8h] [rbp-40h]

fprintf(stderr, "o_undef = %p\n", &undef_object);
fprintf(stderr, "o_fail = %p\n", &fail_object);
fprintf(stderr, "o_nil = %p\n", &nil_object);
fprintf(stderr, "o_true = %p\n", &t_symbol);
fprintf(stderr, "o_false = %p\n", &f_symbol);
fprintf(stderr, "s_eq_p = %p\n", &eq_p_symbol);
fprintf(stderr, "&eq_p_symbol = %p\n", &eq_p_symbol);
fprintf(stderr, "symbol_kind = %p\n", &symbol_kind);
fprintf(stderr, "eq_p_symbol.o.kind = %p\n", eq_p_symbol);
fprintf(stderr, "eq_p_symbol.s = \"%s\"\n", *((const char **)&eq_p_symbol + 1));
fprintf(stderr, "dict_kind = %p\n", &dict_kind);
fprintf(stderr, "s_lookup = %p\n", &lookup_symbol);
fprintf(stderr, "s_bind = %p\n", &bind_symbol);
v0 = (const char **)symbol_new("x");
fprintf(stderr, "s_x = %p\n", v0);
fprintf(stderr, "as_symbol(s_x)->s = \"%s\"\n", v0[1]);
v1 = (void *)object_call(&empty_dict, &lookup_symbol, v0);
fprintf(stderr, "result = %p\n", v1);
if ( v1 != &fail_object )
_assert_fail("o_fail == result", "art.c", 0x18Eu, "run_tests");
v2 = (unsigned int *)integer_new(42LL);
fprintf(stderr, "n_42 = %p\n", v2);
fprintf(stderr, "as_integer(n_42)->n = %d\n", v2[2]);
v3 = (const void *)object_call(&empty_dict, &bind_symbol, v0);
fprintf(stderr, "d_env = %p\n", v3);
v48 = (unsigned int *)object_call(v3, &lookup_symbol, v0);
fprintf(stderr, "result = %p\n", v48);
if ( v2 != v48 )
_assert_fail("n_42 == result", "art.c", 0x197u, "run_tests");
v4 = (const char **)symbol_new("y");
fprintf(stderr, "s_y = %p\n", v4);
fprintf(stderr, "as_symbol(s_y)->s = \"%s\"\n", v4[1]);
v5 = (const void *)object_call(v3, &bind_symbol, v4);
fprintf(stderr, "d_env = %p\n", v5);
v6 = (const char **)symbol_new("z");
fprintf(stderr, "s_z = %p\n", v6);
fprintf(stderr, "as_symbol(s_z)->s = \"%s\"\n", v6[1]);
v7 = (void *)object_call(v5, &lookup_symbol, v6);
fprintf(stderr, "result = %p\n", v7);
if ( v7 != &fail_object )
_assert_fail("o_fail == result", "art.c", 0x1A4u, "run_tests");
v8 = integer_new(65LL);
v9 = integer_new(90LL);
v10 = (const void *)queue_new();
fprintf(stderr, "q_oop = %p\n", v10);
if ( (_UNKNOWN *)object_call(v10, &empty_p_symbol, v11) != &t_symbol )
_assert_fail("o_true == result", "art.c", 0x1ABu, "run_tests");
for ( i = v8; (_UNKNOWN *)object_call(i, &eq_p_symbol, v9) != &t_symbol; i = object_call(i, &add_symbol, &1_integer) )
{
v10 = (const void *)object_call(v10, &give_x_symbol, i);
fprintf(stderr, "q_oop = %p ^ [%c]\n", v10, *(unsigned int *)(i + 8));
}
if ( (_UNKNOWN *)object_call(v10, &empty_p_symbol, v13) != &f_symbol )
_assert_fail("o_false == result", "art.c", 0x1B3u, "run_tests");
while ( (_UNKNOWN *)object_call(v8, &eq_p_symbol, v9) != &t_symbol )
{
v14 = object_call(v10, &take_x_symbol, v15);
fprintf(stderr, "q_oop = [%c] ^ %p\n", *(unsigned int *)(v14 + 8), v10);
if ( (_UNKNOWN *)object_call(v14, &eq_p_symbol, v8) != &t_symbol )
_assert_fail("o_true == result", "art.c", 0x1B9u, "run_tests");
v8 = object_call(v8, &add_symbol, &1_integer);
}
if ( (_UNKNOWN *)object_call(v10, &empty_p_symbol, v15) != &t_symbol )
_assert_fail("o_true == result", "art.c", 0x1BDu, "run_tests");
fwrite("---- expression evaluation ----\n", 1uLL, 0x20uLL, stderr);
fprintf(stderr, "s_eval = %p\n", &eval_symbol);
fprintf(stderr, "s_combine = %p\n", &combine_symbol);
v16 = (const void *)object_new(&const_expr_kind, 8LL);
fprintf(stderr, "expr_const_42 = %p\n", v16);
v17 = (const void *)ident_expr_new(v0);
fprintf(stderr, "expr_ident_x = %p\n", v17);
v18 = bind_pattern_new(v0, &all_pattern);
v19 = lambda_expr_new(v18, v17);
v20 = combine_expr_new(v19, v16);
v21 = (const void *)object_call(v20, &eval_symbol, &empty_dict);
fprintf(stderr, "result = %p\n", v21);
if ( v16 != v21 )
_assert_fail("expr_const_42 == result", "art.c", 0x1CEu, "run_tests");
fprintf(stderr, "n_0 = %p\n", &0_integer);
fprintf(stderr, "n_1 = %p\n", &1_integer);
v22 = bind_pattern_new(v4, &any_pattern);
v23 = and_pattern_new(v22, &end_pattern);
v24 = bind_pattern_new(v0, &any_pattern);
v25 = and_pattern_new(v24, v23);
v26 = pair_new(&1_integer, &nil_object);
v27 = pair_new(&0_integer, v26);
v28 = quote_expr_new(v27);
v29 = ident_expr_new(v4);
v30 = lambda_expr_new(v25, v29);
v31 = combine_expr_new(v30, v28);
v32 = (void *)object_call(v31, &eval_symbol, &empty_dict);
fprintf(stderr, "result = %p\n", v32);
if ( v32 != &1_integer )
_assert_fail("n_1 == result", "art.c", 0x1E1u, "run_tests");
fwrite("---- actor primitives ----\n", 1uLL, 0x1BuLL, stderr);
fprintf(stderr, "s_create_x = %p\n", &create_x_symbol);
fprintf(stderr, "s_send_x = %p\n", &send_x_symbol);
fprintf(stderr, "s_become_x = %p\n", &become_x_symbol);
fprintf(stderr, "s_dispatch_x = %p\n", &dispatch_x_symbol);
v33 = config_new();
v34 = (const void *)object_call(v33, &dispatch_x_symbol, &0_integer);
fprintf(stderr, "result = %p\n", v34);
if ( (_UNKNOWN *)object_call(v34, &eq_p_symbol, &0_integer) != &t_symbol )
_assert_fail("o_true == object_call(result, s_eq_p, n_0)", "art.c", 0x1ECu, "run_tests");
v35 = one_shot_beh_new(&sink_actor);
v36 = (const void *)actor_new(v35);
fprintf(stderr, "a_fwd = %p\n", v36);
v37 = (const void *)event_new(v36, v48);
fprintf(stderr, "event = %p\n", v37);
v38 = (const void *)object_call(v33, &give_x_symbol, v37);
fprintf(stderr, "result = %p\n", v38);
if ( (_UNKNOWN *)object_call(v38, &eq_p_symbol, &1_integer) != &t_symbol )
_assert_fail("o_true == object_call(result, s_eq_p, n_1)", "art.c", 0x1F5u, "run_tests");
v39 = (const void *)event_new(v36, &1_integer);
fprintf(stderr, "event = %p\n", v39);
v40 = (const void *)object_call(v33, &give_x_symbol, v39);
fprintf(stderr, "result = %p\n", v40);
if ( (_UNKNOWN *)object_call(v40, &eq_p_symbol, &2_integer) != &t_symbol )
_assert_fail("o_true == object_call(result, s_eq_p, n_2)", "art.c", 0x1FAu, "run_tests");
v41 = integer_new(5LL);
v42 = (const void *)object_call(v33, &dispatch_x_symbol, v41);
fprintf(stderr, "result = %p\n", v42);
if ( (_UNKNOWN *)object_call(v42, &eq_p_symbol, &0_integer) != &t_symbol )
_assert_fail("o_true == object_call(result, s_eq_p, n_0)", "art.c", 0x1FFu, "run_tests");
fwrite("---- json parser ----\n", 1uLL, 0x16uLL, stderr);
v43 = (const void *)json_grammar_new();
fprintf(stderr, "g_json = %p\n", v43);
v44 = (const void *)string_stream_new(" [0, {\"N\":42}, true]\n");
fprintf(stderr, "s_src = %p\n", v44);
v45 = (const void *)match_new(v44, &empty_dict, &undef_object);
fprintf(stderr, "match = %p\n", v45);
v46 = (void **)object_call(v43, &match_symbol, v45);
result = fprintf(stderr, "match' = %p\n", v46);
if ( *v46 != &match_kind )
_assert_fail("match_kind == match->kind", "art.c", 0x20Bu, "run_tests");
return result;
}

canonical_decompiled_code:
int func0()
{
const char **v0; // r13
void *v1; // rbx
unsigned int *v2; // rbx
const void *v3; // rbp
const char **v4; // r14
const void *v5; // rbp
const char **v6; // r12
void *v7; // rbx
__int64 v8; // rbp
__int64 v9; // rbx
const void *v10; // r12
__int64 v11; // rdx
__int64 i; // r15
__int64 v13; // rdx
__int64 v14; // r15
__int64 v15; // rdx
const void *v16; // rbx
const void *v17; // rbp
__int64 v18; // rax
__int64 v19; // rax
__int64 v20; // rax
const void *v21; // rbp
__int64 v22; // rax
__int64 v23; // rbp
__int64 v24; // rax
__int64 v25; // r12
__int64 v26; // rax
__int64 v27; // rax
__int64 v28; // rbp
__int64 v29; // rax
__int64 v30; // rax
__int64 v31; // rax
void *v32; // rbx
__int64 v33; // rbp
const void *v34; // r12
__int64 v35; // rax
const void *v36; // r12
const void *v37; // r13
const void *v38; // r13
const void *v39; // r12
const void *v40; // r12
__int64 v41; // rax
const void *v42; // rbp
const void *v43; // rbp
const void *v44; // r12
const void *v45; // r12
void **v46; // rbx
int result; // eax
unsigned int *v48; // [rsp+8h] [rbp-40h]

fprintf(stderr, "o_undef = %p\n", &undef_object);
fprintf(stderr, "o_fail = %p\n", &fail_object);
fprintf(stderr, "o_nil = %p\n", &nil_object);
fprintf(stderr, "o_true = %p\n", &t_symbol);
fprintf(stderr, "o_false = %p\n", &f_symbol);
fprintf(stderr, "s_eq_p = %p\n", &eq_p_symbol);
fprintf(stderr, "&eq_p_symbol = %p\n", &eq_p_symbol);
fprintf(stderr, "symbol_kind = %p\n", &symbol_kind);
fprintf(stderr, "eq_p_symbol.o.kind = %p\n", eq_p_symbol);
fprintf(stderr, "eq_p_symbol.s = \"%s\"\n", *((const char **)&eq_p_symbol + 1));
fprintf(stderr, "dict_kind = %p\n", &dict_kind);
fprintf(stderr, "s_lookup = %p\n", &lookup_symbol);
fprintf(stderr, "s_bind = %p\n", &bind_symbol);
v0 = (const char **)symbol_new("x");
fprintf(stderr, "s_x = %p\n", v0);
fprintf(stderr, "as_symbol(s_x)->s = \"%s\"\n", v0[1]);
v1 = (void *)object_call(&empty_dict, &lookup_symbol, v0);
fprintf(stderr, "result = %p\n", v1);
if ( v1 != &fail_object )
_assert_fail("o_fail == result", "art.c", 0x18Eu, "run_tests");
v2 = (unsigned int *)integer_new(42LL);
fprintf(stderr, "n_42 = %p\n", v2);
fprintf(stderr, "as_integer(n_42)->n = %d\n", v2[2]);
v3 = (const void *)object_call(&empty_dict, &bind_symbol, v0);
fprintf(stderr, "d_env = %p\n", v3);
v48 = (unsigned int *)object_call(v3, &lookup_symbol, v0);
fprintf(stderr, "result = %p\n", v48);
if ( v2 != v48 )
_assert_fail("n_42 == result", "art.c", 0x197u, "run_tests");
v4 = (const char **)symbol_new("y");
fprintf(stderr, "s_y = %p\n", v4);
fprintf(stderr, "as_symbol(s_y)->s = \"%s\"\n", v4[1]);
v5 = (const void *)object_call(v3, &bind_symbol, v4);
fprintf(stderr, "d_env = %p\n", v5);
v6 = (const char **)symbol_new("z");
fprintf(stderr, "s_z = %p\n", v6);
fprintf(stderr, "as_symbol(s_z)->s = \"%s\"\n", v6[1]);
v7 = (void *)object_call(v5, &lookup_symbol, v6);
fprintf(stderr, "result = %p\n", v7);
if ( v7 != &fail_object )
_assert_fail("o_fail == result", "art.c", 0x1A4u, "run_tests");
v8 = integer_new(65LL);
v9 = integer_new(90LL);
v10 = (const void *)queue_new();
fprintf(stderr, "q_oop = %p\n", v10);
if ( (_UNKNOWN *)object_call(v10, &empty_p_symbol, v11) != &t_symbol )
_assert_fail("o_true == result", "art.c", 0x1ABu, "run_tests");
for ( i = v8; (_UNKNOWN *)object_call(i, &eq_p_symbol, v9) != &t_symbol; i = object_call(i, &add_symbol, &1_integer) )
{
v10 = (const void *)object_call(v10, &give_x_symbol, i);
fprintf(stderr, "q_oop = %p ^ [%c]\n", v10, *(unsigned int *)(i + 8));
}
if ( (_UNKNOWN *)object_call(v10, &empty_p_symbol, v13) != &f_symbol )
_assert_fail("o_false == result", "art.c", 0x1B3u, "run_tests");
while ( (_UNKNOWN *)object_call(v8, &eq_p_symbol, v9) != &t_symbol )
{
v14 = object_call(v10, &take_x_symbol, v15);
fprintf(stderr, "q_oop = [%c] ^ %p\n", *(unsigned int *)(v14 + 8), v10);
if ( (_UNKNOWN *)object_call(v14, &eq_p_symbol, v8) != &t_symbol )
_assert_fail("o_true == result", "art.c", 0x1B9u, "run_tests");
v8 = object_call(v8, &add_symbol, &1_integer);
}
if ( (_UNKNOWN *)object_call(v10, &empty_p_symbol, v15) != &t_symbol )
_assert_fail("o_true == result", "art.c", 0x1BDu, "run_tests");
fwrite("---- expression evaluation ----\n", 1uLL, 0x20uLL, stderr);
fprintf(stderr, "s_eval = %p\n", &eval_symbol);
fprintf(stderr, "s_combine = %p\n", &combine_symbol);
v16 = (const void *)object_new(&const_expr_kind, 8LL);
fprintf(stderr, "expr_const_42 = %p\n", v16);
v17 = (const void *)ident_expr_new(v0);
fprintf(stderr, "expr_ident_x = %p\n", v17);
v18 = bind_pattern_new(v0, &all_pattern);
v19 = lambda_expr_new(v18, v17);
v20 = combine_expr_new(v19, v16);
v21 = (const void *)object_call(v20, &eval_symbol, &empty_dict);
fprintf(stderr, "result = %p\n", v21);
if ( v16 != v21 )
_assert_fail("expr_const_42 == result", "art.c", 0x1CEu, "run_tests");
fprintf(stderr, "n_0 = %p\n", &0_integer);
fprintf(stderr, "n_1 = %p\n", &1_integer);
v22 = bind_pattern_new(v4, &any_pattern);
v23 = and_pattern_new(v22, &end_pattern);
v24 = bind_pattern_new(v0, &any_pattern);
v25 = and_pattern_new(v24, v23);
v26 = pair_new(&1_integer, &nil_object);
v27 = pair_new(&0_integer, v26);
v28 = quote_expr_new(v27);
v29 = ident_expr_new(v4);
v30 = lambda_expr_new(v25, v29);
v31 = combine_expr_new(v30, v28);
v32 = (void *)object_call(v31, &eval_symbol, &empty_dict);
fprintf(stderr, "result = %p\n", v32);
if ( v32 != &1_integer )
_assert_fail("n_1 == result", "art.c", 0x1E1u, "run_tests");
fwrite("---- actor primitives ----\n", 1uLL, 0x1BuLL, stderr);
fprintf(stderr, "s_create_x = %p\n", &create_x_symbol);
fprintf(stderr, "s_send_x = %p\n", &send_x_symbol);
fprintf(stderr, "s_become_x = %p\n", &become_x_symbol);
fprintf(stderr, "s_dispatch_x = %p\n", &dispatch_x_symbol);
v33 = config_new();
v34 = (const void *)object_call(v33, &dispatch_x_symbol, &0_integer);
fprintf(stderr, "result = %p\n", v34);
if ( (_UNKNOWN *)object_call(v34, &eq_p_symbol, &0_integer) != &t_symbol )
_assert_fail("o_true == object_call(result, s_eq_p, n_0)", "art.c", 0x1ECu, "run_tests");
v35 = one_shot_beh_new(&sink_actor);
v36 = (const void *)actor_new(v35);
fprintf(stderr, "a_fwd = %p\n", v36);
v37 = (const void *)event_new(v36, v48);
fprintf(stderr, "event = %p\n", v37);
v38 = (const void *)object_call(v33, &give_x_symbol, v37);
fprintf(stderr, "result = %p\n", v38);
if ( (_UNKNOWN *)object_call(v38, &eq_p_symbol, &1_integer) != &t_symbol )
_assert_fail("o_true == object_call(result, s_eq_p, n_1)", "art.c", 0x1F5u, "run_tests");
v39 = (const void *)event_new(v36, &1_integer);
fprintf(stderr, "event = %p\n", v39);
v40 = (const void *)object_call(v33, &give_x_symbol, v39);
fprintf(stderr, "result = %p\n", v40);
if ( (_UNKNOWN *)object_call(v40, &eq_p_symbol, &2_integer) != &t_symbol )
_assert_fail("o_true == object_call(result, s_eq_p, n_2)", "art.c", 0x1FAu, "run_tests");
v41 = integer_new(5LL);
v42 = (const void *)object_call(v33, &dispatch_x_symbol, v41);
fprintf(stderr, "result = %p\n", v42);
if ( (_UNKNOWN *)object_call(v42, &eq_p_symbol, &0_integer) != &t_symbol )
_assert_fail("o_true == object_call(result, s_eq_p, n_0)", "art.c", 0x1FFu, "run_tests");
fwrite("---- json parser ----\n", 1uLL, 0x16uLL, stderr);
v43 = (const void *)json_grammar_new();
fprintf(stderr, "g_json = %p\n", v43);
v44 = (const void *)string_stream_new(" [0, {\"N\":42}, true]\n");
fprintf(stderr, "s_src = %p\n", v44);
v45 = (const void *)match_new(v44, &empty_dict, &undef_object);
fprintf(stderr, "match = %p\n", v45);
v46 = (void **)object_call(v43, &match_symbol, v45);
result = fprintf(stderr, "match' = %p\n", v46);
if ( *v46 != &match_kind )
_assert_fail("match_kind == match->kind", "art.c", 0x20Bu, "run_tests");
return result;
}

original_code:
void
run_tests()
{
    fprintf(stderr, "o_undef = %p\n", ((OOP)&undef_object));
    fprintf(stderr, "o_fail = %p\n", ((OOP)&fail_object));
    fprintf(stderr, "o_nil = %p\n", ((OOP)&nil_object));
    fprintf(stderr, "o_true = %p\n", ((OOP)&_t_symbol));
    fprintf(stderr, "o_false = %p\n", ((OOP)&_f_symbol));
    fprintf(stderr, "s_eq_p = %p\n", ((OOP)&eq_p_symbol));
    fprintf(stderr, "&eq_p_symbol = %p\n", &eq_p_symbol);
    fprintf(stderr, "symbol_kind = %p\n", (void*)symbol_kind);
    fprintf(stderr, "eq_p_symbol.o.kind = %p\n", (void*)eq_p_symbol.o.kind);
    fprintf(stderr, "eq_p_symbol.s = \"%s\"\n", eq_p_symbol.s);
    fprintf(stderr, "dict_kind = %p\n", (void*)dict_kind);
    fprintf(stderr, "s_lookup = %p\n", ((OOP)&lookup_symbol));
    fprintf(stderr, "s_bind = %p\n", ((OOP)&bind_symbol));
    OOP s_x = symbol_new("x");
    fprintf(stderr, "s_x = %p\n", s_x);
    fprintf(stderr, "as_symbol(s_x)->s = \"%s\"\n", ((struct symbol *)(s_x))->s);
    OOP result = object_call(((OOP)&empty_dict), ((OOP)&lookup_symbol), s_x);
    fprintf(stderr, "result = %p\n", result);
    ((void) sizeof ((((OOP)&fail_object) == result) ? 1 : 0), __extension__ ({ if (((OOP)&fail_object) == result) ; else __assert_fail ("o_fail == result", "art.c", 398, __extension__ __PRETTY_FUNCTION__); }));
    OOP n_42 = integer_new(42);
    fprintf(stderr, "n_42 = %p\n", n_42);
    fprintf(stderr, "as_integer(n_42)->n = %d\n", ((struct integer *)(n_42))->n);
    OOP d_env = object_call(((OOP)&empty_dict), ((OOP)&bind_symbol), s_x, n_42);
    fprintf(stderr, "d_env = %p\n", d_env);
    result = object_call(d_env, ((OOP)&lookup_symbol), s_x);
    fprintf(stderr, "result = %p\n", result);
    ((void) sizeof ((n_42 == result) ? 1 : 0), __extension__ ({ if (n_42 == result) ; else __assert_fail ("n_42 == result", "art.c", 407, __extension__ __PRETTY_FUNCTION__); }));
    OOP s_y = symbol_new("y");
    fprintf(stderr, "s_y = %p\n", s_y);
    fprintf(stderr, "as_symbol(s_y)->s = \"%s\"\n", ((struct symbol *)(s_y))->s);
    d_env = object_call(d_env, ((OOP)&bind_symbol), s_y, ((OOP)&minus_1_integer));
    fprintf(stderr, "d_env = %p\n", d_env);
    OOP s_z = symbol_new("z");
    fprintf(stderr, "s_z = %p\n", s_z);
    fprintf(stderr, "as_symbol(s_z)->s = \"%s\"\n", ((struct symbol *)(s_z))->s);
    result = object_call(d_env, ((OOP)&lookup_symbol), s_z);
    fprintf(stderr, "result = %p\n", result);
    ((void) sizeof ((((OOP)&fail_object) == result) ? 1 : 0), __extension__ ({ if (((OOP)&fail_object) == result) ; else __assert_fail ("o_fail == result", "art.c", 420, __extension__ __PRETTY_FUNCTION__); }));
    OOP ch_A = integer_new('A');
    OOP ch_Z = integer_new('Z');
    OOP q_oop = queue_new();
    fprintf(stderr, "q_oop = %p\n", q_oop);
    result = object_call(q_oop, ((OOP)&empty_p_symbol));
    ((void) sizeof ((((OOP)&_t_symbol) == result) ? 1 : 0), __extension__ ({ if (((OOP)&_t_symbol) == result) ; else __assert_fail ("o_true == result", "art.c", 427, __extension__ __PRETTY_FUNCTION__); }));
    OOP n_ch = ch_A;
    while (object_call(n_ch, ((OOP)&eq_p_symbol), ch_Z) != ((OOP)&_t_symbol)) {
        q_oop = object_call(q_oop, ((OOP)&give_x_symbol), n_ch);
        fprintf(stderr, "q_oop = %p ^ [%c]\n", q_oop, ((struct integer *)(n_ch))->n);
        n_ch = object_call(n_ch, ((OOP)&add_symbol), ((OOP)&_1_integer));
    }
    result = object_call(q_oop, ((OOP)&empty_p_symbol));
    ((void) sizeof ((((OOP)&_f_symbol) == result) ? 1 : 0), __extension__ ({ if (((OOP)&_f_symbol) == result) ; else __assert_fail ("o_false == result", "art.c", 435, __extension__ __PRETTY_FUNCTION__); }));
    n_ch = ch_A;
    while (object_call(n_ch, ((OOP)&eq_p_symbol), ch_Z) != ((OOP)&_t_symbol)) {
        OOP n_i = object_call(q_oop, ((OOP)&take_x_symbol));
        fprintf(stderr, "q_oop = [%c] ^ %p\n", ((struct integer *)(n_i))->n, q_oop);
        result = object_call(n_i, ((OOP)&eq_p_symbol), n_ch);
        ((void) sizeof ((((OOP)&_t_symbol) == result) ? 1 : 0), __extension__ ({ if (((OOP)&_t_symbol) == result) ; else __assert_fail ("o_true == result", "art.c", 441, __extension__ __PRETTY_FUNCTION__); }));
        n_ch = object_call(n_ch, ((OOP)&add_symbol), ((OOP)&_1_integer));
    }
    result = object_call(q_oop, ((OOP)&empty_p_symbol));
    ((void) sizeof ((((OOP)&_t_symbol) == result) ? 1 : 0), __extension__ ({ if (((OOP)&_t_symbol) == result) ; else __assert_fail ("o_true == result", "art.c", 445, __extension__ __PRETTY_FUNCTION__); }));
    fprintf(stderr, "---- expression evaluation ----\n");
    fprintf(stderr, "s_eval = %p\n", ((OOP)&eval_symbol));
    fprintf(stderr, "s_combine = %p\n", ((OOP)&combine_symbol));
    OOP expr_const_42 = ((struct object *)object_new((const_expr_kind), sizeof(struct object)));
    fprintf(stderr, "expr_const_42 = %p\n", expr_const_42);
    OOP expr_ident_x = ident_expr_new(s_x);
    fprintf(stderr, "expr_ident_x = %p\n", expr_ident_x);
    OOP expr_example = combine_expr_new(
        lambda_expr_new(bind_pattern_new(s_x, ((OOP)&all_pattern)), expr_ident_x),
        expr_const_42);
    result = object_call(expr_example, ((OOP)&eval_symbol), ((OOP)&empty_dict));
    fprintf(stderr, "result = %p\n", result);
    ((void) sizeof ((expr_const_42 == result) ? 1 : 0), __extension__ ({ if (expr_const_42 == result) ; else __assert_fail ("expr_const_42 == result", "art.c", 462, __extension__ __PRETTY_FUNCTION__); }));
    fprintf(stderr, "n_0 = %p\n", ((OOP)&_0_integer));
    fprintf(stderr, "n_1 = %p\n", ((OOP)&_1_integer));
    OOP ptrn_parm_x_y = and_pattern_new(
        bind_pattern_new(s_x, ((OOP)&any_pattern)),
        and_pattern_new(
            bind_pattern_new(s_y, ((OOP)&any_pattern)),
            ((OOP)&end_pattern)));
    OOP list_0_1 = pair_new(((OOP)&_0_integer), pair_new(((OOP)&_1_integer), ((OOP)&nil_object)));
    expr_example = combine_expr_new(
        lambda_expr_new(
            ptrn_parm_x_y,
            ident_expr_new(s_y)),
        quote_expr_new(list_0_1));
    result = object_call(expr_example, ((OOP)&eval_symbol), ((OOP)&empty_dict));
    fprintf(stderr, "result = %p\n", result);
    ((void) sizeof ((((OOP)&_1_integer) == result) ? 1 : 0), __extension__ ({ if (((OOP)&_1_integer) == result) ; else __assert_fail ("n_1 == result", "art.c", 481, __extension__ __PRETTY_FUNCTION__); }));
    fprintf(stderr, "---- actor primitives ----\n");
    fprintf(stderr, "s_create_x = %p\n", ((OOP)&create_x_symbol));
    fprintf(stderr, "s_send_x = %p\n", ((OOP)&send_x_symbol));
    fprintf(stderr, "s_become_x = %p\n", ((OOP)&become_x_symbol));
    fprintf(stderr, "s_dispatch_x = %p\n", ((OOP)&dispatch_x_symbol));
    OOP cfg = config_new();
    result = object_call(cfg, ((OOP)&dispatch_x_symbol), ((OOP)&_0_integer));
    fprintf(stderr, "result = %p\n", result);
    ((void) sizeof ((((OOP)&_t_symbol) == object_call(result, ((OOP)&eq_p_symbol), ((OOP)&_0_integer))) ? 1 : 0), __extension__ ({ if (((OOP)&_t_symbol) == object_call(result, ((OOP)&eq_p_symbol), ((OOP)&_0_integer))) ; else __assert_fail ("o_true == object_call(result, s_eq_p, n_0)", "art.c", 492, __extension__ __PRETTY_FUNCTION__); }));
    OOP a_fwd = actor_new(one_shot_beh_new(((OOP)&sink_actor)));
    fprintf(stderr, "a_fwd = %p\n", a_fwd);
    OOP event = event_new(a_fwd, n_42);
    fprintf(stderr, "event = %p\n", event);
    result = object_call(cfg, ((OOP)&give_x_symbol), event);
    fprintf(stderr, "result = %p\n", result);
    ((void) sizeof ((((OOP)&_t_symbol) == object_call(result, ((OOP)&eq_p_symbol), ((OOP)&_1_integer))) ? 1 : 0), __extension__ ({ if (((OOP)&_t_symbol) == object_call(result, ((OOP)&eq_p_symbol), ((OOP)&_1_integer))) ; else __assert_fail ("o_true == object_call(result, s_eq_p, n_1)", "art.c", 501, __extension__ __PRETTY_FUNCTION__); }));
    event = event_new(a_fwd, ((OOP)&_1_integer));
    fprintf(stderr, "event = %p\n", event);
    result = object_call(cfg, ((OOP)&give_x_symbol), event);
    fprintf(stderr, "result = %p\n", result);
    ((void) sizeof ((((OOP)&_t_symbol) == object_call(result, ((OOP)&eq_p_symbol), ((OOP)&_2_integer))) ? 1 : 0), __extension__ ({ if (((OOP)&_t_symbol) == object_call(result, ((OOP)&eq_p_symbol), ((OOP)&_2_integer))) ; else __assert_fail ("o_true == object_call(result, s_eq_p, n_2)", "art.c", 506, __extension__ __PRETTY_FUNCTION__); }));
    OOP n_5 = integer_new(5);
    result = object_call(cfg, ((OOP)&dispatch_x_symbol), n_5);
    fprintf(stderr, "result = %p\n", result);
    ((void) sizeof ((((OOP)&_t_symbol) == object_call(result, ((OOP)&eq_p_symbol), ((OOP)&_0_integer))) ? 1 : 0), __extension__ ({ if (((OOP)&_t_symbol) == object_call(result, ((OOP)&eq_p_symbol), ((OOP)&_0_integer))) ; else __assert_fail ("o_true == object_call(result, s_eq_p, n_0)", "art.c", 511, __extension__ __PRETTY_FUNCTION__); }));
    fprintf(stderr, "---- json parser ----\n");
    OOP g_json = json_grammar_new();
    fprintf(stderr, "g_json = %p\n", g_json);
    OOP s_src = string_stream_new(" [0, {\"N\":42}, true]\n");
    fprintf(stderr, "s_src = %p\n", s_src);
    OOP match = match_new(s_src, ((OOP)&empty_dict), ((OOP)&undef_object));
    fprintf(stderr, "match = %p\n", match);
    match = object_call(g_json, ((OOP)&match_symbol), match);
    fprintf(stderr, "match' = %p\n", match);
    ((void) sizeof ((match_kind == match->kind) ? 1 : 0), __extension__ ({ if (match_kind == match->kind) ; else __assert_fail ("match_kind == match->kind", "art.c", 523, __extension__ __PRETTY_FUNCTION__); }));
}

canonical_original_code:
void run_tests()
{
    fprintf(stderr, "o_undef = %p\n", ((OOP)&undef_object));
    fprintf(stderr, "o_fail = %p\n", ((OOP)&fail_object));
    fprintf(stderr, "o_nil = %p\n", ((OOP)&nil_object));
    fprintf(stderr, "o_true = %p\n", ((OOP)&_t_symbol));
    fprintf(stderr, "o_false = %p\n", ((OOP)&_f_symbol));
    fprintf(stderr, "s_eq_p = %p\n", ((OOP)&eq_p_symbol));
    fprintf(stderr, "&eq_p_symbol = %p\n", &eq_p_symbol);
    fprintf(stderr, "symbol_kind = %p\n", (void *)symbol_kind);
    fprintf(stderr, "eq_p_symbol.o.kind = %p\n", (void *)eq_p_symbol.o.kind);
    fprintf(stderr, "eq_p_symbol.s = \"%s\"\n", eq_p_symbol.s);
    fprintf(stderr, "dict_kind = %p\n", (void *)dict_kind);
    fprintf(stderr, "s_lookup = %p\n", ((OOP)&lookup_symbol));
    fprintf(stderr, "s_bind = %p\n", ((OOP)&bind_symbol));
    struct object *s_x = symbol_new("x");
    fprintf(stderr, "s_x = %p\n", s_x);
    fprintf(stderr, "as_symbol(s_x)->s = \"%s\"\n", ((struct symbol *)(s_x))->s);
    struct object *result = object_call(((OOP)&empty_dict), ((OOP)&lookup_symbol), s_x);
    fprintf(stderr, "result = %p\n", result);
    ((void) sizeof ((((OOP)&fail_object) == result) ? 1 : 0), __extension__ ({ if (((OOP)&fail_object) == result) ; else __assert_fail ("o_fail == result", "art.c", 398, __extension__ __PRETTY_FUNCTION__); }));
    struct object *n_42 = integer_new(42);
    fprintf(stderr, "n_42 = %p\n", n_42);
    fprintf(stderr, "as_integer(n_42)->n = %d\n", ((struct integer *)(n_42))->n);
    struct object *d_env = object_call(((OOP)&empty_dict), ((OOP)&bind_symbol), s_x, n_42);
    fprintf(stderr, "d_env = %p\n", d_env);
    result = object_call(d_env, ((OOP)&lookup_symbol), s_x);
    fprintf(stderr, "result = %p\n", result);
    ((void) sizeof ((n_42 == result) ? 1 : 0), __extension__ ({ if (n_42 == result) ; else __assert_fail ("n_42 == result", "art.c", 407, __extension__ __PRETTY_FUNCTION__); }));
    struct object *s_y = symbol_new("y");
    fprintf(stderr, "s_y = %p\n", s_y);
    fprintf(stderr, "as_symbol(s_y)->s = \"%s\"\n", ((struct symbol *)(s_y))->s);
    d_env = object_call(d_env, ((OOP)&bind_symbol), s_y, ((OOP)&minus_1_integer));
    fprintf(stderr, "d_env = %p\n", d_env);
    struct object *s_z = symbol_new("z");
    fprintf(stderr, "s_z = %p\n", s_z);
    fprintf(stderr, "as_symbol(s_z)->s = \"%s\"\n", ((struct symbol *)(s_z))->s);
    result = object_call(d_env, ((OOP)&lookup_symbol), s_z);
    fprintf(stderr, "result = %p\n", result);
    ((void) sizeof ((((OOP)&fail_object) == result) ? 1 : 0), __extension__ ({ if (((OOP)&fail_object) == result) ; else __assert_fail ("o_fail == result", "art.c", 420, __extension__ __PRETTY_FUNCTION__); }));
    struct object *ch_A = integer_new('A');
    struct object *ch_Z = integer_new('Z');
    struct object *q_oop = queue_new();
    fprintf(stderr, "q_oop = %p\n", q_oop);
    result = object_call(q_oop, ((OOP)&empty_p_symbol));
    ((void) sizeof ((((OOP)&_t_symbol) == result) ? 1 : 0), __extension__ ({ if (((OOP)&_t_symbol) == result) ; else __assert_fail ("o_true == result", "art.c", 427, __extension__ __PRETTY_FUNCTION__); }));
    struct object *n_ch = ch_A;
    while (object_call(n_ch, ((OOP)&eq_p_symbol), ch_Z) != ((OOP)&_t_symbol)) {
        q_oop = object_call(q_oop, ((OOP)&give_x_symbol), n_ch);
        fprintf(stderr, "q_oop = %p ^ [%c]\n", q_oop, ((struct integer *)(n_ch))->n);
        n_ch = object_call(n_ch, ((OOP)&add_symbol), ((OOP)&_1_integer));
    }
    result = object_call(q_oop, ((OOP)&empty_p_symbol));
    ((void) sizeof ((((OOP)&_f_symbol) == result) ? 1 : 0), __extension__ ({ if (((OOP)&_f_symbol) == result) ; else __assert_fail ("o_false == result", "art.c", 435, __extension__ __PRETTY_FUNCTION__); }));
    n_ch = ch_A;
    while (object_call(n_ch, ((OOP)&eq_p_symbol), ch_Z) != ((OOP)&_t_symbol)) {
        struct object *n_i = object_call(q_oop, ((OOP)&take_x_symbol));
        fprintf(stderr, "q_oop = [%c] ^ %p\n", ((struct integer *)(n_i))->n, q_oop);
        result = object_call(n_i, ((OOP)&eq_p_symbol), n_ch);
        ((void) sizeof ((((OOP)&_t_symbol) == result) ? 1 : 0), __extension__ ({ if (((OOP)&_t_symbol) == result) ; else __assert_fail ("o_true == result", "art.c", 441, __extension__ __PRETTY_FUNCTION__); }));
        n_ch = object_call(n_ch, ((OOP)&add_symbol), ((OOP)&_1_integer));
    }
    result = object_call(q_oop, ((OOP)&empty_p_symbol));
    ((void) sizeof ((((OOP)&_t_symbol) == result) ? 1 : 0), __extension__ ({ if (((OOP)&_t_symbol) == result) ; else __assert_fail ("o_true == result", "art.c", 445, __extension__ __PRETTY_FUNCTION__); }));
    fprintf(stderr, "---- expression evaluation ----\n");
    fprintf(stderr, "s_eval = %p\n", ((OOP)&eval_symbol));
    fprintf(stderr, "s_combine = %p\n", ((OOP)&combine_symbol));
    struct object *expr_const_42 = ((struct object *)object_new((const_expr_kind), sizeof(struct object)));
    fprintf(stderr, "expr_const_42 = %p\n", expr_const_42);
    struct object *expr_ident_x = ident_expr_new(s_x);
    fprintf(stderr, "expr_ident_x = %p\n", expr_ident_x);
    struct object *expr_example = combine_expr_new(
        lambda_expr_new(bind_pattern_new(s_x, ((OOP)&all_pattern)), expr_ident_x),
        expr_const_42);
    result = object_call(expr_example, ((OOP)&eval_symbol), ((OOP)&empty_dict));
    fprintf(stderr, "result = %p\n", result);
    ((void) sizeof ((expr_const_42 == result) ? 1 : 0), __extension__ ({ if (expr_const_42 == result) ; else __assert_fail ("expr_const_42 == result", "art.c", 462, __extension__ __PRETTY_FUNCTION__); }));
    fprintf(stderr, "n_0 = %p\n", ((OOP)&_0_integer));
    fprintf(stderr, "n_1 = %p\n", ((OOP)&_1_integer));
    struct object *ptrn_parm_x_y = and_pattern_new(
        bind_pattern_new(s_x, ((OOP)&any_pattern)),
        and_pattern_new(
            bind_pattern_new(s_y, ((OOP)&any_pattern)),
            ((OOP)&end_pattern)));
    struct object *list_0_1 = pair_new(((OOP)&_0_integer), pair_new(((OOP)&_1_integer), ((OOP)&nil_object)));
    expr_example = combine_expr_new(
        lambda_expr_new(
            ptrn_parm_x_y,
            ident_expr_new(s_y)),
        quote_expr_new(list_0_1));
    result = object_call(expr_example, ((OOP)&eval_symbol), ((OOP)&empty_dict));
    fprintf(stderr, "result = %p\n", result);
    ((void) sizeof ((((OOP)&_1_integer) == result) ? 1 : 0), __extension__ ({ if (((OOP)&_1_integer) == result) ; else __assert_fail ("n_1 == result", "art.c", 481, __extension__ __PRETTY_FUNCTION__); }));
    fprintf(stderr, "---- actor primitives ----\n");
    fprintf(stderr, "s_create_x = %p\n", ((OOP)&create_x_symbol));
    fprintf(stderr, "s_send_x = %p\n", ((OOP)&send_x_symbol));
    fprintf(stderr, "s_become_x = %p\n", ((OOP)&become_x_symbol));
    fprintf(stderr, "s_dispatch_x = %p\n", ((OOP)&dispatch_x_symbol));
    struct object *cfg = config_new();
    result = object_call(cfg, ((OOP)&dispatch_x_symbol), ((OOP)&_0_integer));
    fprintf(stderr, "result = %p\n", result);
    ((void) sizeof ((((OOP)&_t_symbol) == object_call(result, ((OOP)&eq_p_symbol), ((OOP)&_0_integer))) ? 1 : 0), __extension__ ({ if (((OOP)&_t_symbol) == object_call(result, ((OOP)&eq_p_symbol), ((OOP)&_0_integer))) ; else __assert_fail ("o_true == object_call(result, s_eq_p, n_0)", "art.c", 492, __extension__ __PRETTY_FUNCTION__); }));
    struct object *a_fwd = actor_new(one_shot_beh_new(((OOP)&sink_actor)));
    fprintf(stderr, "a_fwd = %p\n", a_fwd);
    struct object *event = event_new(a_fwd, n_42);
    fprintf(stderr, "event = %p\n", event);
    result = object_call(cfg, ((OOP)&give_x_symbol), event);
    fprintf(stderr, "result = %p\n", result);
    ((void) sizeof ((((OOP)&_t_symbol) == object_call(result, ((OOP)&eq_p_symbol), ((OOP)&_1_integer))) ? 1 : 0), __extension__ ({ if (((OOP)&_t_symbol) == object_call(result, ((OOP)&eq_p_symbol), ((OOP)&_1_integer))) ; else __assert_fail ("o_true == object_call(result, s_eq_p, n_1)", "art.c", 501, __extension__ __PRETTY_FUNCTION__); }));
    event = event_new(a_fwd, ((OOP)&_1_integer));
    fprintf(stderr, "event = %p\n", event);
    result = object_call(cfg, ((OOP)&give_x_symbol), event);
    fprintf(stderr, "result = %p\n", result);
    ((void) sizeof ((((OOP)&_t_symbol) == object_call(result, ((OOP)&eq_p_symbol), ((OOP)&_2_integer))) ? 1 : 0), __extension__ ({ if (((OOP)&_t_symbol) == object_call(result, ((OOP)&eq_p_symbol), ((OOP)&_2_integer))) ; else __assert_fail ("o_true == object_call(result, s_eq_p, n_2)", "art.c", 506, __extension__ __PRETTY_FUNCTION__); }));
    struct object *n_5 = integer_new(5);
    result = object_call(cfg, ((OOP)&dispatch_x_symbol), n_5);
    fprintf(stderr, "result = %p\n", result);
    ((void) sizeof ((((OOP)&_t_symbol) == object_call(result, ((OOP)&eq_p_symbol), ((OOP)&_0_integer))) ? 1 : 0), __extension__ ({ if (((OOP)&_t_symbol) == object_call(result, ((OOP)&eq_p_symbol), ((OOP)&_0_integer))) ; else __assert_fail ("o_true == object_call(result, s_eq_p, n_0)", "art.c", 511, __extension__ __PRETTY_FUNCTION__); }));
    fprintf(stderr, "---- json parser ----\n");
    struct object *g_json = json_grammar_new();
    fprintf(stderr, "g_json = %p\n", g_json);
    struct object *s_src = string_stream_new(" [0, {\"N\":42}, true]\n");
    fprintf(stderr, "s_src = %p\n", s_src);
    struct object *match = match_new(s_src, ((OOP)&empty_dict), ((OOP)&undef_object));
    fprintf(stderr, "match = %p\n", match);
    match = object_call(g_json, ((OOP)&match_symbol), match);
    fprintf(stderr, "match' = %p\n", match);
    ((void) sizeof ((match_kind == match->kind) ? 1 : 0), __extension__ ({ if (match_kind == match->kind) ; else __assert_fail ("match_kind == match->kind", "art.c", 523, __extension__ __PRETTY_FUNCTION__); }));
}

return_type: void


main

canonical_name: main

decompiled_code:
int __cdecl main(int argc, const char **argv, const char **envp)
{
run_tests();
return 0;
}

canonical_decompiled_code:
int __cdecl main(int argc, const char **argv, const char **envp)
{
func0();
return 0;
}

original_code:
int
main()
{
    run_tests();
    return 0;
}

canonical_original_code:
int main()
{
    run_tests();
    return 0;
}

return_type: int


decompiled_code:
__int64 object_call(__int64 (__fastcall **a1)(_QWORD, __va_list_tag *), ...)
{
gcc_va_list va; // [rsp+8h] [rbp-D0h] BYREF

va_start(va, a1);
return (*a1)(a1, va);
}

canonical_decompiled_code:
__int64 func0(__int64 (__fastcall **a1)(_QWORD, __va_list_tag *), ...)
{
gcc_va_list va; // [rsp+8h] [rbp-D0h] BYREF

va_start(va, a1);
return (*a1)(a1, va);
}

original_code:
OOP
object_call(OOP obj, ...)
{
    va_list args;
    __builtin_va_start(args,obj);
    OOP result = (obj->kind)(obj, args);
    __builtin_va_end(args);
    return result;
}

canonical_original_code:
struct object *object_call(struct object *obj, ...)
{
    __builtin_va_list args;
    __builtin_va_start(args,obj);
    struct object *result = (obj->kind)(obj, args);
    __builtin_va_end(args);
    return result;
}

variable_types:
obj
struct object *


halt

repo: organix/tart

decompiled_code:
void __fastcall __noreturn halt(const char *a1)
{
fprintf(stderr, "%s **** HALTED ****\n", a1);
_assert_fail("0", "tart.c", 0x28u, "halt");
}

canonical_decompiled_code:
void __fastcall __noreturn func0(const char *a1)
{
fprintf(stderr, "%s **** HALTED ****\n", a1);
_assert_fail("0", "tart.c", 0x28u, "halt");
}

original_code:
void
halt(char * msg)
{
    fprintf(stderr, "%s **** HALTED ****\n", msg);
    ((void) sizeof ((0) ? 1 : 0), __extension__ ({ if (0) ; else __assert_fail ("0", "tart.c", 40, __extension__ __PRETTY_FUNCTION__); }));
    for (;;)
        ;
}

canonical_original_code:
void halt(char *msg)
{
    fprintf(stderr, "%s **** HALTED ****\n", msg);
    ((void) sizeof ((0) ? 1 : 0), __extension__ ({ if (0) ; else __assert_fail ("0", "tart.c", 40, __extension__ __PRETTY_FUNCTION__); }));
    for (;;)
        ;
}

variable_types:
msg
char *


decompiled_code:
__int64 run_tests()
{
fwrite("---- tart unit tests ----\n", 1uLL, 0x1AuLL, stderr);
fprintf(stderr, "NIL = %p\n", &the_nil_pair_actor);
fprintf(stderr, "NOTHING = %p\n", &the_halt_actor);
fprintf(stderr, "a_halt = %p\n", &the_halt_actor);
fprintf(stderr, "a_ignore = %p\n", &the_ignore_actor);
fprintf(stderr, "e_nomem = %p\n", &fail_reason_nomem);
fprintf(stderr, "e_inval = %p\n", &fail_reason_inval);
test_number();
test_string();
test_expr();
return test_universe();
}

canonical_decompiled_code:
__int64 func1()
{
fwrite("---- tart unit tests ----\n", 1uLL, 0x1AuLL, stderr);
fprintf(stderr, "NIL = %p\n", &the_nil_pair_actor);
fprintf(stderr, "NOTHING = %p\n", &the_halt_actor);
fprintf(stderr, "a_halt = %p\n", &the_halt_actor);
fprintf(stderr, "a_ignore = %p\n", &the_ignore_actor);
fprintf(stderr, "e_nomem = %p\n", &fail_reason_nomem);
fprintf(stderr, "e_inval = %p\n", &fail_reason_inval);
test_number();
test_string();
test_expr();
return test_universe();
}

original_code:
void
run_tests()
{
    fprintf(stderr, "---- tart unit tests ----\n");
    fprintf(stderr, "NIL = %p\n", ((Actor)(&the_nil_pair_actor)));
    fprintf(stderr, "NOTHING = %p\n", ((Actor)(&the_halt_actor)));
    fprintf(stderr, "a_halt = %p\n", ((Actor)(&the_halt_actor)));
    fprintf(stderr, "a_ignore = %p\n", ((Actor)(&the_ignore_actor)));
    fprintf(stderr, "e_nomem = %p\n", ((Actor)(&fail_reason_nomem)));
    fprintf(stderr, "e_inval = %p\n", ((Actor)(&fail_reason_inval)));
    test_number();
    test_string();
    test_expr();
    test_universe();
}


main

decompiled_code:
int __cdecl main(int argc, const char **argv, const char **envp)
{
run_tests(argc, argv, envp);
return 0;
}

canonical_decompiled_code:
int __cdecl main(int argc, const char **argv, const char **envp)
{
func1(argc, argv, envp);
return 0;
}


decompiled_code:
__int16 __fastcall u16_load(_WORD *a1)
{
return __ROL2__(*a1, 8);
}

canonical_decompiled_code:
__int16 __fastcall func2(_WORD *a1)
{
return __ROL2__(*a1, 8);
}

original_code:
inline uint16_t
u16_load(uint8_t* p)
{
    return ((p[0] << 8) | p[1]);
}

canonical_original_code:
inline unsigned short u16_load(unsigned char *p)
{
    return ((p[0] << 8) | p[1]);
}

variable_types:
p
unsigned char *

return_type: unsigned short


decompiled_code:
__int64 __fastcall u32_load(unsigned int *a1)
{
return _byteswap_ulong(*a1);
}

canonical_decompiled_code:
__int64 __fastcall func4(unsigned int *a1)
{
return _byteswap_ulong(*a1);
}

canonical_original_code:
inline unsigned int u32_load(unsigned char *p)
{
    return ((p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3]);
}

return_type: unsigned int


original_code:
inline uint32_t
u32_getbits(uint8_t* p, int n, int m)
{
    p += (n >> 3);
    int lb = n & 0x7;
    int rb = (8 - lb);
    int rm = 0xFF >> lb;
    uint32_t b = *p++;
    b &= rm;
    if (m <= rb) {
        b >>= (rb - m);
        return b;
    }
    m -= rb;
    while (m >= 8) {
        b <<= 8;
        b |= *p++;
        m -= 8;
    }
    lb = (8 - m);
    b <<= m;
    b |= (*p >> lb);
    return b;
}

canonical_original_code:
inline unsigned int u32_getbits(unsigned char *p, int n, int m)
{
    p += (n >> 3);
    int lb = n & 0x7;
    int rb = (8 - lb);
    int rm = 0xFF >> lb;
    unsigned int b = *p++;
    b &= rm;
    if (m <= rb) {
        b >>= (rb - m);
        return b;
    }
    m -= rb;
    while (m >= 8) {
        b <<= 8;
        b |= *p++;
        m -= 8;
    }
    lb = (8 - m);
    b <<= m;
    b |= (*p >> lb);
    return b;
}

variable_types: n int

variable_types: m int

variable_types: lb int

variable_types: rb int

variable_types: rm int

variable_types:
b
unsigned int


decompiled_code:
int __fastcall test_getbits(int a1, int a2, unsigned int a3)
{
__int64 v3; // rbx
__int64 v4; // rax
unsigned int v5; // er11
unsigned int v6; // er10
int v7; // ebp
int result; // eax
int v9; // [rsp+Ah] [rbp-1Eh] BYREF
__int16 v10; // [rsp+Eh] [rbp-1Ah]

v3 = a3;
v10 = 0;
v9 = 0;
*((_BYTE *)&v9 + (a1 >> 3)) |= 128 >> (a1 & 7);
*((_BYTE *)&v9 + ((a1 + a2 - 1) >> 3)) |= 128 >> ((a1 + a2 - 1) & 7);
v4 = u32_getbits((__int64)&v9, a1, a2);
v7 = v4;
result = fprintf(
stderr,
"test_getbits{n=%d, m=%d, buf=%02x%02x%02x%02x%02x%02x, expect=%08x, actual=%08x}\n",
v6,
v5,
(unsigned __int8)v9,
BYTE1(v9),
BYTE2(v9),
HIBYTE(v9),
(unsigned __int8)v10,
HIBYTE(v10),
v3,
v4);
if ( v7 != (_DWORD)v3 )
result = halt("test_getbits() failed");
return result;
}

canonical_decompiled_code:
int __fastcall func7(int a1, int a2, unsigned int a3)
{
__int64 v3; // rbx
__int64 v4; // rax
unsigned int v5; // er11
unsigned int v6; // er10
int v7; // ebp
int result; // eax
int v9; // [rsp+Ah] [rbp-1Eh] BYREF
__int16 v10; // [rsp+Eh] [rbp-1Ah]

v3 = a3;
v10 = 0;
v9 = 0;
*((_BYTE *)&v9 + (a1 >> 3)) |= 128 >> (a1 & 7);
*((_BYTE *)&v9 + ((a1 + a2 - 1) >> 3)) |= 128 >> ((a1 + a2 - 1) & 7);
v4 = func6((__int64)&v9, a1, a2);
v7 = v4;
result = fprintf(
stderr,
"test_getbits{n=%d, m=%d, buf=%02x%02x%02x%02x%02x%02x, expect=%08x, actual=%08x}\n",
v6,
v5,
(unsigned __int8)v9,
BYTE1(v9),
BYTE2(v9),
HIBYTE(v9),
(unsigned __int8)v10,
HIBYTE(v10),
v3,
v4);
if ( v7 != (_DWORD)v3 )
result = halt("test_getbits() failed");
return result;
}

original_code:
void
test_getbits(int n, int m, uint32_t expect)
{
    uint8_t buf[] = { 0, 0, 0, 0, 0, 0 };
    uint8_t b = (0x80 >> (n & 0x7));
    buf[n >> 3] |= b;
    int x = n + m - 1;
    b = (0x80 >> (x & 0x7));
    buf[x >> 3] |= b;
    uint32_t actual = u32_getbits(buf, n, m);
    fprintf(stderr, "test_getbits{n=%d, m=%d, buf=%02x%02x%02x%02x%02x%02x, expect=%08x, actual=%08x}\n", n, m, buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], expect, actual);
    if (expect != actual) { halt("test_getbits() failed"); }
}

canonical_original_code:
void test_getbits(int n, int m, unsigned int expect)
{
    unsigned char buf[] = { 0, 0, 0, 0, 0, 0 };
    unsigned char b = (0x80 >> (n & 0x7));
    buf[n >> 3] |= b;
    int x = n + m - 1;
    b = (0x80 >> (x & 0x7));
    buf[x >> 3] |= b;
    unsigned int actual = u32_getbits(buf, n, m);
    fprintf(stderr, "test_getbits{n=%d, m=%d, buf=%02x%02x%02x%02x%02x%02x, expect=%08x, actual=%08x}\n", n, m, buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], expect, actual);
    if (expect != actual) { halt("test_getbits() failed"); }
}

variable_types:
expect
unsigned int

variable_types:
buf
unsigned char []

variable_types:
b
unsigned char

variable_types: x int

variable_types:
actual
unsigned int


die

repo: oridb/mc

decompiled_code:
void __noreturn die(char *format, ...)
{
gcc_va_list arg; // [rsp+8h] [rbp-D0h] BYREF

va_start(arg, format);
vfprintf(stderr, format, arg);
fputc(10, stderr);
abort();
}

canonical_decompiled_code:
void __noreturn func0(char *format, ...)
{
gcc_va_list arg; // [rsp+8h] [rbp-D0h] BYREF

va_start(arg, format);
vfprintf(stderr, format, arg);
fputc(10, stderr);
abort();
}

original_code:
void
die(char *msg, ...)
{
 va_list ap;
 __builtin_va_start(ap,msg);
 vfprintf(stderr, msg, ap);
 fprintf(stderr, "\n");
 __builtin_va_end(ap);
 abort();
}

canonical_original_code:
void die(char *msg, ...)
{
 __builtin_va_list ap;
 __builtin_va_start(ap,msg);
 vfprintf(stderr, msg, ap);
 fprintf(stderr, "\n");
 __builtin_va_end(ap);
 abort();
}


lfatalv

decompiled_code:
void __fastcall __noreturn lfatalv(__int64 a1, const char *a2, void *a3)
{
unsigned int v4; // er14
const char *v5; // rax

v4 = lnum();
v5 = (const char *)fname(a1);
fprintf(stdout, "%s:%d: ", v5, v4);
vfprintf(stdout, a2, a3);
fputc(10, stdout);
exit(1);
}

canonical_decompiled_code:
void __fastcall __noreturn func1(__int64 a1, const char *a2, void *a3)
{
unsigned int v4; // er14
const char *v5; // rax

v4 = lnum();
v5 = (const char *)fname(a1);
fprintf(stdout, "%s:%d: ", v5, v4);
vfprintf(stdout, a2, a3);
fputc(10, stdout);
exit(1);
}

original_code:
void
lfatalv(Srcloc l, char *msg, va_list ap)
{
 fprintf(stdout, "%s:%d: ", fname(l), lnum(l));
 vfprintf(stdout, msg, ap);
 fprintf(stdout, "\n");
 exit(1);
}

canonical_original_code:
void lfatalv(struct Srcloc l, char *msg, __builtin_va_list ap)
{
 fprintf(stdout, "%s:%d: ", fname(l), lnum(l));
 vfprintf(stdout, msg, ap);
 fprintf(stdout, "\n");
 exit(1);
}

variable_types:
l
struct Srcloc { int line; int file; }


fatal

decompiled_code:
void __noreturn fatal(__int64 *a1, const char *a2, ...)
{
gcc_va_list va; // [rsp+8h] [rbp-D0h] BYREF

va_start(va, a2);
lfatalv(*a1, a2, va);
}

canonical_decompiled_code:
void __noreturn func2(__int64 *a1, const char *a2, ...)
{
gcc_va_list va; // [rsp+8h] [rbp-D0h] BYREF

va_start(va, a2);
func1(*a1, a2, va);
}

original_code:
void
fatal(Node *n, char *msg, ...)
{
 va_list ap;
 __builtin_va_start(ap,msg);
 lfatalv(n->loc, msg, ap);
 __builtin_va_end(ap);
}

canonical_original_code:
void fatal(struct Node *n, char *msg, ...)
{
 __builtin_va_list ap;
 __builtin_va_start(ap,msg);
 lfatalv(n->loc, msg, ap);
 __builtin_va_end(ap);
}

variable_types: struct Node { struct Srcloc { int line; int file; } loc; enum Ntype { Nnone=0, Nblock=1, Nifstmt=2, Nloopstmt=3, Niterstmt=4, Nmatchstmt=5, Nmatch=6, Nuse=7, Nexpr=8, Nlit=9, Nname=10, Ndecl=11, Nfunc=12, Nimpl=13 } type; int nid; char inferred; union { struct { enum Op { Obad=0, Oauto=1, Oadd=2, Osub=3, Omul=4, Odiv=5, Omod=6, Oneg=7, Obor=8, Oband=9, Obxor=10, Obsl=11, Obsr=12, Obnot=13, Opreinc=14, Opostinc=15, Opredec=16, Opostdec=17, Oaddr=18, Oderef=19, Olor=20, Oland=21, Olnot=22, Oeq=23, One=24, Ogt=25, Oge=26, Olt=27, Ole=28, Oasn=29, Oaddeq=30, Osubeq=31, Omuleq=32, Odiveq=33, Omodeq=34, Oboreq=35, Obandeq=36, Obxoreq=37, Obsleq=38, Obsreq=39, Oidx=40, Oslice=41, Omemb=42, Otupmemb=43, Osize=44, Ocall=45, Ocast=46, Oret=47, Ojmp=48, Obreak=49, Ocontinue=50, Ovar=51, Ogap=52, Olit=53, Oucon=54, Otup=55, Ostruct=56, Oarr=57, Otern=58, Odead=59, Oundef=60, Odef=61, Ocjmp=62, Ovjmp=63, Oset=64, Osllen=65, Oslbase=66, Outag=67, Oudata=68, Otupget=69, Oblit=70, Oclear=71, Ocallind=72, Otrunc=73, Ozwiden=74, Oswiden=75, Oflt2int=76, Oint2flt=77, Oflt2flt=78, Ofadd=79, Ofsub=80, Ofmul=81, Ofdiv=82, Ofneg=83, Ofeq=84, Ofne=85, Ofgt=86, Ofge=87, Oflt=88, Ofle=89, Oueq=90, Oune=91, Ougt=92, Ouge=93, Oult=94, Oule=95, Numops=96 } op; struct Type { enum Ty { Tybad=0, Tyvoid=1, Tybool=2, Tychar=3, Tyint8=4, Tyint16=5, Tyint=6, Tyint32=7, Tyint64=8, Tybyte=9, Tyuint8=10, Tyuint16=11, Tyuint=12, Tyuint32=13, Tyuint64=14, Tyflt32=15, Tyflt64=16, Tyvalist=17, Typtr=18, Tyfunc=19, Tyslice=20, Tyarray=21, Tytuple=22, Tystruct=23, Tyunion=24, Tyvar=25, Typaram=26, Tyunres=27, Tyname=28, Tygeneric=29, Tycode=30, Ntypes=31 } type; unsigned int tid; struct Srcloc loc; enum Vis { Visintern=0, Visexport=1, Vishidden=2, Visbuiltin=3 } vis; struct Traitspec { struct Node **trait; unsigned long ntrait; struct Type *param; struct Type *aux; } **spec; unsigned long nspec; struct Type *seqaux; struct Type **gparam; unsigned long ngparam; struct Type **arg; unsigned long narg; struct Type **inst; unsigned long ninst; struct Tyenv { struct Tyenv *super; struct Htab { unsigned long nelt; unsigned long ndead; unsigned long sz; unsigned long (*hash)(void *k); int (*cmp)(void *a, void *b); void **keys; void **vals; unsigned long *hashes; char *dead; } *tab; } *env; struct Type **sub; unsigned long nsub; unsigned long nmemb; struct Bitset { unsigned long nchunks; unsigned long *chunks; } *trneed; union { struct Node *name; struct Node *asize; char *pname; struct Node **sdecls; struct Ucon { struct Srcloc loc; unsigned long id; int synth; struct Node *name; struct Type *utype; struct Type *etype; } **udecls; }; char hasparams; char isenum; char ishidden; char ispkglocal; char isimport; char isreflect; char isemitted; char resolved; char fixed; char tagged; } *type; struct Type *param; int isconst; int ispat; unsigned long did; unsigned long nargs; struct Node *idx; struct Node **args; } expr; struct { char *ns; char *name; } name; struct { int islocal; char *name; } use; struct { enum Littype { Lchr=0, Lbool=1, Lint=2, Lflt=3, Lstr=4, Lfunc=5, Llbl=6, Lvoid=7 } littype; struct Type *type; unsigned long nelt; union { unsigned long long intval; double fltval; unsigned int chrval; struct Str { unsigned long len; char *buf; } strval; struct { char *lblval; char *lblname; }; int boolval; struct Node *fnval; }; } lit; struct { struct Node *init; struct Node *cond; struct Node *step; struct Node *body; struct Stab { struct Stab *super; char *name; char isfunc; struct Htab *dcl; struct Htab *env; struct Htab *ty; struct Htab *tr; struct Htab *uc; struct Htab *lbl; struct Htab *impl; struct Node **autotmp; unsigned long nautotmp; struct Node *exit[-1]; unsigned long ndisposed[-1]; } *scope; } loopstmt; struct { struct Node *elt; struct Node *seq; struct Node *body; } iterstmt; struct { struct Node *cond; struct Node *iftrue; struct Node *iffalse; } ifstmt; struct { struct Node *val; unsigned long nmatches; struct Node **matches; } matchstmt; struct { struct Node *pat; struct Node *block; } match; struct { struct Stab *scope; unsigned long nstmts; struct Node **stmts; } block; struct { unsigned long did; struct Node *name; struct Type *type; struct Node *init; struct Tyenv *env; struct Trait { int uid; struct Srcloc loc; enum Vis { Visintern=0, Visexport=1, Vishidden=2, Visbuiltin=3 } vis; struct Node *name; struct Type *param; struct Type **aux; unsigned long naux; struct Node **proto; unsigned long nproto; struct Tyenv *env; char isproto; char ishidden; char isimport; } *trait; struct Htab *impls; struct Node **gimpl; unsigned long ngimpl; struct Node **gtype; unsigned long ngtype; char vis; char isglobl; char isconst; char isgeneric; char isextern; char ispkglocal; char ishidden; char isimport; char isnoret; char isexportval; char isinit; char isfini; } decl; struct { struct Tyenv *env; struct Stab *scope; struct Type *type; unsigned long nargs; struct Node **args; struct Node *body; } func; struct { struct Node *traitname; struct Trait *trait; struct Type *type; struct Type **aux; struct Tyenv *env; unsigned long naux; struct Node **decls; unsigned long ndecls; enum Vis { Visintern=0, Visexport=1, Vishidden=2, Visbuiltin=3 } vis; char isproto; char isextern; } impl; }; } *

user_defined_types: struct Node { struct Srcloc loc; enum Ntype type; int nid; char inferred; union { struct { enum Op op; struct Type *type; struct Type *param; int isconst; int ispat; unsigned long did; unsigned long nargs; struct Node *idx; struct Node **args; } expr; struct { char *ns; char *name; } name; struct { int islocal; char *name; } use; struct { enum Littype littype; struct Type *type; unsigned long nelt; union { unsigned long long intval; double fltval; unsigned int chrval; struct Str strval; struct { char *lblval; char *lblname; }; int boolval; struct Node *fnval; }; } lit; struct { struct Node *init; struct Node *cond; struct Node *step; struct Node *body; struct Stab *scope; } loopstmt; struct { struct Node *elt; struct Node *seq; struct Node *body; } iterstmt; struct { struct Node *cond; struct Node *iftrue; struct Node *iffalse; } ifstmt; struct { struct Node *val; unsigned long nmatches; struct Node **matches; } matchstmt; struct { struct Node *pat; struct Node *block; } match; struct { struct Stab *scope; unsigned long nstmts; struct Node **stmts; } block; struct { unsigned long did; struct Node *name; struct Type *type; struct Node *init; struct Tyenv *env; struct Trait *trait; struct Htab *impls; struct Node **gimpl; unsigned long ngimpl; struct Node **gtype; unsigned long ngtype; char vis; char isglobl; char isconst; char isgeneric; char isextern; char ispkglocal; char ishidden; char isimport; char isnoret; char isexportval; char isinit; char isfini; } decl; struct { struct Tyenv *env; struct Stab *scope; struct Type *type; unsigned long nargs; struct Node **args; struct Node *body; } func; struct { struct Node *traitname; struct Trait *trait; struct Type *type; struct Type **aux; struct Tyenv *env; unsigned long naux; struct Node **decls; unsigned long ndecls; enum Vis vis; char isproto; char isextern; } impl; }; }

user_defined_types: struct Type { enum Ty type; unsigned int tid; struct Srcloc loc; enum Vis vis; struct Traitspec **spec; unsigned long nspec; struct Type *seqaux; struct Type **gparam; unsigned long ngparam; struct Type **arg; unsigned long narg; struct Type **inst; unsigned long ninst; struct Tyenv *env; struct Type **sub; unsigned long nsub; unsigned long nmemb; struct Bitset *trneed; union { struct Node *name; struct Node *asize; char *pname; struct Node **sdecls; struct Ucon **udecls; }; char hasparams; char isenum; char ishidden; char ispkglocal; char isimport; char isreflect; char isemitted; char resolved; char fixed; char tagged; }

user_defined_types: struct Trait { int uid; struct Srcloc loc; enum Vis vis; struct Node *name; struct Type *param; struct Type **aux; unsigned long naux; struct Node **proto; unsigned long nproto; struct Tyenv *env; char isproto; char ishidden; char isimport; }

user_defined_types: struct Tyenv { struct Tyenv *super; struct Htab *tab; }


lfatal

decompiled_code:
void __noreturn lfatal(__int64 a1, const char *a2, ...)
{
gcc_va_list va; // [rsp+8h] [rbp-D0h] BYREF

va_start(va, a2);
lfatalv(a1, a2, va);
}

canonical_decompiled_code:
void __noreturn func3(__int64 a1, const char *a2, ...)
{
gcc_va_list va; // [rsp+8h] [rbp-D0h] BYREF

va_start(va, a2);
func1(a1, a2, va);
}

original_code:
void
lfatal(Srcloc l, char *msg, ...)
{
 va_list ap;
 __builtin_va_start(ap,msg);
 lfatalv(l, msg, ap);
 __builtin_va_end(ap);
}

canonical_original_code:
void lfatal(struct Srcloc l, char *msg, ...)
{
 __builtin_va_list ap;
 __builtin_va_start(ap,msg);
 lfatalv(l, msg, ap);
 __builtin_va_end(ap);
}


bshas

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

result = 0LL;
if ( *a1 << 6 > a2 )
result = (*(_QWORD *)(a1[1] + 8 * (a2 >> 6)) >> (a2 & 0x3F)) & 1LL;
return result;
}

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

result = 0LL;
if ( *a1 << 6 > a2 )
result = (*(_QWORD *)(a1[1] + 8 * (a2 >> 6)) >> (a2 & 0x3F)) & 1LL;
return result;
}

original_code:
static inline int bshas(Bitset *bs, size_t elt)
{
 size_t eltidx, eltshift;
 if (elt >= bs->nchunks * 8 * sizeof(size_t))
  return 0;
 eltidx = elt / (8 * sizeof(size_t));
 eltshift = elt % (8 * sizeof(size_t));
 return (bs->chunks[eltidx] & (1ULL << eltshift)) != 0;
}

canonical_original_code:
static inline int bshas(struct Bitset *bs, unsigned long elt)
{
 unsigned long eltidx; unsigned long eltshift;
 if (elt >= bs->nchunks * 8 * sizeof(unsigned long))
  return 0;
 eltidx = elt / (8 * sizeof(unsigned long));
 eltshift = elt % (8 * sizeof(unsigned long));
 return (bs->chunks[eltidx] & (1ULL << eltshift)) != 0;
}

variable_types: struct Bitset { unsigned long nchunks; unsigned long *chunks; } *

variable_types:
elt
unsigned long

variable_types:
eltidx
unsigned long

variable_types:
eltshift
unsigned long


strlabel

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

result = htget(*(_QWORD *)(a1 + 48));
if ( a3 != result )
{
htput(*(_QWORD *)(a1 + 48), a2, a3);
result = lappend(a3 + 8, a3 + 16, a2);
}
return result;
}

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

result = htget(*(_QWORD *)(a1 + 48));
if ( a3 != result )
{
htput(*(_QWORD *)(a1 + 48), a2, a3);
result = lappend(a3 + 8, a3 + 16, a2);
}
return result;
}

original_code:
static void
strlabel(Cfg *cfg, char *lbl, Bb *bb)
{
 if (htget(cfg->lblmap, lbl) != bb) {
  htput(cfg->lblmap, lbl, bb);
  lappend(&bb->lbls, &bb->nlbls, lbl);
 }
}

canonical_original_code:
static void strlabel(struct Cfg *cfg, char *lbl, struct Bb *bb)
{
 if (htget(cfg->lblmap, lbl) != bb) {
  htput(cfg->lblmap, lbl, bb);
  lappend(&bb->lbls, &bb->nlbls, lbl);
 }
}

variable_types: struct Cfg { struct Node { struct Srcloc { int line; int file; } loc; enum Ntype { Nnone=0, Nblock=1, Nifstmt=2, Nloopstmt=3, Niterstmt=4, Nmatchstmt=5, Nmatch=6, Nuse=7, Nexpr=8, Nlit=9, Nname=10, Ndecl=11, Nfunc=12, Nimpl=13 } type; int nid; char inferred; union { struct { enum Op { Obad=0, Oauto=1, Oadd=2, Osub=3, Omul=4, Odiv=5, Omod=6, Oneg=7, Obor=8, Oband=9, Obxor=10, Obsl=11, Obsr=12, Obnot=13, Opreinc=14, Opostinc=15, Opredec=16, Opostdec=17, Oaddr=18, Oderef=19, Olor=20, Oland=21, Olnot=22, Oeq=23, One=24, Ogt=25, Oge=26, Olt=27, Ole=28, Oasn=29, Oaddeq=30, Osubeq=31, Omuleq=32, Odiveq=33, Omodeq=34, Oboreq=35, Obandeq=36, Obxoreq=37, Obsleq=38, Obsreq=39, Oidx=40, Oslice=41, Omemb=42, Otupmemb=43, Osize=44, Ocall=45, Ocast=46, Oret=47, Ojmp=48, Obreak=49, Ocontinue=50, Ovar=51, Ogap=52, Olit=53, Oucon=54, Otup=55, Ostruct=56, Oarr=57, Otern=58, Odead=59, Oundef=60, Odef=61, Ocjmp=62, Ovjmp=63, Oset=64, Osllen=65, Oslbase=66, Outag=67, Oudata=68, Otupget=69, Oblit=70, Oclear=71, Ocallind=72, Otrunc=73, Ozwiden=74, Oswiden=75, Oflt2int=76, Oint2flt=77, Oflt2flt=78, Ofadd=79, Ofsub=80, Ofmul=81, Ofdiv=82, Ofneg=83, Ofeq=84, Ofne=85, Ofgt=86, Ofge=87, Oflt=88, Ofle=89, Oueq=90, Oune=91, Ougt=92, Ouge=93, Oult=94, Oule=95, Numops=96 } op; struct Type { enum Ty { Tybad=0, Tyvoid=1, Tybool=2, Tychar=3, Tyint8=4, Tyint16=5, Tyint=6, Tyint32=7, Tyint64=8, Tybyte=9, Tyuint8=10, Tyuint16=11, Tyuint=12, Tyuint32=13, Tyuint64=14, Tyflt32=15, Tyflt64=16, Tyvalist=17, Typtr=18, Tyfunc=19, Tyslice=20, Tyarray=21, Tytuple=22, Tystruct=23, Tyunion=24, Tyvar=25, Typaram=26, Tyunres=27, Tyname=28, Tygeneric=29, Tycode=30, Ntypes=31 } type; unsigned int tid; struct Srcloc loc; enum Vis { Visintern=0, Visexport=1, Vishidden=2, Visbuiltin=3 } vis; struct Traitspec { struct Node **trait; unsigned long ntrait; struct Type *param; struct Type *aux; } **spec; unsigned long nspec; struct Type *seqaux; struct Type **gparam; unsigned long ngparam; struct Type **arg; unsigned long narg; struct Type **inst; unsigned long ninst; struct Tyenv { struct Tyenv *super; struct Htab { unsigned long nelt; unsigned long ndead; unsigned long sz; unsigned long (*hash)(void *k); int (*cmp)(void *a, void *b); void **keys; void **vals; unsigned long *hashes; char *dead; } *tab; } *env; struct Type **sub; unsigned long nsub; unsigned long nmemb; struct Bitset { unsigned long nchunks; unsigned long *chunks; } *trneed; union { struct Node *name; struct Node *asize; char *pname; struct Node **sdecls; struct Ucon { struct Srcloc loc; unsigned long id; int synth; struct Node *name; struct Type *utype; struct Type *etype; } **udecls; }; char hasparams; char isenum; char ishidden; char ispkglocal; char isimport; char isreflect; char isemitted; char resolved; char fixed; char tagged; } *type; struct Type *param; int isconst; int ispat; unsigned long did; unsigned long nargs; struct Node *idx; struct Node **args; } expr; struct { char *ns; char *name; } name; struct { int islocal; char *name; } use; struct { enum Littype { Lchr=0, Lbool=1, Lint=2, Lflt=3, Lstr=4, Lfunc=5, Llbl=6, Lvoid=7 } littype; struct Type *type; unsigned long nelt; union { unsigned long long intval; double fltval; unsigned int chrval; struct Str { unsigned long len; char *buf; } strval; struct { char *lblval; char *lblname; }; int boolval; struct Node *fnval; }; } lit; struct { struct Node *init; struct Node *cond; struct Node *step; struct Node *body; struct Stab { struct Stab *super; char *name; char isfunc; struct Htab *dcl; struct Htab *env; struct Htab *ty; struct Htab *tr; struct Htab *uc; struct Htab *lbl; struct Htab *impl; struct Node **autotmp; unsigned long nautotmp; struct Node *exit[-1]; unsigned long ndisposed[-1]; } *scope; } loopstmt; struct { struct Node *elt; struct Node *seq; struct Node *body; } iterstmt; struct { struct Node *cond; struct Node *iftrue; struct Node *iffalse; } ifstmt; struct { struct Node *val; unsigned long nmatches; struct Node **matches; } matchstmt; struct { struct Node *pat; struct Node *block; } match; struct { struct Stab *scope; unsigned long nstmts; struct Node **stmts; } block; struct { unsigned long did; struct Node *name; struct Type *type; struct Node *init; struct Tyenv *env; struct Trait { int uid; struct Srcloc loc; enum Vis { Visintern=0, Visexport=1, Vishidden=2, Visbuiltin=3 } vis; struct Node *name; struct Type *param; struct Type **aux; unsigned long naux; struct Node **proto; unsigned long nproto; struct Tyenv *env; char isproto; char ishidden; char isimport; } *trait; struct Htab *impls; struct Node **gimpl; unsigned long ngimpl; struct Node **gtype; unsigned long ngtype; char vis; char isglobl; char isconst; char isgeneric; char isextern; char ispkglocal; char ishidden; char isimport; char isnoret; char isexportval; char isinit; char isfini; } decl; struct { struct Tyenv *env; struct Stab *scope; struct Type *type; unsigned long nargs; struct Node **args; struct Node *body; } func; struct { struct Node *traitname; struct Trait *trait; struct Type *type; struct Type **aux; struct Tyenv *env; unsigned long naux; struct Node **decls; unsigned long ndecls; enum Vis { Visintern=0, Visexport=1, Vishidden=2, Visbuiltin=3 } vis; char isproto; char isextern; } impl; }; } *fn; struct Bb { int id; char **lbls; unsigned long nlbls; struct Node **nl; unsigned long nnl; struct Bitset *pred; struct Bitset *succ; } **bb; struct Bb *start; struct Bb *end; unsigned long nbb; int nextbbid; struct Htab *lblmap; struct Node **fixjmp; unsigned long nfixjmp; struct Bb **fixblk; unsigned long nfixblk; } *

variable_types:
lbl
char *

variable_types:
bb
struct Bb *

user_defined_types: struct Cfg { struct Node *fn; struct Bb **bb; struct Bb *start; struct Bb *end; unsigned long nbb; int nextbbid; struct Htab *lblmap; struct Node **fixjmp; unsigned long nfixjmp; struct Bb **fixblk; unsigned long nfixblk; }