// File: /workspace/github_c_makefile_star2_O3/johsteffens[P]beth/xoico/src/xoico.xo.c
// Function: xoico_stamp_s_parse
er_t xoico_stamp_s_parse( xoico_stamp_s* o, const xoico_host* host, x_source* source )
{
    // xoico_stamp.x:709:1
    BLM_INIT_LEVEL(0);
    xoico_compiler_s* compiler = o->group->compiler;
    bl_t verbatim = x_source_parse_bl(source," #?w'verbatim'" );
    
    st_s* st_stamp_name = ((st_s*)BLM_LEVEL_T_PUSH(0,st_s,st_s_create()));
    
    x_source_point_s_setup_from_source(&(o->source_point),source );
    
    xoico_transient_map_s_copy(&(o->transient_map),&(o->group->transient_map ));
    
    BLM_TRY(xoico_group_s_parse_name_st(o->group,source, st_stamp_name ))
    
    if( !st_s_ends_in_sc(st_stamp_name,"_s" ) ) BLM_RETURNV(er_t, x_source_parse_error_fa(source,"Stamp name '#<sc_t>' must end in '_s'.", st_stamp_name->sc ))
    
    if( x_source_parse_bl(source," #?'('" ) ) // functor args
    {BLM_INIT_LEVEL(1);
        xoico_args_s* args = ((xoico_args_s*)BLM_LEVEL_T_PUSH(1,xoico_args_s,xoico_args_s_create()));
        BLM_TRY(xoico_args_s_parse(args,host, source ))
        BLM_TRY(x_source_parse_fa(source," )" ))
    
        {const xoico_args_s* __a=args ;if(__a)for(sz_t __i=0;__i<__a->size;__i++){const xoico_arg_s* e=__a->data[__i];
        {BLM_INIT_LEVEL(5);
            xoico_stamp_self_item_s* self_item = ((xoico_stamp_self_item_s*)BLM_LEVEL_T_PUSH(5,xoico_stamp_self_item_s,xoico_stamp_self_item_s_create()));
            self_item->arg_of_initializer = true;
            self_item->copy_from_initializer = ( e->typespec.access_class == TYPEOF_const );
    
            BLM_TRY(xoico_arg_s_to_self_item_st(e,((const xoico_host*)(o)),&( self_item->st )))
            x_source_point_s_copy(&(self_item->source_point),&(e->source_point ));
            x_array_push_d(((x_array*)(BCORE_PASS_CREATE(xoico_stamp_arr_self_item_s,o->arr_self_item))),((x_inst*)(((xoico_stamp_self_item_s*)bcore_fork(self_item)) )));
            o->has_compact_initializer = true;
        BLM_DOWN();}
    }}BLM_DOWN();}
    
    // using assignment symbol is optional
    if( x_source_parse_bl(source," #?'=' " ) )
    {
        // nothing (error in case use of assignment becomes illegal)
    }
    
    if( x_source_parse_bl(source," #?w'extending'" ) )
    {BLM_INIT_LEVEL(1);
        st_s* templ_name = ((st_s*)BLM_LEVEL_T_PUSH(1,st_s,st_s_create()));
        BLM_TRY(xoico_group_s_parse_name_st(o->group,source, templ_name ))
    
        if( !st_s_ends_in_sc(templ_name,"_s" ) )
        {
            BLM_RETURNV(er_t, x_source_parse_error_fa(source,"Extending: Stamp name '#<sc_t>' must end in '_s'.", templ_name->sc ))
        }
    
        const xoico* item = xoico_compiler_s_get_const_item(compiler,btypeof( templ_name->sc ) );
        if( !item ) BLM_RETURNV(er_t, x_source_parse_error_fa(source,"Template #<sc_t> not found.", templ_name->sc ))
        if( item->_ != ((tp_t)(TYPEOF_xoico_stamp_s)) ) BLM_RETURNV(er_t, x_source_parse_error_fa(source,"Template #<sc_t> is no stamp.", templ_name->sc ))
        xoico_stamp_s_copy(o,((xoico_stamp_s*)(item)) );
    BLM_DOWN();}
    else if( !verbatim && o->group->extending_stamp )
    {
        xoico_stamp_s_copy(o,o->group->extending_stamp );
    }
    else
    {
        /// 'is_aware' is true by default
        if      ( x_source_parse_bl(source," #?w'obliv'" ) ) o->is_aware = false;
        else if ( x_source_parse_bl(source," #?w'aware'" ) ) o->is_aware = true;
        o->trait_name = o->group->tp_name;
    
        if( !x_source_parse_bl(source," #=?w'func'" ) && !x_source_parse_bl(source," #=?w'trans'" ) ) // if func follows, the brief-functor format was chosen
        {BLM_INIT_LEVEL(2);
            st_s st_trait_name;BLM_T_INIT_SPUSH(st_s, &st_trait_name);;
            BLM_TRY(xoico_group_s_parse_name_st(o->group,source,&( st_trait_name )))
            if( st_trait_name.size > 0 ) o->trait_name = xoico_compiler_s_entypeof(compiler,st_trait_name.sc );
        BLM_DOWN();}
    
        if( x_source_parse_bl(source," #?w'trans' " ) )
        {
            BLM_TRY(xoico_transient_map_s_parse_update(&(o->transient_map),((const xoico_host*)(o)), source ))
        }
    
    }
    
    st_s_copy(&(o->st_name),st_stamp_name );
    o->tp_name = xoico_compiler_s_entypeof(compiler,st_stamp_name->sc );
    BLM_TRY(xoico_stamp_s_parse_extend(o,source ))
    if( o->has_compact_initializer ) BLM_TRY(xoico_stamp_s_push_compact_initializer_func(o))
    
    BLM_RETURNV(er_t, 0)
}

er_t xoico_stamp_s_finalize( xoico_stamp_s* o, const xoico_host* host )
{
    // xoico_stamp.x:799:1
    BLM_INIT_LEVEL(0);
    //if( o.has_compact_initializer ) o.push_compact_initializer_func();
    
    if( o->finalized ) BLM_RETURNV(er_t, x_source_point_s_parse_error_fa(&(o->source_point),"In stamp '#<sc_t>': Attempting to finalize stamp twice.", o->st_name.sc ))
    
    xoico_compiler_s* compiler = o->group->compiler;
    st_s self_buf;BLM_T_INIT_SPUSH(st_s, &self_buf);;
    
    bcore_self_item_s* first_array_item = NULL; // !=NULL if stamp has an array;
    {BLM_INIT_LEVEL(1);
        bcore_self_s* self = ((bcore_self_s*)BLM_LEVEL_T_PUSH(1,bcore_self_s,bcore_self_s_create())); self->type = o->tp_name; self->trait = o->trait_name;
        {const xoico_stamp_arr_self_item_s* __a=o->arr_self_item ;if(__a)for(sz_t __i=0;__i<__a->size;__i++){xoico_stamp_self_item_s* self_item=&(__a->data[__i]);
        {BLM_INIT_LEVEL(5);
            bcore_self_item_s* item = ((bcore_self_item_s*)BLM_LEVEL_T_PUSH(5,bcore_self_item_s,bcore_self_item_s_create()));
            BLM_TRY(xoico_stamp_self_item_s_to_bcore_self_item(self_item,self, item ))
    
            if( xoico_compiler_s_is_group(compiler,item->type ) )
            {
                if( bcore_flect_caps_get_indirection( item->caps ) == 0 )
                {
                    BLM_RETURNV(er_t, x_source_point_s_parse_error_fa(&(self_item->source_point),"Element is a group at indirection 0. Was a pointer intended?\n" ))
                }
    
                if(  !item->flags.f_aware  &&  !item->flags.f_obliv  && !bcore_flect_caps_is_typed( item->caps ) )
                {
                    /// group reference: when type awareness is not specified but 'aware' is a legal option, assume 'aware'.
                    st_s_insert_sc(&(self_item->st),0, "aware " );
                }
            }
    
            if( bcore_flect_caps_is_array( item->caps ) && !first_array_item ) first_array_item = ((bcore_self_item_s*)BLM_LEVEL_T_PUSH(0,bcore_self_item_s,bcore_self_item_s_clone(item)));
            st_s_push_st(&(self_buf),&(self_item->st ));
        BLM_DOWN();}
    }}BLM_DOWN();}
    
    // set transient classes for x_array
    if( o->trait_name == ((tp_t)(TYPEOF_x_array)) || o->trait_name == ((tp_t)(TYPEOF_bcore_array)) )
    {
        if( !first_array_item )
        {
            BLM_RETURNV(er_t, x_source_point_s_parse_error_fa(&(o->source_point),"In stamp '#<sc_t>': Stamp is of trait 'x_array' but contains no array", o->st_name.sc ))
        }
        xoico_transient_map_s_set(&(o->transient_map),xoico_compiler_s_entypeof(compiler,"TO" ), o->tp_name );
        if( first_array_item->type ) xoico_transient_map_s_set(&(o->transient_map),xoico_compiler_s_entypeof(compiler,"TE" ), first_array_item->type );
    }
    
    // overload transient features
    {BLM_INIT_LEVEL(1);const bcore_arr_tp_s* __a=((bcore_arr_tp_s*)BLM_LEVEL_T_PUSH(1,bcore_arr_tp_s,xoico_transient_map_s_create_key_arr(&(o->transient_map)))) ;if(__a)for(sz_t __i=0;__i<__a->size;__i++){tp_t key=__a->data[__i];
    {
        const xoico_feature_s* feature = xoico_stamp_s_get_traitline_feature_from_name(o,key );
        if( feature )
        {BLM_INIT_LEVEL(5);
            if( !xoico_signature_s_fits_transient_type_feature(&(feature->signature)) )
            {BLM_INIT_LEVEL(6);
                st_s feature_reference;BLM_T_INIT_SPUSH(st_s, &feature_reference);;
                x_source_point_s_source_reference_to_sink(&(feature->source_point),false,((x_sink*)(&( feature_reference ))));
                BLM_RETURNV(er_t, x_source_point_s_parse_error_fa(&(o->source_point),"In stamp '#<sc_t>': Stamp uses transient feature '#<sc_t>' with triggers automatic overload of a feature with this name in the stamps traitline.\n"
                    "A matching feature was found in '#<sc_t>' but it does not satisfy signature-requirements for such an overload.\n"
                    "Suggestions:\n"
                    "   - Define feature in the form 'feature tp_t #<sc_t>( @*o );'. Or\n"
                    "   - If the feature has a different purpose:\n"
                    "       - Rename the feature. Or\n"
                    "       - Rename the transient type identifier '#<sc_t>'.\n",
                    o->st_name.sc,
                    xoico_compiler_s_nameof(compiler,feature->signature.name ),
                    feature_reference.sc,
                    xoico_compiler_s_nameof(compiler,feature->signature.name ),
                    xoico_compiler_s_nameof(compiler,feature->signature.name )
                ))
            BLM_DOWN();}
    
            tp_t type = xoico_transient_map_s_get(&(o->transient_map),key );
    
            st_s func_code;BLM_T_INIT_SPUSH(st_s, &func_code);st_s_push_fa(&(func_code),"#<sc_t>.#<sc_t> { = TYPEOF_#<sc_t>; }",
                xoico_compiler_s_nameof(compiler,feature->group->tp_name ),
                xoico_compiler_s_nameof(compiler,feature->signature.name ),
                xoico_compiler_s_nameof(compiler,type )
            );
    
            BLM_TRY(xoico_stamp_s_push_internal_func_from_sc(o,func_code.sc ))
        BLM_DOWN();}
    }
    
    }BLM_DOWN();}{const xoico_wraps_s* __a=&(o->wraps );if(__a)for(sz_t __i=0;__i<__a->size;__i++){xoico_wrap_s* wrap=__a->data[__i];
    {
        BLM_TRY(xoico_wrap_s_finalize(wrap,((const xoico_host*)(o ))))
        x_array_push_d(((x_array*)(&(o->funcs))),((x_inst*)(((xoico_func_s*)bcore_fork(wrap->func)) )));
    }
    
    }}{const xoico_funcs_s* __a=&(o->funcs );if(__a)for(sz_t __i=0;__i<__a->size;__i++){xoico_func_s* func=__a->data[__i];
    {
        BLM_TRY(xoico_func_s_finalize(func,((const xoico_host*)(o ))))
        if( xoico_func_s_reflectable(func,((const xoico_host*)(o ))) ) BLM_TRY(xoico_func_s_push_flect_decl_to_sink(func,((const xoico_host*)(o)),((x_sink*)(&( self_buf )))))
        BLM_TRY(xoico_compiler_s_register_func(compiler,func ))
    }
    
    }}st_s_attach( &(o->self_source ),  st_s_create());
    st_s_push_fa(o->self_source,"#<sc_t> =", o->st_name.sc );
    if( o->is_aware ) st_s_push_sc(o->self_source,"aware " );
    st_s_push_sc(o->self_source,xoico_compiler_s_nameof(compiler,o->trait_name ) );
    st_s_push_fa(o->self_source,"{#<st_s*>}", (&(self_buf)) );
    
    bcore_self_s_attach( &(o->self ),  bcore_self_s_parse_source( ( bcore_source* )((x_source*)BLM_LEVEL_A_PUSH(0,x_source_create_from_st(o->self_source ))), 0, 0, o->group->st_name.sc, false ));
    
    // checking for repetitions in o.self (non-functions)
    bcore_hmap_tp_s* hmap_name = ((bcore_hmap_tp_s*)BLM_LEVEL_T_PUSH(0,bcore_hmap_tp_s,bcore_hmap_tp_s_create()));
    sz_t self_items = bcore_self_s_items_size( o->self );
    for(sz_t i = 0; i < self_items; i++ )
    {
        const bcore_self_item_s* item = bcore_self_s_get_item(o->self,i );
        if( item->name && ( item->caps != BCORE_CAPS_EXTERNAL_FUNC ) )
        {
            if( bcore_hmap_tp_s_exists(hmap_name,item->name ) )
            {
                BLM_RETURNV(er_t, x_source_point_s_parse_error_fa(&(o->source_point),"In stamp '#<sc_t>': Repeated use of member name '#<sc_t>'.", o->st_name.sc, xoico_compiler_s_nameof(compiler,item->name ) ))
            }
    
            bcore_hmap_tp_s_set(hmap_name,item->name );
        }
    }
    
    // check validity of trait name
    if( !xoico_compiler_s_is_group(compiler,o->trait_name ) )
    {
        BLM_RETURNV(er_t, x_source_point_s_parse_error_fa(&(o->source_point),"In stamp '#<sc_t>': Trait name '#<sc_t>' is not a group.", o->st_name.sc, xoico_compiler_s_nameof(compiler,o->trait_name ) ))
    }
    
    // update retrievability of groups in traitline
    for(tp_t trait_name = o->trait_name; trait_name != 0; )
    {
        const xoico_group_s* group = xoico_compiler_s_get_group(compiler,trait_name );
        trait_name = group->trait_name != group->tp_name ? group->trait_name : 0;
        if( group->is_retrievable ) bcore_arr_tp_s_push(BCORE_PASS_CREATE(bcore_arr_tp_s,group->retrievable_stamps),o->tp_name );
    }
    
    o->finalized = true;
    
    BLM_RETURNV(er_t, 0)
}

er_t xoico_stamp_s_expand_declaration( const xoico_stamp_s* o, const xoico_host* host, sz_t indent, x_sink* sink )
{
    // xoico_stamp.x:946:1
    
    sc_t sc_name = o->st_name.sc;
    
    x_sink_push_fa(sink,"#rn{ }##define TYPEOF_#<sc_t> 0x#pl16'0'{#X<tp_t>}ull\n", indent, sc_name, btypeof( sc_name ) );
    
    x_sink_push_fa(sink,"#rn{ }##define BETH_EXPAND_ITEM_#<sc_t>", indent, sc_name, sc_name );
    x_sink_push_fa(sink," \\\n#rn{ }  BCORE_DECLARE_OBJECT( #<sc_t> )", indent, sc_name );
    x_sink_push_fa(sink," \\\n" );
    
    bcore_self_s_struct_body_to_sink_newline_escaped( o->self, indent + 2, ( bcore_sink* )sink );
    x_sink_push_fa(sink,";" );
    
    {const xoico_funcs_s* __a=&(o->funcs );if(__a)for(sz_t __i=0;__i<__a->size;__i++){xoico_func_s* func=__a->data[__i]; BLM_TRY(xoico_func_s_expand_forward(func,((const xoico_host*)(o)), indent + 2, sink )) // expands all prototypes
    }}{const xoico_funcs_s* __a=&(o->funcs );if(__a)for(sz_t __i=0;__i<__a->size;__i++){xoico_func_s* func=__a->data[__i]; BLM_TRY(xoico_func_s_expand_declaration(func,((const xoico_host*)(o)), indent + 2, sink )) // only expands static inline functions
    
    }}x_sink_push_fa(sink,"\n" );
    return  0;
}

er_t xoico_stamp_s_expand_definition( const xoico_stamp_s* o, const xoico_host* host, sz_t indent, x_sink* sink )
{
    // xoico_stamp.x:968:1
    BLM_INIT_LEVEL(0);
    st_s* embedded_string = ((st_s*)BLM_LEVEL_T_PUSH(0,st_s,xoico_stamp_create_embedded_string(o->self_source )));
    
    // Issue below was mitigated by using nasc strings; error check can be removed
    // 4095 is the C99-limit for string literals
    //    if( embedded_string.size > 4095 )
    //    {
    //        return o.source_point.parse_error_fa
    //        (
    //            "Reflection embedding failed. (Stamp is too large)\n"
    //            "The embedded code would require a string literal larger than 4095 characters.\n"
    //            "This exceeds the limit defined in C99.\n"
    //        );
    //    }
    
    sz_t idx = st_s_find_char(embedded_string,0, -1, '=' );
    sc_t self_def = "";
    if( idx < embedded_string->size )
    {
        self_def = embedded_string->sc + idx + 1;
    }
    
    x_sink_push_fa(sink,"\n" );
    
    //   old code before nasc strings
    //    sink.push_fa( "#rn{ }BCORE_DEFINE_OBJECT_INST_P( #<sc_t> )\n", indent, o.st_name.sc );
    //    m st_s* multiline_string = xoico_stamp_create_structured_multiline_string( self_def, indent )^;
    //    sink.push_fa( "#<sc_t>;\n", multiline_string.sc );
    
    x_sink_push_fa(sink,"#rn{ }BCORE_DEFINE_OBJECT_INST_P_NASC_BEGIN( #<sc_t> )\n", indent, o->st_name.sc );
    st_s* multiline_nasc_string = ((st_s*)BLM_LEVEL_T_PUSH(0,st_s,xoico_stamp_create_structured_multiline_string_nasc(self_def, indent )));
    x_sink_push_fa(sink,"#<sc_t>,\n", multiline_nasc_string->sc );
    x_sink_push_fa(sink,"#rn{ }BCORE_DEFINE_OBJECT_INST_P_NASC_END( #<sc_t> )\n", indent, o->st_name.sc );
    
    {const xoico_funcs_s* __a=&(o->funcs );if(__a)for(sz_t __i=0;__i<__a->size;__i++){xoico_func_s* func=__a->data[__i]; BLM_TRY(xoico_func_s_expand_definition(func,((const xoico_host*)(o)), indent, sink ))
    
    }}BLM_RETURNV(er_t, 0)
}

er_t xoico_stamp_s_expand_init1( const xoico_stamp_s* o, const xoico_host* host, sz_t indent, x_sink* sink )
{
    // xoico_stamp.x:1010:1
    
    xoico_compiler_s* compiler = o->group->compiler;
    
    {const xoico_funcs_s* __a=&(o->funcs );if(__a)for(sz_t __i=0;__i<__a->size;__i++){xoico_func_s* func=__a->data[__i];
    {
        if( xoico_func_s_reflectable(func,host ) )
        {
            const xoico_signature_s* signature = func->signature;
            x_sink_push_fa(sink,"#rn{ }BCORE_REGISTER_FFUNC( #<sc_t>, #<sc_t>_#<sc_t> );\n",
                indent,
                xoico_compiler_s_nameof(compiler,signature->global_name ),
                o->st_name.sc,
                xoico_compiler_s_nameof(compiler,func->name )
            );
        }
    }
    }}x_sink_push_fa(sink,"#rn{ }BCORE_REGISTER_OBJECT( #<sc_t> );\n", indent, o->st_name.sc );
    return  0;
}

BCORE_DEFINE_OBJECT_INST_P_NASC_BEGIN( xoico_stamp_self_item_s )
"aware xoico_stamp",
"{",
    "x_source_point_s source_point;",
    "st_s st;",
    "bl_t arg_of_initializer;",
    "bl_t copy_from_initializer;",
"}",
BCORE_DEFINE_OBJECT_INST_P_NASC_END( xoico_stamp_self_item_s )

er_t xoico_stamp_self_item_s_to_bcore_self_item( const xoico_stamp_self_item_s* o, const bcore_self_s* self, bcore_self_item_s* item )
{
    // xoico_stamp.x:140:5
    BLM_INIT_LEVEL(0);
    er_t er = bcore_self_item_s_parse_src( item, sr_awc(((const x_inst*)( ((x_source*)BLM_LEVEL_A_PUSH(0,x_source_create_from_st(&(o->st )))) ))), self, false );
    
    if( er )
    {BLM_INIT_LEVEL(1);
        st_s* msg = ((st_s*)BLM_LEVEL_T_PUSH(1,st_s,st_s_create()));
        bcore_error_pop_st((&(er)), msg );
        BLM_RETURNV(er_t, x_source_point_s_parse_error_fa(&(o->source_point),"#<sc_t>\n", msg->sc ))
    BLM_DOWN();}
    BLM_RETURNV(er_t, 0)
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %rdx, %rbx
movq %rsi, %rbp
movq %rdi, %r14
leaq 0x1779dd(%rip), %rax    # 0x19bdd0
movq (%rax), %rsi
leaq 0x38(%rsp), %r15
movq %r15, %rdi
callq 0xd6675
movq $0x0, 0x10(%r15)
movq 0xc8(%r14), %rax
movq 0x140(%rax), %rax
movq %rax, 0x18(%rsp)
movq (%rbx), %r15
leaq 0x1788a0(%rip), %rdx    # 0x19ccc8
movl (%rdx), %eax
cltq
leaq (%rax,%rax,2), %rax
movq 0x20(%rdx,%rax,8), %rcx
movq 0x18(%rdx,%rax,8), %rdx
andq %r15, %rdx
shlq $0x4, %rdx
leaq (%rcx,%rdx), %rax
movq (%rcx,%rdx), %rdx
movl $0x8, %ecx
cmpq %r15, %rdx
je 0x2447d
movq 0x10(%rax), %rdx
movl $0x18, %ecx
cmpq %r15, %rdx
je 0x2447d
movq 0x20(%rax), %rdx
movl $0x28, %ecx
cmpq %r15, %rdx
je 0x2447d
movq 0x30(%rax), %rdx
movl $0x38, %ecx
cmpq %r15, %rdx
jne 0x24486
movq (%rax,%rcx), %r12
testq %r12, %r12
jne 0x244ad
movabsq $-0x7e8ee9b9b4bbaa8, %rdi # imm = 0xF817116464B44558
movq %r15, %rsi
callq 0xe9bc5
movq %rax, %r12
leaq 0x178826(%rip), %rdi    # 0x19ccc8
movq %r15, %rsi
movq %rax, %rdx
callq 0x115fac
movabsq $-0x503db0e6e1c2e704, %r15 # imm = 0xAFC24F191E3D18FC
leaq 0x10a860(%rip), %rdx    # 0x12ed1e
movq %r12, %rdi
movq %rbx, %rsi
callq 0xffe2b
movb %al, 0x7(%rsp)
xorl %eax, %eax
callq 0x109c82
leaq 0x38(%rsp), %rdi
xorl %esi, %esi
movq %r15, %rdx
movq %rax, %rcx
callq 0xd68a8
movq %rax, 0x10(%rsp)
leaq 0xd8(%r14), %r15
movq %rbx, %rdi
callq 0xbe7e4
movq %r15, %rdi
movq %rax, %rsi
callq 0x242ed
movq (%rbx), %r15
leaq 0x1787b9(%rip), %rdx    # 0x19ccc8
movl (%rdx), %eax
cltq
leaq (%rax,%rax,2), %rax
movq 0x20(%rdx,%rax,8), %rcx
movq 0x18(%rdx,%rax,8), %rdx
andq %r15, %rdx
shlq $0x4, %rdx
leaq (%rcx,%rdx), %rax
movq (%rcx,%rdx), %rdx
movl $0x8, %ecx
cmpq %r15, %rdx
je 0x24564
movq 0x10(%rax), %rdx
movl $0x18, %ecx
cmpq %r15, %rdx
je 0x24564
movq 0x20(%rax), %rdx
movl $0x28, %ecx
cmpq %r15, %rdx
je 0x24564
movq 0x30(%rax), %rdx
movl $0x38, %ecx
cmpq %r15, %rdx
jne 0x2456d
movq (%rax,%rcx), %r12
testq %r12, %r12
jne 0x24594
movabsq $-0x7e8ee9b9b4bbaa8, %rdi # imm = 0xF817116464B44558
movq %r15, %rsi
callq 0xe9bc5
movq %rax, %r12
leaq 0x17873f(%rip), %rdi    # 0x19ccc8
movq %r15, %rsi
movq %rax, %rdx
callq 0x115fac
movq %r12, %rdi
movq %rbx, %rsi
callq 0xffe72
movq %rax, 0xe0(%r14)
leaq 0x98(%r14), %r13
movl $0xe0, %esi
addq 0xc8(%r14), %rsi
movq %r13, %rdi
callq 0x1238a
movq 0xc8(%r14), %rdi
movq %rbx, %rsi
movq 0x10(%rsp), %r12
movq %r12, %rdx
callq 0x213bd
testq %rax, %rax
jne 0x247d9
movq %r13, 0x30(%rsp)
leaq 0x122c72(%rip), %rsi    # 0x14725f
movq %r12, %rdi
callq 0x10a962
testb %al, %al
je 0x247c3
movq (%rbx), %r15
leaq 0x1786c1(%rip), %rdx    # 0x19ccc8
movl (%rdx), %eax
cltq
leaq (%rax,%rax,2), %rax
movq 0x20(%rdx,%rax,8), %rcx
movq 0x18(%rdx,%rax,8), %rdx
andq %r15, %rdx
shlq $0x4, %rdx
leaq (%rcx,%rdx), %rax
movq (%rcx,%rdx), %rdx
movl $0x8, %ecx
cmpq %r15, %rdx
je 0x2465c
movq 0x10(%rax), %rdx
movl $0x18, %ecx
cmpq %r15, %rdx
je 0x2465c
movq 0x20(%rax), %rdx
movl $0x28, %ecx
cmpq %r15, %rdx
je 0x2465c
movq 0x30(%rax), %rdx
movl $0x38, %ecx
cmpq %r15, %rdx
jne 0x24665
movq (%rax,%rcx), %r12
testq %r12, %r12
jne 0x2468c
movabsq $-0x7e8ee9b9b4bbaa8, %rdi # imm = 0xF817116464B44558
movq %r15, %rsi
callq 0xe9bc5
movq %rax, %r12
leaq 0x178647(%rip), %rdi    # 0x19ccc8
movq %r15, %rsi
movq %rax, %rdx
callq 0x115fac
leaq 0x108ea2(%rip), %rdx    # 0x12d535
movq %r12, %rdi
movq %rbx, %rsi
callq 0xffe2b
testb %al, %al
je 0x248ef
leaq 0x98(%rsp), %rdi
movq %rdi, 0x8(%rsp)
leaq 0x38(%rsp), %rsi
callq 0xd6675
movq 0x8(%rsp), %r15
movq $0x1, 0x10(%r15)
callq 0x13aca
movabsq $0x40f4054e83f33d09, %rdx # imm = 0x40F4054E83F33D09
movl $0x1, %esi
movq %r15, %rdi
movq %rax, %rcx
callq 0xd68a8
movq %rax, 0x28(%rsp)
movq (%rax), %r15
leaq 0x177728(%rip), %rax    # 0x19be20
movl (%rax), %ecx
movslq %ecx, %rcx
leaq (%rcx,%rcx,2), %rcx
movq 0x20(%rax,%rcx,8), %rdx
movq 0x18(%rax,%rcx,8), %rcx
andq %r15, %rcx
shlq $0x4, %rcx
leaq (%rdx,%rcx), %rax
movq (%rdx,%rcx), %rdx
movl $0x8, %ecx
cmpq %r15, %rdx
je 0x2474e
movq 0x10(%rax), %rdx
movl $0x18, %ecx
cmpq %r15, %rdx
je 0x2474e
movq 0x20(%rax), %rdx
movl $0x28, %ecx
cmpq %r15, %rdx
je 0x2474e
movq 0x30(%rax), %rdx
movl $0x38, %ecx
cmpq %r15, %rdx
jne 0x24757
movq (%rax,%rcx), %r12
testq %r12, %r12
jne 0x2477e
movabsq $-0x5073d588c3beb52e, %rdi # imm = 0xAF8C2A773C414AD2
movq %r15, %rsi
callq 0xe9bc5
movq %rax, %r12
leaq 0x1776ad(%rip), %rdi    # 0x19be20
movq %r15, %rsi
movq %rax, %rdx
callq 0x115fac
movq %r12, %rdi
movq 0x28(%rsp), %r12
movq %r12, %rsi
xorl %edx, %edx
callq 0xebeb6
movq %r12, %rdi
movq %rbp, %rsi
movq %rbx, %rdx
callq 0x13cf1
testq %rax, %rax
jne 0x247b9
leaq 0x1267ba(%rip), %rsi    # 0x14af64
movq %rbx, %rdi
xorl %eax, %eax
callq 0xda80
testq %rax, %rax
je 0x247fb
movq %rax, %r15
movq 0x8(%rsp), %rdi
jmp 0x247e1
movq 0x8(%r12), %rdx
leaq 0x10a569(%rip), %rsi    # 0x12ed38
movq %rbx, %rdi
xorl %eax, %eax
callq 0xde10
movq %rax, %r15
leaq 0x38(%rsp), %rdi
callq 0xd6d2c
movq %r15, %rax
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpq $0x0, 0x10(%r12)
je 0x248e5
xorl %r13d, %r13d
movq 0x8(%r12), %rax
movq (%rax,%r13,8), %rbp
movq 0x8(%rsp), %rsi
leaq 0x68(%rsp), %rdi
movq %rdi, 0x20(%rsp)
callq 0xd6675
movq 0x20(%rsp), %r15
movq $0x5, 0x10(%r15)
callq 0x2b178
movl $0x5, %esi
movq %r15, %rdi
movabsq $-0x4a7225c98ee69178, %rdx # imm = 0xB58DDA3671196E88
movq %rax, %rcx
callq 0xd68a8
movq %rax, %r12
movb $0x1, 0x40(%rax)
movabsq $0x65c9718e19e3df34, %rax # imm = 0x65C9718E19E3DF34
cmpq %rax, 0x30(%rbp)
sete 0x41(%r12)
leaq 0x20(%r12), %rdx
movq %rbp, %rdi
movq %r14, %rsi
callq 0x135fc
testq %rax, %rax
jne 0x24fa7
leaq 0x8(%r12), %rdi
addq $0x8, %rbp
movq %rbp, %rsi
callq 0x54692
movq 0x40(%r14), %r15
testq %r15, %r15
jne 0x248ad
callq 0x2b5d2
movq %rax, %r15
movq %rax, 0x40(%r14)
movq %r12, %rdi
callq 0xbe7e4
movq (%r15), %rsi
movq %r15, %rdi
movq %rax, %rdx
callq 0x55b79
movb $0x1, 0x39(%r14)
leaq 0x20(%rsp), %rdi
callq 0xd6d0d
incq %r13
movq 0x28(%rsp), %r12
cmpq 0x10(%r12), %r13
jb 0x2480a
leaq 0x8(%rsp), %rdi
callq 0xd6d0d
movq (%rbx), %r15
leaq 0x1783cf(%rip), %rdx    # 0x19ccc8
movl (%rdx), %eax
cltq
leaq (%rax,%rax,2), %rax
movq 0x20(%rdx,%rax,8), %rcx
movq 0x18(%rdx,%rax,8), %rdx
andq %r15, %rdx
shlq $0x4, %rdx
leaq (%rcx,%rdx), %rax
movq (%rcx,%rdx), %rdx
movl $0x8, %ecx
cmpq %r15, %rdx
je 0x2494e
movq 0x10(%rax), %rdx
movl $0x18, %ecx
cmpq %r15, %rdx
je 0x2494e
movq 0x20(%rax), %rdx
movl $0x28, %ecx
cmpq %r15, %rdx
je 0x2494e
movq 0x30(%rax), %rdx
movl $0x38, %ecx
cmpq %r15, %rdx
jne 0x24957
movq (%rax,%rcx), %r12
testq %r12, %r12
jne 0x2497e
movabsq $-0x7e8ee9b9b4bbaa8, %rdi # imm = 0xF817116464B44558
movq %r15, %rsi
callq 0xe9bc5
movq %rax, %r12
leaq 0x178355(%rip), %rdi    # 0x19ccc8
movq %r15, %rsi
movq %rax, %rdx
callq 0x115fac
leaq 0x109852(%rip), %rdx    # 0x12e1d7
movq %r12, %rdi
movq %rbx, %rsi
callq 0xffe2b
movq (%rbx), %r15
leaq 0x17832e(%rip), %rdx    # 0x19ccc8
movl (%rdx), %eax
cltq
leaq (%rax,%rax,2), %rax
movq 0x20(%rdx,%rax,8), %rcx
movq 0x18(%rdx,%rax,8), %rdx
andq %r15, %rdx
shlq $0x4, %rdx
leaq (%rcx,%rdx), %rax
movq (%rcx,%rdx), %rdx
movl $0x8, %ecx
cmpq %r15, %rdx
movq 0x30(%rsp), %rbp
je 0x249f4
movq 0x10(%rax), %rdx
movl $0x18, %ecx
cmpq %r15, %rdx
je 0x249f4
movq 0x20(%rax), %rdx
movl $0x28, %ecx
cmpq %r15, %rdx
je 0x249f4
movq 0x30(%rax), %rdx
movl $0x38, %ecx
cmpq %r15, %rdx
jne 0x249fd
movq (%rax,%rcx), %r12
testq %r12, %r12
jne 0x24a24
movabsq $-0x7e8ee9b9b4bbaa8, %rdi # imm = 0xF817116464B44558
movq %r15, %rsi
callq 0xe9bc5
movq %rax, %r12
leaq 0x1782af(%rip), %rdi    # 0x19ccc8
movq %r15, %rsi
movq %rax, %rdx
callq 0x115fac
leaq 0x109748(%rip), %rdx    # 0x12e173
movq %r12, %rdi
movq %rbx, %rsi
callq 0xffe2b
testb %al, %al
je 0x24b07
movq 0x18(%rsp), %r12
leaq 0x98(%rsp), %r15
movq %r15, 0x68(%rsp)
leaq 0x38(%rsp), %rsi
movq %r15, %rdi
callq 0xd6675
movq $0x1, 0x10(%r15)
xorl %eax, %eax
callq 0x109c82
movl $0x1, %esi
movq %r15, %rdi
movabsq $-0x503db0e6e1c2e704, %rdx # imm = 0xAFC24F191E3D18FC
movq %rax, %rcx
callq 0xd68a8
movq %rax, %r13
movq 0xc8(%r14), %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x213bd
movq %rax, %r15
testq %rax, %rax
jne 0x25025
leaq 0x1227b1(%rip), %rsi    # 0x14725f
movq %r13, %rdi
callq 0x10a962
movq 0x8(%r13), %rdx
testb %al, %al
je 0x24f9e
testq %rdx, %rdx
je 0x24fb4
movabsq $-0x340d631b7bdddcdb, %rdi # imm = 0xCBF29CE484222325
movb (%rdx), %cl
testb %cl, %cl
je 0x24fc0
incq %rdx
movabsq $0x100000001b3, %rax    # imm = 0x100000001B3
movzbl %cl, %esi
xorq %rdi, %rsi
imulq %rax, %rsi
movb (%rdx), %cl
incq %rdx
movq %rsi, %rdi
testb %cl, %cl
jne 0x24aec
jmp 0x24fc3
cmpb $0x0, 0x7(%rsp)
jne 0x24b33
movq 0xc8(%r14), %rax
movq 0x110(%rax), %rsi
testq %rsi, %rsi
je 0x24b33
movq %r14, %rdi
callq 0x287c2
movq 0x10(%rsp), %r12
jmp 0x24f3a
movq (%rbx), %r15
leaq 0x17818b(%rip), %rdx    # 0x19ccc8
movl (%rdx), %eax
cltq
leaq (%rax,%rax,2), %rax
movq 0x20(%rdx,%rax,8), %rcx
movq 0x18(%rdx,%rax,8), %rdx
andq %r15, %rdx
shlq $0x4, %rdx
leaq (%rcx,%rdx), %rax
movq (%rcx,%rdx), %rdx
movl $0x8, %ecx
cmpq %r15, %rdx
je 0x24b92
movq 0x10(%rax), %rdx
movl $0x18, %ecx
cmpq %r15, %rdx
je 0x24b92
movq 0x20(%rax), %rdx
movl $0x28, %ecx
cmpq %r15, %rdx
je 0x24b92
movq 0x30(%rax), %rdx
movl $0x38, %ecx
cmpq %r15, %rdx
jne 0x24b9b
movq (%rax,%rcx), %r12
testq %r12, %r12
jne 0x24bc2
movabsq $-0x7e8ee9b9b4bbaa8, %rdi # imm = 0xF817116464B44558
movq %r15, %rsi
callq 0xe9bc5
movq %rax, %r12
leaq 0x178111(%rip), %rdi    # 0x19ccc8
movq %r15, %rsi
movq %rax, %rdx
callq 0x115fac
leaq 0x1085d1(%rip), %rdx    # 0x12d19a
movq %r12, %rdi
movq %rbx, %rsi
callq 0xffe2b
testb %al, %al
je 0x24bdf
xorl %ecx, %ecx
jmp 0x24c86
movq (%rbx), %r15
leaq 0x1780df(%rip), %rdx    # 0x19ccc8
movl (%rdx), %eax
cltq
leaq (%rax,%rax,2), %rax
movq 0x20(%rdx,%rax,8), %rcx
movq 0x18(%rdx,%rax,8), %rdx
andq %r15, %rdx
shlq $0x4, %rdx
leaq (%rcx,%rdx), %rax
movq (%rcx,%rdx), %rdx
movl $0x8, %ecx
cmpq %r15, %rdx
je 0x24c3e
movq 0x10(%rax), %rdx
movl $0x18, %ecx
cmpq %r15, %rdx
je 0x24c3e
movq 0x20(%rax), %rdx
movl $0x28, %ecx
cmpq %r15, %rdx
je 0x24c3e
movq 0x30(%rax), %rdx
movl $0x38, %ecx
cmpq %r15, %rdx
jne 0x24c47
movq (%rax,%rcx), %r12
testq %r12, %r12
jne 0x24c6e
movabsq $-0x7e8ee9b9b4bbaa8, %rdi # imm = 0xF817116464B44558
movq %r15, %rsi
callq 0xe9bc5
movq %rax, %r12
leaq 0x178065(%rip), %rdi    # 0x19ccc8
movq %r15, %rsi
movq %rax, %rdx
callq 0x115fac
leaq 0x108531(%rip), %rdx    # 0x12d1a6
movq %r12, %rdi
movq %rbx, %rsi
callq 0xffe2b
movb $0x1, %cl
testb %al, %al
je 0x24c8a
movb %cl, 0x38(%r14)
movq 0xc8(%r14), %rax
movq 0xa8(%rax), %rax
movq %rax, 0x30(%r14)
movq (%rbx), %r15
leaq 0x178022(%rip), %rdx    # 0x19ccc8
movl (%rdx), %eax
cltq
leaq (%rax,%rax,2), %rax
movq 0x20(%rdx,%rax,8), %rcx
movq 0x18(%rdx,%rax,8), %rdx
andq %r15, %rdx
shlq $0x4, %rdx
leaq (%rcx,%rdx), %rax
movq (%rcx,%rdx), %rdx
movl $0x8, %ecx
cmpq %r15, %rdx
je 0x24cfb
movq 0x10(%rax), %rdx
movl $0x18, %ecx
cmpq %r15, %rdx
je 0x24cfb
movq 0x20(%rax), %rdx
movl $0x28, %ecx
cmpq %r15, %rdx
je 0x24cfb
movq 0x30(%rax), %rdx
movl $0x38, %ecx
cmpq %r15, %rdx
jne 0x24d04
movq (%rax,%rcx), %r12
testq %r12, %r12
jne 0x24d2b
movabsq $-0x7e8ee9b9b4bbaa8, %rdi # imm = 0xF817116464B44558
movq %r15, %rsi
callq 0xe9bc5
movq %rax, %r12
leaq 0x177fa8(%rip), %rdi    # 0x19ccc8
movq %r15, %rsi
movq %rax, %rdx
callq 0x115fac
leaq 0x10a02d(%rip), %rdx    # 0x12ed5f
movq %r12, %rdi
movq %rbx, %rsi
callq 0xffe2b
testb %al, %al
jne 0x24e79
movq (%rbx), %r15
leaq 0x177f79(%rip), %rdx    # 0x19ccc8
movl (%rdx), %eax
cltq
leaq (%rax,%rax,2), %rax
movq 0x20(%rdx,%rax,8), %rcx
movq 0x18(%rdx,%rax,8), %rdx
andq %r15, %rdx
shlq $0x4, %rdx
leaq (%rcx,%rdx), %rax
movq (%rcx,%rdx), %rdx
movl $0x8, %ecx
cmpq %r15, %rdx
je 0x24da4
movq 0x10(%rax), %rdx
movl $0x18, %ecx
cmpq %r15, %rdx
je 0x24da4
movq 0x20(%rax), %rdx
movl $0x28, %ecx
cmpq %r15, %rdx
je 0x24da4
movq 0x30(%rax), %rdx
movl $0x38, %ecx
cmpq %r15, %rdx
jne 0x24dad
movq (%rax,%rcx), %r12
testq %r12, %r12
jne 0x24dd4
movabsq $-0x7e8ee9b9b4bbaa8, %rdi # imm = 0xF817116464B44558
movq %r15, %rsi
callq 0xe9bc5
movq %rax, %r12
leaq 0x177eff(%rip), %rdi    # 0x19ccc8
movq %r15, %rsi
movq %rax, %rdx
callq 0x115fac
leaq 0x109f90(%rip), %rdx    # 0x12ed6b
movq %r12, %rdi
movq %rbx, %rsi
callq 0xffe2b
testb %al, %al
jne 0x24e79
leaq 0x98(%rsp), %r15
movq %r15, 0x8(%rsp)
leaq 0x38(%rsp), %rsi
movq %r15, %rdi
callq 0xd6675
movq $0x2, 0x10(%r15)
leaq 0x68(%rsp), %r12
movq %r12, %rdi
callq 0x109030
movq %r15, %rdi
movabsq $-0x503db0e6e1c2e704, %rsi # imm = 0xAFC24F191E3D18FC
movq %r12, %rdx
callq 0xd68d9
movq 0xc8(%r14), %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x213bd
testq %rax, %rax
jne 0x25022
cmpq $0x0, 0x78(%rsp)
je 0x24e6f
movq 0x70(%rsp), %rsi
movq 0x18(%rsp), %rax
leaq 0x140(%rax), %rdi
callq 0xd3d8e
movq %rax, 0x30(%r14)
leaq 0x8(%rsp), %rdi
callq 0xd6d0d
movq (%rbx), %r15
leaq 0x177e45(%rip), %rdx    # 0x19ccc8
movl (%rdx), %eax
cltq
leaq (%rax,%rax,2), %rax
movq 0x20(%rdx,%rax,8), %rcx
movq 0x18(%rdx,%rax,8), %rdx
andq %r15, %rdx
shlq $0x4, %rdx
leaq (%rcx,%rdx), %rax
movq (%rcx,%rdx), %rdx
movl $0x8, %ecx
cmpq %r15, %rdx
je 0x24ed8
movq 0x10(%rax), %rdx
movl $0x18, %ecx
cmpq %r15, %rdx
je 0x24ed8
movq 0x20(%rax), %rdx
movl $0x28, %ecx
cmpq %r15, %rdx
je 0x24ed8
movq 0x30(%rax), %rdx
movl $0x38, %ecx
cmpq %r15, %rdx
jne 0x24ee1
movq (%rax,%rcx), %r12
testq %r12, %r12
jne 0x24f08
movabsq $-0x7e8ee9b9b4bbaa8, %rdi # imm = 0xF817116464B44558
movq %r15, %rsi
callq 0xe9bc5
movq %rax, %r12
leaq 0x177dcb(%rip), %rdi    # 0x19ccc8
movq %r15, %rsi
movq %rax, %rdx
callq 0x115fac
leaq 0x1092e3(%rip), %rdx    # 0x12e1f2
movq %r12, %rdi
movq %rbx, %rsi
callq 0xffe2b
testb %al, %al
movq 0x10(%rsp), %r12
je 0x24f3a
movq %rbp, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x12757
testq %rax, %rax
jne 0x247d9
leaq 0x8(%r14), %rdi
movq %r12, %rsi
callq 0x1094fa
movq 0x8(%r12), %rsi
movq 0x18(%rsp), %rdi
addq $0x140, %rdi            # imm = 0x140
callq 0xd3d8e
movq %rax, 0x28(%r14)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x28cd4
testq %rax, %rax
jne 0x247d9
cmpb $0x1, 0x39(%r14)
jne 0x24f8c
movq %r14, %rdi
callq 0x29a8b
testq %rax, %rax
jne 0x247d9
leaq 0x38(%rsp), %rdi
callq 0xd6d2c
xorl %r15d, %r15d
jmp 0x247e6
leaq 0x109d88(%rip), %rsi    # 0x12ed2d
jmp 0x25018
movq %rax, %r15
movq 0x20(%rsp), %rdi
jmp 0x247e1
movabsq $-0x509c42b379fe4821, %rsi # imm = 0xAF63BD4C8601B7DF
jmp 0x24fc3
movq %rdi, %rsi
leaq 0x78(%r12), %rdi
callq 0xca94f
testq %rax, %rax
je 0x25000
movq (%rax), %rsi
testq %rsi, %rsi
je 0x25000
movabsq $0x12d01d78049fae7, %rax # imm = 0x12D01D78049FAE7
cmpq %rax, (%rsi)
jne 0x2500d
movq %r14, %rdi
callq 0x287c2
leaq 0x68(%rsp), %rdi
callq 0xd6d0d
jmp 0x24b29
movq 0x8(%r13), %rdx
leaq 0x109185(%rip), %rsi    # 0x12e190
jmp 0x25018
movq 0x8(%r13), %rdx
leaq 0x109194(%rip), %rsi    # 0x12e1ac
movq %rbx, %rdi
xorl %eax, %eax
callq 0xde10
movq %rax, %r15
leaq 0x98(%rsp), %rdi
jmp 0x247e1