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

    conditional_expr_node->logical_or_expr_node  = create_logical_or_expr_node(vec, index);
    if (conditional_expr_node->logical_or_expr_node == NULL) {
        error("Failed to create logical-or-expression node.\n");
        return NULL;
    }

    const Token* token = vec->elements[*index];
    if (token->type == TK_QUESTION) {
        ++(*index);

        conditional_expr_node->expr_node = create_expr_node(vec, index);
        if (conditional_expr_node->expr_node == NULL) {
            error("Failed to create 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);

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

    return conditional_expr_node;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %r15
movl $0x1, %edi
movl $0x18, %esi
callq 0x10c0
movq %rax, %r13
movl $0x1, %edi
movl $0x10, %esi
callq 0x10c0
movq %rax, %rbx
movq %r15, %rdi
movq %r14, %rsi
callq 0x618f
movq %rax, (%rbx)
testq %rax, %rax
je 0x600f
movq %r13, (%rsp)
movq (%r15), %rax
movslq (%r14), %rcx
movq (%rax,%rcx,8), %r13
cmpl $0x37, (%r13)
jne 0x6009
incl (%r14)
movl $0x1, %edi
movl $0x10, %esi
callq 0x10c0
movq %rax, %r12
movq %rbx, 0x8(%rax)
movq %r15, %rdi
movq %r14, %rsi
callq 0x618f
movq %rax, %rbp
movq %rax, (%r12)
testq %rax, %rax
je 0x5ff4
movq (%r15), %rax
movslq (%r14), %rcx
movq (%rax,%rcx,8), %r13
movq %r12, %rbx
jmp 0x6002
leaq 0x5105(%rip), %rdi      # 0xb100
xorl %eax, %eax
callq 0x8a7c
testq %rbp, %rbp
jne 0x5fae
xorl %ebx, %ebx
movq (%rsp), %r13
jmp 0x601f
leaq 0x50ea(%rip), %rdi      # 0xb100
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x8a7c
movq %rbx, (%r13)
testq %rbx, %rbx
je 0x6086
movq (%r15), %rcx
movslq (%r14), %rax
movq (%rcx,%rax,8), %rcx
cmpl $0x2a, (%rcx)
jne 0x60a0
incl %eax
movl %eax, (%r14)
movq %r15, %rdi
movq %r14, %rsi
callq 0x60d0
movq %rax, 0x8(%r13)
testq %rax, %rax
je 0x608f
movq (%r15), %rax
movslq (%r14), %r12
movq (%rax,%r12,8), %rax
movl (%rax), %edi
cmpl $0x20, %edi
jne 0x60b2
leal 0x1(%r12), %eax
movl %eax, (%r14)
movq %r15, %rdi
movq %r14, %rsi
callq 0x5f58
movq %rax, 0x10(%r13)
testq %rax, %rax
jne 0x60a0
leaq 0x504d(%rip), %rdi      # 0xb0d1
jmp 0x6096
leaq 0x4ff3(%rip), %rdi      # 0xb080
jmp 0x6096
leaq 0x5018(%rip), %rdi      # 0xb0ae
xorl %r13d, %r13d
xorl %eax, %eax
callq 0x8a7c
movq %r13, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x8a51
leaq 0x4d32(%rip), %rdi      # 0xadf0
xorl %r13d, %r13d
movl %r12d, %esi
movq %rax, %rdx
xorl %eax, %eax
callq 0x8a7c
jmp 0x60a0