// File: attractivechaos[P]udb2/stb/./stb.h
// Function: stb_ps_writelist
int stb_ps_writelist(stb_ps *ps, void **list, int size )
{
   int i,n=0;
   switch (3 & (int) ps) {
      case STB_ps_direct:
         if (ps == NULL || size <= 0) return 0;
         list[0] = ps;
         return 1;
      case STB_ps_bucket: {
         stb_ps_bucket *b = GetBucket(ps);
         for (i=0; i < STB_BUCKET_SIZE; ++i)
            if (b->p[i] != NULL && n < size)
               list[n++] = b->p[i];
         return n;
      }
      case STB_ps_array: {
         stb_ps_array *a = GetArray(ps);
         n = stb_min(size, a->count);
         memcpy(list, a->p, sizeof(*list) * n);
         return n;
      }
      case STB_ps_hash: {
         stb_ps_hash *h = GetHash(ps);
         if (size <= 0) return 0;
         for (i=0; i < h->count; ++i) {
            if (!stb_ps_empty(h->table[i])) {
               list[n++] = h->table[i];
               if (n == size) break;
            }
         }
         return n;
      }
   }
   return 0; /* NOTREACHED */
}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x48(%rsp)
movq %rsi, 0x40(%rsp)
movl %edx, 0x3c(%rsp)
movl $0x0, 0x34(%rsp)
movl 0x48(%rsp), %eax
andl $0x3, %eax
movl %eax, %ecx
movq %rcx, 0x10(%rsp)
subl $0x3, %eax
ja 0x14253
movq 0x10(%rsp), %rax
leaq 0xb097(%rip), %rcx      # 0x1f134
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpq $0x0, 0x48(%rsp)
je 0x140b5
cmpl $0x0, 0x3c(%rsp)
jg 0x140c2
movl $0x0, 0x54(%rsp)
jmp 0x1425b
movq 0x48(%rsp), %rcx
movq 0x40(%rsp), %rax
movq %rcx, (%rax)
movl $0x1, 0x54(%rsp)
jmp 0x1425b
movq 0x48(%rsp), %rax
addq $-0x1, %rax
movq %rax, 0x28(%rsp)
movl $0x0, 0x38(%rsp)
cmpl $0x4, 0x38(%rsp)
jge 0x1414a
movq 0x28(%rsp), %rax
movslq 0x38(%rsp), %rcx
cmpq $0x0, (%rax,%rcx,8)
je 0x1413b
movl 0x34(%rsp), %eax
cmpl 0x3c(%rsp), %eax
jge 0x1413b
movq 0x28(%rsp), %rax
movslq 0x38(%rsp), %rcx
movq (%rax,%rcx,8), %rdx
movq 0x40(%rsp), %rax
movl 0x34(%rsp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, 0x34(%rsp)
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
jmp 0x1413d
movl 0x38(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x38(%rsp)
jmp 0x140f2
movl 0x34(%rsp), %eax
movl %eax, 0x54(%rsp)
jmp 0x1425b
movq 0x48(%rsp), %rax
addq $-0x2, %rax
movq %rax, 0x20(%rsp)
movl 0x3c(%rsp), %eax
movq 0x20(%rsp), %rcx
cmpl (%rcx), %eax
jge 0x1417c
movl 0x3c(%rsp), %eax
movl %eax, 0xc(%rsp)
jmp 0x14187
movq 0x20(%rsp), %rax
movl (%rax), %eax
movl %eax, 0xc(%rsp)
movl 0xc(%rsp), %eax
movl %eax, 0x34(%rsp)
movq 0x40(%rsp), %rdi
movq 0x20(%rsp), %rsi
addq $0x8, %rsi
movslq 0x34(%rsp), %rdx
shlq $0x3, %rdx
callq 0x2230
movl 0x34(%rsp), %eax
movl %eax, 0x54(%rsp)
jmp 0x1425b
movq 0x48(%rsp), %rax
addq $-0x3, %rax
movq %rax, 0x18(%rsp)
cmpl $0x0, 0x3c(%rsp)
jg 0x141da
movl $0x0, 0x54(%rsp)
jmp 0x1425b
movl $0x0, 0x38(%rsp)
movl 0x38(%rsp), %eax
movq 0x18(%rsp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x14249
movq 0x18(%rsp), %rax
movslq 0x38(%rsp), %rcx
movq 0x20(%rax,%rcx,8), %rax
cmpl $0x1, %eax
jbe 0x1423a
movq 0x18(%rsp), %rax
movslq 0x38(%rsp), %rcx
movq 0x20(%rax,%rcx,8), %rdx
movq 0x40(%rsp), %rax
movl 0x34(%rsp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, 0x34(%rsp)
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
movl 0x34(%rsp), %eax
cmpl 0x3c(%rsp), %eax
jne 0x14238
jmp 0x14249
jmp 0x1423a
jmp 0x1423c
movl 0x38(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x38(%rsp)
jmp 0x141e2
movl 0x34(%rsp), %eax
movl %eax, 0x54(%rsp)
jmp 0x1425b
movl $0x0, 0x54(%rsp)
movl 0x54(%rsp), %eax
addq $0x58, %rsp
retq
nopw %cs:(%rax,%rax)