// File: /workspace/github_c_makefile_star2_O0/chgzm[P]minic/parser.c
// Function: create_labeled_stmt_node
static LabeledStmtNode* create_labeled_stmt_node(const Vector* vec, int* index) {
    LabeledStmtNode* labeled_stmt_node = calloc(1, sizeof(LabeledStmtNode));

    const Token* token = vec->elements[*index];
    switch (token->type) {
    case TK_CASE: {
        ++(*index);
        labeled_stmt_node->labeled_stmt_type = LABELED_CASE;

        labeled_stmt_node->conditional_expr_node = create_conditional_expr_node(vec, index);
        if (labeled_stmt_node->conditional_expr_node == NULL) {
            error("Failed to create conditional-expression node.\n");
            return NULL;
        }
       
        token = vec->elements[*index];
        if (token->type != TK_COLON) {
            error("Invalid token[%d]=\"%s\".\n", *index, decode_token_type(token->type));
            return NULL;
        }
        ++(*index);

        labeled_stmt_node->stmt_node = create_stmt_node(vec, index);
        if (labeled_stmt_node->stmt_node == NULL) {
            error("Failed to create statement-expression node.\n");
            return NULL;
        }

        break;
    }
    case TK_DEFAULT: {
        ++(*index);
        labeled_stmt_node->labeled_stmt_type = LABELED_DEFAULT;

        token = vec->elements[*index];
        if (token->type != TK_COLON) {
            error("Invalid token[%d]=\"%s\".\n", *index, decode_token_type(token->type));
            return NULL;
        }
        ++(*index);

        labeled_stmt_node->stmt_node = create_stmt_node(vec, index);
        if (labeled_stmt_node->stmt_node == NULL) {
            error("Failed to create statement-expression node.\n");
            return NULL;
        }

        break;
    }
    default: {
        error("Invalid token[%d]=\"%s\"\n", *index, decode_token_type(token->type));
        return NULL;
    }
    }

    return labeled_stmt_node;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl $0x1, %edi
movl $0x18, %esi
callq 0x10b0
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x18(%rbp), %rcx
movslq (%rcx), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x2c(%rbp)
subl $0x12, %eax
je 0xb18a
jmp 0xb179
movl -0x2c(%rbp), %eax
subl $0x13, %eax
je 0xb27f
jmp 0xb330
movq -0x18(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movq -0x20(%rbp), %rax
movl $0x0, (%rax)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x8df0
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x20(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0xb1dd
leaq 0x5048(%rip), %rdi      # 0x10211
movb $0x0, %al
callq 0xe4e0
movq $0x0, -0x8(%rbp)
jmp 0xb36a
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x18(%rbp), %rcx
movslq (%rcx), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpl $0x20, (%rax)
je 0xb231
movq -0x18(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x30(%rbp)
movq -0x28(%rbp), %rax
movl (%rax), %edi
callq 0xe050
movl -0x30(%rbp), %esi
movq %rax, %rdx
leaq 0x4d13(%rip), %rdi      # 0xff30
movb $0x0, %al
callq 0xe4e0
movq $0x0, -0x8(%rbp)
jmp 0xb36a
movq -0x18(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0xaf30
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x20(%rbp), %rax
cmpq $0x0, 0x10(%rax)
jne 0xb27a
leaq 0x54e7(%rip), %rdi      # 0x1074d
movb $0x0, %al
callq 0xe4e0
movq $0x0, -0x8(%rbp)
jmp 0xb36a
jmp 0xb362
movq -0x18(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movq -0x20(%rbp), %rax
movl $0x1, (%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x18(%rbp), %rcx
movslq (%rcx), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpl $0x20, (%rax)
je 0xb2e8
movq -0x18(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x34(%rbp)
movq -0x28(%rbp), %rax
movl (%rax), %edi
callq 0xe050
movl -0x34(%rbp), %esi
movq %rax, %rdx
leaq 0x4c5c(%rip), %rdi      # 0xff30
movb $0x0, %al
callq 0xe4e0
movq $0x0, -0x8(%rbp)
jmp 0xb36a
movq -0x18(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0xaf30
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x20(%rbp), %rax
cmpq $0x0, 0x10(%rax)
jne 0xb32e
leaq 0x5430(%rip), %rdi      # 0x1074d
movb $0x0, %al
callq 0xe4e0
movq $0x0, -0x8(%rbp)
jmp 0xb36a
jmp 0xb362
movq -0x18(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x38(%rbp)
movq -0x28(%rbp), %rax
movl (%rax), %edi
callq 0xe050
movl -0x38(%rbp), %esi
movq %rax, %rdx
leaq 0x5429(%rip), %rdi      # 0x1077a
movb $0x0, %al
callq 0xe4e0
movq $0x0, -0x8(%rbp)
jmp 0xb36a
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)