// File: /workspace/github_c_makefile_star2_O3/GangZhuo[P]rbtree/rbtree.c
// Function: rbtree_insert
int rbtree_insert(rbtree_t *tree, rbnode_t *n)
{

	if (btree_insert(tree, n) != 0)
		return -1;

	n->color = rbnode_red;

	rbtree_insert_fixup(tree, n);

	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rsi)
movq (%rdi), %rax
testq %rax, %rax
je 0x11c3
movq %rax, %r15
movq (%r14), %rdi
movq (%rax), %rsi
callq *0x8(%rbx)
testl %eax, %eax
js 0x11b3
je 0x11db
movq 0x18(%r15), %rax
testq %rax, %rax
jne 0x1196
jmp 0x11f0
movq 0x10(%r15), %rax
testq %rax, %rax
jne 0x1196
movl $0x10, %eax
jmp 0x11f5
movq $0x0, 0x20(%r14)
movq %r14, (%rbx)
movl $0x1, 0x8(%r14)
jmp 0x13c6
callq 0x1040
movl $0x11, (%rax)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x13d2
movl $0x18, %eax
movq %r15, 0x20(%r14)
movq %r14, (%r15,%rax)
movl $0x1, 0x8(%r14)
xorl %eax, %eax
cmpl $0x1, 0x8(%r15)
jne 0x13c6
movq 0x20(%r15), %rcx
movq 0x10(%rcx), %rdx
cmpq %r15, %rdx
je 0x1247
testq %rdx, %rdx
je 0x1233
cmpl $0x1, 0x8(%rdx)
jne 0x1233
movl %eax, 0x8(%r15)
movl %eax, 0x8(%rdx)
jmp 0x125d
movq 0x10(%r15), %rdx
cmpq %r14, %rdx
je 0x1280
movq %r15, %rdx
movq %r14, %r15
jmp 0x12f5
movq 0x18(%rcx), %rsi
testq %rsi, %rsi
je 0x126c
cmpl $0x1, 0x8(%rsi)
jne 0x126c
movl %eax, 0x8(%r15)
movl %eax, 0x8(%rsi)
movl $0x1, 0x8(%rcx)
movq %rcx, %r15
jmp 0x13b6
movq 0x18(%r15), %rsi
cmpq %r14, %rsi
je 0x12a3
movq %r15, %rsi
movq %r14, %r15
jmp 0x136c
movq 0x18(%rdx), %rsi
movq %rsi, 0x10(%r15)
testq %rsi, %rsi
je 0x12d2
movq %r15, 0x20(%rsi)
movq 0x20(%r15), %rcx
movq %rcx, 0x20(%rdx)
movq %rbx, %rsi
testq %rcx, %rcx
jne 0x12d6
jmp 0x12e6
movq 0x10(%rsi), %rdx
movq %rdx, 0x18(%r15)
testq %rdx, %rdx
je 0x1341
movq %r15, 0x20(%rdx)
movq 0x20(%r15), %rcx
movq %rcx, 0x20(%rsi)
movq %rbx, %rdx
testq %rcx, %rcx
je 0x1359
movq 0x10(%rcx), %rdx
jmp 0x1348
movq %rcx, 0x20(%rdx)
leaq 0x10(%rcx), %rdi
leaq 0x18(%rcx), %rsi
cmpq %r15, 0x10(%rcx)
cmoveq %rdi, %rsi
movq %rdx, (%rsi)
movq %r15, 0x18(%rdx)
movq %rdx, 0x20(%r15)
movq 0x20(%rdx), %rcx
movl $0x0, 0x8(%rdx)
movl $0x1, 0x8(%rcx)
movq 0x18(%rcx), %rdx
movq 0x10(%rdx), %rsi
movq %rsi, 0x18(%rcx)
testq %rsi, %rsi
je 0x1318
movq %rcx, 0x20(%rsi)
movq 0x20(%rcx), %rdi
movq %rdi, 0x20(%rdx)
movq %rbx, %rsi
testq %rdi, %rdi
je 0x1338
leaq 0x10(%rdi), %r8
leaq 0x18(%rdi), %rsi
cmpq %rcx, 0x10(%rdi)
cmoveq %r8, %rsi
movq %rdx, (%rsi)
movq %rcx, 0x10(%rdx)
jmp 0x13b2
movq %rcx, 0x20(%rsi)
movq %r15, %rdx
xorl %edi, %edi
cmpq %r15, %rdx
setne %dil
leaq (%rcx,%rdi,8), %rdx
addq $0x10, %rdx
movq %rsi, (%rdx)
movq %r15, 0x10(%rsi)
movq %rsi, 0x20(%r15)
movq 0x20(%rsi), %rcx
movq 0x10(%rcx), %rdx
movl $0x0, 0x8(%rsi)
movl $0x1, 0x8(%rcx)
movq 0x18(%rdx), %rsi
movq %rsi, 0x10(%rcx)
testq %rsi, %rsi
je 0x138b
movq %rcx, 0x20(%rsi)
movq 0x20(%rcx), %rdi
movq %rdi, 0x20(%rdx)
movq %rbx, %rsi
testq %rdi, %rdi
je 0x13ab
leaq 0x10(%rdi), %r8
leaq 0x18(%rdi), %rsi
cmpq %rcx, 0x10(%rdi)
cmoveq %r8, %rsi
movq %rdx, (%rsi)
movq %rcx, 0x18(%rdx)
movq %rdx, 0x20(%rcx)
movq %r15, %r14
movq 0x20(%r15), %r15
testq %r15, %r15
jne 0x1207
movq (%rbx), %rax
movl $0x0, 0x8(%rax)
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq