// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x8(%rbp), %rax
cmpq -0x10(%rbp), %rax
jne 0x27527
jmp 0x279b5
movq -0x10(%rbp), %rax
movl 0x4(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x10(%rbp), %rax
movl 0x8(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x10(%rbp), %rax
movl 0xc(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0xc(%rax)
movq -0x10(%rbp), %rax
movl 0xc134(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0xc134(%rax)
movq -0x10(%rbp), %rax
movl 0x50(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x50(%rax)
movq -0x10(%rbp), %rax
movl 0x54(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x54(%rax)
movq -0x10(%rbp), %rax
movl 0xc148(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0xc148(%rax)
movq -0x10(%rbp), %rax
movl 0xc14c(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0xc14c(%rax)
movq -0x10(%rbp), %rax
movq 0xc150(%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0xc150(%rax)
movq -0x10(%rbp), %rax
movq 0xc158(%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0xc158(%rax)
movq -0x10(%rbp), %rax
movl 0xc160(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0xc160(%rax)
movq -0x10(%rbp), %rax
movw 0xc164(%rax), %cx
movq -0x8(%rbp), %rax
movw %cx, 0xc164(%rax)
movq -0x10(%rbp), %rax
movq 0x1e5f8(%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x1e5f8(%rax)
movq -0x10(%rbp), %rax
movq 0x1e600(%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x1e600(%rax)
movq -0x10(%rbp), %rax
movw 0x1f22c(%rax), %cx
movq -0x8(%rbp), %rax
movw %cx, 0x1f22c(%rax)
movq -0x10(%rbp), %rax
movw 0x1f22e(%rax), %cx
movq -0x8(%rbp), %rax
movw %cx, 0x1f22e(%rax)
movq -0x10(%rbp), %rax
movl 0x1f230(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x1f230(%rax)
movq -0x10(%rbp), %rax
movl 0x1f234(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x1f234(%rax)
movq -0x10(%rbp), %rax
movl 0x1f238(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x1f238(%rax)
movq -0x10(%rbp), %rax
movl 0x1f23c(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x1f23c(%rax)
movq -0x8(%rbp), %rax
movq -0x10(%rbp), %rcx
movq 0x27384(%rcx), %rdx
movq %rdx, 0x27384(%rax)
movq 0x2738c(%rcx), %rcx
movq %rcx, 0x2738c(%rax)
movq -0x10(%rbp), %rax
movq 0x27398(%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x27398(%rax)
movq -0x8(%rbp), %rdi
addq $0xc198, %rdi           # imm = 0xC198
movq -0x10(%rbp), %rsi
addq $0xc198, %rsi           # imm = 0xC198
movl $0x10000, %edx          # imm = 0x10000
callq 0x3230
movq -0x8(%rbp), %rdi
callq 0x239b0
movq -0x8(%rbp), %rdi
callq 0x23c20
movq -0x10(%rbp), %rax
cmpq $0x0, 0x88(%rax)
je 0x27885
movq -0x10(%rbp), %rax
cmpq $0x0, 0x80(%rax)
je 0x27885
movq $0x0, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq 0x88(%rax), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x277b1
movq -0x28(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rdi
addq $0x18, %rdi
callq 0x3100
addq $0x20, %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
callq 0x3250
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x27788
jmp 0x277b1
movq -0x28(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x40(%rbp), %rdx
callq 0x3230
movq -0x38(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0x2774e
jmp 0x277b3
cmpq $0x0, -0x28(%rbp)
je 0x27883
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x28(%rbp), %rax
movl 0x8(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0xc168(%rax)
cmpq $0x0, -0x48(%rbp)
jne 0x2783e
movq -0x28(%rbp), %rax
movswl 0xc(%rax), %eax
cmpl $0x0, %eax
jl 0x2783e
movq -0x10(%rbp), %rax
movq 0x80(%rax), %rax
movq -0x28(%rbp), %rcx
movswq 0xc(%rcx), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rax
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
jne 0x2783c
movq -0x10(%rbp), %rax
movq 0x80(%rax), %rax
movq -0x28(%rbp), %rcx
movswq 0xc(%rcx), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq %rax, -0x48(%rbp)
jmp 0x2783e
cmpq $0x0, -0x48(%rbp)
je 0x27862
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
addq $0x18, %rsi
movq -0x48(%rbp), %rdx
callq 0x1ce90
cmpq $0x0, %rax
jne 0x27862
jmp 0x27883
movq -0x28(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x30(%rbp), %rdi
callq 0x3030
jmp 0x277b3
jmp 0x27885
movq -0x10(%rbp), %rax
movl 0xc168(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0xc168(%rax)
movq -0x10(%rbp), %rax
movw 0xc166(%rax), %cx
movq -0x8(%rbp), %rax
movw %cx, 0xc166(%rax)
movq -0x10(%rbp), %rax
movw 0x1e5f6(%rax), %cx
movq -0x8(%rbp), %rax
movw %cx, 0x1e5f6(%rax)
movq -0x8(%rbp), %rdi
addq $0x1c998, %rdi          # imm = 0x1C998
movq -0x10(%rbp), %rsi
addq $0x1c998, %rsi          # imm = 0x1C998
movl $0x400, %edx            # imm = 0x400
callq 0x3230
movq -0x10(%rbp), %rax
movq 0x1e5e0(%rax), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x279a6
movq -0x18(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x20(%rbp), %rdi
addq $0x2a, %rdi
callq 0x3100
addq $0x30, %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rdi
callq 0x3250
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x58(%rbp), %rdx
callq 0x3230
movq -0x18(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x2797f
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x3250
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x2797d
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rsi
callq 0x3080
jmp 0x2797f
movq -0x18(%rbp), %rax
movq $0x0, 0x20(%rax)
movq -0x50(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0x278f4
movq -0x18(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x1e5e0(%rax)
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax,%rax)