// File: attractivechaos[P]udb2/stb/./stb.h
// Function: stb_ps_find
int stb_ps_find(stb_ps *ps, void *value)
{
   int i, code = 3 & (int) ps;
    assert((3 & (int) value) == STB_ps_direct);
   assert(stb_ps_fastlist_valid(value));
   // not a switch: order based on expected performance/power-law distribution
   if (code == STB_ps_direct)
      return value == ps;
   if (code == STB_ps_bucket) {
      stb_ps_bucket *b = GetBucket(ps);
      assert(STB_BUCKET_SIZE == 4);
      if (b->p[0] == value || b->p[1] == value ||
          b->p[2] == value || b->p[3] == value)
          return STB_TRUE;
      return STB_FALSE;
   }
   if (code == STB_ps_array) {
      stb_ps_array *a = GetArray(ps);
      for (i=0; i < a->count; ++i)
         if (a->p[i] == value)
            return STB_TRUE;
      return STB_FALSE;
   } else {
      stb_ps_hash *h = GetHash(ps);
      stb_uint32 hash = stb_hashptr(value);
      stb_uint32 s, n = hash & h->mask;
      void **t = h->table;
      if (t[n] == value) return STB_TRUE;
      if (t[n] == NULL) return STB_FALSE;
      s = stb_rehash(hash) | 1;
      do {
         n = (n + s) & h->mask;
         if (t[n] == value) return STB_TRUE;
      } while (t[n] != NULL);
      return STB_FALSE;
   }
}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x48(%rsp)
movq %rsi, 0x40(%rsp)
movq 0x48(%rsp), %rax
andl $0x3, %eax
movl %eax, 0x38(%rsp)
movq 0x40(%rsp), %rax
andl $0x3, %eax
cmpl $0x0, %eax
jne 0x12d49
jmp 0x12d68
leaq 0xccc4(%rip), %rdi      # 0x1fa14
leaq 0xc632(%rip), %rsi      # 0x1f389
movl $0x1e01, %edx           # imm = 0x1E01
leaq 0xccd4(%rip), %rcx      # 0x1fa37
callq 0x2140
movq 0x40(%rsp), %rax
cmpq $0x1, %rax
jbe 0x12d75
jmp 0x12d94
leaq 0xccdd(%rip), %rdi      # 0x1fa59
leaq 0xc606(%rip), %rsi      # 0x1f389
movl $0x1e02, %edx           # imm = 0x1E02
leaq 0xcca8(%rip), %rcx      # 0x1fa37
callq 0x2140
cmpl $0x0, 0x38(%rsp)
jne 0x12db6
movq 0x40(%rsp), %rax
cmpq 0x48(%rsp), %rax
sete %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, 0x54(%rsp)
jmp 0x12f6b
cmpl $0x1, 0x38(%rsp)
jne 0x12e24
movq 0x48(%rsp), %rax
addq $-0x1, %rax
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rax
movq (%rax), %rax
cmpq 0x40(%rsp), %rax
je 0x12e0a
movq 0x30(%rsp), %rax
movq 0x8(%rax), %rax
cmpq 0x40(%rsp), %rax
je 0x12e0a
movq 0x30(%rsp), %rax
movq 0x10(%rax), %rax
cmpq 0x40(%rsp), %rax
je 0x12e0a
movq 0x30(%rsp), %rax
movq 0x18(%rax), %rax
cmpq 0x40(%rsp), %rax
jne 0x12e17
movl $0x1, 0x54(%rsp)
jmp 0x12f6b
movl $0x0, 0x54(%rsp)
jmp 0x12f6b
cmpl $0x2, 0x38(%rsp)
jne 0x12e8d
movq 0x48(%rsp), %rax
addq $-0x2, %rax
movq %rax, 0x28(%rsp)
movl $0x0, 0x3c(%rsp)
movl 0x3c(%rsp), %eax
movq 0x28(%rsp), %rcx
cmpl (%rcx), %eax
jge 0x12e80
movq 0x28(%rsp), %rax
movslq 0x3c(%rsp), %rcx
movq 0x8(%rax,%rcx,8), %rax
cmpq 0x40(%rsp), %rax
jne 0x12e71
movl $0x1, 0x54(%rsp)
jmp 0x12f6b
jmp 0x12e73
movl 0x3c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x3c(%rsp)
jmp 0x12e41
movl $0x0, 0x54(%rsp)
jmp 0x12f6b
movq 0x48(%rsp), %rax
addq $-0x3, %rax
movq %rax, 0x20(%rsp)
movq 0x40(%rsp), %rdi
callq 0x8340
movl %eax, 0x1c(%rsp)
movl 0x1c(%rsp), %eax
movq 0x20(%rsp), %rcx
andl 0x4(%rcx), %eax
movl %eax, 0x14(%rsp)
movq 0x20(%rsp), %rax
addq $0x20, %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
movl 0x14(%rsp), %ecx
movq (%rax,%rcx,8), %rax
cmpq 0x40(%rsp), %rax
jne 0x12ee8
movl $0x1, 0x54(%rsp)
jmp 0x12f6b
movq 0x8(%rsp), %rax
movl 0x14(%rsp), %ecx
cmpq $0x0, (%rax,%rcx,8)
jne 0x12f02
movl $0x0, 0x54(%rsp)
jmp 0x12f6b
movl 0x1c(%rsp), %eax
movl 0x1c(%rsp), %ecx
shrl $0x6, %ecx
addl %ecx, %eax
movl 0x1c(%rsp), %ecx
shrl $0x13, %ecx
addl %ecx, %eax
orl $0x1, %eax
movl %eax, 0x18(%rsp)
movl 0x14(%rsp), %eax
addl 0x18(%rsp), %eax
movq 0x20(%rsp), %rcx
andl 0x4(%rcx), %eax
movl %eax, 0x14(%rsp)
movq 0x8(%rsp), %rax
movl 0x14(%rsp), %ecx
movq (%rax,%rcx,8), %rax
cmpq 0x40(%rsp), %rax
jne 0x12f51
movl $0x1, 0x54(%rsp)
jmp 0x12f6b
jmp 0x12f53
movq 0x8(%rsp), %rax
movl 0x14(%rsp), %ecx
cmpq $0x0, (%rax,%rcx,8)
jne 0x12f1f
movl $0x0, 0x54(%rsp)
movl 0x54(%rsp), %eax
addq $0x58, %rsp
retq
nopw %cs:(%rax,%rax)