decompiled_code:
void __fastcall Gr_MemFree(unsigned __int64 a1, __int64 *a2)
{
_QWORD *v2; // rbx
int v3; // er12
void *v4; // rdx
__int16 v5; // r13

v2 = (_QWORD *)(a1 & 0xFFFFFFFFFFFFF000LL);
v3 = *(_DWORD *)((char *)list_add + (a1 & 0xFFFFFFFFFFFFF000LL) + 1);
if ( pages_idx_free_pos <= v3 || v3 < 0 )
{
Gr_Free((void *)a1);
}
else
{
v4 = pages_idx_array;
if ( *((_QWORD **)pages_idx_array + v3) == v2 )
{
if ( (a1 & 7) != 0 )
_assert_fail("!((unsigned long)ptr&GR_MEM_ALIGN_LOW_MASK)", "memory.c", 0xF8u, "Gr_MemFree");
if ( *(__int16 *)((char *)&loc_1B + (a1 & 0xFFFFFFFFFFFFF000LL) + 1) > 31 )
{
fprintf(stderr, "%s::%s(Line %d):", "memory.c", "Gr_MemFree", 250LL);
fprintf(stderr, "%s(%s,", "BUG_ON", "h->p_slot_idx>=(256>>3)");
fprintf(
stderr,
"h->p_slot_idx=%d,Max=%d",
(unsigned int)*(__int16 *)((char *)&loc_1B + (a1 & 0xFFFFFFFFFFFFF000LL) + 1),
32LL);
a2 = (_QWORD *)(INIT_LIST_HEAD + 1);
fwrite(")\n", 1uLL, 2uLL, stderr);
}
v5 = *(_WORD *)((char *)&loc_1B + (a1 & 0xFFFFFFFFFFFFF000LL) + 1);
if ( *(_WORD *)((char *)&loc_1B + (a1 & 0xFFFFFFFFFFFFF000LL) + 3) == word_6AC[24 * v5] )
{
list_del((__int64)v2);
a2 = (__int64 *)((char *)&slots + 48 * v5);
list_add_tail(v2, a2);
}
--*(_WORD *)((char *)&loc_1B + (a1 & 0xFFFFFFFFFFFFF000LL) + 3);
*(_QWORD *)a1 = *(_QWORD *)((char *)&loc_F + (a1 & 0xFFFFFFFFFFFFF000LL) + 1);
*(_QWORD *)((char *)&loc_F + (a1 & 0xFFFFFFFFFFFFF000LL) + 1) = a1;
if ( !*(_WORD *)((char *)&loc_1B + (a1 & 0xFFFFFFFFFFFFF000LL) + 3) )
{
if ( (_QWORD *)qword_6A0[6 * v5] == v2 )
qword_6A0[6 * v5] = 0LL;
else
list_del((__int64)v2);
Gr_FreePage(v2, a2, v4);
pages_idx_free(v3);
}
}
else
{
Gr_Free((void *)a1);
}
}
}

canonical_decompiled_code:
void __fastcall func14(unsigned __int64 a1, __int64 *a2)
{
_QWORD *v2; // rbx
int v3; // er12
void *v4; // rdx
__int16 v5; // r13

v2 = (_QWORD *)(a1 & 0xFFFFFFFFFFFFF000LL);
v3 = *(_DWORD *)((char *)list_add + (a1 & 0xFFFFFFFFFFFFF000LL) + 1);
if ( pages_idx_free_pos <= v3 || v3 < 0 )
{
func9((void *)a1);
}
else
{
v4 = pages_idx_array;
if ( *((_QWORD **)pages_idx_array + v3) == v2 )
{
if ( (a1 & 7) != 0 )
_assert_fail("!((unsigned long)ptr&GR_MEM_ALIGN_LOW_MASK)", "memory.c", 0xF8u, "Gr_MemFree");
if ( *(__int16 *)((char *)&loc_1B + (a1 & 0xFFFFFFFFFFFFF000LL) + 1) > 31 )
{
fprintf(stderr, "%s::%s(Line %d):", "memory.c", "Gr_MemFree", 250LL);
fprintf(stderr, "%s(%s,", "BUG_ON", "h->p_slot_idx>=(256>>3)");
fprintf(
stderr,
"h->p_slot_idx=%d,Max=%d",
(unsigned int)*(__int16 *)((char *)&loc_1B + (a1 & 0xFFFFFFFFFFFFF000LL) + 1),
32LL);
a2 = (_QWORD *)(INIT_LIST_HEAD + 1);
fwrite(")\n", 1uLL, 2uLL, stderr);
}
v5 = *(_WORD *)((char *)&loc_1B + (a1 & 0xFFFFFFFFFFFFF000LL) + 1);
if ( *(_WORD *)((char *)&loc_1B + (a1 & 0xFFFFFFFFFFFFF000LL) + 3) == word_6AC[24 * v5] )
{
func5((__int64)v2);
a2 = (__int64 *)((char *)&slots + 48 * v5);
func3(v2, a2);
}
--*(_WORD *)((char *)&loc_1B + (a1 & 0xFFFFFFFFFFFFF000LL) + 3);
*(_QWORD *)a1 = *(_QWORD *)((char *)&loc_F + (a1 & 0xFFFFFFFFFFFFF000LL) + 1);
*(_QWORD *)((char *)&loc_F + (a1 & 0xFFFFFFFFFFFFF000LL) + 1) = a1;
if ( !*(_WORD *)((char *)&loc_1B + (a1 & 0xFFFFFFFFFFFFF000LL) + 3) )
{
if ( (_QWORD *)qword_6A0[6 * v5] == v2 )
qword_6A0[6 * v5] = 0LL;
else
func5((__int64)v2);
Gr_FreePage(v2, a2, v4);
func8(v3);
}
}
else
{
func9((void *)a1);
}
}
}

original_code:
void Gr_MemFree(void* ptr)
{
 register struct block_header* b=(struct block_header*)ptr;
 register struct page_header* h=(struct page_header*)((unsigned long)(ptr) & (~((1ul<<12)-1)));
 ((void) sizeof (((!((unsigned long)(h) &((1ul<<12)-1)))) ? 1 : 0), __extension__ ({ if ((!((unsigned long)(h) &((1ul<<12)-1)))) ; else __assert_fail ("GR_PAGE_ALIGNED(h)", "memory.c", 222, __extension__ __PRETTY_FUNCTION__); }));
 register struct slot_header* s;
 register int page_idx=h->p_page_idx;
 if(page_idx>=pages_idx_free_pos||page_idx<0)
 {
  Gr_Free(ptr);
  return ;
 }
 if(pages_idx_array[page_idx]!=(void*)h)
 {
  Gr_Free(ptr);
  return;
 }
 ((void) sizeof ((!((unsigned long)ptr&((1ul<<3)-1))) ? 1 : 0), __extension__ ({ if (!((unsigned long)ptr&((1ul<<3)-1))) ; else __assert_fail ("!((unsigned long)ptr&GR_MEM_ALIGN_LOW_MASK)", "memory.c", 248, __extension__ __PRETTY_FUNCTION__); }));
 do{ if(h->p_slot_idx>=(256>>3)) { fprintf(stderr,"%s::%s(Line %d):","memory.c",__func__,250); fprintf(stderr,"%s(%s,","BUG_ON","h->p_slot_idx>=(256>>3)"); fprintf(stderr,"h->p_slot_idx=%d,Max=%d", h->p_slot_idx,(256>>3)); fprintf(stderr,")\n"); } }while(0);
 s=&slots[h->p_slot_idx];
 if(h->p_block_used==s->s_block_nu)
 {
  list_del(&h->p_link);
  list_add_tail(&h->p_link,&s->s_free_page);
 }
 h->p_block_used--;
 b->b_next=h->p_free_block;
 h->p_free_block=b;
 if((h->p_block_used==0))
 {
  if(s->s_cur==h)
  {
   s->s_cur=((void *)0);
  }
  else
  {
   list_del(&h->p_link);
  }
  Gr_FreePage(h);
  pages_idx_free(page_idx);
 }
}

canonical_original_code:
void Gr_MemFree(void *ptr)
{
 register struct block_header *b = (struct block_header*)ptr;
 register struct page_header *h = (struct page_header*)((unsigned long)(ptr) & (~((1ul<<12)-1)));
 ((void) sizeof (((!((unsigned long)(h) &((1ul<<12)-1)))) ? 1 : 0), __extension__ ({ if ((!((unsigned long)(h) &((1ul<<12)-1)))) ; else __assert_fail ("GR_PAGE_ALIGNED(h)", "memory.c", 222, __extension__ __PRETTY_FUNCTION__); }));
 register struct slot_header *s;
 register int page_idx = h->p_page_idx;
 if(page_idx>=pages_idx_free_pos||page_idx<0)
 {
  Gr_Free(ptr);
  return ;
 }
 if(pages_idx_array[page_idx]!=(void *)h)
 {
  Gr_Free(ptr);
  return;
 }
 ((void) sizeof ((!((unsigned long)ptr&((1ul<<3)-1))) ? 1 : 0), __extension__ ({ if (!((unsigned long)ptr&((1ul<<3)-1))) ; else __assert_fail ("!((unsigned long)ptr&GR_MEM_ALIGN_LOW_MASK)", "memory.c", 248, __extension__ __PRETTY_FUNCTION__); }));
 do{ if(h->p_slot_idx>=(256>>3)) { fprintf(stderr,"%s::%s(Line %d):","memory.c",__func__,250); fprintf(stderr,"%s(%s,","BUG_ON","h->p_slot_idx>=(256>>3)"); fprintf(stderr,"h->p_slot_idx=%d,Max=%d", h->p_slot_idx,(256>>3)); fprintf(stderr,")\n"); } }while(0);
 s=&slots[h->p_slot_idx];
 if(h->p_block_used==s->s_block_nu)
 {
  list_del(&h->p_link);
  list_add_tail(&h->p_link,&s->s_free_page);
 }
 h->p_block_used--;
 b->b_next=h->p_free_block;
 h->p_free_block=b;
 if((h->p_block_used==0))
 {
  if(s->s_cur==h)
  {
   s->s_cur=((void *)0);
  }
  else
  {
   list_del(&h->p_link);
  }
  Gr_FreePage(h);
  pages_idx_free(page_idx);
 }
}

variable_types: struct page_header { struct list_head { struct list_head *prev; struct list_head *next; } p_link; struct block_header { struct block_header *b_next; } *p_free_block; int p_page_idx; short p_slot_idx; short p_block_used; unsigned long p_free_pos; } *

variable_types: struct slot_header { struct list_head { struct list_head *prev; struct list_head *next; } s_free_page; struct list_head s_full_page; struct page_header { struct list_head p_link; struct block_header { struct block_header *b_next; } *p_free_block; int p_page_idx; short p_slot_idx; short p_block_used; unsigned long p_free_pos; } *s_cur; short s_block_size; short s_alloc_offset; short s_block_nu; } *

user_defined_types: struct page_header { struct list_head p_link; struct block_header *p_free_block; int p_page_idx; short p_slot_idx; short p_block_used; unsigned long p_free_pos; }

user_defined_types: struct slot_header { struct list_head s_free_page; struct list_head s_full_page; struct page_header *s_cur; short s_block_size; short s_alloc_offset; short s_block_nu; }


repo: NosicLin/Codger

decompiled_code:
__int64 GrModule_MemInit()
{
char *v0; // rbx
unsigned __int64 v1; // rbp

pages_idx_array = Gr_Alloc(0x2000uLL);
if ( !pages_idx_array )
return 0xFFFFFFFFLL;
v0 = (char *)&slots;
v1 = 8LL;
do
{
INIT_LIST_HEAD(v0);
INIT_LIST_HEAD((_QWORD *)v0 + 2);
*((_QWORD *)v0 + 4) = 0LL;
*((_WORD *)v0 + 20) = v1;
*((_WORD *)v0 + 21) = 40;
*((_WORD *)v0 + 22) = 0xFD8 / v1;
v0 += 48;
v1 += 8LL;
}
while ( v0 != "memory.c" );
return 0LL;
}

canonical_decompiled_code:
__int64 func15()
{
char *v0; // rbx
unsigned __int64 v1; // rbp

pages_idx_array = func7(0x2000uLL);
if ( !pages_idx_array )
return 0xFFFFFFFFLL;
v0 = (char *)&slots;
v1 = 8LL;
do
{
func0(v0);
func0((_QWORD *)v0 + 2);
*((_QWORD *)v0 + 4) = 0LL;
*((_WORD *)v0 + 20) = v1;
*((_WORD *)v0 + 21) = 40;
*((_WORD *)v0 + 22) = 0xFD8 / v1;
v0 += 48;
v1 += 8LL;
}
while ( v0 != "memory.c" );
return 0LL;
}

original_code:
int GrModule_MemInit()
{
 pages_idx_array=(void**)Gr_Alloc(1024*sizeof(void*));
 if(pages_idx_array==((void *)0))
 {
  return -1;
 }
 int i=0;
 struct slot_header* s;
 for(i=0;i<(256>>3);i++)
 {
  s=&slots[i];
  INIT_LIST_HEAD(&s->s_free_page);
  INIT_LIST_HEAD(&s->s_full_page);
  s->s_cur=((void *)0);
  s->s_block_size=(i+1)<<3;
  s->s_alloc_offset=((~((1ul<<3)-1))&((sizeof(struct page_header))+((1ul<<3)-1)));
  s->s_block_nu=((1ul<<12)-s->s_alloc_offset)/s->s_block_size;
 }
 return 0;
}

canonical_original_code:
int GrModule_MemInit()
{
 pages_idx_array=(void **)Gr_Alloc(1024*sizeof(void *));
 if(pages_idx_array==((void *)0))
 {
  return -1;
 }
 int i = 0;
 struct slot_header *s;
 for(i=0;i<(256>>3);i++)
 {
  s=&slots[i];
  INIT_LIST_HEAD(&s->s_free_page);
  INIT_LIST_HEAD(&s->s_full_page);
  s->s_cur=((void *)0);
  s->s_block_size=(i+1)<<3;
  s->s_alloc_offset=((~((1ul<<3)-1))&((sizeof(struct page_header))+((1ul<<3)-1)));
  s->s_block_nu=((1ul<<12)-s->s_alloc_offset)/s->s_block_size;
 }
 return 0;
}

variable_types: i int

return_type: int

user_defined_types: struct list_head { struct list_head *prev; struct list_head *next; }

user_defined_types: struct block_header { struct block_header *b_next; }


decompiled_code:
__int64 GrModule_MemExit()
{
if ( pages_idx_array )
{
Gr_Free(pages_idx_array);
pages_idx_array = 0LL;
}
return 0LL;
}

canonical_decompiled_code:
__int64 func16()
{
if ( pages_idx_array )
{
func9(pages_idx_array);
pages_idx_array = 0LL;
}
return 0LL;
}

original_code:
int GrModule_MemExit()
{
 if(pages_idx_array)
 {
  Gr_Free(pages_idx_array);
  pages_idx_array=((void *)0);
 }
 return 0;
}


decompiled_code:
void __fastcall list_add(_QWORD *a1, __int64 a2)
{
_list_add(a1, a2, *(_QWORD **)(a2 + 8));
}

canonical_decompiled_code:
void __fastcall func2(_QWORD *a1, __int64 a2)
{
func1(a1, a2, *(_QWORD **)(a2 + 8));
}

original_code:
static inline void list_add(struct list_head *new_list, struct list_head *head)
{
 __list_add(new_list, head, head->next);
}

variable_types: struct list_head { struct list_head *prev; struct list_head *next; } *

variable_types:
head
struct list_head *

return_type: void


original_code:
static struct area_header* alloc_area()
{
 struct area_header* h=(struct area_header*)malloc(sizeof(*h)+1024*1024);
 if(h==((void *)0)) return ((void *)0);
 INIT_LIST_HEAD(&h->a_link);
 h->a_block=(unsigned long)h+sizeof(*h);
 h->a_alloc_start=(((unsigned long)(h->a_block)+((1ul<<12)-1))&(~((1ul<<12)-1)));
 h->a_free_pages=((void *)0);
 h->a_page_nu=(1024*1024 -(h->a_alloc_start-h->a_block))>>12;
 h->a_free_pos=0;
 h->a_page_used=0;
 s_area_nu++;
 return h;
}

canonical_original_code:
static struct area_header *alloc_area()
{
 struct area_header *h = (struct area_header*)malloc(sizeof(*h)+1024*1024);
 if(h==((void *)0)) return ((void *)0);
 INIT_LIST_HEAD(&h->a_link);
 h->a_block=(unsigned long)h+sizeof(*h);
 h->a_alloc_start=(((unsigned long)(h->a_block)+((1ul<<12)-1))&(~((1ul<<12)-1)));
 h->a_free_pages=((void *)0);
 h->a_page_nu=(1024*1024 -(h->a_alloc_start-h->a_block))>>12;
 h->a_free_pos=0;
 h->a_page_used=0;
 s_area_nu++;
 return h;
}

variable_types: struct area_header { struct list_head { struct list_head *prev; struct list_head *next; } a_link; unsigned long a_block; unsigned long a_alloc_start; struct page_header { struct page_header *p_next; } *a_free_pages; int a_page_nu; short a_free_pos; short a_page_used; } *

user_defined_types: struct area_header { struct list_head a_link; unsigned long a_block; unsigned long a_alloc_start; struct page_header *a_free_pages; int a_page_nu; short a_free_pos; short a_page_used; }


decompiled_code:
void __fastcall free_area(_WORD *a1)
{
if ( a1[23] )
_assert_fail("h->a_page_used==0", "mem_base.c", 0x5Fu, "free_area");
if ( s_area_nu <= 0 )
_assert_fail("s_area_nu>0", "mem_base.c", 0x60u, "free_area");
--s_area_nu;
free(a1);
}

canonical_decompiled_code:
void __fastcall func8(_WORD *a1)
{
if ( a1[23] )
_assert_fail("h->a_page_used==0", "mem_base.c", 0x5Fu, "free_area");
if ( s_area_nu <= 0 )
_assert_fail("s_area_nu>0", "mem_base.c", 0x60u, "free_area");
--s_area_nu;
free(a1);
}

original_code:
static void free_area(struct area_header* h)
{
 ((void) sizeof ((h->a_page_used==0) ? 1 : 0), __extension__ ({ if (h->a_page_used==0) ; else __assert_fail ("h->a_page_used==0", "mem_base.c", 95, __extension__ __PRETTY_FUNCTION__); }));
 ((void) sizeof ((s_area_nu>0) ? 1 : 0), __extension__ ({ if (s_area_nu>0) ; else __assert_fail ("s_area_nu>0", "mem_base.c", 96, __extension__ __PRETTY_FUNCTION__); }));
 s_area_nu--;
 free(h);
}

canonical_original_code:
static void free_area(struct area_header *h)
{
 ((void) sizeof ((h->a_page_used==0) ? 1 : 0), __extension__ ({ if (h->a_page_used==0) ; else __assert_fail ("h->a_page_used==0", "mem_base.c", 95, __extension__ __PRETTY_FUNCTION__); }));
 ((void) sizeof ((s_area_nu>0) ? 1 : 0), __extension__ ({ if (s_area_nu>0) ; else __assert_fail ("s_area_nu>0", "mem_base.c", 96, __extension__ __PRETTY_FUNCTION__); }));
 s_area_nu--;
 free(h);
}

user_defined_types: struct page_header { struct page_header *p_next; }


decompiled_code:
int Gr_PrintAreaNum()
{
return printf("AreaNum=%d\n", (unsigned int)s_area_nu);
}

canonical_decompiled_code:
int func11()
{
return printf("AreaNum=%d\n", (unsigned int)s_area_nu);
}

original_code:
void Gr_PrintAreaNum()
{
 printf("AreaNum=%d\n",s_area_nu);
}


decompiled_code:
__int64 yl_cur_string()
{
if ( !yl_scanner )
{
fprintf(stderr, "%s::%s(Line %d):", "yylex.c", "yl_cur_string", 19LL);
fprintf(stderr, "%s(%s,", "BUG_ON", "yl_scanner==0");
fwrite("NULL Scanner", 1uLL, 0xCuLL, stderr);
fwrite(")\n", 1uLL, 2uLL, stderr);
}
return sc_token_string(yl_scanner);
}

canonical_decompiled_code:
__int64 func3()
{
if ( !yl_scanner )
{
fprintf(stderr, "%s::%s(Line %d):", "yylex.c", "yl_cur_string", 19LL);
fprintf(stderr, "%s(%s,", "BUG_ON", "yl_scanner==0");
fwrite("NULL Scanner", 1uLL, 0xCuLL, stderr);
fwrite(")\n", 1uLL, 2uLL, stderr);
}
return func0(yl_scanner);
}

original_code:
char* yl_cur_string()
{
 do{ if(yl_scanner==0) { fprintf(stderr,"%s::%s(Line %d):","yylex.c",__func__,19); fprintf(stderr,"%s(%s,","BUG_ON","yl_scanner==0"); fprintf(stderr,"NULL Scanner"); fprintf(stderr,")\n"); } }while(0);
 return sc_token_string(yl_scanner);
}

canonical_original_code:
char *yl_cur_string()
{
 do{ if(yl_scanner==0) { fprintf(stderr,"%s::%s(Line %d):","yylex.c",__func__,19); fprintf(stderr,"%s(%s,","BUG_ON","yl_scanner==0"); fprintf(stderr,"NULL Scanner"); fprintf(stderr,")\n"); } }while(0);
 return sc_token_string(yl_scanner);
}

return_type: char *


decompiled_code:
void yl_ignore_newline()
{
++ignore_newline;
}

canonical_decompiled_code:
void func6()
{
++ignore_newline;
}

original_code:
void yl_ignore_newline()
{
 ignore_newline+=1;
}


decompiled_code:
void yl_restore_newline()
{
--ignore_newline;
}

canonical_decompiled_code:
void func7()
{
--ignore_newline;
}

original_code:
void yl_restore_newline()
{
 ignore_newline-=1;
}


yyerror

decompiled_code:
int yyerror()
{
return fprintf(stderr, "SyntaxError At Line %d\n", *(unsigned int *)(yl_scanner + 12));
}

canonical_decompiled_code:
int func4()
{
return fprintf(stderr, "SyntaxError At Line %d\n", *(unsigned int *)(yl_scanner + 12));
}

original_code:
void yyerror(char* error)
{
 fprintf(stderr,"SyntaxError At Line %d\n",yl_scanner->s_line);
}

canonical_original_code:
void yyerror(char *error)
{
 fprintf(stderr,"SyntaxError At Line %d\n",yl_scanner->s_line);
}

variable_types:
error
char *


yylex

decompiled_code:
__int64 yylex()
{
__int64 result; // rax
__int64 v1; // rax

if ( !yl_scanner )
{
fprintf(stderr, "%s::%s(Line %d):", "yylex.c", "yylex", 29LL);
fprintf(stderr, "%s(%s,", "BUG_ON", "yl_scanner==0");
fwrite("NULL Scanner", 1uLL, 0xCuLL, stderr);
fwrite(")\n", 1uLL, 2uLL, stderr);
}
do
{
while ( 1 )
{
result = sc_next_token(yl_scanner);
if ( (_DWORD)result == 80 )
break;
if ( (_DWORD)result == 6 )
{
v1 = sc_token_string(yl_scanner);
result = symbol_type(v1);
}
if ( (_DWORD)result == 43 )
break;
if ( (_DWORD)result != 81 )
goto LABEL_8;
}
}
while ( ignore_newline );
result = 43LL;
LABEL_8:
if ( (_DWORD)result != -1 )
result = (unsigned int)(result + 258);
return result;
}

canonical_decompiled_code:
__int64 func5()
{
__int64 result; // rax
__int64 v1; // rax

if ( !yl_scanner )
{
fprintf(stderr, "%s::%s(Line %d):", "yylex.c", "yylex", 29LL);
fprintf(stderr, "%s(%s,", "BUG_ON", "yl_scanner==0");
fwrite("NULL Scanner", 1uLL, 0xCuLL, stderr);
fwrite(")\n", 1uLL, 2uLL, stderr);
}
do
{
while ( 1 )
{
result = sc_next_token(yl_scanner);
if ( (_DWORD)result == 80 )
break;
if ( (_DWORD)result == 6 )
{
v1 = func0(yl_scanner);
result = symbol_type(v1);
}
if ( (_DWORD)result == 43 )
break;
if ( (_DWORD)result != 81 )
goto LABEL_8;
}
}
while ( ignore_newline );
result = 43LL;
LABEL_8:
if ( (_DWORD)result != -1 )
result = (unsigned int)(result + 258);
return result;
}

original_code:
int yylex()
{
 do{ if(yl_scanner==0) { fprintf(stderr,"%s::%s(Line %d):","yylex.c",__func__,29); fprintf(stderr,"%s(%s,","BUG_ON","yl_scanner==0"); fprintf(stderr,"NULL Scanner"); fprintf(stderr,")\n"); } }while(0);
 int token=TOKEN_WS;
 while(1)
 {
  token=sc_next_token(yl_scanner);
  if(token==TOKEN_ANNO)
  {
   token=TOKEN_NEWLINE;
  }
  if(token==TOKEN_ID)
  {
   token=symbol_type(sc_token_string(yl_scanner));
  }
  if(token==TOKEN_NEWLINE)
  {
   if(ignore_newline)
   {
    continue;
   }
  }
  if(token==TOKEN_WS)
  {
   continue;
  }
  break;
 }
 if(token!=(-1))
 {
  token+=258;
 }
 return token;
}

canonical_original_code:
int yylex()
{
 do{ if(yl_scanner==0) { fprintf(stderr,"%s::%s(Line %d):","yylex.c",__func__,29); fprintf(stderr,"%s(%s,","BUG_ON","yl_scanner==0"); fprintf(stderr,"NULL Scanner"); fprintf(stderr,")\n"); } }while(0);
 int token = TOKEN_WS;
 while(1)
 {
  token=sc_next_token(yl_scanner);
  if(token==TOKEN_ANNO)
  {
   token=TOKEN_NEWLINE;
  }
  if(token==TOKEN_ID)
  {
   token=symbol_type(sc_token_string(yl_scanner));
  }
  if(token==TOKEN_NEWLINE)
  {
   if(ignore_newline)
   {
    continue;
   }
  }
  if(token==TOKEN_WS)
  {
   continue;
  }
  break;
 }
 if(token!=(-1))
 {
  token+=258;
 }
 return token;
}

variable_types: token int


yyparse

decompiled_code:
__int64 yyparse()
{
int v0; // ebp
unsigned __int64 v1; // r14
unsigned int *v2; // r12
__int16 *v3; // rbx
__int16 *v4; // r13
int v5; // edx
unsigned int v6; // er15
unsigned __int8 v7; // al
int v8; // er15
int v9; // edx
unsigned __int8 v10; // bp
__int16 *v11; // rcx
int v12; // eax
unsigned int v13; // edx
unsigned __int64 v14; // rax
signed __int64 v15; // r12
__int16 *v16; // rax
__int16 *v17; // r15
int v18; // er15
unsigned __int8 v19; // al
__int16 *v20; // rax
unsigned int v21; // ebp
int v22; // eax
unsigned int v23; // eax
char *v25; // [rsp+8h] [rbp-510h]
int v26; // [rsp+14h] [rbp-504h]
__int64 v27; // [rsp+18h] [rbp-500h]
char *v28; // [rsp+28h] [rbp-4F0h]
char v29[800]; // [rsp+30h] [rbp-4E8h] BYREF
__int16 src[228]; // [rsp+350h] [rbp-1C8h] BYREF

yynerrs = 0;
yychar = -2;
src[0] = 0;
v26 = 0;
v0 = 0;
v1 = 200LL;
v2 = (unsigned int *)v29;
v25 = v29;
v3 = src;
v4 = src;
while ( 1 )
{
v18 = yypact[v0];
if ( v18 == -7 )
break;
if ( yychar == -2 )
yychar = yylex();
if ( yychar <= 0 )
{
yychar = 0;
v5 = 0;
}
else
{
v5 = 2;
if ( (unsigned int)yychar <= 0x103 )
v5 = (unsigned __int8)yytranslate[yychar];
}
v6 = v5 + v18;
if ( v6 > 0x23 || yycheck[v6] != v5 )
break;
v7 = yytable[v6];
if ( v7 )
{
v26 = (v26 == 0) + v26 - 1;
yychar = -2;
v2[1] = yylval;
++v2;
v11 = v3;
v0 = v7;
goto LABEL_11;
}
if ( (unsigned int)v7 + 1 <= 1 )
goto LABEL_43;
v8 = v2[1];
v9 = 0;
v10 = 0;
LABEL_8:
v11 = &v3[-v10];
v2 = &v2[-v10 + 1];
*v2 = v8;
v12 = (unsigned __int8)yyr1[v9] - 13;
v13 = *v11 + yypgoto[v12];
if ( v13 <= 0x23 && *v11 == yycheck[v13] )
v0 = (unsigned __int8)yytable[v13];
else
v0 = yydefgoto[v12];
LABEL_11:
v3 = v11 + 1;
v11[1] = v0;
v14 = 2 * v1;
if ( v11 + 1 >= &v4[v1 - 1] )
{
v15 = (char *)v3 - (char *)v4;
v27 = v3 - v4 + 1;
if ( v1 > 0x270F )
goto LABEL_57;
v1 = 10000LL;
if ( v14 <= 0x2710 )
v1 = v14;
v16 = (__int16 *)malloc(6 * v1 + 3);
v17 = v16;
if ( !v16 )
{
LABEL_57:
yyerror("memory exhausted");
v20 = v3;
v3 = v4;
v21 = 2;
goto LABEL_59;
}
memcpy(v16, v4, v15 + 2);
v28 = (char *)&v17[v1];
memcpy(v28, v25, 4 * v27);
if ( v4 != src )
free(v4);
v3 = (__int16 *)((char *)v17 + v15);
v2 = (unsigned int *)&v28[4 * v27 - 4];
if ( v3 >= &v17[v1 - 1] )
{
if ( v17 == v3 )
{
v3 = v17;
v21 = 1;
goto LABEL_64;
}
v20 = v3;
v3 = v17;
v21 = 1;
goto LABEL_60;
}
v25 = v28;
v4 = v17;
}
if ( v0 == 18 )
{
v20 = v3;
v3 = v4;
v21 = 0;
goto LABEL_59;
}
}
v19 = yydefact[v0];
v9 = v19;
if ( v19 )
{
v10 = yyr2[v19];
v8 = v2[1 - v10];
switch ( v19 )
{
case 5u:
printf("\t%d\n\n", *v2);
v9 = 5;
break;
case 7u:
v8 = *v2 + 10 * *(v2 - 1);
v9 = 7;
break;
case 9u:
v8 = *(v2 - 1);
v9 = 9;
break;
case 0xBu:
v8 = reg[*v2];
v9 = 11;
break;
case 0xDu:
v8 = -*v2;
v9 = 13;
break;
case 0xEu:
v8 = *v2;
v9 = 14;
break;
case 0xFu:
v8 = *v2 * *(v2 - 2);
v9 = 15;
break;
case 0x10u:
v8 = (int)*(v2 - 2) / (int)*v2;
v9 = 16;
break;
case 0x11u:
v8 = *v2;
v9 = 17;
break;
case 0x12u:
v8 = *(v2 - 2) + *v2;
v9 = 18;
break;
case 0x13u:
v8 = *(v2 - 2) - *v2;
v9 = 19;
break;
case 0x14u:
reg[*(v2 - 2)] = *v2;
v9 = 20;
break;
default:
goto LABEL_8;
}
goto LABEL_8;
}
LABEL_43:
if ( !v26 )
{
++yynerrs;
yyerror("syntax error");
goto LABEL_52;
}
if ( v26 == 3 )
{
if ( yychar > 0 )
{
yychar = -2;
goto LABEL_52;
}
if ( !yychar )
{
v20 = v3;
v3 = v4;
v21 = 1;
LABEL_59:
if ( v20 == v3 )
goto LABEL_63;
do
LABEL_60:
--v20;
while ( v20 != v3 );
goto LABEL_63;
}
}
while ( 1 )
{
LABEL_52:
v22 = yypact[v0];
if ( v22 != -7 )
{
v23 = v22 + 1;
if ( v23 <= 0x23 && yycheck[v23] == 1 )
{
v0 = (unsigned __int8)yytable[v23];
if ( yytable[v23] )
{
v2[1] = yylval;
++v2;
v11 = v3;
v26 = 3;
goto LABEL_11;
}
}
}
if ( v3 == v4 )
break;
--v2;
v0 = *--v3;
}
v21 = 1;
LABEL_63:
if ( v3 == src )
return v21;
LABEL_64:
free(v3);
return v21;
}

original_code:
int
yyparse (void)
{
    int yystate;
    int yyerrstatus;
    yytype_int16 yyssa[200];
    yytype_int16 *yyss;
    yytype_int16 *yyssp;
    YYSTYPE yyvsa[200];
    YYSTYPE *yyvs;
    YYSTYPE *yyvsp;
    long unsigned int yystacksize;
  int yyn;
  int yyresult;
  int yytoken;
  YYSTYPE yyval;
  int yylen = 0;
  yytoken = 0;
  yyss = yyssa;
  yyvs = yyvsa;
  yystacksize = 200;
  ;
  yystate = 0;
  yyerrstatus = 0;
  yynerrs = 0;
  yychar = (-2);
  yyssp = yyss;
  yyvsp = yyvs;
  goto yysetstate;
 yynewstate:
  yyssp++;
 yysetstate:
  *yyssp = yystate;
  if (yyss + yystacksize - 1 <= yyssp)
    {
      long unsigned int yysize = yyssp - yyss + 1;
      if (10000 <= yystacksize)
 goto yyexhaustedlab;
      yystacksize *= 2;
      if (10000 < yystacksize)
 yystacksize = 10000;
      {
 yytype_int16 *yyss1 = yyss;
 union yyalloc *yyptr =
   (union yyalloc *) malloc (((yystacksize) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) + (sizeof (union yyalloc) - 1)));
 if (! yyptr)
   goto yyexhaustedlab;
 do { long unsigned int yynewbytes; __builtin_memcpy (&yyptr->yyss_alloc, yyss, (yysize) * sizeof (*(yyss))); yyss = &yyptr->yyss_alloc; yynewbytes = yystacksize * sizeof (*yyss) + (sizeof (union yyalloc) - 1); yyptr += yynewbytes / sizeof (*yyptr); } while ((0));
 do { long unsigned int yynewbytes; __builtin_memcpy (&yyptr->yyvs_alloc, yyvs, (yysize) * sizeof (*(yyvs))); yyvs = &yyptr->yyvs_alloc; yynewbytes = yystacksize * sizeof (*yyvs) + (sizeof (union yyalloc) - 1); yyptr += yynewbytes / sizeof (*yyptr); } while ((0));
 if (yyss1 != yyssa)
   free (yyss1);
      }
      yyssp = yyss + yysize - 1;
      yyvsp = yyvs + yysize - 1;
      ;
      if (yyss + yystacksize - 1 <= yyssp)
 goto yyabortlab;
    }
  ;
  if (yystate == 18)
    goto yyacceptlab;
  goto yybackup;
yybackup:
  yyn = yypact[yystate];
  if (yyn == -7)
    goto yydefault;
  if (yychar == (-2))
    {
      ;
      yychar = yylex ();
    }
  if (yychar <= 0)
    {
      yychar = yytoken = 0;
      ;
    }
  else
    {
      yytoken = ((unsigned int) (yychar) <= 259 ? yytranslate[yychar] : 2);
      ;
    }
  yyn += yytoken;
  if (yyn < 0 || 35 < yyn || yycheck[yyn] != yytoken)
    goto yydefault;
  yyn = yytable[yyn];
  if (yyn <= 0)
    {
      if (yyn == 0 || yyn == -1)
 goto yyerrlab;
      yyn = -yyn;
      goto yyreduce;
    }
  if (yyerrstatus)
    yyerrstatus--;
  ;
  yychar = (-2);
  yystate = yyn;
  *++yyvsp = yylval;
  goto yynewstate;
yydefault:
  yyn = yydefact[yystate];
  if (yyn == 0)
    goto yyerrlab;
  goto yyreduce;
yyreduce:
  yylen = yyr2[yyn];
  yyval = yyvsp[1-yylen];
  ;
  switch (yyn)
    {
        case 5:
    {printf("\t%d\n\n",(yyvsp[(1) - (1)]));}
    break;
  case 7:
    {(yyval)=(yyvsp[(1) - (2)])*10+(yyvsp[(2) - (2)]);}
    break;
  case 9:
    {(yyval)=(yyvsp[(2) - (3)]);}
    break;
  case 11:
    {(yyval)=reg[(yyvsp[(1) - (1)])];}
    break;
  case 13:
    {(yyval)=-(yyvsp[(2) - (2)]);}
    break;
  case 14:
    {(yyval)=(yyvsp[(1) - (1)]);}
    break;
  case 15:
    {(yyval)=(yyvsp[(1) - (3)])*(yyvsp[(3) - (3)]);}
    break;
  case 16:
    {(yyval)=(yyvsp[(1) - (3)])/(yyvsp[(3) - (3)]);}
    break;
  case 17:
    {(yyval)=(yyvsp[(1) - (1)]);}
    break;
  case 18:
    {(yyval)=(yyvsp[(1) - (3)])+(yyvsp[(3) - (3)]);}
    break;
  case 19:
    {(yyval)=(yyvsp[(1) - (3)])-(yyvsp[(3) - (3)]);}
    break;
  case 20:
    {reg[(yyvsp[(1) - (3)])]=(yyvsp[(3) - (3)]);}
    break;
      default: break;
    }
  ;
  (yyvsp -= (yylen), yyssp -= (yylen));
  yylen = 0;
  ;
  *++yyvsp = yyval;
  yyn = yyr1[yyn];
  yystate = yypgoto[yyn - 13] + *yyssp;
  if (0 <= yystate && yystate <= 35 && yycheck[yystate] == *yyssp)
    yystate = yytable[yystate];
  else
    yystate = yydefgoto[yyn - 13];
  goto yynewstate;
yyerrlab:
  if (!yyerrstatus)
    {
      ++yynerrs;
      yyerror ("syntax error");
    }
  if (yyerrstatus == 3)
    {
      if (yychar <= 0)
 {
   if (yychar == 0)
     goto yyabortlab;
 }
      else
 {
   yydestruct ("Error: discarding",
        yytoken, &yylval);
   yychar = (-2);
 }
    }
  goto yyerrlab1;
yyerrorlab:
  if ( 0)
     goto yyerrorlab;
  (yyvsp -= (yylen), yyssp -= (yylen));
  yylen = 0;
  ;
  yystate = *yyssp;
  goto yyerrlab1;
yyerrlab1:
  yyerrstatus = 3;
  for (;;)
    {
      yyn = yypact[yystate];
      if (yyn != -7)
 {
   yyn += 1;
   if (0 <= yyn && yyn <= 35 && yycheck[yyn] == 1)
     {
       yyn = yytable[yyn];
       if (0 < yyn)
  break;
     }
 }
      if (yyssp == yyss)
 goto yyabortlab;
      yydestruct ("Error: popping",
    yystos[yystate], yyvsp);
      (yyvsp -= (1), yyssp -= (1));
      yystate = *yyssp;
      ;
    }
  *++yyvsp = yylval;
  ;
  yystate = yyn;
  goto yynewstate;
yyacceptlab:
  yyresult = 0;
  goto yyreturn;
yyabortlab:
  yyresult = 1;
  goto yyreturn;
yyexhaustedlab:
  yyerror ("memory exhausted");
  yyresult = 2;
yyreturn:
  if (yychar != (-2))
     yydestruct ("Cleanup: discarding lookahead",
   yytoken, &yylval);
  (yyvsp -= (yylen), yyssp -= (yylen));
  ;
  while (yyssp != yyss)
    {
      yydestruct ("Cleanup: popping",
    yystos[*yyssp], yyvsp);
      (yyvsp -= (1), yyssp -= (1));
    }
  if (yyss != yyssa)
    free (yyss);
  return (yyresult);
}

canonical_original_code:
int yyparse()
{
    int yystate;
    int yyerrstatus;
    short yyssa[200];
    short *yyss;
    short *yyssp;
    int yyvsa[200];
    int *yyvs;
    int *yyvsp;
    unsigned long yystacksize;
  int yyn;
  int yyresult;
  int yytoken;
  int yyval;
  int yylen = 0;
  yytoken = 0;
  yyss = yyssa;
  yyvs = yyvsa;
  yystacksize = 200;
  ;
  yystate = 0;
  yyerrstatus = 0;
  yynerrs = 0;
  yychar = (-2);
  yyssp = yyss;
  yyvsp = yyvs;
  goto yysetstate;
 yynewstate:
  yyssp++;
 yysetstate:
  *yyssp = yystate;
  if (yyss + yystacksize - 1 <= yyssp)
    {
      unsigned long yysize = yyssp - yyss + 1;
      if (10000 <= yystacksize)
 goto yyexhaustedlab;
      yystacksize *= 2;
      if (10000 < yystacksize)
 yystacksize = 10000;
      {
 short *yyss1 = yyss;
 union yyalloc *yyptr = (union yyalloc *) malloc (((yystacksize) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) + (sizeof (union yyalloc) - 1)));
 if (! yyptr)
   goto yyexhaustedlab;
 do { unsigned long yynewbytes; __builtin_memcpy (&yyptr->yyss_alloc, yyss, (yysize) * sizeof (*(yyss))); yyss = &yyptr->yyss_alloc; yynewbytes = yystacksize * sizeof (*yyss) + (sizeof (union yyalloc) - 1); yyptr += yynewbytes / sizeof (*yyptr); } while ((0));
 do { unsigned long yynewbytes; __builtin_memcpy (&yyptr->yyvs_alloc, yyvs, (yysize) * sizeof (*(yyvs))); yyvs = &yyptr->yyvs_alloc; yynewbytes = yystacksize * sizeof (*yyvs) + (sizeof (union yyalloc) - 1); yyptr += yynewbytes / sizeof (*yyptr); } while ((0));
 if (yyss1 != yyssa)
   free (yyss1);
      }
      yyssp = yyss + yysize - 1;
      yyvsp = yyvs + yysize - 1;
      ;
      if (yyss + yystacksize - 1 <= yyssp)
 goto yyabortlab;
    }
  ;
  if (yystate == 18)
    goto yyacceptlab;
  goto yybackup;
yybackup:
  yyn = yypact[yystate];
  if (yyn == -7)
    goto yydefault;
  if (yychar == (-2))
    {
      ;
      yychar = yylex ();
    }
  if (yychar <= 0)
    {
      yychar = yytoken = 0;
      ;
    }
  else
    {
      yytoken = ((unsigned int) (yychar) <= 259 ? yytranslate[yychar] : 2);
      ;
    }
  yyn += yytoken;
  if (yyn < 0 || 35 < yyn || yycheck[yyn] != yytoken)
    goto yydefault;
  yyn = yytable[yyn];
  if (yyn <= 0)
    {
      if (yyn == 0 || yyn == -1)
 goto yyerrlab;
      yyn = -yyn;
      goto yyreduce;
    }
  if (yyerrstatus)
    yyerrstatus--;
  ;
  yychar = (-2);
  yystate = yyn;
  *++yyvsp = yylval;
  goto yynewstate;
yydefault:
  yyn = yydefact[yystate];
  if (yyn == 0)
    goto yyerrlab;
  goto yyreduce;
yyreduce:
  yylen = yyr2[yyn];
  yyval = yyvsp[1-yylen];
  ;
  switch (yyn)
    {
        case 5:
    {printf("\t%d\n\n",(yyvsp[(1) - (1)]));}
    break;
  case 7:
    {(yyval)=(yyvsp[(1) - (2)])*10+(yyvsp[(2) - (2)]);}
    break;
  case 9:
    {(yyval)=(yyvsp[(2) - (3)]);}
    break;
  case 11:
    {(yyval)=reg[(yyvsp[(1) - (1)])];}
    break;
  case 13:
    {(yyval)=-(yyvsp[(2) - (2)]);}
    break;
  case 14:
    {(yyval)=(yyvsp[(1) - (1)]);}
    break;
  case 15:
    {(yyval)=(yyvsp[(1) - (3)])*(yyvsp[(3) - (3)]);}
    break;
  case 16:
    {(yyval)=(yyvsp[(1) - (3)])/(yyvsp[(3) - (3)]);}
    break;
  case 17:
    {(yyval)=(yyvsp[(1) - (1)]);}
    break;
  case 18:
    {(yyval)=(yyvsp[(1) - (3)])+(yyvsp[(3) - (3)]);}
    break;
  case 19:
    {(yyval)=(yyvsp[(1) - (3)])-(yyvsp[(3) - (3)]);}
    break;
  case 20:
    {reg[(yyvsp[(1) - (3)])]=(yyvsp[(3) - (3)]);}
    break;
      default: break;
    }
  ;
  (yyvsp -= (yylen), yyssp -= (yylen));
  yylen = 0;
  ;
  *++yyvsp = yyval;
  yyn = yyr1[yyn];
  yystate = yypgoto[yyn - 13] + *yyssp;
  if (0 <= yystate && yystate <= 35 && yycheck[yystate] == *yyssp)
    yystate = yytable[yystate];
  else
    yystate = yydefgoto[yyn - 13];
  goto yynewstate;
yyerrlab:
  if (!yyerrstatus)
    {
      ++yynerrs;
      yyerror ("syntax error");
    }
  if (yyerrstatus == 3)
    {
      if (yychar <= 0)
 {
   if (yychar == 0)
     goto yyabortlab;
 }
      else
 {
   yydestruct ("Error: discarding",
        yytoken, &yylval);
   yychar = (-2);
 }
    }
  goto yyerrlab1;
yyerrorlab:
  if ( 0)
     goto yyerrorlab;
  (yyvsp -= (yylen), yyssp -= (yylen));
  yylen = 0;
  ;
  yystate = *yyssp;
  goto yyerrlab1;
yyerrlab1:
  yyerrstatus = 3;
  for (;;)
    {
      yyn = yypact[yystate];
      if (yyn != -7)
 {
   yyn += 1;
   if (0 <= yyn && yyn <= 35 && yycheck[yyn] == 1)
     {
       yyn = yytable[yyn];
       if (0 < yyn)
  break;
     }
 }
      if (yyssp == yyss)
 goto yyabortlab;
      yydestruct ("Error: popping",
    yystos[yystate], yyvsp);
      (yyvsp -= (1), yyssp -= (1));
      yystate = *yyssp;
      ;
    }
  *++yyvsp = yylval;
  ;
  yystate = yyn;
  goto yynewstate;
yyacceptlab:
  yyresult = 0;
  goto yyreturn;
yyabortlab:
  yyresult = 1;
  goto yyreturn;
yyexhaustedlab:
  yyerror ("memory exhausted");
  yyresult = 2;
yyreturn:
  if (yychar != (-2))
     yydestruct ("Cleanup: discarding lookahead",
   yytoken, &yylval);
  (yyvsp -= (yylen), yyssp -= (yylen));
  ;
  while (yyssp != yyss)
    {
      yydestruct ("Cleanup: popping",
    yystos[*yyssp], yyvsp);
      (yyvsp -= (1), yyssp -= (1));
    }
  if (yyss != yyssa)
    free (yyss);
  return (yyresult);
}

variable_types: yystate int

variable_types: yyerrstatus int

variable_types:
yyssa
short [200]

variable_types:
yyss
short *

variable_types:
yyssp
short *

variable_types:
yyvsa
int [200]

variable_types:
yyvs
int *

variable_types:
yyvsp
int *

variable_types:
yystacksize
unsigned long

variable_types: yyn int

variable_types: yyresult int

variable_types: yytoken int

variable_types: yyval int

variable_types: yylen int

variable_types:
yysize
unsigned long

variable_types: union yyalloc { short yyss_alloc; int yyvs_alloc; } *

variable_types:
yynewbytes
unsigned long


yylex

decompiled_code:
int yylex()
{
const unsigned __int16 **v0; // rbx
int result; // eax
unsigned __int16 v2; // dx

v0 = __ctype_b_loc();
for ( result = 32; ; result = fgetc(_bss_start) )
{
v2 = (*v0)[result];
if ( (v2 & 0x2000) == 0 || result == 10 )
break;
}
if ( (v2 & 0x800) != 0 )
{
yylval = result - 48;
result = 258;
}
else if ( (v2 & 0x400) != 0 )
{
yylval = result - 97;
result = 259;
}
return result;
}

canonical_decompiled_code:
int func7()
{
const unsigned __int16 **v0; // rbx
int result; // eax
unsigned __int16 v2; // dx

v0 = __ctype_b_loc();
for ( result = 32; ; result = fgetc(_bss_start) )
{
v2 = (*v0)[result];
if ( (v2 & 0x2000) == 0 || result == 10 )
break;
}
if ( (v2 & 0x800) != 0 )
{
yylval = result - 48;
result = 258;
}
else if ( (v2 & 0x400) != 0 )
{
yylval = result - 97;
result = 259;
}
return result;
}

original_code:
int yylex(int a)
{
 int ch=' ';
 while(((*__ctype_b_loc ())[(int) ((ch))] & (unsigned short int) _ISspace)&&ch!='\n')
   ch=fgetc(stdin);
 if(((*__ctype_b_loc ())[(int) ((ch))] & (unsigned short int) _ISdigit))
 {
  yylval=ch-'0';
  return 258;
 }
 if(((*__ctype_b_loc ())[(int) ((ch))] & (unsigned short int) _ISalpha))
 {
  yylval=ch-'a';
  return 259;
 }
 return ch;
}

canonical_original_code:
int yylex(int a)
{
 int ch = ' ';
 while(((*__ctype_b_loc ())[(int) ((ch))] & (unsigned short) _ISspace)&&ch!='\n')
   ch=fgetc(stdin);
 if(((*__ctype_b_loc ())[(int) ((ch))] & (unsigned short) _ISdigit))
 {
  yylval=ch-'0';
  return 258;
 }
 if(((*__ctype_b_loc ())[(int) ((ch))] & (unsigned short) _ISalpha))
 {
  yylval=ch-'a';
  return 259;
 }
 return ch;
}

variable_types: a int

variable_types: ch int


yyerror

decompiled_code:
int __fastcall yyerror(const char *a1)
{
return fprintf(stderr, "%s\n", a1);
}

canonical_decompiled_code:
int __fastcall func8(const char *a1)
{
return fprintf(stderr, "%s\n", a1);
}

original_code:
int yyerror(char* s)
{
 fprintf(stderr,"%s\n",s);
}

canonical_original_code:
int yyerror(char *s)
{
 fprintf(stderr,"%s\n",s);
}

variable_types:
s
char *


main

canonical_name: main

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

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

original_code:
int main()
{
 return yyparse();
}

canonical_original_code:
int main()
{
 return yyparse();
}


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

result = 1LL;
if ( (unsigned __int8)(a1 - 48) > 3u )
{
result = 2LL;
if ( (unsigned __int8)(a1 - 52) > 3u )
result = 3 * (unsigned int)(a1 == 56);
}
return result;
}

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

result = 1LL;
if ( (unsigned __int8)(a1 - 48) > 3u )
{
result = 2LL;
if ( (unsigned __int8)(a1 - 52) > 3u )
result = 3 * (unsigned int)(a1 == 56);
}
return result;
}

original_code:
int input_map_cbegin(char c)
{
 if(c>='0'&&c<='3') return 1;
 else if(c>='4'&&c<='7') return 2;
 else if(c>='8'&&c<'9') return 3;
 else return 0;
}

variable_types: c char


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

result = 1LL;
if ( (unsigned __int8)(a1 - 48) > 3u )
{
result = 2LL;
if ( (unsigned __int8)(a1 - 52) > 3u )
{
if ( a1 == 56 )
result = 3LL;
else
result = 4 * (unsigned int)(a1 == 97);
}
}
return result;
}

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

result = 1LL;
if ( (unsigned __int8)(a1 - 48) > 3u )
{
result = 2LL;
if ( (unsigned __int8)(a1 - 52) > 3u )
{
if ( a1 == 56 )
result = 3LL;
else
result = 4 * (unsigned int)(a1 == 97);
}
}
return result;
}

original_code:
int input_map_c1(char c)
{
 if(c>='0'&&c<='3') return 1;
 else if(c>='4'&&c<='7') return 2;
 else if(c>='8'&&c<'9') return 3;
 else if(c=='a') return 4;
 else return 0;
}


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

result = 1LL;
if ( a1 != 98 )
result = 2 * (unsigned int)(a1 == 99);
return result;
}

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

result = 1LL;
if ( a1 != 98 )
result = 2 * (unsigned int)(a1 == 99);
return result;
}

original_code:
int input_map_c2(char c)
{
 if(c=='b') return 1;
 else if(c=='c') return 2;
 else return 0;
}


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

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

original_code:
int input_map_other(char c)
{
 return 0;
}


decompiled_code:
_BOOL8 __fastcall input_map_bbegin(char a1)
{
return (unsigned __int8)(a1 - 52) <= 5u;
}

canonical_decompiled_code:
_BOOL8 __fastcall func13(char a1)
{
return (unsigned __int8)(a1 - 52) <= 5u;
}

original_code:
int input_map_bbegin(char c)
{
 if(c>='4'&&c<='9')return 1;
 else return 0;
}


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

result = 1LL;
if ( a1 != 97 )
result = 2 * (unsigned int)((unsigned __int8)(a1 - 52) < 6u);
return result;
}

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

result = 1LL;
if ( a1 != 97 )
result = 2 * (unsigned int)((unsigned __int8)(a1 - 52) < 6u);
return result;
}

original_code:
int input_map_b1(char c)
{
 if(c=='a')return 1;
 if(c>='4'&&c<='9') return 2;
 else return 0;
}


decompiled_code:
_BOOL8 __fastcall input_map_b2(char a1)
{
return a1 == 99;
}

canonical_decompiled_code:
_BOOL8 __fastcall func15(char a1)
{
return a1 == 99;
}

original_code:
int input_map_b2(char c)
{
 if(c=='c')return 1;
 else return 0;
}


decompiled_code:
_BOOL8 __fastcall input_map_b3(char a1)
{
return a1 == 100;
}

canonical_decompiled_code:
_BOOL8 __fastcall func16(char a1)
{
return a1 == 100;
}

original_code:
int input_map_b3(char c)
{
 if(c=='d')return 1;
 else return 0;
}


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

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

original_code:
int input_map_b4(char c)
{
 return 0;
}

canonical_original_code:
int input_map_b4(char c)
{
 return 0;
}


decompiled_code:
_BOOL8 __fastcall input_map_abegin(char a1)
{
return (unsigned __int8)(a1 - 48) <= 7u;
}

canonical_decompiled_code:
_BOOL8 __fastcall func18(char a1)
{
return (unsigned __int8)(a1 - 48) <= 7u;
}

original_code:
int input_map_abegin(char c)
{
 if(c>='0'&&c<='7') return 1;
 else return 0;
}


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

result = 1LL;
if ( a1 != 97 )
result = 2 * (unsigned int)((unsigned __int8)(a1 - 48) < 8u);
return result;
}

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

result = 1LL;
if ( a1 != 97 )
result = 2 * (unsigned int)((unsigned __int8)(a1 - 48) < 8u);
return result;
}

original_code:
int input_map_a1(char c)
{
 if(c=='a')return 1;
 if(c>='0'&&c<='7') return 2;
 else return 0;
}


decompiled_code:
_BOOL8 __fastcall input_map_a2(char a1)
{
return a1 == 98;
}

canonical_decompiled_code:
_BOOL8 __fastcall func20(char a1)
{
return a1 == 98;
}

original_code:
int input_map_a2(char c)
{
 if(c=='b')return 1;
 else return 0;
}


decompiled_code:
_BOOL8 __fastcall input_map_a3(char a1)
{
return a1 == 102;
}

canonical_decompiled_code:
_BOOL8 __fastcall func21(char a1)
{
return a1 == 102;
}

original_code:
int input_map_a3(char c)
{
 if(c=='f')return 1;
 else return 0;
}


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

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

original_code:
int input_map_a4(char c)
{
 return 0;
}

canonical_original_code:
int input_map_a4(char c)
{
 return 0;
}


decompiled_code:
int __fastcall print_automaton(__int64 a1)
{
int v1; // er12
int v2; // eax
int i; // ebx

puts("automaton{");
printf("\tstates:%d\n", (unsigned int)am_float);
printf("\tinput_type:%d\n", (unsigned int)dword_404084);
puts("\tstate_martix{");
if ( *(int *)a1 > 0 )
{
v1 = 0;
do
{
printf("\t\t");
v2 = *(_DWORD *)(a1 + 4);
if ( v2 > 0 )
{
for ( i = 0; i < v2; ++i )
{
printf("%d\t", *(unsigned int *)(*(_QWORD *)(a1 + 24) + 4LL * (i + v1 * v2)));
v2 = *(_DWORD *)(a1 + 4);
}
}
putchar(10);
++v1;
}
while ( *(_DWORD *)a1 > v1 );
}
puts("\t}");
return puts("}");
}

canonical_decompiled_code:
int __fastcall func7(__int64 a1)
{
int v1; // er12
int v2; // eax
int i; // ebx

puts("automaton{");
printf("\tstates:%d\n", (unsigned int)am_float);
printf("\tinput_type:%d\n", (unsigned int)dword_404084);
puts("\tstate_martix{");
if ( *(int *)a1 > 0 )
{
v1 = 0;
do
{
printf("\t\t");
v2 = *(_DWORD *)(a1 + 4);
if ( v2 > 0 )
{
for ( i = 0; i < v2; ++i )
{
printf("%d\t", *(unsigned int *)(*(_QWORD *)(a1 + 24) + 4LL * (i + v1 * v2)));
v2 = *(_DWORD *)(a1 + 4);
}
}
putchar(10);
++v1;
}
while ( *(_DWORD *)a1 > v1 );
}
puts("\t}");
return puts("}");
}

original_code:
void print_automaton(struct automaton* am)
{
 printf("automaton{\n");
 printf("\tstates:%d\n",am_float.states_num);
 printf("\tinput_type:%d\n",am_float.inputs_num);
 printf("\tstate_martix{\n");
 int i,j;
 for(i=0;i<am->states_num;i++)
 {
  printf("\t\t");
  for(j=0;j<am->inputs_num;j++)
  {
   printf("%d\t",am->states_matrix[i*am->inputs_num+j]);
  }
  printf("\n");
 }
 printf("\t}\n");
 printf("}\n");
}

canonical_original_code:
void print_automaton(struct automaton *am)
{
 printf("automaton{\n");
 printf("\tstates:%d\n",am_float.states_num);
 printf("\tinput_type:%d\n",am_float.inputs_num);
 printf("\tstate_martix{\n");
 int i; int j;
 for(i=0;i<am->states_num;i++)
 {
  printf("\t\t");
  for(j=0;j<am->inputs_num;j++)
  {
   printf("%d\t",am->states_matrix[i*am->inputs_num+j]);
  }
  printf("\n");
 }
 printf("\t}\n");
 printf("}\n");
}

variable_types: struct automaton { int states_num; int inputs_num; char *type_map; int begin_state; int *states_matrix; struct state { char *name; int type; int final; } *states_info; } *

variable_types: i int

variable_types: j int

user_defined_types: struct automaton { int states_num; int inputs_num; char *type_map; int begin_state; int *states_matrix; struct state *states_info; }


driver

original_code:
int driver(struct automaton* am,char* str,struct state* s)
{
 int length=strlen(str);
 int i;
 int cur_state=am->begin_state;
 int last_final=-1;
 for(i=0;i<length;i++)
 {
  int input_type=am->type_map[str[i]];
  int next_state=am->states_matrix[cur_state*am->inputs_num+input_type];
  if(next_state==-1)
  {
   return last_final;
  }
  else
  {
   cur_state=next_state;
   if(am->states_info[cur_state].final==1)
   {
    last_final=i;
    *s=am->states_info[cur_state];
   }
  }
 }
 return last_final;
}

canonical_original_code:
int driver(struct automaton *am, char *str, struct state *s)
{
 int length = strlen(str);
 int i;
 int cur_state = am->begin_state;
 int last_final = -1;
 for(i=0;i<length;i++)
 {
  int input_type = am->type_map[str[i]];
  int next_state = am->states_matrix[cur_state*am->inputs_num+input_type];
  if(next_state==-1)
  {
   return last_final;
  }
  else
  {
   cur_state=next_state;
   if(am->states_info[cur_state].final==1)
   {
    last_final=i;
    *s=am->states_info[cur_state];
   }
  }
 }
 return last_final;
}

variable_types:
str
char *

variable_types:
s
struct state *

variable_types: length int

user_defined_types: struct state { char *name; int type; int final; }


main

decompiled_code:
int __cdecl main(int argc, const char **argv, const char **envp)
{
int v3; // eax
size_t v4; // rbx
__m128i v6; // [rsp+0h] [rbp-1028h] BYREF
char dest[2048]; // [rsp+10h] [rbp-1018h] BYREF
char src[2072]; // [rsp+810h] [rbp-818h] BYREF

print_automaton((__int64)&am_float);
puts("input:__quit__ exit");
printf("input:");
__isoc99_scanf();
while ( strcmp(src, "__quit__") )
{
v3 = driver((__int64)&am_float, src, &v6);
if ( v3 == -1 )
{
puts("Sorry,Not Float");
}
else
{
v4 = v3 + 1;
memcpy(dest, src, v4);
dest[v4] = 0;
printf("%s: %s\n", (const char *)v6.m128i_i64[0], dest);
if ( v4 == strlen(src) )
printf("It's %s\n", (const char *)v6.m128i_i64[0]);
else
puts("It's Not Float");
}
printf("\ninput:");
__isoc99_scanf();
}
return 0;
}

canonical_decompiled_code:
int __cdecl main(int argc, const char **argv, const char **envp)
{
int v3; // eax
size_t v4; // rbx
__m128i v6; // [rsp+0h] [rbp-1028h] BYREF
char dest[2048]; // [rsp+10h] [rbp-1018h] BYREF
char src[2072]; // [rsp+810h] [rbp-818h] BYREF

func7((__int64)&am_float);
puts("input:__quit__ exit");
printf("input:");
__isoc99_scanf();
while ( strcmp(src, "__quit__") )
{
v3 = func8((__int64)&am_float, src, &v6);
if ( v3 == -1 )
{
puts("Sorry,Not Float");
}
else
{
v4 = v3 + 1;
memcpy(dest, src, v4);
dest[v4] = 0;
printf("%s: %s\n", (const char *)v6.m128i_i64[0], dest);
if ( v4 == strlen(src) )
printf("It's %s\n", (const char *)v6.m128i_i64[0]);
else
puts("It's Not Float");
}
printf("\ninput:");
__isoc99_scanf();
}
return 0;
}

original_code:
int main()
{
 char buf[2048];
 char buf_copy[2048];
 print_automaton(&am_float);
 printf("input:__quit__ exit\n");
 printf("input:");
 scanf("%s",buf);
 struct state s;
 while(strcmp(buf,"__quit__")!=0)
 {
  int ret=driver(&am_float,buf,&s);
  if(ret==-1)
  {
   printf("Sorry,Not Float\n");
  }
  else
  {
   memcpy(buf_copy,buf,ret+1);
   buf_copy[ret+1]='\0';
   printf("%s: %s\n",s.name,buf_copy);
   if(ret+1==strlen(buf))
   {
    printf("It's %s\n",s.name);
   }
   else
   {
    printf("It's Not Float\n");
   }
  }
  printf("\ninput:");
  scanf("%s",buf);
 }
 return 0;
}

canonical_original_code:
int main()
{
 char buf[2048];
 char buf_copy[2048];
 print_automaton(&am_float);
 printf("input:__quit__ exit\n");
 printf("input:");
 scanf("%s",buf);
 struct state s;
 while(strcmp(buf,"__quit__")!=0)
 {
  int ret = driver(&am_float,buf,&s);
  if(ret==-1)
  {
   printf("Sorry,Not Float\n");
  }
  else
  {
   memcpy(buf_copy,buf,ret+1);
   buf_copy[ret+1]='\0';
   printf("%s: %s\n",s.name,buf_copy);
   if(ret+1==strlen(buf))
   {
    printf("It's %s\n",s.name);
   }
   else
   {
    printf("It's Not Float\n");
   }
  }
  printf("\ninput:");
  scanf("%s",buf);
 }
 return 0;
}

variable_types:
buf
char [2048]

variable_types: struct state { char *name; int type; int final; }

variable_types: ret int


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

result = 1LL;
if ( a1 != 61 )
result = 2 * (unsigned int)(a1 == 62);
return result;
}

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

result = 1LL;
if ( a1 != 61 )
result = 2 * (unsigned int)(a1 == 62);
return result;
}

original_code:
int op_input_map_greater_than(char c)
{
 if(c=='=') return 1;
 else if(c=='>') return 2;
 else return 0;
}


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

result = 1LL;
if ( a1 != 61 )
result = 2 * (unsigned int)(a1 == 60);
return result;
}

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

result = 1LL;
if ( a1 != 61 )
result = 2 * (unsigned int)(a1 == 60);
return result;
}

original_code:
int op_input_map_less_than(char c)
{
 if(c=='=') return 1;
 else if (c=='<') return 2;
 else return 0;
}


decompiled_code:
__int64 __fastcall state_next(__int64 a1, char a2)
{
__int64 v2; // rax
int v3; // eax

v2 = *(_QWORD *)(a1 + 16);
if ( v2 )
v3 = *(char *)(v2 + a2);
else
v3 = (*(__int64 (__fastcall **)(_QWORD))(a1 + 24))((unsigned int)a2);
return *(_QWORD *)(*(_QWORD *)(a1 + 32) + 8LL * v3);
}

original_code:
static inline struct state* state_next(struct state* s,char c)
{
 int input_type;
 if(s->s_input_map)
 {
  input_type=s->s_input_map[c];
 }
 else
 {
  input_type=s->s_input_func(c);
 }
 return s->s_targets[input_type];
}

canonical_original_code:
static inline struct state *state_next(struct state *s, char c)
{
 int input_type;
 if(s->s_input_map)
 {
  input_type=s->s_input_map[c];
 }
 else
 {
  input_type=s->s_input_func(c);
 }
 return s->s_targets[input_type];
}

return_type: struct state { char *s_name; int s_token; int s_inputs_num; char *s_input_map; int (*s_input_func)(char); struct state **s_targets; int s_final; } *


original_code:
static size_t gs_str_hash(const char* str)
{
 size_t hash = 1315423911;
 while (*str)
 {
  hash ^= ((hash << 5) + (*str++) + (hash >> 2));
 }
 return hash ;
}

canonical_original_code:
static unsigned long gs_str_hash(char *str)
{
 unsigned long hash = 1315423911;
 while (*str)
 {
  hash ^= ((hash << 5) + (*str++) + (hash >> 2));
 }
 return hash ;
}

variable_types:
hash
unsigned long

return_type: unsigned long


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

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

original_code:
int GrModule_StringExit()
{
 return 0;
}

canonical_original_code:
int GrModule_StringExit()
{
 return 0;
}


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

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

original_code:
int GrModule_ConstsExit()
{
 return 0;
}

canonical_original_code:
int GrModule_ConstsExit()
{
 return 0;
}


repo: Noxbru/Rands

decompiled_code:
__int64 __fastcall well_x64_srand(unsigned int a1)
{
__int64 *v1; // rbp
__int64 v2; // rbx
__int64 result; // rax

srand(a1);
v1 = &well_x64_default_state;
do
{
v2 = (unsigned int)rand();
result = rand();
*v1++ = (int)result + (v2 << 32);
}
while ( v1 != (__int64 *)(unsigned int)((_DWORD)&well_x64_default_state + 128) );
*((_BYTE *)&well_x64_default_state + 128) = 0;
return result;
}

canonical_decompiled_code:
__int64 __fastcall func0(unsigned int a1)
{
__int64 *v1; // rbp
__int64 v2; // rbx
__int64 result; // rax

srand(a1);
v1 = &well_x64_default_state;
do
{
v2 = (unsigned int)rand();
result = rand();
*v1++ = (int)result + (v2 << 32);
}
while ( v1 != (__int64 *)(unsigned int)((_DWORD)&well_x64_default_state + 128) );
*((_BYTE *)&well_x64_default_state + 128) = 0;
return result;
}

original_code:
void well_x64_srand(unsigned long seed)
{
    unsigned char i;
    unsigned long int r;
    srand(seed);
    for(i = 0; i < 16; i++)
    {
        r=rand();
        well_x64_default_state.wheel[i]=(r<<32)+rand();
    }
    well_x64_default_state.index=0;
}

canonical_original_code:
void well_x64_srand(unsigned long seed)
{
    unsigned char i;
    unsigned long r;
    srand(seed);
    for(i = 0; i < 16; i++)
    {
        r=rand();
        well_x64_default_state.wheel[i]=(r<<32)+rand();
    }
    well_x64_default_state.index=0;
}

variable_types:
seed
unsigned long

variable_types:
i
unsigned char

variable_types:
r
unsigned long


decompiled_code:
unsigned __int64 well_x64_rand()
{
unsigned __int8 v0; // dl
unsigned __int64 v1; // rsi
unsigned __int64 v2; // rcx
char v3; // dl
__int64 v4; // rdx
unsigned __int64 result; // rax

v0 = well_x64_default_state[16];
v1 = well_x64_default_state[v0] ^ well_x64_default_state[(v0 + 13) & 0xF] ^ (well_x64_default_state[v0] << 16) & 0xFFFF0000FFFF0000LL ^ (well_x64_default_state[(v0 + 13) & 0xF] << 15) & 0xFFFF8000FFFF8000LL;
v2 = well_x64_default_state[(v0 + 9) & 0xF] ^ ((unsigned __int64)well_x64_default_state[(v0 + 9) & 0xF] >> 11) & 0x1FFFFF001FFFFFLL;
well_x64_default_state[v0] = v2 ^ v1;
v3 = (v0 + 15) & 0xF;
LOBYTE(well_x64_default_state[16]) = v3;
v4 = v3 & 0xF;
result = (32 * (v2 ^ v1)) & 0xDA442D20DA442D20LL ^ (v2 << 28) & 0xF0000000F0000000LL ^ (v1 << 18) & 0xFFFC0000FFFC0000LL ^ v2 ^ well_x64_default_state[v4] ^ (4 * well_x64_default_state[v4]) & 0xFFFFFFFCFFFFFFFCLL;
well_x64_default_state[v4] = result;
return result;
}

canonical_decompiled_code:
unsigned __int64 func1()
{
unsigned __int8 v0; // dl
unsigned __int64 v1; // rsi
unsigned __int64 v2; // rcx
char v3; // dl
__int64 v4; // rdx
unsigned __int64 result; // rax

v0 = well_x64_default_state[16];
v1 = well_x64_default_state[v0] ^ well_x64_default_state[(v0 + 13) & 0xF] ^ (well_x64_default_state[v0] << 16) & 0xFFFF0000FFFF0000LL ^ (well_x64_default_state[(v0 + 13) & 0xF] << 15) & 0xFFFF8000FFFF8000LL;
v2 = well_x64_default_state[(v0 + 9) & 0xF] ^ ((unsigned __int64)well_x64_default_state[(v0 + 9) & 0xF] >> 11) & 0x1FFFFF001FFFFFLL;
well_x64_default_state[v0] = v2 ^ v1;
v3 = (v0 + 15) & 0xF;
LOBYTE(well_x64_default_state[16]) = v3;
v4 = v3 & 0xF;
result = (32 * (v2 ^ v1)) & 0xDA442D20DA442D20LL ^ (v2 << 28) & 0xF0000000F0000000LL ^ (v1 << 18) & 0xFFFC0000FFFC0000LL ^ v2 ^ well_x64_default_state[v4] ^ (4 * well_x64_default_state[v4]) & 0xFFFFFFFCFFFFFFFCLL;
well_x64_default_state[v4] = result;
return result;
}

original_code:
unsigned long int well_x64_rand()
{
    unsigned long int a,b,c,d;
    a=well_x64_default_state.wheel[well_x64_default_state.index];
    b=well_x64_default_state.wheel[(well_x64_default_state.index+13)&15];
    c=well_x64_default_state.wheel[(well_x64_default_state.index+9)&15];
    b=(a^((a<<16)&0xFFFF0000FFFF0000UL))^(b^((b<<15)&0xFFFF8000FFFF8000UL));
    c^=((c>>11)&0x001FFFFF001FFFFFUL);
    well_x64_default_state.wheel[well_x64_default_state.index]=d=b^c;
    well_x64_default_state.index=(well_x64_default_state.index+15)&15;
    a=well_x64_default_state.wheel[well_x64_default_state.index];
    d=d^(((d<<5)&0xFFFFFFE0FFFFFFE0UL)&0xDA442D24DA442D24UL);
    well_x64_default_state.wheel[well_x64_default_state.index]=a^((a<<2)&0xFFFFFFFCFFFFFFFCUL)^b^((b<<18)&0xFFFC0000FFFC0000UL)^((c<<28)&0xF0000000F0000000UL)^d;
    return well_x64_default_state.wheel[well_x64_default_state.index];
}

canonical_original_code:
unsigned long well_x64_rand()
{
    unsigned long a; unsigned long b; unsigned long c; unsigned long d;
    a=well_x64_default_state.wheel[well_x64_default_state.index];
    b=well_x64_default_state.wheel[(well_x64_default_state.index+13)&15];
    c=well_x64_default_state.wheel[(well_x64_default_state.index+9)&15];
    b=(a^((a<<16)&0xFFFF0000FFFF0000UL))^(b^((b<<15)&0xFFFF8000FFFF8000UL));
    c^=((c>>11)&0x001FFFFF001FFFFFUL);
    well_x64_default_state.wheel[well_x64_default_state.index]=d=b^c;
    well_x64_default_state.index=(well_x64_default_state.index+15)&15;
    a=well_x64_default_state.wheel[well_x64_default_state.index];
    d=d^(((d<<5)&0xFFFFFFE0FFFFFFE0UL)&0xDA442D24DA442D24UL);
    well_x64_default_state.wheel[well_x64_default_state.index]=a^((a<<2)&0xFFFFFFFCFFFFFFFCUL)^b^((b<<18)&0xFFFC0000FFFC0000UL)^((c<<28)&0xF0000000F0000000UL)^d;
    return well_x64_default_state.wheel[well_x64_default_state.index];
}

variable_types:
a
unsigned long

variable_types:
b
unsigned long

variable_types:
c
unsigned long

variable_types:
d
unsigned long


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

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

original_code:
inline void well_x64_clear_st(well_x64_state *st)
{
    free(st);
}

canonical_original_code:
inline void well_x64_clear_st(struct _well_x64_state *st)
{
    free(st);
}

variable_types: struct _well_x64_state { unsigned long wheel[16]; unsigned char index; } *


decompiled_code:
__int64 __fastcall well_x64_srand_st(_QWORD *a1, unsigned int a2)
{
_QWORD *v2; // rbp
__int64 v3; // rbx
__int64 result; // rax

srand(a2);
v2 = a1;
do
{
v3 = (unsigned int)rand();
result = rand();
*v2++ = (int)result + (v3 << 32);
}
while ( v2 != a1 + 16 );
*((_BYTE *)a1 + 128) = 0;
return result;
}

canonical_decompiled_code:
__int64 __fastcall func4(_QWORD *a1, unsigned int a2)
{
_QWORD *v2; // rbp
__int64 v3; // rbx
__int64 result; // rax

srand(a2);
v2 = a1;
do
{
v3 = (unsigned int)rand();
result = rand();
*v2++ = (int)result + (v3 << 32);
}
while ( v2 != a1 + 16 );
*((_BYTE *)a1 + 128) = 0;
return result;
}

original_code:
void well_x64_srand_st(well_x64_state *st, unsigned long seed)
{
    unsigned char i;
    unsigned long int r;
    srand(seed);
    for(i = 0; i < 16; i++)
    {
        r=rand();
        st->wheel[i]=(r<<32)+rand();
    }
    st->index=0;
}

canonical_original_code:
void well_x64_srand_st(struct _well_x64_state *st, unsigned long seed)
{
    unsigned char i;
    unsigned long r;
    srand(seed);
    for(i = 0; i < 16; i++)
    {
        r=rand();
        st->wheel[i]=(r<<32)+rand();
    }
    st->index=0;
}

user_defined_types: struct _well_x64_state { unsigned long wheel[16]; unsigned char index; }


original_code:
unsigned long int well_x64_rand_st(well_x64_state *st)
{
    unsigned long int a,b,c,d;
    a=st->wheel[st->index];
    b=st->wheel[(st->index+13)&15];
    c=st->wheel[(st->index+9)&15];
    b=(a^((a<<16)&0xFFFF0000FFFF0000UL))^(b^((b<<15)&0xFFFF8000FFFF8000UL));
    c^=((c>>11)&0x001FFFFF001FFFFFUL);
    st->wheel[st->index]=d=b^c;
    st->index=(st->index+15)&15;
    a=st->wheel[st->index];
    d=d^(((d<<5)&0xFFFFFFE0FFFFFFE0UL)&0xDA442D24DA442D24UL);
    st->wheel[st->index]=a^((a<<2)&0xFFFFFFFCFFFFFFFCUL)^b^((b<<18)&0xFFFC0000FFFC0000UL)^((c<<28)&0xF0000000F0000000UL)^d;
    return st->wheel[st->index];
}

canonical_original_code:
unsigned long well_x64_rand_st(struct _well_x64_state *st)
{
    unsigned long a; unsigned long b; unsigned long c; unsigned long d;
    a=st->wheel[st->index];
    b=st->wheel[(st->index+13)&15];
    c=st->wheel[(st->index+9)&15];
    b=(a^((a<<16)&0xFFFF0000FFFF0000UL))^(b^((b<<15)&0xFFFF8000FFFF8000UL));
    c^=((c>>11)&0x001FFFFF001FFFFFUL);
    st->wheel[st->index]=d=b^c;
    st->index=(st->index+15)&15;
    a=st->wheel[st->index];
    d=d^(((d<<5)&0xFFFFFFE0FFFFFFE0UL)&0xDA442D24DA442D24UL);
    st->wheel[st->index]=a^((a<<2)&0xFFFFFFFCFFFFFFFCUL)^b^((b<<18)&0xFFFC0000FFFC0000UL)^((c<<28)&0xF0000000F0000000UL)^d;
    return st->wheel[st->index];
}


decompiled_code:
int __fastcall well_srand(unsigned int a1)
{
int *v1; // rbx
int result; // eax

srand(a1);
v1 = &well_default_state;
do
{
result = rand();
*v1++ = result;
}
while ( v1 != (int *)(unsigned int)((_DWORD)&well_default_state + 64) );
*((_BYTE *)&well_default_state + 64) = 0;
return result;
}

canonical_decompiled_code:
int __fastcall func0(unsigned int a1)
{
int *v1; // rbx
int result; // eax

srand(a1);
v1 = &well_default_state;
do
{
result = rand();
*v1++ = result;
}
while ( v1 != (int *)(unsigned int)((_DWORD)&well_default_state + 64) );
*((_BYTE *)&well_default_state + 64) = 0;
return result;
}

original_code:
void well_srand(unsigned long seed)
{
    unsigned char i;
    srand(seed);
    for(i = 0; i < 16; i++)
        well_default_state.wheel[i]=rand();
    well_default_state.index=0;
}


decompiled_code:
__int64 well_rand()
{
unsigned __int8 v0; // dl
int v1; // edi
int v2; // ecx
unsigned int v3; // esi
char v4; // dl
__int64 v5; // rdx
__int64 result; // rax

v0 = well_default_state[16];
v1 = well_default_state[(v0 + 13) & 0xF];
v2 = (v1 << 15) ^ v1 ^ well_default_state[v0] ^ (well_default_state[v0] << 16);
v3 = well_default_state[(v0 + 9) & 0xF] ^ ((unsigned int)well_default_state[(v0 + 9) & 0xF] >> 11);
well_default_state[v0] = v3 ^ v2;
v4 = (v0 + 15) & 0xF;
LOBYTE(well_default_state[16]) = v4;
v5 = v4 & 0xF;
result = (32 * (v3 ^ v2)) & 0xDA442D24 ^ (v3 << 28) ^ (v2 << 18) ^ v3 ^ well_default_state[v5] ^ (4
* well_default_state[v5]);
well_default_state[v5] = result;
return result;
}

canonical_decompiled_code:
__int64 func1()
{
unsigned __int8 v0; // dl
int v1; // edi
int v2; // ecx
unsigned int v3; // esi
char v4; // dl
__int64 v5; // rdx
__int64 result; // rax

v0 = well_default_state[16];
v1 = well_default_state[(v0 + 13) & 0xF];
v2 = (v1 << 15) ^ v1 ^ well_default_state[v0] ^ (well_default_state[v0] << 16);
v3 = well_default_state[(v0 + 9) & 0xF] ^ ((unsigned int)well_default_state[(v0 + 9) & 0xF] >> 11);
well_default_state[v0] = v3 ^ v2;
v4 = (v0 + 15) & 0xF;
LOBYTE(well_default_state[16]) = v4;
v5 = v4 & 0xF;
result = (32 * (v3 ^ v2)) & 0xDA442D24 ^ (v3 << 28) ^ (v2 << 18) ^ v3 ^ well_default_state[v5] ^ (4
* well_default_state[v5]);
well_default_state[v5] = result;
return result;
}

original_code:
unsigned int well_rand()
{
    unsigned int a,b,c,d;
    a=well_default_state.wheel[well_default_state.index];
    b=well_default_state.wheel[(well_default_state.index+13)&15];
    c=well_default_state.wheel[(well_default_state.index+9)&15];
    b=a^(a<<16)^b^(b<<15);
    c^=(c>>11);
    well_default_state.wheel[well_default_state.index]=d=b^c;
    well_default_state.index=(well_default_state.index+15)&15;
    a=well_default_state.wheel[well_default_state.index];
    d=d^((d<<5)&0xDA442D24UL);
    well_default_state.wheel[well_default_state.index]=a^(a<<2)^b^(b<<18)^(c<<28)^d;
    return well_default_state.wheel[well_default_state.index];
}

canonical_original_code:
unsigned int well_rand()
{
    unsigned int a; unsigned int b; unsigned int c; unsigned int d;
    a=well_default_state.wheel[well_default_state.index];
    b=well_default_state.wheel[(well_default_state.index+13)&15];
    c=well_default_state.wheel[(well_default_state.index+9)&15];
    b=a^(a<<16)^b^(b<<15);
    c^=(c>>11);
    well_default_state.wheel[well_default_state.index]=d=b^c;
    well_default_state.index=(well_default_state.index+15)&15;
    a=well_default_state.wheel[well_default_state.index];
    d=d^((d<<5)&0xDA442D24UL);
    well_default_state.wheel[well_default_state.index]=a^(a<<2)^b^(b<<18)^(c<<28)^d;
    return well_default_state.wheel[well_default_state.index];
}

variable_types:
a
unsigned int

variable_types:
b
unsigned int

variable_types:
c
unsigned int

variable_types:
d
unsigned int

return_type: unsigned int


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

original_code:
inline void well_clear_st(well_state *st)
{
    free(st);
}

canonical_original_code:
inline void well_clear_st(struct _well_state *st)
{
    free(st);
}

variable_types: struct _well_state { unsigned int wheel[16]; unsigned char index; } *


decompiled_code:
int __fastcall well_srand_st(int *a1, unsigned int a2)
{
int *v2; // rbx
int result; // eax

srand(a2);
v2 = a1;
do
{
result = rand();
*v2++ = result;
}
while ( v2 != a1 + 16 );
*((_BYTE *)a1 + 64) = 0;
return result;
}

canonical_decompiled_code:
int __fastcall func4(int *a1, unsigned int a2)
{
int *v2; // rbx
int result; // eax

srand(a2);
v2 = a1;
do
{
result = rand();
*v2++ = result;
}
while ( v2 != a1 + 16 );
*((_BYTE *)a1 + 64) = 0;
return result;
}

original_code:
void well_srand_st(well_state *st, unsigned long seed)
{
    unsigned char i;
    srand(seed);
    for(i = 0; i < 16; i++)
        st->wheel[i]=rand();
    st->index=0;
}

canonical_original_code:
void well_srand_st(struct _well_state *st, unsigned long seed)
{
    unsigned char i;
    srand(seed);
    for(i = 0; i < 16; i++)
        st->wheel[i]=rand();
    st->index=0;
}

user_defined_types: struct _well_state { unsigned int wheel[16]; unsigned char index; }


original_code:
unsigned int well_rand_st(well_state *st)
{
    unsigned int a,b,c,d;
    a=st->wheel[st->index];
    b=st->wheel[(st->index+13)&15];
    c=st->wheel[(st->index+9)&15];
    b=a^(a<<16)^b^(b<<15);
    c^=(c>>11);
    st->wheel[st->index]=d=b^c;
    st->index=(st->index+15)&15;
    a=st->wheel[st->index];
    d=d^((d<<5)&0xDA442D24UL);
    st->wheel[st->index]=a^(a<<2)^b^(b<<18)^(c<<28)^d;
    return st->wheel[st->index];
}

canonical_original_code:
unsigned int well_rand_st(struct _well_state *st)
{
    unsigned int a; unsigned int b; unsigned int c; unsigned int d;
    a=st->wheel[st->index];
    b=st->wheel[(st->index+13)&15];
    c=st->wheel[(st->index+9)&15];
    b=a^(a<<16)^b^(b<<15);
    c^=(c>>11);
    st->wheel[st->index]=d=b^c;
    st->index=(st->index+15)&15;
    a=st->wheel[st->index];
    d=d^((d<<5)&0xDA442D24UL);
    st->wheel[st->index]=a^(a<<2)^b^(b<<18)^(c<<28)^d;
    return st->wheel[st->index];
}


decompiled_code:
__int64 __fastcall isaac_x64_srand(unsigned int a1)
{
__int64 *v1; // rbp
__int64 v2; // rbx
__int64 result; // rax

srand(a1);
v1 = &isaac_x64_default_state;
do
{
v2 = (unsigned int)rand();
result = rand();
*v1++ = (int)result + (v2 << 32);
}
while ( v1 != (__int64 *)(unsigned int)((_DWORD)&isaac_x64_default_state + 2048) );
*(&isaac_x64_default_state + 512) = 0LL;
*(&isaac_x64_default_state + 513) = 0LL;
*((_BYTE *)&isaac_x64_default_state + 4112) = 0;
*((_BYTE *)&isaac_x64_default_state + 4113) = 0;
return result;
}

canonical_decompiled_code:
__int64 __fastcall func0(unsigned int a1)
{
__int64 *v1; // rbp
__int64 v2; // rbx
__int64 result; // rax

srand(a1);
v1 = &isaac_x64_default_state;
do
{
v2 = (unsigned int)rand();
result = rand();
*v1++ = (int)result + (v2 << 32);
}
while ( v1 != (__int64 *)(unsigned int)((_DWORD)&isaac_x64_default_state + 2048) );
*(&isaac_x64_default_state + 512) = 0LL;
*(&isaac_x64_default_state + 513) = 0LL;
*((_BYTE *)&isaac_x64_default_state + 4112) = 0;
*((_BYTE *)&isaac_x64_default_state + 4113) = 0;
return result;
}

original_code:
void isaac_x64_srand(unsigned long int seed)
{
    unsigned int i;
    unsigned long int r;
    srand(seed);
    for(i = 0; i < 256; i++)
    {
        r=rand();
        isaac_x64_default_state.wheel[i]=(r<<32)+rand();
    }
    isaac_x64_default_state.a=0;
    isaac_x64_default_state.b=0;
    isaac_x64_default_state.c=0;
    isaac_x64_default_state.index=0;
}

canonical_original_code:
void isaac_x64_srand(unsigned long seed)
{
    unsigned int i;
    unsigned long r;
    srand(seed);
    for(i = 0; i < 256; i++)
    {
        r=rand();
        isaac_x64_default_state.wheel[i]=(r<<32)+rand();
    }
    isaac_x64_default_state.a=0;
    isaac_x64_default_state.b=0;
    isaac_x64_default_state.c=0;
    isaac_x64_default_state.index=0;
}

variable_types:
i
unsigned int


decompiled_code:
__int64 isaac_x64_calc()
{
unsigned __int8 v0; // al
__int64 v1; // rdi
__int64 v2; // r8
__int64 result; // rax
__int64 v4; // rcx
unsigned __int64 v5; // rdx
unsigned __int64 v6; // rsi
__int64 v7; // r8
__int64 v8; // rsi
__int64 v9; // rdx
unsigned __int64 v10; // rcx
__int64 v11; // r8
__int64 v12; // rcx
unsigned __int64 v13; // rdi
unsigned __int64 v14; // rsi
__int64 v15; // r8
__int64 v16; // rsi
unsigned __int64 v17; // rcx
__int64 v18; // rsi

v0 = LOBYTE(isaac_x64_default_state[514]) + 1;
LOBYTE(isaac_x64_default_state[514]) = v0;
v1 = isaac_x64_default_state[512];
v2 = isaac_x64_default_state[513] + v0;
for ( result = 0LL; result != 256; result += 4LL )
{
v4 = isaac_x64_default_state[result];
v5 = isaac_x64_default_state[(unsigned __int8)(result + 0x80)] + ~(v1 ^ (v1 << 21));
v6 = v2 + *(__int64 *)((char *)isaac_x64_default_state + (v4 & 0x7F8)) + v5;
isaac_x64_default_state[result] = v6;
v7 = isaac_x64_default_state[(unsigned __int8)(v6 >> 11)] + v4;
isaac_x64_default_state[result + 256] = v7;
v8 = isaac_x64_default_state[result + 1];
v9 = isaac_x64_default_state[(unsigned __int8)(result - 127)] + ((v5 >> 5) ^ v5);
v10 = v7 + *(__int64 *)((char *)isaac_x64_default_state + (v8 & 0x7F8)) + v9;
isaac_x64_default_state[result + 1] = v10;
v11 = isaac_x64_default_state[(unsigned __int8)(v10 >> 11)] + v8;
isaac_x64_default_state[result + 257] = v11;
v12 = isaac_x64_default_state[result + 2];
v13 = isaac_x64_default_state[(unsigned __int8)(result - 126)] + (v9 ^ (v9 << 12));
v14 = v11 + *(__int64 *)((char *)isaac_x64_default_state + (v12 & 0x7F8)) + v13;
isaac_x64_default_state[result + 2] = v14;
v15 = isaac_x64_default_state[(unsigned __int8)(v14 >> 11)] + v12;
isaac_x64_default_state[result + 258] = v15;
v16 = isaac_x64_default_state[result + 3];
v1 = isaac_x64_default_state[(unsigned __int8)(result - 125)] + (v13 ^ (v13 >> 33));
v17 = v15 + *(__int64 *)((char *)isaac_x64_default_state + (v16 & 0x7F8)) + v1;
isaac_x64_default_state[result + 3] = v17;
v18 = isaac_x64_default_state[(unsigned __int8)(v17 >> 11)] + v16;
v2 = v18;
isaac_x64_default_state[result + 259] = v18;
}
isaac_x64_default_state[512] = v1;
isaac_x64_default_state[513] = v18;
return result;
}

canonical_decompiled_code:
__int64 func1()
{
unsigned __int8 v0; // al
__int64 v1; // rdi
__int64 v2; // r8
__int64 result; // rax
__int64 v4; // rcx
unsigned __int64 v5; // rdx
unsigned __int64 v6; // rsi
__int64 v7; // r8
__int64 v8; // rsi
__int64 v9; // rdx
unsigned __int64 v10; // rcx
__int64 v11; // r8
__int64 v12; // rcx
unsigned __int64 v13; // rdi
unsigned __int64 v14; // rsi
__int64 v15; // r8
__int64 v16; // rsi
unsigned __int64 v17; // rcx
__int64 v18; // rsi

v0 = LOBYTE(isaac_x64_default_state[514]) + 1;
LOBYTE(isaac_x64_default_state[514]) = v0;
v1 = isaac_x64_default_state[512];
v2 = isaac_x64_default_state[513] + v0;
for ( result = 0LL; result != 256; result += 4LL )
{
v4 = isaac_x64_default_state[result];
v5 = isaac_x64_default_state[(unsigned __int8)(result + 0x80)] + ~(v1 ^ (v1 << 21));
v6 = v2 + *(__int64 *)((char *)isaac_x64_default_state + (v4 & 0x7F8)) + v5;
isaac_x64_default_state[result] = v6;
v7 = isaac_x64_default_state[(unsigned __int8)(v6 >> 11)] + v4;
isaac_x64_default_state[result + 256] = v7;
v8 = isaac_x64_default_state[result + 1];
v9 = isaac_x64_default_state[(unsigned __int8)(result - 127)] + ((v5 >> 5) ^ v5);
v10 = v7 + *(__int64 *)((char *)isaac_x64_default_state + (v8 & 0x7F8)) + v9;
isaac_x64_default_state[result + 1] = v10;
v11 = isaac_x64_default_state[(unsigned __int8)(v10 >> 11)] + v8;
isaac_x64_default_state[result + 257] = v11;
v12 = isaac_x64_default_state[result + 2];
v13 = isaac_x64_default_state[(unsigned __int8)(result - 126)] + (v9 ^ (v9 << 12));
v14 = v11 + *(__int64 *)((char *)isaac_x64_default_state + (v12 & 0x7F8)) + v13;
isaac_x64_default_state[result + 2] = v14;
v15 = isaac_x64_default_state[(unsigned __int8)(v14 >> 11)] + v12;
isaac_x64_default_state[result + 258] = v15;
v16 = isaac_x64_default_state[result + 3];
v1 = isaac_x64_default_state[(unsigned __int8)(result - 125)] + (v13 ^ (v13 >> 33));
v17 = v15 + *(__int64 *)((char *)isaac_x64_default_state + (v16 & 0x7F8)) + v1;
isaac_x64_default_state[result + 3] = v17;
v18 = isaac_x64_default_state[(unsigned __int8)(v17 >> 11)] + v16;
v2 = v18;
isaac_x64_default_state[result + 259] = v18;
}
isaac_x64_default_state[512] = v1;
isaac_x64_default_state[513] = v18;
return result;
}

original_code:
void isaac_x64_calc()
{
    unsigned int i;
    unsigned long int x,y;
    unsigned long int a,b;
    isaac_x64_default_state.c++;
    a=isaac_x64_default_state.a;
    b=isaac_x64_default_state.b+isaac_x64_default_state.c;
    for(i = 0; i < 256; i++)
    {
        x = isaac_x64_default_state.wheel[i];
        a =~(a^(a<<21)) + isaac_x64_default_state.wheel[(i+128)%256];
        isaac_x64_default_state.wheel[i]= y = a+b+isaac_x64_default_state.wheel[(x>>3)%256];
        isaac_x64_default_state.wheel2[i]=b = x + isaac_x64_default_state.wheel[(y>>11)%256];
        i++;
        x = isaac_x64_default_state.wheel[i];
        a = (a^(a>>5)) + isaac_x64_default_state.wheel[(i+128)%256];
        isaac_x64_default_state.wheel[i]= y = a+b+isaac_x64_default_state.wheel[(x>>3)%256];
        isaac_x64_default_state.wheel2[i]=b = x + isaac_x64_default_state.wheel[(y>>11)%256];
        i++;
        x=isaac_x64_default_state.wheel[i];
        a= (a^(a<<12)) + isaac_x64_default_state.wheel[(i+128)%256];
        isaac_x64_default_state.wheel[i]= y = a+b+isaac_x64_default_state.wheel[(x>>3)%256];
        isaac_x64_default_state.wheel2[i]=b = x + isaac_x64_default_state.wheel[(y>>11)%256];
        i++;
        x=isaac_x64_default_state.wheel[i];
        a= (a^(a>>33)) + isaac_x64_default_state.wheel[(i+128)%256];
        isaac_x64_default_state.wheel[i]= y = a+b+isaac_x64_default_state.wheel[(x>>3)%256];
        isaac_x64_default_state.wheel2[i]=b = x + isaac_x64_default_state.wheel[(y>>11)%256];
    }
    isaac_x64_default_state.a=a;
    isaac_x64_default_state.b=b;
}

canonical_original_code:
void isaac_x64_calc()
{
    unsigned int i;
    unsigned long x; unsigned long y;
    unsigned long a; unsigned long b;
    isaac_x64_default_state.c++;
    a=isaac_x64_default_state.a;
    b=isaac_x64_default_state.b+isaac_x64_default_state.c;
    for(i = 0; i < 256; i++)
    {
        x = isaac_x64_default_state.wheel[i];
        a =~(a^(a<<21)) + isaac_x64_default_state.wheel[(i+128)%256];
        isaac_x64_default_state.wheel[i]= y = a+b+isaac_x64_default_state.wheel[(x>>3)%256];
        isaac_x64_default_state.wheel2[i]=b = x + isaac_x64_default_state.wheel[(y>>11)%256];
        i++;
        x = isaac_x64_default_state.wheel[i];
        a = (a^(a>>5)) + isaac_x64_default_state.wheel[(i+128)%256];
        isaac_x64_default_state.wheel[i]= y = a+b+isaac_x64_default_state.wheel[(x>>3)%256];
        isaac_x64_default_state.wheel2[i]=b = x + isaac_x64_default_state.wheel[(y>>11)%256];
        i++;
        x=isaac_x64_default_state.wheel[i];
        a= (a^(a<<12)) + isaac_x64_default_state.wheel[(i+128)%256];
        isaac_x64_default_state.wheel[i]= y = a+b+isaac_x64_default_state.wheel[(x>>3)%256];
        isaac_x64_default_state.wheel2[i]=b = x + isaac_x64_default_state.wheel[(y>>11)%256];
        i++;
        x=isaac_x64_default_state.wheel[i];
        a= (a^(a>>33)) + isaac_x64_default_state.wheel[(i+128)%256];
        isaac_x64_default_state.wheel[i]= y = a+b+isaac_x64_default_state.wheel[(x>>3)%256];
        isaac_x64_default_state.wheel2[i]=b = x + isaac_x64_default_state.wheel[(y>>11)%256];
    }
    isaac_x64_default_state.a=a;
    isaac_x64_default_state.b=b;
}

variable_types:
x
unsigned long

variable_types:
y
unsigned long


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

original_code:
inline void isaac_x64_clear_st(isaac_x64_state *st)
{
    free(st);
}

canonical_original_code:
inline void isaac_x64_clear_st(struct _isaac_x64_state *st)
{
    free(st);
}

variable_types: struct _isaac_x64_state { unsigned long wheel[256]; unsigned long wheel2[256]; unsigned long a; unsigned char c; unsigned char index; } *


decompiled_code:
__int64 __fastcall isaac_x64_srand_st(__int64 a1, unsigned int a2)
{
_QWORD *v2; // rbp
__int64 v3; // rbx
__int64 result; // rax

srand(a2);
v2 = (_QWORD *)a1;
do
{
v3 = (unsigned int)rand();
result = rand();
*v2++ = (int)result + (v3 << 32);
}
while ( v2 != (_QWORD *)(a1 + 2048) );
*(_QWORD *)(a1 + 4096) = 0LL;
*(_QWORD *)(a1 + 4104) = 0LL;
*(_BYTE *)(a1 + 4112) = 0;
*(_BYTE *)(a1 + 4113) = 0;
return result;
}

original_code:
void isaac_x64_srand_st(isaac_x64_state *st, unsigned long int seed)
{
    unsigned int i;
    unsigned long int r;
    srand(seed);
    for(i = 0; i < 256; i++)
    {
        r=rand();
        st->wheel[i]=(r<<32)+rand();
    }
    st->a=0;
    st->b=0;
    st->c=0;
    st->index=0;
}

canonical_original_code:
void isaac_x64_srand_st(struct _isaac_x64_state *st, unsigned long seed)
{
    unsigned int i;
    unsigned long r;
    srand(seed);
    for(i = 0; i < 256; i++)
    {
        r=rand();
        st->wheel[i]=(r<<32)+rand();
    }
    st->a=0;
    st->b=0;
    st->c=0;
    st->index=0;
}

variable_types:
seed
unsigned long

user_defined_types: struct _isaac_x64_state { unsigned long wheel[256]; unsigned long wheel2[256]; unsigned long a; unsigned char c; unsigned char index; }


decompiled_code:
int __fastcall xor_srand(unsigned int a1)
{
int result; // eax

srand(a1);
xor_default_state = rand();
*(&xor_default_state + 1) = rand();
*(&xor_default_state + 2) = rand();
result = rand();
*(&xor_default_state + 3) = result;
return result;
}

canonical_decompiled_code:
int __fastcall func0(unsigned int a1)
{
int result; // eax

srand(a1);
xor_default_state = rand();
*(&xor_default_state + 1) = rand();
*(&xor_default_state + 2) = rand();
result = rand();
*(&xor_default_state + 3) = result;
return result;
}

original_code:
void xor_srand(unsigned long int seed)
{
    srand(seed);
    xor_default_state.wheel[0]=rand();
    xor_default_state.wheel[1]=rand();
    xor_default_state.wheel[2]=rand();
    xor_default_state.wheel[3]=rand();
}

canonical_original_code:
void xor_srand(unsigned long seed)
{
    srand(seed);
    xor_default_state.wheel[0]=rand();
    xor_default_state.wheel[1]=rand();
    xor_default_state.wheel[2]=rand();
    xor_default_state.wheel[3]=rand();
}


decompiled_code:
__int64 xor_rand()
{
unsigned int v0; // edx
unsigned int v1; // ecx
__int64 result; // rax

v0 = xor_default_state ^ (xor_default_state << 11);
v1 = *(&xor_default_state + 3);
xor_default_state = *(&xor_default_state + 1);
*(&xor_default_state + 1) = *(&xor_default_state + 2);
*(&xor_default_state + 2) = v1;
result = (v0 >> 8) ^ v0 ^ v1 ^ (v1 >> 19);
*(&xor_default_state + 3) = result;
return result;
}

canonical_decompiled_code:
__int64 func1()
{
unsigned int v0; // edx
unsigned int v1; // ecx
__int64 result; // rax

v0 = xor_default_state ^ (xor_default_state << 11);
v1 = *(&xor_default_state + 3);
xor_default_state = *(&xor_default_state + 1);
*(&xor_default_state + 1) = *(&xor_default_state + 2);
*(&xor_default_state + 2) = v1;
result = (v0 >> 8) ^ v0 ^ v1 ^ (v1 >> 19);
*(&xor_default_state + 3) = result;
return result;
}

original_code:
unsigned int xor_rand()
{
    unsigned int t=xor_default_state.wheel[0]^(xor_default_state.wheel[0]<<11);
    unsigned int a=xor_default_state.wheel[3]^(xor_default_state.wheel[3]>>19);
    xor_default_state.wheel[0]=xor_default_state.wheel[1];
    xor_default_state.wheel[1]=xor_default_state.wheel[2];
    xor_default_state.wheel[2]=xor_default_state.wheel[3];
    xor_default_state.wheel[3]=a ^ (t^(t>>8));
    return xor_default_state.wheel[3];
}

canonical_original_code:
unsigned int xor_rand()
{
    unsigned int t = xor_default_state.wheel[0]^(xor_default_state.wheel[0]<<11);
    unsigned int a = xor_default_state.wheel[3]^(xor_default_state.wheel[3]>>19);
    xor_default_state.wheel[0]=xor_default_state.wheel[1];
    xor_default_state.wheel[1]=xor_default_state.wheel[2];
    xor_default_state.wheel[2]=xor_default_state.wheel[3];
    xor_default_state.wheel[3]=a ^ (t^(t>>8));
    return xor_default_state.wheel[3];
}

variable_types:
t
unsigned int


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

original_code:
inline void xor_clear_st(xor_state *st)
{
    free(st);
}

canonical_original_code:
inline void xor_clear_st(struct _xor_state *st)
{
    free(st);
}

variable_types: struct _xor_state { unsigned int wheel[4]; } *


decompiled_code:
int __fastcall xor_srand_st(int *a1, unsigned int a2)
{
int result; // eax

srand(a2);
*a1 = rand();
a1[1] = rand();
a1[2] = rand();
result = rand();
a1[3] = result;
return result;
}

canonical_decompiled_code:
int __fastcall func4(int *a1, unsigned int a2)
{
int result; // eax

srand(a2);
*a1 = rand();
a1[1] = rand();
a1[2] = rand();
result = rand();
a1[3] = result;
return result;
}

original_code:
void xor_srand_st(xor_state *st, unsigned long int seed)
{
    srand(seed);
    st->wheel[0]=rand();
    st->wheel[1]=rand();
    st->wheel[2]=rand();
    st->wheel[3]=rand();
}

canonical_original_code:
void xor_srand_st(struct _xor_state *st, unsigned long seed)
{
    srand(seed);
    st->wheel[0]=rand();
    st->wheel[1]=rand();
    st->wheel[2]=rand();
    st->wheel[3]=rand();
}

user_defined_types: struct _xor_state { unsigned int wheel[4]; }


decompiled_code:
__int64 __fastcall xor_rand_st(_DWORD *a1)
{
unsigned int v1; // edx
unsigned int v2; // ecx
__int64 result; // rax

v1 = *a1 ^ (*a1 << 11);
v2 = a1[3];
*a1 = a1[1];
a1[1] = a1[2];
a1[2] = v2;
result = (v1 >> 8) ^ v1 ^ v2 ^ (v2 >> 19);
a1[3] = result;
return result;
}

canonical_decompiled_code:
__int64 __fastcall func5(_DWORD *a1)
{
unsigned int v1; // edx
unsigned int v2; // ecx
__int64 result; // rax

v1 = *a1 ^ (*a1 << 11);
v2 = a1[3];
*a1 = a1[1];
a1[1] = a1[2];
a1[2] = v2;
result = (v1 >> 8) ^ v1 ^ v2 ^ (v2 >> 19);
a1[3] = result;
return result;
}

original_code:
unsigned int xor_rand_st(xor_state *st)
{
    unsigned int t=st->wheel[0]^(st->wheel[0]<<11);
    unsigned int a=st->wheel[3]^(st->wheel[3]>>19);
    st->wheel[0]=st->wheel[1];
    st->wheel[1]=st->wheel[2];
    st->wheel[2]=st->wheel[3];
    st->wheel[3]=a ^ (t^(t>>8));
    return st->wheel[3];
}

canonical_original_code:
unsigned int xor_rand_st(struct _xor_state *st)
{
    unsigned int t = st->wheel[0]^(st->wheel[0]<<11);
    unsigned int a = st->wheel[3]^(st->wheel[3]>>19);
    st->wheel[0]=st->wheel[1];
    st->wheel[1]=st->wheel[2];
    st->wheel[2]=st->wheel[3];
    st->wheel[3]=a ^ (t^(t>>8));
    return st->wheel[3];
}


decompiled_code:
int __fastcall mt_srand(unsigned int a1)
{
int *v1; // rbx
int result; // eax

srand(a1);
v1 = mt_default_state;
do
{
result = rand();
*v1++ = result;
}
while ( v1 != (int *)(unsigned int)((_DWORD)mt_default_state + 2496) );
mt_default_state[1248] = 0;
return result;
}

canonical_decompiled_code:
int __fastcall func0(unsigned int a1)
{
int *v1; // rbx
int result; // eax

srand(a1);
v1 = mt_default_state;
do
{
result = rand();
*v1++ = result;
}
while ( v1 != (int *)(unsigned int)((_DWORD)mt_default_state + 2496) );
mt_default_state[1248] = 0;
return result;
}

original_code:
void mt_srand(unsigned long int seed)
{
    unsigned int i;
    srand(seed);
    for(i = 0; i < 624; i++)
        mt_default_state.wheel[i]=rand();
    mt_default_state.index=0;
}

canonical_original_code:
void mt_srand(unsigned long seed)
{
    unsigned int i;
    srand(seed);
    for(i = 0; i < 624; i++)
        mt_default_state.wheel[i]=rand();
    mt_default_state.index=0;
}


decompiled_code:
__int64 mt_calc()
{
__int64 i; // rdx
unsigned int v1; // eax
unsigned int v2; // ecx
__int64 result; // rax

for ( i = 1LL; i != 625; ++i )
{
v1 = mt_magic_1[(mt_default_state[i - 1] & 0x80000000 | mt_default_state[(unsigned int)i % 0x270] & 0x7FFFFFFF) & 1] ^ mt_default_state[((int)i + 396) % 0x270u] ^ ((mt_default_state[i - 1] & 0x80000000 | mt_default_state[(unsigned int)i % 0x270] & 0x7FFFFFFF) >> 1);
mt_default_state[i - 1] = v1;
v2 = v1 ^ (v1 >> 11) ^ ((v1 ^ (v1 >> 11)) << 7) & 0x9D2C5680;
result = ((v2 ^ (v2 << 15) & 0xEFC60000) >> 18) ^ v2 ^ (v2 << 15) & 0xEFC60000;
mt_default_state[i + 623] = result;
}
mt_default_state[1248] = 0;
return result;
}

canonical_decompiled_code:
__int64 func1()
{
__int64 i; // rdx
unsigned int v1; // eax
unsigned int v2; // ecx
__int64 result; // rax

for ( i = 1LL; i != 625; ++i )
{
v1 = mt_magic_1[(mt_default_state[i - 1] & 0x80000000 | mt_default_state[(unsigned int)i % 0x270] & 0x7FFFFFFF) & 1] ^ mt_default_state[((int)i + 396) % 0x270u] ^ ((mt_default_state[i - 1] & 0x80000000 | mt_default_state[(unsigned int)i % 0x270] & 0x7FFFFFFF) >> 1);
mt_default_state[i - 1] = v1;
v2 = v1 ^ (v1 >> 11) ^ ((v1 ^ (v1 >> 11)) << 7) & 0x9D2C5680;
result = ((v2 ^ (v2 << 15) & 0xEFC60000) >> 18) ^ v2 ^ (v2 << 15) & 0xEFC60000;
mt_default_state[i + 623] = result;
}
mt_default_state[1248] = 0;
return result;
}

original_code:
void mt_calc()
{
    unsigned int i,y;
    static unsigned int mt_magic[2] = {0,0x9908b0df};
    for(i = 0; i < 624; i++)
    {
        y = (mt_default_state.wheel[i] & 0x80000000) | (mt_default_state.wheel[(i+1)%624] & 0x7fffffff);
        mt_default_state.wheel[i] = mt_default_state.wheel[(i+397)%624] ^ (y>>1) ^ mt_magic[y&1];
        y = mt_default_state.wheel[i];
        y^= (y>>11);
        y^= ((y<<7)&0x9d2c5680);
        y^= ((y<<15)&0xefc60000);
        y^= (y>>18);
        mt_default_state.wheel2[i] = y;
    }
    mt_default_state.index = 0;
}

canonical_original_code:
void mt_calc()
{
    unsigned int i; unsigned int y;
    static unsigned int mt_magic[2] = {0,0x9908b0df};
    for(i = 0; i < 624; i++)
    {
        y = (mt_default_state.wheel[i] & 0x80000000) | (mt_default_state.wheel[(i+1)%624] & 0x7fffffff);
        mt_default_state.wheel[i] = mt_default_state.wheel[(i+397)%624] ^ (y>>1) ^ mt_magic[y&1];
        y = mt_default_state.wheel[i];
        y^= (y>>11);
        y^= ((y<<7)&0x9d2c5680);
        y^= ((y<<15)&0xefc60000);
        y^= (y>>18);
        mt_default_state.wheel2[i] = y;
    }
    mt_default_state.index = 0;
}

variable_types:
y
unsigned int


decompiled_code:
__int64 mt_rand()
{
__int64 v0; // rax
unsigned int v1; // ecx

if ( !mt_default_state[1248] )
mt_calc();
v0 = (unsigned int)mt_default_state[1248];
v1 = mt_default_state[v0 + 624];
mt_default_state[1248] = ((int)v0 + 1) % 0x270u;
return v1;
}

canonical_decompiled_code:
__int64 func2()
{
__int64 v0; // rax
unsigned int v1; // ecx

if ( !mt_default_state[1248] )
func1();
v0 = (unsigned int)mt_default_state[1248];
v1 = mt_default_state[v0 + 624];
mt_default_state[1248] = ((int)v0 + 1) % 0x270u;
return v1;
}

original_code:
unsigned int mt_rand()
{
    unsigned int r;
    if(!mt_default_state.index)
        mt_calc();
    r = mt_default_state.wheel2[mt_default_state.index];
    mt_default_state.index = (mt_default_state.index + 1)%624;
    return r;
}

variable_types:
r
unsigned int


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

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

original_code:
inline void mt_clear_st(mt_state *st)
{
    free(st);
}

canonical_original_code:
inline void mt_clear_st(struct _mt_state *st)
{
    free(st);
}

variable_types: struct _mt_state { unsigned int wheel[624]; unsigned int wheel2[624]; unsigned int index; } *


decompiled_code:
int __fastcall mt_srand_st(int *a1, unsigned int a2)
{
int *v2; // rbx
int result; // eax

srand(a2);
v2 = a1;
do
{
result = rand();
*v2++ = result;
}
while ( v2 != a1 + 624 );
a1[1248] = 0;
return result;
}

canonical_decompiled_code:
int __fastcall func5(int *a1, unsigned int a2)
{
int *v2; // rbx
int result; // eax

srand(a2);
v2 = a1;
do
{
result = rand();
*v2++ = result;
}
while ( v2 != a1 + 624 );
a1[1248] = 0;
return result;
}

original_code:
void mt_srand_st(mt_state *st, unsigned long int seed)
{
    unsigned int i;
    srand(seed);
    for(i = 0; i < 624; i++)
        st->wheel[i]=rand();
    st->index=0;
}

canonical_original_code:
void mt_srand_st(struct _mt_state *st, unsigned long seed)
{
    unsigned int i;
    srand(seed);
    for(i = 0; i < 624; i++)
        st->wheel[i]=rand();
    st->index=0;
}

user_defined_types: struct _mt_state { unsigned int wheel[624]; unsigned int wheel2[624]; unsigned int index; }


original_code:
unsigned int mt_rand_st(mt_state *st)
{
    unsigned int r;
    if(!st->index)
        mt_calc_st(st);
    r = st->wheel2[st->index];
    st->index = (st->index + 1)%624;
    return r;
}

canonical_original_code:
unsigned int mt_rand_st(struct _mt_state *st)
{
    unsigned int r;
    if(!st->index)
        mt_calc_st(st);
    r = st->wheel2[st->index];
    st->index = (st->index + 1)%624;
    return r;
}


decompiled_code:
int __fastcall pr_srand(unsigned int a1)
{
int *v1; // rbx
int result; // eax

srand(a1);
*((_BYTE *)&pr_default_state + 1024) = 0;
v1 = &pr_default_state;
do
*v1++ = rand();
while ( v1 != (int *)(unsigned int)((_DWORD)&pr_default_state + 1020) );
result = rand();
*(&pr_default_state + 255) = result;
return result;
}

canonical_decompiled_code:
int __fastcall func0(unsigned int a1)
{
int *v1; // rbx
int result; // eax

srand(a1);
*((_BYTE *)&pr_default_state + 1024) = 0;
v1 = &pr_default_state;
do
*v1++ = rand();
while ( v1 != (int *)(unsigned int)((_DWORD)&pr_default_state + 1020) );
result = rand();
*(&pr_default_state + 255) = result;
return result;
}

original_code:
void pr_srand(unsigned long int seed)
{
    srand(seed);
    unsigned char i;
    pr_default_state.index=0;
    for(i = 0; i != 255; i++)
        pr_default_state.wheel[i]=rand();
    pr_default_state.wheel[255]=rand();
}

canonical_original_code:
void pr_srand(unsigned long seed)
{
    srand(seed);
    unsigned char i;
    pr_default_state.index=0;
    for(i = 0; i != 255; i++)
        pr_default_state.wheel[i]=rand();
    pr_default_state.wheel[255]=rand();
}

variable_types:
i
unsigned char


decompiled_code:
__int64 pr_rand()
{
unsigned __int8 v0; // al
int v1; // edx
unsigned int v2; // edx

v0 = pr_default_state[256];
v1 = pr_default_state[(unsigned __int8)(v0 - 24)] + pr_default_state[(unsigned __int8)(v0 - 55)];
pr_default_state[v0] = v1;
v2 = pr_default_state[(unsigned __int8)(v0 - 61)] ^ v1;
LOBYTE(pr_default_state[256]) = v0 + 1;
return v2;
}

canonical_decompiled_code:
__int64 func1()
{
unsigned __int8 v0; // al
int v1; // edx
unsigned int v2; // edx

v0 = pr_default_state[256];
v1 = pr_default_state[(unsigned __int8)(v0 - 24)] + pr_default_state[(unsigned __int8)(v0 - 55)];
pr_default_state[v0] = v1;
v2 = pr_default_state[(unsigned __int8)(v0 - 61)] ^ v1;
LOBYTE(pr_default_state[256]) = v0 + 1;
return v2;
}

original_code:
unsigned int pr_rand()
{
    unsigned int r;
    pr_default_state.wheel[pr_default_state.index]=pr_default_state.wheel[(unsigned char)(pr_default_state.index-24)]+ pr_default_state.wheel[(unsigned char)(pr_default_state.index-55)];
    r=(pr_default_state.wheel[pr_default_state.index]^(pr_default_state.wheel[(unsigned char)(pr_default_state.index-61)]));
    pr_default_state.index++;
    return r;
}


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

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

original_code:
inline void pr_clear_st(pr_state *st)
{
    free(st);
}

canonical_original_code:
inline void pr_clear_st(struct _pr_state *st)
{
    free(st);
}

variable_types: struct _pr_state { unsigned int wheel[256]; unsigned char index; } *


decompiled_code:
int __fastcall pr_srand_st(__int64 a1, unsigned int a2)
{
int *v2; // rbx
int result; // eax

srand(a2);
*(_BYTE *)(a1 + 1024) = 0;
v2 = (int *)a1;
do
*v2++ = rand();
while ( v2 != (int *)(a1 + 1020) );
result = rand();
*(_DWORD *)(a1 + 1020) = result;
return result;
}

canonical_decompiled_code:
int __fastcall func4(__int64 a1, unsigned int a2)
{
int *v2; // rbx
int result; // eax

srand(a2);
*(_BYTE *)(a1 + 1024) = 0;
v2 = (int *)a1;
do
*v2++ = rand();
while ( v2 != (int *)(a1 + 1020) );
result = rand();
*(_DWORD *)(a1 + 1020) = result;
return result;
}

original_code:
void pr_srand_st(pr_state *st, unsigned long int seed)
{
    srand(seed);
    unsigned char i;
    st->index=0;
    for(i = 0; i != 255; i++)
        st->wheel[i]=rand();
    st->wheel[255]=rand();
}

canonical_original_code:
void pr_srand_st(struct _pr_state *st, unsigned long seed)
{
    srand(seed);
    unsigned char i;
    st->index=0;
    for(i = 0; i != 255; i++)
        st->wheel[i]=rand();
    st->wheel[255]=rand();
}

user_defined_types: struct _pr_state { unsigned int wheel[256]; unsigned char index; }


original_code:
unsigned int pr_rand_st(pr_state *st)
{
    unsigned int r;
    st->wheel[st->index]=st->wheel[(unsigned char)(st->index-24)]+ st->wheel[(unsigned char)(st->index-55)];
    r=(st->wheel[st->index]^(st->wheel[(unsigned char)(st->index-61)]));
    st->index++;
    return r;
}

canonical_original_code:
unsigned int pr_rand_st(struct _pr_state *st)
{
    unsigned int r;
    st->wheel[st->index]=st->wheel[(unsigned char)(st->index-24)]+ st->wheel[(unsigned char)(st->index-55)];
    r=(st->wheel[st->index]^(st->wheel[(unsigned char)(st->index-61)]));
    st->index++;
    return r;
}


decompiled_code:
int __fastcall isaac_srand(unsigned int a1)
{
int *v1; // rbx
int result; // eax

srand(a1);
v1 = &isaac_default_state;
do
{
result = rand();
*v1++ = result;
}
while ( v1 != (int *)(unsigned int)((_DWORD)&isaac_default_state + 1024) );
*(&isaac_default_state + 512) = 0;
*(&isaac_default_state + 513) = 0;
*((_BYTE *)&isaac_default_state + 2056) = 0;
*((_BYTE *)&isaac_default_state + 2057) = 0;
return result;
}

canonical_decompiled_code:
int __fastcall func0(unsigned int a1)
{
int *v1; // rbx
int result; // eax

srand(a1);
v1 = &isaac_default_state;
do
{
result = rand();
*v1++ = result;
}
while ( v1 != (int *)(unsigned int)((_DWORD)&isaac_default_state + 1024) );
*(&isaac_default_state + 512) = 0;
*(&isaac_default_state + 513) = 0;
*((_BYTE *)&isaac_default_state + 2056) = 0;
*((_BYTE *)&isaac_default_state + 2057) = 0;
return result;
}

original_code:
void isaac_srand(unsigned long int seed)
{
    unsigned int i;
    srand(seed);
    for(i = 0; i < 256; i++)
        isaac_default_state.wheel[i]=rand();
    isaac_default_state.a=0;
    isaac_default_state.b=0;
    isaac_default_state.c=0;
    isaac_default_state.index=0;
}

canonical_original_code:
void isaac_srand(unsigned long seed)
{
    unsigned int i;
    srand(seed);
    for(i = 0; i < 256; i++)
        isaac_default_state.wheel[i]=rand();
    isaac_default_state.a=0;
    isaac_default_state.b=0;
    isaac_default_state.c=0;
    isaac_default_state.index=0;
}