// File: /workspace/github_c_makefile_star2_O1/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
movq %rdi, 0x10(%rsp)
testq %rsi, %rsi
je 0x44038
movq %r8, %r12
movq %rcx, %r15
movq %rdx, %rbx
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 0x43db4
movq 0x10(%rsp), %rax
movl $0x2d, 0x19214(%rax)
movl $0x2d, %eax
xorl %ebx, %ebx
jmp 0x44034
movq %rbx, 0x18(%rsp)
movq 0x10(%rsp), %r12
movq $0x0, 0x6130(%r12)
movq %r14, %r13
movb (%r14), %al
leal -0x1(%rax), %ecx
incq %r14
cmpb $0x20, %cl
jb 0x43dca
testb %al, %al
je 0x43f01
xorl %ebp, %ebp
movb 0x1(%r13,%rbp), %r15b
incq %rbp
cmpb $0x20, %r15b
ja 0x43de5
movq %r13, %r14
addq %rbp, %r14
movq 0x88(%r12), %rbx
testq %rbx, %rbx
je 0x43eee
movl $0x4, %edx
movq %r13, %rdi
leaq 0xe9cf(%rip), %rsi      # 0x527e8
callq 0x3080
testl %eax, %eax
je 0x43eee
movb (%r13), %al
movq %r13, %rcx
testq %rbp, %rbp
movq %r14, 0x20(%rsp)
jle 0x43e4e
testb %al, %al
je 0x43e91
movzbl %al, %eax
cmpl $0x3a, %eax
je 0x43e52
movb 0x1(%rcx), %al
incq %rcx
cmpq %r14, %rcx
jb 0x43e37
cmpb $0x3a, %al
jne 0x43e91
movq %rcx, 0x8(%rsp)
movq %rcx, %r14
subq %r13, %r14
leaq 0x18(%rbx), %r12
movq %r12, %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x3080
testl %eax, %eax
jne 0x43e7a
cmpb $0x0, (%r12,%r14)
je 0x43e82
movq (%rbx), %rbx
testq %rbx, %rbx
jne 0x43e5d
movq 0x8(%rsp), %rdx
incq %rdx
movq 0x10(%rsp), %r12
jmp 0x43ea2
cmpb $0x0, 0x18(%rbx)
je 0x43e9f
movq (%rbx), %rbx
testq %rbx, %rbx
jne 0x43e91
movq %r13, %rdx
testq %rbx, %rbx
je 0x43f58
movswq 0xc(%rbx), %rax
testq %rax, %rax
js 0x43f0e
movq 0x80(%r12), %rcx
testq %rcx, %rcx
je 0x43f0e
movq %rdx, 0x8(%rsp)
shlq $0x5, %rax
movq (%rcx,%rax), %r14
testq %r14, %r14
je 0x43f95
movq %r14, %rdi
callq 0x3110
movq %r12, %rdi
movq %r14, %rsi
movq %rax, %rdx
jmp 0x43f90
movq %r12, %rdi
movq %r13, %rsi
movq %rbp, %rdx
callq 0x38fa7
jmp 0x43fc4
movl $0x2, %r15d
xorl %ebx, %ebx
jmp 0x43fe8
cmpq $0x0, 0x10(%rbx)
je 0x43f6d
movq %rdx, 0x8(%rsp)
movl $0x1, %edx
movq %r12, %rdi
leaq 0xe8c5(%rip), %r15      # 0x527ee
movq %r15, %rsi
callq 0x38fa7
movq 0x10(%rbx), %r14
movq %r14, %rdi
callq 0x3110
movq %r12, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x38fa7
movl $0x1, %edx
movq %r12, %rdi
movq %r15, %rsi
jmp 0x43f90
movq %rdx, 0x8(%rsp)
testb %r15b, %r15b
je 0x43f81
movq %r12, %rdi
movq %r13, %rsi
movq %rbp, %rdx
jmp 0x43f90
movl $0x9, 0x19214(%r12)
movl $0x1, %r15d
jmp 0x43f07
movl $0x2, %edx
movq %r12, %rdi
leaq 0xe85d(%rip), %rsi      # 0x527ed
callq 0x38fa7
movl $0x1, %edx
movq %r12, %rdi
leaq 0xd498(%rip), %rsi      # 0x5143c
callq 0x38fa7
movq %r13, %rdx
movq 0x8(%rsp), %rsi
subq %rsi, %rdx
addq %rbp, %rdx
movq %r12, %rdi
callq 0x38fa7
movq 0x20(%rsp), %r14
xorl %r15d, %r15d
movb $0x1, %bl
cmpb $0x0, (%r13,%rbp)
je 0x43fe5
movl $0x1, %edx
movq %r12, %rdi
leaq 0xe93d(%rip), %rsi      # 0x5291d
callq 0x38fa7
movq %r14, %r13
movq %r13, %r14
testl %r15d, %r15d
je 0x43dca
cmpl $0x2, %r15d
jne 0x4402f
leaq 0xe160(%rip), %rsi      # 0x52161
movl $0x1, %edx
movq %r12, %rdi
callq 0x38fa7
movq 0x6120(%r12), %rsi
movq %r12, %rdi
callq 0x3a567
movq 0x18(%rsp), %rcx
movq %rax, (%rcx)
movl $0x9, %eax
movb $0x1, %bl
jmp 0x44034
movl $0x9, %eax
testb %bl, %bl
je 0x44043
movq 0x10(%rsp), %rax
movl 0x19214(%rax), %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq