// File: /workspace/github_c_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
callq 0x19989
testb %al, %al
je 0x195f1
movq %rbx, %rdi
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xb415
leaq 0x8(%rsp), %r15
movq $0x0, (%r15)
leaq 0x7(%rsp), %rcx
leaq 0x5(%rsp), %r8
leaq 0x6(%rsp), %r9
movq %rbx, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0xdcb9
leaq 0x4ba8(%rbx), %r14
movl 0x4bd0(%rbx), %ebp
movq (%r15), %rax
cmpl $0x16, (%rax)
jne 0x1964a
cmpb $0x1, 0x14(%rax)
jne 0x1964a
cmpl $0x0, 0x10(%rax)
jle 0x1964a
cmpl $0x31, %ebp
sete %al
orb 0x5(%rsp), %al
je 0x197ef
movb $0x1, %r12b
cmpl $0x31, %ebp
je 0x19664
movl %ebp, %edi
callq 0x163e0
testl %eax, %eax
je 0x1974b
xorl %r12d, %r12d
cmpb $0x1, 0x7(%rsp)
jne 0x19679
cmpb $0x0, 0x5(%rsp)
jne 0x19679
cmpb $0x1, 0x6(%rsp)
jne 0x1968f
movq 0x5118(%rbx), %rdi
leaq 0x5e0b6(%rip), %rsi     # 0x7773d
xorl %eax, %eax
callq *0x50f8(%rbx)
movq %r14, %rdi
callq 0x15914
movq 0x8(%rsp), %r15
testb %r12b, %r12b
je 0x196b3
movq %rbx, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x17310
jmp 0x197e2
movl (%r15), %eax
cmpl $0x18, %eax
ja 0x1981d
movl $0x1ec0000, %ecx        # imm = 0x1EC0000
btl %eax, %ecx
jae 0x1980a
movq %r15, %r14
leaq 0x4e70(%rbx), %r15
movq %r15, %rdi
callq 0x13273
movl (%r14), %esi
movq %r15, %rdi
callq 0x132bc
movq %r14, 0x18(%rsp)
leaq 0x10(%rsp), %rsi
movq %r14, (%rsi)
movq %rbx, %rdi
xorl %edx, %edx
callq 0x111c3
cmpl $0x20, %ebp
jne 0x19712
movl $0x20, %r9d
cmpl $0x14, (%r14)
je 0x1971c
movl %ebp, %edi
callq 0x163e0
movl %eax, %r9d
leaq 0x18(%rsp), %rsi
leaq 0x10(%rsp), %rdx
movq %rbx, %rdi
xorl %ecx, %ecx
xorl %r8d, %r8d
pushq $0x0
pushq $0x1
callq 0xd9c7
addq $0x10, %rsp
movq %r15, %rdi
movq %r14, %rsi
callq 0x135bd
jmp 0x197e2
movl %ebp, %eax
andl $-0x2, %eax
cmpl $0x2c, %eax
jne 0x197ac
movq 0x8(%rsp), %r12
movl (%r12), %eax
cmpl $0x18, %eax
ja 0x19850
movl $0x1ec0000, %ecx        # imm = 0x1EC0000
btl %eax, %ecx
jae 0x1983c
movq %r12, %r15
leaq 0x4e18(%rbx), %rdi
movq 0x5240(%rbx), %rsi
movq %r15, %rdx
callq 0x1a277
addq $0x4e70, %rbx           # imm = 0x4E70
movq %rbx, %rdi
movl %ebp, %esi
movq %r15, %rdx
callq 0x136fc
movq %r14, %rdi
callq 0x15914
jmp 0x197e2
cmpb $0x0, 0x5(%rsp)
jne 0x197c9
movq 0x5118(%rbx), %rdi
leaq 0x5e017(%rip), %rsi     # 0x777d8
xorl %eax, %eax
callq *0x50f8(%rbx)
movq 0x8(%rsp), %rax
cmpl $0x2, (%rax)
je 0x197e2
addq $0x4e70, %rbx           # imm = 0x4E70
movq %rbx, %rdi
callq 0x131c1
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x5118(%rbx), %rdi
leaq 0x5dfc2(%rip), %rsi     # 0x777bf
xorl %eax, %eax
callq *0x50f8(%rbx)
jmp 0x19652
cmpl $0x10, %eax
jne 0x1981d
movq 0x8(%r15), %r14
cmpl $0x2, (%r14)
jne 0x196d0
movq 0x5118(%rbx), %rdi
leaq 0x5df12(%rip), %rsi     # 0x7773d
xorl %eax, %eax
callq *0x50f8(%rbx)
movq 0x8(%r15), %r14
jmp 0x196d0
cmpl $0x10, %eax
jne 0x19850
movq 0x8(%r12), %r15
cmpl $0x2, (%r15)
jne 0x19778
movq 0x5118(%rbx), %rdi
leaq 0x5dedf(%rip), %rsi     # 0x7773d
xorl %eax, %eax
callq *0x50f8(%rbx)
movq 0x8(%r12), %r15
jmp 0x19778