// 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>::insert(unsigned int const&, int*)
inline node_t *insert(const key_t &item, int *is_present) {
		node_t *pa[RB_MAX_HEIGHT], *p, *n;
		unsigned char da[RB_MAX_HEIGHT];
		int k, dir;
		pa[0] = (node_t*)&root;
		da[0] = 0;
		k = 1; *is_present = 0;
		for (p = root; p; p = p->rb_link[dir]) {
			int cmp = __cmp(item, p->key);
			if (cmp == 0) {
				*is_present = 1;
				return p;
			}
			pa[k] = p;
			da[k++] = dir = cmp > 0;
		}
		n = pa[k - 1]->rb_link[da[k - 1]] = (node_t*)malloc(sizeof(node_t));
		n->key = item;
		n->rb_link[0] = n->rb_link[1] = 0;
		n->color = RB_RED;
		++generation;
		while (k >= 3 && pa[k - 1]->color == RB_RED) {
			if (da[k - 2] == 0) {
				node_t *y = pa[k - 2]->rb_link[1];
				if (y && y->color == RB_RED) {
					pa[k - 1]->color = y->color = RB_BLACK;
					pa[k - 2]->color = RB_RED;
					k -= 2;
				} else {
					node_t *x;
					if (da[k - 1] == 0) y = pa[k - 1];
					else {
						x = pa[k - 1];
						y = x->rb_link[1];
						x->rb_link[1] = y->rb_link[0];
						y->rb_link[0] = x;
						pa[k - 2]->rb_link[0] = y;
					}
					x = pa[k - 2];
					x->color = RB_RED;
					y->color = RB_BLACK;
					x->rb_link[0] = y->rb_link[1];
					y->rb_link[1] = x;
					pa[k - 3]->rb_link[da[k - 3]] = y;
					break;
				}
			} else {
				node_t *y = pa[k - 2]->rb_link[0];
				if (y && y->color == RB_RED) {
					pa[k - 1]->color = y->color = RB_BLACK;
					pa[k - 2]->color = RB_RED;
					k -= 2;
				} else {
					node_t *x;
					if (da[k - 1] == 1) y = pa[k - 1];
					else {
						x = pa[k - 1];
						y = x->rb_link[0];
						x->rb_link[0] = y->rb_link[1];
						y->rb_link[1] = x;
						pa[k - 2]->rb_link[1] = y;
					}
					x = pa[k - 2];
					x->color = RB_RED;
					y->color = RB_BLACK;
					x->rb_link[1] = y->rb_link[0];
					y->rb_link[0] = x;
					pa[k - 3]->rb_link[da[k - 3]] = y;
					break;
				}
			}
		}
		root->color = RB_BLACK;
		return n;
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1b8, %rsp            # imm = 0x1B8
movq %rdi, %rbx
movl $0xfffffffe, %r15d      # imm = 0xFFFFFFFE
leaq 0x8(%rdi), %r14
movq %r14, 0x30(%rsp)
movb $0x0, (%rsp)
andl $0x0, (%rdx)
movl (%rsi), %ebp
xorl %r13d, %r13d
xorl %r12d, %r12d
movq %r14, %rax
movq (%rax), %rax
testq %rax, %rax
je 0x136b
xorl %ecx, %ecx
cmpl 0x10(%rax), %ebp
seta %cl
sbbl $0x0, %ecx
je 0x13fd
movq %rax, 0x38(%rsp,%r12,8)
xorl %esi, %esi
testl %ecx, %ecx
setg 0x1(%rsp,%r12)
setg %sil
leaq (%rax,%rsi,8), %rax
incq %r12
addq %r15, %r13
addq $0x2, %r13
jmp 0x132f
pushq $0x20
popq %rdi
callq 0x1060
movq %r13, %rcx
sarq $0x20, %rcx
sarq $0x1d, %r13
movq 0x30(%rsp,%r13), %rdx
movzbl (%rsp,%rcx), %ecx
movq %rax, (%rdx,%rcx,8)
movl %ebp, 0x10(%rax)
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movb $0x1, 0x18(%rax)
incq 0x10(%rbx)
xorl %esi, %esi
leaq 0x1(%r12), %rcx
cmpq $0x3, %rcx
jl 0x1477
movq 0x30(%rsp,%r12,8), %rcx
cmpb $0x1, 0x18(%rcx)
jne 0x1477
cmpb $0x0, -0x1(%rsp,%r12)
movq 0x28(%rsp,%r12,8), %rdx
je 0x13d9
movq (%rdx), %rdi
testq %rdi, %rdi
je 0x1405
cmpb $0x1, 0x18(%rdi)
je 0x13e8
jmp 0x1405
movq 0x8(%rdx), %rdi
testq %rdi, %rdi
je 0x1435
cmpb $0x1, 0x18(%rdi)
jne 0x1435
addq $0x18, %rdi
movb %sil, (%rdi)
movb %sil, 0x18(%rcx)
movb $0x1, 0x18(%rdx)
addq $-0x2, %r12
jmp 0x139e
movl $0x1, (%rdx)
jmp 0x147e
cmpb $0x1, (%rsp,%r12)
je 0x1421
movq (%rcx), %rsi
movq 0x8(%rsi), %rdi
movq %rdi, (%rcx)
movq %rcx, 0x8(%rsi)
movq %rsi, 0x8(%rdx)
movq %rsi, %rcx
movb $0x1, 0x18(%rdx)
movb $0x0, 0x18(%rcx)
movq (%rcx), %rsi
movq %rsi, 0x8(%rdx)
movq %rcx, %rsi
jmp 0x1463
cmpb $0x0, (%rsp,%r12)
je 0x1450
movq 0x8(%rcx), %rsi
movq (%rsi), %rdi
movq %rdi, 0x8(%rcx)
movq %rcx, (%rsi)
movq %rsi, (%rdx)
movq %rsi, %rcx
movb $0x1, 0x18(%rdx)
movb $0x0, 0x18(%rcx)
leaq 0x8(%rcx), %rsi
movq 0x8(%rcx), %rdi
movq %rdi, (%rdx)
movq %rdx, (%rsi)
addl %r15d, %r12d
movq 0x30(%rsp,%r12,8), %rdx
movzbl (%rsp,%r12), %esi
movq %rcx, (%rdx,%rsi,8)
movq (%r14), %rcx
movb $0x0, 0x18(%rcx)
addq $0x1b8, %rsp            # imm = 0x1B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq