// File: /workspace/github_c_makefile_star2_O1/chgzm[P]minic/parser.c
// Function: create_unary_expr_node
static UnaryExprNode* create_unary_expr_node(const Vector* vec, int* index) {
    UnaryExprNode* unary_expr_node = calloc(1, sizeof(UnaryExprNode));

    unary_expr_node->type = UN_NONE;

    const Token* token = vec->elements[*index];
    switch (token->type) {
    case TK_INC: {
        unary_expr_node->type = UN_INC;
        ++(*index);

        unary_expr_node->unary_expr_node = create_unary_expr_node(vec, index);
        if (unary_expr_node->unary_expr_node == NULL) {
            error("Failed to create unary-expression node.\n");
            return NULL;
        }

        break;
    }
    case TK_DEC: {
        unary_expr_node->type = UN_DEC;
        ++(*index);

        unary_expr_node->unary_expr_node = create_unary_expr_node(vec, index);
        if (unary_expr_node->unary_expr_node == NULL) {
            error("Failed to create unary-expression node.\n");
            return NULL;
        }

        break;
    }
    case TK_SIZEOF: {
        ++(*index);

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

        token = vec->elements[*index];
        //
        // sizeof ( identifier )
        //
        if (token->type == TK_IDENT &&  !strptrmap_contains(typedef_map, token->str)) {
            unary_expr_node->type        = UN_SIZEOF_IDENT;
            unary_expr_node->sizeof_name = strdup(token->str);
            ++(*index);
        }
        //
        // sizeof ( type-name )
        //
        else {
            unary_expr_node->type = UN_SIZEOF_TYPE;

            unary_expr_node->type_name_node = create_type_name_node(vec, index);
            if (unary_expr_node->type_name_node == NULL) {
                error("Failed to create type-name node.\n");
                return NULL;
            }
        }

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

        break;
    }
    case TK_AMP:   case TK_ASTER:
    case TK_PLUS:  case TK_MINUS:
    case TK_TILDE: case TK_EXCLA: {
        unary_expr_node->type = UN_OP;
        if      (token->type == TK_AMP)   { unary_expr_node->op_type = OP_AND;   }
        else if (token->type == TK_ASTER) { unary_expr_node->op_type = OP_MUL;   }
        else if (token->type == TK_PLUS)  { unary_expr_node->op_type = OP_ADD;   }
        else if (token->type == TK_MINUS) { unary_expr_node->op_type = OP_SUB;   }
        else if (token->type == TK_TILDE) { unary_expr_node->op_type = OP_TILDE; }
        else if (token->type == TK_EXCLA) { unary_expr_node->op_type = OP_EXCLA; }

        ++(*index);

        unary_expr_node->cast_expr_node = create_cast_expr_node(vec, index);
        if (unary_expr_node->cast_expr_node == NULL) {
            error("Failed to create cast-expression node.\n");
            return NULL;
        }

        break;
    }
    default: {
        unary_expr_node->type = UN_NONE;

        unary_expr_node->postfix_expr_node = create_postfix_expr_node(vec, index);
        if (unary_expr_node->postfix_expr_node == NULL) {
            error("Failed to create postfix-expression node.\n");
            return NULL;
        }

        break;
    }
    }

    return unary_expr_node;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r14
movq %rdi, %r15
movl $0x1, %edi
movl $0x30, %esi
callq 0x10c0
movq %rax, %rbp
movl $0x0, 0x20(%rax)
movq (%r15), %rdx
movslq (%r14), %rax
movq (%rdx,%rax,8), %rcx
movl (%rcx), %ecx
cmpq $0x3c, %rcx
ja 0x6836
movabsq $0x2a0007000000, %rsi   # imm = 0x2A0007000000
btq %rcx, %rsi
jae 0x681a
movl $0x3, 0x20(%rbp)
cmpl $0x28, %ecx
jg 0x67f5
cmpl $0x18, %ecx
je 0x69a4
cmpl $0x19, %ecx
je 0x69b2
cmpl $0x1a, %ecx
jne 0x69c1
movl $0xd, %ecx
jmp 0x69be
cmpl $0x29, %ecx
je 0x69ab
cmpl $0x2b, %ecx
je 0x69b9
cmpl $0x2d, %ecx
jne 0x69c1
movl $0x10, %ecx
jmp 0x69be
cmpq $0x3b, %rcx
je 0x68d6
cmpq $0x3c, %rcx
jne 0x6836
movl $0x2, 0x20(%rbp)
jmp 0x68dd
cmpl $0x17, %ecx
jne 0x6906
leaq 0x1(%rax), %r12
movl %r12d, (%r14)
movq 0x8(%rdx,%rax,8), %rcx
movl (%rcx), %edi
cmpl $0x21, %edi
jne 0x69fc
movq %rax, %rcx
addq $0x2, %rcx
movl %ecx, (%r14)
movq 0x10(%rdx,%rax,8), %rbx
cmpl $0x3, (%rbx)
jne 0x6882
movq 0x88ef(%rip), %rdi      # 0xf160
movq 0x8(%rbx), %rsi
callq 0x8d8c
testb %al, %al
je 0x6ad6
movl $0x5, 0x20(%rbp)
movl $0x1, %edi
movl $0x10, %esi
callq 0x10c0
movq %rax, %r12
movq %r15, %rdi
movq %r14, %rsi
callq 0x5e33
movq %rax, (%r12)
testq %rax, %rax
je 0x6ab0
movq (%r15), %rcx
movslq (%r14), %rax
movq (%rcx,%rax,8), %rcx
cmpl $0x1a, (%rcx)
jne 0x6ac1
movb $0x1, 0x8(%r12)
incl %eax
movl %eax, (%r14)
jmp 0x6ac1
movl $0x1, 0x20(%rbp)
incl %eax
movl %eax, (%r14)
movq %r15, %rdi
movq %r14, %rsi
callq 0x6771
movq %rax, 0x8(%rbp)
testq %rax, %rax
jne 0x69ea
leaq 0x49e0(%rip), %rdi      # 0xb2e1
jmp 0x69e1
xorl %ebx, %ebx
movl %ebx, 0x20(%rbp)
movl $0x1, %edi
movl $0x30, %esi
callq 0x10c0
movq %rax, %r12
xorl %eax, %eax
callq 0x8b08
movq %rax, 0x18(%r12)
movq %r12, 0x10(%rsp)
movl %ebx, 0x28(%r12)
movl $0x1, %edi
movl $0x28, %esi
callq 0x10c0
movq %rax, 0x8(%rsp)
movq (%r15), %rax
movslq (%r14), %r12
movq (%rax,%r12,8), %rbx
movl (%rbx), %r13d
cmpl $0x3, %r13d
movq %rbp, 0x20(%rsp)
jae 0x6a12
movq %r12, 0x18(%rsp)
movl $0x1, %edi
movl $0x18, %esi
callq 0x10c0
movq %rax, %r12
cmpl $0x2, %r13d
je 0x6b3c
cmpl $0x1, %r13d
je 0x6b2a
testl %r13d, %r13d
jne 0x6b5e
movl $0x0, (%r12)
jmp 0x6b32
movl $0xb, %ecx
jmp 0x69be
movl $0x11, %ecx
jmp 0x69be
movl $0xc, %ecx
jmp 0x69be
movl $0xa, %ecx
movl %ecx, 0x24(%rbp)
incl %eax
movl %eax, (%r14)
movq %r15, %rdi
movq %r14, %rsi
callq 0x6728
movq %rax, 0x10(%rbp)
testq %rax, %rax
jne 0x69ea
leaq 0x48d8(%rip), %rdi      # 0xb2b9
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x8a7c
movq %rbp, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x8a51
leaq 0x43e8(%rip), %rdi      # 0xadf0
xorl %ebp, %ebp
movl %r12d, %esi
jmp 0x6b1b
cmpl $0x21, %r13d
je 0x6a3a
cmpl $0x3, %r13d
jne 0x6a87
movq 0x8(%rbx), %rdi
callq 0x1190
movq 0x8(%rsp), %r13
movq %rax, 0x18(%r13)
leal 0x1(%r12), %eax
movl %eax, (%r14)
jmp 0x6aa6
leal 0x1(%r12), %eax
movl %eax, (%r14)
movq %r15, %rdi
movq %r14, %rsi
callq 0x60d0
movq 0x8(%rsp), %rcx
movq %rax, 0x8(%rcx)
testq %rax, %rax
movq 0x10(%rsp), %rbx
je 0x6b9b
movq (%r15), %rax
movslq (%r14), %r13
movq (%rax,%r13,8), %rax
movl (%rax), %r12d
cmpl $0x22, %r12d
jne 0x6e6a
leal 0x1(%r13), %eax
movl %eax, (%r14)
jmp 0x6e86
movl %r13d, %edi
callq 0x8a51
leaq 0x435a(%rip), %rdi      # 0xadf0
xorl %r13d, %r13d
movl %r12d, %esi
movq %rax, %rdx
xorl %eax, %eax
callq 0x8a7c
movq 0x10(%rsp), %rbx
jmp 0x6bac
leaq 0x48a0(%rip), %rdi      # 0xb357
xorl %r12d, %r12d
xorl %eax, %eax
callq 0x8a7c
movq %r12, 0x18(%rbp)
testq %r12, %r12
jne 0x6aed
leaq 0x4839(%rip), %rdi      # 0xb30a
jmp 0x69e1
movl $0x4, 0x20(%rbp)
movq 0x8(%rbx), %rdi
callq 0x1190
movq %rax, 0x28(%rbp)
incl (%r14)
movq (%r15), %rax
movslq (%r14), %r15
movq (%rax,%r15,8), %rax
movl (%rax), %edi
cmpl $0x22, %edi
jne 0x6b0a
leal 0x1(%r15), %eax
movl %eax, (%r14)
jmp 0x69ea
callq 0x8a51
leaq 0x42da(%rip), %rdi      # 0xadf0
xorl %ebp, %ebp
movl %r15d, %esi
movq %rax, %rdx
xorl %eax, %eax
callq 0x8a7c
jmp 0x69ea
movl $0x1, (%r12)
movl 0x4(%rbx), %eax
movl %eax, 0x4(%r12)
jmp 0x6b52
movl $0x2, (%r12)
movq 0x8(%rbx), %rdi
callq 0x1190
movq %rax, 0x10(%r12)
movq 0x18(%rsp), %rax
incl %eax
movl %eax, (%r14)
jmp 0x6b7f
movl %r13d, %edi
callq 0x8a51
leaq 0x4283(%rip), %rdi      # 0xadf0
xorl %r12d, %r12d
movq 0x18(%rsp), %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x8a7c
movq 0x10(%rsp), %rbx
movq 0x8(%rsp), %r13
movq %r12, (%r13)
testq %r12, %r12
jne 0x6bac
leaq 0x4843(%rip), %rdi      # 0xb3dc
jmp 0x6ba2
leaq 0x485b(%rip), %rdi      # 0xb3fd
xorl %r13d, %r13d
xorl %eax, %eax
callq 0x8a7c
movq %r13, (%rbx)
testq %r13, %r13
je 0x6e3c
movq (%r15), %rax
movslq (%r14), %rcx
movq (%rax,%rcx,8), %rbp
movl (%rbp), %eax
cmpl $0x31, %eax
jg 0x6c18
cmpl $0x21, %eax
je 0x6c67
cmpl $0x25, %eax
je 0x6d54
cmpl $0x31, %eax
jne 0x6e4c
incl (%r14)
movl $0x1, %edi
movl $0x30, %esi
callq 0x10c0
movq %rax, %r12
movq %rbx, 0x8(%rax)
xorl %eax, %eax
callq 0x8b08
movq %rax, 0x18(%r12)
movl $0x3, 0x28(%r12)
jmp 0x6d32
cmpl $0x32, %eax
je 0x6d04
cmpl $0x3b, %eax
je 0x6dd6
cmpl $0x3c, %eax
jne 0x6e4c
incl (%r14)
movl $0x1, %edi
movl $0x30, %esi
callq 0x10c0
movq %rax, %r12
xorl %eax, %eax
callq 0x8b08
movq %rax, 0x18(%r12)
movq %rbx, 0x8(%r12)
movl $0x6, 0x28(%r12)
jmp 0x6e0a
incl (%r14)
movl $0x1, %edi
movl $0x30, %esi
callq 0x10c0
movq %rax, %r12
movq %rbx, 0x8(%rax)
xorl %eax, %eax
callq 0x8b08
movq %rax, 0x18(%r12)
movl $0x2, 0x28(%r12)
movq (%r15), %rax
movslq (%r14), %rcx
movq (%rax,%rcx,8), %rbp
cmpl $0x22, (%rbp)
je 0x6e07
movq %r15, %rdi
movq %r14, %rsi
callq 0x6e9d
movq %rax, %r13
testq %rax, %rax
je 0x6ce7
movq 0x18(%r12), %rdi
movq %r13, %rsi
callq 0x8b3b
movq (%r15), %rax
movslq (%r14), %rcx
movq (%rax,%rcx,8), %rbp
cmpl $0x30, (%rbp)
jne 0x6cf5
leaq 0x1(%rcx), %rdx
movl %edx, (%r14)
movq 0x8(%rax,%rcx,8), %rbp
jmp 0x6cf5
leaq 0x46c0(%rip), %rdi      # 0xb3ae
xorl %eax, %eax
callq 0x8a7c
testq %r13, %r13
jne 0x6c9f
movq %rbx, %r12
xorl %ebx, %ebx
jmp 0x6e16
incl (%r14)
movl $0x1, %edi
movl $0x30, %esi
callq 0x10c0
movq %rax, %r12
movq %rbx, 0x8(%rax)
xorl %eax, %eax
callq 0x8b08
movq %rax, 0x18(%r12)
movl $0x4, 0x28(%r12)
movq (%r15), %rax
movslq (%r14), %r13
movq (%rax,%r13,8), %rbp
movl (%rbp), %edi
cmpl $0x3, %edi
jne 0x6db6
movq 0x8(%rbp), %rdi
callq 0x1190
movq %rax, 0x20(%r12)
jmp 0x6dad
incl (%r14)
movl $0x1, %edi
movl $0x30, %esi
callq 0x10c0
movq %rax, %r12
movq %rbx, 0x8(%rax)
xorl %eax, %eax
callq 0x8b08
movq %rax, 0x18(%r12)
movl $0x1, 0x28(%r12)
movq %r15, %rdi
movq %r14, %rsi
callq 0x60d0
movq %rax, 0x10(%r12)
testq %rax, %rax
je 0x6e23
movq (%r15), %rax
movslq (%r14), %r13
movq (%rax,%r13,8), %rbp
movl (%rbp), %edi
cmpl $0x26, %edi
jne 0x6db6
leal 0x1(%r13), %eax
movl %eax, (%r14)
jmp 0x6e0a
movq %rbx, %r12
callq 0x8a51
xorl %ebx, %ebx
leaq 0x4029(%rip), %rdi      # 0xadf0
movl %r13d, %esi
movq %rax, %rdx
xorl %eax, %eax
callq 0x8a7c
jmp 0x6e16
incl (%r14)
movl $0x1, %edi
movl $0x30, %esi
callq 0x10c0
movq %rax, %r12
xorl %eax, %eax
callq 0x8b08
movq %rax, 0x18(%r12)
movq %rbx, 0x8(%r12)
movl $0x5, 0x28(%r12)
jmp 0x6e0a
incl (%r14)
movq (%r15), %rax
movslq (%r14), %rcx
movq (%rax,%rcx,8), %rbp
movb $0x1, %bl
testb %bl, %bl
movq %r12, %rbx
jne 0x6bc2
jmp 0x6e38
movq %rbx, %r12
xorl %ebx, %ebx
leaq 0x457f(%rip), %rdi      # 0xb3ae
xorl %eax, %eax
callq 0x8a7c
jmp 0x6e16
xorl %ebx, %ebx
jmp 0x6e4c
leaq 0x4540(%rip), %rdi      # 0xb383
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x8a7c
movq 0x20(%rsp), %rbp
movq %rbx, (%rbp)
testq %rbx, %rbx
jne 0x69ea
leaq 0x44c7(%rip), %rdi      # 0xb32c
jmp 0x69e1
movl %r12d, %edi
callq 0x8a51
leaq 0x3f77(%rip), %rdi      # 0xadf0
movl %r13d, %esi
movq %rax, %rdx
xorl %eax, %eax
callq 0x8a7c
cmpl $0x22, %r12d
movq 0x8(%rsp), %r13
je 0x6bac
xorl %r13d, %r13d
jmp 0x6bac