// File: /workspace/github_c_makefile_star2_O1/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
subq $0x18, %rsp
movq %r8, %rbx
movq 0x20(%rdx), %r12
cmpq %rcx, %r12
movq %r9, 0x8(%rsp)
jne 0x3a1cb
movq (%r9), %r14
leaq 0x168397(%rip), %rax    # 0x1a24b0
movl 0x168391(%rip), %ecx    # 0x1a24b0
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 0x3a177
movq 0x10(%rax), %rdx
movl $0x18, %ecx
cmpq %r14, %rdx
je 0x3a177
movq 0x20(%rax), %rdx
movl $0x28, %ecx
cmpq %r14, %rdx
je 0x3a177
movq 0x30(%rax), %rdx
movl $0x38, %ecx
cmpq %r14, %rdx
jne 0x3a709
movq (%rax,%rcx), %r15
testq %r15, %r15
jne 0x3a1ac
movabsq $-0x3dfc7e0a250a30dc, %rdi # imm = 0xC20381F5DAF5CF24
movq %r14, %rsi
callq 0xf3f85
movq %rax, %r15
leaq 0x168314(%rip), %rdi    # 0x1a24b0
movq %r14, %rsi
movq %rax, %rdx
callq 0x12128c
movq 0x8(%rsp), %r9
movq %r9, %rdi
movq %rbx, %rsi
callq *0x30(%r15)
xorl %r13d, %r13d
movq %r13, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rcx, %rbp
leaq 0x1(%r12), %rax
cmpq %rcx, %rax
jne 0x3a2b6
cmpb $0x1, 0x2e(%rdx)
jne 0x3a3a8
movq (%r9), %r14
leaq 0x1682c0(%rip), %r12    # 0x1a24b0
movl 0x1682ba(%rip), %eax    # 0x1a24b0
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 0x3a24d
movq 0x10(%rax), %rdx
movl $0x18, %ecx
cmpq %r14, %rdx
je 0x3a24d
movq 0x20(%rax), %rdx
movl $0x28, %ecx
cmpq %r14, %rdx
je 0x3a24d
movq 0x30(%rax), %rdx
movl $0x38, %ecx
cmpq %r14, %rdx
jne 0x3a711
movq (%rax,%rcx), %r15
movq %rbx, %rbp
testq %r15, %r15
jne 0x3a285
movabsq $-0x3dfc7e0a250a30dc, %rdi # imm = 0xC20381F5DAF5CF24
movq %r14, %rsi
callq 0xf3f85
movq %rax, %r15
leaq 0x16823b(%rip), %rdi    # 0x1a24b0
movq %r14, %rsi
movq %rax, %rdx
callq 0x12128c
movq 0x8(%rsp), %r9
leaq 0x1021b3(%rip), %rsi    # 0x13c43f
movq %r9, %rbx
movq %r9, %rdi
callq *0x20(%r15)
movq %rax, %r13
testq %rax, %rax
je 0x3a5a4
leaq 0x16eb27(%rip), %rax    # 0x1a8dd0
movq (%rax), %rdi
callq 0xe0b30
jmp 0x3a1b9
cmpq %rbp, %r12
jle 0x3a3ca
movq %rbx, 0x10(%rsp)
movb $0x1, %r13b
movq (%r9), %r14
movl 0x1681e0(%rip), %eax    # 0x1a24b0
cltq
leaq (%rax,%rax,2), %rax
leaq 0x1681d3(%rip), %rdx    # 0x1a24b0
movq 0x20(%rdx,%rax,8), %rcx
movq 0x18(%rdx,%rax,8), %rdx
andq %r14, %rdx
shlq $0x4, %rdx
leaq (%rcx,%rdx), %rax
movq (%rcx,%rdx), %rdx
movl $0x8, %ecx
cmpq %r14, %rdx
je 0x3a32a
movq 0x10(%rax), %rdx
movl $0x18, %ecx
cmpq %r14, %rdx
je 0x3a32a
movq 0x20(%rax), %rdx
movl $0x28, %ecx
cmpq %r14, %rdx
je 0x3a32a
movq 0x30(%rax), %rdx
movl $0x38, %ecx
cmpq %r14, %rdx
jne 0x3a3a3
movq (%rax,%rcx), %r15
testq %r15, %r15
jne 0x3a35f
movabsq $-0x3dfc7e0a250a30dc, %rdi # imm = 0xC20381F5DAF5CF24
movq %r14, %rsi
callq 0xf3f85
movq %rax, %r15
leaq 0x168161(%rip), %rdi    # 0x1a24b0
movq %r14, %rsi
movq %rax, %rdx
callq 0x12128c
movq 0x8(%rsp), %r9
movq %r9, %rdi
leaq 0x109af5(%rip), %rsi    # 0x143e5e
callq *0x20(%r15)
movq %rax, %r14
testq %rax, %rax
je 0x3a387
leaq 0x16ea54(%rip), %rax    # 0x1a8dd0
movq (%rax), %rdi
callq 0xe0b30
movq %r14, %rbx
testq %r14, %r14
movq 0x8(%rsp), %r9
jne 0x3a3f2
decq %r12
cmpq %rbp, %r12
setg %r13b
jg 0x3a2c7
jmp 0x3a3f2
xorl %r15d, %r15d
jmp 0x3a32e
leaq 0x10113a(%rip), %rax    # 0x13b4e9
movq %rsi, %rdi
movq %rax, %rsi
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xddb2
leaq 0x10114b(%rip), %rax    # 0x13b51c
movq %rsi, %rdi
movq %rax, %rsi
movq %r12, %rdx
movq %rbp, %rcx
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xddb2
testb $0x1, %r13b
je 0x3a400
movq %rbx, %r13
jmp 0x3a1b9
movq (%r9), %r15
movl 0x1680a7(%rip), %eax    # 0x1a24b0
cltq
leaq (%rax,%rax,2), %rax
leaq 0x16809a(%rip), %rdx    # 0x1a24b0
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 %rbx, %r13
je 0x3a46a
movq 0x10(%rax), %rdx
movl $0x18, %ecx
cmpq %r15, %rdx
je 0x3a46a
movq 0x20(%rax), %rdx
movl $0x28, %ecx
cmpq %r15, %rdx
je 0x3a46a
movq 0x30(%rax), %rdx
movl $0x38, %ecx
cmpq %r15, %rdx
jne 0x3a71e
movq (%rax,%rcx), %r14
testq %r14, %r14
jne 0x3a49f
movabsq $-0x3dfc7e0a250a30dc, %rdi # imm = 0xC20381F5DAF5CF24
movq %r15, %rsi
callq 0xf3f85
movq %rax, %r14
leaq 0x168021(%rip), %rdi    # 0x1a24b0
movq %r15, %rsi
movq %rax, %rdx
callq 0x12128c
movq 0x8(%rsp), %r9
leaq 0xfe048(%rip), %rsi     # 0x1384ee
movq %r9, %rdi
callq *0x20(%r14)
movq %rax, %r14
testq %rax, %rax
je 0x3a4c7
leaq 0x16e914(%rip), %rax    # 0x1a8dd0
movq (%rax), %rdi
callq 0xe0b30
movq %r14, %r13
testq %r14, %r14
jne 0x3a1b9
movq 0x8(%rsp), %rax
movq (%rax), %r15
movl 0x167fd2(%rip), %eax    # 0x1a24b0
cltq
leaq (%rax,%rax,2), %rax
leaq 0x167fc5(%rip), %rdx    # 0x1a24b0
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 0x3a53c
movq 0x10(%rax), %rdx
movl $0x18, %ecx
cmpq %r15, %rdx
je 0x3a53c
movq 0x20(%rax), %rdx
movl $0x28, %ecx
cmpq %r15, %rdx
je 0x3a53c
movq 0x30(%rax), %rdx
movl $0x38, %ecx
cmpq %r15, %rdx
jne 0x3a72e
movq (%rax,%rcx), %r14
testq %r14, %r14
jne 0x3a56c
movabsq $-0x3dfc7e0a250a30dc, %rdi # imm = 0xC20381F5DAF5CF24
movq %r15, %rsi
callq 0xf3f85
movq %rax, %r14
leaq 0x167f4f(%rip), %rdi    # 0x1a24b0
movq %r15, %rsi
movq %rax, %rdx
callq 0x12128c
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq *0x30(%r14)
movq 0x8(%rsp), %rdi
movq (%rdi), %r15
movl 0x167f28(%rip), %eax    # 0x1a24b0
cltq
leaq (%rax,%rax,2), %rax
leaq 0x167f1b(%rip), %rdx    # 0x1a24b0
movq 0x20(%rdx,%rax,8), %rcx
movq 0x18(%rdx,%rax,8), %rdx
jmp 0x3a65e
movq (%rbx), %r15
movl 0x167f03(%rip), %eax    # 0x1a24b0
cltq
leaq (%rax,%rax,2), %rax
movq 0x20(%r12,%rax,8), %rcx
movq 0x18(%r12,%rax,8), %rdx
andq %r15, %rdx
shlq $0x4, %rdx
leaq (%rcx,%rdx), %rax
movq (%rcx,%rdx), %rdx
movl $0x8, %ecx
cmpq %r15, %rdx
je 0x3a604
movq 0x10(%rax), %rdx
movl $0x18, %ecx
cmpq %r15, %rdx
je 0x3a604
movq 0x20(%rax), %rdx
movl $0x28, %ecx
cmpq %r15, %rdx
je 0x3a604
movq 0x30(%rax), %rdx
movl $0x38, %ecx
cmpq %r15, %rdx
jne 0x3a726
movq (%rax,%rcx), %r14
testq %r14, %r14
jne 0x3a634
movabsq $-0x3dfc7e0a250a30dc, %rdi # imm = 0xC20381F5DAF5CF24
movq %r15, %rsi
callq 0xf3f85
movq %rax, %r14
leaq 0x167e87(%rip), %rdi    # 0x1a24b0
movq %r15, %rsi
movq %rax, %rdx
callq 0x12128c
movq 0x8(%rsp), %rdi
movq %rbp, %rsi
callq *0x30(%r14)
movq 0x8(%rsp), %rdi
movq (%rdi), %r15
movl 0x167e62(%rip), %eax    # 0x1a24b0
cltq
leaq (%rax,%rax,2), %rax
movq 0x20(%r12,%rax,8), %rcx
movq 0x18(%r12,%rax,8), %rdx
andq %r15, %rdx
shlq $0x4, %rdx
leaq (%rcx,%rdx), %rax
movq (%rcx,%rdx), %rdx
movl $0x8, %ecx
cmpq %r15, %rdx
je 0x3a6a1
movq 0x10(%rax), %rdx
movl $0x18, %ecx
cmpq %r15, %rdx
je 0x3a6a1
movq 0x20(%rax), %rdx
movl $0x28, %ecx
cmpq %r15, %rdx
je 0x3a6a1
movq 0x30(%rax), %rdx
movl $0x38, %ecx
cmpq %r15, %rdx
jne 0x3a719
movq (%rax,%rcx), %r14
testq %r14, %r14
jne 0x3a6d6
movabsq $-0x3dfc7e0a250a30dc, %rdi # imm = 0xC20381F5DAF5CF24
movq %r15, %rsi
callq 0xf3f85
movq %rax, %r14
leaq 0x167dea(%rip), %rdi    # 0x1a24b0
movq %r15, %rsi
movq %rax, %rdx
callq 0x12128c
movq 0x8(%rsp), %rdi
leaq 0x11b860(%rip), %rsi    # 0x155f3d
callq *0x20(%r14)
movq %rax, %rbx
testq %rax, %rax
je 0x3a6fb
leaq 0x16e6e0(%rip), %rax    # 0x1a8dd0
movq (%rax), %rdi
callq 0xe0b30
movq %rbx, %r13
testq %rbx, %rbx
jne 0x3a1b9
jmp 0x3a1b6
xorl %r15d, %r15d
jmp 0x3a17b
xorl %r15d, %r15d
jmp 0x3a251
xorl %r14d, %r14d
jmp 0x3a6a5
xorl %r14d, %r14d
jmp 0x3a46e
xorl %r14d, %r14d
jmp 0x3a608
xorl %r14d, %r14d
jmp 0x3a540