// File: /workspace/github_c_makefile_star2_O2/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 0x1430
movq %rsi, %r15
testq %rsi, %rsi
je 0x1430
movq %rdi, %rbx
movl $0xfffffffe, %r12d      # imm = 0xFFFFFFFE
movq %rdi, 0x30(%rsp)
movb $0x0, (%rsp)
xorl %ebp, %ebp
xorl %r13d, %r13d
movq %rdi, %rax
movq (%rax), %r14
testq %r14, %r14
je 0x12e5
movq 0x10(%r14), %rsi
movq 0x10(%rbx), %rdx
movq %r15, %rdi
callq *0x8(%rbx)
testl %eax, %eax
je 0x1397
movq %r14, 0x38(%rsp,%r13,8)
setg %al
setg 0x1(%rsp,%r13)
movzbl %al, %eax
leaq (%r14,%rax,8), %rax
incq %r13
addq %r12, %rbp
addq $0x2, %rbp
jmp 0x12a6
movq 0x18(%rbx), %rdi
pushq $0x20
popq %rsi
callq *(%rdi)
movq %rax, %r14
movq %rbp, %rax
sarq $0x20, %rax
sarq $0x1d, %rbp
movq 0x30(%rsp,%rbp), %rcx
movzbl (%rsp,%rax), %eax
movq %r14, (%rcx,%rax,8)
testq %r14, %r14
je 0x139d
movq %r14, %rax
addq $0x10, %r14
movq %r15, 0x10(%rax)
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movb $0x1, 0x18(%rax)
movdqu 0x20(%rbx), %xmm0
pcmpeqd %xmm1, %xmm1
psubq %xmm1, %xmm0
movdqu %xmm0, 0x20(%rbx)
xorl %edx, %edx
leaq 0x1(%r13), %rax
cmpq $0x3, %rax
jl 0x1414
movq 0x30(%rsp,%r13,8), %rax
cmpb $0x1, 0x18(%rax)
jne 0x1414
cmpb $0x0, -0x1(%rsp,%r13)
movq 0x28(%rsp,%r13,8), %rcx
je 0x1375
movq (%rcx), %rsi
testq %rsi, %rsi
je 0x13a2
cmpb $0x1, 0x18(%rsi)
je 0x1384
jmp 0x13a2
movq 0x8(%rcx), %rsi
testq %rsi, %rsi
je 0x13d2
cmpb $0x1, 0x18(%rsi)
jne 0x13d2
addq $0x18, %rsi
movb %dl, (%rsi)
movb %dl, 0x18(%rax)
movb $0x1, 0x18(%rcx)
addq $-0x2, %r13
jmp 0x133b
addq $0x10, %r14
jmp 0x141b
xorl %r14d, %r14d
jmp 0x141b
cmpb $0x1, (%rsp,%r13)
je 0x13be
movq (%rax), %rdx
movq 0x8(%rdx), %rsi
movq %rsi, (%rax)
movq %rax, 0x8(%rdx)
movq %rdx, 0x8(%rcx)
movq %rdx, %rax
movb $0x1, 0x18(%rcx)
movb $0x0, 0x18(%rax)
movq (%rax), %rdx
movq %rdx, 0x8(%rcx)
movq %rax, %rdx
jmp 0x1400
cmpb $0x0, (%rsp,%r13)
je 0x13ed
movq 0x8(%rax), %rdx
movq (%rdx), %rsi
movq %rsi, 0x8(%rax)
movq %rax, (%rdx)
movq %rdx, (%rcx)
movq %rdx, %rax
movb $0x1, 0x18(%rcx)
movb $0x0, 0x18(%rax)
leaq 0x8(%rax), %rdx
movq 0x8(%rax), %rsi
movq %rsi, (%rcx)
movq %rcx, (%rdx)
addl %r12d, %r13d
movq 0x30(%rsp,%r13,8), %rcx
movzbl (%rsp,%r13), %edx
movq %rax, (%rcx,%rdx,8)
movq (%rbx), %rax
movb $0x0, 0x18(%rax)
movq %r14, %rax
addq $0x1b8, %rsp            # imm = 0x1B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1da5(%rip), %rdi      # 0x31dc
leaq 0x1bf2(%rip), %rsi      # 0x3030
leaq 0x1c79(%rip), %rcx      # 0x30be
pushq $0x62
popq %rdx
callq 0x1040