// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x1
popq %rdi
pushq $0x30
popq %rsi
callq 0x10c0
movq %rax, %rbx
movq (%r15), %rdx
movslq (%r14), %rax
movq (%rdx,%rax,8), %rcx
movl (%rcx), %ecx
cmpq $0x3c, %rcx
ja 0x61af
movabsq $0x2a0007000000, %rsi   # imm = 0x2A0007000000
btq %rcx, %rsi
jae 0x6193
movl $0x3, 0x20(%rbx)
cmpl $0x18, %ecx
je 0x6315
cmpl $0x19, %ecx
je 0x6311
cmpl $0x2d, %ecx
je 0x6305
cmpl $0x29, %ecx
je 0x630d
cmpl $0x2b, %ecx
je 0x6309
cmpl $0x1a, %ecx
jne 0x631b
pushq $0xd
jmp 0x6317
cmpq $0x3b, %rcx
je 0x624e
cmpq $0x3c, %rcx
jne 0x61af
movl $0x2, 0x20(%rbx)
jmp 0x6255
cmpl $0x17, %ecx
jne 0x627e
leaq 0x1(%rax), %r12
movl %r12d, (%r14)
movq 0x8(%rdx,%rax,8), %rcx
movl (%rcx), %edi
cmpl $0x21, %edi
jne 0x6670
movq %rax, %rcx
addq $0x2, %rcx
movl %ecx, (%r14)
movq 0x10(%rdx,%rax,8), %r12
cmpl $0x3, (%r12)
jne 0x61fe
movq 0x7f74(%rip), %rdi      # 0xe160
movq 0x8(%r12), %rsi
callq 0x83c5
testb %al, %al
je 0x6636
movl $0x5, 0x20(%rbx)
pushq $0x1
popq %rdi
pushq $0x10
popq %rsi
callq 0x10c0
movq %rax, %r13
movq %r15, %rdi
movq %r14, %rsi
callq 0x597a
movq %rax, (%r13)
testq %rax, %rax
je 0x661a
movq (%r15), %rax
movslq (%r14), %r12
movq (%rax,%r12,8), %rcx
cmpl $0x1a, (%rcx)
jne 0x6245
movb $0x1, 0x8(%r13)
incl %r12d
movl %r12d, (%r14)
movq %r13, 0x18(%rbx)
jmp 0x6657
movl $0x1, 0x20(%rbx)
incl %eax
movl %eax, (%r14)
movq %r15, %rdi
movq %r14, %rsi
callq 0x610b
movq %rax, 0x8(%rbx)
testq %rax, %rax
jne 0x66f2
leaq 0x4068(%rip), %rdi      # 0xa2e1
jmp 0x66e9
andl $0x0, 0x20(%rbx)
pushq $0x1
popq %r13
pushq $0x30
popq %rsi
movq %r13, %rdi
callq 0x10c0
movq %rax, %r12
xorl %eax, %eax
callq 0x812e
movq %rax, 0x18(%r12)
pushq $0x28
popq %rsi
movq %r13, %rdi
callq 0x10c0
movq (%r15), %r13
movslq (%r14), %rcx
movq (%r13,%rcx,8), %rdx
movl (%rdx), %ebp
cmpl $0x3, %ebp
jae 0x6344
movq %rdx, 0x8(%rsp)
movq %rcx, (%rsp)
movq %rax, 0x10(%rsp)
pushq $0x1
popq %rdi
pushq $0x18
popq %rsi
callq 0x10c0
movq %rax, %rsi
cmpl $0x2, %ebp
je 0x6371
cmpl $0x1, %ebp
jne 0x63f2
movl $0x1, (%rsi)
movq 0x8(%rsp), %rax
movl 0x4(%rax), %eax
movl %eax, 0x4(%rsi)
jmp 0x638f
pushq $0x10
jmp 0x6317
pushq $0xa
jmp 0x6317
pushq $0x11
jmp 0x6317
pushq $0xc
jmp 0x6317
pushq $0xb
popq %rcx
movl %ecx, 0x24(%rbx)
incl %eax
movl %eax, (%r14)
movq %r15, %rdi
movq %r14, %rsi
callq 0x60c6
movq %rax, 0x10(%rbx)
testq %rax, %rax
jne 0x66f2
leaq 0x3f7a(%rip), %rdi      # 0xa2b9
jmp 0x66e9
cmpl $0x21, %ebp
je 0x639a
movq %rcx, (%rsp)
cmpl $0x3, %ebp
jne 0x63db
movq 0x8(%rdx), %rdi
movq %rax, %rbp
callq 0x1190
movq %rbp, %rcx
movq %rax, 0x18(%rbp)
movq (%rsp), %rax
incl %eax
jmp 0x63d6
movl $0x2, (%rsi)
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rdi
movq %rsi, %rbp
callq 0x1190
movq %rbp, %rsi
movq %rax, 0x10(%rbp)
movq 0x10(%rsp), %rcx
movq (%rsp), %rdx
jmp 0x6406
incl %ecx
movl %ecx, (%r14)
movq %r15, %rdi
movq %r14, %rsi
movq %rax, %r13
callq 0x5bcf
movq %rax, 0x8(%r13)
testq %rax, %rax
je 0x66a8
movq %r13, %rcx
movq (%r15), %r13
movslq (%r14), %rbp
movq (%r13,%rbp,8), %rax
movl (%rax), %edi
cmpl $0x22, %edi
jne 0x66b8
leal 0x1(%rbp), %eax
movl %eax, (%r14)
jmp 0x640f
movl %ebp, %edi
callq 0x807a
leaq 0x3a07(%rip), %rdi      # 0x9df0
movq (%rsp), %rsi
jmp 0x66c6
movq 0x10(%rsp), %rcx
movq (%rsp), %rdx
movq 0x8(%rsp), %rax
movl 0x4(%rax), %eax
movl %eax, 0x4(%rsi)
leal 0x1(%rdx), %eax
movl %eax, (%r14)
movq %rsi, (%rcx)
movq %rcx, (%r12)
movslq %eax, %rcx
movq (%r13,%rcx,8), %rcx
movl (%rcx), %ecx
cmpl $0x21, %ecx
je 0x6506
cmpl $0x3c, %ecx
je 0x65d0
cmpl $0x31, %ecx
je 0x64aa
cmpl $0x32, %ecx
je 0x657b
cmpl $0x3b, %ecx
je 0x64d8
cmpl $0x25, %ecx
jne 0x6704
incl %eax
movl %eax, (%r14)
pushq $0x1
popq %rdi
pushq $0x30
popq %rsi
callq 0x10c0
movq %rax, %rbp
movq %r12, 0x8(%rax)
xorl %eax, %eax
callq 0x812e
movq %rax, 0x18(%rbp)
movl $0x1, 0x28(%rbp)
movq %r15, %rdi
movq %r14, %rsi
callq 0x5bcf
movq %rax, 0x10(%rbp)
testq %rax, %rax
je 0x660e
movq (%r15), %rax
movslq (%r14), %r12
movq (%rax,%r12,8), %rax
movl (%rax), %edi
cmpl $0x26, %edi
je 0x65c6
jmp 0x668d
incl %eax
movl %eax, (%r14)
pushq $0x1
popq %rdi
pushq $0x30
popq %rsi
callq 0x10c0
movq %rax, %rbp
movq %r12, 0x8(%rax)
xorl %eax, %eax
callq 0x812e
movq %rax, 0x18(%rbp)
movl $0x3, 0x28(%rbp)
jmp 0x65a4
incl %eax
movl %eax, (%r14)
pushq $0x1
popq %rdi
pushq $0x30
popq %rsi
callq 0x10c0
movq %rax, %rbp
xorl %eax, %eax
callq 0x812e
movq %rax, 0x18(%rbp)
movq %r12, 0x8(%rbp)
movl $0x5, 0x28(%rbp)
jmp 0x6600
incl %eax
movl %eax, (%r14)
pushq $0x1
popq %rdi
pushq $0x30
popq %rsi
callq 0x10c0
movq %rax, %rbp
movq %r12, 0x8(%rax)
xorl %eax, %eax
callq 0x812e
movq %rax, 0x18(%rbp)
movl $0x2, 0x28(%rbp)
movq (%r15), %rcx
movl (%r14), %eax
movslq %eax, %rdx
movq (%rcx,%rdx,8), %rdx
cmpl $0x22, (%rdx)
je 0x65fb
movq %r15, %rdi
movq %r14, %rsi
callq 0x6709
testq %rax, %rax
je 0x660e
movq 0x18(%rbp), %rdi
movq %rax, %rsi
callq 0x8167
movq (%r15), %rcx
movslq (%r14), %rax
movq (%rcx,%rax,8), %rdx
cmpl $0x30, (%rdx)
jne 0x653c
incl %eax
movl %eax, (%r14)
jmp 0x6535
incl %eax
movl %eax, (%r14)
pushq $0x1
popq %rdi
pushq $0x30
popq %rsi
callq 0x10c0
movq %rax, %rbp
movq %r12, 0x8(%rax)
xorl %eax, %eax
callq 0x812e
movq %rax, 0x18(%rbp)
movl $0x4, 0x28(%rbp)
movq (%r15), %rax
movslq (%r14), %r12
movq (%rax,%r12,8), %rax
movl (%rax), %edi
cmpl $0x3, %edi
jne 0x668d
movq 0x8(%rax), %rdi
callq 0x1190
movq %rax, 0x20(%rbp)
leal 0x1(%r12), %eax
movl %eax, (%r14)
jmp 0x6600
incl %eax
movl %eax, (%r14)
pushq $0x1
popq %rdi
pushq $0x30
popq %rsi
callq 0x10c0
movq %rax, %rbp
xorl %eax, %eax
callq 0x812e
movq %rax, 0x18(%rbp)
movq %r12, 0x8(%rbp)
movl $0x6, 0x28(%rbp)
jmp 0x6600
incl %eax
movl %eax, (%r14)
movq (%r15), %r13
movl (%r14), %eax
movq %rbp, %r12
jmp 0x6413
leaq 0x3d99(%rip), %rdi      # 0xa3ae
jmp 0x66d7
leaq 0x3d36(%rip), %rdi      # 0xa357
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x80a8
leaq 0x3cd9(%rip), %rdi      # 0xa30a
jmp 0x66eb
movl $0x4, 0x20(%rbx)
movq 0x8(%r12), %rdi
callq 0x1190
movq %rax, 0x28(%rbx)
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 0x6670
incl %r12d
movl %r12d, (%r14)
jmp 0x66f2
callq 0x807a
leaq 0x3774(%rip), %rdi      # 0x9df0
xorl %ebx, %ebx
movl %r12d, %esi
movq %rax, %rdx
xorl %eax, %eax
callq 0x80a8
jmp 0x66f2
callq 0x807a
leaq 0x3757(%rip), %rdi      # 0x9df0
movl %r12d, %esi
movq %rax, %rdx
xorl %eax, %eax
callq 0x80a8
jmp 0x66de
leaq 0x3d2d(%rip), %rdi      # 0xa3dc
xorl %eax, %eax
callq 0x80a8
jmp 0x66d0
callq 0x807a
leaq 0x372c(%rip), %rdi      # 0x9df0
movl %ebp, %esi
movq %rax, %rdx
xorl %eax, %eax
callq 0x80a8
leaq 0x3cac(%rip), %rdi      # 0xa383
xorl %eax, %eax
callq 0x80a8
andq $0x0, (%rbx)
leaq 0x3c43(%rip), %rdi      # 0xa32c
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x80a8
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r12, (%rbx)
jmp 0x66f2