// File: /workspace/github_c_makefile_star2_O1/loversmile[P]sugarcrm/sugar_stdsoap2.c
// Function: soap_QName2s
SOAP_FMAC1
const char*
SOAP_FMAC2
soap_QName2s(struct soap *soap, const char *s)
{ const char *t = NULL;
  if (s)
  { soap->labidx = 0;
    for (;;)
    { size_t n;
      /* skip blanks */
      while (*s && soap_blank(*s))
        s++;
      if (!*s)
        break;
      /* find next QName */
      n = 1;
      while (s[n] && !soap_blank(s[n]))
        n++;
      /* normal prefix: pass string as is */
      if (*s != '"')
      { soap_append_lab(soap, s, n);
#ifndef WITH_LEAN
        if ((soap->mode & SOAP_XML_CANONICAL))
        { const char *r = strchr(s, ':');
          if (r)
            soap_utilize_ns(soap, s, r - s);
        }
#endif
      }
      else /* URL-based string prefix */
      { const char *q;
        s++;
        q = strchr(s, '"');
        if (q)
        { struct Namespace *p = soap->local_namespaces;
          if (p)
          { for (; p->id; p++)
            { if (p->ns)
                if (!soap_tag_cmp(s, p->ns))
                  break;
              if (p->in)
                if (!soap_tag_cmp(s, p->in))
                  break;
            }
          }
          /* URL is in the namespace table? */
          if (p && p->id)
          { soap_append_lab(soap, p->id, strlen(p->id));
          }
          else /* not in namespace table: create xmlns binding */
          { char *r = soap_strdup(soap, s);
            r[q-s] = '\0';
            sprintf(soap->tmpbuf, "xmlns:_%d", soap->idnum++);
            soap_set_attr(soap, soap->tmpbuf, r);
            soap_append_lab(soap, soap->tmpbuf + 6, strlen(soap->tmpbuf + 6));
          }
          soap_append_lab(soap, q + 1, n - (q-s) - 1);
        }
      }
      /* advance to next and add spacing */
      s += n;
      if (*s)
        soap_append_lab(soap, " ", 1);
    }
    soap_append_lab(soap, SOAP_STR_EOS, 1);
    t = soap_strdup(soap, soap->labbuf);
  }
  return t;
}

// Assembly:
testq %rsi, %rsi
je 0x46c30
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %r14
movq $0x0, 0x6130(%rdi)
leaq 0x16538(%rdi), %rax
movq %rax, 0x18(%rsp)
leaq 0x1653e(%rdi), %rax
movq %rax, 0x10(%rsp)
leaq 0xbecb(%rip), %r12      # 0x5291d
movq %rdi, (%rsp)
movq %rsi, %r13
movb (%rsi), %bl
leal -0x1(%rbx), %eax
incq %rsi
cmpb $0x20, %al
jb 0x46a56
testb %bl, %bl
je 0x46bf4
xorl %ebp, %ebp
cmpb $0x20, 0x1(%r13,%rbp)
leaq 0x1(%rbp), %rbp
ja 0x46a6f
cmpb $0x22, %bl
jne 0x46aef
leaq 0x1(%r13), %r15
movq %r15, %rdi
movl $0x22, %esi
callq 0x3130
movq %rax, 0x8(%rsp)
testq %rax, %rax
je 0x46bd9
movq 0x80(%r14), %r14
testq %r14, %r14
je 0x46b34
cmpq $0x0, (%r14)
je 0x46b2f
movq 0x8(%r14), %rsi
testq %rsi, %rsi
je 0x46aca
movq %r15, %rdi
callq 0x3806c
testl %eax, %eax
je 0x46b2f
movq 0x10(%r14), %rsi
testq %rsi, %rsi
je 0x46adf
movq %r15, %rdi
callq 0x3806c
testl %eax, %eax
je 0x46b2f
leaq 0x20(%r14), %rax
cmpq $0x0, 0x20(%r14)
movq %rax, %r14
jne 0x46ab5
jmp 0x46b36
movq %r14, %rdi
movq %r13, %rsi
movq %rbp, %rdx
callq 0x38fa7
testb $0x1, 0x6(%r14)
je 0x46b27
movq %r13, %rdi
movl $0x3a, %esi
callq 0x3130
testq %rax, %rax
je 0x46b27
subq %r13, %rax
movq %r14, %rdi
movq %r13, %rsi
movq %rax, %rdx
callq 0x42126
movq %r13, %r15
jmp 0x46bd9
movq %r14, %rax
jmp 0x46b36
xorl %eax, %eax
testq %rax, %rax
je 0x46b43
movq (%rax), %r14
testq %r14, %r14
jne 0x46b9f
movq (%rsp), %r14
movq %r14, %rdi
movq %r15, %rsi
callq 0x3a567
movq %rax, 0x20(%rsp)
movq 0x8(%rsp), %rcx
subq %r15, %rcx
movb $0x0, (%rax,%rcx)
movl 0x5f40(%r14), %edx
leal 0x1(%rdx), %eax
movl %eax, 0x5f40(%r14)
movq 0x18(%rsp), %r12
movq %r12, %rdi
leaq 0xbc6d(%rip), %rsi      # 0x527f0
xorl %eax, %eax
callq 0x3350
movq %r14, %rdi
movq %r12, %rsi
movq 0x20(%rsp), %rdx
callq 0x425f4
movq 0x10(%rsp), %r14
movq %r14, %rdi
callq 0x3110
movq (%rsp), %rdi
movq %r14, %rsi
movq %rdi, %r14
movq %rax, %rdx
callq 0x38fa7
movq 0x8(%rsp), %rsi
subq %rsi, %r13
incq %rsi
addq %rbp, %r13
movq %r14, %rdi
movq %r13, %rdx
callq 0x38fa7
leaq 0xbd44(%rip), %r12      # 0x5291d
leaq (%r15,%rbp), %r13
cmpb $0x0, (%r15,%rbp)
je 0x46bf4
movl $0x1, %edx
movq %r14, %rdi
movq %r12, %rsi
callq 0x38fa7
movq %r13, %rsi
testb %bl, %bl
jne 0x46a56
leaq 0xb55b(%rip), %rsi      # 0x52161
movl $0x1, %edx
movq %r14, %rdi
callq 0x38fa7
movq 0x6120(%r14), %rsi
movq %r14, %rdi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3a567
xorl %eax, %eax
retq