// File: /workspace/github_c_makefile_star2_O2/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 %r14
pushq %rbx
subq $0x138, %rsp            # imm = 0x138
leaq 0x8(%rdi), %rax
movl (%rsi), %esi
movl $0xffffffff, %r9d       # imm = 0xFFFFFFFF
movabsq $-0x100000000, %rdx     # imm = 0xFFFFFFFF00000000
xorl %ecx, %ecx
movabsq $0x100000000, %r8       # imm = 0x100000000
testl %r9d, %r9d
je 0x14f6
setg %r9b
setg -0x80(%rsp,%rcx)
movq %rax, -0x50(%rsp,%rcx,8)
movzbl %r9b, %r9d
movq (%rax,%r9,8), %rax
testq %rax, %rax
je 0x1578
incq %rcx
xorl %r9d, %r9d
cmpl 0x10(%rax), %esi
seta %r9b
sbbl $0x0, %r9d
addq %r8, %rdx
jmp 0x14bc
movq 0x8(%rax), %rsi
testq %rsi, %rsi
je 0x157c
movq (%rsi), %r10
testq %r10, %r10
je 0x159f
leaq 0x1(%rcx), %r8
movq %rsi, %r9
movq %r10, %rsi
movb $0x0, -0x80(%rsp,%r8)
movq %r9, -0x50(%rsp,%r8,8)
incq %r8
movq (%r10), %r10
testq %r10, %r10
jne 0x150f
movl %ecx, %ecx
movb $0x1, -0x80(%rsp,%rcx)
movq %rsi, -0x50(%rsp,%rcx,8)
movq %rdx, %rcx
sarq $0x20, %rcx
sarq $0x1d, %rdx
movq -0x50(%rsp,%rdx), %rdx
movzbl -0x80(%rsp,%rcx), %ecx
movq %rsi, (%rdx,%rcx,8)
movq (%rax), %rcx
movq %rcx, (%rsi)
movq 0x8(%rsi), %rcx
movq %rcx, (%r9)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsi)
movb 0x18(%rsi), %r9b
movb 0x18(%rax), %cl
movb %cl, 0x18(%rsi)
movb %r9b, 0x18(%rax)
movl %r8d, %ecx
jmp 0x15dd
xorl %eax, %eax
jmp 0x15e6
movq (%rax), %rsi
movq %rdx, %r8
sarq $0x20, %r8
sarq $0x1d, %rdx
movq -0x50(%rsp,%rdx), %rdx
movzbl -0x80(%rsp,%r8), %r8d
movq %rsi, (%rdx,%r8,8)
movb 0x18(%rax), %r9b
jmp 0x15dd
movq (%rax), %r8
movq %r8, (%rsi)
movb 0x18(%rsi), %r9b
movb 0x18(%rax), %r8b
movb %r8b, 0x18(%rsi)
movb %r9b, 0x18(%rax)
movq %rdx, %r8
sarq $0x20, %r8
sarq $0x1d, %rdx
movq -0x50(%rsp,%rdx), %rdx
movzbl -0x80(%rsp,%r8), %r8d
movq %rsi, (%rdx,%r8,8)
movl %ecx, %edx
movb $0x1, -0x80(%rsp,%rdx)
incl %ecx
movq %rsi, -0x50(%rsp,%rdx,8)
testb %r9b, %r9b
je 0x15f1
incq 0x10(%rdi)
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r14
retq
xorl %esi, %esi
movb $0x1, %r8b
movslq %ecx, %r10
movq -0x58(%rsp,%r10,8), %r9
movzbl -0x81(%rsp,%r10), %edx
movq (%r9,%rdx,8), %r11
testq %r11, %r11
je 0x161b
cmpb $0x1, 0x18(%r11)
je 0x16fa
cmpl $0x2, %ecx
jl 0x15e2
movl %ecx, %r11d
testb %dl, %dl
je 0x168d
movq (%r9), %rdx
cmpb $0x1, 0x18(%rdx)
jne 0x1668
movb $0x0, 0x18(%rdx)
movb %r8b, 0x18(%r9)
movq 0x8(%rdx), %rbx
movq %rbx, (%r9)
movq %r9, 0x8(%rdx)
leal -0x2(%rcx), %ebx
movq -0x50(%rsp,%rbx,8), %r14
movzbl -0x80(%rsp,%rbx), %ebx
movq %rdx, (%r14,%rbx,8)
movq %r9, -0x50(%rsp,%r11,8)
movb %r8b, -0x80(%rsp,%r11)
movq %rdx, -0x58(%rsp,%r10,8)
incl %ecx
movq (%r9), %rdx
movq (%rdx), %r9
testq %r9, %r9
je 0x167b
cmpb $0x0, 0x18(%r9)
jne 0x1714
movq 0x8(%rdx), %r10
testq %r10, %r10
je 0x16ef
cmpb $0x0, 0x18(%r10)
je 0x16ef
jmp 0x1704
movq 0x8(%r9), %rdx
cmpb $0x1, 0x18(%rdx)
jne 0x16d0
movb %sil, 0x18(%rdx)
movb $0x1, 0x18(%r9)
movq (%rdx), %rbx
movq %rbx, 0x8(%r9)
movq %r9, (%rdx)
leal -0x2(%rcx), %ebx
movq -0x50(%rsp,%rbx,8), %r14
movzbl -0x80(%rsp,%rbx), %ebx
movq %rdx, (%r14,%rbx,8)
movq %r9, -0x50(%rsp,%r11,8)
movb %sil, -0x80(%rsp,%r11)
movq %rdx, -0x58(%rsp,%r10,8)
incl %ecx
movq 0x8(%r9), %rdx
movq (%rdx), %r9
testq %r9, %r9
je 0x16df
cmpb $0x0, 0x18(%r9)
jne 0x171c
movq 0x8(%rdx), %r10
testq %r10, %r10
je 0x16ef
cmpb $0x0, 0x18(%r10)
jne 0x1725
movb $0x1, 0x18(%rdx)
decl %ecx
jmp 0x15f6
movb $0x0, 0x18(%r11)
jmp 0x15e2
testq %r9, %r9
je 0x1796
cmpb $0x0, 0x18(%r9)
je 0x1792
leal -0x1(%rcx), %esi
jmp 0x17ba
movq 0x8(%rdx), %r10
testq %r10, %r10
je 0x1737
cmpb $0x0, 0x18(%r10)
je 0x1737
leal -0x1(%rcx), %esi
movq %r9, %r8
movq %rdx, %r9
jmp 0x175e
movb $0x0, 0x18(%r9)
movb $0x1, 0x18(%rdx)
movq 0x8(%r9), %rsi
movq %rsi, (%rdx)
movq %rdx, 0x8(%r9)
leal -0x1(%rcx), %esi
movq -0x50(%rsp,%rsi,8), %rdx
movq %r9, 0x8(%rdx)
movq (%r9), %r8
movq 0x8(%r9), %r10
movq -0x50(%rsp,%rsi,8), %rdx
movb 0x18(%rdx), %sil
movb %sil, 0x18(%r9)
xorl %esi, %esi
movb %sil, 0x18(%rdx)
movb %sil, 0x18(%r10)
movq %r8, 0x8(%rdx)
movq %rdx, (%r9)
addl $-0x2, %ecx
movq -0x50(%rsp,%rcx,8), %rdx
movzbl -0x80(%rsp,%rcx), %ecx
movq %r9, (%rdx,%rcx,8)
jmp 0x15e2
movq 0x8(%rdx), %r10
movb $0x0, 0x18(%r10)
movb $0x1, 0x18(%rdx)
movq (%r10), %rsi
movq %rsi, 0x8(%rdx)
movq %rdx, (%r10)
leal -0x1(%rcx), %esi
movq -0x50(%rsp,%rsi,8), %rdx
movq %r10, (%rdx)
movq (%r10), %r9
movq %r10, %rdx
movq -0x50(%rsp,%rsi,8), %rsi
movb 0x18(%rsi), %r8b
movb %r8b, 0x18(%rdx)
xorl %r8d, %r8d
movb %r8b, 0x18(%rsi)
movb %r8b, 0x18(%r9)
movq 0x8(%rdx), %r8
movq %r8, (%rsi)
movq %rsi, 0x8(%rdx)
addl $-0x2, %ecx
movq -0x50(%rsp,%rcx,8), %rsi
movzbl -0x80(%rsp,%rcx), %ecx
movq %rdx, (%rsi,%rcx,8)
jmp 0x15e2
nop