// File: /workspace/github_c_makefile_star2_O3/loversmile[P]sugarcrm/sugar_stdsoap2.c
// Function: soap_s2QName
SOAP_FMAC2
soap_s2QName(struct soap *soap, const char *s, char **t, long minlen, long maxlen)
{ if (s)
  { long l = (long)strlen(s);
    if ((maxlen >= 0 && l > maxlen) || l < minlen)
      return soap->error = SOAP_LENGTH;
    soap->labidx = 0;
    DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Normalized namespace(s) of QNames '%s'", s));
    /* convert (by prefix normalize prefix) all QNames in s */
    for (;;)
    { size_t n;
      struct soap_nlist *np;
      register const char *p;
      /* skip blanks */
      while (*s && soap_blank(*s))
        s++;
      if (!*s)
        break;
      /* find next QName */
      n = 1;
      while (s[n] && !soap_blank(s[n]))
        n++;
      np = soap->nlist;
      /* if there is no namespace stack, or prefix is "xml" then copy string */
      if (!np || !strncmp(s, "xml:", 4))
      { soap_append_lab(soap, s, n);
      }
      else /* we normalize the QName by replacing its prefix */
      { for (p = s; *p && p < s + n; p++)
          if (*p == ':')
	    break;
        if (*p == ':')
        { size_t k = p - s;
          while (np && (strncmp(np->id, s, k) || np->id[k]))
            np = np->next;
          p++;
        }
        else
        { while (np && *np->id)
            np = np->next;
          p = s;
        }
        /* replace prefix */
        if (np)
        { if (np->index >= 0 && soap->local_namespaces)
          { const char *q = soap->local_namespaces[np->index].id;
            if (q)
              soap_append_lab(soap, q, strlen(q));
          }
          else if (np->ns)
          { soap_append_lab(soap, "\"", 1);
            soap_append_lab(soap, np->ns, strlen(np->ns));
            soap_append_lab(soap, "\"", 1);
          }
          else
          { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "\nNamespace prefix of '%s' not defined (index=%d, URI=%s)\n", s, np->index, np->ns?np->ns:SOAP_STR_EOS));
            return soap->error = SOAP_NAMESPACE; 
          }
        }
        else if (s[n]) /* no namespace, part of string */
        { soap_append_lab(soap, s, n);
        } 
	else /* no namespace: assume "" namespace */
        { soap_append_lab(soap, "\"\"", 2);
	}
        soap_append_lab(soap, ":", 1);
        soap_append_lab(soap, p, n - (p-s));
      }
      /* 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);
    DBGLOG(TEST, SOAP_MESSAGE(fdebug, " into '%s'\n", *t));
  }
  return soap->error;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
testq %rsi, %rsi
je 0x43a2a
movq %r8, %r12
movq %rcx, %r15
movq %rdx, %rbx
movq %rdi, 0x10(%rsp)
movq %rsi, %r14
movq %rsi, %rdi
callq 0x3110
testq %r12, %r12
setns %cl
cmpq %r12, %rax
setg %dl
andb %cl, %dl
cmpq %r15, %rax
setl %al
orb %dl, %al
cmpb $0x1, %al
jne 0x437df
movq 0x10(%rsp), %rax
movl $0x2d, 0x19214(%rax)
movl $0x2d, %eax
jmp 0x43a30
movq %rbx, 0x20(%rsp)
movq 0x10(%rsp), %r12
movq $0x0, 0x6130(%r12)
movq %r14, %rcx
movq %rcx, %r15
movb (%rcx), %bl
leal -0x1(%rbx), %eax
incq %rcx
cmpb $0x20, %al
jb 0x437f8
testb %bl, %bl
je 0x439fb
xorl %ebp, %ebp
movb 0x1(%r15,%rbp), %r13b
incq %rbp
cmpb $0x20, %r13b
ja 0x43811
leaq (%r15,%rbp), %rax
movq %rax, 0x18(%rsp)
movq 0x88(%r12), %r14
testq %r14, %r14
je 0x438e7
movl $0x4, %edx
movq %r15, %rdi
leaq 0xefa0(%rip), %rsi      # 0x527e8
callq 0x3080
testl %eax, %eax
je 0x438e7
movq %r15, %rdx
testq %rbp, %rbp
movq 0x18(%rsp), %rcx
jle 0x43879
testb %bl, %bl
je 0x438bd
movzbl %bl, %eax
cmpl $0x3a, %eax
je 0x4387e
movb 0x1(%rdx), %bl
incq %rdx
cmpq %rcx, %rdx
jb 0x43862
cmpb $0x3a, %bl
jne 0x438bd
movq %rdx, 0x8(%rsp)
movq %rdx, %r12
subq %r15, %r12
leaq 0x18(%r14), %rbx
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x3080
testl %eax, %eax
jne 0x438a6
cmpb $0x0, (%rbx,%r12)
je 0x4390e
movq (%r14), %r14
testq %r14, %r14
jne 0x43889
movq 0x8(%rsp), %rax
incq %rax
movq 0x10(%rsp), %r12
jmp 0x438cf
cmpb $0x0, 0x18(%r14)
je 0x438f5
movq (%r14), %r14
testq %r14, %r14
jne 0x438bd
movq %r15, %rax
movq %rax, 0x8(%rsp)
testb %r13b, %r13b
je 0x438fa
movq %r12, %rdi
movq %r15, %rsi
movq %rbp, %rdx
jmp 0x4399e
movq %r12, %rdi
movq %r15, %rsi
movq %rbp, %rdx
jmp 0x439c8
movq %r15, %rdx
jmp 0x4391b
movl $0x2, %edx
movq %r12, %rdi
leaq 0xeee4(%rip), %rsi      # 0x527ed
jmp 0x4399e
movq 0x8(%rsp), %rdx
incq %rdx
movq 0x10(%rsp), %r12
movswq 0xc(%r14), %rax
testq %rax, %rax
movq %rdx, 0x8(%rsp)
js 0x43957
movq 0x80(%r12), %rcx
testq %rcx, %rcx
je 0x43957
shlq $0x5, %rax
movq (%rcx,%rax), %rbx
testq %rbx, %rbx
je 0x439a3
movq %rbx, %rdi
callq 0x3110
movq %r12, %rdi
movq %rbx, %rsi
movq %rax, %rdx
jmp 0x4399e
cmpq $0x0, 0x10(%r14)
je 0x43a3f
movl $0x1, %edx
movq %r12, %rdi
leaq 0xee7d(%rip), %r13      # 0x527ee
movq %r13, %rsi
callq 0x39195
movq 0x10(%r14), %rbx
movq %rbx, %rdi
callq 0x3110
movq %r12, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x39195
movl $0x1, %edx
movq %r12, %rdi
movq %r13, %rsi
callq 0x39195
movl $0x1, %edx
movq %r12, %rdi
leaq 0xda8a(%rip), %rsi      # 0x5143c
callq 0x39195
movq %r15, %rdx
movq 0x8(%rsp), %rsi
subq %rsi, %rdx
addq %rbp, %rdx
movq %r12, %rdi
callq 0x39195
cmpb $0x0, (%r15,%rbp)
movq 0x18(%rsp), %rcx
je 0x437f8
movl $0x1, %edx
movq %r12, %rdi
leaq 0xef31(%rip), %rsi      # 0x5291d
callq 0x39195
movq 0x18(%rsp), %rcx
jmp 0x437f8
leaq 0xe75f(%rip), %rsi      # 0x52161
movl $0x1, %edx
movq %r12, %rdi
callq 0x39195
movq 0x6120(%r12), %rsi
movq %r12, %rdi
callq 0x3a6c4
movq 0x20(%rsp), %rcx
movq %rax, (%rcx)
movq %r12, %rdi
movl 0x19214(%rdi), %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x9, 0x19214(%r12)
movl $0x9, %eax
jmp 0x43a30