// File: /workspace/github_c_makefile_star2_O3/hkshenSmart[P]ONVIF-discovery_cs/stdsoap2.c
// Function: soap_copy_stream
SOAP_FMAC2
soap_copy_stream(struct soap *copy, struct soap *soap)
{ struct soap_attribute *tp = NULL, *tq;
  if (copy == soap)
    return;
  copy->mode = soap->mode;
  copy->imode = soap->imode;
  copy->omode = soap->omode;
  copy->socket = soap->socket;
  copy->recv_timeout = soap->recv_timeout;
  copy->send_timeout = soap->send_timeout;
#if defined(__cplusplus) && !defined(WITH_LEAN)
  copy->os = soap->os;
  copy->is = soap->is;
#endif
  copy->sendfd = soap->sendfd;
  copy->recvfd = soap->recvfd;
  copy->bufidx = soap->bufidx;
  copy->buflen = soap->buflen;
  copy->ahead = soap->ahead;
  copy->cdata = soap->cdata;
  copy->chunksize = soap->chunksize;
  copy->chunkbuflen = soap->chunkbuflen;
  copy->keep_alive = soap->keep_alive;
  copy->tcp_keep_alive = soap->tcp_keep_alive;
  copy->tcp_keep_idle = soap->tcp_keep_idle;
  copy->tcp_keep_intvl = soap->tcp_keep_intvl;
  copy->tcp_keep_cnt = soap->tcp_keep_cnt;
  copy->max_keep_alive = soap->max_keep_alive;
#ifndef WITH_NOIO
  copy->peer = soap->peer;
  copy->peerlen = soap->peerlen;
#endif
#ifdef WITH_OPENSSL
  copy->bio = NULL;
  copy->ctx = NULL;
  copy->ssl = NULL;
  if (soap->ssl)
    copy->ssl = SSL_dup(soap->ssl);
#endif
#ifdef WITH_GNUTLS
  copy->session = soap->session; /* TODO: Oops, GNUTLS provides a dup? */
#endif
#ifdef WITH_ZLIB
  copy->zlib_state = soap->zlib_state;
  copy->zlib_in = soap->zlib_in;
  copy->zlib_out = soap->zlib_out;
  copy->d_stream = (z_stream*)SOAP_MALLOC(copy, sizeof(z_stream));
  memcpy(copy->d_stream, soap->d_stream, sizeof(z_stream));
  copy->z_crc = soap->z_crc;
  copy->z_ratio_in = soap->z_ratio_in;
  copy->z_ratio_out = soap->z_ratio_out;
  copy->z_buf = NULL;
  copy->z_buflen = soap->z_buflen;
  copy->z_level = soap->z_level;
  if (soap->z_buf && soap->zlib_state != SOAP_ZLIB_NONE)
  { copy->z_buf = (char*)SOAP_MALLOC(copy, SOAP_BUFLEN);
    memcpy(copy->z_buf, soap->z_buf, sizeof(soap->z_buf));
  }
  copy->z_dict = soap->z_dict;
  copy->z_dict_len = soap->z_dict_len;
#endif
  memcpy(copy->buf, soap->buf, sizeof(soap->buf));
  /* copy XML parser state */
  soap_free_ns(copy);
  soap_set_local_namespaces(copy);
  if (soap->nlist && soap->local_namespaces)
  { register struct soap_nlist *np = NULL, *nq;
    /* copy reversed nlist */
    for (nq = soap->nlist; nq; nq = nq->next)
    { register struct soap_nlist *nr = np;
      size_t n = sizeof(struct soap_nlist) + strlen(nq->id);
      np = (struct soap_nlist*)SOAP_MALLOC(copy, n);
      if (!np)
        break;
      memcpy(np, nq, n);
      np->next = nr;
    }
    while (np)
    { register const char *s = np->ns;
      copy->level = np->level; /* preserve element nesting level */
      if (!s && np->index >= 0)
      { s = soap->local_namespaces[np->index].out;
        if (!s)
          s = soap->local_namespaces[np->index].ns;
      }
      if (s && soap_push_namespace(copy, np->id, s) == NULL)
        break;
      nq = np;
      np = np->next;
      SOAP_FREE(copy, nq);
    }
  }
  copy->level = soap->level;
  copy->body = soap->body;
  copy->peeked = soap->peeked;
  memcpy(copy->tag, soap->tag, sizeof(copy->tag));
  /* copy attributes */
  for (tq = soap->attributes; tq; tq = tq->next)
  { struct soap_attribute *tr = tp;
    size_t n = sizeof(struct soap_attribute) + strlen(tq->name);
    tp = (struct soap_attribute*)SOAP_MALLOC(copy, n);
    memcpy(tp, tq, n);
    if (tp->size)
    { tp->value = (char*)SOAP_MALLOC(copy, tp->size);
      if (tp->value)
        strcpy(tp->value, tq->value);
    }
    tp->ns = NULL;
    tp->next = tr;
  }
  copy->attributes = tp;
}

// Assembly:
cmpq %rsi, %rdi
je 0x1a392
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x4(%rsi), %rax
movq %rax, 0x4(%rdi)
movl 0xc(%rsi), %eax
movl %eax, 0xc(%rdi)
movl 0xc134(%rsi), %eax
movl %eax, 0xc134(%rdi)
movq 0x50(%rsi), %rax
movq %rax, 0x50(%rdi)
movq 0xc148(%rsi), %rax
movq %rax, 0xc148(%rdi)
movups 0xc150(%rsi), %xmm0
movups %xmm0, 0xc150(%rdi)
movl 0xc160(%rsi), %eax
movl %eax, 0xc160(%rdi)
movzwl 0xc164(%rsi), %eax
movw %ax, 0xc164(%rdi)
movups 0x1e5f8(%rsi), %xmm0
movups %xmm0, 0x1e5f8(%rdi)
movl 0x1f22c(%rsi), %eax
movl %eax, 0x1f22c(%rdi)
movups 0x1f230(%rsi), %xmm0
movups %xmm0, 0x1f230(%rdi)
movups 0x27384(%rsi), %xmm0
movups %xmm0, 0x27384(%rdi)
movq 0x27398(%rsi), %rax
movq %rax, 0x27398(%rdi)
movl $0xc198, %esi           # imm = 0xC198
addq %rsi, %rdi
addq %r14, %rsi
movl $0x10000, %edx          # imm = 0x10000
callq 0x3220
movq 0x88(%rbx), %rdi
testq %rdi, %rdi
je 0x1a1f6
movq (%rdi), %r15
callq 0x3030
movq %r15, %rdi
testq %r15, %r15
jne 0x1a1e6
movq $0x0, 0x88(%rbx)
movq %rbx, %rdi
callq 0x17f7b
movq 0x88(%r14), %r12
testq %r12, %r12
je 0x1a2d1
cmpq $0x0, 0x80(%r14)
je 0x1a2d1
xorl %ebp, %ebp
leaq 0x18(%r12), %rdi
callq 0x3110
movq %rax, %r13
addq $0x20, %r13
movq %r13, %rdi
callq 0x3240
testq %rax, %rax
je 0x1a2d1
movq %rax, %r15
movq %rax, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x3220
movq %rbp, (%r15)
movq (%r12), %r12
movq %r15, %rbp
testq %r12, %r12
jne 0x1a229
jmp 0x1a29a
movswq 0xc(%r15), %rax
testq %rax, %rax
js 0x1a2be
movq 0x80(%r14), %rcx
shlq $0x5, %rax
movq 0x18(%rcx,%rax), %rdx
testq %rdx, %rdx
jne 0x1a2ad
addq %rax, %rcx
movq 0x8(%rcx), %rdx
testq %rdx, %rdx
jne 0x1a2ad
jmp 0x1a2be
movq 0x10(%r15), %rdx
movl 0x8(%r15), %eax
movl %eax, 0xc168(%rbx)
testq %rdx, %rdx
je 0x1a26d
leaq 0x18(%r15), %rsi
movq %rbx, %rdi
callq 0x13d51
testq %rax, %rax
je 0x1a2d1
movq (%r15), %r12
movq %r15, %rdi
callq 0x3030
movq %r12, %r15
testq %r12, %r12
jne 0x1a29a
movl 0xc168(%r14), %eax
movl %eax, 0xc168(%rbx)
movzwl 0xc166(%r14), %eax
movw %ax, 0xc166(%rbx)
movzwl 0x1e5f6(%r14), %eax
movw %ax, 0x1e5f6(%rbx)
movl $0x1c998, %esi          # imm = 0x1C998
leaq (%rbx,%rsi), %rdi
addq %r14, %rsi
movl $0x400, %edx            # imm = 0x400
callq 0x3220
movq 0x1e5e0(%r14), %r14
xorl %r15d, %r15d
testq %r14, %r14
je 0x1a37d
movq %r15, %r13
leaq 0x2a(%r14), %rdi
callq 0x3110
leaq 0x30(%rax), %r12
movq %r12, %rdi
callq 0x3240
movq %rax, %r15
movq %rax, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x3220
movq 0x18(%r15), %rdi
testq %rdi, %rdi
je 0x1a36d
callq 0x3240
movq %rax, 0x10(%r15)
testq %rax, %rax
je 0x1a36d
movq 0x10(%r14), %rsi
movq %rax, %rdi
callq 0x3080
movq $0x0, 0x20(%r15)
movq %r13, (%r15)
movq (%r14), %r14
jmp 0x1a31c
movq %r15, 0x1e5e0(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq