// File: /workspace/github_c_makefile_star2_O0/loversmile[P]sugarcrm/sugar_stdsoap2.c
// Function: soap_dealloc
SOAP_FMAC2
soap_dealloc(struct soap *soap, void *p)
{ if (soap_check_state(soap))
    return;
  if (p)
  { register char **q;
    for (q = (char**)&soap->alist; *q; q = *(char***)q)
    { 
      if (*(unsigned short*)(char*)(*q - sizeof(unsigned short)) != (unsigned short)SOAP_CANARY)
      {
#ifdef SOAP_MEM_DEBUG
        fprintf(stderr, "Data corruption in dynamic allocation (see logs)\n");
#endif
        DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Data corruption:\n"));
        DBGHEX(TEST, *q - 200, 200);
        DBGLOG(TEST, SOAP_MESSAGE(fdebug, "\n"));
        soap->error = SOAP_MOE;
        return;
      }
      if (p == (void*)(*q - *(size_t*)(*q + sizeof(void*))))
      { *q = **(char***)q;
        DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Freed data at %p\n", p));
        SOAP_FREE(soap, p);
        return;
      }
    }
    soap_delete(soap, p);
  }
  else
  { register char *q;
    DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Free all soap_malloc() data\n"));
    while (soap->alist)
    { q = (char*)soap->alist;
      if (*(unsigned short*)(char*)(q - sizeof(unsigned short)) != (unsigned short)SOAP_CANARY)
      {
#ifdef SOAP_MEM_DEBUG
        fprintf(stderr, "Data corruption in dynamic allocation (see logs)\n");
#endif
        DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Data corruption:\n"));
        DBGHEX(TEST, q - 200, 200);
        DBGLOG(TEST, SOAP_MESSAGE(fdebug, "\n"));
        soap->error = SOAP_MOE;
        return;
      }
      soap->alist = *(void**)q;
      q -= *(size_t*)(q + sizeof(void*));
      SOAP_FREE(soap, q);
    }
    /* we must assume these were deallocated: */
    soap->action = NULL;
    soap->fault = NULL;
    soap->header = NULL;
    soap->userid = NULL;
    soap->passwd = NULL;
    soap->authrealm = NULL;
    soap->http_content = NULL;
#ifndef WITH_LEANER
    soap_clr_mime(soap);
#endif
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x5c07f
movq -0x8(%rbp), %rax
movswl (%rax), %eax
cmpl $0x1, %eax
je 0x5c084
movq -0x8(%rbp), %rax
movswl (%rax), %eax
cmpl $0x2, %eax
je 0x5c084
jmp 0x5c211
cmpq $0x0, -0x10(%rbp)
je 0x5c12c
movq -0x8(%rbp), %rax
addq $0xa0, %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpq $0x0, (%rax)
je 0x5c11a
movq -0x18(%rbp), %rax
movq (%rax), %rax
movzwl -0x2(%rax), %eax
cmpl $0xc0de, %eax           # imm = 0xC0DE
je 0x5c0cc
movq -0x8(%rbp), %rax
movl $0x15, 0x19214(%rax)
jmp 0x5c211
movq -0x10(%rbp), %rax
movq -0x18(%rbp), %rcx
movq (%rcx), %rcx
movq -0x18(%rbp), %rdx
movq (%rdx), %rsi
xorl %edx, %edx
subq 0x8(%rsi), %rdx
addq %rdx, %rcx
cmpq %rcx, %rax
jne 0x5c10b
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq (%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rdi
callq 0x3030
jmp 0x5c211
jmp 0x5c10d
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0x5c09d
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x5c220
jmp 0x5c211
jmp 0x5c12e
movq -0x8(%rbp), %rax
cmpq $0x0, 0xa0(%rax)
je 0x5c1a2
movq -0x8(%rbp), %rax
movq 0xa0(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movzwl -0x2(%rax), %eax
cmpl $0xc0de, %eax           # imm = 0xC0DE
je 0x5c16d
movq -0x8(%rbp), %rax
movl $0x15, 0x19214(%rax)
jmp 0x5c211
movq -0x20(%rbp), %rax
movq (%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0xa0(%rax)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rdx
movq -0x20(%rbp), %rax
xorl %ecx, %ecx
subq %rdx, %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
callq 0x3030
jmp 0x5c12e
movq -0x8(%rbp), %rax
movq $0x0, 0x191a8(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x5f38(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x5f30(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x5f58(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x5f60(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x191b0(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x30(%rax)
movq -0x8(%rbp), %rdi
callq 0x5c340
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)