// File: /workspace/github_c_makefile_star2_O3/loversmile[P]sugarcrm/sugar_stdsoap2.c
// Function: soap_element_start_end_out
SOAP_FMAC2
soap_element_start_end_out(struct soap *soap, const char *tag)
{ register struct soap_attribute *tp;
#ifndef WITH_LEAN
  if (soap->mode & SOAP_XML_CANONICAL)
  { struct soap_nlist *np;
    for (tp = soap->attributes; tp; tp = tp->next)
    { if (tp->visible && tp->name)
      { const char *s = strchr(tp->name, ':');
        if (s)
          soap_utilize_ns(soap, tp->name, s - tp->name);
      }
    }
    for (np = soap->nlist; np; np = np->next)
    { if (np->index == 1 && np->ns)
      { sprintf(soap->tmpbuf, "xmlns:%s", np->id);
        DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Enabling utilized binding (level=%u) %s='%s'\n", np->level, soap->tmpbuf, np->ns));
        soap_set_attr(soap, soap->tmpbuf, np->ns);
        np->index = 2;
      }
    }
  }
#endif
#ifdef WITH_DOM
  if ((soap->mode & SOAP_XML_DOM) && soap->dom)
  { register struct soap_dom_attribute **att;
    att = &soap->dom->atts;
    for (tp = soap->attributes; tp; tp = tp->next)
    { if (tp->visible)
      { *att = (struct soap_dom_attribute*)soap_malloc(soap, sizeof(struct soap_dom_attribute));
        if (!*att)
          return soap->error;
        (*att)->next = NULL;
        (*att)->nstr = NULL;
        (*att)->name = soap_strdup(soap, tp->name);
        (*att)->data = soap_strdup(soap, tp->value);
        (*att)->wide = NULL;
        (*att)->soap = soap;
        att = &(*att)->next;
        tp->visible = 0;
      }
    }
    return SOAP_OK;
  }
#endif
  for (tp = soap->attributes; tp; tp = tp->next)
  { if (tp->visible)
    { const char *s;
#ifndef WITH_LEAN
      if ((soap->mode & SOAP_XML_DEFAULTNS) && (s = strchr(tp->name, ':')))
      { size_t n = s - tp->name;
        if (soap->nlist && !strncmp(soap->nlist->id, tp->name, n) && !soap->nlist->id[n])
          s++;
        else
          s = tp->name;
        if (soap_send(soap, " ") || soap_send(soap, s))
          return soap->error;
      }
      else
#endif
      if (soap_send(soap, " ") || soap_send(soap, tp->name))
        return soap->error;
      if (tp->visible == 2 && tp->value)
        if (soap_send_raw(soap, "=\"", 2)
         || soap_string_out(soap, tp->value, 1)
         || soap_send_raw(soap, "\"", 1))
          return soap->error;
      tp->visible = 0;
    }
  }
  if (tag)
  { 
#ifndef WITH_LEAN
    if (soap->mode & SOAP_XML_CANONICAL)
    { if (soap_send_raw(soap, ">", 1)
       || soap_element_end_out(soap, tag))
        return soap->error;
      return SOAP_OK;
    }
#endif
    soap->level--;	/* decrement level just before /> */
    if (soap_send_raw(soap, "/>", 2))
      return soap->error;
    return SOAP_OK;
  }
  return soap_send_raw(soap, ">", 1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, (%rsp)
movq %rdi, %rbx
testb $0x1, 0x6(%rdi)
je 0x41f6b
movq 0x18580(%rbx), %r14
testq %r14, %r14
je 0x41f13
cmpw $0x0, 0x20(%r14)
je 0x41f0e
leaq 0x22(%r14), %r15
movq %r15, %rdi
movl $0x3a, %esi
callq 0x3130
testq %rax, %rax
je 0x41f0e
subq %r15, %rax
movq %rbx, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x41e2a
movq (%r14), %r14
jmp 0x41eda
movq 0x88(%rbx), %r14
testq %r14, %r14
je 0x41f6b
leaq 0x16538(%rbx), %r15
leaq 0x10648(%rip), %r12     # 0x52575
cmpw $0x1, 0xc(%r14)
jne 0x41f63
cmpq $0x0, 0x10(%r14)
je 0x41f63
leaq 0x18(%r14), %rdx
movq %r15, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x3360
movq 0x10(%r14), %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x4228b
movw $0x2, 0xc(%r14)
movq (%r14), %r14
testq %r14, %r14
jne 0x41f2d
movq 0x18580(%rbx), %r15
testq %r15, %r15
je 0x420be
leaq 0x1099b(%rip), %r12     # 0x5291d
cmpw $0x0, 0x20(%r15)
je 0x420b2
testb $-0x80, 0x5(%rbx)
je 0x42011
leaq 0x22(%r15), %r13
movq %r13, %rdi
movl $0x3a, %esi
callq 0x3130
testq %rax, %rax
je 0x42011
movq 0x88(%rbx), %r12
testq %r12, %r12
je 0x41fe2
movq %rax, %rbp
movq %rax, %r14
subq %r13, %r14
addq $0x18, %r12
movq %r12, %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x3080
testl %eax, %eax
jne 0x41fe2
cmpb $0x0, (%r12,%r14)
jne 0x41fe2
incq %rbp
movq %rbp, %r13
leaq 0x10934(%rip), %r12     # 0x5291d
movl $0x1, %edx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x379c8
testl %eax, %eax
jne 0x42132
movq %r13, %rdi
callq 0x3110
movq %rbx, %rdi
movq %r13, %rsi
jmp 0x4203b
movl $0x1, %edx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x379c8
testl %eax, %eax
jne 0x42132
leaq 0x22(%r15), %r14
movq %r14, %rdi
callq 0x3110
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x379c8
testl %eax, %eax
jne 0x42132
cmpw $0x2, 0x20(%r15)
jne 0x420ab
cmpq $0x0, 0x8(%r15)
je 0x420ab
movl $0x2, %edx
movq %rbx, %rdi
leaq 0x10a92(%rip), %rsi     # 0x52afb
callq 0x379c8
testl %eax, %eax
jne 0x42132
movq 0x8(%r15), %rsi
movq %rbx, %rdi
movl $0x1, %edx
callq 0x42642
testl %eax, %eax
jne 0x42132
movl $0x1, %edx
movq %rbx, %rdi
leaq 0x10750(%rip), %rsi     # 0x527ee
callq 0x379c8
testl %eax, %eax
jne 0x42132
movw $0x0, 0x20(%r15)
movq (%r15), %r15
testq %r15, %r15
jne 0x41f82
movq (%rsp), %r14
testq %r14, %r14
je 0x420e9
testb $0x1, 0x6(%rbx)
jne 0x4210b
decl 0x6108(%rbx)
leaq 0x10553(%rip), %rsi     # 0x5262d
movl $0x2, %edx
movq %rbx, %rdi
callq 0x379c8
jmp 0x4212e
leaq 0x1053e(%rip), %rsi     # 0x5262e
movl $0x1, %edx
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x379c8
leaq 0x1051c(%rip), %rsi     # 0x5262e
movl $0x1, %edx
movq %rbx, %rdi
callq 0x379c8
testl %eax, %eax
jne 0x42132
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3f6ed
testl %eax, %eax
je 0x42147
movl 0x19214(%rbx), %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
jmp 0x42138