original_code:
void shock_effect(void *vo,int level, int dam, int target)
{
 if (target == 2)
 {
  ROOM_INDEX_DATA *room = (ROOM_INDEX_DATA *) vo;
  OBJ_DATA *obj, *obj_next;
  for (obj = room->contents; obj != ((void *)0); obj = obj_next)
  {
   obj_next = obj->next_content;
   shock_effect(obj,level,dam,1);
  }
  return;
 }
 if (target == 0)
 {
  CHAR_DATA *victim = (CHAR_DATA *) vo;
  OBJ_DATA *obj, *obj_next;
  if (!saves_spell(level/4 + dam/20,victim,6))
  {
   send_to_char("Your muscles stop responding.\n\r",victim);
   ((victim)->daze = (((victim)->daze) > ((((12) > (level/4 + dam/20) ? (12) : (level/4 + dam/20)))) ? ((victim)->daze) : ((((12) > (level/4 + dam/20) ? (12) : (level/4 + dam/20))))));
  }
  for (obj = victim->carrying; obj != ((void *)0); obj = obj_next)
  {
   obj_next = obj->next_content;
   shock_effect(obj,level,dam,1);
  }
  return;
 }
 if (target == 1)
 {
  OBJ_DATA *obj = (OBJ_DATA *) vo;
  int chance = level / 4 + dam / 10;
  char *msg;
  if (((((obj)->extra_flags) & (((16777216)))))
   || ((((obj)->extra_flags) & (((16384)))))
   || number_range(0,4) == 0)
   return;
  if (chance > 25)
   chance = (chance - 25) / 2 + 25;
  if (chance > 50)
   chance = (chance - 50) /2 + 50;
  if (((((obj)->extra_flags) & (((256))))))
   chance -= 5;
  chance -= obj->level * 2;
  switch(obj->item_type)
  {
   default:
   return;
   case 3:
   case 4:
   chance += 10;
   msg = "$p overloads and explodes!";
   break;
   case 33:
   chance -= 10;
   msg = "$p is fused into a worthless lump.";
  }
  chance = ((chance) < (5) ? (5) : ((chance) > (95) ? (95) : (chance)));
  if (number_percent() > chance)
   return;
  if (obj->carried_by != ((void *)0))
   act_new((msg),(obj->carried_by),(obj),(((void *)0)),(4),5);
  else if (obj->in_room != ((void *)0) && obj->in_room->people != ((void *)0))
   act_new((msg),(obj->in_room->people),(obj),(((void *)0)),(4),5);
  extract_obj(obj);
  return;
 }
}

canonical_original_code:
void shock_effect(void *vo, int level, int dam, int target)
{
 if (target == 2)
 {
  struct room_index_data *room = (ROOM_INDEX_DATA *) vo;
  struct obj_data *obj; struct obj_data *obj_next;
  for (obj = room->contents; obj != ((void *)0); obj = obj_next)
  {
   obj_next = obj->next_content;
   shock_effect(obj,level,dam,1);
  }
  return;
 }
 if (target == 0)
 {
  struct char_data *victim = (CHAR_DATA *) vo;
  struct obj_data *obj; struct obj_data *obj_next;
  if (!saves_spell(level/4 + dam/20,victim,6))
  {
   send_to_char("Your muscles stop responding.\n\r",victim);
   ((victim)->daze = (((victim)->daze) > ((((12) > (level/4 + dam/20) ? (12) : (level/4 + dam/20)))) ? ((victim)->daze) : ((((12) > (level/4 + dam/20) ? (12) : (level/4 + dam/20))))));
  }
  for (obj = victim->carrying; obj != ((void *)0); obj = obj_next)
  {
   obj_next = obj->next_content;
   shock_effect(obj,level,dam,1);
  }
  return;
 }
 if (target == 1)
 {
  struct obj_data *obj = (OBJ_DATA *) vo;
  int chance = level / 4 + dam / 10;
  char *msg;
  if (((((obj)->extra_flags) & (((16777216)))))
   || ((((obj)->extra_flags) & (((16384)))))
   || number_range(0,4) == 0)
   return;
  if (chance > 25)
   chance = (chance - 25) / 2 + 25;
  if (chance > 50)
   chance = (chance - 50) /2 + 50;
  if (((((obj)->extra_flags) & (((256))))))
   chance -= 5;
  chance -= obj->level * 2;
  switch(obj->item_type)
  {
   default:
   return;
   case 3:
   case 4:
   chance += 10;
   msg = "$p overloads and explodes!";
   break;
   case 33:
   chance -= 10;
   msg = "$p is fused into a worthless lump.";
  }
  chance = ((chance) < (5) ? (5) : ((chance) > (95) ? (95) : (chance)));
  if (number_percent() > chance)
   return;
  if (obj->carried_by != ((void *)0))
   act_new((msg),(obj->carried_by),(obj),(((void *)0)),(4),5);
  else if (obj->in_room != ((void *)0) && obj->in_room->people != ((void *)0))
   act_new((msg),(obj->in_room->people),(obj),(((void *)0)),(4),5);
  extract_obj(obj);
  return;
 }
}

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 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 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 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 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 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 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; }


repo: ptrayal/dungeonworld

original_code:
bool hedit_show(CHAR_DATA *ch, char*argument)
{
 HELP_DATA * help;
 ( help = (HELP_DATA *) ch->desc->pEdit );
 send_to_char( Format("Keyword : [%s]\n\r"
  "Level   : [%d]\n\r"
  "Text    :\n\r"
  "%s-END-\n\r",
  help->keyword,
  help->level,
  help->text), ch );
 return 0;
}

canonical_original_code:
unsigned char hedit_show(struct char_data *ch, char *argument)
{
 struct help_data *help;
 ( help = (struct help_data *) ch->desc->pEdit );
 send_to_char( Format("Keyword : [%s]\n\r"
  "Level   : [%d]\n\r"
  "Text    :\n\r"
  "%s-END-\n\r",
  help->keyword,
  help->level,
  help->text), ch );
 return 0;
}

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 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 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 MSDP_t { enum bool_t bReport; enum bool_t bDirty; int ValueInt; char *pValueString; }


decompiled_code:
__int64 __fastcall hedit_level(__int64 a1, const char *a2)
{
__int64 result; // rax
__int64 v3; // rbx
int v4; // eax

if ( a2 && *a2 && (v3 = *(_QWORD *)(*(_QWORD *)(a1 + 88) + 1632LL), (unsigned __int8)is_number(a2)) )
{
v4 = atoi(a2);
if ( (unsigned int)(v4 + 1) > 0x3D )
{
printf_to_char(a1, "HEdit : Level must be between -1 and %d, inclusive.\n\r", 60LL);
result = 0LL;
}
else
{
*(_WORD *)(v3 + 16) = v4;
send_to_char("Ok.\n\r", a1);
result = 1LL;
}
}
else
{
send_to_char("Syntax : level [-1..MAX_LEVEL]\n\r", a1);
result = 0LL;
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func1(__int64 a1, const char *a2)
{
__int64 result; // rax
__int64 v3; // rbx
int v4; // eax

if ( a2 && *a2 && (v3 = *(_QWORD *)(*(_QWORD *)(a1 + 88) + 1632LL), (unsigned __int8)is_number(a2)) )
{
v4 = atoi(a2);
if ( (unsigned int)(v4 + 1) > 0x3D )
{
printf_to_char(a1, "HEdit : Level must be between -1 and %d, inclusive.\n\r", 60LL);
result = 0LL;
}
else
{
*(_WORD *)(v3 + 16) = v4;
send_to_char("Ok.\n\r", a1);
result = 1LL;
}
}
else
{
send_to_char("Syntax : level [-1..MAX_LEVEL]\n\r", a1);
result = 0LL;
}
return result;
}

original_code:
bool hedit_level(CHAR_DATA *ch, char*argument)
{
 HELP_DATA *help;
 int lev = 0;
 ( help = (HELP_DATA *) ch->desc->pEdit );
 if ( ((argument) == ((void *)0) || (argument)[0] == '\0') || !is_number(argument) )
 {
  send_to_char( "Syntax : level [-1..MAX_LEVEL]\n\r", ch );
  return 0;
 }
 lev = atoi(argument);
 if ( lev < -1 || lev > 60 )
 {
  printf_to_char( ch, "HEdit : Level must be between -1 and %d, inclusive.\n\r", 60 );
  return 0;
 }
 help->level = lev;
 send_to_char( "Ok.\n\r", ch );
 return 1;
}

canonical_original_code:
unsigned char hedit_level(struct char_data *ch, char *argument)
{
 struct help_data *help;
 int lev = 0;
 ( help = (struct help_data *) ch->desc->pEdit );
 if ( ((argument) == ((void *)0) || (argument)[0] == '\0') || !is_number(argument) )
 {
  send_to_char( "Syntax : level [-1..MAX_LEVEL]\n\r", ch );
  return 0;
 }
 lev = atoi(argument);
 if ( lev < -1 || lev > 60 )
 {
  printf_to_char( ch, "HEdit : Level must be between -1 and %d, inclusive.\n\r", 60 );
  return 0;
 }
 help->level = lev;
 send_to_char( "Ok.\n\r", ch );
 return 1;
}

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

variable_types: lev int

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

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 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 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:
__int64 __fastcall hedit_keyword(__int64 a1, _BYTE *a2)
{
__int64 v3; // rbx
void *v4; // rdi
__int64 result; // rax
__int64 v6; // rax

if ( a2 && *a2 )
{
v3 = *(_QWORD *)(*(_QWORD *)(a1 + 88) + 1632LL);
v4 = *(void **)(v3 + 24);
if ( v4 )
{
free(v4);
}
else if ( logFail )
{
v6 = Format(
"clear_free_lists: unable to purge_data as it was NULL from: %s %s %d",
"hedit.c",
"hedit_keyword",
119LL);
log_string(v6);
}
*(_QWORD *)(v3 + 24) = 0LL;
*(_QWORD *)(v3 + 24) = str_dup(a2, "hedit.c", "hedit_keyword", 120LL);
send_to_char("Ok.\n\r", a1);
result = 1LL;
}
else
{
send_to_char("Syntax : keyword [keyword(s)]\n\r", a1);
result = 0LL;
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func2(__int64 a1, _BYTE *a2)
{
__int64 v3; // rbx
void *v4; // rdi
__int64 result; // rax
__int64 v6; // rax

if ( a2 && *a2 )
{
v3 = *(_QWORD *)(*(_QWORD *)(a1 + 88) + 1632LL);
v4 = *(void **)(v3 + 24);
if ( v4 )
{
free(v4);
}
else if ( logFail )
{
v6 = Format(
"clear_free_lists: unable to purge_data as it was NULL from: %s %s %d",
"hedit.c",
"hedit_keyword",
119LL);
log_string(v6);
}
*(_QWORD *)(v3 + 24) = 0LL;
*(_QWORD *)(v3 + 24) = str_dup(a2, "hedit.c", "hedit_keyword", 120LL);
send_to_char("Ok.\n\r", a1);
result = 1LL;
}
else
{
send_to_char("Syntax : keyword [keyword(s)]\n\r", a1);
result = 0LL;
}
return result;
}

original_code:
bool hedit_keyword(CHAR_DATA *ch, char*argument)
{
 HELP_DATA *help;
 ( help = (HELP_DATA *) ch->desc->pEdit );
 if ( ((argument) == ((void *)0) || (argument)[0] == '\0') )
 {
  send_to_char( "Syntax : keyword [keyword(s)]\n\r", ch );
  return 0;
 }
 do { if(help->keyword) { free((void *)help->keyword); } else { if(logFail) { log_string((char *)Format("clear_free_lists: unable to purge_data as it was NULL from: %s %s %d", "hedit.c", __FUNCTION__, 119)); } } help->keyword = ((void *)0); } while(0);
 help->keyword = _str_dup(argument, "hedit.c", __FUNCTION__, 120);
 send_to_char( "Ok.\n\r", ch );
 return 1;
}

canonical_original_code:
unsigned char hedit_keyword(struct char_data *ch, char *argument)
{
 struct help_data *help;
 ( help = (struct help_data *) ch->desc->pEdit );
 if ( ((argument) == ((void *)0) || (argument)[0] == '\0') )
 {
  send_to_char( "Syntax : keyword [keyword(s)]\n\r", ch );
  return 0;
 }
 do { if(help->keyword) { free((void *)help->keyword); } else { if(logFail) { log_string((char *)Format("clear_free_lists: unable to purge_data as it was NULL from: %s %s %d", "hedit.c", __FUNCTION__, 119)); } } help->keyword = ((void *)0); } while(0);
 help->keyword = _str_dup(argument, "hedit.c", __FUNCTION__, 120);
 send_to_char( "Ok.\n\r", ch );
 return 1;
}

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 help_data { struct help_data *next; struct help_data *next_area; short level; char *keyword; char *text; }

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 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 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; }


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

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

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

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

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

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

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

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 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 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 MSDP_t { enum bool_t bReport; enum bool_t bDirty; int ValueInt; char *pValueString; }


decompiled_code:
__int64 __fastcall hedit_delete(__int64 a1)
{
__int64 *v1; // rbx
__int64 v2; // rbp
_QWORD *v3; // rax
__int64 result; // rax
_QWORD *v5; // rcx
__int64 v6; // rsi
__int64 v7; // rax

v1 = (__int64 *)descriptor_list;
v2 = *(_QWORD *)(*(_QWORD *)(a1 + 88) + 1632LL);
if ( descriptor_list )
{
do
{
while ( *((_DWORD *)v1 + 412) != 6 || v1[204] != v2 )
{
v1 = (__int64 *)*v1;
if ( !v1 )
goto LABEL_7;
}
edit_done(v1[2]);
v1 = (__int64 *)*v1;
}
while ( v1 );
}
LABEL_7:
v3 = (_QWORD *)help_first;
if ( help_first == v2 )
{
help_first = *(_QWORD *)v2;
}
else
{
while ( 1 )
{
if ( !v3 )
{
bugf("hedit_delete : help '%s' not found in the help_first list!", *(const char **)(v2 + 24));
return 0LL;
}
if ( *v3 == v2 )
break;
v3 = (_QWORD *)*v3;
}
*v3 = *(_QWORD *)v2;
}
v5 = (_QWORD *)had_list;
if ( !had_list )
goto LABEL_26;
v6 = 0LL;
do
{
v7 = v5[1];
if ( v7 == v2 )
{
v6 = 1LL;
v5[1] = *(_QWORD *)(v2 + 8);
}
else
{
while ( v7 )
{
if ( *(_QWORD *)(v7 + 8) == v2 )
{
*(_QWORD *)(v7 + 8) = *(_QWORD *)(v2 + 8);
goto LABEL_25;
}
v7 = *(_QWORD *)(v7 + 8);
}
}
v5 = (_QWORD *)*v5;
}
while ( v5 );
if ( (_BYTE)v6 )
{
LABEL_25:
free_help(v2, v6);
send_to_char("Ok.\n\r", a1);
result = 1LL;
}
else
{
LABEL_26:
bugf("hedit_delete : help %s not found in had_list!", *(const char **)(v2 + 24));
result = 0LL;
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func4(__int64 a1)
{
__int64 *v1; // rbx
__int64 v2; // rbp
_QWORD *v3; // rax
__int64 result; // rax
_QWORD *v5; // rcx
__int64 v6; // rsi
__int64 v7; // rax

v1 = (__int64 *)descriptor_list;
v2 = *(_QWORD *)(*(_QWORD *)(a1 + 88) + 1632LL);
if ( descriptor_list )
{
do
{
while ( *((_DWORD *)v1 + 412) != 6 || v1[204] != v2 )
{
v1 = (__int64 *)*v1;
if ( !v1 )
goto LABEL_7;
}
edit_done(v1[2]);
v1 = (__int64 *)*v1;
}
while ( v1 );
}
LABEL_7:
v3 = (_QWORD *)help_first;
if ( help_first == v2 )
{
help_first = *(_QWORD *)v2;
}
else
{
while ( 1 )
{
if ( !v3 )
{
bugf("hedit_delete : help '%s' not found in the help_first list!", *(const char **)(v2 + 24));
return 0LL;
}
if ( *v3 == v2 )
break;
v3 = (_QWORD *)*v3;
}
*v3 = *(_QWORD *)v2;
}
v5 = (_QWORD *)had_list;
if ( !had_list )
goto LABEL_26;
v6 = 0LL;
do
{
v7 = v5[1];
if ( v7 == v2 )
{
v6 = 1LL;
v5[1] = *(_QWORD *)(v2 + 8);
}
else
{
while ( v7 )
{
if ( *(_QWORD *)(v7 + 8) == v2 )
{
*(_QWORD *)(v7 + 8) = *(_QWORD *)(v2 + 8);
goto LABEL_25;
}
v7 = *(_QWORD *)(v7 + 8);
}
}
v5 = (_QWORD *)*v5;
}
while ( v5 );
if ( (_BYTE)v6 )
{
LABEL_25:
free_help(v2, v6);
send_to_char("Ok.\n\r", a1);
result = 1LL;
}
else
{
LABEL_26:
bugf("hedit_delete : help %s not found in had_list!", *(const char **)(v2 + 24));
result = 0LL;
}
return result;
}

original_code:
bool hedit_delete(CHAR_DATA *ch, char*argument)
{
 HELP_DATA * pHelp, * temp;
 HELP_AREA * had;
 DESCRIPTOR_DATA *d;
 bool found = 0;
 ( pHelp = (HELP_DATA *) ch->desc->pEdit );
 for ( d = descriptor_list; d; d = d->next )
  if ( d->editor == 6 && pHelp == (HELP_DATA *) d->pEdit )
   edit_done(d->character);
 if (help_first == pHelp)
  help_first = help_first->next;
 else
 {
  for ( temp = help_first; temp; temp = temp->next )
   if ( temp->next == pHelp )
    break;
  if ( !temp )
  {
   bugf( "hedit_delete : help '%s' not found in the help_first list!", pHelp->keyword );
   return 0;
  }
  temp->next = pHelp->next;
 }
 for ( had = had_list; had; had = had->next )
  if ( pHelp == had->first )
  {
   found = 1;
   had->first = had->first->next_area;
  }
  else
  {
   for ( temp = had->first; temp; temp = temp->next_area )
    if ( temp->next_area == pHelp )
     break;
   if ( temp )
   {
    temp->next_area = pHelp->next_area;
    found = 1;
    break;
   }
  }
 if ( !found )
 {
  bugf( "hedit_delete : help %s not found in had_list!", pHelp->keyword );
  return 0;
 }
 free_help(pHelp);
 send_to_char( "Ok.\n\r", ch );
 return 1;
}

canonical_original_code:
unsigned char hedit_delete(struct char_data *ch, char *argument)
{
 struct help_data *pHelp; struct help_data *temp;
 struct help_area_data *had;
 struct descriptor_data *d;
 unsigned char found = 0;
 ( pHelp = (struct help_data *) ch->desc->pEdit );
 for ( d = descriptor_list; d; d = d->next )
  if ( d->editor == 6 && pHelp == (struct help_data *) d->pEdit )
   edit_done(d->character);
 if (help_first == pHelp)
  help_first = help_first->next;
 else
 {
  for ( temp = help_first; temp; temp = temp->next )
   if ( temp->next == pHelp )
    break;
  if ( !temp )
  {
   bugf( "hedit_delete : help '%s' not found in the help_first list!", pHelp->keyword );
   return 0;
  }
  temp->next = pHelp->next;
 }
 for ( had = had_list; had; had = had->next )
  if ( pHelp == had->first )
  {
   found = 1;
   had->first = had->first->next_area;
  }
  else
  {
   for ( temp = had->first; temp; temp = temp->next_area )
    if ( temp->next_area == pHelp )
     break;
   if ( temp )
   {
    temp->next_area = pHelp->next_area;
    found = 1;
    break;
   }
  }
 if ( !found )
 {
  bugf( "hedit_delete : help %s not found in had_list!", pHelp->keyword );
  return 0;
 }
 free_help(pHelp);
 send_to_char( "Ok.\n\r", ch );
 return 1;
}

variable_types: 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 { 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; } *area; char *filename; unsigned char changed; } *

variable_types: struct descriptor_data { struct descriptor_data *next; struct descriptor_data *snoop_by; 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 *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; } *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; } *

variable_types:
found
unsigned char


original_code:
bool hedit_list(CHAR_DATA *ch, char*argument)
{
 char buf[256]={'\0'};
 int cnt = 0;
 HELP_DATA *pHelp;
 BUFFER *buffer;
 ( pHelp = (HELP_DATA *) ch->desc->pEdit );
 if ( !__strcmp(argument, "all", "hedit.c", __FUNCTION__, 363) )
 {
  buffer = __new_buf("hedit.c", __FUNCTION__, 365);
  for ( pHelp = help_first; pHelp; pHelp = pHelp->next )
  {
   sprintf( buf, "%3d. %-14.14s%s", cnt, pHelp->keyword,
    cnt % 4 == 3 ? "\n\r" : " " );
   add_buf( buffer, buf );
   cnt++;
  }
  if ( cnt % 4 )
   add_buf( buffer, "\n\r" );
  page_to_char( buf_string(buffer), ch );
  return 0;
 }
 if ( !__strcmp(argument, "area", "hedit.c", __FUNCTION__, 382) )
 {
  if ( ch->in_room->area->helps == ((void *)0) )
  {
   send_to_char( "There are no helps in this area.\n\r", ch );
   return 0;
  }
  buffer = __new_buf("hedit.c", __FUNCTION__, 390);
  for ( pHelp = ch->in_room->area->helps->first; pHelp; pHelp = pHelp->next_area )
  {
   sprintf( buf, "%3d. %-14.14s%s", cnt, pHelp->keyword,
    cnt % 4 == 3 ? "\n\r" : " " );
   add_buf( buffer, buf );
   cnt++;
  }
  if ( cnt % 4 )
   add_buf( buffer, "\n\r" );
  page_to_char( buf_string(buffer), ch );
  return 0;
 }
 if ( ((argument) == ((void *)0) || (argument)[0] == '\0') )
 {
  send_to_char( "Syntax : list all\n\r", ch );
  send_to_char( "         list area\n\r", ch );
  return 0;
 }
 return 0;
}

canonical_original_code:
unsigned char hedit_list(struct char_data *ch, char *argument)
{
 char buf[256] = {'\0'};
 int cnt = 0;
 struct help_data *pHelp;
 struct buf_type *buffer;
 ( pHelp = (struct help_data *) ch->desc->pEdit );
 if ( !__strcmp(argument, "all", "hedit.c", __FUNCTION__, 363) )
 {
  buffer = __new_buf("hedit.c", __FUNCTION__, 365);
  for ( pHelp = help_first; pHelp; pHelp = pHelp->next )
  {
   sprintf( buf, "%3d. %-14.14s%s", cnt, pHelp->keyword,
    cnt % 4 == 3 ? "\n\r" : " " );
   add_buf( buffer, buf );
   cnt++;
  }
  if ( cnt % 4 )
   add_buf( buffer, "\n\r" );
  page_to_char( buf_string(buffer), ch );
  return 0;
 }
 if ( !__strcmp(argument, "area", "hedit.c", __FUNCTION__, 382) )
 {
  if ( ch->in_room->area->helps == ((void *)0) )
  {
   send_to_char( "There are no helps in this area.\n\r", ch );
   return 0;
  }
  buffer = __new_buf("hedit.c", __FUNCTION__, 390);
  for ( pHelp = ch->in_room->area->helps->first; pHelp; pHelp = pHelp->next_area )
  {
   sprintf( buf, "%3d. %-14.14s%s", cnt, pHelp->keyword,
    cnt % 4 == 3 ? "\n\r" : " " );
   add_buf( buffer, buf );
   cnt++;
  }
  if ( cnt % 4 )
   add_buf( buffer, "\n\r" );
  page_to_char( buf_string(buffer), ch );
  return 0;
 }
 if ( ((argument) == ((void *)0) || (argument)[0] == '\0') )
 {
  send_to_char( "Syntax : list all\n\r", ch );
  send_to_char( "         list area\n\r", ch );
  return 0;
 }
 return 0;
}

variable_types:
buf
char [256]

variable_types: cnt int

variable_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 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 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: enum support_t { eUNKNOWN=0, eNO=1, eSOMETIMES=2, eYES=3 }


original_code:
void do_hedit(CHAR_DATA *ch, char *argument)
{
 HELP_DATA * pHelp;
 if ( ((((ch)->act) & ((1)))) )
  return;
 if ( (pHelp = help_lookup( argument )) == ((void *)0) )
 {
  send_to_char( "HEdit : That helpfile does not exist.\n\r", ch );
  return;
 }
 ch->desc->pEdit = (void *) pHelp;
 ch->desc->editor = 6;
 return;
}

canonical_original_code:
void do_hedit(struct char_data *ch, char *argument)
{
 struct help_data *pHelp;
 if ( ((((ch)->act) & ((1)))) )
  return;
 if ( (pHelp = help_lookup( argument )) == ((void *)0) )
 {
  send_to_char( "HEdit : That helpfile does not exist.\n\r", ch );
  return;
 }
 ch->desc->pEdit = (void *) pHelp;
 ch->desc->editor = 6;
 return;
}

return_type: void

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 help_data { struct help_data *next; struct help_data *next_area; short level; char *keyword; char *text; }

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 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 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 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:
_BYTE *new_reset_data()
{
_BYTE *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_reset_data",
50LL);
abort();
}
result[8] = 88;
*((_WORD *)result + 5) = 0;
*((_DWORD *)result + 3) = 0;
return result;
}

canonical_decompiled_code:
_BYTE *func0()
{
_BYTE *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_reset_data",
50LL);
abort();
}
result[8] = 88;
*((_WORD *)result + 5) = 0;
*((_DWORD *)result + 3) = 0;
return result;
}

original_code:
RESET_DATA *new_reset_data( void )
{
    RESET_DATA *pReset;
    do { if (!((pReset) = (RESET_DATA *) calloc ((1), sizeof(RESET_DATA)))) { logfmt("Unable to calloc new data from file: %s function: %s, line: %d\t *** ABORTING ***", "mem.c", __FUNCTION__, 50); abort(); } } while(0);
    pReset->next = ((void *)0);
    pReset->command = 'X';
    pReset->arg1 = 0;
    pReset->arg2 = 0;
    pReset->arg3 = 0;
    return pReset;
}

canonical_original_code:
struct reset_data *new_reset_data()
{
    struct reset_data *pReset;
    do { if (!((pReset) = (struct reset_data *) calloc ((1), sizeof(RESET_DATA)))) { logfmt("Unable to calloc new data from file: %s function: %s, line: %d\t *** ABORTING ***", "mem.c", __FUNCTION__, 50); abort(); } } while(0);
    pReset->next = ((void *)0);
    pReset->command = 'X';
    pReset->arg1 = 0;
    pReset->arg2 = 0;
    pReset->arg3 = 0;
    return pReset;
}

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


decompiled_code:
void __fastcall free_reset_data(void *a1)
{
__int64 v1; // rax

if ( a1 )
{
free(a1);
}
else if ( logFail )
{
v1 = Format(
"clear_free_lists: unable to purge_data as it was NULL from: %s %s %d",
"mem.c",
"free_reset_data",
65LL);
log_string(v1);
}
}

canonical_decompiled_code:
void __fastcall func1(void *a1)
{
__int64 v1; // rax

if ( a1 )
{
free(a1);
}
else if ( logFail )
{
v1 = Format(
"clear_free_lists: unable to purge_data as it was NULL from: %s %s %d",
"mem.c",
"free_reset_data",
65LL);
log_string(v1);
}
}

original_code:
void free_reset_data( RESET_DATA *pReset )
{
 do { if(pReset) { free((void *)pReset); } 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__, 65)); } } pReset = ((void *)0); } while(0);
    return;
}

canonical_original_code:
void free_reset_data(struct reset_data *pReset)
{
 do { if(pReset) { free((void *)pReset); } 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__, 65)); } } pReset = ((void *)0); } while(0);
    return;
}


decompiled_code:
_QWORD *new_area()
{
_QWORD *v0; // rax
_QWORD *v1; // r12
__int64 v2; // rax
__int64 v3; // rsi
__int64 v4; // rax
__int64 v5; // rax
_QWORD *result; // rax

v0 = calloc(1uLL, 0x50uLL);
if ( !v0 )
{
logfmt(
"Unable to calloc new data from file: %s function: %s, line: %d\t *** ABORTING ***",
"mem.c",
"new_area",
75LL);
abort();
}
v1 = v0;
v0[3] = str_dup("New Area", "mem.c", "new_area", 77LL);
v2 = str_dup("None", "mem.c", "new_area", 78LL);
v3 = *((unsigned int *)v1 + 16);
v1[7] = v2;
v4 = Format("area%d.are", v3);
v5 = str_dup(v4, "mem.c", "new_area", 79LL);
*v1 = 0LL;
v1[2] = v5;
*(_QWORD *)((char *)v1 + 68) = 0x100000002LL;
LODWORD(v5) = top_area;
*((_DWORD *)v1 + 10) = 0;
*((_BYTE *)v1 + 52) = 1;
*((_DWORD *)v1 + 16) = v5 - 1;
result = v1;
*((_DWORD *)v1 + 12) = 0;
return result;
}

canonical_decompiled_code:
_QWORD *func2()
{
_QWORD *v0; // rax
_QWORD *v1; // r12
__int64 v2; // rax
__int64 v3; // rsi
__int64 v4; // rax
__int64 v5; // rax
_QWORD *result; // rax

v0 = calloc(1uLL, 0x50uLL);
if ( !v0 )
{
logfmt(
"Unable to calloc new data from file: %s function: %s, line: %d\t *** ABORTING ***",
"mem.c",
"new_area",
75LL);
abort();
}
v1 = v0;
v0[3] = str_dup("New Area", "mem.c", "new_area", 77LL);
v2 = str_dup("None", "mem.c", "new_area", 78LL);
v3 = *((unsigned int *)v1 + 16);
v1[7] = v2;
v4 = Format("area%d.are", v3);
v5 = str_dup(v4, "mem.c", "new_area", 79LL);
*v1 = 0LL;
v1[2] = v5;
*(_QWORD *)((char *)v1 + 68) = 0x100000002LL;
LODWORD(v5) = top_area;
*((_DWORD *)v1 + 10) = 0;
*((_BYTE *)v1 + 52) = 1;
*((_DWORD *)v1 + 16) = v5 - 1;
result = v1;
*((_DWORD *)v1 + 12) = 0;
return result;
}

original_code:
AREA_DATA *new_area( void )
{
    AREA_DATA *pArea;
    do { if (!((pArea) = (AREA_DATA *) calloc ((1), sizeof(AREA_DATA)))) { logfmt("Unable to calloc new data from file: %s function: %s, line: %d\t *** ABORTING ***", "mem.c", __FUNCTION__, 75); abort(); } } while(0);
    pArea->name = _str_dup("New Area", "mem.c", __FUNCTION__, 77);
    pArea->builders = _str_dup("None", "mem.c", __FUNCTION__, 78);
    pArea->file_name = _str_dup((char *)Format("area%d.are", pArea->vnum), "mem.c", __FUNCTION__, 79);
    pArea->next = ((void *)0);
    pArea->area_flags = 2;
    pArea->security = 1;
    pArea->min_vnum = 0;
    pArea->max_vnum = 0;
    pArea->age = 0;
    pArea->nplayer = 0;
    pArea->empty = 1;
    pArea->vnum = top_area-1;
    return pArea;
}

canonical_original_code:
struct area_data *new_area()
{
    struct area_data *pArea;
    do { if (!((pArea) = (struct area_data *) calloc ((1), sizeof(AREA_DATA)))) { logfmt("Unable to calloc new data from file: %s function: %s, line: %d\t *** ABORTING ***", "mem.c", __FUNCTION__, 75); abort(); } } while(0);
    pArea->name = _str_dup("New Area", "mem.c", __FUNCTION__, 77);
    pArea->builders = _str_dup("None", "mem.c", __FUNCTION__, 78);
    pArea->file_name = _str_dup((char *)Format("area%d.are", pArea->vnum), "mem.c", __FUNCTION__, 79);
    pArea->next = ((void *)0);
    pArea->area_flags = 2;
    pArea->security = 1;
    pArea->min_vnum = 0;
    pArea->max_vnum = 0;
    pArea->age = 0;
    pArea->nplayer = 0;
    pArea->empty = 1;
    pArea->vnum = top_area-1;
    return pArea;
}

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 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; }


decompiled_code:
void __fastcall free_area(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 + 3);
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_area", 101LL);
log_string(v6);
}
v3 = (void *)*((_QWORD *)ptr + 2);
*((_QWORD *)ptr + 3) = 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_area", 102LL);
log_string(v9);
}
v4 = (void *)*((_QWORD *)ptr + 7);
*((_QWORD *)ptr + 2) = 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_area", 103LL);
log_string(v8);
}
v5 = (void *)*((_QWORD *)ptr + 4);
*((_QWORD *)ptr + 7) = 0LL;
if ( v5 )
{
free(v5);
LABEL_10:
free(ptr);
return;
}
if ( !logFail )
goto LABEL_10;
v7 = Format("clear_free_lists: unable to purge_data as it was NULL from: %s %s %d", "mem.c", "free_area", 104LL);
log_string(v7);
free(ptr);
}
}

canonical_decompiled_code:
void __fastcall func3(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 + 3);
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_area", 101LL);
log_string(v6);
}
v3 = (void *)*((_QWORD *)ptr + 2);
*((_QWORD *)ptr + 3) = 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_area", 102LL);
log_string(v9);
}
v4 = (void *)*((_QWORD *)ptr + 7);
*((_QWORD *)ptr + 2) = 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_area", 103LL);
log_string(v8);
}
v5 = (void *)*((_QWORD *)ptr + 4);
*((_QWORD *)ptr + 7) = 0LL;
if ( v5 )
{
free(v5);
LABEL_10:
free(ptr);
return;
}
if ( !logFail )
goto LABEL_10;
v7 = Format("clear_free_lists: unable to purge_data as it was NULL from: %s %s %d", "mem.c", "free_area", 104LL);
log_string(v7);
free(ptr);
}
}

original_code:
void free_area( AREA_DATA *pArea )
{
    do { if(!pArea) return; } while(0);
    do { if(pArea->name) { free((void *)pArea->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__, 101)); } } pArea->name = ((void *)0); } while(0);
    do { if(pArea->file_name) { free((void *)pArea->file_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__, 102)); } } pArea->file_name = ((void *)0); } while(0);
    do { if(pArea->builders) { free((void *)pArea->builders); } 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__, 103)); } } pArea->builders = ((void *)0); } while(0);
    do { if(pArea->credits) { free((void *)pArea->credits); } 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__, 104)); } } pArea->credits = ((void *)0); } while(0);
    do { if(pArea) { free((void *)pArea); } 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__, 106)); } } pArea = ((void *)0); } while(0);
    return;
}

canonical_original_code:
void free_area(struct area_data *pArea)
{
    do { if(!pArea) return; } while(0);
    do { if(pArea->name) { free((void *)pArea->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__, 101)); } } pArea->name = ((void *)0); } while(0);
    do { if(pArea->file_name) { free((void *)pArea->file_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__, 102)); } } pArea->file_name = ((void *)0); } while(0);
    do { if(pArea->builders) { free((void *)pArea->builders); } 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__, 103)); } } pArea->builders = ((void *)0); } while(0);
    do { if(pArea->credits) { free((void *)pArea->credits); } 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__, 104)); } } pArea->credits = ((void *)0); } while(0);
    do { if(pArea) { free((void *)pArea); } 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__, 106)); } } pArea = ((void *)0); } while(0);
    return;
}


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

result = calloc(1uLL, 0x30uLL);
if ( !result )
{
logfmt(
"Unable to calloc new data from file: %s function: %s, line: %d\t *** ABORTING ***",
"mem.c",
"new_exit",
116LL);
abort();
}
result[2] = 0LL;
*((_WORD *)result + 6) = 0;
result[3] = 0LL;
*((_DWORD *)result + 10) = 0;
return result;
}

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

result = calloc(1uLL, 0x30uLL);
if ( !result )
{
logfmt(
"Unable to calloc new data from file: %s function: %s, line: %d\t *** ABORTING ***",
"mem.c",
"new_exit",
116LL);
abort();
}
result[2] = 0LL;
*((_WORD *)result + 6) = 0;
result[3] = 0LL;
*((_DWORD *)result + 10) = 0;
return result;
}

original_code:
EXIT_DATA *new_exit( void )
{
    EXIT_DATA *pExit;
    do { if (!((pExit) = (EXIT_DATA *) calloc ((1), sizeof(EXIT_DATA)))) { logfmt("Unable to calloc new data from file: %s function: %s, line: %d\t *** ABORTING ***", "mem.c", __FUNCTION__, 116); abort(); } } while(0);
    pExit->u1.to_room = ((void *)0);
    pExit->next = ((void *)0);
    pExit->exit_info = 0;
    pExit->key = 0;
    pExit->keyword = ((void *)0);
    pExit->description = ((void *)0);
    pExit->rs_flags = 0;
    return pExit;
}

canonical_original_code:
struct exit_data *new_exit()
{
    struct exit_data *pExit;
    do { if (!((pExit) = (struct exit_data *) calloc ((1), sizeof(EXIT_DATA)))) { logfmt("Unable to calloc new data from file: %s function: %s, line: %d\t *** ABORTING ***", "mem.c", __FUNCTION__, 116); abort(); } } while(0);
    pExit->u1.to_room = ((void *)0);
    pExit->next = ((void *)0);
    pExit->exit_info = 0;
    pExit->key = 0;
    pExit->keyword = ((void *)0);
    pExit->description = ((void *)0);
    pExit->rs_flags = 0;
    return pExit;
}

variable_types: struct exit_data { union { struct room_index_data { struct room_index_data *next; 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 *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; } *people; struct obj_data *contents; struct extra_descr_data *extra_descr; struct area_data *area; struct exit_data *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; } *to_room; short vnum; } u1; int exit_info; short key; char *keyword; char *description; struct exit_data *next; int rs_flags; int orig_door; } *

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 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; }


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

if ( ptr )
{
v2 = (void *)*((_QWORD *)ptr + 2);
if ( v2 )
{
free(v2);
}
else if ( logFail )
{
v4 = Format("clear_free_lists: unable to purge_data as it was NULL from: %s %s %d", "mem.c", "free_exit", 136LL);
log_string(v4);
}
v3 = (void *)*((_QWORD *)ptr + 3);
*((_QWORD *)ptr + 2) = 0LL;
if ( v3 )
{
free(v3);
LABEL_6:
free(ptr);
return;
}
if ( !logFail )
goto LABEL_6;
v5 = Format("clear_free_lists: unable to purge_data as it was NULL from: %s %s %d", "mem.c", "free_exit", 137LL);
log_string(v5);
free(ptr);
}
}

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

if ( ptr )
{
v2 = (void *)*((_QWORD *)ptr + 2);
if ( v2 )
{
free(v2);
}
else if ( logFail )
{
v4 = Format("clear_free_lists: unable to purge_data as it was NULL from: %s %s %d", "mem.c", "free_exit", 136LL);
log_string(v4);
}
v3 = (void *)*((_QWORD *)ptr + 3);
*((_QWORD *)ptr + 2) = 0LL;
if ( v3 )
{
free(v3);
LABEL_6:
free(ptr);
return;
}
if ( !logFail )
goto LABEL_6;
v5 = Format("clear_free_lists: unable to purge_data as it was NULL from: %s %s %d", "mem.c", "free_exit", 137LL);
log_string(v5);
free(ptr);
}
}

original_code:
void free_exit( EXIT_DATA *pExit )
{
    do { if(!pExit) return; } while(0);
    do { if(pExit->keyword) { free((void *)pExit->keyword); } 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__, 136)); } } pExit->keyword = ((void *)0); } while(0);
    do { if(pExit->description) { free((void *)pExit->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__, 137)); } } pExit->description = ((void *)0); } while(0);
    do { if(pExit) { free((void *)pExit); } 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__, 139)); } } pExit = ((void *)0); } while(0);
    return;
}

canonical_original_code:
void free_exit(struct exit_data *pExit)
{
    do { if(!pExit) return; } while(0);
    do { if(pExit->keyword) { free((void *)pExit->keyword); } 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__, 136)); } } pExit->keyword = ((void *)0); } while(0);
    do { if(pExit->description) { free((void *)pExit->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__, 137)); } } pExit->description = ((void *)0); } while(0);
    do { if(pExit) { free((void *)pExit); } 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__, 139)); } } pExit = ((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 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 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 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 MSDP_t { enum bool_t bReport; enum bool_t bDirty; int ValueInt; char *pValueString; }


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

v0 = calloc(1uLL, 0x98uLL);
if ( !v0 )
{
logfmt(
"Unable to calloc new data from file: %s function: %s, line: %d\t *** ABORTING ***",
"mem.c",
"new_room_index",
149LL);
abort();
}
v0[3] = 0LL;
v1 = v0;
v0[4] = 0LL;
v0[5] = 0LL;
v0[6] = 0LL;
v0[7] = 0LL;
v0[8] = 0LL;
v0[9] = 0LL;
v0[10] = 0LL;
v0[13] = str_dup("Unnamed Room", "mem.c", "new_room_index", 160LL);
v2 = str_dup("None", "mem.c", "new_room_index", 161LL);
v1[15] = 0LL;
v1[14] = v2;
*((_WORD *)v1 + 64) = 0;
v1[17] = 0x64006400000000LL;
result = v1;
*((_DWORD *)v1 + 33) = 0;
*((_WORD *)v1 + 72) = 0;
return result;
}

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

v0 = calloc(1uLL, 0x98uLL);
if ( !v0 )
{
logfmt(
"Unable to calloc new data from file: %s function: %s, line: %d\t *** ABORTING ***",
"mem.c",
"new_room_index",
149LL);
abort();
}
v0[3] = 0LL;
v1 = v0;
v0[4] = 0LL;
v0[5] = 0LL;
v0[6] = 0LL;
v0[7] = 0LL;
v0[8] = 0LL;
v0[9] = 0LL;
v0[10] = 0LL;
v0[13] = str_dup("Unnamed Room", "mem.c", "new_room_index", 160LL);
v2 = str_dup("None", "mem.c", "new_room_index", 161LL);
v1[15] = 0LL;
v1[14] = v2;
*((_WORD *)v1 + 64) = 0;
v1[17] = 0x64006400000000LL;
result = v1;
*((_DWORD *)v1 + 33) = 0;
*((_WORD *)v1 + 72) = 0;
return result;
}

original_code:
ROOM_INDEX_DATA *new_room_index( void )
{
    ROOM_INDEX_DATA *pRoom;
    int door = 0;
    do { if (!((pRoom) = (ROOM_INDEX_DATA *) calloc ((1), sizeof(ROOM_INDEX_DATA)))) { logfmt("Unable to calloc new data from file: %s function: %s, line: %d\t *** ABORTING ***", "mem.c", __FUNCTION__, 149); abort(); } } while(0);
    pRoom->next = ((void *)0);
    pRoom->people = ((void *)0);
    pRoom->contents = ((void *)0);
    pRoom->extra_descr = ((void *)0);
    pRoom->area = ((void *)0);
    for ( door=0; door < 6; door++ )
        pRoom->exit[door] = ((void *)0);
    pRoom->name = _str_dup("Unnamed Room", "mem.c", __FUNCTION__, 160);
    pRoom->description = _str_dup("None", "mem.c", __FUNCTION__, 161);
    pRoom->owner = ((void *)0);
    pRoom->vnum = 0;
    pRoom->room_flags = 0;
    pRoom->light = 0;
    pRoom->sector_type = 0;
    pRoom->clan = 0;
    pRoom->heal_rate = 100;
    pRoom->mana_rate = 100;
    return pRoom;
}

canonical_original_code:
struct room_index_data *new_room_index()
{
    struct room_index_data *pRoom;
    int door = 0;
    do { if (!((pRoom) = (struct room_index_data *) calloc ((1), sizeof(ROOM_INDEX_DATA)))) { logfmt("Unable to calloc new data from file: %s function: %s, line: %d\t *** ABORTING ***", "mem.c", __FUNCTION__, 149); abort(); } } while(0);
    pRoom->next = ((void *)0);
    pRoom->people = ((void *)0);
    pRoom->contents = ((void *)0);
    pRoom->extra_descr = ((void *)0);
    pRoom->area = ((void *)0);
    for ( door=0; door < 6; door++ )
        pRoom->exit[door] = ((void *)0);
    pRoom->name = _str_dup("Unnamed Room", "mem.c", __FUNCTION__, 160);
    pRoom->description = _str_dup("None", "mem.c", __FUNCTION__, 161);
    pRoom->owner = ((void *)0);
    pRoom->vnum = 0;
    pRoom->room_flags = 0;
    pRoom->light = 0;
    pRoom->sector_type = 0;
    pRoom->clan = 0;
    pRoom->heal_rate = 100;
    pRoom->mana_rate = 100;
    return pRoom;
}

variable_types: struct room_index_data { struct room_index_data *next; 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 *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; } *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; } *

variable_types: door 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 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; }