// File: /workspace/github_c_makefile_star2_O0/vtereshkov[P]umka-lang/src/umka_stmt.c
// Function: parseSingleDeclAssignmentStmt
static void parseSingleDeclAssignmentStmt(Compiler *comp, IdentName name, bool exported, bool constExpr)
{
    const Type *rightType = NULL;
    Const rightConstantBuf, *rightConstant = constExpr ? &rightConstantBuf : NULL;
    parseExpr(comp, &rightType, rightConstant);

    if (typeExprListStruct(rightType))
        comp->error.handler(comp->error.context, "1 expression expected but %d found", rightType->numItems);

    const Ident *ident = identAllocVar(&comp->idents, &comp->types, &comp->modules, &comp->blocks, name, rightType, exported);

    if (constExpr)              // Initialize global variable
        constAssign(&comp->consts, ident->ptr, rightConstant, rightType->kind, typeSize(&comp->types, rightType));
    else                        // Assign to variable
    {
        if (doTryRemoveCopyResultToTempVar(comp))
        {
            // Optimization: if the right-hand side is a function call, assume its reference count to be already increased before return
            // The left-hand side will hold this additional reference, so we can remove the temporary "reference holder" variable
        }
        else
        {
            // General case: increase right-hand side reference count
            genChangeRefCnt(&comp->gen, TOK_PLUSPLUS, rightType);
        }

        doPushVarPtr(comp, ident);
        genSwapAssign(&comp->gen, rightType->kind, typeSize(&comp->types, rightType));
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movb %cl, %al
movb %dl, %cl
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
andb $0x1, %cl
movb %cl, -0x11(%rbp)
andb $0x1, %al
movb %al, -0x12(%rbp)
movq $0x0, -0x20(%rbp)
testb $0x1, -0x12(%rbp)
je 0x1e42a
leaq -0x28(%rbp), %rax
movq %rax, -0x40(%rbp)
jmp 0x1e432
xorl %eax, %eax
movq %rax, -0x40(%rbp)
jmp 0x1e432
movq -0x40(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rdx
leaq -0x20(%rbp), %rsi
callq 0xe8c0
movq -0x20(%rbp), %rdi
callq 0x1da10
testb $0x1, %al
jne 0x1e45a
jmp 0x1e482
movq -0x8(%rbp), %rax
movq 0x50f8(%rax), %rcx
movq -0x8(%rbp), %rax
movq 0x5118(%rax), %rdi
movq -0x20(%rbp), %rax
movl 0x10(%rax), %edx
leaq 0x1bb63c(%rip), %rsi    # 0x1d9aba
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
movq -0x20(%rbp), %r9
movb -0x11(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, (%rsp)
callq 0x1a450
movq %rax, -0x38(%rbp)
testb $0x1, -0x12(%rbp)
je 0x1e52b
movq -0x8(%rbp), %rax
addq $0x4e68, %rax           # imm = 0x4E68
movq %rax, -0x60(%rbp)
movq -0x38(%rbp), %rax
movq 0x120(%rax), %rax
movq %rax, -0x58(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x20(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x44(%rbp)
movq -0x8(%rbp), %rdi
addq $0x4e18, %rdi           # imm = 0x4E18
movq -0x20(%rbp), %rsi
callq 0x21fe0
movq -0x60(%rbp), %rdi
movq -0x58(%rbp), %rsi
movq -0x50(%rbp), %rdx
movl -0x44(%rbp), %ecx
movl %eax, %r8d
callq 0x88c0
jmp 0x1e59b
movq -0x8(%rbp), %rdi
callq 0xd0f0
testb $0x1, %al
jne 0x1e53a
jmp 0x1e53c
jmp 0x1e555
movq -0x8(%rbp), %rdi
addq $0x4e70, %rdi           # imm = 0x4E70
movq -0x20(%rbp), %rdx
movl $0x2c, %esi
callq 0x17270
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0xd010
movq -0x8(%rbp), %rax
addq $0x4e70, %rax           # imm = 0x4E70
movq %rax, -0x70(%rbp)
movq -0x20(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x64(%rbp)
movq -0x8(%rbp), %rdi
addq $0x4e18, %rdi           # imm = 0x4E18
movq -0x20(%rbp), %rsi
callq 0x21fe0
movq -0x70(%rbp), %rdi
movl -0x64(%rbp), %esi
movl %eax, %edx
callq 0x17120
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)