// File: /workspace/github_c_makefile_star2_O3/naleksiev[P]fin/src/fin_ast.c
// Function: fin_ast_parse_assign_expr
static fin_ast_expr_t* fin_ast_parse_assign_expr(fin_ctx_t* ctx, fin_lex_t* lex, fin_ast_expr_t* lhs) {
    lhs = lhs ? lhs : fin_ast_parse_id_expr(ctx, lex, NULL);
    fin_ast_assign_type_t op;
    if (fin_lex_match(lex, fin_lex_type_eq))
        op = fin_ast_assign_type_assign;
    else if (fin_lex_match(lex, fin_lex_type_plus_eq))
        op = fin_ast_assign_type_add;
    else if (fin_lex_match(lex, fin_lex_type_minus_eq))
        op = fin_ast_assign_type_sub;
    else if (fin_lex_match(lex, fin_lex_type_star_eq))
        op = fin_ast_assign_type_mul;
    else if (fin_lex_match(lex, fin_lex_type_slash_eq))
        op = fin_ast_assign_type_div;
    else if (fin_lex_match(lex, fin_lex_type_percent_eq))
        op = fin_ast_assign_type_mod;
    else if (fin_lex_match(lex, fin_lex_type_amp_eq))
        op = fin_ast_assign_type_and;
    else if (fin_lex_match(lex, fin_lex_type_pipe_eq))
        op = fin_ast_assign_type_or;
    else if (fin_lex_match(lex, fin_lex_type_caret_eq))
        op = fin_ast_assign_type_xor;
    else if (fin_lex_match(lex, fin_lex_type_lt_lt_eq))
        op = fin_ast_assign_type_shl;
    else if (fin_lex_match(lex, fin_lex_type_gt_gt_eq))
        op = fin_ast_assign_type_shr;
    else
        return lhs;

    fin_ast_assign_expr_t* assign_expr = (fin_ast_assign_expr_t*)ctx->alloc(NULL, sizeof(fin_ast_assign_expr_t));
    assign_expr->base.type = fin_ast_expr_type_assign;
    assign_expr->lhs = lhs;
    assign_expr->rhs = fin_ast_parse_expr(ctx, lex, NULL);
    assign_expr->op = op;
    return &assign_expr->base;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
testq %rdx, %rdx
jne 0x3d97
movq %r14, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x3c38
movq %rax, %r15
movq %rbx, %rdi
movl $0x10, %esi
callq 0x57da
xorl %r13d, %r13d
testb %al, %al
jne 0x3ea5
movq %rbx, %rdi
movl $0x1e, %esi
callq 0x57da
movl $0x1, %r13d
testb %al, %al
jne 0x3ea5
movq %rbx, %rdi
movl $0x1f, %esi
callq 0x57da
movl $0x2, %r13d
testb %al, %al
jne 0x3ea5
movq %rbx, %rdi
movl $0x20, %esi
callq 0x57da
movl $0x3, %r13d
testb %al, %al
jne 0x3ea5
movq %rbx, %rdi
movl $0x21, %esi
callq 0x57da
movl $0x4, %r13d
testb %al, %al
jne 0x3ea5
movq %rbx, %rdi
movl $0x22, %esi
callq 0x57da
movl $0x5, %r13d
testb %al, %al
jne 0x3ea5
movq %rbx, %rdi
movl $0x23, %esi
callq 0x57da
movl $0x6, %r13d
testb %al, %al
jne 0x3ea5
movq %rbx, %rdi
movl $0x24, %esi
callq 0x57da
movl $0x7, %r13d
testb %al, %al
jne 0x3ea5
movq %rbx, %rdi
movl $0x25, %esi
callq 0x57da
movl $0x8, %r13d
testb %al, %al
jne 0x3ea5
movq %rbx, %rdi
movl $0x29, %esi
callq 0x57da
movl $0x9, %r13d
testb %al, %al
jne 0x3ea5
movq %rbx, %rdi
movl $0x2d, %esi
callq 0x57da
movl $0xa, %r13d
testb %al, %al
je 0x3ed6
xorl %edi, %edi
movl $0x20, %esi
callq *(%r14)
movq %rax, %r12
movl $0xc, (%rax)
movq %r15, 0x8(%rax)
movq %r14, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x3ad6
movq %rax, 0x10(%r12)
movl %r13d, 0x18(%r12)
movq %r12, %r15
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq