// File: /workspace/github_c_makefile_star2_O0/loversmile[P]sugarcrm/sugar_stdsoap2.c
// Function: soap_envelope_end_out
SOAP_FMAC2
soap_envelope_end_out(struct soap *soap)
{ if (soap_element_end_out(soap, "SOAP-ENV:Envelope") || ((soap->mode & SOAP_XML_INDENT) && soap_send_raw(soap, "\r\n", 2)))
    return soap->error;
#ifndef WITH_LEANER
  if ((soap->mode & SOAP_IO_LENGTH) && (soap->mode & SOAP_ENC_DIME) && !(soap->mode & SOAP_ENC_MTOM))
  { soap->dime.size = soap->count - soap->dime.size;	/* DIME in MIME correction */
    sprintf(soap->id, soap->dime_id_format, 0);
    soap->dime.id = soap->id;
    if (soap->local_namespaces)
    { if (soap->local_namespaces[0].out)
        soap->dime.type = (char*)soap->local_namespaces[0].out;
      else
        soap->dime.type = (char*)soap->local_namespaces[0].ns;
    }
    soap->dime.options = NULL;
    soap->dime.flags = SOAP_DIME_MB | SOAP_DIME_ABSURI;
    if (!soap->dime.first)
      soap->dime.flags |= SOAP_DIME_ME;
    soap->count += 12 + ((strlen(soap->dime.id)+3)&(~3)) + (soap->dime.type ? ((strlen(soap->dime.type)+3)&(~3)) : 0);
  }
  if ((soap->mode & SOAP_ENC_DIME) && !(soap->mode & SOAP_ENC_MTOM))
    return soap_send_raw(soap, SOAP_STR_PADDING, -(long)soap->dime.size&3);
#endif
  soap->part = SOAP_END_ENVELOPE;
  return SOAP_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
leaq 0xfd2b(%rip), %rsi      # 0x7ae02
callq 0x5bcc0
cmpl $0x0, %eax
jne 0x6b10c
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
je 0x6b11e
movq -0x10(%rbp), %rdi
leaq 0xf7c4(%rip), %rsi      # 0x7a8c1
movl $0x2, %edx
callq 0x4eeb0
cmpl $0x0, %eax
je 0x6b11e
movq -0x10(%rbp), %rax
movl 0x19214(%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x6b311
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0x6b2b3
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x80, %eax
cmpl $0x0, %eax
je 0x6b2b3
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x200, %eax            # imm = 0x200
cmpl $0x0, %eax
jne 0x6b2b3
movq -0x10(%rbp), %rax
movq 0x6110(%rax), %rcx
movq -0x10(%rbp), %rax
subq 0x19230(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x19230(%rax)
movq -0x10(%rbp), %rdi
addq $0x16d38, %rdi          # imm = 0x16D38
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rsi
xorl %edx, %edx
movb $0x0, %al
callq 0x3370
movq -0x10(%rbp), %rcx
addq $0x16d38, %rcx          # imm = 0x16D38
movq -0x10(%rbp), %rax
movq %rcx, 0x19258(%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x80(%rax)
je 0x6b206
movq -0x10(%rbp), %rax
movq 0x80(%rax), %rax
cmpq $0x0, 0x18(%rax)
je 0x6b1ea
movq -0x10(%rbp), %rax
movq 0x80(%rax), %rax
movq 0x18(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x19260(%rax)
jmp 0x6b204
movq -0x10(%rbp), %rax
movq 0x80(%rax), %rax
movq 0x8(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x19260(%rax)
jmp 0x6b206
movq -0x10(%rbp), %rax
movq $0x0, 0x19268(%rax)
movq -0x10(%rbp), %rax
movb $0x24, 0x19248(%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x19278(%rax)
jne 0x6b242
movq -0x10(%rbp), %rax
movsbl 0x19248(%rax), %ecx
orl $0x2, %ecx
movb %cl, 0x19248(%rax)
movq -0x10(%rbp), %rax
movq 0x19258(%rax), %rdi
callq 0x3100
addq $0x3, %rax
andq $-0x4, %rax
addq $0xc, %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x19260(%rax)
je 0x6b28e
movq -0x10(%rbp), %rax
movq 0x19260(%rax), %rdi
callq 0x3100
addq $0x3, %rax
andq $-0x4, %rax
movq %rax, -0x20(%rbp)
jmp 0x6b296
xorl %eax, %eax
movq %rax, -0x20(%rbp)
jmp 0x6b296
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %rax
addq %rax, %rcx
movq -0x10(%rbp), %rax
addq 0x6110(%rax), %rcx
movq %rcx, 0x6110(%rax)
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x80, %eax
cmpl $0x0, %eax
je 0x6b2fd
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x200, %eax            # imm = 0x200
cmpl $0x0, %eax
jne 0x6b2fd
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
xorl %ecx, %ecx
movl %ecx, %edx
subq 0x19230(%rax), %rdx
andq $0x3, %rdx
leaq 0xf18e(%rip), %rsi      # 0x7a481
callq 0x4eeb0
movl %eax, -0x4(%rbp)
jmp 0x6b311
movq -0x10(%rbp), %rax
movw $0x8, 0x18590(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)