// File: /workspace/github_c_makefile_star2_O0/vtereshkov[P]umka-lang/src/umka_stmt.c
// Function: parseSimpleStmt
static void parseSimpleStmt(Compiler *comp)
{
    if (doShortVarDeclLookahead(comp))
        parseShortVarDecl(comp);
    else
    {
        const Type *type = NULL;
        bool isVar, isCall, isCompLit;
        parseDesignatorList(comp, &type, NULL, &isVar, &isCall, &isCompLit);

        TokenKind op = comp->lex.tok.kind;

        if (typeExprListStruct(type) && !isCall && op != TOK_EQ)
            comp->error.handler(comp->error.context, "List assignment expected");

        if (op == TOK_EQ || lexShortAssignment(op) != TOK_NONE)
        {
            // Assignment
            if (!isVar || isCall || isCompLit)
                comp->error.handler(comp->error.context, "Left side cannot be assigned to");
            lexNext(&comp->lex);

            if (op == TOK_EQ)
                parseAssignmentStmt(comp, type, NULL);
            else
                parseShortAssignmentStmt(comp, type, op);
        }
        else if (op == TOK_PLUSPLUS || op == TOK_MINUSMINUS)
        {
            // Increment/decrement
            parseIncDecStmt(comp, type, op);
        }
        else
        {
            // Call
            if (!isCall)
                comp->error.handler(comp->error.context, "Assignment or function call expected");
            if (type->kind != TYPE_VOID)
                genPop(&comp->gen);  // Manually remove result
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x1f910
testb $0x1, %al
jne 0x1ef0b
jmp 0x1ef19
movq -0x8(%rbp), %rdi
callq 0xa8f0
jmp 0x1f06c
movq $0x0, -0x10(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x10(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
leaq -0x11(%rbp), %rcx
leaq -0x12(%rbp), %r8
leaq -0x13(%rbp), %r9
callq 0xe610
movq -0x8(%rbp), %rax
movl 0x4bd0(%rax), %eax
movl %eax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x1da10
testb $0x1, %al
jne 0x1ef5a
jmp 0x1ef87
testb $0x1, -0x12(%rbp)
jne 0x1ef87
cmpl $0x31, -0x18(%rbp)
je 0x1ef87
movq -0x8(%rbp), %rax
movq 0x50f8(%rax), %rcx
movq -0x8(%rbp), %rax
movq 0x5118(%rax), %rdi
leaq 0x1bab74(%rip), %rsi    # 0x1d9af7
movb $0x0, %al
callq *%rcx
cmpl $0x31, -0x18(%rbp)
je 0x1ef9a
movl -0x18(%rbp), %edi
callq 0x1b1a0
cmpl $0x0, %eax
je 0x1f008
testb $0x1, -0x11(%rbp)
je 0x1efac
testb $0x1, -0x12(%rbp)
jne 0x1efac
testb $0x1, -0x13(%rbp)
je 0x1efcd
movq -0x8(%rbp), %rax
movq 0x50f8(%rax), %rcx
movq -0x8(%rbp), %rax
movq 0x5118(%rax), %rdi
leaq 0x1baaac(%rip), %rsi    # 0x1d9a75
movb $0x0, %al
callq *%rcx
movq -0x8(%rbp), %rdi
addq $0x4ba8, %rdi           # imm = 0x4BA8
callq 0x1ad90
cmpl $0x31, -0x18(%rbp)
jne 0x1eff6
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x1d9c0
jmp 0x1f006
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x18(%rbp), %edx
callq 0x1f990
jmp 0x1f06a
cmpl $0x2c, -0x18(%rbp)
je 0x1f014
cmpl $0x2d, -0x18(%rbp)
jne 0x1f026
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x18(%rbp), %edx
callq 0x1fab0
jmp 0x1f068
testb $0x1, -0x12(%rbp)
jne 0x1f04d
movq -0x8(%rbp), %rax
movq 0x50f8(%rax), %rcx
movq -0x8(%rbp), %rax
movq 0x5118(%rax), %rdi
leaq 0x1baac7(%rip), %rsi    # 0x1d9b10
movb $0x0, %al
callq *%rcx
movq -0x10(%rbp), %rax
cmpl $0x2, (%rax)
je 0x1f066
movq -0x8(%rbp), %rdi
addq $0x4e70, %rdi           # imm = 0x4E70
callq 0x16d30
jmp 0x1f068
jmp 0x1f06a
jmp 0x1f06c
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)