// File: /workspace/github_c_makefile_star2_O1/attractivechaos[P]rb-eval/rb.c
// Function: rb_probe
void **
rb_probe (struct rb_table *tree, void *item)
{
  struct rb_node *pa[RB_MAX_HEIGHT]; /* Nodes on stack. */
  unsigned char da[RB_MAX_HEIGHT];   /* Directions moved from stack nodes. */
  int k;                             /* Stack height. */

  struct rb_node *p; /* Traverses tree looking for insertion point. */
  struct rb_node *n; /* Newly inserted node. */

  assert (tree != NULL && item != NULL);

  pa[0] = (struct rb_node *) &tree->rb_root;
  da[0] = 0;
  k = 1;
  for (p = tree->rb_root; p != NULL; p = p->rb_link[da[k - 1]])
    {
      int cmp = tree->rb_compare (item, p->rb_data, tree->rb_param);
      if (cmp == 0)
        return &p->rb_data;

      pa[k] = p;
      da[k++] = cmp > 0;
    }

  n = pa[k - 1]->rb_link[da[k - 1]] =
    tree->rb_alloc->libavl_malloc (tree->rb_alloc, sizeof *n);
  if (n == NULL)
    return NULL;

  n->rb_data = item;
  n->rb_link[0] = n->rb_link[1] = NULL;
  n->rb_color = RB_RED;
  tree->rb_count++;
  tree->rb_generation++;

  while (k >= 3 && pa[k - 1]->rb_color == RB_RED)
    {
      if (da[k - 2] == 0)
        {
          struct rb_node *y = pa[k - 2]->rb_link[1];
          if (y != NULL && y->rb_color == RB_RED)
            {
              pa[k - 1]->rb_color = y->rb_color = RB_BLACK;
              pa[k - 2]->rb_color = RB_RED;
              k -= 2;
            }
          else
            {
              struct rb_node *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->rb_color = RB_RED;
              y->rb_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
        {
          struct rb_node *y = pa[k - 2]->rb_link[0];
          if (y != NULL && y->rb_color == RB_RED)
            {
              pa[k - 1]->rb_color = y->rb_color = RB_BLACK;
              pa[k - 2]->rb_color = RB_RED;
              k -= 2;
            }
          else
            {
              struct rb_node *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->rb_color = RB_RED;
              y->rb_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;
            }
        }
    }
  tree->rb_root->rb_color = RB_BLACK;


  return &n->rb_data;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1b8, %rsp            # imm = 0x1B8
testq %rdi, %rdi
je 0x1488
movq %rsi, %r15
testq %rsi, %rsi
je 0x1488
movq %rdi, %rbx
movq %rdi, 0x30(%rsp)
movb $0x0, (%rsp)
movq (%rdi), %r13
movl $0x1, %r12d
testq %r13, %r13
je 0x1344
movq %rsp, %rbp
movq 0x10(%r13), %rsi
movq 0x10(%rbx), %rdx
movq %r15, %rdi
callq *0x8(%rbx)
testl %eax, %eax
je 0x1326
movslq %r12d, %rcx
movq %r13, 0x30(%rsp,%rcx,8)
leal 0x1(%rcx), %r12d
testl %eax, %eax
setg (%rsp,%rcx)
jmp 0x132a
leaq 0x10(%r13), %r14
testl %eax, %eax
je 0x1473
movslq %r12d, %rax
movzbl -0x1(%rax,%rbp), %eax
movq (%r13,%rax,8), %r13
testq %r13, %r13
jne 0x1300
movq 0x18(%rbx), %rdi
movl $0x20, %esi
callq *(%rdi)
movq %rax, %r14
movslq %r12d, %rax
movq 0x28(%rsp,%rax,8), %rcx
movzbl -0x1(%rsp,%rax), %eax
movq %r14, (%rcx,%rax,8)
testq %r14, %r14
je 0x1470
movq %r15, 0x10(%r14)
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
movb $0x1, 0x18(%r14)
incq 0x20(%rbx)
incq 0x28(%rbx)
cmpl $0x3, %r12d
jl 0x1463
xorl %eax, %eax
leal -0x1(%r12), %edi
movq 0x30(%rsp,%rdi,8), %rcx
cmpb $0x1, 0x18(%rcx)
jne 0x1463
leal -0x2(%r12), %esi
cmpb $0x0, (%rsp,%rsi)
movq 0x30(%rsp,%rsi,8), %rdx
je 0x13f2
movq (%rdx), %r8
testq %r8, %r8
je 0x13c3
cmpb $0x1, 0x18(%r8)
je 0x1402
cmpb $0x1, (%rsp,%rdi)
je 0x13de
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 %rdx, (%rcx)
jmp 0x1441
movq 0x8(%rdx), %r8
testq %r8, %r8
je 0x1414
cmpb $0x1, 0x18(%r8)
jne 0x1414
movb %al, 0x18(%r8)
movb %al, 0x18(%rcx)
movb $0x1, 0x18(%rdx)
movb $0x1, %cl
movl %esi, %r12d
jmp 0x1455
cmpb $0x0, (%rsp,%rdi)
je 0x142e
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)
movq 0x8(%rcx), %rsi
movq %rsi, (%rdx)
movq %rdx, 0x8(%rcx)
leal -0x3(%r12), %edx
movq 0x30(%rsp,%rdx,8), %rsi
movzbl (%rsp,%rdx), %edx
movq %rcx, (%rsi,%rdx,8)
xorl %ecx, %ecx
testb %cl, %cl
je 0x1463
cmpl $0x2, %r12d
jg 0x1390
addq $0x10, %r14
movq (%rbx), %rax
movb $0x0, 0x18(%rax)
jmp 0x1473
xorl %r14d, %r14d
movq %r14, %rax
addq $0x1b8, %rsp            # imm = 0x1B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1d31(%rip), %rdi      # 0x31c0
leaq 0x1b7e(%rip), %rsi      # 0x3014
leaq 0x1c05(%rip), %rcx      # 0x30a2
movl $0x62, %edx
callq 0x1040