// File: /workspace/github_c_makefile_star2_O1/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
movl $0x1, %edi
movl $0x20, %esi
callq 0x10c0
movq %rax, %rbx
movl $0x0, 0x18(%rax)
movl (%r14), %ebp
movq %r15, %rdi
movq %r14, %rsi
callq 0x6771
movq %rax, 0x8(%rbx)
testq %rax, %rax
je 0x6f05
movq (%r15), %rcx
movslq (%r14), %rax
movq (%rcx,%rax,8), %rcx
movl (%rcx), %edx
leal -0x3d(%rdx), %ecx
cmpl $0x7, %ecx
ja 0x6f11
leaq 0x3b2f(%rip), %rdx      # 0xaa24
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movl $0x2, %ecx
jmp 0x6f71
leaq 0x43d5(%rip), %rdi      # 0xb2e1
jmp 0x6f94
movl $0x1, %ecx
cmpl $0x1e, %edx
je 0x6f71
movq $0x0, 0x8(%rbx)
movl %ebp, (%r14)
movq %r15, %rdi
movq %r14, %rsi
callq 0x5f58
movq %rax, (%rbx)
testq %rax, %rax
jne 0x6f9d
leaq 0x4191(%rip), %rdi      # 0xb0d1
jmp 0x6f94
movl $0x6, %ecx
jmp 0x6f71
movl $0x4, %ecx
jmp 0x6f71
movl $0x5, %ecx
jmp 0x6f71
movl $0x9, %ecx
jmp 0x6f71
movl $0x3, %ecx
jmp 0x6f71
movl $0x7, %ecx
jmp 0x6f71
movl $0x8, %ecx
movl %ecx, 0x18(%rbx)
incl %eax
movl %eax, (%r14)
movq %r15, %rdi
movq %r14, %rsi
callq 0x6e9d
movq %rax, 0x10(%rbx)
testq %rax, %rax
jne 0x6f9d
leaq 0x448c(%rip), %rdi      # 0xb420
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x8a7c
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq