// File: /workspace/github_c_makefile_star2_O0/loversmile[P]sugarcrm/sugar_stdsoap2.c
// Function: soap_envelope_begin_out
SOAP_FMAC2
soap_envelope_begin_out(struct soap *soap)
{
#ifndef WITH_LEANER
  size_t n = 0;
  if ((soap->mode & SOAP_ENC_MIME) && soap->mime.boundary && soap->mime.start && strlen(soap->mime.boundary) + strlen(soap->mime.start) < sizeof(soap->tmpbuf) - 80 )
  { const char *s;
    if ((soap->mode & SOAP_ENC_DIME) && !(soap->mode & SOAP_ENC_MTOM))
      s = "application/dime";
    else if (soap->version == 2)
    { if (soap->mode & SOAP_ENC_MTOM)
        s = "application/xop+xml; charset=utf-8; type=\"application/soap+xml\"";
      else
        s = "application/soap+xml; charset=utf-8";
    }
    else if (soap->mode & SOAP_ENC_MTOM)
      s = "application/xop+xml; charset=utf-8; type=\"text/xml\"";
    else
      s = "text/xml; charset=utf-8";
    sprintf(soap->tmpbuf, "--%s\r\nContent-Type: %s\r\nContent-Transfer-Encoding: binary\r\nContent-ID: %s\r\n\r\n", soap->mime.boundary, s, soap->mime.start);
    n = strlen(soap->tmpbuf);
    if (soap_send_raw(soap, soap->tmpbuf, n))
      return soap->error;
  }
  if (soap->mode & SOAP_IO_LENGTH)
    soap->dime.size = soap->count;	/* DIME in MIME correction */
  if (!(soap->mode & SOAP_IO_LENGTH) && (soap->mode & SOAP_ENC_DIME))
  { if (soap_putdimehdr(soap))
      return soap->error;
  }
#endif
  soap->part = SOAP_IN_ENVELOPE;
  return soap_element_begin_out(soap, "SOAP-ENV:Envelope", 0, NULL);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x100, %eax            # imm = 0x100
cmpl $0x0, %eax
je 0x6b023
movq -0x10(%rbp), %rax
cmpq $0x0, 0x19288(%rax)
je 0x6b023
movq -0x10(%rbp), %rax
cmpq $0x0, 0x19290(%rax)
je 0x6b023
movq -0x10(%rbp), %rax
movq 0x19288(%rax), %rdi
callq 0x3100
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq 0x19290(%rax), %rdi
callq 0x3100
movq %rax, %rcx
movq -0x28(%rbp), %rax
addq %rcx, %rax
cmpq $0x3b0, %rax            # imm = 0x3B0
jae 0x6b023
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x80, %eax
cmpl $0x0, %eax
je 0x6af46
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x200, %eax            # imm = 0x200
cmpl $0x0, %eax
jne 0x6af46
leaq 0xfdaf(%rip), %rax      # 0x7acef
movq %rax, -0x20(%rbp)
jmp 0x6afab
movq -0x10(%rbp), %rax
movswl 0x2(%rax), %eax
cmpl $0x2, %eax
jne 0x6af7e
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x200, %eax            # imm = 0x200
cmpl $0x0, %eax
je 0x6af71
leaq 0xfd99(%rip), %rax      # 0x7ad04
movq %rax, -0x20(%rbp)
jmp 0x6af7c
leaq 0xfdcc(%rip), %rax      # 0x7ad44
movq %rax, -0x20(%rbp)
jmp 0x6afa9
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x200, %eax            # imm = 0x200
cmpl $0x0, %eax
je 0x6af9c
leaq 0xfdd2(%rip), %rax      # 0x7ad68
movq %rax, -0x20(%rbp)
jmp 0x6afa7
leaq 0xfdf9(%rip), %rax      # 0x7ad9c
movq %rax, -0x20(%rbp)
jmp 0x6afa9
jmp 0x6afab
movq -0x10(%rbp), %rdi
addq $0x16538, %rdi          # imm = 0x16538
movq -0x10(%rbp), %rax
movq 0x19288(%rax), %rdx
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
movq 0x19290(%rax), %r8
leaq 0xfddd(%rip), %rsi      # 0x7adb4
movb $0x0, %al
callq 0x3370
movq -0x10(%rbp), %rdi
addq $0x16538, %rdi          # imm = 0x16538
callq 0x3100
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x16538, %rsi          # imm = 0x16538
movq -0x18(%rbp), %rdx
callq 0x4eeb0
cmpl $0x0, %eax
je 0x6b021
movq -0x10(%rbp), %rax
movl 0x19214(%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x6b0ad
jmp 0x6b023
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0x6b048
movq -0x10(%rbp), %rax
movq 0x6110(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x19230(%rax)
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x8, %eax
cmpl $0x0, %eax
jne 0x6b087
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x80, %eax
cmpl $0x0, %eax
je 0x6b087
movq -0x10(%rbp), %rdi
callq 0x68b10
cmpl $0x0, %eax
je 0x6b085
movq -0x10(%rbp), %rax
movl 0x19214(%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x6b0ad
jmp 0x6b087
movq -0x10(%rbp), %rax
movw $0x2, 0x18590(%rax)
movq -0x10(%rbp), %rdi
leaq 0xfd63(%rip), %rsi      # 0x7ae02
xorl %edx, %edx
xorl %eax, %eax
movl %eax, %ecx
callq 0x5bbd0
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)