// File: /workspace/github_c_makefile_star2_O3/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 (%r14), %ebp
movq %r15, %rdi
movq %r14, %rsi
callq 0x6560
movq %rax, 0x8(%rbx)
testq %rax, %rax
je 0x6c36
movq (%r15), %rcx
movslq (%r14), %rax
movq (%rcx,%rax,8), %rcx
movl (%rcx), %edx
leal -0x3d(%rdx), %ecx
cmpl $0x7, %ecx
ja 0x6c42
leaq 0x2dfe(%rip), %rdx      # 0x9a24
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movl $0x2, %ecx
jmp 0x6ca2
leaq 0x36a4(%rip), %rdi      # 0xa2e1
jmp 0x6cc5
movl $0x1, %ecx
cmpl $0x1e, %edx
je 0x6ca2
movq $0x0, 0x8(%rbx)
movl %ebp, (%r14)
movq %r15, %rdi
movq %r14, %rsi
callq 0x5e3d
movq %rax, (%rbx)
testq %rax, %rax
jne 0x6cce
leaq 0x3460(%rip), %rdi      # 0xa0d1
jmp 0x6cc5
movl $0x6, %ecx
jmp 0x6ca2
movl $0x4, %ecx
jmp 0x6ca2
movl $0x5, %ecx
jmp 0x6ca2
movl $0x9, %ecx
jmp 0x6ca2
movl $0x3, %ecx
jmp 0x6ca2
movl $0x7, %ecx
jmp 0x6ca2
movl $0x8, %ecx
movl %ecx, 0x18(%rbx)
incl %eax
movl %eax, (%r14)
movq %r15, %rdi
movq %r14, %rsi
callq 0x6bd5
movq %rax, 0x10(%rbx)
testq %rax, %rax
jne 0x6cce
leaq 0x373a(%rip), %rdi      # 0xa3ff
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x86ac
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq