// File: /workspace/github_c_makefile_star2_O3/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 $0x18, %rsp
movq %rsi, %r14
movq %rdi, %r15
movl $0x1, %edi
movl $0x30, %esi
callq 0x10c0
movq %rax, %rbp
movq (%r15), %rdx
movslq (%r14), %rax
movq (%rdx,%rax,8), %rcx
movl (%rcx), %ecx
cmpq $0x3c, %rcx
ja 0x661e
movabsq $0x2a0007000000, %rsi   # imm = 0x2A0007000000
btq %rcx, %rsi
jae 0x6602
movl $0x3, 0x20(%rbp)
cmpl $0x28, %ecx
jg 0x65dd
cmpl $0x18, %ecx
je 0x677d
cmpl $0x19, %ecx
je 0x678b
cmpl $0x1a, %ecx
jne 0x679a
movl $0xd, %ecx
jmp 0x6797
cmpl $0x29, %ecx
je 0x6784
cmpl $0x2b, %ecx
je 0x6792
cmpl $0x2d, %ecx
jne 0x679a
movl $0x10, %ecx
jmp 0x6797
cmpq $0x3b, %rcx
je 0x66be
cmpq $0x3c, %rcx
jne 0x661e
movl $0x2, 0x20(%rbp)
jmp 0x66c5
cmpl $0x17, %ecx
jne 0x66ee
leaq 0x1(%rax), %r12
movl %r12d, (%r14)
movq 0x8(%rdx,%rax,8), %rcx
movl (%rcx), %edi
cmpl $0x21, %edi
jne 0x6b4d
movq %rax, %rcx
addq $0x2, %rcx
movl %ecx, (%r14)
movq 0x10(%rdx,%rax,8), %rbx
cmpl $0x3, (%rbx)
jne 0x666a
movq 0x7b07(%rip), %rdi      # 0xe160
movq 0x8(%rbx), %rsi
callq 0x89bf
testb %al, %al
je 0x6b17
movl $0x5, 0x20(%rbp)
movl $0x1, %edi
movl $0x10, %esi
callq 0x10c0
movq %rax, %r13
movq %r15, %rdi
movq %r14, %rsi
callq 0x5d1b
movq %rax, (%r13)
testq %rax, %rax
je 0x6afb
movq (%r15), %rax
movslq (%r14), %r12
movq (%rax,%r12,8), %rcx
cmpl $0x1a, (%rcx)
jne 0x66b5
movb $0x1, 0x8(%r13)
incl %r12d
movl %r12d, (%r14)
movq %r13, 0x18(%rbp)
jmp 0x6b37
movl $0x1, 0x20(%rbp)
incl %eax
movl %eax, (%r14)
movq %r15, %rdi
movq %r14, %rsi
callq 0x6560
movq %rax, 0x8(%rbp)
testq %rax, %rax
jne 0x6ba2
leaq 0x3bf8(%rip), %rdi      # 0xa2e1
jmp 0x6b99
movq %rbp, (%rsp)
movl $0x0, 0x20(%rbp)
movl $0x1, %edi
movl $0x30, %esi
callq 0x10c0
movq %rax, %r12
xorl %eax, %eax
callq 0x8738
movq %rax, 0x18(%r12)
movl $0x1, %edi
movl $0x28, %esi
callq 0x10c0
movq (%r15), %rbx
movslq (%r14), %rcx
movq (%rbx,%rcx,8), %r13
movl (%r13), %ebp
cmpl $0x3, %ebp
jae 0x67c3
movq %rcx, 0x8(%rsp)
movq %rax, 0x10(%rsp)
movl $0x1, %edi
movl $0x18, %esi
callq 0x10c0
movq %rax, %rsi
cmpl $0x2, %ebp
je 0x67fc
cmpl $0x1, %ebp
jne 0x688c
movl $0x1, (%rsi)
movl 0x4(%r13), %eax
movl %eax, 0x4(%rsi)
jmp 0x6815
movl $0xb, %ecx
jmp 0x6797
movl $0x11, %ecx
jmp 0x6797
movl $0xc, %ecx
jmp 0x6797
movl $0xa, %ecx
movl %ecx, 0x24(%rbp)
incl %eax
movl %eax, (%r14)
movq %r15, %rdi
movq %r14, %rsi
callq 0x6517
movq %rax, 0x10(%rbp)
testq %rax, %rax
jne 0x6ba2
leaq 0x3afb(%rip), %rdi      # 0xa2b9
jmp 0x6b99
cmpl $0x21, %ebp
je 0x6825
movq %rcx, 0x8(%rsp)
cmpl $0x3, %ebp
jne 0x686a
movq 0x8(%r13), %rdi
movq %rax, %r13
callq 0x1190
movq %r13, %rcx
movq %rax, 0x18(%r13)
movq 0x8(%rsp), %rax
incl %eax
movl %eax, (%r14)
movq (%rsp), %rbp
jmp 0x68aa
movl $0x2, (%rsi)
movq 0x8(%r13), %rdi
movq %rsi, %r13
callq 0x1190
movq %r13, %rsi
movq %rax, 0x10(%r13)
movq (%rsp), %rbp
movq 0x10(%rsp), %rcx
movq 0x8(%rsp), %rdx
jmp 0x68a1
incl %ecx
movl %ecx, (%r14)
movq %r15, %rdi
movq %r14, %rsi
movq %rax, %rbx
callq 0x5f8a
movq %rax, 0x8(%rbx)
testq %rax, %rax
je 0x6b6a
movq %rbx, %rcx
movq (%r15), %rbx
movslq (%r14), %r13
movq (%rbx,%r13,8), %rax
movl (%rax), %edi
cmpl $0x22, %edi
movq (%rsp), %rbp
jne 0x6bba
leal 0x1(%r13), %eax
movl %eax, (%r14)
jmp 0x68aa
movl %ebp, %edi
callq 0x8681
leaq 0x3578(%rip), %rdi      # 0x9df0
movq 0x8(%rsp), %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x86ac
jmp 0x6b78
movq (%rsp), %rbp
movq 0x10(%rsp), %rcx
movq 0x8(%rsp), %rdx
movl 0x4(%r13), %eax
movl %eax, 0x4(%rsi)
leal 0x1(%rdx), %eax
movl %eax, (%r14)
movq %rsi, (%rcx)
movq %rcx, (%r12)
movslq %eax, %rcx
movq (%rbx,%rcx,8), %rcx
movl (%rcx), %ecx
cmpl $0x31, %ecx
jg 0x690a
cmpl $0x21, %ecx
je 0x6958
cmpl $0x25, %ecx
je 0x6a38
cmpl $0x31, %ecx
jne 0x6bb4
incl %eax
movl %eax, (%r14)
movl $0x1, %edi
movl $0x30, %esi
callq 0x10c0
movq %rax, %r13
movq %r12, 0x8(%rax)
xorl %eax, %eax
callq 0x8738
movq %rax, 0x18(%r13)
movl $0x3, 0x28(%r13)
jmp 0x6a14
cmpl $0x32, %ecx
je 0x69e6
cmpl $0x3b, %ecx
je 0x6a95
cmpl $0x3c, %ecx
jne 0x6bb4
incl %eax
movl %eax, (%r14)
movl $0x1, %edi
movl $0x30, %esi
callq 0x10c0
movq %rax, %r13
xorl %eax, %eax
callq 0x8738
movq %rax, 0x18(%r13)
movq %r12, 0x8(%r13)
movl $0x6, 0x28(%r13)
jmp 0x6ac3
incl %eax
movl %eax, (%r14)
movl $0x1, %edi
movl $0x30, %esi
callq 0x10c0
movq %rax, %r13
movq %r12, 0x8(%rax)
xorl %eax, %eax
callq 0x8738
movq %rax, 0x18(%r13)
movl $0x2, 0x28(%r13)
movq (%r15), %rcx
movslq (%r14), %rax
movq (%rcx,%rax,8), %rcx
cmpl $0x22, (%rcx)
je 0x69dc
movq %r15, %rdi
movq %r14, %rsi
callq 0x6bd5
testq %rax, %rax
je 0x6ad1
movq 0x18(%r13), %rdi
movq %rax, %rsi
callq 0x876b
movq (%r15), %rcx
movl (%r14), %eax
movslq %eax, %rdx
movq (%rcx,%rdx,8), %rsi
movl (%rsi), %esi
cmpl $0x30, %esi
jne 0x69d7
leaq 0x1(%rdx), %rax
movl %eax, (%r14)
movq 0x8(%rcx,%rdx,8), %rcx
movl (%rcx), %esi
cmpl $0x22, %esi
jne 0x6995
incl %eax
movl %eax, (%r14)
jmp 0x6ac3
incl %eax
movl %eax, (%r14)
movl $0x1, %edi
movl $0x30, %esi
callq 0x10c0
movq %rax, %r13
movq %r12, 0x8(%rax)
xorl %eax, %eax
callq 0x8738
movq %rax, 0x18(%r13)
movl $0x4, 0x28(%r13)
movq (%r15), %rax
movslq (%r14), %r12
movq (%rax,%r12,8), %rax
movl (%rax), %edi
cmpl $0x3, %edi
jne 0x6add
movq 0x8(%rax), %rdi
callq 0x1190
movq %rax, 0x20(%r13)
jmp 0x6a8b
incl %eax
movl %eax, (%r14)
movl $0x1, %edi
movl $0x30, %esi
callq 0x10c0
movq %rax, %r13
movq %r12, 0x8(%rax)
xorl %eax, %eax
callq 0x8738
movq %rax, 0x18(%r13)
movl $0x1, 0x28(%r13)
movq %r15, %rdi
movq %r14, %rsi
callq 0x5f8a
movq %rax, 0x10(%r13)
testq %rax, %rax
je 0x6ad1
movq (%r15), %rax
movslq (%r14), %r12
movq (%rax,%r12,8), %rax
movl (%rax), %edi
cmpl $0x26, %edi
jne 0x6add
leal 0x1(%r12), %eax
movl %eax, (%r14)
jmp 0x6ac3
incl %eax
movl %eax, (%r14)
movl $0x1, %edi
movl $0x30, %esi
callq 0x10c0
movq %rax, %r13
xorl %eax, %eax
callq 0x8738
movq %rax, 0x18(%r13)
movq %r12, 0x8(%r13)
movl $0x5, 0x28(%r13)
movq (%r15), %rbx
movl (%r14), %eax
movq %r13, %r12
jmp 0x68ae
leaq 0x38d6(%rip), %rdi      # 0xa3ae
jmp 0x6b83
callq 0x8681
leaq 0x3307(%rip), %rdi      # 0x9df0
movl %r12d, %esi
movq %rax, %rdx
xorl %eax, %eax
callq 0x86ac
jmp 0x6b8a
leaq 0x3855(%rip), %rdi      # 0xa357
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x86ac
leaq 0x37f8(%rip), %rdi      # 0xa30a
jmp 0x6b9b
movl $0x4, 0x20(%rbp)
movq 0x8(%rbx), %rdi
callq 0x1190
movq %rax, 0x28(%rbp)
movl (%r14), %r12d
incl %r12d
movl %r12d, (%r14)
movq (%r15), %rax
movslq %r12d, %rcx
movq (%rax,%rcx,8), %rax
movl (%rax), %edi
cmpl $0x22, %edi
jne 0x6b4d
incl %r12d
movl %r12d, (%r14)
jmp 0x6ba2
callq 0x8681
leaq 0x3297(%rip), %rdi      # 0x9df0
xorl %ebp, %ebp
movl %r12d, %esi
movq %rax, %rdx
xorl %eax, %eax
callq 0x86ac
jmp 0x6ba2
leaq 0x386b(%rip), %rdi      # 0xa3dc
xorl %eax, %eax
callq 0x86ac
movq (%rsp), %rbp
leaq 0x3800(%rip), %rdi      # 0xa383
xorl %eax, %eax
callq 0x86ac
movq $0x0, (%rbp)
leaq 0x3793(%rip), %rdi      # 0xa32c
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x86ac
movq %rbp, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r12, (%rbp)
jmp 0x6ba2
callq 0x8681
leaq 0x322a(%rip), %rdi      # 0x9df0
movl %r13d, %esi
movq %rax, %rdx
xorl %eax, %eax
callq 0x86ac
jmp 0x6b7c