// File: /workspace/github_c_makefile_star2_O1/loversmile[P]sugarcrm/sugar_stdsoap2.c
// Function: soap_string_out
SOAP_FMAC2
soap_string_out(struct soap *soap, const char *s, int flag)
{ register const char *t;
  register soap_wchar c;
  register soap_wchar mask = (soap_wchar)0xFFFFFF80UL;
#ifdef WITH_DOM
  if ((soap->mode & SOAP_XML_DOM) && soap->dom)
  { soap->dom->data = soap_strdup(soap, s);
    return SOAP_OK;
  }
#endif
  if (soap->mode & SOAP_C_UTFSTRING)
    mask = 0;
  t = s;
  while ((c = *t++))
  { switch (c)
    { 
    case 0x09:
      if (flag)
      { if (soap_send_raw(soap, s, t - s - 1) || soap_send_raw(soap, "&#x9;", 5))
          return soap->error;
        s = t;
      }
      break;
    case 0x0A:
      if (flag || !(soap->mode & SOAP_XML_CANONICAL))
      { if (soap_send_raw(soap, s, t - s - 1) || soap_send_raw(soap, "&#xA;", 5))
          return soap->error;
        s = t;
      }
      break;
    case 0x0D:
      if (soap_send_raw(soap, s, t - s - 1) || soap_send_raw(soap, "&#xD;", 5))
        return soap->error;
      s = t;
      break;
    case '&':
      if (soap_send_raw(soap, s, t - s - 1) || soap_send_raw(soap, "&amp;", 5))
        return soap->error;
      s = t;
      break;
    case '<':
      if (soap_send_raw(soap, s, t - s - 1) || soap_send_raw(soap, "&lt;", 4))
        return soap->error;
      s = t;
      break;
    case '>':
      if (!flag)
      { if (soap_send_raw(soap, s, t - s - 1) || soap_send_raw(soap, "&gt;", 4))
          return soap->error;
        s = t;
      }
      break;
    case '"':
      if (flag)
      { if (soap_send_raw(soap, s, t - s - 1) || soap_send_raw(soap, "&quot;", 6))
          return soap->error;
        s = t;
      }
      break;
    default:
#ifndef WITH_LEANER
#ifdef HAVE_MBTOWC
      if (soap->mode & SOAP_C_MBSTRING)
      { wchar_t wc;
        register int m = mbtowc(&wc, t - 1, MB_CUR_MAX);
        if (m > 0 && wc != c)
        { if (soap_send_raw(soap, s, t - s - 1) || soap_pututf8(soap, wc))
            return soap->error;
          s = t += m - 1;
          continue;
        }
      }
#endif
#endif
#ifndef WITH_NOSTRINGTOUTF8
      if ((c & mask) || !(c & 0xFFFFFFE0UL))
      { if (soap_send_raw(soap, s, t - s - 1) || soap_pututf8(soap, (unsigned char)c))
          return soap->error;
        s = t;
      }
#endif
    }
  }
  return soap_send_raw(soap, s, t - s - 1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movl 0x4(%rdi), %r15d
leaq 0x1(%rsi), %r12
shrl $0x15, %r15d
movzbl -0x1(%r12), %r13d
cmpl $0x21, %r13d
jle 0x429e1
cmpl $0x3b, %r13d
jg 0x42a29
cmpl $0x22, %r13d
je 0x42ad5
cmpl $0x26, %r13d
jne 0x42b3d
movq %r14, %rdx
subq %rsi, %rdx
movq %rbx, %rdi
callq 0x376e8
testl %eax, %eax
jne 0x42b74
movl $0x5, %edx
movq %rbx, %rdi
leaq 0xfd32(%rip), %rsi      # 0x5270e
jmp 0x42b21
cmpl $0x9, %r13d
jle 0x42a6f
cmpl $0xa, %r13d
je 0x42aa4
cmpl $0xd, %r13d
jne 0x42b3d
movq %r14, %rdx
subq %rsi, %rdx
movq %rbx, %rdi
callq 0x376e8
testl %eax, %eax
jne 0x42b74
movl $0x5, %edx
movq %rbx, %rdi
leaq 0xfce4(%rip), %rsi      # 0x52708
jmp 0x42b21
cmpl $0x3c, %r13d
je 0x42b00
cmpl $0x3e, %r13d
jne 0x42b3d
testl %ebp, %ebp
jne 0x42b2d
movq %r14, %rdx
subq %rsi, %rdx
movq %rbx, %rdi
callq 0x376e8
testl %eax, %eax
jne 0x42b74
movl $0x4, %edx
movq %rbx, %rdi
leaq 0xfcaf(%rip), %rsi      # 0x52719
jmp 0x42b21
jne 0x42b38
testl %ebp, %ebp
je 0x42b2d
movq %r14, %rdx
subq %rsi, %rdx
movq %rbx, %rdi
callq 0x376e8
testl %eax, %eax
jne 0x42b74
movl $0x5, %edx
movq %rbx, %rdi
leaq 0xfc5a(%rip), %rsi      # 0x526fc
jmp 0x42b21
testl %ebp, %ebp
jne 0x42aae
testb $0x1, 0x6(%rbx)
jne 0x42b2d
movq %r14, %rdx
subq %rsi, %rdx
movq %rbx, %rdi
callq 0x376e8
testl %eax, %eax
jne 0x42b74
movl $0x5, %edx
movq %rbx, %rdi
leaq 0xfc2f(%rip), %rsi      # 0x52702
jmp 0x42b21
testl %ebp, %ebp
je 0x42b2d
movq %r14, %rdx
subq %rsi, %rdx
movq %rbx, %rdi
callq 0x376e8
testl %eax, %eax
jne 0x42b74
movl $0x6, %edx
movq %rbx, %rdi
leaq 0xfc20(%rip), %rsi      # 0x5271e
jmp 0x42b21
movq %r14, %rdx
subq %rsi, %rdx
movq %rbx, %rdi
callq 0x376e8
testl %eax, %eax
jne 0x42b74
movl $0x4, %edx
movq %rbx, %rdi
leaq 0xfbf3(%rip), %rsi      # 0x52714
callq 0x376e8
movq %r12, %rsi
testl %eax, %eax
jne 0x42b74
incq %r12
incq %r14
jmp 0x4298d
testl %r13d, %r13d
je 0x42b89
movsbq %r13b, %rax
testb %al, %al
setns %cl
orb %r15b, %cl
testl $0xffffffe0, %eax       # imm = 0xFFFFFFE0
setne %al
testb %al, %cl
jne 0x42b2d
movq %r14, %rdx
subq %rsi, %rdx
movq %rbx, %rdi
callq 0x376e8
testl %eax, %eax
jne 0x42b74
movq %rbx, %rdi
movq %r13, %rsi
callq 0x38a46
jmp 0x42b26
movl 0x19214(%rbx), %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
subq %rsi, %r14
movq %rbx, %rdi
movq %r14, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x376e8