// File: /workspace/github_c_makefile_star2_O2/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 0x4210a
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbp
movq %rdi, %rbx
andq $0x0, 0x6130(%rdi)
leaq 0x16538(%rdi), %rax
movq %rax, 0x10(%rsp)
leaq 0x1653e(%rdi), %rax
movq %rax, 0x8(%rsp)
leaq 0xb9c3(%rip), %r14      # 0x4d91d
pushq $0x1
popq %r15
movq %rbp, %r12
movb (%rbp), %al
leal -0x1(%rax), %ecx
incq %rbp
cmpb $0x20, %cl
jb 0x41f5e
testb %al, %al
je 0x420db
xorl %r13d, %r13d
cmpb $0x20, 0x1(%r12,%r13)
leaq 0x1(%r13), %r13
ja 0x41f7a
cmpb $0x22, %al
jne 0x41fed
movq %rbp, %rdi
pushq $0x22
popq %rsi
callq 0x3130
testq %rax, %rax
je 0x420b7
movq %rax, %r12
movq 0x80(%rbx), %r15
testq %r15, %r15
je 0x4202a
movq (%r15), %r14
testq %r14, %r14
je 0x4202a
movq 0x8(%r15), %rsi
testq %rsi, %rsi
je 0x41fce
movq %rbp, %rdi
callq 0x3507f
testl %eax, %eax
je 0x4207b
movq 0x10(%r15), %rsi
testq %rsi, %rsi
je 0x41fe7
movq %rbp, %rdi
callq 0x3507f
testl %eax, %eax
je 0x4207b
addq $0x20, %r15
jmp 0x41fad
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x35e4f
testb $0x1, 0x6(%rbx)
je 0x42022
movq %r12, %rdi
pushq $0x3a
popq %rsi
callq 0x3130
testq %rax, %rax
je 0x42022
subq %r12, %rax
movq %rbx, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x3de9d
movq %r12, %rbp
jmp 0x420b7
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x37284
movq %rax, %r14
movq %r12, %rax
subq %rbp, %rax
movb $0x0, (%r14,%rax)
movl 0x5f40(%rbx), %edx
leal 0x1(%rdx), %eax
movl %eax, 0x5f40(%rbx)
movq 0x10(%rsp), %r15
movq %r15, %rdi
leaq 0xb78f(%rip), %rsi      # 0x4d7f0
xorl %eax, %eax
callq 0x3370
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x3e2d0
movq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x3110
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x35e4f
movq %rbp, %rax
subq %r12, %rax
incq %r12
leaq (%rax,%r13), %rdx
decq %rdx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x35e4f
leaq 0xb86a(%rip), %r14      # 0x4d91d
pushq $0x1
popq %r15
cmpb $0x0, (%rbp,%r13)
leaq (%rbp,%r13), %rbp
je 0x41f5e
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x35e4f
jmp 0x41f5e
leaq 0xb07f(%rip), %rsi      # 0x4d161
pushq $0x1
popq %rdx
movq %rbx, %rdi
callq 0x35e4f
movq 0x6120(%rbx), %rsi
movq %rbx, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x37284
xorl %eax, %eax
retq