decompiled_code:
void __fastcall free_room_index(void *ptr)
{
void *v2; // rdi
void *v3; // rdi
void *v4; // rdi
void **v5; // rbx
_QWORD *v6; // rbx
_QWORD *v7; // rdi
_QWORD *v8; // rbx
void *v9; // rdi
__int64 v10; // rax
__int64 v11; // rax
__int64 v12; // rax

v2 = (void *)*((_QWORD *)ptr + 13);
if ( v2 )
{
free(v2);
}
else if ( logFail )
{
v10 = Format(
"clear_free_lists: unable to purge_data as it was NULL from: %s %s %d",
"mem.c",
"free_room_index",
182LL);
log_string(v10);
}
v3 = (void *)*((_QWORD *)ptr + 14);
*((_QWORD *)ptr + 13) = 0LL;
if ( v3 )
{
free(v3);
}
else if ( logFail )
{
v12 = Format(
"clear_free_lists: unable to purge_data as it was NULL from: %s %s %d",
"mem.c",
"free_room_index",
183LL);
log_string(v12);
}
v4 = (void *)*((_QWORD *)ptr + 15);
*((_QWORD *)ptr + 14) = 0LL;
if ( v4 )
{
free(v4);
}
else if ( logFail )
{
v11 = Format(
"clear_free_lists: unable to purge_data as it was NULL from: %s %s %d",
"mem.c",
"free_room_index",
184LL);
log_string(v11);
}
*((_QWORD *)ptr + 15) = 0LL;
v5 = (void **)((char *)ptr + 40);
do
{
if ( *v5 )
free_exit(*v5);
++v5;
}
while ( v5 != (void **)((char *)ptr + 88) );
v6 = (_QWORD *)*((_QWORD *)ptr + 3);
while ( v6 )
{
v7 = v6;
v6 = (_QWORD *)*v6;
free_extra_descr(v7);
}
v8 = (_QWORD *)*((_QWORD *)ptr + 11);
while ( v8 )
{
v9 = v8;
v8 = (_QWORD *)*v8;
free_reset_data(v9);
}
free(ptr);
}

canonical_decompiled_code:
void __fastcall func7(void *ptr)
{
void *v2; // rdi
void *v3; // rdi
void *v4; // rdi
void **v5; // rbx
_QWORD *v6; // rbx
_QWORD *v7; // rdi
_QWORD *v8; // rbx
void *v9; // rdi
__int64 v10; // rax
__int64 v11; // rax
__int64 v12; // rax

v2 = (void *)*((_QWORD *)ptr + 13);
if ( v2 )
{
free(v2);
}
else if ( logFail )
{
v10 = Format(
"clear_free_lists: unable to purge_data as it was NULL from: %s %s %d",
"mem.c",
"free_room_index",
182LL);
log_string(v10);
}
v3 = (void *)*((_QWORD *)ptr + 14);
*((_QWORD *)ptr + 13) = 0LL;
if ( v3 )
{
free(v3);
}
else if ( logFail )
{
v12 = Format(
"clear_free_lists: unable to purge_data as it was NULL from: %s %s %d",
"mem.c",
"free_room_index",
183LL);
log_string(v12);
}
v4 = (void *)*((_QWORD *)ptr + 15);
*((_QWORD *)ptr + 14) = 0LL;
if ( v4 )
{
free(v4);
}
else if ( logFail )
{
v11 = Format(
"clear_free_lists: unable to purge_data as it was NULL from: %s %s %d",
"mem.c",
"free_room_index",
184LL);
log_string(v11);
}
*((_QWORD *)ptr + 15) = 0LL;
v5 = (void **)((char *)ptr + 40);
do
{
if ( *v5 )
func5(*v5);
++v5;
}
while ( v5 != (void **)((char *)ptr + 88) );
v6 = (_QWORD *)*((_QWORD *)ptr + 3);
while ( v6 )
{
v7 = v6;
v6 = (_QWORD *)*v6;
free_extra_descr(v7);
}
v8 = (_QWORD *)*((_QWORD *)ptr + 11);
while ( v8 )
{
v9 = v8;
v8 = (_QWORD *)*v8;
func1(v9);
}
free(ptr);
}

original_code:
void free_room_index( ROOM_INDEX_DATA *pRoom )
{
    int door = 0;
    EXTRA_DESCR_DATA *pExtra, *pExtra_next;
    RESET_DATA *pReset, *pReset_next;
    do { if(pRoom->name) { free((void *)pRoom->name); } else { if(logFail) { log_string((char *)Format("clear_free_lists: unable to purge_data as it was NULL from: %s %s %d", "mem.c", __FUNCTION__, 182)); } } pRoom->name = ((void *)0); } while(0);
    do { if(pRoom->description) { free((void *)pRoom->description); } else { if(logFail) { log_string((char *)Format("clear_free_lists: unable to purge_data as it was NULL from: %s %s %d", "mem.c", __FUNCTION__, 183)); } } pRoom->description = ((void *)0); } while(0);
    do { if(pRoom->owner) { free((void *)pRoom->owner); } else { if(logFail) { log_string((char *)Format("clear_free_lists: unable to purge_data as it was NULL from: %s %s %d", "mem.c", __FUNCTION__, 184)); } } pRoom->owner = ((void *)0); } while(0);
    for ( door = 0; door < 6; door++ )
    {
        if ( pRoom->exit[door] )
            free_exit( pRoom->exit[door] );
    }
    for ( pExtra = pRoom->extra_descr; pExtra; pExtra = pExtra_next )
    {
     pExtra_next = pExtra->next;
        free_extra_descr( pExtra );
    }
    for ( pReset = pRoom->reset_first; pReset; pReset = pReset_next)
    {
     pReset_next = pReset->next;
        free_reset_data( pReset );
    }
 do { if(pRoom) { free((void *)pRoom); } else { if(logFail) { log_string((char *)Format("clear_free_lists: unable to purge_data as it was NULL from: %s %s %d", "mem.c", __FUNCTION__, 204)); } } pRoom = ((void *)0); } while(0);
    return;
}

canonical_original_code:
void free_room_index(struct room_index_data *pRoom)
{
    int door = 0;
    struct extra_descr_data *pExtra; struct extra_descr_data *pExtra_next;
    struct reset_data *pReset; struct reset_data *pReset_next;
    do { if(pRoom->name) { free((void *)pRoom->name); } else { if(logFail) { log_string((char *)Format("clear_free_lists: unable to purge_data as it was NULL from: %s %s %d", "mem.c", __FUNCTION__, 182)); } } pRoom->name = ((void *)0); } while(0);
    do { if(pRoom->description) { free((void *)pRoom->description); } else { if(logFail) { log_string((char *)Format("clear_free_lists: unable to purge_data as it was NULL from: %s %s %d", "mem.c", __FUNCTION__, 183)); } } pRoom->description = ((void *)0); } while(0);
    do { if(pRoom->owner) { free((void *)pRoom->owner); } else { if(logFail) { log_string((char *)Format("clear_free_lists: unable to purge_data as it was NULL from: %s %s %d", "mem.c", __FUNCTION__, 184)); } } pRoom->owner = ((void *)0); } while(0);
    for ( door = 0; door < 6; door++ )
    {
        if ( pRoom->exit[door] )
            free_exit( pRoom->exit[door] );
    }
    for ( pExtra = pRoom->extra_descr; pExtra; pExtra = pExtra_next )
    {
     pExtra_next = pExtra->next;
        free_extra_descr( pExtra );
    }
    for ( pReset = pRoom->reset_first; pReset; pReset = pReset_next)
    {
     pReset_next = pReset->next;
        free_reset_data( pReset );
    }
 do { if(pRoom) { free((void *)pRoom); } else { if(logFail) { log_string((char *)Format("clear_free_lists: unable to purge_data as it was NULL from: %s %s %d", "mem.c", __FUNCTION__, 204)); } } pRoom = ((void *)0); } while(0);
    return;
}

variable_types: struct extra_descr_data { struct extra_descr_data *next; unsigned char valid; char *keyword; char *description; } *

user_defined_types: struct descriptor_data { struct descriptor_data *next; struct descriptor_data *snoop_by; struct char_data *character; struct char_data *original; unsigned char valid; char *host; short descriptor; short connected; unsigned char fcommand; char inbuf[-1]; char incomm[256]; char inlast[256]; int repeat; char *outbuf; int outsize; int outtop; char *showstr_head; char *showstr_point; void *pEdit; char **pString; int editor; struct protocol_t *pProtocol; }

user_defined_types: struct mprog_list { int trig_type; char *trig_phrase; short vnum; char *code; struct mprog_list *next; unsigned char valid; }

user_defined_types: struct obj_index_data { struct obj_index_data *next; struct extra_descr_data *extra_descr; struct affect_data *affected; struct area_data *area; unsigned char new_format; char *name; char *short_descr; char *description; short vnum; short reset_num; char *material; short item_type; int extra_flags; int wear_flags; short level; short condition; short count; short weight; int cost; int value[5]; }

user_defined_types: struct buf_type { struct buf_type *next; unsigned char valid; short state; short size; char *string; char *file; char *function; int line; }

user_defined_types: enum support_t { eUNKNOWN=0, eNO=1, eSOMETIMES=2, eYES=3 }

user_defined_types: struct help_data { struct help_data *next; struct help_data *next_area; short level; char *keyword; char *text; }


repo: ptrayal/dungeonworld

decompiled_code:
char *new_shop()
{
char *result; // rax

result = (char *)calloc(1uLL, 0x20uLL);
if ( !result )
{
logfmt(
"Unable to calloc new data from file: %s function: %s, line: %d\t *** ABORTING ***",
"mem.c",
"new_shop",
216LL);
abort();
}
*(_QWORD *)(result + 12) = 0LL;
*(_QWORD *)(result + 20) = 0x17000000640064LL;
return result;
}

canonical_decompiled_code:
char *func8()
{
char *result; // rax

result = (char *)calloc(1uLL, 0x20uLL);
if ( !result )
{
logfmt(
"Unable to calloc new data from file: %s function: %s, line: %d\t *** ABORTING ***",
"mem.c",
"new_shop",
216LL);
abort();
}
*(_QWORD *)(result + 12) = 0LL;
*(_QWORD *)(result + 20) = 0x17000000640064LL;
return result;
}

original_code:
SHOP_DATA *new_shop( void )
{
    SHOP_DATA *pShop;
    int buy = 0;
    do { if (!((pShop) = (SHOP_DATA *) calloc ((1), sizeof(SHOP_DATA)))) { logfmt("Unable to calloc new data from file: %s function: %s, line: %d\t *** ABORTING ***", "mem.c", __FUNCTION__, 216); abort(); } } while(0);
    pShop->next = ((void *)0);
    pShop->keeper = 0;
    for ( buy=0; buy<5; buy++ )
        pShop->buy_type[buy] = 0;
    pShop->profit_buy = 100;
    pShop->profit_sell = 100;
    pShop->open_hour = 0;
    pShop->close_hour = 23;
    return pShop;
}

canonical_original_code:
struct shop_data *new_shop()
{
    struct shop_data *pShop;
    int buy = 0;
    do { if (!((pShop) = (struct shop_data *) calloc ((1), sizeof(SHOP_DATA)))) { logfmt("Unable to calloc new data from file: %s function: %s, line: %d\t *** ABORTING ***", "mem.c", __FUNCTION__, 216); abort(); } } while(0);
    pShop->next = ((void *)0);
    pShop->keeper = 0;
    for ( buy=0; buy<5; buy++ )
        pShop->buy_type[buy] = 0;
    pShop->profit_buy = 100;
    pShop->profit_sell = 100;
    pShop->open_hour = 0;
    pShop->close_hour = 23;
    return pShop;
}

variable_types: struct shop_data { struct shop_data *next; short keeper; short buy_type[5]; short profit_buy; short profit_sell; short open_hour; short close_hour; } *

variable_types: buy int


decompiled_code:
void __fastcall free_shop(void *a1)
{
if ( a1 )
free(a1);
}

canonical_decompiled_code:
void __fastcall func9(void *a1)
{
if ( a1 )
free(a1);
}

original_code:
void free_shop( SHOP_DATA *pShop )
{
    do { if(!pShop) return; } while(0);
    do { if(pShop) { free((void *)pShop); } else { if(logFail) { log_string((char *)Format("clear_free_lists: unable to purge_data as it was NULL from: %s %s %d", "mem.c", __FUNCTION__, 239)); } } pShop = ((void *)0); } while(0);
    return;
}

canonical_original_code:
void free_shop(struct shop_data *pShop)
{
    do { if(!pShop) return; } while(0);
    do { if(pShop) { free((void *)pShop); } else { if(logFail) { log_string((char *)Format("clear_free_lists: unable to purge_data as it was NULL from: %s %s %d", "mem.c", __FUNCTION__, 239)); } } pShop = ((void *)0); } while(0);
    return;
}

return_type: void

user_defined_types: struct shop_data { struct shop_data *next; short keeper; short buy_type[5]; short profit_buy; short profit_sell; short open_hour; short close_hour; }


decompiled_code:
_QWORD *new_obj_index()
{
_QWORD *v0; // rax
_QWORD *v1; // r12
__int64 v2; // rax
__int64 v3; // rax
_QWORD *result; // rax

v0 = calloc(1uLL, 0x80uLL);
if ( !v0 )
{
logfmt(
"Unable to calloc new data from file: %s function: %s, line: %d\t *** ABORTING ***",
"mem.c",
"new_obj_index",
250LL);
abort();
}
v0[3] = 0LL;
v1 = v0;
v0[5] = str_dup("(no name)", "mem.c", "new_obj_index", 256LL);
v1[6] = str_dup("(no short description)", "mem.c", "new_obj_index", 257LL);
v2 = str_dup("(no description)", "mem.c", "new_obj_index", 258LL);
*(_QWORD *)((char *)v1 + 84) = 0LL;
v1[7] = v2;
*((_WORD *)v1 + 40) = 13;
*((_WORD *)v1 + 32) = 0;
v1[12] = 0LL;
v3 = str_dup("unknown", "mem.c", "new_obj_index", 266LL);
*((_BYTE *)v1 + 32) = 1;
v1[9] = v3;
result = v1;
*((_WORD *)v1 + 47) = 100;
v1[13] = 0LL;
v1[14] = 0LL;
*((_DWORD *)v1 + 30) = 0;
return result;
}

canonical_decompiled_code:
_QWORD *func10()
{
_QWORD *v0; // rax
_QWORD *v1; // r12
__int64 v2; // rax
__int64 v3; // rax
_QWORD *result; // rax

v0 = calloc(1uLL, 0x80uLL);
if ( !v0 )
{
logfmt(
"Unable to calloc new data from file: %s function: %s, line: %d\t *** ABORTING ***",
"mem.c",
"new_obj_index",
250LL);
abort();
}
v0[3] = 0LL;
v1 = v0;
v0[5] = str_dup("(no name)", "mem.c", "new_obj_index", 256LL);
v1[6] = str_dup("(no short description)", "mem.c", "new_obj_index", 257LL);
v2 = str_dup("(no description)", "mem.c", "new_obj_index", 258LL);
*(_QWORD *)((char *)v1 + 84) = 0LL;
v1[7] = v2;
*((_WORD *)v1 + 40) = 13;
*((_WORD *)v1 + 32) = 0;
v1[12] = 0LL;
v3 = str_dup("unknown", "mem.c", "new_obj_index", 266LL);
*((_BYTE *)v1 + 32) = 1;
v1[9] = v3;
result = v1;
*((_WORD *)v1 + 47) = 100;
v1[13] = 0LL;
v1[14] = 0LL;
*((_DWORD *)v1 + 30) = 0;
return result;
}

original_code:
OBJ_INDEX_DATA *new_obj_index( void )
{
    OBJ_INDEX_DATA *pObj;
    int value = 0;
    do { if (!((pObj) = (OBJ_INDEX_DATA *) calloc ((1), sizeof(OBJ_INDEX_DATA)))) { logfmt("Unable to calloc new data from file: %s function: %s, line: %d\t *** ABORTING ***", "mem.c", __FUNCTION__, 250); abort(); } } while(0);
    pObj->next = ((void *)0);
    pObj->extra_descr = ((void *)0);
    pObj->affected = ((void *)0);
    pObj->area = ((void *)0);
    pObj->name = _str_dup("(no name)", "mem.c", __FUNCTION__, 256);
    pObj->short_descr = _str_dup("(no short description)", "mem.c", __FUNCTION__, 257);
    pObj->description = _str_dup("(no description)", "mem.c", __FUNCTION__, 258);
    pObj->vnum = 0;
    pObj->item_type = 13;
    pObj->extra_flags = 0;
    pObj->wear_flags = 0;
    pObj->count = 0;
    pObj->weight = 0;
    pObj->cost = 0;
    pObj->material = _str_dup("unknown", "mem.c", __FUNCTION__, 266);
    pObj->condition = 100;
    for ( value = 0; value < 5; value++ )
        pObj->value[value] = 0;
    pObj->new_format = 1;
    return pObj;
}

canonical_original_code:
struct obj_index_data *new_obj_index()
{
    struct obj_index_data *pObj;
    int value = 0;
    do { if (!((pObj) = (struct obj_index_data *) calloc ((1), sizeof(OBJ_INDEX_DATA)))) { logfmt("Unable to calloc new data from file: %s function: %s, line: %d\t *** ABORTING ***", "mem.c", __FUNCTION__, 250); abort(); } } while(0);
    pObj->next = ((void *)0);
    pObj->extra_descr = ((void *)0);
    pObj->affected = ((void *)0);
    pObj->area = ((void *)0);
    pObj->name = _str_dup("(no name)", "mem.c", __FUNCTION__, 256);
    pObj->short_descr = _str_dup("(no short description)", "mem.c", __FUNCTION__, 257);
    pObj->description = _str_dup("(no description)", "mem.c", __FUNCTION__, 258);
    pObj->vnum = 0;
    pObj->item_type = 13;
    pObj->extra_flags = 0;
    pObj->wear_flags = 0;
    pObj->count = 0;
    pObj->weight = 0;
    pObj->cost = 0;
    pObj->material = _str_dup("unknown", "mem.c", __FUNCTION__, 266);
    pObj->condition = 100;
    for ( value = 0; value < 5; value++ )
        pObj->value[value] = 0;
    pObj->new_format = 1;
    return pObj;
}

variable_types: struct obj_index_data { struct obj_index_data *next; struct extra_descr_data { struct extra_descr_data *next; unsigned char valid; char *keyword; char *description; } *extra_descr; struct affect_data { struct affect_data *next; unsigned char valid; short where; short type; short level; short duration; short location; short modifier; int bitvector; } *affected; struct area_data { struct area_data *next; struct help_area_data { struct help_area_data *next; struct help_data { struct help_data *next; struct help_data *next_area; short level; char *keyword; char *text; } *first; struct help_data *last; struct area_data *area; char *filename; unsigned char changed; } *helps; char *file_name; char *name; char *credits; short age; short nplayer; short low_range; short high_range; short min_vnum; short max_vnum; unsigned char empty; char *builders; int vnum; int area_flags; int security; } *area; unsigned char new_format; char *name; char *short_descr; char *description; short vnum; short reset_num; char *material; short item_type; int extra_flags; int wear_flags; short level; short condition; short count; short weight; int cost; int value[5]; } *

variable_types: value int

user_defined_types: struct area_data { struct area_data *next; struct help_area_data *helps; char *file_name; char *name; char *credits; short age; short nplayer; short low_range; short high_range; short min_vnum; short max_vnum; unsigned char empty; char *builders; int vnum; int area_flags; int security; }

user_defined_types: struct help_area_data { struct help_area_data *next; struct help_data *first; struct help_data *last; struct area_data *area; char *filename; unsigned char changed; }


decompiled_code:
void __fastcall free_obj_index(void *ptr)
{
void *v2; // rdi
void *v3; // rdi
void *v4; // rdi
_QWORD *v5; // rbx
_QWORD *v6; // rdi
_QWORD *v7; // rbx
_QWORD *v8; // rdi
__int64 v9; // rax
__int64 v10; // rax
__int64 v11; // rax

v2 = (void *)*((_QWORD *)ptr + 5);
if ( v2 )
{
free(v2);
}
else if ( logFail )
{
v9 = Format(
"clear_free_lists: unable to purge_data as it was NULL from: %s %s %d",
"mem.c",
"free_obj_index",
283LL);
log_string(v9);
}
v3 = (void *)*((_QWORD *)ptr + 6);
*((_QWORD *)ptr + 5) = 0LL;
if ( v3 )
{
free(v3);
}
else if ( logFail )
{
v11 = Format(
"clear_free_lists: unable to purge_data as it was NULL from: %s %s %d",
"mem.c",
"free_obj_index",
284LL);
log_string(v11);
}
v4 = (void *)*((_QWORD *)ptr + 7);
*((_QWORD *)ptr + 6) = 0LL;
if ( v4 )
{
free(v4);
}
else if ( logFail )
{
v10 = Format(
"clear_free_lists: unable to purge_data as it was NULL from: %s %s %d",
"mem.c",
"free_obj_index",
285LL);
log_string(v10);
}
v5 = (_QWORD *)*((_QWORD *)ptr + 2);
*((_QWORD *)ptr + 7) = 0LL;
while ( v5 )
{
v6 = v5;
v5 = (_QWORD *)*v5;
free_affect(v6);
}
v7 = (_QWORD *)*((_QWORD *)ptr + 1);
while ( v7 )
{
v8 = v7;
v7 = (_QWORD *)*v7;
free_extra_descr(v8);
}
free(ptr);
}

canonical_decompiled_code:
void __fastcall func11(void *ptr)
{
void *v2; // rdi
void *v3; // rdi
void *v4; // rdi
_QWORD *v5; // rbx
_QWORD *v6; // rdi
_QWORD *v7; // rbx
_QWORD *v8; // rdi
__int64 v9; // rax
__int64 v10; // rax
__int64 v11; // rax

v2 = (void *)*((_QWORD *)ptr + 5);
if ( v2 )
{
free(v2);
}
else if ( logFail )
{
v9 = Format(
"clear_free_lists: unable to purge_data as it was NULL from: %s %s %d",
"mem.c",
"free_obj_index",
283LL);
log_string(v9);
}
v3 = (void *)*((_QWORD *)ptr + 6);
*((_QWORD *)ptr + 5) = 0LL;
if ( v3 )
{
free(v3);
}
else if ( logFail )
{
v11 = Format(
"clear_free_lists: unable to purge_data as it was NULL from: %s %s %d",
"mem.c",
"free_obj_index",
284LL);
log_string(v11);
}
v4 = (void *)*((_QWORD *)ptr + 7);
*((_QWORD *)ptr + 6) = 0LL;
if ( v4 )
{
free(v4);
}
else if ( logFail )
{
v10 = Format(
"clear_free_lists: unable to purge_data as it was NULL from: %s %s %d",
"mem.c",
"free_obj_index",
285LL);
log_string(v10);
}
v5 = (_QWORD *)*((_QWORD *)ptr + 2);
*((_QWORD *)ptr + 7) = 0LL;
while ( v5 )
{
v6 = v5;
v5 = (_QWORD *)*v5;
free_affect(v6);
}
v7 = (_QWORD *)*((_QWORD *)ptr + 1);
while ( v7 )
{
v8 = v7;
v7 = (_QWORD *)*v7;
free_extra_descr(v8);
}
free(ptr);
}

original_code:
void free_obj_index( OBJ_INDEX_DATA *pObj )
{
    EXTRA_DESCR_DATA *pExtra, *pExtra_next;
    AFFECT_DATA *pAf, *pAf_next;
    do { if(pObj->name) { free((void *)pObj->name); } else { if(logFail) { log_string((char *)Format("clear_free_lists: unable to purge_data as it was NULL from: %s %s %d", "mem.c", __FUNCTION__, 283)); } } pObj->name = ((void *)0); } while(0);
    do { if(pObj->short_descr) { free((void *)pObj->short_descr); } else { if(logFail) { log_string((char *)Format("clear_free_lists: unable to purge_data as it was NULL from: %s %s %d", "mem.c", __FUNCTION__, 284)); } } pObj->short_descr = ((void *)0); } while(0);
    do { if(pObj->description) { free((void *)pObj->description); } else { if(logFail) { log_string((char *)Format("clear_free_lists: unable to purge_data as it was NULL from: %s %s %d", "mem.c", __FUNCTION__, 285)); } } pObj->description = ((void *)0); } while(0);
    for ( pAf = pObj->affected; pAf; pAf = pAf_next )
    {
     pAf_next = pAf->next;
        free_affect( pAf );
    }
    for ( pExtra = pObj->extra_descr; pExtra; pExtra = pExtra_next )
    {
     pExtra_next = pExtra->next;
        free_extra_descr( pExtra );
    }
    do { if(pObj) { free((void *)pObj); } else { if(logFail) { log_string((char *)Format("clear_free_lists: unable to purge_data as it was NULL from: %s %s %d", "mem.c", __FUNCTION__, 300)); } } pObj = ((void *)0); } while(0);
    return;
}

canonical_original_code:
void free_obj_index(struct obj_index_data *pObj)
{
    struct extra_descr_data *pExtra; struct extra_descr_data *pExtra_next;
    struct affect_data *pAf; struct affect_data *pAf_next;
    do { if(pObj->name) { free((void *)pObj->name); } else { if(logFail) { log_string((char *)Format("clear_free_lists: unable to purge_data as it was NULL from: %s %s %d", "mem.c", __FUNCTION__, 283)); } } pObj->name = ((void *)0); } while(0);
    do { if(pObj->short_descr) { free((void *)pObj->short_descr); } else { if(logFail) { log_string((char *)Format("clear_free_lists: unable to purge_data as it was NULL from: %s %s %d", "mem.c", __FUNCTION__, 284)); } } pObj->short_descr = ((void *)0); } while(0);
    do { if(pObj->description) { free((void *)pObj->description); } else { if(logFail) { log_string((char *)Format("clear_free_lists: unable to purge_data as it was NULL from: %s %s %d", "mem.c", __FUNCTION__, 285)); } } pObj->description = ((void *)0); } while(0);
    for ( pAf = pObj->affected; pAf; pAf = pAf_next )
    {
     pAf_next = pAf->next;
        free_affect( pAf );
    }
    for ( pExtra = pObj->extra_descr; pExtra; pExtra = pExtra_next )
    {
     pExtra_next = pExtra->next;
        free_extra_descr( pExtra );
    }
    do { if(pObj) { free((void *)pObj); } else { if(logFail) { log_string((char *)Format("clear_free_lists: unable to purge_data as it was NULL from: %s %s %d", "mem.c", __FUNCTION__, 300)); } } pObj = ((void *)0); } while(0);
    return;
}

variable_types: struct affect_data { struct affect_data *next; unsigned char valid; short where; short type; short level; short duration; short location; short modifier; int bitvector; } *

user_defined_types: struct extra_descr_data { struct extra_descr_data *next; unsigned char valid; char *keyword; char *description; }


original_code:
MOB_INDEX_DATA *new_mob_index( void )
{
    MOB_INDEX_DATA *pMob;
    do { if (!((pMob) = (MOB_INDEX_DATA *) calloc ((1), sizeof(MOB_INDEX_DATA)))) { logfmt("Unable to calloc new data from file: %s function: %s, line: %d\t *** ABORTING ***", "mem.c", __FUNCTION__, 310); abort(); } } while(0);
    pMob->next = ((void *)0);
    pMob->spec_fun = ((void *)0);
    pMob->pShop = ((void *)0);
    pMob->area = ((void *)0);
    pMob->player_name = _str_dup("(no name)", "mem.c", __FUNCTION__, 316);
    pMob->short_descr = _str_dup("(no short description)", "mem.c", __FUNCTION__, 317);
    pMob->long_descr = _str_dup("(no long description)\n\r", "mem.c", __FUNCTION__, 318);
    pMob->description = _str_dup("(no description)", "mem.c", __FUNCTION__, 319);
    pMob->vnum = 0;
    pMob->count = 0;
    pMob->killed = 0;
    pMob->sex = 0;
    pMob->level = 0;
    pMob->act = (1);
    pMob->affected_by = 0;
    pMob->alignment = 0;
    pMob->hitroll = 0;
    pMob->race = race_lookup( "human" );
    pMob->form = 0;
    pMob->parts = 0;
    pMob->imm_flags = 0;
    pMob->res_flags = 0;
    pMob->vuln_flags = 0;
    pMob->material = _str_dup("unknown", "mem.c", __FUNCTION__, 335);
    pMob->off_flags = 0;
    pMob->size = 2;
    pMob->ac[0] = 0;
    pMob->ac[1] = 0;
    pMob->ac[2] = 0;
    pMob->ac[3] = 0;
    pMob->hit[0] = 0;
    pMob->hit[1] = 0;
    pMob->hit[2] = 0;
    pMob->mana[0] = 0;
    pMob->mana[1] = 0;
    pMob->mana[2] = 0;
    pMob->damage[0] = 0;
    pMob->damage[1] = 0;
    pMob->damage[0] = 0;
    pMob->start_pos = 8;
    pMob->default_pos = 8;
    pMob->wealth = 0;
    pMob->new_format = 1;
    return pMob;
}

canonical_original_code:
struct mob_index_data *new_mob_index()
{
    struct mob_index_data *pMob;
    do { if (!((pMob) = (struct mob_index_data *) calloc ((1), sizeof(MOB_INDEX_DATA)))) { logfmt("Unable to calloc new data from file: %s function: %s, line: %d\t *** ABORTING ***", "mem.c", __FUNCTION__, 310); abort(); } } while(0);
    pMob->next = ((void *)0);
    pMob->spec_fun = ((void *)0);
    pMob->pShop = ((void *)0);
    pMob->area = ((void *)0);
    pMob->player_name = _str_dup("(no name)", "mem.c", __FUNCTION__, 316);
    pMob->short_descr = _str_dup("(no short description)", "mem.c", __FUNCTION__, 317);
    pMob->long_descr = _str_dup("(no long description)\n\r", "mem.c", __FUNCTION__, 318);
    pMob->description = _str_dup("(no description)", "mem.c", __FUNCTION__, 319);
    pMob->vnum = 0;
    pMob->count = 0;
    pMob->killed = 0;
    pMob->sex = 0;
    pMob->level = 0;
    pMob->act = (1);
    pMob->affected_by = 0;
    pMob->alignment = 0;
    pMob->hitroll = 0;
    pMob->race = race_lookup( "human" );
    pMob->form = 0;
    pMob->parts = 0;
    pMob->imm_flags = 0;
    pMob->res_flags = 0;
    pMob->vuln_flags = 0;
    pMob->material = _str_dup("unknown", "mem.c", __FUNCTION__, 335);
    pMob->off_flags = 0;
    pMob->size = 2;
    pMob->ac[0] = 0;
    pMob->ac[1] = 0;
    pMob->ac[2] = 0;
    pMob->ac[3] = 0;
    pMob->hit[0] = 0;
    pMob->hit[1] = 0;
    pMob->hit[2] = 0;
    pMob->mana[0] = 0;
    pMob->mana[1] = 0;
    pMob->mana[2] = 0;
    pMob->damage[0] = 0;
    pMob->damage[1] = 0;
    pMob->damage[0] = 0;
    pMob->start_pos = 8;
    pMob->default_pos = 8;
    pMob->wealth = 0;
    pMob->new_format = 1;
    return pMob;
}

variable_types: struct mob_index_data { struct mob_index_data *next; unsigned char (*spec_fun)(struct char_data { struct char_data *next; struct char_data *next_in_room; struct char_data *master; struct char_data *leader; struct char_data *fighting; struct char_data *reply; struct char_data *pet; struct char_data *mprog_target; struct mem_data { struct mem_data *next; unsigned char valid; int id; int reaction; long when; } *memory; unsigned char (*spec_fun)(struct char_data *ch); struct mob_index_data *pIndexData; struct descriptor_data { struct descriptor_data *next; struct descriptor_data *snoop_by; struct char_data *character; struct char_data *original; unsigned char valid; char *host; short descriptor; short connected; unsigned char fcommand; char inbuf[-1]; char incomm[256]; char inlast[256]; int repeat; char *outbuf; int outsize; int outtop; char *showstr_head; char *showstr_point; void *pEdit; char **pString; int editor; struct protocol_t { int WriteOOB; enum bool_t { false=0, true=1 } Negotiated[-1]; enum bool_t { false=0, true=1 } bIACMode; enum bool_t { false=0, true=1 } bNegotiated; enum bool_t { false=0, true=1 } bRenegotiate; enum bool_t { false=0, true=1 } bNeedMXPVersion; enum bool_t { false=0, true=1 } bBlockMXP; enum bool_t { false=0, true=1 } bTTYPE; enum bool_t { false=0, true=1 } bECHO; enum bool_t { false=0, true=1 } bNAWS; enum bool_t { false=0, true=1 } bCHARSET; enum bool_t { false=0, true=1 } bMSDP; enum bool_t { false=0, true=1 } bMSSP; enum bool_t { false=0, true=1 } bATCP; enum bool_t { false=0, true=1 } bMSP; enum bool_t { false=0, true=1 } bMXP; enum bool_t { false=0, true=1 } bMCCP; enum support_t { eUNKNOWN=0, eNO=1, eSOMETIMES=2, eYES=3 } b256Support; int ScreenWidth; int ScreenHeight; char *pMXPVersion; char *pLastTTYPE; struct MSDP_t { enum bool_t { false=0, true=1 } bReport; enum bool_t { false=0, true=1 } bDirty; int ValueInt; char *pValueString; } **pVariables; } *pProtocol; } *desc; struct affect_data { struct affect_data *next; unsigned char valid; short where; short type; short level; short duration; short location; short modifier; int bitvector; } *affected; struct note_data { struct note_data *next; unsigned char valid; short type; char *sender; char *date; char *to_list; char *subject; char *text; long date_stamp; } *pnote; struct obj_data { struct obj_data *next; struct obj_data *next_content; struct obj_data *contains; struct obj_data *in_obj; struct obj_data *on; struct char_data *carried_by; struct extra_descr_data { struct extra_descr_data *next; unsigned char valid; char *keyword; char *description; } *extra_descr; struct affect_data *affected; struct obj_index_data { struct obj_index_data *next; struct extra_descr_data *extra_descr; struct affect_data *affected; struct area_data { struct area_data *next; struct help_area_data { struct help_area_data *next; struct help_data { struct help_data *next; struct help_data *next_area; short level; char *keyword; char *text; } *first; struct help_data *last; struct area_data *area; char *filename; unsigned char changed; } *helps; char *file_name; char *name; char *credits; short age; short nplayer; short low_range; short high_range; short min_vnum; short max_vnum; unsigned char empty; char *builders; int vnum; int area_flags; int security; } *area; unsigned char new_format; char *name; char *short_descr; char *description; short vnum; short reset_num; char *material; short item_type; int extra_flags; int wear_flags; short level; short condition; short count; short weight; int cost; int value[5]; } *pIndexData; struct room_index_data { struct room_index_data *next; struct char_data *people; struct obj_data *contents; struct extra_descr_data *extra_descr; struct area_data *area; struct exit_data { union { struct room_index_data *to_room; short vnum; } u1; int exit_info; short key; char *keyword; char *description; struct exit_data *next; int rs_flags; int orig_door; } *exit[6]; struct reset_data { struct reset_data *next; char command; short arg1; short arg2; short arg3; short arg4; } *reset_first; struct reset_data *reset_last; char *name; char *description; char *owner; short vnum; int room_flags; short light; short sector_type; short heal_rate; short mana_rate; short clan; } *in_room; unsigned char valid; unsigned char enchanted; char *owner; char *name; char *short_descr; char *description; short item_type; int extra_flags; int wear_flags; short wear_loc; short weight; int cost; short level; short condition; char *material; short timer; int value[5]; } *carrying; struct obj_data *on; struct room_index_data *in_room; struct room_index_data *was_in_room; struct area_data *zone; struct pc_data { struct pc_data *next; struct buf_type { struct buf_type *next; unsigned char valid; short state; short size; char *string; char *file; char *function; int line; } *buffer; unsigned char valid; char *pwd; char *bamfin; char *bamfout; char *title; long last_note; long last_idea; long last_penalty; long last_news; long last_changes; short perm_hit; short perm_mana; short perm_move; short true_sex; int last_level; short condition[4]; short learned[151]; unsigned char group_known[30]; short points; unsigned char confirm_delete; char *alias[5]; char *alias_sub[5]; int security; } *pcdata; struct gen_data { struct gen_data *next; unsigned char valid; unsigned char skill_chosen[151]; unsigned char group_chosen[30]; int points_chosen; } *gen_data; unsigned char valid; char *name; long id; short version; char *short_descr; char *long_descr; char *description; char *prompt; char *prefix; short group; short clan; short sex; short iclass; short race; short level; short trust; int played; int lines; long logon; short timer; short wait; short daze; short hit; short max_hit; short mana; short max_mana; short move; short max_move; long gold; long silver; int exp; long act; long comm; long wiznet; long imm_flags; long res_flags; long vuln_flags; short invis_level; short incog_level; long affected_by; short position; short practice; short train; short carry_weight; short carry_number; short saving_throw; short alignment; short hitroll; short damroll; short armor[4]; short wimpy; short perm_stat[5]; short mod_stat[5]; long form; long parts; short size; char *material; long off_flags; short damage[3]; short dam_type; short start_pos; short default_pos; short mprog_delay; } *ch); struct shop_data { struct shop_data *next; short keeper; short buy_type[5]; short profit_buy; short profit_sell; short open_hour; short close_hour; } *pShop; struct mprog_list { int trig_type; char *trig_phrase; short vnum; char *code; struct mprog_list *next; unsigned char valid; } *mprogs; struct area_data *area; short vnum; short group; unsigned char new_format; short count; short killed; char *player_name; char *short_descr; char *long_descr; char *description; long act; long affected_by; short alignment; short level; short hitroll; short hit[3]; short mana[3]; short damage[3]; short ac[4]; short dam_type; long off_flags; long imm_flags; long res_flags; long vuln_flags; short start_pos; short default_pos; short sex; short race; long wealth; long form; long parts; short size; char *material; long mprog_flags; } *

user_defined_types: struct mob_index_data { struct mob_index_data *next; unsigned char (*spec_fun)(struct char_data *ch); struct shop_data *pShop; struct mprog_list *mprogs; struct area_data *area; short vnum; short group; unsigned char new_format; short count; short killed; char *player_name; char *short_descr; char *long_descr; char *description; long act; long affected_by; short alignment; short level; short hitroll; short hit[3]; short mana[3]; short damage[3]; short ac[4]; short dam_type; long off_flags; long imm_flags; long res_flags; long vuln_flags; short start_pos; short default_pos; short sex; short race; long wealth; long form; long parts; short size; char *material; long mprog_flags; }

user_defined_types: struct char_data { struct char_data *next; struct char_data *next_in_room; struct char_data *master; struct char_data *leader; struct char_data *fighting; struct char_data *reply; struct char_data *pet; struct char_data *mprog_target; struct mem_data *memory; unsigned char (*spec_fun)(struct char_data *ch); struct mob_index_data *pIndexData; struct descriptor_data *desc; struct affect_data *affected; struct note_data *pnote; struct obj_data *carrying; struct obj_data *on; struct room_index_data *in_room; struct room_index_data *was_in_room; struct area_data *zone; struct pc_data *pcdata; struct gen_data *gen_data; unsigned char valid; char *name; long id; short version; char *short_descr; char *long_descr; char *description; char *prompt; char *prefix; short group; short clan; short sex; short iclass; short race; short level; short trust; int played; int lines; long logon; short timer; short wait; short daze; short hit; short max_hit; short mana; short max_mana; short move; short max_move; long gold; long silver; int exp; long act; long comm; long wiznet; long imm_flags; long res_flags; long vuln_flags; short invis_level; short incog_level; long affected_by; short position; short practice; short train; short carry_weight; short carry_number; short saving_throw; short alignment; short hitroll; short damroll; short armor[4]; short wimpy; short perm_stat[5]; short mod_stat[5]; long form; long parts; short size; char *material; long off_flags; short damage[3]; short dam_type; short start_pos; short default_pos; short mprog_delay; }

user_defined_types: struct obj_data { struct obj_data *next; struct obj_data *next_content; struct obj_data *contains; struct obj_data *in_obj; struct obj_data *on; struct char_data *carried_by; struct extra_descr_data *extra_descr; struct affect_data *affected; struct obj_index_data *pIndexData; struct room_index_data *in_room; unsigned char valid; unsigned char enchanted; char *owner; char *name; char *short_descr; char *description; short item_type; int extra_flags; int wear_flags; short wear_loc; short weight; int cost; short level; short condition; char *material; short timer; int value[5]; }

user_defined_types: struct pc_data { struct pc_data *next; struct buf_type *buffer; unsigned char valid; char *pwd; char *bamfin; char *bamfout; char *title; long last_note; long last_idea; long last_penalty; long last_news; long last_changes; short perm_hit; short perm_mana; short perm_move; short true_sex; int last_level; short condition[4]; short learned[151]; unsigned char group_known[30]; short points; unsigned char confirm_delete; char *alias[5]; char *alias_sub[5]; int security; }

user_defined_types: struct protocol_t { int WriteOOB; enum bool_t Negotiated[-1]; enum bool_t bIACMode; enum bool_t bNegotiated; enum bool_t bRenegotiate; enum bool_t bNeedMXPVersion; enum bool_t bBlockMXP; enum bool_t bTTYPE; enum bool_t bECHO; enum bool_t bNAWS; enum bool_t bCHARSET; enum bool_t bMSDP; enum bool_t bMSSP; enum bool_t bATCP; enum bool_t bMSP; enum bool_t bMXP; enum bool_t bMCCP; enum support_t b256Support; int ScreenWidth; int ScreenHeight; char *pMXPVersion; char *pLastTTYPE; struct MSDP_t **pVariables; }

user_defined_types: struct room_index_data { struct room_index_data *next; struct char_data *people; struct obj_data *contents; struct extra_descr_data *extra_descr; struct area_data *area; struct exit_data *exit[6]; struct reset_data *reset_first; struct reset_data *reset_last; char *name; char *description; char *owner; short vnum; int room_flags; short light; short sector_type; short heal_rate; short mana_rate; short clan; }

user_defined_types: struct MSDP_t { enum bool_t bReport; enum bool_t bDirty; int ValueInt; char *pValueString; }


decompiled_code:
void __fastcall free_mob_index(void *ptr)
{
void *v2; // rdi
void *v3; // rdi
void *v4; // rdi
void *v5; // rdi
__int64 v6; // rax
__int64 v7; // rax
__int64 v8; // rax
__int64 v9; // rax

if ( ptr )
{
v2 = (void *)*((_QWORD *)ptr + 7);
if ( v2 )
{
free(v2);
}
else if ( logFail )
{
v6 = Format(
"clear_free_lists: unable to purge_data as it was NULL from: %s %s %d",
"mem.c",
"free_mob_index",
366LL);
log_string(v6);
}
v3 = (void *)*((_QWORD *)ptr + 8);
*((_QWORD *)ptr + 7) = 0LL;
if ( v3 )
{
free(v3);
}
else if ( logFail )
{
v9 = Format(
"clear_free_lists: unable to purge_data as it was NULL from: %s %s %d",
"mem.c",
"free_mob_index",
367LL);
log_string(v9);
}
v4 = (void *)*((_QWORD *)ptr + 9);
*((_QWORD *)ptr + 8) = 0LL;
if ( v4 )
{
free(v4);
}
else if ( logFail )
{
v8 = Format(
"clear_free_lists: unable to purge_data as it was NULL from: %s %s %d",
"mem.c",
"free_mob_index",
368LL);
log_string(v8);
}
v5 = (void *)*((_QWORD *)ptr + 10);
*((_QWORD *)ptr + 9) = 0LL;
if ( v5 )
{
free(v5);
}
else if ( logFail )
{
v7 = Format(
"clear_free_lists: unable to purge_data as it was NULL from: %s %s %d",
"mem.c",
"free_mob_index",
369LL);
log_string(v7);
}
*((_QWORD *)ptr + 10) = 0LL;
free_mprog(*((_QWORD *)ptr + 3));
free_shop(*((void **)ptr + 2));
free(ptr);
}
}

canonical_decompiled_code:
void __fastcall func13(void *ptr)
{
void *v2; // rdi
void *v3; // rdi
void *v4; // rdi
void *v5; // rdi
__int64 v6; // rax
__int64 v7; // rax
__int64 v8; // rax
__int64 v9; // rax

if ( ptr )
{
v2 = (void *)*((_QWORD *)ptr + 7);
if ( v2 )
{
free(v2);
}
else if ( logFail )
{
v6 = Format(
"clear_free_lists: unable to purge_data as it was NULL from: %s %s %d",
"mem.c",
"free_mob_index",
366LL);
log_string(v6);
}
v3 = (void *)*((_QWORD *)ptr + 8);
*((_QWORD *)ptr + 7) = 0LL;
if ( v3 )
{
free(v3);
}
else if ( logFail )
{
v9 = Format(
"clear_free_lists: unable to purge_data as it was NULL from: %s %s %d",
"mem.c",
"free_mob_index",
367LL);
log_string(v9);
}
v4 = (void *)*((_QWORD *)ptr + 9);
*((_QWORD *)ptr + 8) = 0LL;
if ( v4 )
{
free(v4);
}
else if ( logFail )
{
v8 = Format(
"clear_free_lists: unable to purge_data as it was NULL from: %s %s %d",
"mem.c",
"free_mob_index",
368LL);
log_string(v8);
}
v5 = (void *)*((_QWORD *)ptr + 10);
*((_QWORD *)ptr + 9) = 0LL;
if ( v5 )
{
free(v5);
}
else if ( logFail )
{
v7 = Format(
"clear_free_lists: unable to purge_data as it was NULL from: %s %s %d",
"mem.c",
"free_mob_index",
369LL);
log_string(v7);
}
*((_QWORD *)ptr + 10) = 0LL;
free_mprog(*((_QWORD *)ptr + 3));
func9(*((void **)ptr + 2));
free(ptr);
}
}

original_code:
void free_mob_index( MOB_INDEX_DATA *pMob )
{
    do { if(!pMob) return; } while(0);
    do { if(pMob->player_name) { free((void *)pMob->player_name); } else { if(logFail) { log_string((char *)Format("clear_free_lists: unable to purge_data as it was NULL from: %s %s %d", "mem.c", __FUNCTION__, 366)); } } pMob->player_name = ((void *)0); } while(0);
    do { if(pMob->short_descr) { free((void *)pMob->short_descr); } else { if(logFail) { log_string((char *)Format("clear_free_lists: unable to purge_data as it was NULL from: %s %s %d", "mem.c", __FUNCTION__, 367)); } } pMob->short_descr = ((void *)0); } while(0);
    do { if(pMob->long_descr) { free((void *)pMob->long_descr); } else { if(logFail) { log_string((char *)Format("clear_free_lists: unable to purge_data as it was NULL from: %s %s %d", "mem.c", __FUNCTION__, 368)); } } pMob->long_descr = ((void *)0); } while(0);
    do { if(pMob->description) { free((void *)pMob->description); } else { if(logFail) { log_string((char *)Format("clear_free_lists: unable to purge_data as it was NULL from: %s %s %d", "mem.c", __FUNCTION__, 369)); } } pMob->description = ((void *)0); } while(0);
    free_mprog( pMob->mprogs );
    free_shop( pMob->pShop );
 do { if(pMob) { free((void *)pMob); } else { if(logFail) { log_string((char *)Format("clear_free_lists: unable to purge_data as it was NULL from: %s %s %d", "mem.c", __FUNCTION__, 374)); } } pMob = ((void *)0); } while(0);
    return;
}

canonical_original_code:
void free_mob_index(struct mob_index_data *pMob)
{
    do { if(!pMob) return; } while(0);
    do { if(pMob->player_name) { free((void *)pMob->player_name); } else { if(logFail) { log_string((char *)Format("clear_free_lists: unable to purge_data as it was NULL from: %s %s %d", "mem.c", __FUNCTION__, 366)); } } pMob->player_name = ((void *)0); } while(0);
    do { if(pMob->short_descr) { free((void *)pMob->short_descr); } else { if(logFail) { log_string((char *)Format("clear_free_lists: unable to purge_data as it was NULL from: %s %s %d", "mem.c", __FUNCTION__, 367)); } } pMob->short_descr = ((void *)0); } while(0);
    do { if(pMob->long_descr) { free((void *)pMob->long_descr); } else { if(logFail) { log_string((char *)Format("clear_free_lists: unable to purge_data as it was NULL from: %s %s %d", "mem.c", __FUNCTION__, 368)); } } pMob->long_descr = ((void *)0); } while(0);
    do { if(pMob->description) { free((void *)pMob->description); } else { if(logFail) { log_string((char *)Format("clear_free_lists: unable to purge_data as it was NULL from: %s %s %d", "mem.c", __FUNCTION__, 369)); } } pMob->description = ((void *)0); } while(0);
    free_mprog( pMob->mprogs );
    free_shop( pMob->pShop );
 do { if(pMob) { free((void *)pMob); } else { if(logFail) { log_string((char *)Format("clear_free_lists: unable to purge_data as it was NULL from: %s %s %d", "mem.c", __FUNCTION__, 374)); } } pMob = ((void *)0); } while(0);
    return;
}

user_defined_types: struct mem_data { struct mem_data *next; unsigned char valid; int id; int reaction; long when; }

user_defined_types: struct descriptor_data { struct descriptor_data *next; struct descriptor_data *snoop_by; struct char_data *character; struct char_data *original; unsigned char valid; char *host; short descriptor; short connected; unsigned char fcommand; char inbuf[-1]; char incomm[256]; char inlast[256]; int repeat; char *outbuf; int outsize; int outtop; char *showstr_head; char *showstr_point; void *pEdit; char **pString; int editor; struct protocol_t *pProtocol; }

user_defined_types: struct affect_data { struct affect_data *next; unsigned char valid; short where; short type; short level; short duration; short location; short modifier; int bitvector; }

user_defined_types: struct note_data { struct note_data *next; unsigned char valid; short type; char *sender; char *date; char *to_list; char *subject; char *text; long date_stamp; }

user_defined_types: struct gen_data { struct gen_data *next; unsigned char valid; unsigned char skill_chosen[151]; unsigned char group_chosen[30]; int points_chosen; }

user_defined_types: struct reset_data { struct reset_data *next; char command; short arg1; short arg2; short arg3; short arg4; }

user_defined_types: struct exit_data { union { struct room_index_data *to_room; short vnum; } u1; int exit_info; short key; char *keyword; char *description; struct exit_data *next; int rs_flags; int orig_door; }


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

result = calloc(1uLL, 0x18uLL);
if ( !result )
{
logfmt(
"Unable to calloc new data from file: %s function: %s, line: %d\t *** ABORTING ***",
"mem.c",
"new_mpcode",
382LL);
abort();
}
return result;
}

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

result = calloc(1uLL, 0x18uLL);
if ( !result )
{
logfmt(
"Unable to calloc new data from file: %s function: %s, line: %d\t *** ABORTING ***",
"mem.c",
"new_mpcode",
382LL);
abort();
}
return result;
}

original_code:
MPROG_CODE *new_mpcode(void)
{
     MPROG_CODE *NewCode;
     do { if (!((NewCode) = (MPROG_CODE *) calloc ((1), sizeof(MPROG_CODE)))) { logfmt("Unable to calloc new data from file: %s function: %s, line: %d\t *** ABORTING ***", "mem.c", __FUNCTION__, 382); abort(); } } while(0);
     NewCode->vnum = 0;
     NewCode->code = ((void *)0);
     NewCode->next = ((void *)0);
     return NewCode;
}

canonical_original_code:
struct mprog_code *new_mpcode()
{
     struct mprog_code *NewCode;
     do { if (!((NewCode) = (struct mprog_code *) calloc ((1), sizeof(MPROG_CODE)))) { logfmt("Unable to calloc new data from file: %s function: %s, line: %d\t *** ABORTING ***", "mem.c", __FUNCTION__, 382); abort(); } } while(0);
     NewCode->vnum = 0;
     NewCode->code = ((void *)0);
     NewCode->next = ((void *)0);
     return NewCode;
}

variable_types: struct mprog_code { short vnum; char *code; struct mprog_code *next; } *


decompiled_code:
void __fastcall free_mpcode(void *ptr)
{
void *v2; // rdi
__int64 v3; // rax

v2 = (void *)*((_QWORD *)ptr + 1);
if ( v2 )
{
free(v2);
LABEL_3:
free(ptr);
return;
}
if ( !logFail )
goto LABEL_3;
v3 = Format("clear_free_lists: unable to purge_data as it was NULL from: %s %s %d", "mem.c", "free_mpcode", 393LL);
log_string(v3);
free(ptr);
}

canonical_decompiled_code:
void __fastcall func15(void *ptr)
{
void *v2; // rdi
__int64 v3; // rax

v2 = (void *)*((_QWORD *)ptr + 1);
if ( v2 )
{
free(v2);
LABEL_3:
free(ptr);
return;
}
if ( !logFail )
goto LABEL_3;
v3 = Format("clear_free_lists: unable to purge_data as it was NULL from: %s %s %d", "mem.c", "free_mpcode", 393LL);
log_string(v3);
free(ptr);
}

original_code:
void free_mpcode(MPROG_CODE *pMcode)
{
    do { if(pMcode->code) { free((void *)pMcode->code); } else { if(logFail) { log_string((char *)Format("clear_free_lists: unable to purge_data as it was NULL from: %s %s %d", "mem.c", __FUNCTION__, 393)); } } pMcode->code = ((void *)0); } while(0);
 do { if(pMcode) { free((void *)pMcode); } else { if(logFail) { log_string((char *)Format("clear_free_lists: unable to purge_data as it was NULL from: %s %s %d", "mem.c", __FUNCTION__, 394)); } } pMcode = ((void *)0); } while(0);
    return;
}

canonical_original_code:
void free_mpcode(struct mprog_code *pMcode)
{
    do { if(pMcode->code) { free((void *)pMcode->code); } else { if(logFail) { log_string((char *)Format("clear_free_lists: unable to purge_data as it was NULL from: %s %s %d", "mem.c", __FUNCTION__, 393)); } } pMcode->code = ((void *)0); } while(0);
 do { if(pMcode) { free((void *)pMcode); } else { if(logFail) { log_string((char *)Format("clear_free_lists: unable to purge_data as it was NULL from: %s %s %d", "mem.c", __FUNCTION__, 394)); } } pMcode = ((void *)0); } while(0);
    return;
}

user_defined_types: struct mprog_code { short vnum; char *code; struct mprog_code *next; }


decompiled_code:
__int64 __fastcall mpedit_create(__int64 a1, const char *a2)
{
int v2; // eax
unsigned int v3; // er12
__int64 v4; // rax
__int64 v5; // rdx
__int64 result; // rax
const char *v7; // r13
__int64 v8; // rax
__int64 v9; // rdx
__int64 v10; // rdx

v2 = atoi(a2);
if ( *a2 && (v3 = v2, v2 > 0) )
{
v4 = get_vnum_area((unsigned int)v2);
if ( v4 )
{
if ( (*(_BYTE *)(a1 + 320) & 1) != 0
|| (v5 = *(_QWORD *)(a1 + 88)) != 0 && *(_QWORD *)(v5 + 24)
|| *(_DWORD *)(*(_QWORD *)(a1 + 152) + 536LL) < *(_DWORD *)(v4 + 72)
&& (v7 = *(const char **)(v4 + 56), !strstr(v7, *(const char **)(a1 + 176)))
&& !strstr(v7, "All") )
{
send_to_char("MPEdit : You do not have a high enough security rating.\n\r", a1);
result = 0LL;
}
else if ( get_mprog_index(v3) )
{
send_to_char("MPEdit: Code vnum already exists.\n\r", a1);
result = 0LL;
}
else
{
v8 = new_mpcode();
v9 = mprog_list;
*(_WORD *)v8 = v3;
*(_QWORD *)(v8 + 16) = v9;
v10 = *(_QWORD *)(a1 + 88);
mprog_list = v8;
*(_QWORD *)(v10 + 1632) = v8;
*(_DWORD *)(v10 + 1648) = 5;
send_to_char("MobProgram code created.\n\r", a1);
result = 1LL;
}
}
else
{
send_to_char("MPEdit : That vnum is not assigned to an area.\n\r", a1);
result = 0LL;
}
}
else
{
send_to_char("Syntax : mpedit create [vnum]\n\r", a1);
result = 0LL;
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func0(__int64 a1, const char *a2)
{
int v2; // eax
unsigned int v3; // er12
__int64 v4; // rax
__int64 v5; // rdx
__int64 result; // rax
const char *v7; // r13
__int64 v8; // rax
__int64 v9; // rdx
__int64 v10; // rdx

v2 = atoi(a2);
if ( *a2 && (v3 = v2, v2 > 0) )
{
v4 = get_vnum_area((unsigned int)v2);
if ( v4 )
{
if ( (*(_BYTE *)(a1 + 320) & 1) != 0
|| (v5 = *(_QWORD *)(a1 + 88)) != 0 && *(_QWORD *)(v5 + 24)
|| *(_DWORD *)(*(_QWORD *)(a1 + 152) + 536LL) < *(_DWORD *)(v4 + 72)
&& (v7 = *(const char **)(v4 + 56), !strstr(v7, *(const char **)(a1 + 176)))
&& !strstr(v7, "All") )
{
send_to_char("MPEdit : You do not have a high enough security rating.\n\r", a1);
result = 0LL;
}
else if ( get_mprog_index(v3) )
{
send_to_char("MPEdit: Code vnum already exists.\n\r", a1);
result = 0LL;
}
else
{
v8 = new_mpcode();
v9 = mprog_list;
*(_WORD *)v8 = v3;
*(_QWORD *)(v8 + 16) = v9;
v10 = *(_QWORD *)(a1 + 88);
mprog_list = v8;
*(_QWORD *)(v10 + 1632) = v8;
*(_DWORD *)(v10 + 1648) = 5;
send_to_char("MobProgram code created.\n\r", a1);
result = 1LL;
}
}
else
{
send_to_char("MPEdit : That vnum is not assigned to an area.\n\r", a1);
result = 0LL;
}
}
else
{
send_to_char("Syntax : mpedit create [vnum]\n\r", a1);
result = 0LL;
}
return result;
}

original_code:
bool mpedit_create(CHAR_DATA *ch, char*argument)
{
    MPROG_CODE *pMcode;
    int value = atoi(argument);
    AREA_DATA *ad;
    if (((argument) == ((void *)0) || (argument)[0] == '\0') || value < 1)
    {
 send_to_char( "Syntax : mpedit create [vnum]\n\r", ch );
 return 0;
    }
    ad = get_vnum_area(value);
    if ( ad == ((void *)0) )
    {
     send_to_char( "MPEdit : That vnum is not assigned to an area.\n\r", ch );
     return 0;
    }
    if ( !( !((((ch)->act) & ((1)))) && !( ch->desc && ch->desc->original ) && ( ch->pcdata->security >= ad->security || strstr( ad->builders, ch->name ) || strstr( ad->builders, "All" ) ) ) )
    {
        send_to_char("MPEdit : You do not have a high enough security rating.\n\r", ch);
        return 0;
    }
    if ( get_mprog_index(value) )
    {
 send_to_char("MPEdit: Code vnum already exists.\n\r",ch);
 return 0;
    }
    pMcode = new_mpcode();
    pMcode->vnum = value;
    pMcode->next = mprog_list;
    mprog_list = pMcode;
    ch->desc->pEdit = (void *)pMcode;
    ch->desc->editor = 5;
    send_to_char("MobProgram code created.\n\r",ch);
    return 1;
}

canonical_original_code:
unsigned char mpedit_create(struct char_data *ch, char *argument)
{
    struct mprog_code *pMcode;
    int value = atoi(argument);
    struct area_data *ad;
    if (((argument) == ((void *)0) || (argument)[0] == '\0') || value < 1)
    {
 send_to_char( "Syntax : mpedit create [vnum]\n\r", ch );
 return 0;
    }
    ad = get_vnum_area(value);
    if ( ad == ((void *)0) )
    {
     send_to_char( "MPEdit : That vnum is not assigned to an area.\n\r", ch );
     return 0;
    }
    if ( !( !((((ch)->act) & ((1)))) && !( ch->desc && ch->desc->original ) && ( ch->pcdata->security >= ad->security || strstr( ad->builders, ch->name ) || strstr( ad->builders, "All" ) ) ) )
    {
        send_to_char("MPEdit : You do not have a high enough security rating.\n\r", ch);
        return 0;
    }
    if ( get_mprog_index(value) )
    {
 send_to_char("MPEdit: Code vnum already exists.\n\r",ch);
 return 0;
    }
    pMcode = new_mpcode();
    pMcode->vnum = value;
    pMcode->next = mprog_list;
    mprog_list = pMcode;
    ch->desc->pEdit = (void *)pMcode;
    ch->desc->editor = 5;
    send_to_char("MobProgram code created.\n\r",ch);
    return 1;
}

variable_types: struct char_data { struct char_data *next; struct char_data *next_in_room; struct char_data *master; struct char_data *leader; struct char_data *fighting; struct char_data *reply; struct char_data *pet; struct char_data *mprog_target; struct mem_data { struct mem_data *next; unsigned char valid; int id; int reaction; long when; } *memory; unsigned char (*spec_fun)(struct char_data *ch); struct mob_index_data { struct mob_index_data *next; unsigned char (*spec_fun)(struct char_data *ch); struct shop_data { struct shop_data *next; short keeper; short buy_type[5]; short profit_buy; short profit_sell; short open_hour; short close_hour; } *pShop; struct mprog_list { int trig_type; char *trig_phrase; short vnum; char *code; struct mprog_list *next; unsigned char valid; } *mprogs; struct area_data { struct area_data *next; struct help_area_data { struct help_area_data *next; struct help_data { struct help_data *next; struct help_data *next_area; short level; char *keyword; char *text; } *first; struct help_data *last; struct area_data *area; char *filename; unsigned char changed; } *helps; char *file_name; char *name; char *credits; short age; short nplayer; short low_range; short high_range; short min_vnum; short max_vnum; unsigned char empty; char *builders; int vnum; int area_flags; int security; } *area; short vnum; short group; unsigned char new_format; short count; short killed; char *player_name; char *short_descr; char *long_descr; char *description; long act; long affected_by; short alignment; short level; short hitroll; short hit[3]; short mana[3]; short damage[3]; short ac[4]; short dam_type; long off_flags; long imm_flags; long res_flags; long vuln_flags; short start_pos; short default_pos; short sex; short race; long wealth; long form; long parts; short size; char *material; long mprog_flags; } *pIndexData; struct descriptor_data { struct descriptor_data *next; struct descriptor_data *snoop_by; struct char_data *character; struct char_data *original; unsigned char valid; char *host; short descriptor; short connected; unsigned char fcommand; char inbuf[-1]; char incomm[256]; char inlast[256]; int repeat; char *outbuf; int outsize; int outtop; char *showstr_head; char *showstr_point; void *pEdit; char **pString; int editor; struct protocol_t { int WriteOOB; enum bool_t { false=0, true=1 } Negotiated[-1]; enum bool_t { false=0, true=1 } bIACMode; enum bool_t { false=0, true=1 } bNegotiated; enum bool_t { false=0, true=1 } bRenegotiate; enum bool_t { false=0, true=1 } bNeedMXPVersion; enum bool_t { false=0, true=1 } bBlockMXP; enum bool_t { false=0, true=1 } bTTYPE; enum bool_t { false=0, true=1 } bECHO; enum bool_t { false=0, true=1 } bNAWS; enum bool_t { false=0, true=1 } bCHARSET; enum bool_t { false=0, true=1 } bMSDP; enum bool_t { false=0, true=1 } bMSSP; enum bool_t { false=0, true=1 } bATCP; enum bool_t { false=0, true=1 } bMSP; enum bool_t { false=0, true=1 } bMXP; enum bool_t { false=0, true=1 } bMCCP; enum support_t { eUNKNOWN=0, eNO=1, eSOMETIMES=2, eYES=3 } b256Support; int ScreenWidth; int ScreenHeight; char *pMXPVersion; char *pLastTTYPE; struct MSDP_t { enum bool_t { false=0, true=1 } bReport; enum bool_t { false=0, true=1 } bDirty; int ValueInt; char *pValueString; } **pVariables; } *pProtocol; } *desc; struct affect_data { struct affect_data *next; unsigned char valid; short where; short type; short level; short duration; short location; short modifier; int bitvector; } *affected; struct note_data { struct note_data *next; unsigned char valid; short type; char *sender; char *date; char *to_list; char *subject; char *text; long date_stamp; } *pnote; struct obj_data { struct obj_data *next; struct obj_data *next_content; struct obj_data *contains; struct obj_data *in_obj; struct obj_data *on; struct char_data *carried_by; struct extra_descr_data { struct extra_descr_data *next; unsigned char valid; char *keyword; char *description; } *extra_descr; struct affect_data *affected; struct obj_index_data { struct obj_index_data *next; struct extra_descr_data *extra_descr; struct affect_data *affected; struct area_data *area; unsigned char new_format; char *name; char *short_descr; char *description; short vnum; short reset_num; char *material; short item_type; int extra_flags; int wear_flags; short level; short condition; short count; short weight; int cost; int value[5]; } *pIndexData; struct room_index_data { struct room_index_data *next; struct char_data *people; struct obj_data *contents; struct extra_descr_data *extra_descr; struct area_data *area; struct exit_data { union { struct room_index_data *to_room; short vnum; } u1; int exit_info; short key; char *keyword; char *description; struct exit_data *next; int rs_flags; int orig_door; } *exit[6]; struct reset_data { struct reset_data *next; char command; short arg1; short arg2; short arg3; short arg4; } *reset_first; struct reset_data *reset_last; char *name; char *description; char *owner; short vnum; int room_flags; short light; short sector_type; short heal_rate; short mana_rate; short clan; } *in_room; unsigned char valid; unsigned char enchanted; char *owner; char *name; char *short_descr; char *description; short item_type; int extra_flags; int wear_flags; short wear_loc; short weight; int cost; short level; short condition; char *material; short timer; int value[5]; } *carrying; struct obj_data *on; struct room_index_data *in_room; struct room_index_data *was_in_room; struct area_data *zone; struct pc_data { struct pc_data *next; struct buf_type { struct buf_type *next; unsigned char valid; short state; short size; char *string; char *file; char *function; int line; } *buffer; unsigned char valid; char *pwd; char *bamfin; char *bamfout; char *title; long last_note; long last_idea; long last_penalty; long last_news; long last_changes; short perm_hit; short perm_mana; short perm_move; short true_sex; int last_level; short condition[4]; short learned[151]; unsigned char group_known[30]; short points; unsigned char confirm_delete; char *alias[5]; char *alias_sub[5]; int security; } *pcdata; struct gen_data { struct gen_data *next; unsigned char valid; unsigned char skill_chosen[151]; unsigned char group_chosen[30]; int points_chosen; } *gen_data; unsigned char valid; char *name; long id; short version; char *short_descr; char *long_descr; char *description; char *prompt; char *prefix; short group; short clan; short sex; short iclass; short race; short level; short trust; int played; int lines; long logon; short timer; short wait; short daze; short hit; short max_hit; short mana; short max_mana; short move; short max_move; long gold; long silver; int exp; long act; long comm; long wiznet; long imm_flags; long res_flags; long vuln_flags; short invis_level; short incog_level; long affected_by; short position; short practice; short train; short carry_weight; short carry_number; short saving_throw; short alignment; short hitroll; short damroll; short armor[4]; short wimpy; short perm_stat[5]; short mod_stat[5]; long form; long parts; short size; char *material; long off_flags; short damage[3]; short dam_type; short start_pos; short default_pos; short mprog_delay; } *

variable_types:
argument
char *

return_type: unsigned char

user_defined_types: struct area_data { struct area_data *next; struct help_area_data *helps; char *file_name; char *name; char *credits; short age; short nplayer; short low_range; short high_range; short min_vnum; short max_vnum; unsigned char empty; char *builders; int vnum; int area_flags; int security; }

user_defined_types: struct help_area_data { struct help_area_data *next; struct help_data *first; struct help_data *last; struct area_data *area; char *filename; unsigned char changed; }


decompiled_code:
__int64 __fastcall mpedit_show(__int64 a1)
{
const char **v1; // rbx
__int64 v2; // rax
__int64 v3; // rax

v1 = *(const char ***)(*(_QWORD *)(a1 + 88) + 1632LL);
v2 = Format("Vnum: [%d]\n\r", (unsigned int)*(__int16 *)v1);
send_to_char(v2, a1);
v3 = Format("Code:\n\r%s\n\r", v1[1]);
send_to_char(v3, a1);
return 0LL;
}

canonical_decompiled_code:
__int64 __fastcall func1(__int64 a1)
{
const char **v1; // rbx
__int64 v2; // rax
__int64 v3; // rax

v1 = *(const char ***)(*(_QWORD *)(a1 + 88) + 1632LL);
v2 = Format("Vnum: [%d]\n\r", (unsigned int)*(__int16 *)v1);
send_to_char(v2, a1);
v3 = Format("Code:\n\r%s\n\r", v1[1]);
send_to_char(v3, a1);
return 0LL;
}

original_code:
bool mpedit_show(CHAR_DATA *ch, char*argument)
{
    MPROG_CODE *pMcode;
    ( pMcode = (MPROG_CODE*)ch->desc->pEdit );
    send_to_char( Format("Vnum:       [%d]\n\r", pMcode->vnum), ch);
    send_to_char( Format("Code:\n\r%s\n\r", pMcode->code), ch);
    return 0;
}

canonical_original_code:
unsigned char mpedit_show(struct char_data *ch, char *argument)
{
    struct mprog_code *pMcode;
    ( pMcode = (struct mprog_code *)ch->desc->pEdit );
    send_to_char( Format("Vnum:       [%d]\n\r", pMcode->vnum), ch);
    send_to_char( Format("Code:\n\r%s\n\r", pMcode->code), ch);
    return 0;
}

user_defined_types: struct mob_index_data { struct mob_index_data *next; unsigned char (*spec_fun)(struct char_data *ch); struct shop_data *pShop; struct mprog_list *mprogs; struct area_data *area; short vnum; short group; unsigned char new_format; short count; short killed; char *player_name; char *short_descr; char *long_descr; char *description; long act; long affected_by; short alignment; short level; short hitroll; short hit[3]; short mana[3]; short damage[3]; short ac[4]; short dam_type; long off_flags; long imm_flags; long res_flags; long vuln_flags; short start_pos; short default_pos; short sex; short race; long wealth; long form; long parts; short size; char *material; long mprog_flags; }

user_defined_types: struct shop_data { struct shop_data *next; short keeper; short buy_type[5]; short profit_buy; short profit_sell; short open_hour; short close_hour; }

user_defined_types: struct mprog_list { int trig_type; char *trig_phrase; short vnum; char *code; struct mprog_list *next; unsigned char valid; }

user_defined_types: struct extra_descr_data { struct extra_descr_data *next; unsigned char valid; char *keyword; char *description; }

user_defined_types: struct obj_index_data { struct obj_index_data *next; struct extra_descr_data *extra_descr; struct affect_data *affected; struct area_data *area; unsigned char new_format; char *name; char *short_descr; char *description; short vnum; short reset_num; char *material; short item_type; int extra_flags; int wear_flags; short level; short condition; short count; short weight; int cost; int value[5]; }

user_defined_types: struct buf_type { struct buf_type *next; unsigned char valid; short state; short size; char *string; char *file; char *function; int line; }

user_defined_types: enum support_t { eUNKNOWN=0, eNO=1, eSOMETIMES=2, eYES=3 }

user_defined_types: struct help_data { struct help_data *next; struct help_data *next_area; short level; char *keyword; char *text; }


decompiled_code:
__int64 __fastcall mpedit_code(__int64 a1, _BYTE *a2)
{
__int64 result; // rax

if ( a2 && *a2 )
{
send_to_char("Syntax: code\n\r", a1);
result = 0LL;
}
else
{
string_append(a1, *(_QWORD *)(*(_QWORD *)(a1 + 88) + 1632LL) + 8LL);
result = 1LL;
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func2(__int64 a1, _BYTE *a2)
{
__int64 result; // rax

if ( a2 && *a2 )
{
send_to_char("Syntax: code\n\r", a1);
result = 0LL;
}
else
{
string_append(a1, *(_QWORD *)(*(_QWORD *)(a1 + 88) + 1632LL) + 8LL);
result = 1LL;
}
return result;
}

original_code:
bool mpedit_code(CHAR_DATA *ch, char*argument)
{
    MPROG_CODE *pMcode;
    ( pMcode = (MPROG_CODE*)ch->desc->pEdit );
    if (((argument) == ((void *)0) || (argument)[0] == '\0'))
    {
       string_append(ch, &pMcode->code);
       return 1;
    }
    send_to_char("Syntax: code\n\r",ch);
    return 0;
}

canonical_original_code:
unsigned char mpedit_code(struct char_data *ch, char *argument)
{
    struct mprog_code *pMcode;
    ( pMcode = (struct mprog_code *)ch->desc->pEdit );
    if (((argument) == ((void *)0) || (argument)[0] == '\0'))
    {
       string_append(ch, &pMcode->code);
       return 1;
    }
    send_to_char("Syntax: code\n\r",ch);
    return 0;
}

user_defined_types: struct char_data { struct char_data *next; struct char_data *next_in_room; struct char_data *master; struct char_data *leader; struct char_data *fighting; struct char_data *reply; struct char_data *pet; struct char_data *mprog_target; struct mem_data *memory; unsigned char (*spec_fun)(struct char_data *ch); struct mob_index_data *pIndexData; struct descriptor_data *desc; struct affect_data *affected; struct note_data *pnote; struct obj_data *carrying; struct obj_data *on; struct room_index_data *in_room; struct room_index_data *was_in_room; struct area_data *zone; struct pc_data *pcdata; struct gen_data *gen_data; unsigned char valid; char *name; long id; short version; char *short_descr; char *long_descr; char *description; char *prompt; char *prefix; short group; short clan; short sex; short iclass; short race; short level; short trust; int played; int lines; long logon; short timer; short wait; short daze; short hit; short max_hit; short mana; short max_mana; short move; short max_move; long gold; long silver; int exp; long act; long comm; long wiznet; long imm_flags; long res_flags; long vuln_flags; short invis_level; short incog_level; long affected_by; short position; short practice; short train; short carry_weight; short carry_number; short saving_throw; short alignment; short hitroll; short damroll; short armor[4]; short wimpy; short perm_stat[5]; short mod_stat[5]; long form; long parts; short size; char *material; long off_flags; short damage[3]; short dam_type; short start_pos; short default_pos; short mprog_delay; }

user_defined_types: struct mem_data { struct mem_data *next; unsigned char valid; int id; int reaction; long when; }

user_defined_types: struct descriptor_data { struct descriptor_data *next; struct descriptor_data *snoop_by; struct char_data *character; struct char_data *original; unsigned char valid; char *host; short descriptor; short connected; unsigned char fcommand; char inbuf[-1]; char incomm[256]; char inlast[256]; int repeat; char *outbuf; int outsize; int outtop; char *showstr_head; char *showstr_point; void *pEdit; char **pString; int editor; struct protocol_t *pProtocol; }

user_defined_types: struct obj_data { struct obj_data *next; struct obj_data *next_content; struct obj_data *contains; struct obj_data *in_obj; struct obj_data *on; struct char_data *carried_by; struct extra_descr_data *extra_descr; struct affect_data *affected; struct obj_index_data *pIndexData; struct room_index_data *in_room; unsigned char valid; unsigned char enchanted; char *owner; char *name; char *short_descr; char *description; short item_type; int extra_flags; int wear_flags; short wear_loc; short weight; int cost; short level; short condition; char *material; short timer; int value[5]; }

user_defined_types: struct pc_data { struct pc_data *next; struct buf_type *buffer; unsigned char valid; char *pwd; char *bamfin; char *bamfout; char *title; long last_note; long last_idea; long last_penalty; long last_news; long last_changes; short perm_hit; short perm_mana; short perm_move; short true_sex; int last_level; short condition[4]; short learned[151]; unsigned char group_known[30]; short points; unsigned char confirm_delete; char *alias[5]; char *alias_sub[5]; int security; }

user_defined_types: struct protocol_t { int WriteOOB; enum bool_t Negotiated[-1]; enum bool_t bIACMode; enum bool_t bNegotiated; enum bool_t bRenegotiate; enum bool_t bNeedMXPVersion; enum bool_t bBlockMXP; enum bool_t bTTYPE; enum bool_t bECHO; enum bool_t bNAWS; enum bool_t bCHARSET; enum bool_t bMSDP; enum bool_t bMSSP; enum bool_t bATCP; enum bool_t bMSP; enum bool_t bMXP; enum bool_t bMCCP; enum support_t b256Support; int ScreenWidth; int ScreenHeight; char *pMXPVersion; char *pLastTTYPE; struct MSDP_t **pVariables; }

user_defined_types: struct room_index_data { struct room_index_data *next; struct char_data *people; struct obj_data *contents; struct extra_descr_data *extra_descr; struct area_data *area; struct exit_data *exit[6]; struct reset_data *reset_first; struct reset_data *reset_last; char *name; char *description; char *owner; short vnum; int room_flags; short light; short sector_type; short heal_rate; short mana_rate; short clan; }

user_defined_types: struct MSDP_t { enum bool_t bReport; enum bool_t bDirty; int ValueInt; char *pValueString; }


original_code:
bool mpedit_list(CHAR_DATA *ch, char*argument)
{
    int count = 1;
    MPROG_CODE *mprg;
    char buf[4608]={'\0'};
    BUFFER *buffer;
    bool fAll = !__strcmp(argument, "all", "olc_mpcode.c", __FUNCTION__, 230);
    char blah;
    AREA_DATA *ad;
    buffer = __new_buf("olc_mpcode.c", __FUNCTION__, 234);
    for (mprg = mprog_list; mprg !=((void *)0); mprg = mprg->next)
 if ( fAll || ( ((ch->in_room->area->min_vnum) < (mprg->vnum)) && ((mprg->vnum) < (ch->in_room->area->max_vnum)) ) )
 {
  ad = get_vnum_area(mprg->vnum);
  if ( ad == ((void *)0) )
   blah = '?';
  else
  if ( ( !((((ch)->act) & ((1)))) && !( ch->desc && ch->desc->original ) && ( ch->pcdata->security >= ad->security || strstr( ad->builders, ch->name ) || strstr( ad->builders, "All" ) ) ) )
   blah = '*';
  else
   blah = ' ';
  sprintf(buf, "[%3d] (%c) %5d\n\r", count, blah, mprg->vnum );
  add_buf(buffer, buf);
  count++;
 }
    if ( count == 1 )
    {
     if ( fAll )
      add_buf( buffer, "There are currently no existing mprogs.\n\r" );
     else
      add_buf( buffer, "There are no mprogs in this area.\n\r" );
    }
    page_to_char(buf_string(buffer), ch);
    free_buf(buffer);
    return 0;
}

canonical_original_code:
unsigned char mpedit_list(struct char_data *ch, char *argument)
{
    int count = 1;
    struct mprog_code *mprg;
    char buf[4608] = {'\0'};
    struct buf_type *buffer;
    unsigned char fAll = !__strcmp(argument, "all", "olc_mpcode.c", __FUNCTION__, 230);
    char blah;
    struct area_data *ad;
    buffer = __new_buf("olc_mpcode.c", __FUNCTION__, 234);
    for (mprg = mprog_list; mprg !=((void *)0); mprg = mprg->next)
 if ( fAll || ( ((ch->in_room->area->min_vnum) < (mprg->vnum)) && ((mprg->vnum) < (ch->in_room->area->max_vnum)) ) )
 {
  ad = get_vnum_area(mprg->vnum);
  if ( ad == ((void *)0) )
   blah = '?';
  else
  if ( ( !((((ch)->act) & ((1)))) && !( ch->desc && ch->desc->original ) && ( ch->pcdata->security >= ad->security || strstr( ad->builders, ch->name ) || strstr( ad->builders, "All" ) ) ) )
   blah = '*';
  else
   blah = ' ';
  sprintf(buf, "[%3d] (%c) %5d\n\r", count, blah, mprg->vnum );
  add_buf(buffer, buf);
  count++;
 }
    if ( count == 1 )
    {
     if ( fAll )
      add_buf( buffer, "There are currently no existing mprogs.\n\r" );
     else
      add_buf( buffer, "There are no mprogs in this area.\n\r" );
    }
    page_to_char(buf_string(buffer), ch);
    free_buf(buffer);
    return 0;
}

variable_types: count int

variable_types:
buf
char [4608]

variable_types: struct buf_type { struct buf_type *next; unsigned char valid; short state; short size; char *string; char *file; char *function; int line; } *

variable_types:
fAll
unsigned char

variable_types: blah char

variable_types: struct area_data { struct area_data *next; struct help_area_data { struct help_area_data *next; struct help_data { struct help_data *next; struct help_data *next_area; short level; char *keyword; char *text; } *first; struct help_data *last; struct area_data *area; char *filename; unsigned char changed; } *helps; char *file_name; char *name; char *credits; short age; short nplayer; short low_range; short high_range; short min_vnum; short max_vnum; unsigned char empty; char *builders; int vnum; int area_flags; int security; } *

user_defined_types: struct mprog_code { short vnum; char *code; struct mprog_code *next; }

user_defined_types: struct area_data { struct area_data *next; struct help_area_data *helps; char *file_name; char *name; char *credits; short age; short nplayer; short low_range; short high_range; short min_vnum; short max_vnum; unsigned char empty; char *builders; int vnum; int area_flags; int security; }

user_defined_types: struct affect_data { struct affect_data *next; unsigned char valid; short where; short type; short level; short duration; short location; short modifier; int bitvector; }

user_defined_types: struct note_data { struct note_data *next; unsigned char valid; short type; char *sender; char *date; char *to_list; char *subject; char *text; long date_stamp; }

user_defined_types: struct gen_data { struct gen_data *next; unsigned char valid; unsigned char skill_chosen[151]; unsigned char group_chosen[30]; int points_chosen; }

user_defined_types: struct help_area_data { struct help_area_data *next; struct help_data *first; struct help_data *last; struct area_data *area; char *filename; unsigned char changed; }

user_defined_types: struct reset_data { struct reset_data *next; char command; short arg1; short arg2; short arg3; short arg4; }

user_defined_types: struct exit_data { union { struct room_index_data *to_room; short vnum; } u1; int exit_info; short key; char *keyword; char *description; struct exit_data *next; int rs_flags; int orig_door; }


mpedit

decompiled_code:
__int64 __fastcall mpedit(__int64 a1, const char *a2)
{
__int64 v2; // r13
__int16 *v3; // r14
__int64 v4; // rax
__int64 v5; // rdx
__int64 result; // rax
__int64 v7; // rbx
const char *v8; // rsi
const char *v9; // r12
char v10[256]; // [rsp+0h] [rbp-228h] BYREF
char v11[296]; // [rsp+100h] [rbp-128h] BYREF

smash_tilde(a2);
strcpy(v10, a2);
v2 = one_argument(a2, v11);
v3 = *(__int16 **)(*(_QWORD *)(a1 + 88) + 1632LL);
if ( v3 )
{
v4 = get_vnum_area((unsigned int)*v3);
if ( !v4 )
return edit_done(a1);
if ( (*(_BYTE *)(a1 + 320) & 1) != 0
|| (v5 = *(_QWORD *)(a1 + 88)) != 0 && *(_QWORD *)(v5 + 24)
|| *(_DWORD *)(*(_QWORD *)(a1 + 152) + 536LL) < *(_DWORD *)(v4 + 72)
&& (v9 = *(const char **)(v4 + 56), !strstr(v9, *(const char **)(a1 + 176)))
&& !strstr(v9, "All") )
{
send_to_char("MPEdit: Insufficient security to modify code.\n\r", a1);
return edit_done(a1);
}
}
if ( !v11[0] )
return mpedit_show(a1);
if ( !(unsigned __int8)_strcmp(v11, "done", "olc_mpcode.c", "mpedit", 75LL) )
return edit_done(a1);
v7 = 0LL;
v8 = "commands";
while ( (unsigned __int8)str_prefix(v11, v8) )
{
++v7;
v8 = (&mpedit_table)[2 * v7];
if ( !v8 )
return interpret(a1, v10);
}
result = ((__int64 (__fastcall *)(__int64, __int64))(&mpedit_table)[2 * (int)v7 + 1])(a1, v2);
if ( v3 && (_BYTE)result )
{
result = get_vnum_area((unsigned int)*v3);
if ( result )
*(_DWORD *)(result + 68) |= 1u;
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func4(__int64 a1, const char *a2)
{
__int64 v2; // r13
__int16 *v3; // r14
__int64 v4; // rax
__int64 v5; // rdx
__int64 result; // rax
__int64 v7; // rbx
const char *v8; // rsi
const char *v9; // r12
char v10[256]; // [rsp+0h] [rbp-228h] BYREF
char v11[296]; // [rsp+100h] [rbp-128h] BYREF

smash_tilde(a2);
strcpy(v10, a2);
v2 = one_argument(a2, v11);
v3 = *(__int16 **)(*(_QWORD *)(a1 + 88) + 1632LL);
if ( v3 )
{
v4 = get_vnum_area((unsigned int)*v3);
if ( !v4 )
return edit_done(a1);
if ( (*(_BYTE *)(a1 + 320) & 1) != 0
|| (v5 = *(_QWORD *)(a1 + 88)) != 0 && *(_QWORD *)(v5 + 24)
|| *(_DWORD *)(*(_QWORD *)(a1 + 152) + 536LL) < *(_DWORD *)(v4 + 72)
&& (v9 = *(const char **)(v4 + 56), !strstr(v9, *(const char **)(a1 + 176)))
&& !strstr(v9, "All") )
{
send_to_char("MPEdit: Insufficient security to modify code.\n\r", a1);
return edit_done(a1);
}
}
if ( !v11[0] )
return func1(a1);
if ( !(unsigned __int8)_strcmp(v11, "done", "olc_mpcode.c", "mpedit", 75LL) )
return edit_done(a1);
v7 = 0LL;
v8 = "commands";
while ( (unsigned __int8)str_prefix(v11, v8) )
{
++v7;
v8 = (&mpedit_table)[2 * v7];
if ( !v8 )
return interpret(a1, v10);
}
result = ((__int64 (__fastcall *)(__int64, __int64))(&mpedit_table)[2 * (int)v7 + 1])(a1, v2);
if ( v3 && (_BYTE)result )
{
result = get_vnum_area((unsigned int)*v3);
if ( result )
*(_DWORD *)(result + 68) |= 1u;
}
return result;
}

original_code:
void mpedit( CHAR_DATA *ch, char *argument)
{
    MPROG_CODE *pMcode;
    char arg[256];
    char command[256];
    int cmd;
    AREA_DATA *ad;
    smash_tilde(argument);
    strcpy(arg, argument);
    argument = one_argument( argument, command);
    ( pMcode = (MPROG_CODE*)ch->desc->pEdit );
    if (pMcode)
    {
 ad = get_vnum_area( pMcode->vnum );
 if ( ad == ((void *)0) )
 {
  edit_done(ch);
  return;
 }
 if ( !( !((((ch)->act) & ((1)))) && !( ch->desc && ch->desc->original ) && ( ch->pcdata->security >= ad->security || strstr( ad->builders, ch->name ) || strstr( ad->builders, "All" ) ) ) )
 {
  send_to_char("MPEdit: Insufficient security to modify code.\n\r", ch);
  edit_done(ch);
  return;
 }
    }
    if (((command) == ((void *)0) || (command)[0] == '\0'))
    {
        mpedit_show(ch, argument);
        return;
    }
    if (!__strcmp(command, "done", "olc_mpcode.c", __FUNCTION__, 75) )
    {
        edit_done(ch);
        return;
    }
    for (cmd = 0; mpedit_table[cmd].name != ((void *)0); cmd++)
    {
 if (!str_prefix(command, mpedit_table[cmd].name) )
 {
  if ((*mpedit_table[cmd].olc_fun) (ch, argument) && pMcode)
   if ((ad = get_vnum_area(pMcode->vnum)) != ((void *)0))
    ((ad->area_flags) |= (1));
  return;
 }
    }
    interpret(ch, arg);
    return;
}

canonical_original_code:
void mpedit(struct char_data *ch, char *argument)
{
    struct mprog_code *pMcode;
    char arg[256];
    char command[256];
    int cmd;
    struct area_data *ad;
    smash_tilde(argument);
    strcpy(arg, argument);
    argument = one_argument( argument, command);
    ( pMcode = (struct mprog_code *)ch->desc->pEdit );
    if (pMcode)
    {
 ad = get_vnum_area( pMcode->vnum );
 if ( ad == ((void *)0) )
 {
  edit_done(ch);
  return;
 }
 if ( !( !((((ch)->act) & ((1)))) && !( ch->desc && ch->desc->original ) && ( ch->pcdata->security >= ad->security || strstr( ad->builders, ch->name ) || strstr( ad->builders, "All" ) ) ) )
 {
  send_to_char("MPEdit: Insufficient security to modify code.\n\r", ch);
  edit_done(ch);
  return;
 }
    }
    if (((command) == ((void *)0) || (command)[0] == '\0'))
    {
        mpedit_show(ch, argument);
        return;
    }
    if (!__strcmp(command, "done", "olc_mpcode.c", __FUNCTION__, 75) )
    {
        edit_done(ch);
        return;
    }
    for (cmd = 0; mpedit_table[cmd].name != ((void *)0); cmd++)
    {
 if (!str_prefix(command, mpedit_table[cmd].name) )
 {
  if ((*mpedit_table[cmd].olc_fun) (ch, argument) && pMcode)
   if ((ad = get_vnum_area(pMcode->vnum)) != ((void *)0))
    ((ad->area_flags) |= (1));
  return;
 }
    }
    interpret(ch, arg);
    return;
}

variable_types:
arg
char [256]

variable_types:
command
char [256]

variable_types: cmd int

user_defined_types: struct mob_index_data { struct mob_index_data *next; unsigned char (*spec_fun)(struct char_data *ch); struct shop_data *pShop; struct mprog_list *mprogs; struct area_data *area; short vnum; short group; unsigned char new_format; short count; short killed; char *player_name; char *short_descr; char *long_descr; char *description; long act; long affected_by; short alignment; short level; short hitroll; short hit[3]; short mana[3]; short damage[3]; short ac[4]; short dam_type; long off_flags; long imm_flags; long res_flags; long vuln_flags; short start_pos; short default_pos; short sex; short race; long wealth; long form; long parts; short size; char *material; long mprog_flags; }

user_defined_types: struct shop_data { struct shop_data *next; short keeper; short buy_type[5]; short profit_buy; short profit_sell; short open_hour; short close_hour; }

user_defined_types: struct mprog_list { int trig_type; char *trig_phrase; short vnum; char *code; struct mprog_list *next; unsigned char valid; }

user_defined_types: struct extra_descr_data { struct extra_descr_data *next; unsigned char valid; char *keyword; char *description; }

user_defined_types: struct obj_index_data { struct obj_index_data *next; struct extra_descr_data *extra_descr; struct affect_data *affected; struct area_data *area; unsigned char new_format; char *name; char *short_descr; char *description; short vnum; short reset_num; char *material; short item_type; int extra_flags; int wear_flags; short level; short condition; short count; short weight; int cost; int value[5]; }

user_defined_types: struct buf_type { struct buf_type *next; unsigned char valid; short state; short size; char *string; char *file; char *function; int line; }

user_defined_types: struct help_data { struct help_data *next; struct help_data *next_area; short level; char *keyword; char *text; }

user_defined_types: enum support_t { eUNKNOWN=0, eNO=1, eSOMETIMES=2, eYES=3 }


decompiled_code:
__int64 __fastcall do_mpedit(__int64 a1, __int64 a2)
{
const char *v2; // r12
unsigned int v3; // er12
__int64 v4; // rbx
__int64 result; // rax
__int64 v6; // r12
const char *v7; // r13
char v8[296]; // [rsp+0h] [rbp-128h] BYREF

v2 = (const char *)one_argument(a2, v8);
if ( (unsigned __int8)is_number(v8) )
{
v3 = atoi(v8);
v4 = get_mprog_index(v3);
if ( v4 )
{
result = get_vnum_area(v3);
if ( result )
{
if ( (*(_BYTE *)(a1 + 320) & 1) != 0
|| (v6 = *(_QWORD *)(a1 + 88)) != 0 && *(_QWORD *)(v6 + 24)
|| *(_DWORD *)(*(_QWORD *)(a1 + 152) + 536LL) < *(_DWORD *)(result + 72)
&& (v7 = *(const char **)(result + 56), (result = (__int64)strstr(v7, *(const char **)(a1 + 176))) == 0)
&& (result = (__int64)strstr(v7, "All")) == 0 )
{
result = send_to_char("MPEdit : You do not have access to that area.\n\r", a1);
}
else
{
*(_QWORD *)(v6 + 1632) = v4;
*(_DWORD *)(v6 + 1648) = 5;
}
}
else
{
result = send_to_char("MPEdit : That vnum has not been assigned to an area.\n\r", a1);
}
}
else
{
result = send_to_char("MPEdit : That vnum does not exist.\n\r", a1);
}
}
else if ( !(unsigned __int8)_strcmp(v8, "create", "olc_mpcode.c", "do_mpedit", 135LL) )
{
if ( v2 && *v2 )
result = mpedit_create(a1, v2);
else
result = send_to_char("Syntax : mpedit create [vnum]\n\r", a1);
}
else
{
send_to_char("Syntax : mpedit [vnum]\n\r", a1);
result = send_to_char(" mpedit create [vnum]\n\r", a1);
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func5(__int64 a1, __int64 a2)
{
const char *v2; // r12
unsigned int v3; // er12
__int64 v4; // rbx
__int64 result; // rax
__int64 v6; // r12
const char *v7; // r13
char v8[296]; // [rsp+0h] [rbp-128h] BYREF

v2 = (const char *)one_argument(a2, v8);
if ( (unsigned __int8)is_number(v8) )
{
v3 = atoi(v8);
v4 = get_mprog_index(v3);
if ( v4 )
{
result = get_vnum_area(v3);
if ( result )
{
if ( (*(_BYTE *)(a1 + 320) & 1) != 0
|| (v6 = *(_QWORD *)(a1 + 88)) != 0 && *(_QWORD *)(v6 + 24)
|| *(_DWORD *)(*(_QWORD *)(a1 + 152) + 536LL) < *(_DWORD *)(result + 72)
&& (v7 = *(const char **)(result + 56), (result = (__int64)strstr(v7, *(const char **)(a1 + 176))) == 0)
&& (result = (__int64)strstr(v7, "All")) == 0 )
{
result = send_to_char("MPEdit : You do not have access to that area.\n\r", a1);
}
else
{
*(_QWORD *)(v6 + 1632) = v4;
*(_DWORD *)(v6 + 1648) = 5;
}
}
else
{
result = send_to_char("MPEdit : That vnum has not been assigned to an area.\n\r", a1);
}
}
else
{
result = send_to_char("MPEdit : That vnum does not exist.\n\r", a1);
}
}
else if ( !(unsigned __int8)_strcmp(v8, "create", "olc_mpcode.c", "do_mpedit", 135LL) )
{
if ( v2 && *v2 )
result = func0(a1, v2);
else
result = send_to_char("Syntax : mpedit create [vnum]\n\r", a1);
}
else
{
send_to_char("Syntax : mpedit [vnum]\n\r", a1);
result = send_to_char(" mpedit create [vnum]\n\r", a1);
}
return result;
}

original_code:
void do_mpedit(CHAR_DATA *ch, char *argument)
{
    MPROG_CODE *pMcode;
    char command[256];
    argument = one_argument(argument, command);
    if( is_number(command) )
    {
 int vnum = atoi(command);
 AREA_DATA *ad;
 if ( (pMcode = get_mprog_index(vnum)) == ((void *)0) )
 {
  send_to_char("MPEdit : That vnum does not exist.\n\r",ch);
  return;
 }
 ad = get_vnum_area(vnum);
 if ( ad == ((void *)0) )
 {
  send_to_char( "MPEdit : That vnum has not been assigned to an area.\n\r", ch );
  return;
 }
 if ( !( !((((ch)->act) & ((1)))) && !( ch->desc && ch->desc->original ) && ( ch->pcdata->security >= ad->security || strstr( ad->builders, ch->name ) || strstr( ad->builders, "All" ) ) ) )
 {
  send_to_char("MPEdit : You do not have access to that area.\n\r", ch );
  return;
 }
 ch->desc->pEdit = (void *)pMcode;
 ch->desc->editor = 5;
 return;
    }
    if ( !__strcmp(command, "create", "olc_mpcode.c", __FUNCTION__, 135) )
    {
 if (((argument) == ((void *)0) || (argument)[0] == '\0'))
 {
  send_to_char( "Syntax : mpedit create [vnum]\n\r", ch );
  return;
 }
 mpedit_create(ch, argument);
 return;
    }
    send_to_char( "Syntax :   mpedit [vnum]\n\r", ch );
    send_to_char( "           mpedit create [vnum]\n\r", ch );
    return;
}

canonical_original_code:
void do_mpedit(struct char_data *ch, char *argument)
{
    struct mprog_code *pMcode;
    char command[256];
    argument = one_argument(argument, command);
    if( is_number(command) )
    {
 int vnum = atoi(command);
 struct area_data *ad;
 if ( (pMcode = get_mprog_index(vnum)) == ((void *)0) )
 {
  send_to_char("MPEdit : That vnum does not exist.\n\r",ch);
  return;
 }
 ad = get_vnum_area(vnum);
 if ( ad == ((void *)0) )
 {
  send_to_char( "MPEdit : That vnum has not been assigned to an area.\n\r", ch );
  return;
 }
 if ( !( !((((ch)->act) & ((1)))) && !( ch->desc && ch->desc->original ) && ( ch->pcdata->security >= ad->security || strstr( ad->builders, ch->name ) || strstr( ad->builders, "All" ) ) ) )
 {
  send_to_char("MPEdit : You do not have access to that area.\n\r", ch );
  return;
 }
 ch->desc->pEdit = (void *)pMcode;
 ch->desc->editor = 5;
 return;
    }
    if ( !__strcmp(command, "create", "olc_mpcode.c", __FUNCTION__, 135) )
    {
 if (((argument) == ((void *)0) || (argument)[0] == '\0'))
 {
  send_to_char( "Syntax : mpedit create [vnum]\n\r", ch );
  return;
 }
 mpedit_create(ch, argument);
 return;
    }
    send_to_char( "Syntax :   mpedit [vnum]\n\r", ch );
    send_to_char( "           mpedit create [vnum]\n\r", ch );
    return;
}

variable_types: vnum int

user_defined_types: struct char_data { struct char_data *next; struct char_data *next_in_room; struct char_data *master; struct char_data *leader; struct char_data *fighting; struct char_data *reply; struct char_data *pet; struct char_data *mprog_target; struct mem_data *memory; unsigned char (*spec_fun)(struct char_data *ch); struct mob_index_data *pIndexData; struct descriptor_data *desc; struct affect_data *affected; struct note_data *pnote; struct obj_data *carrying; struct obj_data *on; struct room_index_data *in_room; struct room_index_data *was_in_room; struct area_data *zone; struct pc_data *pcdata; struct gen_data *gen_data; unsigned char valid; char *name; long id; short version; char *short_descr; char *long_descr; char *description; char *prompt; char *prefix; short group; short clan; short sex; short iclass; short race; short level; short trust; int played; int lines; long logon; short timer; short wait; short daze; short hit; short max_hit; short mana; short max_mana; short move; short max_move; long gold; long silver; int exp; long act; long comm; long wiznet; long imm_flags; long res_flags; long vuln_flags; short invis_level; short incog_level; long affected_by; short position; short practice; short train; short carry_weight; short carry_number; short saving_throw; short alignment; short hitroll; short damroll; short armor[4]; short wimpy; short perm_stat[5]; short mod_stat[5]; long form; long parts; short size; char *material; long off_flags; short damage[3]; short dam_type; short start_pos; short default_pos; short mprog_delay; }

user_defined_types: struct mem_data { struct mem_data *next; unsigned char valid; int id; int reaction; long when; }

user_defined_types: struct descriptor_data { struct descriptor_data *next; struct descriptor_data *snoop_by; struct char_data *character; struct char_data *original; unsigned char valid; char *host; short descriptor; short connected; unsigned char fcommand; char inbuf[-1]; char incomm[256]; char inlast[256]; int repeat; char *outbuf; int outsize; int outtop; char *showstr_head; char *showstr_point; void *pEdit; char **pString; int editor; struct protocol_t *pProtocol; }

user_defined_types: struct obj_data { struct obj_data *next; struct obj_data *next_content; struct obj_data *contains; struct obj_data *in_obj; struct obj_data *on; struct char_data *carried_by; struct extra_descr_data *extra_descr; struct affect_data *affected; struct obj_index_data *pIndexData; struct room_index_data *in_room; unsigned char valid; unsigned char enchanted; char *owner; char *name; char *short_descr; char *description; short item_type; int extra_flags; int wear_flags; short wear_loc; short weight; int cost; short level; short condition; char *material; short timer; int value[5]; }

user_defined_types: struct pc_data { struct pc_data *next; struct buf_type *buffer; unsigned char valid; char *pwd; char *bamfin; char *bamfout; char *title; long last_note; long last_idea; long last_penalty; long last_news; long last_changes; short perm_hit; short perm_mana; short perm_move; short true_sex; int last_level; short condition[4]; short learned[151]; unsigned char group_known[30]; short points; unsigned char confirm_delete; char *alias[5]; char *alias_sub[5]; int security; }

user_defined_types: struct protocol_t { int WriteOOB; enum bool_t Negotiated[-1]; enum bool_t bIACMode; enum bool_t bNegotiated; enum bool_t bRenegotiate; enum bool_t bNeedMXPVersion; enum bool_t bBlockMXP; enum bool_t bTTYPE; enum bool_t bECHO; enum bool_t bNAWS; enum bool_t bCHARSET; enum bool_t bMSDP; enum bool_t bMSSP; enum bool_t bATCP; enum bool_t bMSP; enum bool_t bMXP; enum bool_t bMCCP; enum support_t b256Support; int ScreenWidth; int ScreenHeight; char *pMXPVersion; char *pLastTTYPE; struct MSDP_t **pVariables; }

user_defined_types: struct room_index_data { struct room_index_data *next; struct char_data *people; struct obj_data *contents; struct extra_descr_data *extra_descr; struct area_data *area; struct exit_data *exit[6]; struct reset_data *reset_first; struct reset_data *reset_last; char *name; char *description; char *owner; short vnum; int room_flags; short light; short sector_type; short heal_rate; short mana_rate; short clan; }

user_defined_types: struct MSDP_t { enum bool_t bReport; enum bool_t bDirty; int ValueInt; char *pValueString; }