// 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>::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 %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x1b8, %rsp            # imm = 0x1B8
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x8(%rdi), %r15
movq %r15, 0x30(%rsp)
movb $0x0, (%rsp)
movl $0x0, (%rdx)
movq 0x8(%rdi), %rcx
movl $0x1, %r12d
testq %rcx, %rcx
je 0x138e
movl (%r14), %r8d
xorl %edi, %edi
cmpl 0x10(%rcx), %r8d
seta %dil
sbbl $0x0, %edi
je 0x1371
movslq %r12d, %r8
movq %rcx, 0x30(%rsp,%r8,8)
leal 0x1(%r8), %r12d
xorl %esi, %esi
testl %edi, %edi
setg %sil
setg (%rsp,%r8)
jmp 0x137a
movl $0x1, (%rdx)
movq %rcx, %rax
testl %edi, %edi
je 0x14a4
movslq %esi, %rdi
movq (%rcx,%rdi,8), %rcx
testq %rcx, %rcx
jne 0x1344
movl $0x20, %edi
callq 0x1060
movslq %r12d, %rcx
movq 0x28(%rsp,%rcx,8), %rdx
movzbl -0x1(%rsp,%rcx), %esi
movq %rax, (%rdx,%rsi,8)
movl (%r14), %edx
movl %edx, 0x10(%rax)
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movb $0x1, 0x18(%rax)
incq 0x10(%rbx)
cmpl $0x3, %ecx
jl 0x149d
xorl %ecx, %ecx
leal -0x1(%r12), %r8d
movq 0x30(%rsp,%r8,8), %rdx
cmpb $0x1, 0x18(%rdx)
jne 0x149d
leal -0x2(%r12), %edi
cmpb $0x0, (%rsp,%rdi)
movq 0x30(%rsp,%rdi,8), %rsi
je 0x142b
movq (%rsi), %r9
testq %r9, %r9
je 0x13fb
cmpb $0x1, 0x18(%r9)
je 0x143b
cmpb $0x1, (%rsp,%r8)
je 0x1417
movq (%rdx), %rdi
movq 0x8(%rdi), %r8
movq %r8, (%rdx)
movq %rdx, 0x8(%rdi)
movq %rdi, 0x8(%rsi)
movq %rdi, %rdx
movb $0x1, 0x18(%rsi)
movb $0x0, 0x18(%rdx)
movq (%rdx), %rdi
movq %rdi, 0x8(%rsi)
movq %rsi, (%rdx)
jmp 0x147b
movq 0x8(%rsi), %r9
testq %r9, %r9
je 0x144d
cmpb $0x1, 0x18(%r9)
jne 0x144d
movb %cl, 0x18(%r9)
movb %cl, 0x18(%rdx)
movb $0x1, 0x18(%rsi)
movb $0x1, %dl
movl %edi, %r12d
jmp 0x148f
cmpb $0x0, (%rsp,%r8)
je 0x1468
movq 0x8(%rdx), %rdi
movq (%rdi), %r8
movq %r8, 0x8(%rdx)
movq %rdx, (%rdi)
movq %rdi, (%rsi)
movq %rdi, %rdx
movb $0x1, 0x18(%rsi)
movb $0x0, 0x18(%rdx)
movq 0x8(%rdx), %rdi
movq %rdi, (%rsi)
movq %rsi, 0x8(%rdx)
leal -0x3(%r12), %esi
movq 0x30(%rsp,%rsi,8), %rdi
movzbl (%rsp,%rsi), %esi
movq %rdx, (%rdi,%rsi,8)
xorl %edx, %edx
testb %dl, %dl
je 0x149d
cmpl $0x2, %r12d
jg 0x13c8
movq (%r15), %rcx
movb $0x0, 0x18(%rcx)
addq $0x1b8, %rsp            # imm = 0x1B8
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop