decompiled_code:
__int64 __fastcall bz_list_to_wstr(__int64 a1)
{
__int64 v1; // rbx

bz_barf_push_function("bz_list_to_wstr");
v1 = bz_list_to_string(a1);
bz_barf_pop_function();
return *(_QWORD *)(v1 + 24);
}

canonical_decompiled_code:
__int64 __fastcall func22(__int64 a1)
{
__int64 v1; // rbx

bz_barf_push_function("bz_list_to_wstr");
v1 = func21(a1);
bz_barf_pop_function();
return *(_QWORD *)(v1 + 24);
}

original_code:
wchar_t* bz_list_to_wstr(bz_List* e)
{
  {bz_barf_push_function(__PRETTY_FUNCTION__);;};
  bz_String*s = bz_list_to_string(e);
  {;bz_barf_pop_function();return (s->string);};
}

canonical_original_code:
int *bz_list_to_wstr(struct bz_list_node *e)
{
  {bz_barf_push_function(__PRETTY_FUNCTION__);;};
  struct bz_String *s = bz_list_to_string(e);
  {;bz_barf_pop_function();return (s->string);};
}


repo: sambeau/burp

decompiled_code:
// attributes: thunk
__int64 __fastcall bz_list_to_list(__int64 a1)
{
return bz_empty_to_list(a1);
}

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

original_code:
bz_List* bz_list_to_list(bz_List* e)
{
  return e;
}

canonical_original_code:
struct bz_list_node *bz_list_to_list(struct bz_list_node *e)
{
  return e;
}

variable_types:
e
struct bz_list_node *

return_type: struct bz_list_node { struct bz_Type { int *name; unsigned long size; void *(*new)(); void *(*clone)(); int (*length)(); int (*charsize)(); int (*compare)(); void *(*to_integer)(); void *(*to_real)(); void *(*to_string)(); void *(*to_list)(); void *(*to_wstr)(); void *(*show)(); } *type; void *node; struct bz_list_node *next; } *

user_defined_types: struct bz_list_node { struct bz_Type *type; void *node; struct bz_list_node *next; }


decompiled_code:
__int64 __fastcall bz_string_length(__int64 a1)
{
bz_barf_push_function("bz_string_length");
bz_barf_pop_function();
return *(_QWORD *)(a1 + 16);
}

canonical_decompiled_code:
__int64 __fastcall func0(__int64 a1)
{
bz_barf_push_function("bz_string_length");
bz_barf_pop_function();
return *(_QWORD *)(a1 + 16);
}

original_code:
size_t bz_string_length(bz_String* e)
{
  {bz_barf_push_function(__PRETTY_FUNCTION__);;};
  {;bz_barf_pop_function();return (e->length);};
}

canonical_original_code:
unsigned long bz_string_length(struct bz_String *e)
{
  {bz_barf_push_function(__PRETTY_FUNCTION__);;};
  {;bz_barf_pop_function();return (e->length);};
}

variable_types: struct bz_String { struct bz_Type { int *name; unsigned long size; void *(*new)(); void *(*clone)(); int (*length)(); int (*charsize)(); int (*compare)(); void *(*to_integer)(); void *(*to_real)(); void *(*to_string)(); void *(*to_list)(); void *(*to_wstr)(); void *(*show)(); } *type; unsigned long buffer_size; unsigned long length; int *string; } *

return_type: unsigned long

user_defined_types: struct bz_String { struct bz_Type *type; unsigned long buffer_size; unsigned long length; int *string; }


decompiled_code:
__int64 __fastcall bz_string_stretch(__int64 a1, unsigned __int64 a2)
{
unsigned __int64 v3; // rsi
__int64 v4; // rax

bz_barf_push_function("bz_string_stretch");
v3 = *(_QWORD *)(a1 + 8);
if ( a2 >= v3 )
{
do
v3 *= 2LL;
while ( v3 <= a2 );
*(_QWORD *)(a1 + 8) = v3;
}
v4 = GC_realloc(*(_QWORD *)(a1 + 24), 4 * v3);
*(_QWORD *)(a1 + 24) = v4;
if ( !v4 )
bz_barf("Out of Memory");
return bz_barf_pop_function();
}

canonical_decompiled_code:
__int64 __fastcall func1(__int64 a1, unsigned __int64 a2)
{
unsigned __int64 v3; // rsi
__int64 v4; // rax

bz_barf_push_function("bz_string_stretch");
v3 = *(_QWORD *)(a1 + 8);
if ( a2 >= v3 )
{
do
v3 *= 2LL;
while ( v3 <= a2 );
*(_QWORD *)(a1 + 8) = v3;
}
v4 = GC_realloc(*(_QWORD *)(a1 + 24), 4 * v3);
*(_QWORD *)(a1 + 24) = v4;
if ( !v4 )
bz_barf("Out of Memory");
return bz_barf_pop_function();
}

original_code:
static void bz_string_stretch(bz_String* e, size_t new_size)
{
  {bz_barf_push_function(__PRETTY_FUNCTION__);;};
  while(e->buffer_size <= new_size)
    e->buffer_size = e->buffer_size << 1;
  e->string = (wchar_t *) GC_realloc(e->string,sizeof(wchar_t) * e->buffer_size);
  if(e->string == ((void *)0))
    bz_barf("Out of Memory");
  {;bz_barf_pop_function();};
}

canonical_original_code:
static void bz_string_stretch(struct bz_String *e, unsigned long new_size)
{
  {bz_barf_push_function(__PRETTY_FUNCTION__);;};
  while(e->buffer_size <= new_size)
    e->buffer_size = e->buffer_size << 1;
  e->string = (int *) GC_realloc(e->string,sizeof(wchar_t) * e->buffer_size);
  if(e->string == ((void *)0))
    bz_barf("Out of Memory");
  {;bz_barf_pop_function();};
}

return_type: void

user_defined_types: struct bz_Type { int *name; unsigned long size; void *(*new)(); void *(*clone)(); int (*length)(); int (*charsize)(); int (*compare)(); void *(*to_integer)(); void *(*to_real)(); void *(*to_string)(); void *(*to_list)(); void *(*to_wstr)(); void *(*show)(); }


decompiled_code:
int __fastcall bz_string_compare(__int64 a1, __int64 a2)
{
bz_barf_push_function("bz_string_compare");
bz_barf_pop_function();
return wcscmp(*(const wchar_t **)(a1 + 24), *(const wchar_t **)(a2 + 24));
}

canonical_decompiled_code:
int __fastcall func2(__int64 a1, __int64 a2)
{
bz_barf_push_function("bz_string_compare");
bz_barf_pop_function();
return wcscmp(*(const wchar_t **)(a1 + 24), *(const wchar_t **)(a2 + 24));
}

original_code:
int bz_string_compare(bz_String* e1, bz_String* e2)
{
  {bz_barf_push_function(__PRETTY_FUNCTION__);;};
  {;bz_barf_pop_function();return (wcscmp(e1->string,e2->string));};
}

canonical_original_code:
int bz_string_compare(struct bz_String *e1, struct bz_String *e2)
{
  {bz_barf_push_function(__PRETTY_FUNCTION__);;};
  {;bz_barf_pop_function();return (wcscmp(e1->string,e2->string));};
}

return_type: int


decompiled_code:
int __fastcall bz_string_show(__int64 a1)
{
if ( !a1 )
_assert_fail("s", "src/string.c", 0x1B2u, "bz_string_show");
if ( *(void ***)a1 != &bz_String_type )
_assert_fail("s->type == bz_STRING", "src/string.c", 0x1B3u, "bz_string_show");
if ( *(_DWORD *)(*(_QWORD *)(a1 + 24) + 4LL * *(_QWORD *)(a1 + 16)) )
_assert_fail("s->string[s->length] == L'\\0'", "src/string.c", 0x1B4u, "bz_string_show");
return fputws(*(const wchar_t **)(a1 + 24), stdout);
}

canonical_decompiled_code:
int __fastcall func3(__int64 a1)
{
if ( !a1 )
_assert_fail("s", "src/string.c", 0x1B2u, "bz_string_show");
if ( *(void ***)a1 != &bz_String_type )
_assert_fail("s->type == bz_STRING", "src/string.c", 0x1B3u, "bz_string_show");
if ( *(_DWORD *)(*(_QWORD *)(a1 + 24) + 4LL * *(_QWORD *)(a1 + 16)) )
_assert_fail("s->string[s->length] == L'\\0'", "src/string.c", 0x1B4u, "bz_string_show");
return fputws(*(const wchar_t **)(a1 + 24), stdout);
}

original_code:
void bz_string_show(bz_String* s)
{
  ((void) sizeof ((s) ? 1 : 0), __extension__ ({ if (s) ; else __assert_fail ("s", "src/string.c", 434, __extension__ __PRETTY_FUNCTION__); }));
  ((void) sizeof ((s->type == &bz_String_type) ? 1 : 0), __extension__ ({ if (s->type == &bz_String_type) ; else __assert_fail ("s->type == bz_STRING", "src/string.c", 435, __extension__ __PRETTY_FUNCTION__); }));
  ((void) sizeof ((s->string[s->length] == L'\0') ? 1 : 0), __extension__ ({ if (s->string[s->length] == L'\0') ; else __assert_fail ("s->string[s->length] == L'\\0'", "src/string.c", 436, __extension__ __PRETTY_FUNCTION__); }));
  fputws(s->string,stdout);
}

canonical_original_code:
void bz_string_show(struct bz_String *s)
{
  ((void) sizeof ((s) ? 1 : 0), __extension__ ({ if (s) ; else __assert_fail ("s", "src/string.c", 434, __extension__ __PRETTY_FUNCTION__); }));
  ((void) sizeof ((s->type == &bz_String_type) ? 1 : 0), __extension__ ({ if (s->type == &bz_String_type) ; else __assert_fail ("s->type == bz_STRING", "src/string.c", 435, __extension__ __PRETTY_FUNCTION__); }));
  ((void) sizeof ((s->string[s->length] == L'\0') ? 1 : 0), __extension__ ({ if (s->string[s->length] == L'\0') ; else __assert_fail ("s->string[s->length] == L'\\0'", "src/string.c", 436, __extension__ __PRETTY_FUNCTION__); }));
  fputws(s->string,stdout);
}


decompiled_code:
__int64 __fastcall bz_string_cat_wstr(_QWORD *a1, const wchar_t *a2)
{
size_t v3; // rbp
__int64 v4; // rax
unsigned __int64 v5; // rsi
size_t v6; // rbp

bz_barf_push_function("bz_string_cat_wstr");
v3 = wcslen(a2);
v4 = a1[2];
v5 = v4 + v3 + 1;
if ( v5 > a1[1] )
{
bz_string_stretch((__int64)a1, v5);
v4 = a1[2];
}
wmemcpy((wchar_t *)(a1[3] + 4 * v4), a2, v3 + 1);
v6 = a1[2] + v3;
a1[2] = v6;
if ( v6 >= a1[1] )
_assert_fail("e->length < e->buffer_size", "src/string.c", 0xB9u, "bz_string_cat_wstr");
return bz_barf_pop_function();
}

canonical_decompiled_code:
__int64 __fastcall func4(_QWORD *a1, const wchar_t *a2)
{
size_t v3; // rbp
__int64 v4; // rax
unsigned __int64 v5; // rsi
size_t v6; // rbp

bz_barf_push_function("bz_string_cat_wstr");
v3 = wcslen(a2);
v4 = a1[2];
v5 = v4 + v3 + 1;
if ( v5 > a1[1] )
{
func1((__int64)a1, v5);
v4 = a1[2];
}
wmemcpy((wchar_t *)(a1[3] + 4 * v4), a2, v3 + 1);
v6 = a1[2] + v3;
a1[2] = v6;
if ( v6 >= a1[1] )
_assert_fail("e->length < e->buffer_size", "src/string.c", 0xB9u, "bz_string_cat_wstr");
return bz_barf_pop_function();
}

original_code:
void bz_string_cat_wstr(bz_String* e, wchar_t* s)
{
  {bz_barf_push_function(__PRETTY_FUNCTION__);;};
  size_t n = wcslen(s);
  if ((n + e->length + 1) > e->buffer_size)
    {
      (void) bz_string_stretch(e, e->length + n + 1);
    }
(void) wmemcpy(
  &e->string[e->length],
  s,
  (n+1));
  e->length += n;
  ((void) sizeof ((e->length < e->buffer_size) ? 1 : 0), __extension__ ({ if (e->length < e->buffer_size) ; else __assert_fail ("e->length < e->buffer_size", "src/string.c", 185, __extension__ __PRETTY_FUNCTION__); }));
  {;bz_barf_pop_function();};
}

canonical_original_code:
void bz_string_cat_wstr(struct bz_String *e, int *s)
{
  {bz_barf_push_function(__PRETTY_FUNCTION__);;};
  unsigned long n = wcslen(s);
  if ((n + e->length + 1) > e->buffer_size)
    {
      (void) bz_string_stretch(e, e->length + n + 1);
    }
(void) wmemcpy(
  &e->string[e->length],
  s,
  (n+1));
  e->length += n;
  ((void) sizeof ((e->length < e->buffer_size) ? 1 : 0), __extension__ ({ if (e->length < e->buffer_size) ; else __assert_fail ("e->length < e->buffer_size", "src/string.c", 185, __extension__ __PRETTY_FUNCTION__); }));
  {;bz_barf_pop_function();};
}

variable_types:
s
int *

variable_types:
n
unsigned long


decompiled_code:
__int64 __fastcall bz_string_cat_wchar(_QWORD *a1, int a2)
{
__int64 v3; // rax
unsigned __int64 v4; // rdx
__int64 v5; // rcx
__int64 v6; // rsi
unsigned __int64 v7; // rax

bz_barf_push_function("bz_string_cat_wchar");
v3 = a1[2];
v4 = a1[1];
if ( v3 + 2 > v4 )
{
bz_string_stretch((__int64)a1, v3 + 2);
v3 = a1[2];
v4 = a1[1];
}
v5 = a1[3];
v6 = 4 * v3;
*(_DWORD *)(v5 + 4 * v3) = a2;
v7 = v3 + 1;
a1[2] = v7;
if ( v7 >= v4 )
_assert_fail("e->length < e->buffer_size", "src/string.c", 0xCFu, "bz_string_cat_wchar");
*(_DWORD *)(v5 + v6 + 4) = 0;
return bz_barf_pop_function();
}

canonical_decompiled_code:
__int64 __fastcall func5(_QWORD *a1, int a2)
{
__int64 v3; // rax
unsigned __int64 v4; // rdx
__int64 v5; // rcx
__int64 v6; // rsi
unsigned __int64 v7; // rax

bz_barf_push_function("bz_string_cat_wchar");
v3 = a1[2];
v4 = a1[1];
if ( v3 + 2 > v4 )
{
func1((__int64)a1, v3 + 2);
v3 = a1[2];
v4 = a1[1];
}
v5 = a1[3];
v6 = 4 * v3;
*(_DWORD *)(v5 + 4 * v3) = a2;
v7 = v3 + 1;
a1[2] = v7;
if ( v7 >= v4 )
_assert_fail("e->length < e->buffer_size", "src/string.c", 0xCFu, "bz_string_cat_wchar");
*(_DWORD *)(v5 + v6 + 4) = 0;
return bz_barf_pop_function();
}

original_code:
void bz_string_cat_wchar(bz_String* e, wchar_t c)
{
  {bz_barf_push_function(__PRETTY_FUNCTION__);;};
  if ((e->length + 2) > e->buffer_size)
  {
    (void) bz_string_stretch(e, e->length + 2);
  }
  e->string[e->length]=c;
  e->length++;
  ((void) sizeof ((e->length < e->buffer_size) ? 1 : 0), __extension__ ({ if (e->length < e->buffer_size) ; else __assert_fail ("e->length < e->buffer_size", "src/string.c", 207, __extension__ __PRETTY_FUNCTION__); }));
  e->string[e->length]=L'\0';
  {;bz_barf_pop_function();};
}

canonical_original_code:
void bz_string_cat_wchar(struct bz_String *e, int c)
{
  {bz_barf_push_function(__PRETTY_FUNCTION__);;};
  if ((e->length + 2) > e->buffer_size)
  {
    (void) bz_string_stretch(e, e->length + 2);
  }
  e->string[e->length]=c;
  e->length++;
  ((void) sizeof ((e->length < e->buffer_size) ? 1 : 0), __extension__ ({ if (e->length < e->buffer_size) ; else __assert_fail ("e->length < e->buffer_size", "src/string.c", 207, __extension__ __PRETTY_FUNCTION__); }));
  e->string[e->length]=L'\0';
  {;bz_barf_pop_function();};
}

variable_types: c int


decompiled_code:
__int64 __fastcall bz_string_compare_ignorecase(__int64 a1, __int64 a2)
{
bz_barf_push_function("bz_string_compare_ignorecase");
bz_barf_pop_function();
return wcscasecmp(*(wint_t **)(a1 + 24), *(wint_t **)(a2 + 24));
}

canonical_decompiled_code:
__int64 __fastcall func9(__int64 a1, __int64 a2)
{
bz_barf_push_function("bz_string_compare_ignorecase");
bz_barf_pop_function();
return func8(*(wint_t **)(a1 + 24), *(wint_t **)(a2 + 24));
}

original_code:
int bz_string_compare_ignorecase(bz_String* e1, bz_String* e2)
{
  {bz_barf_push_function(__PRETTY_FUNCTION__);;};
  {;bz_barf_pop_function();return (wcscasecmp(e1->string,e2->string));};
}

canonical_original_code:
int bz_string_compare_ignorecase(struct bz_String *e1, struct bz_String *e2)
{
  {bz_barf_push_function(__PRETTY_FUNCTION__);;};
  {;bz_barf_pop_function();return (wcscasecmp(e1->string,e2->string));};
}


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

bz_barf_push_function("bz_string_eq");
v2 = *(_QWORD *)(a1 + 16);
if ( v2 != *(_QWORD *)(a2 + 16) )
{
LABEL_6:
bz_barf_pop_function();
return 0LL;
}
if ( v2 )
{
v3 = 0LL;
while ( *(_DWORD *)(*(_QWORD *)(a1 + 24) + 4 * v3) == *(_DWORD *)(*(_QWORD *)(a2 + 24) + 4 * v3) )
{
if ( v2 == ++v3 )
goto LABEL_7;
}
goto LABEL_6;
}
LABEL_7:
bz_barf_pop_function();
return 1LL;
}

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

bz_barf_push_function("bz_string_eq");
v2 = *(_QWORD *)(a1 + 16);
if ( v2 != *(_QWORD *)(a2 + 16) )
{
LABEL_6:
bz_barf_pop_function();
return 0LL;
}
if ( v2 )
{
v3 = 0LL;
while ( *(_DWORD *)(*(_QWORD *)(a1 + 24) + 4 * v3) == *(_DWORD *)(*(_QWORD *)(a2 + 24) + 4 * v3) )
{
if ( v2 == ++v3 )
goto LABEL_7;
}
goto LABEL_6;
}
LABEL_7:
bz_barf_pop_function();
return 1LL;
}

original_code:
int bz_string_eq(bz_String* e1, bz_String* e2)
{
  {bz_barf_push_function(__PRETTY_FUNCTION__);;};
  size_t n1,n2,i;
  n1 = e1->length;
  n2 = e2->length;
  if(n1 != n2)
    {;bz_barf_pop_function();return (0);};
  for(i=0;i<n1;i++)
    if(e1->string[i] != e2->string[i])
      {;bz_barf_pop_function();return (0);};
  {;bz_barf_pop_function();return (1);};
}

canonical_original_code:
int bz_string_eq(struct bz_String *e1, struct bz_String *e2)
{
  {bz_barf_push_function(__PRETTY_FUNCTION__);;};
  unsigned long n1; unsigned long n2; unsigned long i;
  n1 = e1->length;
  n2 = e2->length;
  if(n1 != n2)
    {;bz_barf_pop_function();return (0);};
  for(i=0;i<n1;i++)
    if(e1->string[i] != e2->string[i])
      {;bz_barf_pop_function();return (0);};
  {;bz_barf_pop_function();return (1);};
}

variable_types:
i
unsigned long


decompiled_code:
__int64 __fastcall bz_minihash_length(__int64 a1)
{
_QWORD *v1; // rax
__int64 v2; // r8

v1 = (_QWORD *)(a1 + 8);
v2 = 0LL;
do
v2 -= (*v1++ == 0LL) - 1LL;
while ( v1 != (_QWORD *)(a1 + 264) );
return v2;
}

original_code:
size_t bz_minihash_length(bz_Minihash* m)
{
  size_t n = 0;
  int i;
    for (i=0; i<32; i++)
      if(m->name[i])
     n ++;
    return n;
}

canonical_original_code:
unsigned long bz_minihash_length(struct bz_Minihash *m)
{
  unsigned long n = 0;
  int i;
    for (i=0; i<32; i++)
      if(m->name[i])
     n ++;
    return n;
}

variable_types: struct bz_Minihash { struct bz_Type { int *name; unsigned long size; void *(*new)(); void *(*clone)(); int (*length)(); int (*charsize)(); int (*compare)(); void *(*to_integer)(); void *(*to_real)(); void *(*to_string)(); void *(*to_list)(); void *(*to_wstr)(); void *(*show)(); } *type; struct bz_String { struct bz_Type *type; unsigned long buffer_size; unsigned long length; int *string; } *name[32]; void *value[32]; struct bz_String *filename[32]; unsigned long line[32]; } *

variable_types: i int

user_defined_types: struct bz_Minihash { struct bz_Type *type; struct bz_String *name[32]; void *value[32]; struct bz_String *filename[32]; unsigned long line[32]; }


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

result = malloc(0x408uLL);
if ( !result )
{
bz_barf("Out of memory");
result = 0LL;
}
*result = &bz_Minihash_type;
return result;
}

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

result = malloc(0x408uLL);
if ( !result )
{
bz_barf("Out of memory");
result = 0LL;
}
*result = &bz_Minihash_type;
return result;
}

original_code:
bz_Minihash* bz_minihash_new(void)
{
  bz_Minihash* m;
  m = malloc(sizeof(bz_Minihash)); if(!m) bz_barf("Out of memory"); m->type = &bz_Minihash_type;
  return m;
}

canonical_original_code:
struct bz_Minihash *bz_minihash_new()
{
  struct bz_Minihash *m;
  m = malloc(sizeof(bz_Minihash)); if(!m) bz_barf("Out of memory"); m->type = &bz_Minihash_type;
  return m;
}

return_type: struct bz_Minihash { struct bz_Type { int *name; unsigned long size; void *(*new)(); void *(*clone)(); int (*length)(); int (*charsize)(); int (*compare)(); void *(*to_integer)(); void *(*to_real)(); void *(*to_string)(); void *(*to_list)(); void *(*to_wstr)(); void *(*show)(); } *type; struct bz_String { struct bz_Type *type; unsigned long buffer_size; unsigned long length; int *string; } *name[32]; void *value[32]; struct bz_String *filename[32]; unsigned long line[32]; } *


decompiled_code:
__int64 __fastcall bz_minihash_copy(__int64 a1)
{
if ( !malloc(0x408uLL) )
bz_barf("Out of memory");
return a1;
}

canonical_decompiled_code:
__int64 __fastcall func2(__int64 a1)
{
if ( !malloc(0x408uLL) )
bz_barf("Out of memory");
return a1;
}

original_code:
bz_Minihash* bz_minihash_copy(bz_Minihash* m)
{
  bz_Minihash* mm;
  mm = malloc(sizeof(bz_Minihash)); if(!mm) bz_barf("Out of memory"); mm->type = &bz_Minihash_type;
  memcpy(mm,m,sizeof(bz_Minihash));
  return m;
}

canonical_original_code:
struct bz_Minihash *bz_minihash_copy(struct bz_Minihash *m)
{
  struct bz_Minihash *mm;
  mm = malloc(sizeof(bz_Minihash)); if(!mm) bz_barf("Out of memory"); mm->type = &bz_Minihash_type;
  memcpy(mm,m,sizeof(bz_Minihash));
  return m;
}

variable_types:
m
struct bz_Minihash *


decompiled_code:
__int64 __fastcall bz_minihash_charsize(__int64 a1)
{
__int64 v1; // r12
_QWORD *v2; // rbx

v1 = 0LL;
v2 = (_QWORD *)(a1 + 8);
do
{
if ( *v2 )
v1 += bz_string_length();
++v2;
}
while ( v2 != (_QWORD *)(a1 + 264) );
return v1;
}

original_code:
size_t bz_minihash_charsize(bz_Minihash* m)
{
  size_t n = 0;
  int i;
    for (i=0; i<32; i++)
      if(m->name[i])
     n += bz_string_length(m->name[i]);
    return n;
}

canonical_original_code:
unsigned long bz_minihash_charsize(struct bz_Minihash *m)
{
  unsigned long n = 0;
  int i;
    for (i=0; i<32; i++)
      if(m->name[i])
     n += bz_string_length(m->name[i]);
    return n;
}


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

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

original_code:
int bz_minihash_compare(bz_Minihash* x, bz_Minihash* y)
{
  return(0);
}

canonical_original_code:
int bz_minihash_compare(struct bz_Minihash *x, struct bz_Minihash *y)
{
  return(0);
}

variable_types:
y
struct bz_Minihash *


decompiled_code:
void bz_minihash_show()
{
;
}

canonical_decompiled_code:
void func5()
{
;
}

original_code:
void bz_minihash_show(bz_Minihash* m)
{
   ;
}

canonical_original_code:
void bz_minihash_show(struct bz_Minihash *m)
{
   ;
}


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

v2 = 0LL;
while ( !*(_QWORD *)(a1 + 8 * v2 + 8) || !(unsigned int)bz_string_eq(a2) )
{
if ( ++v2 == 32 )
return &bz_Empty_value;
}
return *(void **)(a1 + 8LL * (int)v2 + 264);
}

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

v2 = 0LL;
while ( !*(_QWORD *)(a1 + 8 * v2 + 8) || !(unsigned int)bz_string_eq(a2) )
{
if ( ++v2 == 32 )
return &bz_Empty_value;
}
return *(void **)(a1 + 8LL * (int)v2 + 264);
}

original_code:
void* bz_minihash_get(bz_Minihash* m, bz_String* name)
{
  int i;
  for (i=0; i<32; i++)
    if(m->name[i])
      if(bz_string_eq(name,m->name[i]))
     return m->value[i];
  return ((void *)&bz_Empty_value);
}

canonical_original_code:
void *bz_minihash_get(struct bz_Minihash *m, struct bz_String *name)
{
  int i;
  for (i=0; i<32; i++)
    if(m->name[i])
      if(bz_string_eq(name,m->name[i]))
     return m->value[i];
  return ((void *)&bz_Empty_value);
}

variable_types:
name
struct bz_String *

return_type: void *


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

v2 = 0LL;
while ( !*(_QWORD *)(a1 + 8 * v2 + 8) || !(unsigned int)bz_string_eq(a2) )
{
if ( ++v2 == 32 )
return &bz_Empty_value;
}
return *(void **)(a1 + 8LL * (int)v2 + 520);
}

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

v2 = 0LL;
while ( !*(_QWORD *)(a1 + 8 * v2 + 8) || !(unsigned int)bz_string_eq(a2) )
{
if ( ++v2 == 32 )
return &bz_Empty_value;
}
return *(void **)(a1 + 8LL * (int)v2 + 520);
}

original_code:
bz_String* bz_minihash_get_filename(bz_Minihash* m, bz_String* name)
{
  int i;
  for (i=0; i<32; i++)
    if(m->name[i])
      if(bz_string_eq(name,m->name[i]))
     return m->filename[i];
  return ((void *)&bz_Empty_value);
}

canonical_original_code:
struct bz_String *bz_minihash_get_filename(struct bz_Minihash *m, struct bz_String *name)
{
  int i;
  for (i=0; i<32; i++)
    if(m->name[i])
      if(bz_string_eq(name,m->name[i]))
     return m->filename[i];
  return ((void *)&bz_Empty_value);
}

variable_types: struct bz_Minihash { struct bz_Type *type; struct bz_String *name[32]; void *value[32]; struct bz_String *filename[32]; unsigned long line[32]; } *

return_type: struct bz_String { struct bz_Type { int *name; unsigned long size; void *(*new)(); void *(*clone)(); int (*length)(); int (*charsize)(); int (*compare)(); void *(*to_integer)(); void *(*to_real)(); void *(*to_string)(); void *(*to_list)(); void *(*to_wstr)(); void *(*show)(); } *type; unsigned long buffer_size; unsigned long length; int *string; } *


decompiled_code:
__int64 __fastcall bz_minihash_get_line(__int64 a1, __int64 a2)
{
__int64 v2; // rbx

v2 = 0LL;
while ( !*(_QWORD *)(a1 + 8 * v2 + 8) || !(unsigned int)bz_string_eq(a2) )
{
if ( ++v2 == 32 )
return 0LL;
}
return *(_QWORD *)(a1 + 8LL * (int)v2 + 776);
}

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

v2 = 0LL;
while ( !*(_QWORD *)(a1 + 8 * v2 + 8) || !(unsigned int)bz_string_eq(a2) )
{
if ( ++v2 == 32 )
return 0LL;
}
return *(_QWORD *)(a1 + 8LL * (int)v2 + 776);
}

original_code:
size_t bz_minihash_get_line(bz_Minihash* m, bz_String* name)
{
  int i;
  for (i=0; i<32; i++)
    if(m->name[i])
      if(bz_string_eq(name,m->name[i]))
     return m->line[i];
  return 0;
}

canonical_original_code:
unsigned long bz_minihash_get_line(struct bz_Minihash *m, struct bz_String *name)
{
  int i;
  for (i=0; i<32; i++)
    if(m->name[i])
      if(bz_string_eq(name,m->name[i]))
     return m->line[i];
  return 0;
}


decompiled_code:
void __fastcall bz_minihash_delete(__int64 a1, __int64 a2)
{
__int64 v2; // rbx

v2 = 0LL;
while ( !*(_QWORD *)(a1 + 8 * v2 + 8) || !(unsigned int)bz_string_eq(a2) )
{
if ( ++v2 == 32 )
return;
}
*(_QWORD *)(a1 + 8LL * (int)v2 + 8) = 0LL;
}

canonical_decompiled_code:
void __fastcall func9(__int64 a1, __int64 a2)
{
__int64 v2; // rbx

v2 = 0LL;
while ( !*(_QWORD *)(a1 + 8 * v2 + 8) || !(unsigned int)bz_string_eq(a2) )
{
if ( ++v2 == 32 )
return;
}
*(_QWORD *)(a1 + 8LL * (int)v2 + 8) = 0LL;
}

original_code:
void bz_minihash_delete(bz_Minihash* m, bz_String* name)
{
  int i;
  for (i=0; i<32; i++)
    if(m->name[i])
      if(bz_string_eq(name,m->name[i])) {
     m->name[i]=((void *)0);
     return;
      }
}

canonical_original_code:
void bz_minihash_delete(struct bz_Minihash *m, struct bz_String *name)
{
  int i;
  for (i=0; i<32; i++)
    if(m->name[i])
      if(bz_string_eq(name,m->name[i])) {
     m->name[i]=((void *)0);
     return;
      }
}


decompiled_code:
void **bz_empty_new()
{
return &bz_Empty_value;
}

canonical_decompiled_code:
void **func0()
{
return &bz_Empty_value;
}

original_code:
const bz_Empty* bz_empty_new(bz_Empty* e)
{
  return ((void *)&bz_Empty_value);
}

canonical_original_code:
struct bz_Empty *bz_empty_new(struct bz_Empty *e)
{
  return ((void *)&bz_Empty_value);
}

variable_types:
e
struct bz_Empty *

return_type: struct bz_Empty { struct bz_Type { int *name; unsigned long size; void *(*new)(); void *(*clone)(); int (*length)(); int (*charsize)(); int (*compare)(); void *(*to_integer)(); void *(*to_real)(); void *(*to_string)(); void *(*to_list)(); void *(*to_wstr)(); void *(*show)(); } *type; } *

user_defined_types: struct bz_Empty { struct bz_Type *type; }


decompiled_code:
// attributes: thunk
void **bz_empty_clone()
{
return bz_empty_new();
}

canonical_decompiled_code:
void **func1()
{
return func0();
}

original_code:
const bz_Empty* bz_empty_clone(bz_Empty* e)
{
  return ((void *)&bz_Empty_value);
}

canonical_original_code:
struct bz_Empty *bz_empty_clone(struct bz_Empty *e)
{
  return ((void *)&bz_Empty_value);
}


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

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

original_code:
size_t bz_empty_length(bz_Empty* e)
{
  return 0;
}

canonical_original_code:
unsigned long bz_empty_length(struct bz_Empty *e)
{
  return 0;
}

variable_types: struct bz_Empty { struct bz_Type { int *name; unsigned long size; void *(*new)(); void *(*clone)(); int (*length)(); int (*charsize)(); int (*compare)(); void *(*to_integer)(); void *(*to_real)(); void *(*to_string)(); void *(*to_list)(); void *(*to_wstr)(); void *(*show)(); } *type; } *


decompiled_code:
// attributes: thunk
__int64 bz_empty_charsize()
{
return bz_empty_length();
}

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

original_code:
size_t bz_empty_charsize(bz_Empty* e)
{
  return 0;
}

canonical_original_code:
unsigned long bz_empty_charsize(struct bz_Empty *e)
{
  return 0;
}


decompiled_code:
__int64 __fastcall bz_empty_compare(void **a1)
{
return (unsigned int)-(a1 != &bz_Empty_value);
}

canonical_decompiled_code:
__int64 __fastcall func4(void **a1)
{
return (unsigned int)-(a1 != &bz_Empty_value);
}

original_code:
int bz_empty_compare(bz_Empty* e)
{
  return (e == ((void *)&bz_Empty_value) ? 0 : -1 );
}

canonical_original_code:
int bz_empty_compare(struct bz_Empty *e)
{
  return (e == ((void *)&bz_Empty_value) ? 0 : -1 );
}


decompiled_code:
void bz_empty_show()
{
;
}

original_code:
void bz_empty_show(bz_Empty* e)
{
}

canonical_original_code:
void bz_empty_show(struct bz_Empty *e)
{
}


decompiled_code:
void *bz_list_new()
{
bz_barf_push_function("bz_list_new");
bz_barf_pop_function();
return &bz_Empty_value;
}

canonical_decompiled_code:
void *func0()
{
bz_barf_push_function("bz_list_new");
bz_barf_pop_function();
return &bz_Empty_value;
}

original_code:
bz_List* bz_list_new(void)
{
   {bz_barf_push_function(__PRETTY_FUNCTION__);;};
   {;bz_barf_pop_function();return (((void *)&bz_Empty_value));};
}

canonical_original_code:
struct bz_list_node *bz_list_new()
{
   {bz_barf_push_function(__PRETTY_FUNCTION__);;};
   {;bz_barf_pop_function();return (((void *)&bz_Empty_value));};
}


decompiled_code:
__int64 __fastcall bz_list_charsize(__int64 a1)
{
int v1; // ebx

bz_barf_push_function("bz_list_charsize");
v1 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 8) + 40LL))(*(_QWORD *)(a1 + 8));
bz_barf_pop_function();
return v1;
}

canonical_decompiled_code:
__int64 __fastcall func1(__int64 a1)
{
int v1; // ebx

bz_barf_push_function("bz_list_charsize");
v1 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 8) + 40LL))(*(_QWORD *)(a1 + 8));
bz_barf_pop_function();
return v1;
}

original_code:
size_t bz_list_charsize(bz_List* xs)
{
   int n = 0;
   {bz_barf_push_function(__PRETTY_FUNCTION__);;};
   n = ((bz_Type *)((bz_node *)xs->node)->type)->charsize(xs->node);
   {;bz_barf_pop_function();return (n);};
}

canonical_original_code:
unsigned long bz_list_charsize(struct bz_list_node *xs)
{
   int n = 0;
   {bz_barf_push_function(__PRETTY_FUNCTION__);;};
   n = ((struct bz_Type *)((struct bz_node *)xs->node)->type)->charsize(xs->node);
   {;bz_barf_pop_function();return (n);};
}

variable_types: struct bz_list_node { struct bz_Type { int *name; unsigned long size; void *(*new)(); void *(*clone)(); int (*length)(); int (*charsize)(); int (*compare)(); void *(*to_integer)(); void *(*to_real)(); void *(*to_string)(); void *(*to_list)(); void *(*to_wstr)(); void *(*show)(); } *type; void *node; struct bz_list_node *next; } *

variable_types: n int

user_defined_types: struct bz_node { struct bz_Type *type; }


cmp

decompiled_code:
__int64 __fastcall cmp(__int64 a1, __int64 a2)
{
bz_barf_push_function("cmp");
bz_barf_pop_function();
return (*(__int64 (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 48LL))(a1, a2);
}

canonical_decompiled_code:
__int64 __fastcall func2(__int64 a1, __int64 a2)
{
bz_barf_push_function("cmp");
bz_barf_pop_function();
return (*(__int64 (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 48LL))(a1, a2);
}

original_code:
static inline int cmp(void* x, void* y) {
  {bz_barf_push_function(__PRETTY_FUNCTION__);;};
  {;bz_barf_pop_function();return (((bz_Type *)((bz_node *)x)->type)->compare(x,y));};
}

canonical_original_code:
static inline int cmp(void *x, void *y) {
  {bz_barf_push_function(__PRETTY_FUNCTION__);;};
  {;bz_barf_pop_function();return (((struct bz_Type *)((struct bz_node *)x)->type)->compare(x,y));};
}

variable_types:
x
void *

variable_types:
y
void *


decompiled_code:
__int64 __fastcall bz_list_length(__int64 a1)
{
__int64 v1; // r12

v1 = 0LL;
while ( 1 )
{
bz_barf_push_function("bz_list_length");
if ( !a1 )
_assert_fail("xs", "src/list.c", 0x85u, "bz_list_length");
if ( (_UNKNOWN *)a1 == &bz_Empty_value )
break;
++v1;
if ( !*(_QWORD *)(a1 + 16) )
_assert_fail("xs->next", "src/list.c", 0x8Au, "bz_list_length");
bz_barf_pop_function();
a1 = *(_QWORD *)(a1 + 16);
}
bz_barf_pop_function();
return v1;
}

canonical_decompiled_code:
__int64 __fastcall func3(__int64 a1)
{
__int64 v1; // r12

v1 = 0LL;
while ( 1 )
{
bz_barf_push_function("bz_list_length");
if ( !a1 )
_assert_fail("xs", "src/list.c", 0x85u, "bz_list_length");
if ( (_UNKNOWN *)a1 == &bz_Empty_value )
break;
++v1;
if ( !*(_QWORD *)(a1 + 16) )
_assert_fail("xs->next", "src/list.c", 0x8Au, "bz_list_length");
bz_barf_pop_function();
a1 = *(_QWORD *)(a1 + 16);
}
bz_barf_pop_function();
return v1;
}

original_code:
size_t bz_list_length(bz_List* xs)
{
   {bz_barf_push_function(__PRETTY_FUNCTION__);;};
   ((void) sizeof ((xs) ? 1 : 0), __extension__ ({ if (xs) ; else __assert_fail ("xs", "src/list.c", 133, __extension__ __PRETTY_FUNCTION__); }));
   if (xs == ((void *)&bz_Empty_value)) {
      {;bz_barf_pop_function();return (0);};
   }
   ((void) sizeof ((xs->next) ? 1 : 0), __extension__ ({ if (xs->next) ; else __assert_fail ("xs->next", "src/list.c", 138, __extension__ __PRETTY_FUNCTION__); }));
   {;bz_barf_pop_function();return (1 + bz_list_length(xs->next));};
}

canonical_original_code:
unsigned long bz_list_length(struct bz_list_node *xs)
{
   {bz_barf_push_function(__PRETTY_FUNCTION__);;};
   ((void) sizeof ((xs) ? 1 : 0), __extension__ ({ if (xs) ; else __assert_fail ("xs", "src/list.c", 133, __extension__ __PRETTY_FUNCTION__); }));
   if (xs == ((void *)&bz_Empty_value)) {
      {;bz_barf_pop_function();return (0);};
   }
   ((void) sizeof ((xs->next) ? 1 : 0), __extension__ ({ if (xs->next) ; else __assert_fail ("xs->next", "src/list.c", 138, __extension__ __PRETTY_FUNCTION__); }));
   {;bz_barf_pop_function();return (1 + bz_list_length(xs->next));};
}


decompiled_code:
__int64 __fastcall bz_list_show(void ***a1)
{
void ***v1; // rbx
void **v3; // rdi

v1 = a1;
bz_barf_push_function("bz_list_show");
if ( !a1 )
_assert_fail("xs", "src/list.c", 0x114u, "bz_list_show");
if ( *a1 == &bz_List_type )
{
while ( v1 != (void ***)&bz_Empty_value )
{
v3 = v1[1];
if ( !v3 )
_assert_fail("xs->node", "src/list.c", 0x11Au, "bz_list_show");
if ( !*v3 )
_assert_fail("((bz_List* )xs->node)->type", "src/list.c", 0x11Bu, "bz_list_show");
(*((void (__fastcall **)(void **))*v3 + 12))(v3);
v1 = (void ***)v1[2];
if ( !v1 )
_assert_fail("xs->next", "src/list.c", 0x126u, "bz_list_show");
}
}
else if ( a1 != (void ***)&bz_Empty_value )
{
_assert_fail("(xs->type == bz_LIST) || (xs == bz_EMPTY)", "src/list.c", 0x116u, "bz_list_show");
}
return bz_barf_pop_function();
}

canonical_decompiled_code:
__int64 __fastcall func4(void ***a1)
{
void ***v1; // rbx
void **v3; // rdi

v1 = a1;
bz_barf_push_function("bz_list_show");
if ( !a1 )
_assert_fail("xs", "src/list.c", 0x114u, "bz_list_show");
if ( *a1 == &bz_List_type )
{
while ( v1 != (void ***)&bz_Empty_value )
{
v3 = v1[1];
if ( !v3 )
_assert_fail("xs->node", "src/list.c", 0x11Au, "bz_list_show");
if ( !*v3 )
_assert_fail("((bz_List* )xs->node)->type", "src/list.c", 0x11Bu, "bz_list_show");
(*((void (__fastcall **)(void **))*v3 + 12))(v3);
v1 = (void ***)v1[2];
if ( !v1 )
_assert_fail("xs->next", "src/list.c", 0x126u, "bz_list_show");
}
}
else if ( a1 != (void ***)&bz_Empty_value )
{
_assert_fail("(xs->type == bz_LIST) || (xs == bz_EMPTY)", "src/list.c", 0x116u, "bz_list_show");
}
return bz_barf_pop_function();
}

original_code:
void bz_list_show(bz_List* xs)
{
  {bz_barf_push_function(__PRETTY_FUNCTION__);;};
  ((void) sizeof ((xs) ? 1 : 0), __extension__ ({ if (xs) ; else __assert_fail ("xs", "src/list.c", 276, __extension__ __PRETTY_FUNCTION__); }));
  ((void) sizeof (((xs->type == &bz_List_type) || (xs == ((void *)&bz_Empty_value))) ? 1 : 0), __extension__ ({ if ((xs->type == &bz_List_type) || (xs == ((void *)&bz_Empty_value))) ; else __assert_fail ("(xs->type == bz_LIST) || (xs == bz_EMPTY)", "src/list.c", 278, __extension__ __PRETTY_FUNCTION__); }));
  while (xs != ((void *)&bz_Empty_value)) {
    ((void) sizeof ((xs->node) ? 1 : 0), __extension__ ({ if (xs->node) ; else __assert_fail ("xs->node", "src/list.c", 282, __extension__ __PRETTY_FUNCTION__); }));
    ((void) sizeof ((((bz_List* )xs->node)->type) ? 1 : 0), __extension__ ({ if (((bz_List* )xs->node)->type) ; else __assert_fail ("((bz_List* )xs->node)->type", "src/list.c", 283, __extension__ __PRETTY_FUNCTION__); }));
      ((bz_Type *)((bz_node *)xs->node)->type)->show(xs->node);;
    ((void) sizeof ((xs->next) ? 1 : 0), __extension__ ({ if (xs->next) ; else __assert_fail ("xs->next", "src/list.c", 294, __extension__ __PRETTY_FUNCTION__); }));
    xs = xs->next;
    ((void) sizeof ((xs) ? 1 : 0), __extension__ ({ if (xs) ; else __assert_fail ("xs", "src/list.c", 297, __extension__ __PRETTY_FUNCTION__); }));
  }
  {;bz_barf_pop_function();};
}

canonical_original_code:
void bz_list_show(struct bz_list_node *xs)
{
  {bz_barf_push_function(__PRETTY_FUNCTION__);;};
  ((void) sizeof ((xs) ? 1 : 0), __extension__ ({ if (xs) ; else __assert_fail ("xs", "src/list.c", 276, __extension__ __PRETTY_FUNCTION__); }));
  ((void) sizeof (((xs->type == &bz_List_type) || (xs == ((void *)&bz_Empty_value))) ? 1 : 0), __extension__ ({ if ((xs->type == &bz_List_type) || (xs == ((void *)&bz_Empty_value))) ; else __assert_fail ("(xs->type == bz_LIST) || (xs == bz_EMPTY)", "src/list.c", 278, __extension__ __PRETTY_FUNCTION__); }));
  while (xs != ((void *)&bz_Empty_value)) {
    ((void) sizeof ((xs->node) ? 1 : 0), __extension__ ({ if (xs->node) ; else __assert_fail ("xs->node", "src/list.c", 282, __extension__ __PRETTY_FUNCTION__); }));
    ((void) sizeof ((((struct bz_list_node * )xs->node)->type) ? 1 : 0), __extension__ ({ if (((struct bz_list_node * )xs->node)->type) ; else __assert_fail ("((bz_List* )xs->node)->type", "src/list.c", 283, __extension__ __PRETTY_FUNCTION__); }));
      ((struct bz_Type *)((struct bz_node *)xs->node)->type)->show(xs->node);;
    ((void) sizeof ((xs->next) ? 1 : 0), __extension__ ({ if (xs->next) ; else __assert_fail ("xs->next", "src/list.c", 294, __extension__ __PRETTY_FUNCTION__); }));
    xs = xs->next;
    ((void) sizeof ((xs) ? 1 : 0), __extension__ ({ if (xs) ; else __assert_fail ("xs", "src/list.c", 297, __extension__ __PRETTY_FUNCTION__); }));
  }
  {;bz_barf_pop_function();};
}


decompiled_code:
__int64 type_default()
{
return bz_barf("Missing method");
}

canonical_decompiled_code:
__int64 func5()
{
return bz_barf("Missing method");
}

original_code:
void type_default(void)
{
  bz_barf("Missing method");
}

canonical_original_code:
void type_default()
{
  bz_barf("Missing method");
}


splitAt

decompiled_code:
__int64 __fastcall splitAt(int a1, __int64 a2, _QWORD *a3, _QWORD *a4)
{
int v6; // ebx
_QWORD *v7; // rax

v6 = a1;
bz_barf_push_function("splitAt");
v7 = bz_list_copy(a2);
*a3 = v7;
if ( a1 )
{
while ( v7 != (_QWORD *)&bz_Empty_value )
{
v7 = (_QWORD *)v7[2];
if ( !--v6 )
goto LABEL_6;
}
}
else
{
LABEL_6:
if ( v7 != (_QWORD *)&bz_Empty_value )
{
*a4 = v7[2];
v7[2] = &bz_Empty_value;
}
}
return bz_barf_pop_function();
}

canonical_decompiled_code:
__int64 __fastcall func6(int a1, __int64 a2, _QWORD *a3, _QWORD *a4)
{
int v6; // ebx
_QWORD *v7; // rax

v6 = a1;
bz_barf_push_function("splitAt");
v7 = bz_list_copy(a2);
*a3 = v7;
if ( a1 )
{
while ( v7 != (_QWORD *)&bz_Empty_value )
{
v7 = (_QWORD *)v7[2];
if ( !--v6 )
goto LABEL_6;
}
}
else
{
LABEL_6:
if ( v7 != (_QWORD *)&bz_Empty_value )
{
*a4 = v7[2];
v7[2] = &bz_Empty_value;
}
}
return bz_barf_pop_function();
}

original_code:
static inline void splitAt(int n, bz_List* xs, bz_List** as, bz_List** bs)
{
  bz_List* aas;
  {bz_barf_push_function(__PRETTY_FUNCTION__);;};
  *as = bz_list_copy(xs);
  aas = *as;
  while (n && (aas != ((void *)&bz_Empty_value))) {
    aas = aas->next;
    n--;
  }
  if (aas != ((void *)&bz_Empty_value)) {
    *bs = aas->next;
    aas->next = ((void *)&bz_Empty_value);
  }
  {;bz_barf_pop_function();};
}

canonical_original_code:
static inline void splitAt(int n, struct bz_list_node *xs, struct bz_list_node **as, struct bz_list_node **bs)
{
  struct bz_list_node *aas;
  {bz_barf_push_function(__PRETTY_FUNCTION__);;};
  *as = bz_list_copy(xs);
  aas = *as;
  while (n && (aas != ((void *)&bz_Empty_value))) {
    aas = aas->next;
    n--;
  }
  if (aas != ((void *)&bz_Empty_value)) {
    *bs = aas->next;
    aas->next = ((void *)&bz_Empty_value);
  }
  {;bz_barf_pop_function();};
}

variable_types:
as
struct bz_list_node **

variable_types:
bs
struct bz_list_node **


decompiled_code:
__int64 __fastcall bz_list_debug_show(_QWORD **a1)
{
_QWORD **v1; // rbx
__int64 v2; // rax
_QWORD *v4; // rdx
_QWORD *v5; // rax

v1 = a1;
bz_barf_push_function("bz_list_debug_show");
if ( !a1 )
_assert_fail("xs", "src/list.c", 0x134u, "bz_list_debug_show");
v2 = bz_list_length((__int64)a1);
wprintf(U"[%ls:%i]", **a1, v2);
fflush(0LL);
if ( *a1 == &bz_List_type )
{
while ( v1 != (_QWORD **)&bz_Empty_value )
{
v4 = v1[1];
if ( !v4 )
_assert_fail("xs->node", "src/list.c", 0x139u, "bz_list_debug_show");
v5 = (_QWORD *)*v4;
if ( (_UNKNOWN *)*v4 == &bz_String_type )
{
wprintf(U"-->[%ls:%ls]", 0LL, v4[3]);
fflush(0LL);
}
else
{
if ( v5 == (_QWORD *)&bz_Integer_type )
wprintf(U"-->[%ls:%ld]", 0LL, v4[1]);
else
wprintf(U"-->[%ls]", *v5);
fflush(0LL);
}
v1 = (_QWORD **)v1[2];
if ( !v1 )
_assert_fail("xs", "src/list.c", 0x144u, "bz_list_debug_show");
}
}
else if ( a1 != (_QWORD **)&bz_Empty_value )
{
_assert_fail("(xs->type == bz_LIST) || (xs == bz_EMPTY)", "src/list.c", 0x136u, "bz_list_debug_show");
}
wprintf(U"-->[/]");
fflush(0LL);
return bz_barf_pop_function();
}

canonical_decompiled_code:
__int64 __fastcall func7(_QWORD **a1)
{
_QWORD **v1; // rbx
__int64 v2; // rax
_QWORD *v4; // rdx
_QWORD *v5; // rax

v1 = a1;
bz_barf_push_function("bz_list_debug_show");
if ( !a1 )
_assert_fail("xs", "src/list.c", 0x134u, "bz_list_debug_show");
v2 = func3((__int64)a1);
wprintf(U"[%ls:%i]", **a1, v2);
fflush(0LL);
if ( *a1 == &bz_List_type )
{
while ( v1 != (_QWORD **)&bz_Empty_value )
{
v4 = v1[1];
if ( !v4 )
_assert_fail("xs->node", "src/list.c", 0x139u, "bz_list_debug_show");
v5 = (_QWORD *)*v4;
if ( (_UNKNOWN *)*v4 == &bz_String_type )
{
wprintf(U"-->[%ls:%ls]", 0LL, v4[3]);
fflush(0LL);
}
else
{
if ( v5 == (_QWORD *)&bz_Integer_type )
wprintf(U"-->[%ls:%ld]", 0LL, v4[1]);
else
wprintf(U"-->[%ls]", *v5);
fflush(0LL);
}
v1 = (_QWORD **)v1[2];
if ( !v1 )
_assert_fail("xs", "src/list.c", 0x144u, "bz_list_debug_show");
}
}
else if ( a1 != (_QWORD **)&bz_Empty_value )
{
_assert_fail("(xs->type == bz_LIST) || (xs == bz_EMPTY)", "src/list.c", 0x136u, "bz_list_debug_show");
}
wprintf(U"-->[/]");
fflush(0LL);
return bz_barf_pop_function();
}

original_code:
void bz_list_debug_show(bz_List* xs)
{
  {bz_barf_push_function(__PRETTY_FUNCTION__);;};
  ((void) sizeof ((xs) ? 1 : 0), __extension__ ({ if (xs) ; else __assert_fail ("xs", "src/list.c", 308, __extension__ __PRETTY_FUNCTION__); }));
  wprintf(L"[%ls:%i]",xs->type->name,bz_list_length(xs));fflush(0);
  ((void) sizeof (((xs->type == &bz_List_type) || (xs == ((void *)&bz_Empty_value))) ? 1 : 0), __extension__ ({ if ((xs->type == &bz_List_type) || (xs == ((void *)&bz_Empty_value))) ; else __assert_fail ("(xs->type == bz_LIST) || (xs == bz_EMPTY)", "src/list.c", 310, __extension__ __PRETTY_FUNCTION__); }));
  while ( xs != ((void *)&bz_Empty_value) ) {
    ((void) sizeof ((xs->node) ? 1 : 0), __extension__ ({ if (xs->node) ; else __assert_fail ("xs->node", "src/list.c", 313, __extension__ __PRETTY_FUNCTION__); }));
    if (((bz_String*)xs->node)->type == &bz_String_type) {
      wprintf(L"-->[%ls:%ls]",((bz_String*)xs->node)->type->name,((bz_String*)xs->node)->string);fflush(0);
    } else if (((bz_String*)xs->node)->type == &bz_Integer_type) {
      wprintf(L"-->[%ls:%ld]",((bz_String*)xs->node)->type->name,((bz_Integer*)xs->node)->value);fflush(0);
    } else {
      wprintf(L"-->[%ls]",((bz_String*)xs->node)->type->name,xs->node);fflush(0);
    }
    xs = xs->next;
    ((void) sizeof ((xs) ? 1 : 0), __extension__ ({ if (xs) ; else __assert_fail ("xs", "src/list.c", 324, __extension__ __PRETTY_FUNCTION__); }));
  }
    wprintf(L"-->[/]");fflush(0);
  {;bz_barf_pop_function();};
}

canonical_original_code:
void bz_list_debug_show(struct bz_list_node *xs)
{
  {bz_barf_push_function(__PRETTY_FUNCTION__);;};
  ((void) sizeof ((xs) ? 1 : 0), __extension__ ({ if (xs) ; else __assert_fail ("xs", "src/list.c", 308, __extension__ __PRETTY_FUNCTION__); }));
  wprintf(L"[%ls:%i]",xs->type->name,bz_list_length(xs));fflush(0);
  ((void) sizeof (((xs->type == &bz_List_type) || (xs == ((void *)&bz_Empty_value))) ? 1 : 0), __extension__ ({ if ((xs->type == &bz_List_type) || (xs == ((void *)&bz_Empty_value))) ; else __assert_fail ("(xs->type == bz_LIST) || (xs == bz_EMPTY)", "src/list.c", 310, __extension__ __PRETTY_FUNCTION__); }));
  while ( xs != ((void *)&bz_Empty_value) ) {
    ((void) sizeof ((xs->node) ? 1 : 0), __extension__ ({ if (xs->node) ; else __assert_fail ("xs->node", "src/list.c", 313, __extension__ __PRETTY_FUNCTION__); }));
    if (((struct bz_String *)xs->node)->type == &bz_String_type) {
      wprintf(L"-->[%ls:%ls]",((struct bz_String *)xs->node)->type->name,((struct bz_String *)xs->node)->string);fflush(0);
    } else if (((struct bz_String *)xs->node)->type == &bz_Integer_type) {
      wprintf(L"-->[%ls:%ld]",((struct bz_String *)xs->node)->type->name,((struct bz_Integer *)xs->node)->value);fflush(0);
    } else {
      wprintf(L"-->[%ls]",((struct bz_String *)xs->node)->type->name,xs->node);fflush(0);
    }
    xs = xs->next;
    ((void) sizeof ((xs) ? 1 : 0), __extension__ ({ if (xs) ; else __assert_fail ("xs", "src/list.c", 324, __extension__ __PRETTY_FUNCTION__); }));
  }
    wprintf(L"-->[/]");fflush(0);
  {;bz_barf_pop_function();};
}

user_defined_types: struct bz_Integer { struct bz_Type *type; long long value; }


decompiled_code:
__int64 __fastcall bz_list_compare(void *a1, void *a2)
{
_QWORD *v2; // rbx
_QWORD *v3; // rax
__int64 *v4; // rdi
_QWORD *v5; // rbp
__int64 v6; // rdx
unsigned int v7; // er12
__int64 *v8; // rsi
unsigned int v10; // er12

bz_barf_push_function("bz_list_compare");
if ( a1 == &bz_Empty_value )
{
if ( a2 != &bz_Empty_value )
{
LABEL_19:
v10 = -1;
bz_barf_pop_function();
return v10;
}
LABEL_15:
v10 = 0;
bz_barf_pop_function();
return v10;
}
if ( a2 == &bz_Empty_value )
goto LABEL_17;
v2 = bz_list_flatten((__int64)a1);
v3 = bz_list_flatten((__int64)a2);
v4 = (__int64 *)v2[1];
v5 = v3;
v6 = *v4;
if ( *v4 != *(_QWORD *)v3[1] )
_assert_fail(
"((bz_String*)xxs->node)->type == ((bz_String*)yys->node)->type",
"src/list.c",
0x1B3u,
"bz_list_compare");
if ( v2 == (_QWORD *)&bz_Empty_value )
{
LABEL_18:
if ( v5 != (_QWORD *)&bz_Empty_value )
goto LABEL_19;
goto LABEL_15;
}
if ( v3 != (_QWORD *)&bz_Empty_value )
{
LABEL_6:
v7 = (*(__int64 (**)(void))(v6 + 48))();
if ( v7 )
{
LABEL_13:
bz_barf_pop_function();
return v7;
}
while ( 1 )
{
v2 = (_QWORD *)v2[2];
v5 = (_QWORD *)v5[2];
if ( !v2 || !v5 )
goto LABEL_15;
if ( v2 == (_QWORD *)&bz_Empty_value )
goto LABEL_18;
if ( v5 == (_QWORD *)&bz_Empty_value )
break;
v8 = (__int64 *)v5[1];
v6 = *v8;
if ( *(_QWORD *)v2[1] == *v8 )
goto LABEL_6;
bz_barf("comparing different things");
v7 = (*(__int64 (__fastcall **)(_QWORD, _QWORD))(*(_QWORD *)v2[1] + 48LL))(v2[1], v5[1]);
if ( v7 )
goto LABEL_13;
}
}
LABEL_17:
bz_barf_pop_function();
return 1LL;
}

canonical_decompiled_code:
__int64 __fastcall func9(void *a1, void *a2)
{
_QWORD *v2; // rbx
_QWORD *v3; // rax
__int64 *v4; // rdi
_QWORD *v5; // rbp
__int64 v6; // rdx
unsigned int v7; // er12
__int64 *v8; // rsi
unsigned int v10; // er12

bz_barf_push_function("bz_list_compare");
if ( a1 == &bz_Empty_value )
{
if ( a2 != &bz_Empty_value )
{
LABEL_19:
v10 = -1;
bz_barf_pop_function();
return v10;
}
LABEL_15:
v10 = 0;
bz_barf_pop_function();
return v10;
}
if ( a2 == &bz_Empty_value )
goto LABEL_17;
v2 = bz_list_flatten((__int64)a1);
v3 = bz_list_flatten((__int64)a2);
v4 = (__int64 *)v2[1];
v5 = v3;
v6 = *v4;
if ( *v4 != *(_QWORD *)v3[1] )
_assert_fail(
"((bz_String*)xxs->node)->type == ((bz_String*)yys->node)->type",
"src/list.c",
0x1B3u,
"bz_list_compare");
if ( v2 == (_QWORD *)&bz_Empty_value )
{
LABEL_18:
if ( v5 != (_QWORD *)&bz_Empty_value )
goto LABEL_19;
goto LABEL_15;
}
if ( v3 != (_QWORD *)&bz_Empty_value )
{
LABEL_6:
v7 = (*(__int64 (**)(void))(v6 + 48))();
if ( v7 )
{
LABEL_13:
bz_barf_pop_function();
return v7;
}
while ( 1 )
{
v2 = (_QWORD *)v2[2];
v5 = (_QWORD *)v5[2];
if ( !v2 || !v5 )
goto LABEL_15;
if ( v2 == (_QWORD *)&bz_Empty_value )
goto LABEL_18;
if ( v5 == (_QWORD *)&bz_Empty_value )
break;
v8 = (__int64 *)v5[1];
v6 = *v8;
if ( *(_QWORD *)v2[1] == *v8 )
goto LABEL_6;
bz_barf("comparing different things");
v7 = (*(__int64 (__fastcall **)(_QWORD, _QWORD))(*(_QWORD *)v2[1] + 48LL))(v2[1], v5[1]);
if ( v7 )
goto LABEL_13;
}
}
LABEL_17:
bz_barf_pop_function();
return 1LL;
}

original_code:
int bz_list_compare(bz_List* xs, bz_List* ys)
{
  {bz_barf_push_function(__PRETTY_FUNCTION__);;};
  if(xs == ((void *)&bz_Empty_value)) {
    if(ys == ((void *)&bz_Empty_value))
      {;bz_barf_pop_function();return (0);};
    {;bz_barf_pop_function();return (-1);};
  }
  if(ys == ((void *)&bz_Empty_value))
    {;bz_barf_pop_function();return (1);};
  bz_List* xxs = bz_list_flatten(xs);
  bz_List* yys = bz_list_flatten(ys);
  int cmp=0;
  ((void) sizeof ((((bz_String*)xxs->node)->type == ((bz_String*)yys->node)->type) ? 1 : 0), __extension__ ({ if (((bz_String*)xxs->node)->type == ((bz_String*)yys->node)->type) ; else __assert_fail ("((bz_String*)xxs->node)->type == ((bz_String*)yys->node)->type", "src/list.c", 435, __extension__ __PRETTY_FUNCTION__); }));
  while ( xxs && yys ) {
    if(xxs == ((void *)&bz_Empty_value)) {
      if(yys == ((void *)&bz_Empty_value))
 {;bz_barf_pop_function();return (0);};
      {;bz_barf_pop_function();return (-1);};
    }
    if(yys == ((void *)&bz_Empty_value))
      {;bz_barf_pop_function();return (1);};
    if(((bz_String*)xxs->node)->type != ((bz_String*)yys->node)->type)
      bz_barf("comparing different things");
    cmp = ((bz_Type *)((bz_node *)xxs->node)->type)->compare(xxs->node,yys->node);
    if (cmp != 0) {;bz_barf_pop_function();return (cmp);};
    xxs = xxs->next;
    yys = yys->next;
  }
  {;bz_barf_pop_function();return (cmp);};
}

canonical_original_code:
int bz_list_compare(struct bz_list_node *xs, struct bz_list_node *ys)
{
  {bz_barf_push_function(__PRETTY_FUNCTION__);;};
  if(xs == ((void *)&bz_Empty_value)) {
    if(ys == ((void *)&bz_Empty_value))
      {;bz_barf_pop_function();return (0);};
    {;bz_barf_pop_function();return (-1);};
  }
  if(ys == ((void *)&bz_Empty_value))
    {;bz_barf_pop_function();return (1);};
  struct bz_list_node *xxs = bz_list_flatten(xs);
  struct bz_list_node *yys = bz_list_flatten(ys);
  int cmp = 0;
  ((void) sizeof ((((struct bz_String *)xxs->node)->type == ((struct bz_String *)yys->node)->type) ? 1 : 0), __extension__ ({ if (((struct bz_String *)xxs->node)->type == ((struct bz_String *)yys->node)->type) ; else __assert_fail ("((bz_String*)xxs->node)->type == ((bz_String*)yys->node)->type", "src/list.c", 435, __extension__ __PRETTY_FUNCTION__); }));
  while ( xxs && yys ) {
    if(xxs == ((void *)&bz_Empty_value)) {
      if(yys == ((void *)&bz_Empty_value))
 {;bz_barf_pop_function();return (0);};
      {;bz_barf_pop_function();return (-1);};
    }
    if(yys == ((void *)&bz_Empty_value))
      {;bz_barf_pop_function();return (1);};
    if(((struct bz_String *)xxs->node)->type != ((struct bz_String *)yys->node)->type)
      bz_barf("comparing different things");
    cmp = ((struct bz_Type *)((struct bz_node *)xxs->node)->type)->compare(xxs->node,yys->node);
    if (cmp != 0) {;bz_barf_pop_function();return (cmp);};
    xxs = xxs->next;
    yys = yys->next;
  }
  {;bz_barf_pop_function();return (cmp);};
}

variable_types:
ys
struct bz_list_node *

variable_types: cmp int


decompiled_code:
__int64 __fastcall bz_trie_find(__int64 a1, const wchar_t *a2, size_t a3)
{
const wchar_t *v5; // rdi
size_t v6; // rax
__int64 v7; // rcx
__int64 v8; // rdx
__int64 v9; // rbx
__int64 v10; // rax

while ( 1 )
{
bz_barf_push_function("bz_trie_find");
if ( !a2 )
_assert_fail("key != NULL", "src/trie.c", 0x4Fu, "bz_trie_find");
v5 = a2;
v6 = wcslen(a2);
if ( v6 < a3 )
_assert_fail("key_index <= wcslen(key)", "src/trie.c", 0x50u, "bz_trie_find");
if ( !v6 )
_assert_fail("wcslen(key) > 0", "src/trie.c", 0x51u, "bz_trie_find");
v7 = *(_QWORD *)(a1 + 8);
if ( !v7 )
{
LABEL_11:
bz_barf_pop_function(v5);
return 0LL;
}
v8 = *(_QWORD *)(a1 + 16);
v9 = 0LL;
v10 = 0LL;
while ( 1 )
{
v5 = (const wchar_t *)(v8 + v9);
if ( *(_DWORD *)(v8 + v9) == a2[a3] )
break;
++v10;
v9 += 24LL;
if ( v10 == v7 )
goto LABEL_11;
}
if ( !a2[++a3] )
break;
if ( !*((_QWORD *)v5 + 2) )
goto LABEL_11;
bz_barf_pop_function(v5);
a1 = *(_QWORD *)(*(_QWORD *)(a1 + 16) + v9 + 16);
}
bz_barf_pop_function(v5);
return *(_QWORD *)(*(_QWORD *)(a1 + 16) + v9 + 8);
}

canonical_decompiled_code:
__int64 __fastcall func0(__int64 a1, const wchar_t *a2, size_t a3)
{
const wchar_t *v5; // rdi
size_t v6; // rax
__int64 v7; // rcx
__int64 v8; // rdx
__int64 v9; // rbx
__int64 v10; // rax

while ( 1 )
{
bz_barf_push_function("bz_trie_find");
if ( !a2 )
_assert_fail("key != NULL", "src/trie.c", 0x4Fu, "bz_trie_find");
v5 = a2;
v6 = wcslen(a2);
if ( v6 < a3 )
_assert_fail("key_index <= wcslen(key)", "src/trie.c", 0x50u, "bz_trie_find");
if ( !v6 )
_assert_fail("wcslen(key) > 0", "src/trie.c", 0x51u, "bz_trie_find");
v7 = *(_QWORD *)(a1 + 8);
if ( !v7 )
{
LABEL_11:
bz_barf_pop_function(v5);
return 0LL;
}
v8 = *(_QWORD *)(a1 + 16);
v9 = 0LL;
v10 = 0LL;
while ( 1 )
{
v5 = (const wchar_t *)(v8 + v9);
if ( *(_DWORD *)(v8 + v9) == a2[a3] )
break;
++v10;
v9 += 24LL;
if ( v10 == v7 )
goto LABEL_11;
}
if ( !a2[++a3] )
break;
if ( !*((_QWORD *)v5 + 2) )
goto LABEL_11;
bz_barf_pop_function(v5);
a1 = *(_QWORD *)(*(_QWORD *)(a1 + 16) + v9 + 16);
}
bz_barf_pop_function(v5);
return *(_QWORD *)(*(_QWORD *)(a1 + 16) + v9 + 8);
}

original_code:
void* bz_trie_find(bz_trie* T, wchar_t* key, size_t key_index)
{
  {bz_barf_push_function(__PRETTY_FUNCTION__);;};
  size_t i;
  ((void) sizeof ((key != ((void *)0)) ? 1 : 0), __extension__ ({ if (key != ((void *)0)) ; else __assert_fail ("key != NULL", "src/trie.c", 79, __extension__ __PRETTY_FUNCTION__); }));
  ((void) sizeof ((key_index <= wcslen(key)) ? 1 : 0), __extension__ ({ if (key_index <= wcslen(key)) ; else __assert_fail ("key_index <= wcslen(key)", "src/trie.c", 80, __extension__ __PRETTY_FUNCTION__); }));
  ((void) sizeof ((wcslen(key) > 0) ? 1 : 0), __extension__ ({ if (wcslen(key) > 0) ; else __assert_fail ("wcslen(key) > 0", "src/trie.c", 81, __extension__ __PRETTY_FUNCTION__); }));
  for (i=0; i < T->length; i++) {
    if (T->nodes[i].c == key[key_index]) {
      if (key[key_index + 1] == L'\0')
 {;bz_barf_pop_function();return (T->nodes[i].data);};
      if (!T->nodes[i].next)
 {;bz_barf_pop_function();return (((void *)0));};
      {;bz_barf_pop_function();return (bz_trie_find(T->nodes[i].next, key, key_index + 1));};
    }
  }
  {;bz_barf_pop_function();return (((void *)0));};
}

canonical_original_code:
void *bz_trie_find(struct bz_trie *T, int *key, unsigned long key_index)
{
  {bz_barf_push_function(__PRETTY_FUNCTION__);;};
  unsigned long i;
  ((void) sizeof ((key != ((void *)0)) ? 1 : 0), __extension__ ({ if (key != ((void *)0)) ; else __assert_fail ("key != NULL", "src/trie.c", 79, __extension__ __PRETTY_FUNCTION__); }));
  ((void) sizeof ((key_index <= wcslen(key)) ? 1 : 0), __extension__ ({ if (key_index <= wcslen(key)) ; else __assert_fail ("key_index <= wcslen(key)", "src/trie.c", 80, __extension__ __PRETTY_FUNCTION__); }));
  ((void) sizeof ((wcslen(key) > 0) ? 1 : 0), __extension__ ({ if (wcslen(key) > 0) ; else __assert_fail ("wcslen(key) > 0", "src/trie.c", 81, __extension__ __PRETTY_FUNCTION__); }));
  for (i=0; i < T->length; i++) {
    if (T->nodes[i].c == key[key_index]) {
      if (key[key_index + 1] == L'\0')
 {;bz_barf_pop_function();return (T->nodes[i].data);};
      if (!T->nodes[i].next)
 {;bz_barf_pop_function();return (((void *)0));};
      {;bz_barf_pop_function();return (bz_trie_find(T->nodes[i].next, key, key_index + 1));};
    }
  }
  {;bz_barf_pop_function();return (((void *)0));};
}

variable_types: struct bz_trie { unsigned long node_array_size; unsigned long length; struct bz_trie_node { int c; void *data; void *next; } *nodes; } *

variable_types:
key
int *

variable_types:
i
unsigned long

user_defined_types: struct bz_trie { unsigned long node_array_size; unsigned long length; struct bz_trie_node *nodes; }


decompiled_code:
__int64 __fastcall bz_trie_find_top(__int64 a1, const wchar_t *a2, size_t a3)
{
const wchar_t *v5; // rdi
size_t v6; // rax
__int64 v7; // rcx
__int64 v8; // rdx
__int64 v9; // rbx
__int64 v10; // rax

while ( 1 )
{
bz_barf_push_function("bz_trie_find_top");
if ( !a2 )
_assert_fail("key != NULL", "src/trie.c", 0x6Au, "bz_trie_find_top");
v5 = a2;
v6 = wcslen(a2);
if ( v6 < a3 )
_assert_fail("key_index <= wcslen(key)", "src/trie.c", 0x6Bu, "bz_trie_find_top");
if ( !v6 )
_assert_fail("wcslen(key) > 0", "src/trie.c", 0x6Cu, "bz_trie_find_top");
v7 = *(_QWORD *)(a1 + 8);
if ( !v7 )
break;
v8 = *(_QWORD *)(a1 + 16);
v9 = 0LL;
v10 = 0LL;
while ( 1 )
{
v5 = (const wchar_t *)(v8 + v9);
if ( *(_DWORD *)(v8 + v9) == a2[a3] )
break;
++v10;
v9 += 24LL;
if ( v7 == v10 )
goto LABEL_11;
}
if ( !a2[++a3] || !*((_QWORD *)v5 + 2) )
break;
bz_barf_pop_function(v5);
a1 = *(_QWORD *)(*(_QWORD *)(a1 + 16) + v9 + 16);
}
LABEL_11:
bz_barf_pop_function(v5);
return a1;
}

canonical_decompiled_code:
__int64 __fastcall func1(__int64 a1, const wchar_t *a2, size_t a3)
{
const wchar_t *v5; // rdi
size_t v6; // rax
__int64 v7; // rcx
__int64 v8; // rdx
__int64 v9; // rbx
__int64 v10; // rax

while ( 1 )
{
bz_barf_push_function("bz_trie_find_top");
if ( !a2 )
_assert_fail("key != NULL", "src/trie.c", 0x6Au, "bz_trie_find_top");
v5 = a2;
v6 = wcslen(a2);
if ( v6 < a3 )
_assert_fail("key_index <= wcslen(key)", "src/trie.c", 0x6Bu, "bz_trie_find_top");
if ( !v6 )
_assert_fail("wcslen(key) > 0", "src/trie.c", 0x6Cu, "bz_trie_find_top");
v7 = *(_QWORD *)(a1 + 8);
if ( !v7 )
break;
v8 = *(_QWORD *)(a1 + 16);
v9 = 0LL;
v10 = 0LL;
while ( 1 )
{
v5 = (const wchar_t *)(v8 + v9);
if ( *(_DWORD *)(v8 + v9) == a2[a3] )
break;
++v10;
v9 += 24LL;
if ( v7 == v10 )
goto LABEL_11;
}
if ( !a2[++a3] || !*((_QWORD *)v5 + 2) )
break;
bz_barf_pop_function(v5);
a1 = *(_QWORD *)(*(_QWORD *)(a1 + 16) + v9 + 16);
}
LABEL_11:
bz_barf_pop_function(v5);
return a1;
}

original_code:
bz_trie* bz_trie_find_top(bz_trie* T, wchar_t* key, size_t key_index)
{
  {bz_barf_push_function(__PRETTY_FUNCTION__);;};
  size_t i;
  ((void) sizeof ((key != ((void *)0)) ? 1 : 0), __extension__ ({ if (key != ((void *)0)) ; else __assert_fail ("key != NULL", "src/trie.c", 106, __extension__ __PRETTY_FUNCTION__); }));
  ((void) sizeof ((key_index <= wcslen(key)) ? 1 : 0), __extension__ ({ if (key_index <= wcslen(key)) ; else __assert_fail ("key_index <= wcslen(key)", "src/trie.c", 107, __extension__ __PRETTY_FUNCTION__); }));
  ((void) sizeof ((wcslen(key) > 0) ? 1 : 0), __extension__ ({ if (wcslen(key) > 0) ; else __assert_fail ("wcslen(key) > 0", "src/trie.c", 108, __extension__ __PRETTY_FUNCTION__); }));
  for (i=0; i < T->length; i++) {
    if (T->nodes[i].c == key[key_index]) {
      if (key[key_index + 1] == L'\0')
 {;bz_barf_pop_function();return (T);};
      if (!T->nodes[i].next)
 {;bz_barf_pop_function();return (T);};
      {;bz_barf_pop_function();return (bz_trie_find_top(T->nodes[i].next, key, key_index + 1));};
    }
  }
  {;bz_barf_pop_function();return (T);};
}

canonical_original_code:
struct bz_trie *bz_trie_find_top(struct bz_trie *T, int *key, unsigned long key_index)
{
  {bz_barf_push_function(__PRETTY_FUNCTION__);;};
  unsigned long i;
  ((void) sizeof ((key != ((void *)0)) ? 1 : 0), __extension__ ({ if (key != ((void *)0)) ; else __assert_fail ("key != NULL", "src/trie.c", 106, __extension__ __PRETTY_FUNCTION__); }));
  ((void) sizeof ((key_index <= wcslen(key)) ? 1 : 0), __extension__ ({ if (key_index <= wcslen(key)) ; else __assert_fail ("key_index <= wcslen(key)", "src/trie.c", 107, __extension__ __PRETTY_FUNCTION__); }));
  ((void) sizeof ((wcslen(key) > 0) ? 1 : 0), __extension__ ({ if (wcslen(key) > 0) ; else __assert_fail ("wcslen(key) > 0", "src/trie.c", 108, __extension__ __PRETTY_FUNCTION__); }));
  for (i=0; i < T->length; i++) {
    if (T->nodes[i].c == key[key_index]) {
      if (key[key_index + 1] == L'\0')
 {;bz_barf_pop_function();return (T);};
      if (!T->nodes[i].next)
 {;bz_barf_pop_function();return (T);};
      {;bz_barf_pop_function();return (bz_trie_find_top(T->nodes[i].next, key, key_index + 1));};
    }
  }
  {;bz_barf_pop_function();return (T);};
}

variable_types:
T
struct bz_trie *

return_type: struct bz_trie { unsigned long node_array_size; unsigned long length; struct bz_trie_node { int c; void *data; void *next; } *nodes; } *


decompiled_code:
__int64 __fastcall bz_trie_graft(__int64 *a1, const wchar_t *a2, __int64 a3, __int64 a4)
{
__int64 v7; // rax
__int64 v8; // rdx
char *v9; // rdi
char *v10; // r14
__int64 v11; // rax
char *v13; // rax

bz_barf_push_function("bz_trie_graft");
if ( !a2 )
_assert_fail("key != NULL", "src/trie.c", 0x86u, "bz_trie_graft");
if ( !wcslen(a2) )
_assert_fail("wcslen(key) > 0", "src/trie.c", 0x87u, "bz_trie_graft");
v7 = a1[1];
v8 = *a1;
v9 = (char *)a1[2];
if ( v7 + 1 > (unsigned __int64)*a1 )
{
*a1 = 2 * v8;
v13 = (char *)realloc(v9, 48 * v8);
a1[2] = (__int64)v13;
v9 = v13;
if ( !v13 )
{
bz_barf("Out of memory");
v9 = (char *)a1[2];
}
v7 = a1[1];
}
v10 = &v9[24 * v7];
*(_DWORD *)v10 = a2[a3];
v11 = 0LL;
if ( !a2[a3 + 1] )
v11 = a4;
*((_QWORD *)v10 + 1) = v11;
*((_QWORD *)v10 + 2) = bz_trie_make(a2, a3 + 1, 2uLL, a4);
++a1[1];
return bz_barf_pop_function(a2);
}

original_code:
void bz_trie_graft(bz_trie* T, wchar_t* key, size_t key_index, void* data)
{
  {bz_barf_push_function(__PRETTY_FUNCTION__);;};
  ((void) sizeof ((key != ((void *)0)) ? 1 : 0), __extension__ ({ if (key != ((void *)0)) ; else __assert_fail ("key != NULL", "src/trie.c", 134, __extension__ __PRETTY_FUNCTION__); }));
  ((void) sizeof ((wcslen(key) > 0) ? 1 : 0), __extension__ ({ if (wcslen(key) > 0) ; else __assert_fail ("wcslen(key) > 0", "src/trie.c", 135, __extension__ __PRETTY_FUNCTION__); }));
  if ((T->length + 1) > (T->node_array_size)) {
    T->node_array_size <<= 1;
    T->nodes = realloc( T->nodes, sizeof(bz_trie_node[T->node_array_size]));
    if (T->nodes == ((void *)0))
      bz_barf("Out of memory");
  }
  T->nodes[T->length].c = key[key_index];
  if(key[key_index + 1] == L'\0')
    T->nodes[T->length].data = data;
  else
    T->nodes[T->length].data = ((void *)0);
  T->nodes[T->length].next = bz_trie_make(key, key_index + 1, 2, data);
  T->length++;
  {;bz_barf_pop_function();};
}

canonical_original_code:
void bz_trie_graft(struct bz_trie *T, int *key, unsigned long key_index, void *data)
{
  {bz_barf_push_function(__PRETTY_FUNCTION__);;};
  ((void) sizeof ((key != ((void *)0)) ? 1 : 0), __extension__ ({ if (key != ((void *)0)) ; else __assert_fail ("key != NULL", "src/trie.c", 134, __extension__ __PRETTY_FUNCTION__); }));
  ((void) sizeof ((wcslen(key) > 0) ? 1 : 0), __extension__ ({ if (wcslen(key) > 0) ; else __assert_fail ("wcslen(key) > 0", "src/trie.c", 135, __extension__ __PRETTY_FUNCTION__); }));
  if ((T->length + 1) > (T->node_array_size)) {
    T->node_array_size <<= 1;
    T->nodes = realloc( T->nodes, sizeof(bz_trie_node[T->node_array_size]));
    if (T->nodes == ((void *)0))
      bz_barf("Out of memory");
  }
  T->nodes[T->length].c = key[key_index];
  if(key[key_index + 1] == L'\0')
    T->nodes[T->length].data = data;
  else
    T->nodes[T->length].data = ((void *)0);
  T->nodes[T->length].next = bz_trie_make(key, key_index + 1, 2, data);
  T->length++;
  {;bz_barf_pop_function();};
}

variable_types:
data
void *

user_defined_types: struct bz_trie_node { int c; void *data; void *next; }


decompiled_code:
__int64 __fastcall bz_trie_find_and_graft(__int64 *a1, const wchar_t *a2, unsigned __int64 a3, __int64 a4)
{
const wchar_t *v7; // rbp
void *v8; // rdi
size_t v9; // rax
__int64 v10; // rbx
__int64 v11; // rdx
wchar_t v12; // ecx
__int64 v13; // rsi
__int64 v14; // rax
size_t v15; // r14
__int64 v16; // rdi
__int64 result; // rax

v7 = a2;
bz_barf_push_function("bz_trie_find_and_graft");
if ( !a1 )
_assert_fail("T != NULL", "src/trie.c", 0xA4u, "bz_trie_find_and_graft");
if ( !a2 )
_assert_fail("key != NULL", "src/trie.c", 0xA5u, "bz_trie_find_and_graft");
v8 = (void *)a2;
v9 = wcslen(a2);
if ( v9 < a3 )
_assert_fail("key_index <= wcslen(key)", "src/trie.c", 0xA6u, "bz_trie_find_and_graft");
if ( !v9 )
_assert_fail("wcslen(key) > 0", "src/trie.c", 0xA7u, "bz_trie_find_and_graft");
v10 = a1[2];
if ( !v10 )
_assert_fail("T->nodes != NULL", "src/trie.c", 0xA8u, "bz_trie_find_and_graft");
v11 = a1[1];
if ( !v11 )
{
LABEL_13:
v8 = a1;
bz_trie_graft(a1, v7, a3, a4);
return bz_barf_pop_function(v8);
}
v12 = a2[a3];
v13 = a3;
v14 = 0LL;
while ( *(_DWORD *)v10 != v12 )
{
++v14;
v10 += 24LL;
if ( v14 == v11 )
goto LABEL_13;
}
v15 = a3 + 1;
if ( !v7[v13 + 1] )
{
*(_QWORD *)(v10 + 8) = a4;
return bz_barf_pop_function(v8);
}
v16 = *(_QWORD *)(v10 + 16);
if ( v16 )
{
bz_trie_find_and_graft(v16, v7, v15, a4);
result = bz_barf_pop_function(v16);
}
else
{
*(_QWORD *)(v10 + 16) = bz_trie_make(v7, v15, 2uLL, a4);
result = bz_barf_pop_function(v7);
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func3(__int64 *a1, const wchar_t *a2, unsigned __int64 a3, __int64 a4)
{
const wchar_t *v7; // rbp
void *v8; // rdi
size_t v9; // rax
__int64 v10; // rbx
__int64 v11; // rdx
wchar_t v12; // ecx
__int64 v13; // rsi
__int64 v14; // rax
size_t v15; // r14
__int64 v16; // rdi
__int64 result; // rax

v7 = a2;
bz_barf_push_function("bz_trie_find_and_graft");
if ( !a1 )
_assert_fail("T != NULL", "src/trie.c", 0xA4u, "bz_trie_find_and_graft");
if ( !a2 )
_assert_fail("key != NULL", "src/trie.c", 0xA5u, "bz_trie_find_and_graft");
v8 = (void *)a2;
v9 = wcslen(a2);
if ( v9 < a3 )
_assert_fail("key_index <= wcslen(key)", "src/trie.c", 0xA6u, "bz_trie_find_and_graft");
if ( !v9 )
_assert_fail("wcslen(key) > 0", "src/trie.c", 0xA7u, "bz_trie_find_and_graft");
v10 = a1[2];
if ( !v10 )
_assert_fail("T->nodes != NULL", "src/trie.c", 0xA8u, "bz_trie_find_and_graft");
v11 = a1[1];
if ( !v11 )
{
LABEL_13:
v8 = a1;
func2(a1, v7, a3, a4);
return bz_barf_pop_function(v8);
}
v12 = a2[a3];
v13 = a3;
v14 = 0LL;
while ( *(_DWORD *)v10 != v12 )
{
++v14;
v10 += 24LL;
if ( v14 == v11 )
goto LABEL_13;
}
v15 = a3 + 1;
if ( !v7[v13 + 1] )
{
*(_QWORD *)(v10 + 8) = a4;
return bz_barf_pop_function(v8);
}
v16 = *(_QWORD *)(v10 + 16);
if ( v16 )
{
func3(v16, v7, v15, a4);
result = bz_barf_pop_function(v16);
}
else
{
*(_QWORD *)(v10 + 16) = bz_trie_make(v7, v15, 2uLL, a4);
result = bz_barf_pop_function(v7);
}
return result;
}

original_code:
void bz_trie_find_and_graft(bz_trie* T, wchar_t* key, size_t key_index, void* data)
{
  {bz_barf_push_function(__PRETTY_FUNCTION__);;};
  size_t i;
  ((void) sizeof ((T != ((void *)0)) ? 1 : 0), __extension__ ({ if (T != ((void *)0)) ; else __assert_fail ("T != NULL", "src/trie.c", 164, __extension__ __PRETTY_FUNCTION__); }));
  ((void) sizeof ((key != ((void *)0)) ? 1 : 0), __extension__ ({ if (key != ((void *)0)) ; else __assert_fail ("key != NULL", "src/trie.c", 165, __extension__ __PRETTY_FUNCTION__); }));
  ((void) sizeof ((key_index <= wcslen(key)) ? 1 : 0), __extension__ ({ if (key_index <= wcslen(key)) ; else __assert_fail ("key_index <= wcslen(key)", "src/trie.c", 166, __extension__ __PRETTY_FUNCTION__); }));
  ((void) sizeof ((wcslen(key) > 0) ? 1 : 0), __extension__ ({ if (wcslen(key) > 0) ; else __assert_fail ("wcslen(key) > 0", "src/trie.c", 167, __extension__ __PRETTY_FUNCTION__); }));
  ((void) sizeof ((T->nodes != ((void *)0)) ? 1 : 0), __extension__ ({ if (T->nodes != ((void *)0)) ; else __assert_fail ("T->nodes != NULL", "src/trie.c", 168, __extension__ __PRETTY_FUNCTION__); }));
  for (i=0; i < T->length; i++) {
    if (T->nodes[i].c == key[key_index]) {
      if (key[key_index + 1] == L'\0') {
 T->nodes[i].data = data;
 {;bz_barf_pop_function();return;};
      }
      if (T->nodes[i].next == ((void *)0)) {
 T->nodes[i].next = bz_trie_make(key, key_index+1, 2, data);
 {;bz_barf_pop_function();return;};
      }
      bz_trie_find_and_graft(T->nodes[i].next, key, key_index + 1, data);
      {;bz_barf_pop_function();return;};
    }
  }
  bz_trie_graft( T, key, key_index, data);
  {;bz_barf_pop_function();};
}

canonical_original_code:
void bz_trie_find_and_graft(struct bz_trie *T, int *key, unsigned long key_index, void *data)
{
  {bz_barf_push_function(__PRETTY_FUNCTION__);;};
  unsigned long i;
  ((void) sizeof ((T != ((void *)0)) ? 1 : 0), __extension__ ({ if (T != ((void *)0)) ; else __assert_fail ("T != NULL", "src/trie.c", 164, __extension__ __PRETTY_FUNCTION__); }));
  ((void) sizeof ((key != ((void *)0)) ? 1 : 0), __extension__ ({ if (key != ((void *)0)) ; else __assert_fail ("key != NULL", "src/trie.c", 165, __extension__ __PRETTY_FUNCTION__); }));
  ((void) sizeof ((key_index <= wcslen(key)) ? 1 : 0), __extension__ ({ if (key_index <= wcslen(key)) ; else __assert_fail ("key_index <= wcslen(key)", "src/trie.c", 166, __extension__ __PRETTY_FUNCTION__); }));
  ((void) sizeof ((wcslen(key) > 0) ? 1 : 0), __extension__ ({ if (wcslen(key) > 0) ; else __assert_fail ("wcslen(key) > 0", "src/trie.c", 167, __extension__ __PRETTY_FUNCTION__); }));
  ((void) sizeof ((T->nodes != ((void *)0)) ? 1 : 0), __extension__ ({ if (T->nodes != ((void *)0)) ; else __assert_fail ("T->nodes != NULL", "src/trie.c", 168, __extension__ __PRETTY_FUNCTION__); }));
  for (i=0; i < T->length; i++) {
    if (T->nodes[i].c == key[key_index]) {
      if (key[key_index + 1] == L'\0') {
 T->nodes[i].data = data;
 {;bz_barf_pop_function();return;};
      }
      if (T->nodes[i].next == ((void *)0)) {
 T->nodes[i].next = bz_trie_make(key, key_index+1, 2, data);
 {;bz_barf_pop_function();return;};
      }
      bz_trie_find_and_graft(T->nodes[i].next, key, key_index + 1, data);
      {;bz_barf_pop_function();return;};
    }
  }
  bz_trie_graft( T, key, key_index, data);
  {;bz_barf_pop_function();};
}


decompiled_code:
__int64 __fastcall bz_trie_show(__int64 a1, int a2)
{
const char *v3; // rdi
unsigned __int64 i; // r12
__int64 v5; // rax
__int64 v6; // r13
int j; // er15

v3 = "bz_trie_show";
bz_barf_push_function("bz_trie_show");
if ( !a1 )
_assert_fail("T", "src/trie.c", 0xCAu, "bz_trie_show");
for ( i = 0LL; *(_QWORD *)(a1 + 8) > i; ++i )
{
v5 = *(_QWORD *)(a1 + 16);
if ( !v5 )
_assert_fail("T->nodes", "src/trie.c", 0xCEu, "bz_trie_show");
v6 = 24 * i;
if ( a2 > 0 )
{
for ( j = 0; j != a2; ++j )
wprintf(U" ");
v5 = *(_QWORD *)(a1 + 16);
}
wprintf(U"%lc", *(unsigned int *)(v5 + 24 * i));
if ( *(_QWORD *)(*(_QWORD *)(a1 + 16) + v6 + 8) )
wprintf(U"-->*");
wprintf(asc_BB8);
v3 = *(const char **)(*(_QWORD *)(a1 + 16) + v6 + 16);
if ( v3 )
bz_trie_show(v3, (unsigned int)(a2 + 1));
}
return bz_barf_pop_function(v3);
}

canonical_decompiled_code:
__int64 __fastcall func4(__int64 a1, int a2)
{
const char *v3; // rdi
unsigned __int64 i; // r12
__int64 v5; // rax
__int64 v6; // r13
int j; // er15

v3 = "bz_trie_show";
bz_barf_push_function("bz_trie_show");
if ( !a1 )
_assert_fail("T", "src/trie.c", 0xCAu, "bz_trie_show");
for ( i = 0LL; *(_QWORD *)(a1 + 8) > i; ++i )
{
v5 = *(_QWORD *)(a1 + 16);
if ( !v5 )
_assert_fail("T->nodes", "src/trie.c", 0xCEu, "bz_trie_show");
v6 = 24 * i;
if ( a2 > 0 )
{
for ( j = 0; j != a2; ++j )
wprintf(U" ");
v5 = *(_QWORD *)(a1 + 16);
}
wprintf(U"%lc", *(unsigned int *)(v5 + 24 * i));
if ( *(_QWORD *)(*(_QWORD *)(a1 + 16) + v6 + 8) )
wprintf(U"-->*");
wprintf(asc_BB8);
v3 = *(const char **)(*(_QWORD *)(a1 + 16) + v6 + 16);
if ( v3 )
func4(v3, (unsigned int)(a2 + 1));
}
return bz_barf_pop_function(v3);
}

original_code:
void bz_trie_show(bz_trie* T, int n)
{
  {bz_barf_push_function(__PRETTY_FUNCTION__);;};
  int i;
  ((void) sizeof ((T) ? 1 : 0), __extension__ ({ if (T) ; else __assert_fail ("T", "src/trie.c", 202, __extension__ __PRETTY_FUNCTION__); }));
  for(i=0;i<T->length;i++) {
    ((void) sizeof ((T->nodes) ? 1 : 0), __extension__ ({ if (T->nodes) ; else __assert_fail ("T->nodes", "src/trie.c", 206, __extension__ __PRETTY_FUNCTION__); }));
    ((void) sizeof ((&T->nodes[i]) ? 1 : 0), __extension__ ({ if (&T->nodes[i]) ; else __assert_fail ("&T->nodes[i]", "src/trie.c", 207, __extension__ __PRETTY_FUNCTION__); }));
    {int j;for(j=0;j<n;j++){wprintf(L"  ");};};
    wprintf(L"%lc",T->nodes[i].c);
    if (T->nodes[i].data)
      wprintf(L"-->*");
    wprintf(L"\n");
    if (T->nodes[i].next)
      bz_trie_show(T->nodes[i].next,n+1);
  }
  {;bz_barf_pop_function();};
}

canonical_original_code:
void bz_trie_show(struct bz_trie *T, int n)
{
  {bz_barf_push_function(__PRETTY_FUNCTION__);;};
  int i;
  ((void) sizeof ((T) ? 1 : 0), __extension__ ({ if (T) ; else __assert_fail ("T", "src/trie.c", 202, __extension__ __PRETTY_FUNCTION__); }));
  for(i=0;i<T->length;i++) {
    ((void) sizeof ((T->nodes) ? 1 : 0), __extension__ ({ if (T->nodes) ; else __assert_fail ("T->nodes", "src/trie.c", 206, __extension__ __PRETTY_FUNCTION__); }));
    ((void) sizeof ((&T->nodes[i]) ? 1 : 0), __extension__ ({ if (&T->nodes[i]) ; else __assert_fail ("&T->nodes[i]", "src/trie.c", 207, __extension__ __PRETTY_FUNCTION__); }));
    {int j;for(j=0;j<n;j++){wprintf(L"  ");};};
    wprintf(L"%lc",T->nodes[i].c);
    if (T->nodes[i].data)
      wprintf(L"-->*");
    wprintf(L"\n");
    if (T->nodes[i].next)
      bz_trie_show(T->nodes[i].next,n+1);
  }
  {;bz_barf_pop_function();};
}

variable_types: i int

variable_types: j int


decompiled_code:
unsigned __int64 *__fastcall bz_trie_prune(unsigned __int64 *a1)
{
char *v2; // rdi
unsigned __int64 v3; // rbx
unsigned __int64 v4; // r12
unsigned __int64 v5; // rcx
unsigned __int64 v6; // rax
__int64 v7; // rdx
__int64 v8; // rax
unsigned __int64 v9; // rcx
__int64 v10; // rdx
unsigned __int64 v11; // rdx
unsigned __int64 *result; // rax
__int64 v13; // rsi
unsigned __int64 v14; // r13

v2 = "bz_trie_prune";
bz_barf_push_function("bz_trie_prune");
if ( !a1 || !a1[1] )
goto LABEL_15;
v3 = 0LL;
v4 = 0LL;
do
{
v5 = a1[2];
v6 = v5 + 24 * v3;
v7 = *(_QWORD *)(v6 + 8);
v2 = *(char **)(v6 + 16);
if ( v7 )
{
v13 = 3 * v4++;
v14 = v5 + 8 * v13;
*(_DWORD *)v14 = *(_DWORD *)v6;
*(_QWORD *)(v14 + 8) = v7;
*(_QWORD *)(v14 + 16) = bz_trie_prune(v2);
}
else if ( v2 )
{
v8 = bz_trie_prune(v2);
if ( v8 )
{
v9 = a1[2];
v10 = 3 * v4++;
v11 = v9 + 8 * v10;
LODWORD(v9) = *(_DWORD *)(v9 + 24 * v3);
*(_QWORD *)(v11 + 8) = 0LL;
*(_DWORD *)v11 = v9;
*(_QWORD *)(v11 + 16) = v8;
}
}
++v3;
}
while ( a1[1] > v3 );
if ( v4 )
{
a1[1] = v4;
if ( v4 > 2 && *a1 > v4 )
{
v2 = (char *)a1[2];
a1[2] = (unsigned __int64)realloc(v2, 24 * v4);
}
bz_barf_pop_function(v2);
result = a1;
}
else
{
LABEL_15:
bz_barf_pop_function(v2);
result = 0LL;
}
return result;
}

canonical_decompiled_code:
unsigned __int64 *__fastcall func5(unsigned __int64 *a1)
{
char *v2; // rdi
unsigned __int64 v3; // rbx
unsigned __int64 v4; // r12
unsigned __int64 v5; // rcx
unsigned __int64 v6; // rax
__int64 v7; // rdx
__int64 v8; // rax
unsigned __int64 v9; // rcx
__int64 v10; // rdx
unsigned __int64 v11; // rdx
unsigned __int64 *result; // rax
__int64 v13; // rsi
unsigned __int64 v14; // r13

v2 = "bz_trie_prune";
bz_barf_push_function("bz_trie_prune");
if ( !a1 || !a1[1] )
goto LABEL_15;
v3 = 0LL;
v4 = 0LL;
do
{
v5 = a1[2];
v6 = v5 + 24 * v3;
v7 = *(_QWORD *)(v6 + 8);
v2 = *(char **)(v6 + 16);
if ( v7 )
{
v13 = 3 * v4++;
v14 = v5 + 8 * v13;
*(_DWORD *)v14 = *(_DWORD *)v6;
*(_QWORD *)(v14 + 8) = v7;
*(_QWORD *)(v14 + 16) = func5(v2);
}
else if ( v2 )
{
v8 = func5(v2);
if ( v8 )
{
v9 = a1[2];
v10 = 3 * v4++;
v11 = v9 + 8 * v10;
LODWORD(v9) = *(_DWORD *)(v9 + 24 * v3);
*(_QWORD *)(v11 + 8) = 0LL;
*(_DWORD *)v11 = v9;
*(_QWORD *)(v11 + 16) = v8;
}
}
++v3;
}
while ( a1[1] > v3 );
if ( v4 )
{
a1[1] = v4;
if ( v4 > 2 && *a1 > v4 )
{
v2 = (char *)a1[2];
a1[2] = (unsigned __int64)realloc(v2, 24 * v4);
}
bz_barf_pop_function(v2);
result = a1;
}
else
{
LABEL_15:
bz_barf_pop_function(v2);
result = 0LL;
}
return result;
}

original_code:
bz_trie* bz_trie_prune(bz_trie* T)
{
  {bz_barf_push_function(__PRETTY_FUNCTION__);;};
  if(T == ((void *)0))
    {;bz_barf_pop_function();return (((void *)0));};
  if(T->length == 0)
    {;bz_barf_pop_function();return (((void *)0));};
  size_t kept = 0;
  size_t i;
  for (i=0;i<T->length;i++) {
    if (T->nodes[i].data) {
      T->nodes[kept].c = T->nodes[i].c;
      T->nodes[kept].data = T->nodes[i].data;
      T->nodes[kept].next = bz_trie_prune(T->nodes[i].next);
      kept++;
      continue;
    }
    if (T->nodes[i].next) {
      bz_trie* next = bz_trie_prune(T->nodes[i].next);
      if( next != ((void *)0) ) {
 T->nodes[kept].c = T->nodes[i].c;
 T->nodes[kept].data = ((void *)0);
 T->nodes[kept].next = next;
 kept++;
      }
    }
  }
  if(kept == 0)
    {;bz_barf_pop_function();return (((void *)0));};
  T->length = kept;
  if((T->length > 2) && (T->length < T->node_array_size))
    T->nodes = realloc(T->nodes,sizeof(bz_trie_node) * T->length);
  {;bz_barf_pop_function();return (T);};
}

canonical_original_code:
struct bz_trie *bz_trie_prune(struct bz_trie *T)
{
  {bz_barf_push_function(__PRETTY_FUNCTION__);;};
  if(T == ((void *)0))
    {;bz_barf_pop_function();return (((void *)0));};
  if(T->length == 0)
    {;bz_barf_pop_function();return (((void *)0));};
  unsigned long kept = 0;
  unsigned long i;
  for (i=0;i<T->length;i++) {
    if (T->nodes[i].data) {
      T->nodes[kept].c = T->nodes[i].c;
      T->nodes[kept].data = T->nodes[i].data;
      T->nodes[kept].next = bz_trie_prune(T->nodes[i].next);
      kept++;
      continue;
    }
    if (T->nodes[i].next) {
      struct bz_trie *next = bz_trie_prune(T->nodes[i].next);
      if( next != ((void *)0) ) {
 T->nodes[kept].c = T->nodes[i].c;
 T->nodes[kept].data = ((void *)0);
 T->nodes[kept].next = next;
 kept++;
      }
    }
  }
  if(kept == 0)
    {;bz_barf_pop_function();return (((void *)0));};
  T->length = kept;
  if((T->length > 2) && (T->length < T->node_array_size))
    T->nodes = realloc(T->nodes,sizeof(bz_trie_node) * T->length);
  {;bz_barf_pop_function();return (T);};
}

variable_types:
kept
unsigned long


decompiled_code:
__int64 __fastcall bz_trie_find_and_delete(__int64 a1, const wchar_t *a2, size_t a3)
{
const wchar_t *v6; // rdi
size_t v7; // rax
__int64 v8; // rcx
__int64 v9; // rdx
__int64 v10; // rbx
__int64 v11; // rax
__int64 v12; // rsi

while ( 1 )
{
bz_barf_push_function("bz_trie_find_and_delete");
if ( !a2 )
_assert_fail("key != NULL", "src/trie.c", 0x117u, "bz_trie_find_and_delete");
v6 = a2;
v7 = wcslen(a2);
if ( v7 < a3 )
_assert_fail("key_index <= wcslen(key)", "src/trie.c", 0x118u, "bz_trie_find_and_delete");
if ( !v7 )
_assert_fail("wcslen(key) > 0", "src/trie.c", 0x119u, "bz_trie_find_and_delete");
v8 = *(_QWORD *)(a1 + 8);
if ( !v8 )
{
LABEL_12:
bz_barf_pop_function(v6);
return 0LL;
}
v9 = *(_QWORD *)(a1 + 16);
v6 = (const wchar_t *)(unsigned int)a2[a3];
v10 = 0LL;
v11 = 0LL;
while ( 1 )
{
v12 = v9 + v10;
if ( *(_DWORD *)(v9 + v10) == (_DWORD)v6 )
break;
++v11;
v10 += 24LL;
if ( v8 == v11 )
goto LABEL_12;
}
if ( *(_QWORD *)(v12 + 8) && !a2[a3 + 1] )
break;
if ( !*(_QWORD *)(v12 + 16) )
goto LABEL_12;
++a3;
bz_barf_pop_function(v6);
a1 = *(_QWORD *)(*(_QWORD *)(a1 + 16) + v10 + 16);
}
*(_QWORD *)(v12 + 8) = 0LL;
bz_barf_pop_function(v6);
return a1;
}

canonical_decompiled_code:
__int64 __fastcall func6(__int64 a1, const wchar_t *a2, size_t a3)
{
const wchar_t *v6; // rdi
size_t v7; // rax
__int64 v8; // rcx
__int64 v9; // rdx
__int64 v10; // rbx
__int64 v11; // rax
__int64 v12; // rsi

while ( 1 )
{
bz_barf_push_function("bz_trie_find_and_delete");
if ( !a2 )
_assert_fail("key != NULL", "src/trie.c", 0x117u, "bz_trie_find_and_delete");
v6 = a2;
v7 = wcslen(a2);
if ( v7 < a3 )
_assert_fail("key_index <= wcslen(key)", "src/trie.c", 0x118u, "bz_trie_find_and_delete");
if ( !v7 )
_assert_fail("wcslen(key) > 0", "src/trie.c", 0x119u, "bz_trie_find_and_delete");
v8 = *(_QWORD *)(a1 + 8);
if ( !v8 )
{
LABEL_12:
bz_barf_pop_function(v6);
return 0LL;
}
v9 = *(_QWORD *)(a1 + 16);
v6 = (const wchar_t *)(unsigned int)a2[a3];
v10 = 0LL;
v11 = 0LL;
while ( 1 )
{
v12 = v9 + v10;
if ( *(_DWORD *)(v9 + v10) == (_DWORD)v6 )
break;
++v11;
v10 += 24LL;
if ( v8 == v11 )
goto LABEL_12;
}
if ( *(_QWORD *)(v12 + 8) && !a2[a3 + 1] )
break;
if ( !*(_QWORD *)(v12 + 16) )
goto LABEL_12;
++a3;
bz_barf_pop_function(v6);
a1 = *(_QWORD *)(*(_QWORD *)(a1 + 16) + v10 + 16);
}
*(_QWORD *)(v12 + 8) = 0LL;
bz_barf_pop_function(v6);
return a1;
}

original_code:
void* bz_trie_find_and_delete(bz_trie* T, wchar_t* key, size_t key_index)
{
  {bz_barf_push_function(__PRETTY_FUNCTION__);;};
  size_t i;
  ((void) sizeof ((key != ((void *)0)) ? 1 : 0), __extension__ ({ if (key != ((void *)0)) ; else __assert_fail ("key != NULL", "src/trie.c", 279, __extension__ __PRETTY_FUNCTION__); }));
  ((void) sizeof ((key_index <= wcslen(key)) ? 1 : 0), __extension__ ({ if (key_index <= wcslen(key)) ; else __assert_fail ("key_index <= wcslen(key)", "src/trie.c", 280, __extension__ __PRETTY_FUNCTION__); }));
  ((void) sizeof ((wcslen(key) > 0) ? 1 : 0), __extension__ ({ if (wcslen(key) > 0) ; else __assert_fail ("wcslen(key) > 0", "src/trie.c", 281, __extension__ __PRETTY_FUNCTION__); }));
  for (i=0; i < T->length; i++) {
    if (T->nodes[i].c == key[key_index]) {
      if (T->nodes[i].data)
      if (key[key_index + 1] == L'\0') {
 T->nodes[i].data = ((void *)0);
 {;bz_barf_pop_function();return (T);};
      }
      if (!T->nodes[i].next)
 {;bz_barf_pop_function();return (((void *)0));};
      {;bz_barf_pop_function();return (bz_trie_find_and_delete(T->nodes[i].next, key, key_index + 1));};
    }
  }
  {;bz_barf_pop_function();return (((void *)0));};
}

canonical_original_code:
void *bz_trie_find_and_delete(struct bz_trie *T, int *key, unsigned long key_index)
{
  {bz_barf_push_function(__PRETTY_FUNCTION__);;};
  unsigned long i;
  ((void) sizeof ((key != ((void *)0)) ? 1 : 0), __extension__ ({ if (key != ((void *)0)) ; else __assert_fail ("key != NULL", "src/trie.c", 279, __extension__ __PRETTY_FUNCTION__); }));
  ((void) sizeof ((key_index <= wcslen(key)) ? 1 : 0), __extension__ ({ if (key_index <= wcslen(key)) ; else __assert_fail ("key_index <= wcslen(key)", "src/trie.c", 280, __extension__ __PRETTY_FUNCTION__); }));
  ((void) sizeof ((wcslen(key) > 0) ? 1 : 0), __extension__ ({ if (wcslen(key) > 0) ; else __assert_fail ("wcslen(key) > 0", "src/trie.c", 281, __extension__ __PRETTY_FUNCTION__); }));
  for (i=0; i < T->length; i++) {
    if (T->nodes[i].c == key[key_index]) {
      if (T->nodes[i].data)
      if (key[key_index + 1] == L'\0') {
 T->nodes[i].data = ((void *)0);
 {;bz_barf_pop_function();return (T);};
      }
      if (!T->nodes[i].next)
 {;bz_barf_pop_function();return (((void *)0));};
      {;bz_barf_pop_function();return (bz_trie_find_and_delete(T->nodes[i].next, key, key_index + 1));};
    }
  }
  {;bz_barf_pop_function();return (((void *)0));};
}


decompiled_code:
__int64 __fastcall bz_trie_delete(unsigned __int64 *a1, const wchar_t *a2)
{
bz_barf_push_function("bz_trie_delete");
if ( !a1 )
_assert_fail("T", "src/trie.c", 0x134u, "bz_trie_delete");
if ( !a2 )
_assert_fail("key", "src/trie.c", 0x135u, "bz_trie_delete");
if ( !a1[1] )
_assert_fail("T->length > 0", "src/trie.c", 0x136u, "bz_trie_delete");
if ( !wcslen(a2) )
_assert_fail("wcslen(key) > 0", "src/trie.c", 0x137u, "bz_trie_delete");
bz_trie_find_and_delete((__int64)a1, a2, 0LL);
bz_trie_prune(a1);
return bz_barf_pop_function(a1);
}

canonical_decompiled_code:
__int64 __fastcall func7(unsigned __int64 *a1, const wchar_t *a2)
{
bz_barf_push_function("bz_trie_delete");
if ( !a1 )
_assert_fail("T", "src/trie.c", 0x134u, "bz_trie_delete");
if ( !a2 )
_assert_fail("key", "src/trie.c", 0x135u, "bz_trie_delete");
if ( !a1[1] )
_assert_fail("T->length > 0", "src/trie.c", 0x136u, "bz_trie_delete");
if ( !wcslen(a2) )
_assert_fail("wcslen(key) > 0", "src/trie.c", 0x137u, "bz_trie_delete");
func6((__int64)a1, a2, 0LL);
func5(a1);
return bz_barf_pop_function(a1);
}

original_code:
void bz_trie_delete(bz_trie* T, wchar_t* key)
{
  {bz_barf_push_function(__PRETTY_FUNCTION__);;};
  ((void) sizeof ((T) ? 1 : 0), __extension__ ({ if (T) ; else __assert_fail ("T", "src/trie.c", 308, __extension__ __PRETTY_FUNCTION__); }));
  ((void) sizeof ((key) ? 1 : 0), __extension__ ({ if (key) ; else __assert_fail ("key", "src/trie.c", 309, __extension__ __PRETTY_FUNCTION__); }));
  ((void) sizeof ((T->length > 0) ? 1 : 0), __extension__ ({ if (T->length > 0) ; else __assert_fail ("T->length > 0", "src/trie.c", 310, __extension__ __PRETTY_FUNCTION__); }));
  ((void) sizeof ((wcslen(key) > 0) ? 1 : 0), __extension__ ({ if (wcslen(key) > 0) ; else __assert_fail ("wcslen(key) > 0", "src/trie.c", 311, __extension__ __PRETTY_FUNCTION__); }));
  bz_trie_find_and_delete(T, key, 0);
  T = bz_trie_prune(T);
  {;bz_barf_pop_function();};
}

canonical_original_code:
void bz_trie_delete(struct bz_trie *T, int *key)
{
  {bz_barf_push_function(__PRETTY_FUNCTION__);;};
  ((void) sizeof ((T) ? 1 : 0), __extension__ ({ if (T) ; else __assert_fail ("T", "src/trie.c", 308, __extension__ __PRETTY_FUNCTION__); }));
  ((void) sizeof ((key) ? 1 : 0), __extension__ ({ if (key) ; else __assert_fail ("key", "src/trie.c", 309, __extension__ __PRETTY_FUNCTION__); }));
  ((void) sizeof ((T->length > 0) ? 1 : 0), __extension__ ({ if (T->length > 0) ; else __assert_fail ("T->length > 0", "src/trie.c", 310, __extension__ __PRETTY_FUNCTION__); }));
  ((void) sizeof ((wcslen(key) > 0) ? 1 : 0), __extension__ ({ if (wcslen(key) > 0) ; else __assert_fail ("wcslen(key) > 0", "src/trie.c", 311, __extension__ __PRETTY_FUNCTION__); }));
  bz_trie_find_and_delete(T, key, 0);
  T = bz_trie_prune(T);
  {;bz_barf_pop_function();};
}


decompiled_code:
void *__fastcall bz_trie_flatten(__int64 a1, __int64 a2)
{
unsigned __int64 v3; // rbp
void *v4; // r13
__int64 v5; // r12
__int64 v6; // rax
void *v7; // rdi
__int64 v8; // rax

bz_barf_push_function("bz_trie_flatten");
if ( a1 && *(_QWORD *)(a1 + 8) )
{
v3 = 0LL;
v4 = &bz_Empty_value;
do
{
v5 = bz_string_copy(a2);
bz_string_cat_wchar(v5, *(unsigned int *)(*(_QWORD *)(a1 + 16) + 24 * v3));
v6 = 24 * v3 + *(_QWORD *)(a1 + 16);
if ( *(_QWORD *)(v6 + 8) )
{
v4 = (void *)bz_list_cons(v4, v5);
v6 = 24 * v3 + *(_QWORD *)(a1 + 16);
}
v7 = *(void **)(v6 + 16);
if ( v7 )
{
v8 = bz_trie_flatten(v7, v5);
v7 = v4;
v4 = (void *)bz_list_concat(v4, v8);
}
++v3;
}
while ( *(_QWORD *)(a1 + 8) > v3 );
bz_barf_pop_function(v7);
}
else
{
v4 = &bz_Empty_value;
bz_barf_pop_function("bz_trie_flatten");
}
return v4;
}

canonical_decompiled_code:
void *__fastcall func8(__int64 a1, __int64 a2)
{
unsigned __int64 v3; // rbp
void *v4; // r13
__int64 v5; // r12
__int64 v6; // rax
void *v7; // rdi
__int64 v8; // rax

bz_barf_push_function("bz_trie_flatten");
if ( a1 && *(_QWORD *)(a1 + 8) )
{
v3 = 0LL;
v4 = &bz_Empty_value;
do
{
v5 = bz_string_copy(a2);
bz_string_cat_wchar(v5, *(unsigned int *)(*(_QWORD *)(a1 + 16) + 24 * v3));
v6 = 24 * v3 + *(_QWORD *)(a1 + 16);
if ( *(_QWORD *)(v6 + 8) )
{
v4 = (void *)bz_list_cons(v4, v5);
v6 = 24 * v3 + *(_QWORD *)(a1 + 16);
}
v7 = *(void **)(v6 + 16);
if ( v7 )
{
v8 = func8(v7, v5);
v7 = v4;
v4 = (void *)bz_list_concat(v4, v8);
}
++v3;
}
while ( *(_QWORD *)(a1 + 8) > v3 );
bz_barf_pop_function(v7);
}
else
{
v4 = &bz_Empty_value;
bz_barf_pop_function("bz_trie_flatten");
}
return v4;
}

original_code:
bz_List* bz_trie_flatten(bz_trie* T, bz_String* s)
{
  {bz_barf_push_function(__PRETTY_FUNCTION__);;};
  if (T == ((void *)0))
    {;bz_barf_pop_function();return (((void *)&bz_Empty_value));};
  if (T->length == 0)
    {;bz_barf_pop_function();return (((void *)&bz_Empty_value));};
  bz_List* L = ((void *)&bz_Empty_value);
  int i;
  for (i=0; i < T->length ;i++) {
    bz_String* name = bz_string_copy(s);
    bz_string_cat_wchar(name,T->nodes[i].c);
    if (T->nodes[i].data) {
      L = bz_list_cons(L,name);
    }
    if (T->nodes[i].next) {
      L = bz_list_concat(L,bz_trie_flatten(T->nodes[i].next,name));
    }
  }
  {;bz_barf_pop_function();return (L);};
}

canonical_original_code:
struct bz_list_node *bz_trie_flatten(struct bz_trie *T, struct bz_String *s)
{
  {bz_barf_push_function(__PRETTY_FUNCTION__);;};
  if (T == ((void *)0))
    {;bz_barf_pop_function();return (((void *)&bz_Empty_value));};
  if (T->length == 0)
    {;bz_barf_pop_function();return (((void *)&bz_Empty_value));};
  struct bz_list_node *L = ((void *)&bz_Empty_value);
  int i;
  for (i=0; i < T->length ;i++) {
    struct bz_String *name = bz_string_copy(s);
    bz_string_cat_wchar(name,T->nodes[i].c);
    if (T->nodes[i].data) {
      L = bz_list_cons(L,name);
    }
    if (T->nodes[i].next) {
      L = bz_list_concat(L,bz_trie_flatten(T->nodes[i].next,name));
    }
  }
  {;bz_barf_pop_function();return (L);};
}

variable_types: struct bz_String { struct bz_Type *type; unsigned long buffer_size; unsigned long length; int *string; } *

variable_types: struct bz_String { struct bz_Type { int *name; unsigned long size; void *(*new)(); void *(*clone)(); int (*length)(); int (*charsize)(); int (*compare)(); void *(*to_integer)(); void *(*to_real)(); void *(*to_string)(); void *(*to_list)(); void *(*to_wstr)(); void *(*show)(); } *type; unsigned long buffer_size; unsigned long length; int *string; } *


decompiled_code:
__int64 __fastcall bz_lazy_new(__int64 (__fastcall *a1)(__int64), __int64 a2)
{
bz_barf_push_function("bz_lazy_new");
bz_barf_pop_function();
return a1(a2);
}

canonical_decompiled_code:
__int64 __fastcall func0(__int64 (__fastcall *a1)(__int64), __int64 a2)
{
bz_barf_push_function("bz_lazy_new");
bz_barf_pop_function();
return a1(a2);
}

original_code:
bz_Lazy* bz_lazy_new(const bz_Lazy* (*next)(),void* arg)
{
   {bz_barf_push_function(__PRETTY_FUNCTION__);;};
   {;bz_barf_pop_function();return ((bz_Lazy* )next(arg));};
}

canonical_original_code:
struct bz_lazy_node *bz_lazy_new(struct bz_lazy_node *(*next)(), void *arg)
{
   {bz_barf_push_function(__PRETTY_FUNCTION__);;};
   {;bz_barf_pop_function();return ((struct bz_lazy_node * )next(arg));};
}

variable_types:
next
struct bz_lazy_node *(*)()

variable_types:
arg
void *

return_type: struct bz_lazy_node { struct bz_Type { int *name; unsigned long size; void *(*new)(); void *(*clone)(); int (*length)(); int (*charsize)(); int (*compare)(); void *(*to_integer)(); void *(*to_real)(); void *(*to_string)(); void *(*to_list)(); void *(*to_wstr)(); void *(*show)(); } *type; void *node; void *(*next)(); void *arg; } *

user_defined_types: struct bz_lazy_node { struct bz_Type *type; void *node; void *(*next)(); void *arg; }


decompiled_code:
__int64 __fastcall bz_lazy_length(void *a1)
{
__int64 v1; // r12
__int64 v2; // rax
__int64 (__fastcall *v3)(_QWORD); // rdx

v1 = 0LL;
bz_barf_push_function("bz_lazy_length");
v2 = (__int64)a1;
if ( a1 != &bz_Empty_value )
{
LODWORD(v1) = 0;
do
{
v3 = *(__int64 (__fastcall **)(_QWORD))(v2 + 16);
if ( (char *)v3 == (char *)&bz_Empty_value )
break;
LODWORD(v1) = v1 + 1;
v2 = v3(*(_QWORD *)(v2 + 24));
}
while ( (_UNKNOWN *)v2 != &bz_Empty_value );
v1 = (int)v1;
}
bz_barf_pop_function();
return v1;
}

canonical_decompiled_code:
__int64 __fastcall func1(void *a1)
{
__int64 v1; // r12
__int64 v2; // rax
__int64 (__fastcall *v3)(_QWORD); // rdx

v1 = 0LL;
bz_barf_push_function("bz_lazy_length");
v2 = (__int64)a1;
if ( a1 != &bz_Empty_value )
{
LODWORD(v1) = 0;
do
{
v3 = *(__int64 (__fastcall **)(_QWORD))(v2 + 16);
if ( (char *)v3 == (char *)&bz_Empty_value )
break;
LODWORD(v1) = v1 + 1;
v2 = v3(*(_QWORD *)(v2 + 24));
}
while ( (_UNKNOWN *)v2 != &bz_Empty_value );
v1 = (int)v1;
}
bz_barf_pop_function();
return v1;
}

original_code:
size_t bz_lazy_length(bz_Lazy* xs)
{
   int n = 0;
   {bz_barf_push_function(__PRETTY_FUNCTION__);;};
   while((xs != ((void *)&bz_Empty_value)) && (xs->next != ((void *)&bz_Empty_value))) {
      n++;
      xs = xs->next(xs->arg);
   }
   {;bz_barf_pop_function();return (n);};
}

canonical_original_code:
unsigned long bz_lazy_length(struct bz_lazy_node *xs)
{
   int n = 0;
   {bz_barf_push_function(__PRETTY_FUNCTION__);;};
   while((xs != ((void *)&bz_Empty_value)) && (xs->next != ((void *)&bz_Empty_value))) {
      n++;
      xs = xs->next(xs->arg);
   }
   {;bz_barf_pop_function();return (n);};
}

variable_types: struct bz_lazy_node { struct bz_Type { int *name; unsigned long size; void *(*new)(); void *(*clone)(); int (*length)(); int (*charsize)(); int (*compare)(); void *(*to_integer)(); void *(*to_real)(); void *(*to_string)(); void *(*to_list)(); void *(*to_wstr)(); void *(*show)(); } *type; void *node; void *(*next)(); void *arg; } *

variable_types: n int


decompiled_code:
__int64 __fastcall bz_lazy_charsize(__int64 a1)
{
int v1; // ebx

bz_barf_push_function("bz_lazy_charsize");
v1 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 8) + 40LL))(*(_QWORD *)(a1 + 8));
bz_barf_pop_function();
return v1;
}

canonical_decompiled_code:
__int64 __fastcall func2(__int64 a1)
{
int v1; // ebx

bz_barf_push_function("bz_lazy_charsize");
v1 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 8) + 40LL))(*(_QWORD *)(a1 + 8));
bz_barf_pop_function();
return v1;
}

original_code:
size_t bz_lazy_charsize(bz_Lazy* xs)
{
   int n = 0;
   {bz_barf_push_function(__PRETTY_FUNCTION__);;};
   n = ((bz_Type *)((bz_node *)xs->node)->type)->charsize(xs->node);
   {;bz_barf_pop_function();return (n);};
}

canonical_original_code:
unsigned long bz_lazy_charsize(struct bz_lazy_node *xs)
{
   int n = 0;
   {bz_barf_push_function(__PRETTY_FUNCTION__);;};
   n = ((struct bz_Type *)((struct bz_node *)xs->node)->type)->charsize(xs->node);
   {;bz_barf_pop_function();return (n);};
}


decompiled_code:
void *bz_lazy_copy()
{
bz_barf_push_function("bz_lazy_copy");
bz_barf_pop_function();
return &bz_Empty_value;
}

canonical_decompiled_code:
void *func3()
{
bz_barf_push_function("bz_lazy_copy");
bz_barf_pop_function();
return &bz_Empty_value;
}

original_code:
bz_Lazy* bz_lazy_copy(bz_Lazy* xs)
{
   {bz_barf_push_function(__PRETTY_FUNCTION__);;};
   {;bz_barf_pop_function();return (((void *)&bz_Empty_value));};
}

canonical_original_code:
struct bz_lazy_node *bz_lazy_copy(struct bz_lazy_node *xs)
{
   {bz_barf_push_function(__PRETTY_FUNCTION__);;};
   {;bz_barf_pop_function();return (((void *)&bz_Empty_value));};
}

variable_types:
xs
struct bz_lazy_node *


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

if ( a1 != &bz_Empty_value )
{
v1 = (__int64)a1;
do
{
wprintf("%", *(unsigned int *)(v1 + 8));
v1 = (*(__int64 (__fastcall **)(_QWORD))(v1 + 16))(*(_QWORD *)(v1 + 24));
}
while ( (_UNKNOWN *)v1 != &bz_Empty_value );
}
}

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

if ( a1 != &bz_Empty_value )
{
v1 = (__int64)a1;
do
{
wprintf("%", *(unsigned int *)(v1 + 8));
v1 = (*(__int64 (__fastcall **)(_QWORD))(v1 + 16))(*(_QWORD *)(v1 + 24));
}
while ( (_UNKNOWN *)v1 != &bz_Empty_value );
}
}

original_code:
void bz_lazy_show(bz_Lazy* xs)
{
   if(xs != ((void *)&bz_Empty_value)) {
      wprintf(L"%i",(int)xs->node);
      bz_lazy_show(xs->next(xs->arg));
   }
}

canonical_original_code:
void bz_lazy_show(struct bz_lazy_node *xs)
{
   if(xs != ((void *)&bz_Empty_value)) {
      wprintf(L"%i",(int)xs->node);
      bz_lazy_show(xs->next(xs->arg));
   }
}


decompiled_code:
void __fastcall bz_lazy_filter(__int64 a1, __int64 a2)
{
_QWORD *v2; // rbp

v2 = malloc(8uLL);
if ( !v2 )
bz_barf("Out of memory");
*v2 = a1;
v2[1] = a2;
filter();
}

canonical_decompiled_code:
void __fastcall func6(__int64 a1, __int64 a2)
{
_QWORD *v2; // rbp

v2 = malloc(8uLL);
if ( !v2 )
bz_barf("Out of memory");
*v2 = a1;
v2[1] = a2;
func4();
}

original_code:
bz_Lazy* bz_lazy_filter(void* f, bz_Lazy* xs)
{
   filter_arg* arg = malloc(sizeof(arg));
   if(!arg) bz_barf("Out of memory");
   arg->f = f;
   arg->xs = xs;
   return _filter(arg);
}

canonical_original_code:
struct bz_lazy_node *bz_lazy_filter(void *f, struct bz_lazy_node *xs)
{
   struct filter_arg *arg = malloc(sizeof(arg));
   if(!arg) bz_barf("Out of memory");
   arg->f = f;
   arg->xs = xs;
   return _filter(arg);
}

variable_types:
f
void *

variable_types: struct filter_arg { void *(*f)(); void *xs; } *


decompiled_code:
__int64 bz_integer_length()
{
return 1LL;
}

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

original_code:
size_t bz_integer_length(bz_Integer* I)
{
  return 1;
}

canonical_original_code:
unsigned long bz_integer_length(struct bz_Integer *I)
{
  return 1;
}

variable_types: struct bz_Integer { struct bz_Type { int *name; unsigned long size; void *(*new)(); void *(*clone)(); int (*length)(); int (*charsize)(); int (*compare)(); void *(*to_integer)(); void *(*to_real)(); void *(*to_string)(); void *(*to_list)(); void *(*to_wstr)(); void *(*show)(); } *type; long long value; } *


decompiled_code:
__int64 __fastcall bz_integer_compare(__int64 a1, __int64 a2)
{
return (unsigned int)*(_QWORD *)(a1 + 8) - *(_DWORD *)(a2 + 8);
}

canonical_decompiled_code:
__int64 __fastcall func1(__int64 a1, __int64 a2)
{
return (unsigned int)*(_QWORD *)(a1 + 8) - *(_DWORD *)(a2 + 8);
}

original_code:
int bz_integer_compare(bz_Integer* x, bz_Integer* y)
{
  return x->value - y->value;
}

canonical_original_code:
int bz_integer_compare(struct bz_Integer *x, struct bz_Integer *y)
{
  return x->value - y->value;
}

variable_types:
y
struct bz_Integer *


original_code:
size_t bz_integer_charsize(bz_Integer* I)
{
  return ( (I->value == 0) ? 1 : (floor( log10( abs(I->value) ) ) + 1 + (I->value < 0 ? 1 : 0)) );
}

canonical_original_code:
unsigned long bz_integer_charsize(struct bz_Integer *I)
{
  return ( (I->value == 0) ? 1 : (floor( log10( abs(I->value) ) ) + 1 + (I->value < 0 ? 1 : 0)) );
}


decompiled_code:
int bz_integer_show()
{
struct _IO_FILE *v0; // rbp
const wchar_t *v1; // rax

v0 = stdout;
v1 = (const wchar_t *)bz_integer_to_wstr();
return fputws(v1, v0);
}

canonical_decompiled_code:
int func3()
{
struct _IO_FILE *v0; // rbp
const wchar_t *v1; // rax

v0 = stdout;
v1 = (const wchar_t *)bz_integer_to_wstr();
return fputws(v1, v0);
}

original_code:
void bz_integer_show(bz_Integer* I)
{
  fputws(bz_integer_to_wstr(I),stdout);
}

canonical_original_code:
void bz_integer_show(struct bz_Integer *I)
{
  fputws(bz_integer_to_wstr(I),stdout);
}


decompiled_code:
__int64 bz_nvp_length()
{
return 1LL;
}

original_code:
size_t bz_nvp_length(bz_Nvp* xs)
{
  return 1;
}

canonical_original_code:
unsigned long bz_nvp_length(struct bz_Nvp *xs)
{
  return 1;
}

variable_types: struct bz_Nvp { struct bz_Type { int *name; unsigned long size; void *(*new)(); void *(*clone)(); int (*length)(); int (*charsize)(); int (*compare)(); void *(*to_integer)(); void *(*to_real)(); void *(*to_string)(); void *(*to_list)(); void *(*to_wstr)(); void *(*show)(); } *type; struct bz_String { struct bz_Type *type; unsigned long buffer_size; unsigned long length; int *string; } *name; void *value; struct bz_String *filename; int line; } *

user_defined_types: struct bz_Nvp { struct bz_Type *type; struct bz_String *name; void *value; struct bz_String *filename; int line; }


decompiled_code:
__int64 __fastcall bz_nvp_charsize(__int64 a1)
{
return bz_string_length(*(_QWORD *)(a1 + 8));
}

canonical_decompiled_code:
__int64 __fastcall func1(__int64 a1)
{
return bz_string_length(*(_QWORD *)(a1 + 8));
}

original_code:
size_t bz_nvp_charsize(bz_Nvp* n)
{
  return bz_string_length(n->name);
}

canonical_original_code:
unsigned long bz_nvp_charsize(struct bz_Nvp *n)
{
  return bz_string_length(n->name);
}


decompiled_code:
__int64 __fastcall bz_nvp_show(__int64 a1)
{
return bz_string_show(*(_QWORD *)(a1 + 8));
}

canonical_decompiled_code:
__int64 __fastcall func2(__int64 a1)
{
return bz_string_show(*(_QWORD *)(a1 + 8));
}

original_code:
void bz_nvp_show(bz_Nvp* n)
{
  bz_string_show(n->name);
}

canonical_original_code:
void bz_nvp_show(struct bz_Nvp *n)
{
  bz_string_show(n->name);
}


decompiled_code:
int bz_trace_cleanup()
{
return fclose(bz_trace_log_file);
}

canonical_decompiled_code:
int func0()
{
return fclose(bz_trace_log_file);
}

original_code:
void bz_trace_cleanup(void)
{
  fclose(bz_trace_log_file);
}

canonical_original_code:
void bz_trace_cleanup()
{
  fclose(bz_trace_log_file);
}