// File: /workspace/github_c_makefile_star2_O0/Yamsman[P]scc/src/parse.c
// Function: parse_expr_assign
ast_n *parse_expr_assign(lexer *lx) {
	ast_n *node = parse_expr_cond(lx);

	//lhs must be unary_expr
	ast_n *n_node;
	int atype = 0;
	switch (lex_peek(lx).type) {
		case TOK_ASSIGN_ADD: atype = EXPR_ADD; goto base;
		case TOK_ASSIGN_SUB: atype = EXPR_SUB; goto base;
		case TOK_ASSIGN_MUL: atype = EXPR_MUL; goto base;
		case TOK_ASSIGN_DIV: atype = EXPR_DIV; goto base;
		case TOK_ASSIGN_MOD: atype = EXPR_MOD; goto base;
		case TOK_ASSIGN_AND: atype = EXPR_AND; goto base;
		case TOK_ASSIGN_OR: atype = EXPR_OR; goto base;
		case TOK_ASSIGN_XOR: atype = EXPR_XOR; goto base;
		case TOK_ASSIGN_LSHIFT: atype = EXPR_LSHIFT; goto base;
		case TOK_ASSIGN_RSHIFT: atype = EXPR_RSHIFT; goto base;

		case TOK_ASSIGN: {
base:			n_node = astn_new(EXPR, EXPR_ASSIGN, lex_peek(lx));
			lex_adv(lx);
			ast_expr *n_expr = &n_node->dat.expr;
			n_expr->left = node;
			n_expr->right = parse_expr_assign(lx);
			break;
			}

		default:
			return node;
	}

	//Expand assignment
	if (atype) {
		ast_n *opr = astn_new(EXPR, atype, lex_peek(lx));
		opr->dat.expr.left = node;
		opr->dat.expr.right = n_node->dat.expr.right;
		n_node->dat.expr.right = opr;
	}

	return n_node;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x110, %rsp            # imm = 0x110
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0xc110
movq %rax, -0x18(%rbp)
movl $0x0, -0x24(%rbp)
movq -0x10(%rbp), %rsi
leaq -0x58(%rbp), %rdi
callq 0x9790
movl -0x58(%rbp), %eax
addl $-0x27, %eax
movl %eax, %ecx
movq %rcx, -0xd0(%rbp)
subl $0xa, %eax
ja 0xba8a
movq -0xd0(%rbp), %rax
leaq 0x6fee(%rip), %rcx      # 0x12994
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x10, -0x24(%rbp)
jmp 0xba0b
movl $0x11, -0x24(%rbp)
jmp 0xba0b
movl $0x12, -0x24(%rbp)
jmp 0xba0b
movl $0x13, -0x24(%rbp)
jmp 0xba0b
movl $0x14, -0x24(%rbp)
jmp 0xba0b
movl $0x7, -0x24(%rbp)
jmp 0xba0b
movl $0x5, -0x24(%rbp)
jmp 0xba0b
movl $0x6, -0x24(%rbp)
jmp 0xba0b
movl $0xc, -0x24(%rbp)
jmp 0xba0b
movl $0xd, -0x24(%rbp)
jmp 0xba0b
jmp 0xba0b
movq -0x10(%rbp), %rsi
leaq -0x88(%rbp), %rdi
callq 0x9790
xorl %eax, %eax
movups -0x88(%rbp), %xmm0
movups -0x78(%rbp), %xmm1
movups -0x68(%rbp), %xmm2
movq %rsp, %rax
movups %xmm2, 0x20(%rax)
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
movl $0x1, %edi
xorl %esi, %esi
callq 0x3350
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
callq 0x97e0
movq -0x20(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x90(%rbp)
movq -0x18(%rbp), %rcx
movq -0x90(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rdi
callq 0xb950
movq %rax, %rcx
movq -0x90(%rbp), %rax
movq %rcx, 0x20(%rax)
jmp 0xba97
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0xbb2d
cmpl $0x0, -0x24(%rbp)
je 0xbb25
movl -0x24(%rbp), %eax
movl %eax, -0xd4(%rbp)
movq -0x10(%rbp), %rsi
leaq -0xc8(%rbp), %rdi
callq 0x9790
movl -0xd4(%rbp), %esi
movups -0xc8(%rbp), %xmm0
movups -0xb8(%rbp), %xmm1
movups -0xa8(%rbp), %xmm2
movq %rsp, %rax
movups %xmm2, 0x20(%rax)
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
movl $0x1, %edi
callq 0x3350
movq %rax, -0x98(%rbp)
movq -0x18(%rbp), %rcx
movq -0x98(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x20(%rbp), %rax
movq 0x28(%rax), %rcx
movq -0x98(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x98(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
nopw (%rax,%rax)