// File: /workspace/github_c_makefile_star2_O3/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 0x15a5
incq %rcx
xorl %esi, %esi
cmpl 0x10(%rax), %edx
seta %sil
sbbl $0x0, %esi
jne 0x14a5
movq 0x8(%rax), %rdx
leaq -0x1(%rcx), %rsi
testq %rdx, %rdx
je 0x154f
movq (%rdx), %r10
testq %r10, %r10
je 0x1568
leaq 0x1(%rcx), %r8
movq %rdx, %r9
movq %r10, %rdx
movb $0x0, -0x80(%rsp,%r8)
movq %r9, -0x50(%rsp,%r8,8)
incq %r8
movq (%r10), %r10
testq %r10, %r10
jne 0x14ef
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), %r9b
movb 0x18(%rax), %cl
movb %cl, 0x18(%rdx)
movb %r9b, 0x18(%rax)
movl %r8d, %ecx
jmp 0x159c
movq (%rax), %rdx
movl %esi, %esi
movq -0x50(%rsp,%rsi,8), %r8
movzbl -0x80(%rsp,%rsi), %esi
movq %rdx, (%r8,%rsi,8)
movb 0x18(%rax), %r9b
jmp 0x159c
movq (%rax), %r8
movq %r8, (%rdx)
movb 0x18(%rdx), %r9b
movb 0x18(%rax), %r8b
movb %r8b, 0x18(%rdx)
movb %r9b, 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)
testb %r9b, %r9b
je 0x15ae
incq 0x10(%rdi)
addq $0x130, %rsp            # imm = 0x130
popq %rbx
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 0x15d8
cmpb $0x1, 0x18(%r11)
je 0x16be
cmpl $0x2, %ecx
jl 0x15a1
testb %dl, %dl
je 0x164c
movq (%r9), %rdx
cmpb $0x1, 0x18(%rdx)
jne 0x1627
movb $0x0, 0x18(%rdx)
movb %r8b, 0x18(%r9)
movq 0x8(%rdx), %r11
movq %r11, (%r9)
movq %r9, 0x8(%rdx)
leal -0x2(%rcx), %r11d
movq -0x50(%rsp,%r11,8), %rbx
movzbl -0x80(%rsp,%r11), %r11d
movq %rdx, (%rbx,%r11,8)
movl %ecx, %r11d
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 0x163a
cmpb $0x0, 0x18(%r9)
jne 0x16d8
movq 0x8(%rdx), %r10
testq %r10, %r10
je 0x16b3
cmpb $0x0, 0x18(%r10)
je 0x16b3
jmp 0x16c8
movq 0x8(%r9), %rdx
cmpb $0x1, 0x18(%rdx)
jne 0x1694
movb %sil, 0x18(%rdx)
movb $0x1, 0x18(%r9)
movq (%rdx), %r11
movq %r11, 0x8(%r9)
movq %r9, (%rdx)
leal -0x2(%rcx), %r11d
movq -0x50(%rsp,%r11,8), %rbx
movzbl -0x80(%rsp,%r11), %r11d
movq %rdx, (%rbx,%r11,8)
movl %ecx, %r11d
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 0x16a3
cmpb $0x0, 0x18(%r9)
jne 0x16e0
movq 0x8(%rdx), %r10
testq %r10, %r10
je 0x16b3
cmpb $0x0, 0x18(%r10)
jne 0x16e9
movb $0x1, 0x18(%rdx)
decl %ecx
jmp 0x15b3
movb $0x0, 0x18(%r11)
jmp 0x15a1
testq %r9, %r9
je 0x175a
cmpb $0x0, 0x18(%r9)
je 0x1756
leal -0x1(%rcx), %esi
jmp 0x177e
movq 0x8(%rdx), %r10
testq %r10, %r10
je 0x16fb
cmpb $0x0, 0x18(%r10)
je 0x16fb
leal -0x1(%rcx), %esi
movq %r9, %r8
movq %rdx, %r9
jmp 0x1722
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 0x15a1
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 0x15a1
nop