// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x10000, %eax          # imm = 0x10000
cmpl $0x0, %eax
je 0x6076a
movq -0x10(%rbp), %rax
movq 0x18580(%rax), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x606e4
movq -0x20(%rbp), %rax
movswl 0x20(%rax), %eax
cmpl $0x0, %eax
je 0x606d5
movq -0x20(%rbp), %rax
addq $0x22, %rax
cmpq $0x0, %rax
je 0x606d5
movq -0x20(%rbp), %rdi
addq $0x22, %rdi
movl $0x3a, %esi
callq 0x3130
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x606d3
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
addq $0x22, %rsi
movq -0x30(%rbp), %rdx
movq -0x20(%rbp), %rax
addq $0x22, %rax
subq %rax, %rdx
callq 0x60570
jmp 0x606d5
jmp 0x606d7
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0x60674
movq -0x10(%rbp), %rax
movq 0x88(%rax), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x60768
movq -0x28(%rbp), %rax
movswl 0xc(%rax), %eax
cmpl $0x1, %eax
jne 0x60759
movq -0x28(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x60759
movq -0x10(%rbp), %rdi
addq $0x16538, %rdi          # imm = 0x16538
movq -0x28(%rbp), %rdx
addq $0x18, %rdx
leaq 0x1a1e8(%rip), %rsi     # 0x7a914
movb $0x0, %al
callq 0x3370
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x16538, %rsi          # imm = 0x16538
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rdx
callq 0x60c30
movq -0x28(%rbp), %rax
movw $0x2, 0xc(%rax)
jmp 0x6075b
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
jmp 0x606f3
jmp 0x6076a
movq -0x10(%rbp), %rax
movq 0x18580(%rax), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x6094f
movq -0x20(%rbp), %rax
cmpw $0x0, 0x20(%rax)
je 0x6093d
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x8000, %eax           # imm = 0x8000
cmpl $0x0, %eax
je 0x60879
movq -0x20(%rbp), %rdi
addq $0x22, %rdi
movl $0x3a, %esi
callq 0x3130
movq %rax, -0x38(%rbp)
cmpq $0x0, %rax
je 0x60879
movq -0x38(%rbp), %rax
movq -0x20(%rbp), %rcx
addq $0x22, %rcx
subq %rcx, %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x88(%rax)
je 0x60832
movq -0x10(%rbp), %rax
movq 0x88(%rax), %rdi
addq $0x18, %rdi
movq -0x20(%rbp), %rsi
addq $0x22, %rsi
movq -0x40(%rbp), %rdx
callq 0x3080
cmpl $0x0, %eax
jne 0x60832
movq -0x10(%rbp), %rax
movq 0x88(%rax), %rax
movq -0x40(%rbp), %rcx
cmpb $0x0, 0x18(%rax,%rcx)
jne 0x60832
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x6083e
movq -0x20(%rbp), %rax
addq $0x22, %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rdi
leaq 0x1a47b(%rip), %rsi     # 0x7acc4
callq 0x4f310
cmpl $0x0, %eax
jne 0x60865
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x4f310
cmpl $0x0, %eax
je 0x60877
movq -0x10(%rbp), %rax
movl 0x19214(%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x60a0c
jmp 0x608b8
movq -0x10(%rbp), %rdi
leaq 0x1a440(%rip), %rsi     # 0x7acc4
callq 0x4f310
cmpl $0x0, %eax
jne 0x608a4
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
addq $0x22, %rsi
callq 0x4f310
cmpl $0x0, %eax
je 0x608b6
movq -0x10(%rbp), %rax
movl 0x19214(%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x60a0c
jmp 0x608b8
movq -0x20(%rbp), %rax
movswl 0x20(%rax), %eax
cmpl $0x2, %eax
jne 0x60933
movq -0x20(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x60933
movq -0x10(%rbp), %rdi
leaq 0x1a5c7(%rip), %rsi     # 0x7aea2
movl $0x2, %edx
callq 0x4eeb0
cmpl $0x0, %eax
jne 0x6091f
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rsi
movl $0x1, %edx
callq 0x61120
cmpl $0x0, %eax
jne 0x6091f
movq -0x10(%rbp), %rdi
leaq 0x1a285(%rip), %rsi     # 0x7ab95
movl $0x1, %edx
callq 0x4eeb0
cmpl $0x0, %eax
je 0x60931
movq -0x10(%rbp), %rax
movl 0x19214(%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x60a0c
jmp 0x60933
movq -0x20(%rbp), %rax
movw $0x0, 0x20(%rax)
jmp 0x6093f
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0x60779
cmpq $0x0, -0x18(%rbp)
je 0x609f4
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x10000, %eax          # imm = 0x10000
cmpl $0x0, %eax
je 0x609af
movq -0x10(%rbp), %rdi
leaq 0x1a057(%rip), %rsi     # 0x7a9cd
movl $0x1, %edx
callq 0x4eeb0
cmpl $0x0, %eax
jne 0x60997
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x5bcc0
cmpl $0x0, %eax
je 0x609a6
movq -0x10(%rbp), %rax
movl 0x19214(%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x60a0c
movl $0x0, -0x4(%rbp)
jmp 0x60a0c
movq -0x10(%rbp), %rax
movl 0x6108(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x6108(%rax)
movq -0x10(%rbp), %rdi
leaq 0x19fff(%rip), %rsi     # 0x7a9cc
movl $0x2, %edx
callq 0x4eeb0
cmpl $0x0, %eax
je 0x609eb
movq -0x10(%rbp), %rax
movl 0x19214(%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x60a0c
movl $0x0, -0x4(%rbp)
jmp 0x60a0c
movq -0x10(%rbp), %rdi
leaq 0x19fce(%rip), %rsi     # 0x7a9cd
movl $0x1, %edx
callq 0x4eeb0
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)