// File: /workspace/github_c_makefile_star2_O0/chgzm[P]minic/parser.c
// Function: create_struct_specifier_node
static StructSpecifierNode* create_struct_specifier_node(const Vector* vec, int* index) {
    StructSpecifierNode* struct_specifier_node = malloc(sizeof(StructSpecifierNode));
    struct_specifier_node->struct_declaration_nodes = create_vector();

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

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

    struct_specifier_node->identifier = strdup(token->str);

    token = vec->elements[*index];
    if (token->type == TK_LBRCKT) {
        ++(*index);
        token = vec->elements[*index];
        while (token->type != TK_RBRCKT) {
            StructDeclarationNode* struct_declaration_node = create_struct_declaration_node(vec, index);
            if (struct_declaration_node == NULL) {
                error("Failed to create struct-declaration node.\n");
                return NULL;
            }

            vector_push_back(struct_specifier_node->struct_declaration_nodes, struct_declaration_node);
            token = vec->elements[*index];
        }

        ++(*index); 
    }

    return struct_specifier_node;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl $0x10, %edi
callq 0x10f0
movq %rax, -0x20(%rbp)
movb $0x0, %al
callq 0xe5c0
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x8(%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 $0xa, (%rax)
je 0x84c4
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 0x7a80(%rip), %rdi      # 0xff30
movb $0x0, %al
callq 0xe4e0
movq $0x0, -0x8(%rbp)
jmp 0x85fe
movq -0x18(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%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 $0x3, (%rax)
je 0x8523
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 0x7a21(%rip), %rdi      # 0xff30
movb $0x0, %al
callq 0xe4e0
movq $0x0, -0x8(%rbp)
jmp 0x85fe
movq -0x18(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x1170
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%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 $0x23, (%rax)
jne 0x85f6
movq -0x18(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%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 $0x24, (%rax)
je 0x85eb
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x8610
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x85c2
leaq 0x7b16(%rip), %rdi      # 0x100c7
movb $0x0, %al
callq 0xe4e0
movq $0x0, -0x8(%rbp)
jmp 0x85fe
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x30(%rbp), %rsi
callq 0xe610
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x18(%rbp), %rcx
movslq (%rcx), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x28(%rbp)
jmp 0x8589
movq -0x18(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)