// File: attractivechaos[P]udb2/stb/./stb.h
// Function: stb_malloc_validate
void stb_malloc_validate(void *p, void *parent)
{
   if (p == NULL) return;

   switch(stb__identify(p)) {
      case STB__chunked:
         return;
      case STB__nochildren: {
         stb__nochildren *n = (stb__nochildren *) p - 1;
         if (n->prevn)
            assert(*n->prevn == p);
         if (n->next) {
            assert(*stb__prevn(n->next) == &n->next);
            stb_malloc_validate(n, parent);
         }
         return;
      }
      case STB__alloc: {
         stb__alloc *s = (stb__alloc *) p - 1;

         if (s->prevn)
            assert(*s->prevn == p);

         if (s->child) {
            assert(*stb__prevn(s->child) == &s->child);
            stb_malloc_validate(s->child, p);
         }

         if (s->next) {
            assert(*stb__prevn(s->next) == &s->next);
            stb_malloc_validate(s->next, parent);
         }
         return;
      }
      default:
         assert(0); /* NOTREACHED */
   }
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
cmpq $0x0, 0x20(%rsp)
jne 0x70cb
jmp 0x72da
movq 0x20(%rsp), %rdi
callq 0x7030
movl %eax, %ecx
movl %ecx, 0x4(%rsp)
testl %eax, %eax
je 0x7103
jmp 0x70e1
movl 0x4(%rsp), %eax
subl $0x1, %eax
je 0x70fe
jmp 0x70ec
movl 0x4(%rsp), %eax
subl $0x2, %eax
je 0x71ad
jmp 0x72bb
jmp 0x72da
movq 0x20(%rsp), %rax
addq $-0x10, %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
cmpq $0x0, 0x8(%rax)
je 0x7153
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rax
cmpq 0x20(%rsp), %rax
jne 0x7132
jmp 0x7151
leaq 0x183cb(%rip), %rdi     # 0x1f504
leaq 0x18249(%rip), %rsi     # 0x1f389
movl $0xa35, %edx            # imm = 0xA35
leaq 0x183c7(%rip), %rcx     # 0x1f513
callq 0x2140
jmp 0x7153
movq 0x10(%rsp), %rax
cmpq $0x0, (%rax)
je 0x71a8
movq 0x10(%rsp), %rax
movq (%rax), %rdi
callq 0x7050
movq (%rax), %rax
movq 0x10(%rsp), %rcx
cmpq %rcx, %rax
jne 0x717a
jmp 0x7199
leaq 0x183bb(%rip), %rdi     # 0x1f53c
leaq 0x18201(%rip), %rsi     # 0x1f389
movl $0xa37, %edx            # imm = 0xA37
leaq 0x1837f(%rip), %rcx     # 0x1f513
callq 0x2140
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0x70b0
jmp 0x72da
movq 0x20(%rsp), %rax
addq $-0x20, %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
cmpq $0x0, (%rax)
je 0x71fb
movq 0x8(%rsp), %rax
movq (%rax), %rax
movq (%rax), %rax
cmpq 0x20(%rsp), %rax
jne 0x71da
jmp 0x71f9
leaq 0x1837c(%rip), %rdi     # 0x1f55d
leaq 0x181a1(%rip), %rsi     # 0x1f389
movl $0xa40, %edx            # imm = 0xA40
leaq 0x1831f(%rip), %rcx     # 0x1f513
callq 0x2140
jmp 0x71fb
movq 0x8(%rsp), %rax
cmpq $0x0, 0x8(%rax)
je 0x725a
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x7050
movq (%rax), %rax
movq 0x8(%rsp), %rcx
addq $0x8, %rcx
cmpq %rcx, %rax
jne 0x7228
jmp 0x7247
leaq 0x1833d(%rip), %rdi     # 0x1f56c
leaq 0x18153(%rip), %rsi     # 0x1f389
movl $0xa43, %edx            # imm = 0xA43
leaq 0x182d1(%rip), %rcx     # 0x1f513
callq 0x2140
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rdi
movq 0x20(%rsp), %rsi
callq 0x70b0
movq 0x8(%rsp), %rax
cmpq $0x0, 0x10(%rax)
je 0x72b9
movq 0x8(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x7050
movq (%rax), %rax
movq 0x8(%rsp), %rcx
addq $0x10, %rcx
cmpq %rcx, %rax
jne 0x7287
jmp 0x72a6
leaq 0x18301(%rip), %rdi     # 0x1f58f
leaq 0x180f4(%rip), %rsi     # 0x1f389
movl $0xa48, %edx            # imm = 0xA48
leaq 0x18272(%rip), %rcx     # 0x1f513
callq 0x2140
movq 0x8(%rsp), %rax
movq 0x10(%rax), %rdi
movq 0x18(%rsp), %rsi
callq 0x70b0
jmp 0x72da
leaq 0x183ec(%rip), %rdi     # 0x1f6ae
leaq 0x180c0(%rip), %rsi     # 0x1f389
movl $0xa4e, %edx            # imm = 0xA4E
leaq 0x1823e(%rip), %rcx     # 0x1f513
callq 0x2140
addq $0x28, %rsp
retq
nop