// File: /workspace/github_c_makefile_star2_O2/chgzm[P]minic/parser.c
// Function: create_assign_expr_node
static AssignExprNode* create_assign_expr_node(const Vector* vec, int* index) {
    AssignExprNode* assign_expr_node = calloc(1, sizeof(AssignExprNode));

    assign_expr_node->assign_operator = OP_NONE;

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

    const Token* token = vec->elements[*index];
    if (token->type == TK_ASSIGN || token->type == TK_MUL_EQ || token->type == TK_DIV_EQ
     || token->type == TK_MOD_EQ || token->type == TK_ADD_EQ || token->type == TK_SUB_EQ
     || token->type == TK_AND_EQ || token->type == TK_XOR_EQ || token->type == TK_OR_EQ) {
        if      (token->type == TK_ASSIGN) { assign_expr_node->assign_operator = OP_ASSIGN; }
        else if (token->type == TK_MUL_EQ) { assign_expr_node->assign_operator = OP_MUL_EQ; }
        else if (token->type == TK_DIV_EQ) { assign_expr_node->assign_operator = OP_DIV_EQ; }
        else if (token->type == TK_MOD_EQ) { assign_expr_node->assign_operator = OP_MOD_EQ; }
        else if (token->type == TK_ADD_EQ) { assign_expr_node->assign_operator = OP_ADD_EQ; }
        else if (token->type == TK_SUB_EQ) { assign_expr_node->assign_operator = OP_SUB_EQ; }
        else if (token->type == TK_AND_EQ) { assign_expr_node->assign_operator = OP_AND_EQ; }
        else if (token->type == TK_XOR_EQ) { assign_expr_node->assign_operator = OP_XOR_EQ; }
        else if (token->type == TK_OR_EQ)  { assign_expr_node->assign_operator = OP_OR_EQ;  }

        ++(*index);
        assign_expr_node->assign_expr_node = create_assign_expr_node(vec, index);
        if (assign_expr_node->assign_expr_node == NULL) {
            error("Failed to create assign-expression node.\n");
            return NULL;
        }
    } else {
        assign_expr_node->unary_expr_node = NULL;
        *index = buf; // restore index

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

    return assign_expr_node;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %r15
pushq $0x1
popq %rdi
pushq $0x20
popq %rsi
callq 0x10c0
movq %rax, %rbx
movl (%r14), %ebp
movq %r15, %rdi
movq %r14, %rsi
callq 0x610b
movq %rax, 0x8(%rbx)
testq %rax, %rax
je 0x6763
movq (%r15), %rcx
movslq (%r14), %rax
movq (%rcx,%rax,8), %rcx
movl (%rcx), %edx
leal -0x3d(%rdx), %ecx
cmpl $0x7, %ecx
ja 0x676c
leaq 0x32ce(%rip), %rdx      # 0x9a24
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
pushq $0x2
jmp 0x678f
leaq 0x3b77(%rip), %rdi      # 0xa2e1
jmp 0x67b3
cmpl $0x1e, %edx
jne 0x67ca
pushq $0x1
jmp 0x678f
pushq $0x6
jmp 0x678f
pushq $0x4
jmp 0x678f
pushq $0x5
jmp 0x678f
pushq $0x9
jmp 0x678f
pushq $0x3
jmp 0x678f
pushq $0x7
jmp 0x678f
pushq $0x8
popq %rcx
movl %ecx, 0x18(%rbx)
incl %eax
movl %eax, (%r14)
movq %r15, %rdi
movq %r14, %rsi
callq 0x6709
movq %rax, 0x10(%rbx)
testq %rax, %rax
jne 0x67bc
leaq 0x3c4c(%rip), %rdi      # 0xa3ff
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x80a8
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
andq $0x0, 0x8(%rbx)
movl %ebp, (%r14)
movq %r15, %rdi
movq %r14, %rsi
callq 0x5a86
movq %rax, (%rbx)
testq %rax, %rax
jne 0x67bc
leaq 0x38e5(%rip), %rdi      # 0xa0d1
jmp 0x67b3