// File: /workspace/github_c_makefile_star2_O2/johsteffens[P]beth/xoico/src/xoico.xo.c
// Function: xoico_che_s_try_trans_declaration
er_t xoico_che_s_try_trans_declaration( xoico_che_s* o, x_source* source, xoico_che_result* result_out, bl_t* success )
{
    // xoico_che.x:1554:1
    BLM_INIT_LEVEL(0);
    if( success ) (*(success)) = false;
    
    xoico_typespec_s* typespec_var = ((xoico_typespec_s*)BLM_LEVEL_T_PUSH(0,xoico_typespec_s,xoico_typespec_s_create()));
    
    sz_t index = x_source_get_index(source);
    
    xoico_che_result_arr_s* result_var = ((xoico_che_result_arr_s*)BLM_LEVEL_T_PUSH(0,xoico_che_result_arr_s,xoico_che_result_arr_s_create()));
    
    bl_t success_take_typespec = false;
    BLM_TRY(xoico_che_s_try_take_typespec(o,source, typespec_var, true, (&(success_take_typespec)) ))
    
    if( !success_take_typespec )
    {
        x_source_set_index(source,index );
        BLM_RETURNV(er_t, 0)
    }
    
    BLM_TRY(xoico_che_s_trans_whitespace(o,source,((xoico_che_result*)( result_var ))))
    
    if
    (
        typespec_var->type &&
        x_source_parse_bl(source,"#?(([0]>='A'&&[0]<='Z')||([0]>='a'&&[0]<='z')||[0]=='_')" )
    )
    {
        tp_t tp_identifier = 0;
        BLM_TRY(xoico_che_s_trans_identifier(o,source,((xoico_che_result*)( result_var)), (&(tp_identifier)) ))
        BLM_TRY(xoico_che_s_trans_whitespace(o,source,((xoico_che_result*)( result_var ))))
    
        if( x_source_parse_bl(source,"#?'='" ) ) // assignment
        {
            if( typespec_var->flag_scope ) BLM_RETURNV(er_t, x_source_parse_error_fa(source,"Declaration-syntax: Stack-scope requested with subsequent assignment." ))
            bl_t pushed_typedecl = false;
            if( typespec_var->type != ((tp_t)(TYPEOF_type_deduce)) )
            {
                xoico_che_s_push_typedecl(o,typespec_var, tp_identifier );
                pushed_typedecl = true;
            }
    
            BLM_TRY(xoico_che_result_arr_s_push_sc(result_var,"=" ))
            xoico_typespec_s* typespec_expr = ((xoico_typespec_s*)BLM_LEVEL_T_PUSH(0,xoico_typespec_s,xoico_typespec_s_create()));
            xoico_che_result_arr_s* result_expr = ((xoico_che_result_arr_s*)BLM_LEVEL_T_PUSH(0,xoico_che_result_arr_s,xoico_che_result_arr_s_create()));
            BLM_TRY(xoico_che_s_trans_expression(o,source,((xoico_che_result*)( result_expr)), typespec_expr ))
    
            if( typespec_var->type == ((tp_t)(TYPEOF_type_deduce)) )
            {
                if( !typespec_expr->type )
                {
                    BLM_RETURNV(er_t, x_source_parse_error_fa(source,"Declaration-syntax: Deduce requested but expression is intractable." ))
                }
                typespec_var->type = typespec_expr->type;
            }
    
            if( typespec_expr->type )
            {
                if( typespec_expr->access_class != typespec_var->access_class )
                {
                    if( typespec_expr->access_class == TYPEOF_discardable )
                    {
                        BLM_RETURNV(er_t, x_source_parse_error_fa(source,"Declaration-syntax: Assignment: Conversion discards typespec 'discardable'." ))
                    }
    
                    if( typespec_var->access_class == TYPEOF_discardable )
                    {
                        BLM_RETURNV(er_t, x_source_parse_error_fa(source,"Declaration-syntax: Assignment: Conversion requires typespec 'discardable'." ))
                    }
                }
                BLM_TRY(xoico_che_s_adapt_expression(o,source, typespec_expr, typespec_var,((const xoico_che_result*)( result_expr)),((xoico_che_result*)( result_var ))))
            }
            else
            {
                xoico_che_result_arr_s_push_result_d(result_var,((xoico_che_result*)(((xoico_che_result_arr_s*)bcore_fork(result_expr)) )));
            }
            BLM_TRY(xoico_che_s_push_typespec(o,typespec_var, result_out ))
            BLM_TRY(xoico_che_result_a_push_char(result_out,' ' ))
            xoico_che_result_a_push_result_d(result_out,((xoico_che_result*)(((xoico_che_result_arr_s*)bcore_fork(result_var)) )));
            if( !pushed_typedecl ) xoico_che_s_push_typedecl(o,typespec_var, tp_identifier );
        }
        else if( typespec_var->type == ((tp_t)(TYPEOF_type_deduce)) )
        {
            BLM_RETURNV(er_t, x_source_parse_error_fa(source,"Declaration-syntax: Deduce requested without assignment." ))
        }
        else if( x_source_parse_bl(source,"#=?'['" ) ) // c-style array
        {
            if( typespec_var->flag_scope ) BLM_RETURNV(er_t, x_source_parse_error_fa(source,"Declaration-syntax: Stack-scope requested on C-style array." ))
            BLM_TRY(xoico_che_s_push_typespec(o,typespec_var, result_out ))
            while( x_source_parse_bl(source,"#?'['" ) )
            {
                BLM_TRY(xoico_che_result_arr_s_push_char(result_var,'[' ))
                BLM_TRY(xoico_che_s_trans_expression(o,source,((xoico_che_result*)( result_var)), NULL ))
                BLM_TRY(x_source_parse_fa(source,"]" ))
                BLM_TRY(xoico_che_result_arr_s_push_char(result_var,']' ))
                typespec_var->indirection++;
            }
            BLM_TRY(xoico_che_result_a_push_char(result_out,' ' ))
            xoico_che_result_a_push_result_d(result_out,((xoico_che_result*)(((xoico_che_result_arr_s*)bcore_fork(result_var)) )));
            xoico_che_s_push_typedecl(o,typespec_var, tp_identifier );
    
            BLM_TRY(xoico_che_s_trans_whitespace(o,source,((xoico_che_result*)( result_var ))))
            if( x_source_parse_bl(source,"#?'='" ) ) // c-style initialization
            {
                BLM_TRY(xoico_che_result_arr_s_push_sc(result_var,"=" ))
                BLM_TRY(xoico_che_s_trans_whitespace(o,source,((xoico_che_result*)( result_var ))))
                BLM_TRY(xoico_che_s_trans_block(o,source,((xoico_che_result*)( result_var)), false ))
            }
        }
        else
        {
            BLM_TRY(xoico_che_s_push_typespec(o,typespec_var, result_out ))
            BLM_TRY(xoico_che_result_a_push_char(result_out,' ' ))
            xoico_che_result_a_push_result_d(result_out,((xoico_che_result*)(((xoico_che_result_arr_s*)bcore_fork(result_var)) )));
            xoico_che_s_push_typedecl(o,typespec_var, tp_identifier );
    
            if( typespec_var->flag_scope )
            {
                BLM_TRY(xoico_che_result_a_push_char(result_out,';' ))
                BLM_TRY(xoico_che_result_push_fa(result_out,"BLM_T_INIT_SPUSH(#<sc_t>, &#<sc_t>);", xoico_che_s_nameof(o,typespec_var->type ), xoico_che_s_nameof(o,tp_identifier ) ))
                o->stack_block.adl.data[ o->block_level ]->use_blm = true;
    
                // debug
                if( !x_source_parse_bl(source," #=?';'" ) )
                {
                    xoico_che_result_arr_s* result_local = ((xoico_che_result_arr_s*)BLM_LEVEL_T_PUSH(0,xoico_che_result_arr_s,xoico_che_result_arr_s_create()));
                    BLM_TRY(xoico_che_result_push_fa(((xoico_che_result*)(result_local)),"#<sc_t>", xoico_che_s_nameof(o,tp_identifier ) ))
                    BLM_TRY(xoico_che_s_trans_typespec_expression(o,source,((xoico_che_result*)( result_local)), typespec_var, NULL ))
                    xoico_che_result_a_push_result_d(result_out,((xoico_che_result*)(((xoico_che_result_arr_s*)bcore_fork(result_local)) )));
                }
            }
        }
    
        // catch group variable at indirection 0
        if( typespec_var->indirection == 0 && xoico_che_s_is_group(o,typespec_var->type ) )
        {
            BLM_RETURNV(er_t, x_source_parse_error_fa(source,"Declaration-syntax: Variable of group-type has indirection 0." ))
        }
    
        if( success ) (*(success)) = true;
    }
    else // no declaration
    {
        x_source_set_index(source,index );
        BLM_RETURNV(er_t, 0)
    }
    
    if( success ) (*(success)) = true;
    
    BLM_RETURNV(er_t, 0)
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rcx, %r14
movq %rdx, 0x28(%rsp)
movq %rsi, %rbx
movq %rdi, 0x8(%rsp)
leaq 0xf737e(%rip), %rax     # 0x117dd0
movq (%rax), %rsi
leaq 0x38(%rsp), %r15
movq %r15, %rdi
callq 0x717f5
andq $0x0, 0x10(%r15)
testq %r14, %r14
je 0x20a70
movb $0x0, (%r14)
movq %r14, 0x30(%rsp)
movabsq $-0x641110359430e9c5, %r15 # imm = 0x9BEEEFCA6BCF163B
movabsq $-0x7850996cdf80346a, %r12 # imm = 0x87AF6693207FCB96
callq 0xe090
leaq 0x38(%rsp), %rbp
movq %rbp, %rdi
xorl %esi, %esi
movq %r15, %rdx
movq %rax, %rcx
callq 0x71967
movq %rax, %r14
movq %rbx, %rdi
callq 0x10a95
movq %rax, %r13
callq 0x2637f
movq %rbp, %rdi
xorl %esi, %esi
movq %r12, %rdx
movq %rax, %rcx
callq 0x71967
movq %rax, %r12
leaq 0x17(%rsp), %r8
movb $0x0, (%r8)
pushq $0x1
popq %rcx
movq 0x8(%rsp), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x1ea5b
testq %rax, %rax
je 0x20afc
movq %rax, %rbp
leaq 0x38(%rsp), %rdi
callq 0x71b64
jmp 0x20bbb
movq %r14, (%rsp)
movq %r12, 0x18(%rsp)
cmpb $0x0, 0x17(%rsp)
je 0x20ba4
movq %rbx, %rsi
movq 0x18(%rsp), %rbp
movq %rbp, %rdx
callq 0x1dc6b
movq (%rsp), %rax
cmpq $0x0, 0x8(%rax)
je 0x20ba4
leaq 0x950f2(%rip), %rsi     # 0xb5c24
movq %rbx, %rdi
callq 0xe5ff
testb %al, %al
je 0x20ba4
leaq 0x20(%rsp), %rcx
andq $0x0, (%rcx)
movq 0x8(%rsp), %rdi
movq %rbx, %rsi
movq %rbp, %rdx
callq 0x1d81d
testq %rax, %rax
jne 0x20aea
movq %rbp, %r13
movq %rbx, %rsi
movq %rbp, %rdx
callq 0x1dc6b
leaq 0x954b3(%rip), %rsi     # 0xb6024
movq %rbx, %rdi
callq 0xe5ff
movabsq $-0x59040ffc58933ff2, %r12 # imm = 0xA6FBF003A76CC00E
testb %al, %al
je 0x20bcd
movq (%rsp), %rax
cmpb $0x0, 0x2d(%rax)
movabsq $-0x7850996cdf80346a, %r14 # imm = 0x87AF6693207FCB96
je 0x20bf1
leaq 0x8d059(%rip), %rsi     # 0xadbfb
jmp 0x20be2
movq %rbx, %rdi
movq %r13, %rsi
callq 0x10b09
leaq 0x38(%rsp), %rdi
callq 0x71b64
xorl %ebp, %ebp
movq %rbp, %rax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%rsp), %r14
cmpq %r12, 0x8(%r14)
jne 0x20ce5
leaq 0x8d13b(%rip), %rsi     # 0xadd1d
movq %rbx, %rdi
xorl %eax, %eax
callq 0xd7c4
jmp 0x20aea
movq %r13, %rbp
movq 0x8(%rax), %r13
cmpq %r12, %r13
je 0x20c10
movq 0x20(%rsp), %rdx
movq 0x8(%rsp), %rdi
movq (%rsp), %rsi
callq 0x1d18f
leaq 0x8b425(%rip), %rsi     # 0xac03c
movq %rbp, %rdi
callq 0x209ff
testq %rax, %rax
jne 0x20aea
callq 0xe090
leaq 0x38(%rsp), %rbp
movq %rbp, %rdi
xorl %esi, %esi
movq %r15, %rdx
movq %rax, %rcx
callq 0x71967
movq %rax, %r15
callq 0x2637f
movq %rbp, %rdi
xorl %esi, %esi
movq %r14, %rdx
movq %rax, %rcx
callq 0x71967
movq %rax, %r14
movq 0x8(%rsp), %rdi
movq %rbx, %rsi
movq %rax, %rdx
movq %r15, %rcx
callq 0x1fc8a
testq %rax, %rax
jne 0x20aea
movq (%rsp), %rax
cmpq %r12, 0x8(%rax)
movq 0x18(%rsp), %rbp
jne 0x20c9d
movq 0x8(%r15), %rax
testq %rax, %rax
je 0x20fd1
movq (%rsp), %rcx
movq %rax, 0x8(%rcx)
cmpq $0x0, 0x8(%r15)
je 0x20f2c
movq 0x10(%r15), %rcx
movq (%rsp), %rax
movq 0x10(%rax), %rax
cmpq %rax, %rcx
jne 0x20fb2
movq 0x8(%rsp), %rdi
movq %rbx, %rsi
movq %r15, %rdx
movq (%rsp), %rcx
movq %r14, %r8
movq %rbp, %r9
callq 0x1e44c
testq %rax, %rax
jne 0x20aea
jmp 0x20f43
leaq 0x8ceeb(%rip), %rsi     # 0xadbd7
movq %rbx, %rdi
callq 0xe5ff
testb %al, %al
je 0x20d19
cmpb $0x0, 0x2d(%r14)
movq 0x8(%rsp), %rdi
movq 0x28(%rsp), %rdx
je 0x20e8f
leaq 0x8d042(%rip), %rsi     # 0xadd56
jmp 0x20be2
movq 0x8(%rsp), %r13
movq %r13, %rdi
movq %r14, %rsi
movq 0x28(%rsp), %r15
movq %r15, %rdx
callq 0x1d30a
testq %rax, %rax
jne 0x20aea
pushq $0x20
popq %rsi
movq %r15, %rdi
callq 0x1daa5
testq %rax, %rax
jne 0x20aea
movq 0x18(%rsp), %rdi
callq 0x6026d
movq %r15, %rdi
movq %rax, %rsi
callq 0x1de41
movq 0x20(%rsp), %rdx
movq %r13, %rdi
movq %r14, %rsi
callq 0x1d18f
cmpb $0x1, 0x2d(%r14)
jne 0x21091
pushq $0x3b
popq %rsi
movq %r15, %rdi
callq 0x1daa5
testq %rax, %rax
jne 0x20aea
movq 0x8(%r14), %rsi
movq %r13, %rdi
callq 0x1cf9d
movq %rax, %rbp
movq 0x20(%rsp), %rsi
movq %r13, %rdi
callq 0x1cf9d
leaq 0x8cfdd(%rip), %rsi     # 0xadd92
movq %r15, %rdi
movq %rbp, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x1edfd
testq %rax, %rax
jne 0x20aea
movq 0x8(%rsp), %r13
movq 0x28(%r13), %rax
movq 0x98(%r13), %rcx
movq (%rcx,%rax,8), %rax
movb $0x1, 0x10(%rax)
leaq 0x89923(%rip), %rsi     # 0xaa710
movq %rbx, %rdi
callq 0xe5ff
testb %al, %al
movq (%rsp), %r14
jne 0x21091
callq 0x2637f
leaq 0x38(%rsp), %rdi
xorl %esi, %esi
movabsq $-0x7850996cdf80346a, %rdx # imm = 0x87AF6693207FCB96
movq %rax, %rcx
callq 0x71967
movq %rax, %r15
movq 0x20(%rsp), %rsi
movq %r13, %rdi
callq 0x1cf9d
leaq 0xa1cd3(%rip), %rsi     # 0xc2b09
movq %r15, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x1edfd
testq %rax, %rax
jne 0x20aea
movq 0x8(%rsp), %rdi
movq %rbx, %rsi
movq %r15, %rdx
movq (%rsp), %rcx
xorl %r8d, %r8d
callq 0x1f555
testq %rax, %rax
jne 0x20aea
movq %r15, %rdi
callq 0x6026d
movq 0x28(%rsp), %rdi
movq %rax, %rsi
callq 0x1de41
movq 0x8(%rsp), %r13
movq (%rsp), %r14
jmp 0x21091
movq %r14, %rsi
callq 0x1d30a
testq %rax, %rax
jne 0x20aea
leaq 0x939e8(%rip), %r15     # 0xb488f
pushq $0x5b
popq %r13
movq 0x18(%rsp), %r12
movq (%rsp), %r14
movq %rbx, %rdi
movq %r15, %rsi
callq 0xe5ff
testb %al, %al
je 0x20fdd
movq %r12, %rdi
movl %r13d, %esi
callq 0x210e8
testq %rax, %rax
jne 0x20aea
movq 0x8(%rsp), %rdi
movq %rbx, %rsi
movq %r12, %rdx
xorl %ecx, %ecx
callq 0x1fc8a
testq %rax, %rax
jne 0x20aea
movq %rbx, %rdi
leaq 0x94137(%rip), %rsi     # 0xb5037
xorl %eax, %eax
callq 0xd600
testq %rax, %rax
jne 0x20aea
movq 0x18(%rsp), %rdi
pushq $0x5d
popq %rsi
callq 0x210e8
testq %rax, %rax
jne 0x20aea
incq 0x20(%r14)
jmp 0x20eb4
movq %r14, %rdi
callq 0x6026d
addq $0x8, %rbp
movq %rbp, %rdi
movq %rax, %rsi
callq 0xf6dd
movq 0x8(%rsp), %rdi
movq (%rsp), %rsi
movq 0x28(%rsp), %r15
movq %r15, %rdx
callq 0x1d30a
testq %rax, %rax
jne 0x20aea
pushq $0x20
popq %rsi
movq %r15, %rdi
callq 0x1daa5
testq %rax, %rax
jne 0x20aea
movq 0x18(%rsp), %rdi
callq 0x6026d
movq %r15, %rdi
movq %rax, %rsi
callq 0x1de41
cmpq %r12, %r13
movq 0x8(%rsp), %r13
movq (%rsp), %r14
jne 0x21091
movq 0x20(%rsp), %rdx
movq %r13, %rdi
movq %r14, %rsi
callq 0x1d18f
jmp 0x21091
movabsq $-0x12e90733f18038df, %rdx # imm = 0xED16F8CC0E7FC721
cmpq %rdx, %rcx
jne 0x210ca
leaq 0x8ccb9(%rip), %rsi     # 0xadc85
jmp 0x20be2
leaq 0x8cc69(%rip), %rsi     # 0xadc41
jmp 0x20be2
pushq $0x20
popq %rsi
movq 0x28(%rsp), %r15
movq %r15, %rdi
callq 0x1daa5
testq %rax, %rax
jne 0x20aea
movq 0x18(%rsp), %r12
movq %r12, %rdi
callq 0x6026d
movq %r15, %rdi
movq %rax, %rsi
callq 0x1de41
movq 0x20(%rsp), %rdx
movq 0x8(%rsp), %r13
movq %r13, %rdi
movq (%rsp), %r14
movq %r14, %rsi
callq 0x1d18f
movq %rbx, %rsi
movq %r12, %rdx
callq 0x1dc6b
leaq 0x94feb(%rip), %rsi     # 0xb6024
movq %rbx, %rdi
callq 0xe5ff
testb %al, %al
je 0x21091
leaq 0x8aff0(%rip), %rsi     # 0xac03c
movq 0x18(%rsp), %rdi
callq 0x209ff
testq %rax, %rax
jne 0x20aea
movq %rbx, %rsi
movq 0x18(%rsp), %r15
movq %r15, %rdx
callq 0x1dc6b
movq 0x8(%rsp), %r13
movq %r13, %rdi
movq %rbx, %rsi
movq %r15, %rdx
xorl %ecx, %ecx
callq 0x210fb
testq %rax, %rax
movq (%rsp), %r14
jne 0x20aea
cmpq $0x0, 0x20(%r14)
jne 0x210b4
movq 0x8(%r14), %rsi
movq %r13, %rdi
callq 0x1e874
testb %al, %al
je 0x210b4
leaq 0x8cd08(%rip), %rsi     # 0xaddb7
jmp 0x20be2
movq 0x30(%rsp), %rax
testq %rax, %rax
je 0x20baf
movb $0x1, (%rax)
jmp 0x20baf
cmpq %rdx, %rax
jne 0x20cbd
leaq 0x8cbf7(%rip), %rsi     # 0xadcd1
jmp 0x20be2