// File: /workspace/github_c_makefile_star2_O3/johsteffens[P]beth/xoico/src/xoico.xo.c
// Function: xoico_che_s_adapt_expression_indirection
er_t xoico_che_s_adapt_expression_indirection( xoico_che_s* o, x_source* source, const xoico_typespec_s* typespec_expr, sz_t target_indirection, const xoico_che_result* result_expr, xoico_che_result* result )
{
    // xoico_che.x:764:1
    
    if( target_indirection == typespec_expr->indirection )
    {
        xoico_che_result_a_push_result_c(result,result_expr );
    }
    else if( target_indirection == typespec_expr->indirection + 1 )
    {
        if( typespec_expr->flag_addressable )
        {
            BLM_TRY(xoico_che_result_a_push_sc(result,"&(" ))
            xoico_che_result_a_push_result_c(result,result_expr );
            BLM_TRY(xoico_che_result_a_push_sc(result,")" ))
        }
        else
        {
            return  x_source_parse_error_fa(source,"Increasing indirection: Expression has no address." );
        }
    }
    else if( target_indirection < typespec_expr->indirection )
    {
        for(sz_t ind = typespec_expr->indirection; ind > target_indirection; ind-- ) BLM_TRY(xoico_che_result_a_push_sc(result,"*" ))
        BLM_TRY(xoico_che_result_a_push_sc(result,"(" ))
        xoico_che_result_a_push_result_c(result,result_expr );
        BLM_TRY(xoico_che_result_a_push_sc(result,")" ))
    }
    else
    {
        return  x_source_parse_error_fa(source,"Cannot adapt from expression's indirection '#<sz_t>' to target indirection '#<sz_t>'.",
            typespec_expr->indirection,
            target_indirection
        );
    }
    return  0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %rbx
movq %r8, %r12
movq 0x20(%rdx), %rbp
cmpq %rcx, %rbp
jne 0x376f7
movq (%rbx), %r14
leaq 0x15de55(%rip), %rax    # 0x1954b0
movl 0x15de4f(%rip), %ecx    # 0x1954b0
movslq %ecx, %rcx
leaq (%rcx,%rcx,2), %rcx
movq 0x20(%rax,%rcx,8), %rdx
movq 0x18(%rax,%rcx,8), %rcx
andq %r14, %rcx
shlq $0x4, %rcx
leaq (%rdx,%rcx), %rax
movq (%rdx,%rcx), %rdx
movl $0x8, %ecx
cmpq %r14, %rdx
je 0x376b5
movq 0x10(%rax), %rdx
movl $0x18, %ecx
cmpq %r14, %rdx
je 0x376b5
movq 0x20(%rax), %rdx
movl $0x28, %ecx
cmpq %r14, %rdx
je 0x376b5
movq 0x30(%rax), %rdx
movl $0x38, %ecx
cmpq %r14, %rdx
jne 0x376be
movq (%rax,%rcx), %r15
testq %r15, %r15
jne 0x376e5
movabsq $-0x3dfc7e0a250a30dc, %rdi # imm = 0xC20381F5DAF5CF24
movq %r14, %rsi
callq 0xe9bc5
movq %rax, %r15
leaq 0x15ddd6(%rip), %rdi    # 0x1954b0
movq %r14, %rsi
movq %rax, %rdx
callq 0x115fac
movq %rbx, %rdi
movq %r12, %rsi
callq *0x30(%r15)
xorl %r14d, %r14d
jmp 0x37b03
movq %rcx, %r13
leaq 0x1(%rbp), %rax
cmpq %rcx, %rax
jne 0x37855
cmpb $0x1, 0x2e(%rdx)
jne 0x37b15
movq %r12, %r13
movq (%rbx), %r14
leaq 0x15dd92(%rip), %r12    # 0x1954b0
movl 0x15dd8c(%rip), %eax    # 0x1954b0
cltq
leaq (%rax,%rax,2), %rax
movq 0x20(%r12,%rax,8), %rcx
movq 0x18(%r12,%rax,8), %rdx
andq %r14, %rdx
shlq $0x4, %rdx
leaq (%rcx,%rdx), %rax
movq (%rcx,%rdx), %rdx
movl $0x8, %ecx
cmpq %r14, %rdx
je 0x37777
movq 0x10(%rax), %rdx
movl $0x18, %ecx
cmpq %r14, %rdx
je 0x37777
movq 0x20(%rax), %rdx
movl $0x28, %ecx
cmpq %r14, %rdx
je 0x37777
movq 0x30(%rax), %rdx
movl $0x38, %ecx
cmpq %r14, %rdx
jne 0x37780
movq (%rax,%rcx), %r15
testq %r15, %r15
jne 0x377a7
movabsq $-0x3dfc7e0a250a30dc, %rdi # imm = 0xC20381F5DAF5CF24
movq %r14, %rsi
callq 0xe9bc5
movq %rax, %r15
leaq 0x15dd14(%rip), %rdi    # 0x1954b0
movq %r14, %rsi
movq %rax, %rdx
callq 0x115fac
leaq 0xf9c91(%rip), %rsi     # 0x13143f
movq %rbx, %rdi
callq *0x20(%r15)
testq %rax, %rax
jne 0x37af1
movq (%rbx), %r14
movl 0x15dce9(%rip), %eax    # 0x1954b0
cltq
leaq (%rax,%rax,2), %rax
movq 0x20(%r12,%rax,8), %rcx
movq 0x18(%r12,%rax,8), %rdx
andq %r14, %rdx
shlq $0x4, %rdx
leaq (%rcx,%rdx), %rax
movq (%rcx,%rdx), %rdx
movl $0x8, %ecx
cmpq %r14, %rdx
je 0x3781a
movq 0x10(%rax), %rdx
movl $0x18, %ecx
cmpq %r14, %rdx
je 0x3781a
movq 0x20(%rax), %rdx
movl $0x28, %ecx
cmpq %r14, %rdx
je 0x3781a
movq 0x30(%rax), %rdx
movl $0x38, %ecx
cmpq %r14, %rdx
jne 0x37823
movq (%rax,%rcx), %r15
testq %r15, %r15
jne 0x3784a
movabsq $-0x3dfc7e0a250a30dc, %rdi # imm = 0xC20381F5DAF5CF24
movq %r14, %rsi
callq 0xe9bc5
movq %rax, %r15
leaq 0x15dc71(%rip), %rdi    # 0x1954b0
movq %r14, %rsi
movq %rax, %rdx
callq 0x115fac
movq %rbx, %rdi
movq %r13, %rsi
jmp 0x37a4a
cmpq %r13, %rbp
jle 0x37b37
movq %r12, (%rsp)
leaq 0x15dc47(%rip), %r12    # 0x1954b0
movq (%rbx), %r14
movl 0x15dc3e(%rip), %eax    # 0x1954b0
cltq
leaq (%rax,%rax,2), %rax
movq 0x20(%r12,%rax,8), %rcx
movq 0x18(%r12,%rax,8), %rdx
andq %r14, %rdx
shlq $0x4, %rdx
leaq (%rcx,%rdx), %rax
movq (%rcx,%rdx), %rdx
movl $0x8, %ecx
cmpq %r14, %rdx
je 0x378c5
movq 0x10(%rax), %rdx
movl $0x18, %ecx
cmpq %r14, %rdx
je 0x378c5
movq 0x20(%rax), %rdx
movl $0x28, %ecx
cmpq %r14, %rdx
je 0x378c5
movq 0x30(%rax), %rdx
movl $0x38, %ecx
cmpq %r14, %rdx
jne 0x378ce
movq (%rax,%rcx), %r15
testq %r15, %r15
jne 0x378f1
movabsq $-0x3dfc7e0a250a30dc, %rdi # imm = 0xC20381F5DAF5CF24
movq %r14, %rsi
callq 0xe9bc5
movq %rax, %r15
movq %r12, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x115fac
movq %rbx, %rdi
leaq 0x1013db(%rip), %rsi    # 0x138cd6
callq *0x20(%r15)
testq %rax, %rax
jne 0x37af1
decq %rbp
cmpq %r13, %rbp
jg 0x37869
movq (%rbx), %r14
movl 0x15db93(%rip), %eax    # 0x1954b0
cltq
leaq (%rax,%rax,2), %rax
movq 0x20(%r12,%rax,8), %rcx
movq 0x18(%r12,%rax,8), %rdx
andq %r14, %rdx
shlq $0x4, %rdx
leaq (%rcx,%rdx), %rax
movq (%rcx,%rdx), %rdx
movl $0x8, %ecx
cmpq %r14, %rdx
je 0x37970
movq 0x10(%rax), %rdx
movl $0x18, %ecx
cmpq %r14, %rdx
je 0x37970
movq 0x20(%rax), %rdx
movl $0x28, %ecx
cmpq %r14, %rdx
je 0x37970
movq 0x30(%rax), %rdx
movl $0x38, %ecx
cmpq %r14, %rdx
jne 0x37979
movq (%rax,%rcx), %r15
testq %r15, %r15
jne 0x379a0
movabsq $-0x3dfc7e0a250a30dc, %rdi # imm = 0xC20381F5DAF5CF24
movq %r14, %rsi
callq 0xe9bc5
movq %rax, %r15
leaq 0x15db1b(%rip), %rdi    # 0x1954b0
movq %r14, %rsi
movq %rax, %rdx
callq 0x115fac
leaq 0xf5b47(%rip), %rsi     # 0x12d4ee
movq %rbx, %rdi
callq *0x20(%r15)
testq %rax, %rax
jne 0x37af1
movq (%rbx), %r14
movl 0x15daf0(%rip), %eax    # 0x1954b0
cltq
leaq (%rax,%rax,2), %rax
movq 0x20(%r12,%rax,8), %rcx
movq 0x18(%r12,%rax,8), %rdx
andq %r14, %rdx
shlq $0x4, %rdx
leaq (%rcx,%rdx), %rax
movq (%rcx,%rdx), %rdx
movl $0x8, %ecx
cmpq %r14, %rdx
je 0x37a13
movq 0x10(%rax), %rdx
movl $0x18, %ecx
cmpq %r14, %rdx
je 0x37a13
movq 0x20(%rax), %rdx
movl $0x28, %ecx
cmpq %r14, %rdx
je 0x37a13
movq 0x30(%rax), %rdx
movl $0x38, %ecx
cmpq %r14, %rdx
jne 0x37a1c
movq (%rax,%rcx), %r15
testq %r15, %r15
jne 0x37a43
movabsq $-0x3dfc7e0a250a30dc, %rdi # imm = 0xC20381F5DAF5CF24
movq %r14, %rsi
callq 0xe9bc5
movq %rax, %r15
leaq 0x15da78(%rip), %rdi    # 0x1954b0
movq %r14, %rsi
movq %rax, %rdx
callq 0x115fac
movq %rbx, %rdi
movq (%rsp), %rsi
callq *0x30(%r15)
movq (%rbx), %r14
movl 0x15da59(%rip), %eax    # 0x1954b0
cltq
leaq (%rax,%rax,2), %rax
movq 0x20(%r12,%rax,8), %rcx
movq 0x18(%r12,%rax,8), %rdx
andq %r14, %rdx
shlq $0x4, %rdx
leaq (%rcx,%rdx), %rax
movq (%rcx,%rdx), %rdx
movl $0x8, %ecx
cmpq %r14, %rdx
je 0x37aaa
movq 0x10(%rax), %rdx
movl $0x18, %ecx
cmpq %r14, %rdx
je 0x37aaa
movq 0x20(%rax), %rdx
movl $0x28, %ecx
cmpq %r14, %rdx
je 0x37aaa
movq 0x30(%rax), %rdx
movl $0x38, %ecx
cmpq %r14, %rdx
jne 0x37ab3
movq (%rax,%rcx), %r15
testq %r15, %r15
jne 0x37ada
movabsq $-0x3dfc7e0a250a30dc, %rdi # imm = 0xC20381F5DAF5CF24
movq %r14, %rsi
callq 0xe9bc5
movq %rax, %r15
leaq 0x15d9e1(%rip), %rdi    # 0x1954b0
movq %r14, %rsi
movq %rax, %rdx
callq 0x115fac
leaq 0x113484(%rip), %rsi    # 0x14af65
movq %rbx, %rdi
callq *0x20(%r15)
testq %rax, %rax
je 0x376ef
movq %rax, %r14
leaq 0x1642d5(%rip), %rax    # 0x19bdd0
movq (%rax), %rdi
callq 0xd6d2c
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xf89cd(%rip), %rax     # 0x1304e9
movq %rsi, %rdi
movq %rax, %rsi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xde10
leaq 0xf89de(%rip), %rax     # 0x13051c
movq %rsi, %rdi
movq %rax, %rsi
movq %rbp, %rdx
movq %r13, %rcx
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xde10