// File: /workspace/github_c_makefile_star2_O2/chgzm[P]minic/parser.c
// Function: create_stmt_node
static StmtNode* create_stmt_node(const Vector* vec, int* index) {
    StmtNode* stmt_node = calloc(1, sizeof(StmtNode));

    const Token* token = vec->elements[*index];
    switch (token->type) {
    case TK_CASE:
    case TK_DEFAULT: {
        stmt_node->labeled_stmt_node = create_labeled_stmt_node(vec, index);
        if (stmt_node->labeled_stmt_node == NULL) {
            error("Failed to create labeled-statement node.\n");
            return NULL;
        }

        break;
    }
    case TK_WHILE: 
    case TK_FOR: {
        stmt_node->itr_stmt_node = create_itr_stmt_node(vec, index);
        if (stmt_node->itr_stmt_node == NULL) {
            error("Failed to create iteration-statement node.\n");
            return NULL;
        }

        break;
    } 
    case TK_RETURN: 
    case TK_BREAK:
    case TK_CONTINUE: {
        stmt_node->jump_stmt_node = create_jump_stmt_node(vec, index);
        if (stmt_node->jump_stmt_node == NULL) {
            error("Failed to create jump-statement node.\n");
            return NULL;
        }

        break;
    }
    case TK_IF: 
    case TK_SWITCH: {
        stmt_node->selection_stmt_node = create_selection_stmt_node(vec, index);
        if (stmt_node->selection_stmt_node == NULL) {
            error("Failed to create selection-statement node.\n");
            return NULL;
        }

        break;
    }
    case TK_LBRCKT: {
        stmt_node->compound_stmt_node = create_compound_stmt_node(vec, index);
        if (stmt_node->compound_stmt_node == NULL) {
            error("Failed to create compound-statement node.\n");
            return NULL;
        }

        break;
    }
    default: {
        stmt_node->expr_stmt_node = create_expr_stmt_node(vec, index);
        if (stmt_node->expr_stmt_node == NULL) {
            error("Failed to create expression-statement node.\n");
            return NULL;
        }

        break;
    }
    }

    return stmt_node;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %r15
pushq $0x1
popq %rdi
pushq $0x30
popq %rsi
callq 0x10c0
movq %rax, %rbx
movq %r15, 0x8(%rsp)
movq (%r15), %r15
movq %r14, (%rsp)
movl (%r14), %r13d
movslq %r13d, %r12
movq (%r15,%r12,8), %rax
movl (%rax), %ebp
leal -0xd(%rbp), %eax
cmpl $0x16, %eax
ja 0x6bdd
leaq 0x316e(%rip), %rcx      # 0x9a44
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
pushq $0x1
popq %rdi
pushq $0x18
popq %rsi
callq 0x10c0
movq %rax, %rsi
cmpl $0x14, %ebp
je 0x6b51
cmpl $0x16, %ebp
jne 0x6b83
movl $0x2, (%rsi)
movq %r12, %r13
incq %r13
movq (%rsp), %rax
movl %r13d, (%rax)
movq 0x8(%r15,%r12,8), %rax
cmpl $0x1f, (%rax)
je 0x6959
movq 0x8(%rsp), %r14
movq %r14, %rdi
movq (%rsp), %r15
movq %rsi, %r12
movq %r15, %rsi
callq 0x5bcf
movq %rax, 0x10(%r12)
testq %rax, %rax
je 0x6ee2
movq (%r14), %rax
movslq (%r15), %r13
movq (%rax,%r13,8), %rax
movl (%rax), %edi
cmpl $0x1f, %edi
jne 0x6f49
movq %r12, %rsi
incl %r13d
movq (%rsp), %rdx
jmp 0x6b74
pushq $0x1
popq %rdi
pushq $0x30
popq %rsi
callq 0x10c0
movq %rax, %r12
xorl %eax, %eax
callq 0x812e
movq %rax, %r13
movq %rax, 0x28(%r12)
movq 0x8(%rsp), %rbp
movq (%rbp), %rax
movq (%rsp), %r14
movslq (%r14), %rcx
movq (%rax,%rcx,8), %rdx
movl (%rdx), %edx
cmpl $0xf, %edx
je 0x6cb8
cmpl $0x10, %edx
movq %rbx, %r15
jne 0x6d92
leaq 0x1(%rcx), %rbx
movl %ebx, (%r14)
movq 0x8(%rax,%rcx,8), %rax
movl (%rax), %edi
cmpl $0x21, %edi
jne 0x6e6d
leal 0x2(%rcx), %eax
movl %eax, (%r14)
movq %rbp, %rdi
movq %r14, %rsi
callq 0x5bcf
movq %rax, 0x10(%r12)
testq %rax, %rax
je 0x6fed
movq (%rbp), %rcx
movslq (%r14), %rax
movq (%rcx,%rax,8), %rcx
movl (%rcx), %edi
cmpl $0x22, %edi
jne 0x6fd5
incl %eax
movl %eax, (%r14)
jmp 0x6d79
pushq $0x1
popq %rdi
pushq $0x20
popq %rsi
callq 0x10c0
cmpl $0x11, %ebp
je 0x6d9b
cmpl $0xd, %ebp
jne 0x6e3f
movq %rbx, 0x10(%rsp)
movq %r12, %rbp
incq %rbp
movq (%rsp), %r14
movl %ebp, (%r14)
movq 0x8(%r15,%r12,8), %rcx
movl (%rcx), %edi
cmpl $0x21, %edi
jne 0x6e2c
addl $0x2, %r13d
movl %r13d, (%r14)
movq 0x8(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
movq %rax, %r12
callq 0x5bcf
movq %rax, 0x8(%r12)
testq %rax, %rax
je 0x6f82
movq (%r15), %rax
movslq (%r14), %rbx
movq (%rax,%rbx,8), %rax
movl (%rax), %edi
cmpl $0x22, %edi
jne 0x6ebe
leal 0x1(%rbx), %eax
movl %eax, (%r14)
movq %r15, %rdi
movq %r14, %rsi
callq 0x6889
movq %rax, 0x10(%r12)
testq %rax, %rax
je 0x6f94
movq %r12, %rdx
movq (%r15), %rcx
movslq (%r14), %rax
movq (%rcx,%rax,8), %rcx
cmpl $0xe, (%rcx)
jne 0x6e1e
incl %eax
movl %eax, (%r14)
movl $0x1, (%rdx)
movq %r15, %rdi
movq %r14, %rsi
callq 0x6889
movq %r12, %rdx
movq %rax, 0x18(%r12)
jmp 0x6e15
movq %rbx, 0x10(%rsp)
pushq $0x1
popq %rdi
pushq $0x18
popq %rsi
callq 0x10c0
movq %rax, %rbx
leal 0x1(%r13), %ecx
movq (%rsp), %r14
movl %ecx, (%r14)
cmpl $0x12, %ebp
jne 0x6c70
movq 0x8(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x5a86
movq %rax, 0x8(%rbx)
testq %rax, %rax
je 0x6e64
movq %rbx, %r12
movq (%r15), %rax
movslq (%r14), %rbx
movq (%rax,%rbx,8), %rax
movl (%rax), %edi
cmpl $0x20, %edi
jne 0x6e8a
leal 0x1(%rbx), %eax
movl %eax, (%r14)
movq %r15, %rdi
movq %r14, %rsi
callq 0x6889
movq %r12, %rbx
movq %rax, 0x10(%r12)
jmp 0x6ca2
movl $0x1, (%rsi)
movq %r12, %r14
incq %r14
movq (%rsp), %rdx
movl %r14d, (%rdx)
movq 0x8(%r15,%r12,8), %rax
movl (%rax), %edi
cmpl $0x1f, %edi
jne 0x6bb8
addl $0x2, %r13d
movq %rbx, %r15
movl %r13d, (%rdx)
movq %rsi, 0x28(%rbx)
jmp 0x702f
movq %rbx, %rcx
movq %r12, %r14
incq %r14
movq (%rsp), %rbx
movl %r14d, (%rbx)
movq 0x8(%r15,%r12,8), %rax
movl (%rax), %edi
cmpl $0x1f, %edi
jne 0x6bb8
addl $0x2, %r13d
movl %r13d, (%rbx)
movq %rcx, %r15
movq %rsi, 0x28(%rcx)
testq %rsi, %rsi
jne 0x702f
jmp 0x6bd1
callq 0x807a
leaq 0x322c(%rip), %rdi      # 0x9df0
movl %r14d, %esi
movq %rax, %rdx
xorl %eax, %eax
callq 0x80a8
leaq 0x3969(%rip), %rdi      # 0xa541
jmp 0x7025
pushq $0x1
popq %rdi
pushq $0x8
popq %rsi
callq 0x10c0
movq %rax, %r12
cmpl $0x1f, %ebp
je 0x6c27
movq 0x8(%rsp), %r14
movq %r14, %rdi
movq (%rsp), %r13
movq %r13, %rsi
callq 0x5bcf
movq %rax, (%r12)
testq %rax, %rax
je 0x6ef5
movq (%r14), %rax
movslq (%r13), %r13
movq (%rax,%r13,8), %rax
movl (%rax), %edi
cmpl $0x1f, %edi
jne 0x6f5d
incl %r13d
movq (%rsp), %rax
movl %r13d, (%rax)
movq %r12, 0x8(%rbx)
testq %r12, %r12
movq %rbx, %r15
jne 0x702f
jmp 0x6f76
movq 0x8(%rsp), %rdi
movq (%rsp), %rsi
callq 0x5530
movq %rbx, %r15
movq %rax, 0x10(%rbx)
testq %rax, %rax
jne 0x702f
leaq 0x3929(%rip), %rdi      # 0xa594
jmp 0x7025
movl $0x1, (%rbx)
movq 0x8(%r15,%r12,8), %rax
movl (%rax), %edi
cmpl $0x20, %edi
movq 0x8(%rsp), %rax
jne 0x6e52
addl $0x2, %r13d
movq (%rsp), %rsi
movl %r13d, (%rsi)
movq %rax, %rdi
callq 0x6889
movq %rax, 0x10(%rbx)
testq %rax, %rax
je 0x6ea4
movq 0x10(%rsp), %r15
movq %rbx, (%r15)
jmp 0x702f
movl $0x1, (%r12)
leal 0x1(%rcx), %edx
movl %edx, (%r14)
movq 0x8(%rax,%rcx,8), %rdx
movl (%rdx), %edi
cmpl $0x21, %edi
movq %rbx, %r15
jne 0x6fd5
movq %rcx, %rsi
addq $0x2, %rsi
movl %esi, (%r14)
movq 0x10(%rax,%rcx,8), %rdx
cmpl $0x1f, (%rdx)
jne 0x6f05
addl $0x3, %ecx
movl %ecx, (%r14)
movslq %ecx, %rdx
movq (%rax,%rdx,8), %rdx
cmpl $0x1f, (%rdx)
je 0x6d32
movq %rbp, %rdi
movq %r14, %rsi
callq 0x5bcf
movq %rax, 0x18(%r12)
testq %rax, %rax
je 0x6fed
movq (%rbp), %rax
movslq (%r14), %rcx
movq (%rax,%rcx,8), %rdx
movl (%rdx), %edi
cmpl $0x1f, %edi
jne 0x6fd5
leal 0x1(%rcx), %edx
movl %edx, (%r14)
movslq %ecx, %rcx
movq 0x8(%rax,%rcx,8), %rax
cmpl $0x22, (%rax)
je 0x6d74
movq %rbp, %rdi
movq %r14, %rsi
callq 0x5bcf
movq %rax, 0x20(%r12)
testq %rax, %rax
je 0x6fed
movq (%rbp), %rax
movslq (%r14), %rdx
movq (%rax,%rdx,8), %rax
movl (%rax), %edi
cmpl $0x22, %edi
jne 0x6fd5
incl %edx
movl %edx, (%r14)
movq %rbp, %rdi
movq %r14, %rsi
callq 0x6889
movq %rax, 0x8(%r12)
testq %rax, %rax
je 0x6ff6
movq %r12, 0x20(%r15)
jmp 0x702f
movq %rbx, 0x10(%rsp)
movl $0x2, (%rax)
movq %r12, %rbp
incq %rbp
movq (%rsp), %r14
movl %ebp, (%r14)
movq 0x8(%r15,%r12,8), %rcx
movl (%rcx), %edi
cmpl $0x21, %edi
jne 0x6e2c
addl $0x2, %r13d
movl %r13d, (%r14)
movq 0x8(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
movq %rax, %r12
callq 0x5bcf
movq %rax, 0x8(%r12)
testq %rax, %rax
je 0x6f8b
movq (%r15), %rax
movslq (%r14), %rbx
movq (%rax,%rbx,8), %rax
movl (%rax), %edi
cmpl $0x22, %edi
jne 0x6ebe
leal 0x1(%rbx), %eax
movl %eax, (%r14)
movq %r15, %rdi
movq %r14, %rsi
callq 0x6889
movq %r12, %rdx
movq %rax, 0x10(%r12)
testq %rax, %rax
je 0x6f94
movq 0x10(%rsp), %r15
movq %rdx, 0x18(%r15)
jmp 0x702f
callq 0x807a
leaq 0x2fb8(%rip), %rdi      # 0x9df0
movl %ebp, %esi
jmp 0x6ecc
movl %ebp, %edi
callq 0x807a
leaq 0x2fa3(%rip), %rdi      # 0x9df0
movl %r13d, %esi
jmp 0x6ecc
movl %ecx, %ebx
callq 0x807a
leaq 0x2f90(%rip), %rdi      # 0x9df0
movl %ebx, %esi
jmp 0x6e98
leaq 0x3266(%rip), %rdi      # 0xa0d1
jmp 0x6eab
callq 0x807a
leaq 0x2f77(%rip), %rdi      # 0x9df0
movl %ebx, %esi
movq %rax, %rdx
xorl %eax, %eax
callq 0x80a8
jmp 0x7019
callq 0x807a
leaq 0x2f5a(%rip), %rdi      # 0x9df0
movl %ebx, %esi
movq %rax, %rdx
xorl %eax, %eax
callq 0x80a8
jmp 0x6eb2
leaq 0x3741(%rip), %rdi      # 0xa5ec
xorl %eax, %eax
callq 0x80a8
leaq 0x3632(%rip), %rdi      # 0xa4eb
jmp 0x7025
callq 0x807a
leaq 0x2f26(%rip), %rdi      # 0x9df0
movl %ebx, %esi
movq %rax, %rdx
xorl %eax, %eax
callq 0x80a8
leaq 0x368b(%rip), %rdi      # 0xa568
jmp 0x7025
leaq 0x31c5(%rip), %rdi      # 0xa0ae
xorl %eax, %eax
callq 0x80a8
jmp 0x6bd1
leaq 0x34e0(%rip), %rdi      # 0xa3dc
xorl %eax, %eax
callq 0x80a8
jmp 0x6f76
movq %rbp, %rdi
callq 0x518f
testb %al, %al
je 0x6fa7
movl (%r14), %esi
movq %rbp, %rdi
callq 0x518f
testb %al, %al
je 0x6fff
movq %rbp, %rdi
movq %r14, %rsi
callq 0x5042
testq %rax, %rax
je 0x700b
movq %r13, %rdi
movq %rax, %rsi
callq 0x8167
jmp 0x6f15
callq 0x807a
leaq 0x2e9b(%rip), %rdi      # 0x9df0
movl %r13d, %esi
jmp 0x6bc7
callq 0x807a
leaq 0x2e87(%rip), %rdi      # 0x9df0
movl %r13d, %esi
movq %rax, %rdx
xorl %eax, %eax
callq 0x80a8
leaq 0x3642(%rip), %rdi      # 0xa5bf
jmp 0x7025
leaq 0x3636(%rip), %rdi      # 0xa5bf
jmp 0x6f9b
leaq 0x311c(%rip), %rdi      # 0xa0ae
jmp 0x6f9b
leaq 0x352e(%rip), %rdi      # 0xa4c9
xorl %eax, %eax
callq 0x80a8
jmp 0x6ed6
movq %rbp, %rdi
movq %r14, %rsi
callq 0x5bcf
movq %rax, 0x10(%r12)
testq %rax, %rax
je 0x6fed
movq (%rbp), %rax
movslq (%r14), %rcx
movq (%rax,%rcx,8), %rdx
movl (%rdx), %edi
cmpl $0x1f, %edi
jne 0x6fd5
incl %ecx
jmp 0x6cf4
callq 0x807a
leaq 0x3638(%rip), %rdi      # 0xa619
movq %rax, %rsi
xorl %eax, %eax
callq 0x80a8
jmp 0x7019
leaq 0x33e8(%rip), %rdi      # 0xa3dc
jmp 0x7012
leaq 0x3635(%rip), %rdi      # 0xa632
jmp 0x7012
movq (%rbp), %rax
movl (%r14), %ecx
jmp 0x6cf7
leaq 0x3642(%rip), %rdi      # 0xa654
xorl %eax, %eax
callq 0x80a8
andq $0x0, 0x20(%r15)
leaq 0x34f0(%rip), %rdi      # 0xa515
xorl %r15d, %r15d
xorl %eax, %eax
callq 0x80a8
movq %r15, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq