// File: /workspace/github_c_makefile_star2_O1/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 0x1a8f7
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movl 0x4(%rsi), %eax
movl %eax, 0x4(%rdi)
movl 0x8(%rsi), %eax
movl %eax, 0x8(%rdi)
movl 0xc(%rsi), %eax
movl %eax, 0xc(%rdi)
movl 0xc134(%rsi), %eax
movl %eax, 0xc134(%rdi)
movl 0x50(%rsi), %eax
movl %eax, 0x50(%rdi)
movl 0x54(%rsi), %eax
movl %eax, 0x54(%rdi)
movl 0xc148(%rsi), %eax
movl %eax, 0xc148(%rdi)
movl 0xc14c(%rsi), %eax
movl %eax, 0xc14c(%rdi)
movq 0xc150(%rsi), %rax
movq %rax, 0xc150(%rdi)
movq 0xc158(%rsi), %rax
movq %rax, 0xc158(%rdi)
movl 0xc160(%rsi), %eax
movl %eax, 0xc160(%rdi)
movzwl 0xc164(%rsi), %eax
movw %ax, 0xc164(%rdi)
movq 0x1e5f8(%rsi), %rax
movq %rax, 0x1e5f8(%rdi)
movq 0x1e600(%rsi), %rax
movq %rax, 0x1e600(%rdi)
movzwl 0x1f22c(%rsi), %eax
movw %ax, 0x1f22c(%rdi)
movzwl 0x1f22e(%rsi), %eax
movw %ax, 0x1f22e(%rdi)
movl 0x1f230(%rsi), %eax
movl %eax, 0x1f230(%rdi)
movl 0x1f234(%rsi), %eax
movl %eax, 0x1f234(%rdi)
movl 0x1f238(%rsi), %eax
movl %eax, 0x1f238(%rdi)
movl 0x1f23c(%rsi), %eax
movl %eax, 0x1f23c(%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 0x1a74b
movq (%rdi), %r15
callq 0x3030
movq %r15, %rdi
testq %r15, %r15
jne 0x1a73b
movq $0x0, 0x88(%rbx)
movq %rbx, %rdi
callq 0x182ba
movq 0x88(%r14), %r12
testq %r12, %r12
je 0x1a836
cmpq $0x0, 0x80(%r14)
je 0x1a836
xorl %ebp, %ebp
leaq 0x18(%r12), %rdi
callq 0x3110
movq %rax, %r13
addq $0x20, %r13
movq %r13, %rdi
callq 0x3240
movq %rax, %r15
testq %rax, %rax
je 0x1a831
movq %r15, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x3220
movq %rbp, (%r15)
movq (%r12), %r12
movq %r15, %rbp
testq %r12, %r12
jne 0x1a77e
jmp 0x1a831
movq 0x10(%r15), %rdx
movl 0x8(%r15), %eax
movl %eax, 0xc168(%rbx)
testq %rdx, %rdx
je 0x1a7fd
testq %rdx, %rdx
je 0x1a7eb
leaq 0x18(%r15), %rsi
movq %rbx, %rdi
callq 0x13f4e
testq %rax, %rax
je 0x1a825
movq (%r15), %r12
movq %r15, %rdi
callq 0x3030
movb $0x1, %al
movq %r12, %r15
jmp 0x1a827
movswq 0xc(%r15), %rax
testq %rax, %rax
js 0x1a82d
movq 0x80(%r14), %rcx
shlq $0x5, %rax
movq 0x18(%rcx,%rax), %rdx
testq %rdx, %rdx
jne 0x1a7d5
addq %rax, %rcx
movq 0x8(%rcx), %rdx
jmp 0x1a7d5
xorl %eax, %eax
testb %al, %al
jne 0x1a831
jmp 0x1a836
xorl %edx, %edx
jmp 0x1a7d5
testq %r15, %r15
jne 0x1a7c2
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 0x1a8e2
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 0x1a8d2
callq 0x3240
movq %rax, 0x10(%r15)
testq %rax, %rax
je 0x1a8d2
movq 0x10(%r14), %rsi
movq %rax, %rdi
callq 0x3080
movq $0x0, 0x20(%r15)
movq %r13, (%r15)
movq (%r14), %r14
jmp 0x1a881
movq %r15, 0x1e5e0(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq