// File: /workspace/github_c_makefile_star2_O0/vtereshkov[P]umka-lang/src/umka_expr.c
// Function: doExprListToExprListConv
static void doExprListToExprListConv(Compiler *comp, const Type *dest, const Type **src, Const *constant)
{
    if (constant)
        comp->error.handler(comp->error.context, "Conversion to expression list is not allowed in constant expressions");

    const Ident *destList = identAllocTempVar(&comp->idents, &comp->types, &comp->modules, &comp->blocks, dest, false);
    doZeroVar(comp, destList);

    // Assign to fields
    for (int i = 0; i < dest->numItems; i++)
    {
        genDup(&comp->gen);                                                     // Duplicate src pointer
        genGetFieldPtr(&comp->gen, (*src)->field[i]->offset);                   // Get src.item pointer
        genDeref(&comp->gen, (*src)->field[i]->type->kind);                     // Get src.item value

        const Type *srcFieldType = (*src)->field[i]->type;
        doAssertImplicitTypeConv(comp, dest->field[i]->type, &srcFieldType, constant);

        genPushLocalPtr(&comp->gen, destList->offset + dest->field[i]->offset); // Push dest.item pointer
        genSwapChangeRefCntAssign(&comp->gen, dest->field[i]->type);            // Assign to dest.item
    }

    genPop(&comp->gen);                                                         // Remove src pointer
    doPushVarPtr(comp, destList);
    *src = dest;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x10380
movq -0x8(%rbp), %rax
movq 0x50f8(%rax), %rcx
movq -0x8(%rbp), %rax
movq 0x5118(%rax), %rdi
leaq 0x1c87a2(%rip), %rsi    # 0x1d8b1e
movb $0x0, %al
callq *%rcx
movq -0x8(%rbp), %rdi
addq $0x4e38, %rdi           # imm = 0x4E38
movq -0x8(%rbp), %rsi
addq $0x4e18, %rsi           # imm = 0x4E18
movq -0x8(%rbp), %rdx
addq $0x100, %rdx            # imm = 0x100
movq -0x8(%rbp), %rcx
addq $0x4220, %rcx           # imm = 0x4220
movq -0x10(%rbp), %r8
xorl %r9d, %r9d
callq 0x1a540
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x1d5e0
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jge 0x104f7
movq -0x8(%rbp), %rdi
addq $0x4e70, %rdi           # imm = 0x4E70
callq 0x16eb0
movq -0x8(%rbp), %rdi
addq $0x4e70, %rdi           # imm = 0x4E70
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq 0x28(%rax), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl 0x110(%rax), %esi
callq 0x17bb0
movq -0x8(%rbp), %rdi
addq $0x4e70, %rdi           # imm = 0x4E70
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq 0x28(%rax), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x108(%rax), %rax
movl (%rax), %esi
callq 0x16fa0
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq 0x28(%rax), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x108(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x108(%rax), %rsi
movq -0x20(%rbp), %rcx
leaq -0x38(%rbp), %rdx
callq 0xd6e0
movq -0x8(%rbp), %rdi
addq $0x4e70, %rdi           # imm = 0x4E70
movq -0x28(%rbp), %rax
movq 0x120(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x28(%rcx), %rcx
movslq -0x2c(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movslq 0x110(%rcx), %rcx
addq %rcx, %rax
movl %eax, %esi
callq 0x169a0
movq -0x8(%rbp), %rdi
addq $0x4e70, %rdi           # imm = 0x4E70
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x108(%rax), %rsi
callq 0x17500
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x103d0
movq -0x8(%rbp), %rdi
addq $0x4e70, %rdi           # imm = 0x4E70
callq 0x16d30
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0xd010
movq -0x10(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)