// File: /workspace/github_c_makefile_star2_O1/attractivechaos[P]rb-eval/./rb.hpp
// Function: rbtree_t<unsigned int, rbnode_map_t<unsigned int, int>, int_cmp>::erase(unsigned int const&)
inline node_t *erase(const key_t &item) {
		node_t *pa[RB_MAX_HEIGHT], *p;
		unsigned char da[RB_MAX_HEIGHT];
		int k, cmp;
		k = 0;
		p = (node_t*)&root;
		for (cmp = -1; cmp != 0; cmp = __cmp(item, p->key)) {
			int dir = cmp > 0;
			pa[k] = p;
			da[k++] = dir;
			p = p->rb_link[dir];
			if (p == 0) return 0;
		}
		if (p->rb_link[1] == 0) pa[k - 1]->rb_link[da[k - 1]] = p->rb_link[0];
		else {
			int t;
			node_t *r = p->rb_link[1];
			if (r->rb_link[0] == 0) {
				r->rb_link[0] = p->rb_link[0];
				t = r->color;
				r->color = p->color;
				p->color = t;
				pa[k - 1]->rb_link[da[k - 1]] = r;
				da[k] = 1;
				pa[k++] = r;
			} else {
				node_t *s;
				int j = k++;
				for (;;) {
					da[k] = 0;
					pa[k++] = r;
					s = r->rb_link[0];
					if (s->rb_link[0] == 0) break;
					r = s;
				}
				da[j] = 1;
				pa[j] = s;
				pa[j - 1]->rb_link[da[j - 1]] = s;
				s->rb_link[0] = p->rb_link[0];
				r->rb_link[0] = s->rb_link[1];
				s->rb_link[1] = p->rb_link[1];
				t = s->color;
				s->color = p->color;
				p->color = t;
			}
		}
		if (p->color == RB_BLACK) {
			for (;;) {
				node_t *x = pa[k - 1]->rb_link[da[k - 1]];
				if (x && x->color == RB_RED) {
					x->color = RB_BLACK;
					break;
				}
				if (k < 2) break;
				if (da[k - 1] == 0) {
					node_t *w = pa[k - 1]->rb_link[1];
					if (w->color == RB_RED) {
						w->color = RB_BLACK;
						pa[k - 1]->color = RB_RED;
						pa[k - 1]->rb_link[1] = w->rb_link[0];
						w->rb_link[0] = pa[k - 1];
						pa[k - 2]->rb_link[da[k - 2]] = w;
						pa[k] = pa[k - 1];
						da[k] = 0;
						pa[k - 1] = w;
						++k;
						w = pa[k - 1]->rb_link[1];
					}
					if ((w->rb_link[0] == 0 || w->rb_link[0]->color == RB_BLACK)
						&& (w->rb_link[1] == 0 || w->rb_link[1]->color == RB_BLACK))
					{
						w->color = RB_RED;
					} else {
						if (w->rb_link[1] == 0 || w->rb_link[1]->color == RB_BLACK) {
							node_t *y = w->rb_link[0];
							y->color = RB_BLACK;
							w->color = RB_RED;
							w->rb_link[0] = y->rb_link[1];
							y->rb_link[1] = w;
							w = pa[k - 1]->rb_link[1] = y;
						}
						w->color = pa[k - 1]->color;
						pa[k - 1]->color = RB_BLACK;
						w->rb_link[1]->color = RB_BLACK;
						pa[k - 1]->rb_link[1] = w->rb_link[0];
						w->rb_link[0] = pa[k - 1];
						pa[k - 2]->rb_link[da[k - 2]] = w;
						break;
					}
				} else {
					node_t *w = pa[k - 1]->rb_link[0];
					if (w->color == RB_RED) {
						w->color = RB_BLACK;
						pa[k - 1]->color = RB_RED;
						pa[k - 1]->rb_link[0] = w->rb_link[1];
						w->rb_link[1] = pa[k - 1];
						pa[k - 2]->rb_link[da[k - 2]] = w;
						pa[k] = pa[k - 1];
						da[k] = 1;
						pa[k - 1] = w;
						k++;
						w = pa[k - 1]->rb_link[0];
					}
					if ((w->rb_link[0] == 0 || w->rb_link[0]->color == RB_BLACK)
						&& (w->rb_link[1] == 0 || w->rb_link[1]->color == RB_BLACK))
					{
						w->color = RB_RED;
					} else {
						if (w->rb_link[0] == 0 || w->rb_link[0]->color == RB_BLACK) {
							node_t *y = w->rb_link[1];
							y->color = RB_BLACK;
							w->color = RB_RED;
							w->rb_link[1] = y->rb_link[0];
							y->rb_link[0] = w;
							w = pa[k - 1]->rb_link[0] = y;
						}
						w->color = pa[k - 1]->color;
						pa[k - 1]->color = RB_BLACK;
						w->rb_link[0]->color = RB_BLACK;
						pa[k - 1]->rb_link[0] = w->rb_link[1];
						w->rb_link[1] = pa[k - 1];
						pa[k - 2]->rb_link[da[k - 2]] = w;
						break;
					}
				}
				--k;
			}
		}
		//::free(p);
		++generation;
		return p;
	}

// Assembly:
pushq %rbx
subq $0x130, %rsp            # imm = 0x130
leaq 0x8(%rdi), %rax
movl (%rsi), %edx
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %ecx, %ecx
xorl %r8d, %r8d
testl %esi, %esi
setg -0x80(%rsp,%rcx)
setg %r8b
movq %rax, -0x50(%rsp,%rcx,8)
movq (%rax,%r8,8), %rax
testq %rax, %rax
je 0x156f
incq %rcx
xorl %esi, %esi
cmpl 0x10(%rax), %edx
seta %sil
sbbl $0x0, %esi
jne 0x14c9
movq 0x8(%rax), %rdx
leaq -0x1(%rcx), %rsi
testq %rdx, %rdx
je 0x1573
cmpq $0x0, (%rdx)
je 0x1588
leaq 0x1(%rcx), %r8
movq %rdx, %r9
movb $0x0, -0x80(%rsp,%r8)
movq %rdx, -0x50(%rsp,%r8,8)
incq %r8
movq (%rdx), %rdx
cmpq $0x0, (%rdx)
jne 0x1511
movl %ecx, %ecx
movb $0x1, -0x80(%rsp,%rcx)
movq %rdx, -0x50(%rsp,%rcx,8)
movl %esi, %ecx
movq -0x50(%rsp,%rcx,8), %rsi
movzbl -0x80(%rsp,%rcx), %ecx
movq %rdx, (%rsi,%rcx,8)
movq (%rax), %rcx
movq %rcx, (%rdx)
movq 0x8(%rdx), %rcx
movq %rcx, (%r9)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rdx)
movb 0x18(%rdx), %cl
movb 0x18(%rax), %sil
movb %sil, 0x18(%rdx)
movb %cl, 0x18(%rax)
movl %r8d, %ecx
jmp 0x15bc
xorl %eax, %eax
jmp 0x15c6
movq (%rax), %rdx
movl %esi, %esi
movq -0x50(%rsp,%rsi,8), %r8
movzbl -0x80(%rsp,%rsi), %esi
movq %rdx, (%r8,%rsi,8)
jmp 0x15bc
movq (%rax), %r8
movq %r8, (%rdx)
movb 0x18(%rdx), %r8b
movb 0x18(%rax), %r9b
movb %r9b, 0x18(%rdx)
movb %r8b, 0x18(%rax)
movl %esi, %esi
movq -0x50(%rsp,%rsi,8), %r8
movzbl -0x80(%rsp,%rsi), %esi
movq %rdx, (%r8,%rsi,8)
movl %ecx, %esi
movb $0x1, -0x80(%rsp,%rsi)
incl %ecx
movq %rdx, -0x50(%rsp,%rsi,8)
cmpb $0x0, 0x18(%rax)
je 0x15cf
incq 0x10(%rdi)
addq $0x130, %rsp            # imm = 0x130
popq %rbx
retq
xorl %edx, %edx
movb $0x1, %sil
movslq %ecx, %r10
movq -0x58(%rsp,%r10,8), %r9
movzbl -0x81(%rsp,%r10), %r11d
movq (%r9,%r11,8), %r8
testq %r8, %r8
je 0x1605
cmpb $0x1, 0x18(%r8)
jne 0x1605
movb $0x0, 0x18(%r8)
movl $0x7, %r8d
jmp 0x17a1
movl $0x7, %r8d
cmpl $0x2, %ecx
jl 0x17a1
testb %r11b, %r11b
je 0x1707
movq (%r9), %r8
cmpb $0x1, 0x18(%r8)
jne 0x1665
movb $0x0, 0x18(%r8)
movb %sil, 0x18(%r9)
movq 0x8(%r8), %r11
movq %r11, (%r9)
movq %r9, 0x8(%r8)
leal -0x2(%rcx), %r11d
movq -0x50(%rsp,%r11,8), %rbx
movzbl -0x80(%rsp,%r11), %r11d
movq %r8, (%rbx,%r11,8)
movl %ecx, %r11d
movq %r9, -0x50(%rsp,%r11,8)
movb %sil, -0x80(%rsp,%r11)
movq %r8, -0x58(%rsp,%r10,8)
incl %ecx
movq (%r9), %r8
movq (%r8), %r9
testq %r9, %r9
je 0x1674
cmpb $0x0, 0x18(%r9)
jne 0x168c
movq 0x8(%r8), %r10
testq %r10, %r10
je 0x178c
cmpb $0x0, 0x18(%r10)
je 0x178c
testq %r9, %r9
je 0x1698
cmpb $0x0, 0x18(%r9)
jne 0x16bf
movq 0x8(%r8), %r9
movb $0x0, 0x18(%r9)
movb $0x1, 0x18(%r8)
movq (%r9), %r10
movq %r10, 0x8(%r8)
movq %r8, (%r9)
leal -0x1(%rcx), %r8d
movq -0x50(%rsp,%r8,8), %r8
movq %r9, (%r8)
movq %r9, %r8
leal -0x1(%rcx), %r9d
movq -0x50(%rsp,%r9,8), %r10
movb 0x18(%r10), %r9b
movb %r9b, 0x18(%r8)
xorl %r9d, %r9d
movb %r9b, 0x18(%r10)
movq (%r8), %r11
movb %r9b, 0x18(%r11)
movq 0x8(%r8), %r11
movq %r11, (%r10)
movq %r10, 0x8(%r8)
leal -0x2(%rcx), %r10d
movq -0x50(%rsp,%r10,8), %r11
movzbl -0x80(%rsp,%r10), %r10d
movq %r8, (%r11,%r10,8)
movl $0x7, %r8d
jmp 0x1797
movq 0x8(%r9), %r8
cmpb $0x1, 0x18(%r8)
jne 0x1750
movb %dl, 0x18(%r8)
movb $0x1, 0x18(%r9)
movq (%r8), %r11
movq %r11, 0x8(%r9)
movq %r9, (%r8)
leal -0x2(%rcx), %r11d
movq -0x50(%rsp,%r11,8), %rbx
movzbl -0x80(%rsp,%r11), %r11d
movq %r8, (%rbx,%r11,8)
movl %ecx, %r11d
movq %r9, -0x50(%rsp,%r11,8)
movb %dl, -0x80(%rsp,%r11)
movq %r8, -0x58(%rsp,%r10,8)
incl %ecx
movq 0x8(%r9), %r8
movq (%r8), %r9
testq %r9, %r9
je 0x175f
cmpb $0x0, 0x18(%r9)
jne 0x1777
movq 0x8(%r8), %r10
testq %r10, %r10
je 0x1816
cmpb $0x0, 0x18(%r10)
je 0x1816
movq 0x8(%r8), %r10
testq %r10, %r10
je 0x17af
cmpb $0x0, 0x18(%r10)
je 0x17af
movq %r8, %r9
jmp 0x17d1
movb $0x1, 0x18(%r8)
xorl %r8d, %r8d
movb $0x1, %r9b
testb %r9b, %r9b
je 0x17a1
decl %ecx
xorl %r8d, %r8d
testl %r8d, %r8d
je 0x15d4
jmp 0x15c2
movb $0x0, 0x18(%r9)
movb $0x1, 0x18(%r8)
movq 0x8(%r9), %r10
movq %r10, (%r8)
movq %r8, 0x8(%r9)
leal -0x1(%rcx), %r8d
movq -0x50(%rsp,%r8,8), %r8
movq %r9, 0x8(%r8)
leal -0x1(%rcx), %r8d
movq -0x50(%rsp,%r8,8), %r8
movb 0x18(%r8), %r10b
movb %r10b, 0x18(%r9)
xorl %r10d, %r10d
movb %r10b, 0x18(%r8)
movq 0x8(%r9), %r11
movb %r10b, 0x18(%r11)
movq (%r9), %r11
movq %r11, 0x8(%r8)
movq %r8, (%r9)
leal -0x2(%rcx), %r8d
movq -0x50(%rsp,%r8,8), %r11
movzbl -0x80(%rsp,%r8), %r8d
movq %r9, (%r11,%r8,8)
movl $0x7, %r8d
jmp 0x1821
movb $0x1, 0x18(%r8)
xorl %r8d, %r8d
movb $0x1, %r10b
testb %r10b, %r10b
jne 0x179c
jmp 0x17a1
nop