// File: /workspace/github_c_makefile_star2_O2/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 $0x18, %rsp
movq %rdi, %r13
testq %rsi, %rsi
je 0x3f9b9
movq %r8, %r15
movq %rcx, %r14
movq %rdx, %rbx
movq %rsi, %r12
movq %rsi, %rdi
callq 0x3110
testq %r15, %r15
setns %cl
cmpq %r15, %rax
setg %dl
andb %cl, %dl
cmpq %r14, %rax
setl %al
orb %dl, %al
cmpb $0x1, %al
jne 0x3f78a
movl $0x2d, 0x19214(%r13)
pushq $0x2d
popq %rax
jmp 0x3f9c0
movq %rbx, 0x10(%rsp)
andq $0x0, 0x6130(%r13)
movq %r12, %r14
movq %r13, (%rsp)
movq %r14, %r15
movb (%r14), %r12b
leal -0x1(%r12), %eax
incq %r14
cmpb $0x20, %al
jb 0x3f79e
testb %r12b, %r12b
je 0x3f990
xorl %ebp, %ebp
movb 0x1(%r15,%rbp), %bl
incq %rbp
cmpb $0x20, %bl
ja 0x3f7bb
leaq (%r15,%rbp), %r14
movq 0x88(%r13), %r13
testq %r13, %r13
je 0x3f819
movq %r15, %rdi
leaq 0xe006(%rip), %rsi      # 0x4d7e8
pushq $0x4
popq %rdx
callq 0x3080
testl %eax, %eax
je 0x3f819
movq %r14, 0x8(%rsp)
xorl %r14d, %r14d
leaq (%r15,%r14), %rax
cmpq 0x8(%rsp), %rax
jae 0x3f830
testb %r12b, %r12b
je 0x3f860
movzbl %r12b, %eax
cmpl $0x3a, %eax
je 0x3f836
movb 0x1(%r15,%r14), %r12b
incq %r14
jmp 0x3f7f6
movq (%rsp), %r13
movq %r13, %rdi
movq %r15, %rsi
movq %rbp, %rdx
callq 0x35e4f
jmp 0x3f968
cmpb $0x3a, %r12b
jne 0x3f860
testq %r13, %r13
je 0x3f871
leaq 0x18(%r13), %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x3080
testl %eax, %eax
jne 0x3f856
cmpb $0x0, 0x18(%r13,%r14)
je 0x3f8a1
movq (%r13), %r13
jmp 0x3f836
movq (%r13), %r13
testq %r13, %r13
je 0x3f879
cmpb $0x0, 0x18(%r13)
jne 0x3f85c
movq %r15, %r14
jmp 0x3f8a7
addq %r15, %r14
incq %r14
jmp 0x3f87c
movq %r15, %r14
testb %bl, %bl
movq (%rsp), %r13
movq %r13, %rdi
je 0x3f892
movq %r15, %rsi
movq %rbp, %rdx
jmp 0x3f938
leaq 0xdf54(%rip), %rsi      # 0x4d7ed
pushq $0x2
popq %rdx
jmp 0x3f938
addq %r15, %r14
incq %r14
movswq 0xc(%r13), %rax
testq %rax, %rax
js 0x3f8e9
movq (%rsp), %rcx
movq 0x80(%rcx), %rcx
testq %rcx, %rcx
je 0x3f8e9
shlq $0x5, %rax
movq (%rcx,%rax), %r13
testq %r13, %r13
je 0x3f98a
movq %r13, %rdi
callq 0x3110
movq (%rsp), %rdi
movq %r13, %rsi
movq %rdi, %r13
movq %rax, %rdx
jmp 0x3f938
cmpq $0x0, 0x10(%r13)
je 0x3f9cf
movq (%rsp), %rbx
movq %rbx, %rdi
leaq 0xdeec(%rip), %rsi      # 0x4d7ee
pushq $0x1
popq %r12
movq %r12, %rdx
callq 0x35e4f
movq 0x10(%r13), %r13
movq %r13, %rdi
callq 0x3110
movq %rbx, %rdi
movq %r13, %rsi
movq %rbx, %r13
movq %rax, %rdx
callq 0x35e4f
movq %rbx, %rdi
leaq 0xdeb9(%rip), %rsi      # 0x4d7ee
movq %r12, %rdx
callq 0x35e4f
movq %r13, %rdi
leaq 0xcaf5(%rip), %rsi      # 0x4c43c
pushq $0x1
popq %rdx
callq 0x35e4f
movq %r15, %rdx
subq %r14, %rdx
addq %rbp, %rdx
movq %r13, %rdi
movq %r14, %rsi
callq 0x35e4f
movq 0x8(%rsp), %r14
cmpb $0x0, (%r15,%rbp)
je 0x3f79e
movq %r13, %rdi
leaq 0xdfa0(%rip), %rsi      # 0x4d91d
pushq $0x1
popq %rdx
callq 0x35e4f
jmp 0x3f79e
movq (%rsp), %r13
jmp 0x3f93d
leaq 0xd7ca(%rip), %rsi      # 0x4d161
pushq $0x1
popq %rdx
movq %r13, %rdi
callq 0x35e4f
movq 0x6120(%r13), %rsi
movq %r13, %rdi
callq 0x37284
movq 0x10(%rsp), %rcx
movq %rax, (%rcx)
movl 0x19214(%r13), %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%rsp), %rax
movl $0x9, 0x19214(%rax)
pushq $0x9
jmp 0x3f784