// File: /workspace/github_c_makefile_star2_O3/hkshenSmart[P]ONVIF-discovery_cs/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 (flag == 2 || 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 && !((soap_wchar)wc == c && m == 1 && c < 0x80))
        { 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 %rdi, %rbx
cmpl $0x2, %edx
je 0x1b986
movl $0xffffff80, %r13d      # imm = 0xFFFFFF80
testb $0x20, 0x6(%rbx)
je 0x1b989
xorl %r13d, %r13d
leaq 0x1(%rsi), %r15
movq %rsi, %r14
movzbl -0x1(%r15), %r12d
cmpl $0x21, %r12d
jle 0x1b9e3
cmpl $0x3b, %r12d
jg 0x1ba2b
cmpl $0x22, %r12d
je 0x1bad7
cmpl $0x26, %r12d
jne 0x1bb3b
movq %r14, %rdx
subq %rsi, %rdx
movq %rbx, %rdi
callq 0x102b0
testl %eax, %eax
jne 0x1bb68
movl $0x5, %edx
movq %rbx, %rdi
leaq 0xabea(%rip), %rsi      # 0x265c8
jmp 0x1bb1f
cmpl $0x9, %r12d
jle 0x1ba71
cmpl $0xa, %r12d
je 0x1baa6
cmpl $0xd, %r12d
jne 0x1bb3b
movq %r14, %rdx
subq %rsi, %rdx
movq %rbx, %rdi
callq 0x102b0
testl %eax, %eax
jne 0x1bb68
movl $0x5, %edx
movq %rbx, %rdi
leaq 0xab9c(%rip), %rsi      # 0x265c2
jmp 0x1bb1f
cmpl $0x3c, %r12d
je 0x1bafe
cmpl $0x3e, %r12d
jne 0x1bb3b
testl %ebp, %ebp
jne 0x1bb2b
movq %r14, %rdx
subq %rsi, %rdx
movq %rbx, %rdi
callq 0x102b0
testl %eax, %eax
jne 0x1bb68
movl $0x4, %edx
movq %rbx, %rdi
leaq 0xab67(%rip), %rsi      # 0x265d3
jmp 0x1bb1f
jne 0x1bb36
testl %ebp, %ebp
je 0x1bb2b
movq %r14, %rdx
subq %rsi, %rdx
movq %rbx, %rdi
callq 0x102b0
testl %eax, %eax
jne 0x1bb68
movl $0x5, %edx
movq %rbx, %rdi
leaq 0xab12(%rip), %rsi      # 0x265b6
jmp 0x1bb1f
testl %ebp, %ebp
jne 0x1bab0
testb $0x1, 0x6(%rbx)
jne 0x1bb2b
movq %r14, %rdx
subq %rsi, %rdx
movq %rbx, %rdi
callq 0x102b0
testl %eax, %eax
jne 0x1bb68
movl $0x5, %edx
movq %rbx, %rdi
leaq 0xaae7(%rip), %rsi      # 0x265bc
jmp 0x1bb1f
testl %ebp, %ebp
je 0x1bb2b
movq %r14, %rdx
subq %rsi, %rdx
movq %rbx, %rdi
callq 0x102b0
testl %eax, %eax
jne 0x1bb68
movl $0x6, %edx
movq %rbx, %rdi
leaq 0xaadc(%rip), %rsi      # 0x265d8
jmp 0x1bb1f
movq %r14, %rdx
subq %rsi, %rdx
movq %rbx, %rdi
callq 0x102b0
testl %eax, %eax
jne 0x1bb68
movl $0x4, %edx
movq %rbx, %rdi
leaq 0xaaaf(%rip), %rsi      # 0x265ce
callq 0x102b0
movq %r15, %rsi
testl %eax, %eax
jne 0x1bb68
incq %r15
incq %r14
jmp 0x1b990
testl %r12d, %r12d
je 0x1bb7d
movsbl %r12b, %eax
testl %eax, %r13d
jne 0x1bb49
andl $-0x20, %eax
jne 0x1bb2b
movq %r14, %rdx
subq %rsi, %rdx
movq %rbx, %rdi
callq 0x102b0
testl %eax, %eax
jne 0x1bb68
movq %rbx, %rdi
movq %r12, %rsi
callq 0x11694
jmp 0x1bb24
movl 0x1f274(%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 0x102b0