// File: /workspace/github_c_makefile_star2_O2/loversmile[P]sugarcrm/sugar_stdsoap2.c
// Function: soap_id_forward
SOAP_FMAC1
void*
SOAP_FMAC2
soap_id_forward(struct soap *soap, const char *href, void *p, size_t len, int st, int tt, size_t n, unsigned int k, void (*fcopy)(struct soap*, int, int, void*, size_t, const void*, size_t))
{ struct soap_ilist *ip;
  if (!p || !href || !*href)
    return p;
  ip = soap_lookup(soap, href); /* lookup pointer to hash table entry for string id */
  if (!ip)
  { if (!(ip = soap_enter(soap, href))) /* new hash table entry for string id */
      return NULL;
    ip->type = st;
    ip->size = n;
    ip->link = NULL;
    ip->copy = NULL;
    ip->ptr = NULL;
    ip->level = 0;
    ip->flist = NULL;
    DBGLOG(TEST,SOAP_MESSAGE(fdebug, "New entry href='%s' type=%d size=%lu level=%d location=%p\n", href, st, (unsigned long)n, k, p));
  }
  else if (ip->type != st || (ip->level == k && ip->size != n))
  { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Type incompatibility id='%s' expect type=%d size=%lu level=%u got type=%d size=%lu\n", href, ip->type, (unsigned long)ip->size, k, st, (unsigned long)n));
    strcpy(soap->id, href);
    soap->error = SOAP_HREF;
    return NULL;
  }
  if (fcopy || n < sizeof(void*) || *href != '#')
  { register struct soap_flist *fp = (struct soap_flist*)SOAP_MALLOC(soap, sizeof(struct soap_flist));
    if (!fp)
    { soap->error = SOAP_EOM;
      return NULL;
    }
    fp->next = ip->flist;
    fp->type = tt;
    fp->ptr = p;
    fp->level = k;
    fp->len = len;
    if (fcopy)
      fp->fcopy = fcopy;
    else
      fp->fcopy = soap_fcopy;
    ip->flist = fp;
    DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Forwarding type=%d (target type=%d) size=%lu location=%p level=%u len=%lu href='%s'\n", st, tt, (unsigned long)n, p, k, (unsigned long)len, href));
  }
  else
  { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Forwarding copying address %p for type=%d href='%s'\n", p, st, href));
    *(void**)p = ip->copy;
    ip->copy = p;
  }
  return p;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
testq %rdx, %rdx
sete %al
testq %rsi, %rsi
sete %dl
orb %al, %dl
jne 0x3c1a3
movq %rsi, %r12
cmpb $0x0, (%rsi)
je 0x3c1a3
movl %r9d, %ebp
movl %r8d, %r14d
movq %rdi, %r15
movq %rcx, (%rsp)
movq %r12, %rsi
callq 0x3bb85
testq %rax, %rax
je 0x3c0f2
movq %rax, %r13
cmpl %r14d, 0x8(%rax)
jne 0x3c0d3
movl 0x48(%rsp), %eax
cmpl %eax, 0x38(%r13)
jne 0x3c128
movq 0x40(%rsp), %rax
cmpq %rax, 0x10(%r13)
je 0x3c128
leaq 0x16d38(%r15), %rdi
movq %r12, %rsi
callq 0x3090
movl $0x1a, 0x19214(%r15)
jmp 0x3c1a1
movq %r15, %rdi
movq %r12, %rsi
callq 0x3bbc5
testq %rax, %rax
je 0x3c1a1
movq %rax, %r13
movl %r14d, 0x8(%rax)
movq 0x40(%rsp), %rax
movq %rax, 0x10(%r13)
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%r13)
movups %xmm0, 0x28(%r13)
andl $0x0, 0x38(%r13)
movq 0x50(%rsp), %r14
testq %r14, %r14
setne %al
cmpq $0x8, 0x40(%rsp)
setb %cl
orb %al, %cl
jne 0x3c154
cmpb $0x23, (%r12)
jne 0x3c154
movq 0x20(%r13), %rax
movq %rax, (%rbx)
movq %rbx, 0x20(%r13)
jmp 0x3c1a3
pushq $0x30
popq %rdi
callq 0x3290
testq %rax, %rax
je 0x3c196
testq %r14, %r14
movq 0x28(%r13), %rcx
movq %rcx, (%rax)
movl %ebp, 0x8(%rax)
movq %rbx, 0x10(%rax)
movl 0x48(%rsp), %ecx
movl %ecx, 0x18(%rax)
movq (%rsp), %rcx
movq %rcx, 0x20(%rax)
leaq -0x4c01(%rip), %rcx     # 0x37587
cmovneq %r14, %rcx
movq %rcx, 0x28(%rax)
movq %rax, 0x28(%r13)
jmp 0x3c1a3
movl $0x14, 0x19214(%r15)
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq