// File: /workspace/github_c_makefile_star2_O0/hkshenSmart[P]ONVIF-discovery_cs/stdsoap2.c
// Function: soap_done
SOAP_FMAC2
soap_done(struct soap *soap)
{
#ifdef SOAP_DEBUG
  int i;
#endif
  if (soap_check_state(soap))
    return;
  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Done with context\n"));
  soap_free_temp(soap);
  while (soap->clist)
  { struct soap_clist *p = soap->clist->next;
    SOAP_FREE(soap, soap->clist);
    soap->clist = p;
  }
  if (soap->state == SOAP_INIT)
    soap->omode &= ~SOAP_IO_UDP; /* to force close the socket */
  soap->keep_alive = 0; /* to force close the socket */
  soap_closesock(soap);
#ifdef WITH_COOKIES
  soap_free_cookies(soap);
#endif
  while (soap->plugins)
  { register struct soap_plugin *p = soap->plugins->next;
    DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Removing plugin '%s'\n", soap->plugins->id));
    if (soap->plugins->fcopy || soap->state == SOAP_INIT)
      soap->plugins->fdelete(soap, soap->plugins);
    SOAP_FREE(soap, soap->plugins);
    soap->plugins = p;
  }
  soap->fplugin = fplugin;
  soap->fmalloc = NULL;
#ifndef WITH_NOHTTP
  soap->fpost = http_post;
  soap->fput = http_put;
  soap->fget = http_get;
  soap->fdel = http_405;
  soap->fopt = http_405;
  soap->fhead = http_405;
  soap->fform = NULL;
  soap->fposthdr = http_post_header;
  soap->fresponse = http_response;
  soap->fparse = http_parse;
  soap->fparsehdr = http_parse_header;
#endif
  soap->fheader = NULL;
#ifndef WITH_NOIO
#ifndef WITH_IPV6
  soap->fresolve = tcp_gethost;
#else
  soap->fresolve = NULL;
#endif
  soap->faccept = tcp_accept;
  soap->fopen = tcp_connect;
  soap->fclose = tcp_disconnect;
  soap->fclosesocket = tcp_closesocket;
  soap->fshutdownsocket = tcp_shutdownsocket;
  soap->fsend = fsend;
  soap->frecv = frecv;
  soap->fpoll = soap_poll;
#else
  soap->fopen = NULL;
  soap->fclose = NULL;
  soap->fpoll = NULL;
#endif
#ifndef WITH_LEANER
  soap->feltbegin = NULL;
  soap->feltendin = NULL;
  soap->feltbegout = NULL;
  soap->feltendout = NULL;
  soap->fprepareinitsend = NULL;
  soap->fprepareinitrecv = NULL;
  soap->fpreparesend = NULL;
  soap->fpreparerecv = NULL;
  soap->fpreparefinalsend = NULL;
  soap->fpreparefinalrecv = NULL;
  soap->ffiltersend = NULL;
  soap->ffilterrecv = NULL;
#endif
  soap->fseterror = NULL;
  soap->fignore = NULL;
  soap->fserveloop = NULL;
#ifdef WITH_OPENSSL
  if (soap->session)
  { SSL_SESSION_free(soap->session);
    soap->session = NULL;
  }
#endif
  if (soap->state == SOAP_INIT)
  { if (soap_valid_socket(soap->master))
    { soap->fclosesocket(soap, soap->master);
      soap->master = SOAP_INVALID_SOCKET;
    }
  }
#ifdef WITH_OPENSSL
  if (soap->ssl)
  { SSL_free(soap->ssl);
    soap->ssl = NULL;
  }
  if (soap->state == SOAP_INIT)
  { if (soap->ctx)
    { SSL_CTX_free(soap->ctx);
      soap->ctx = NULL;
    }
  }
  ERR_remove_state(0);
#endif
#ifdef WITH_GNUTLS
  if (soap->state == SOAP_INIT)
  { if (soap->xcred)
    { gnutls_certificate_free_credentials(soap->xcred);
      soap->xcred = NULL;
    }
    if (soap->acred)
    { gnutls_anon_free_client_credentials(soap->acred);
      soap->acred = NULL;
    }
    if (soap->cache)
    { gnutls_priority_deinit(soap->cache);
      soap->cache = NULL;
    }
    if (soap->dh_params)
    { gnutls_dh_params_deinit(soap->dh_params);
      soap->dh_params = NULL;
    }
    if (soap->rsa_params)
    { gnutls_rsa_params_deinit(soap->rsa_params);
      soap->rsa_params = NULL;
    }
  }
  if (soap->session)
  { gnutls_deinit(soap->session);
    soap->session = NULL;
  }
#endif
#ifdef WITH_C_LOCALE
  freelocale(soap->c_locale);
#endif
#ifdef WITH_ZLIB
  if (soap->d_stream)
  { SOAP_FREE(soap, (void*)soap->d_stream);
    soap->d_stream = NULL;
  }
  if (soap->z_buf)
  { SOAP_FREE(soap, (void*)soap->z_buf);
    soap->z_buf = NULL;
  }
#endif
#ifdef SOAP_DEBUG
  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Free logfiles\n"));
  for (i = 0; i < SOAP_MAXLOGS; i++)
  { if (soap->logfile[i])
    { SOAP_FREE(soap, (void*)soap->logfile[i]);
      soap->logfile[i] = NULL;
    }
    soap_close_logfile(soap, i);
  }
  soap->state = SOAP_NONE;
#endif
#ifdef SOAP_MEM_DEBUG
  soap_free_mht(soap);
#endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x1edab
movq -0x8(%rbp), %rax
movswl (%rax), %eax
cmpl $0x1, %eax
je 0x1edb0
movq -0x8(%rbp), %rax
movswl (%rax), %eax
cmpl $0x2, %eax
je 0x1edb0
jmp 0x1f162
movq -0x8(%rbp), %rdi
callq 0x1f170
movq -0x8(%rbp), %rax
cmpq $0x0, 0x98(%rax)
je 0x1edfa
movq -0x8(%rbp), %rax
movq 0x98(%rax), %rax
movq (%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x98(%rax), %rdi
callq 0x3030
movq -0x10(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x98(%rax)
jmp 0x1edb9
movq -0x8(%rbp), %rax
movswl (%rax), %eax
cmpl $0x1, %eax
jne 0x1ee13
movq -0x8(%rbp), %rax
movl 0xc(%rax), %ecx
andl $-0x5, %ecx
movl %ecx, 0xc(%rax)
movq -0x8(%rbp), %rax
movw $0x0, 0x1f22c(%rax)
movq -0x8(%rbp), %rdi
callq 0x1de40
movq -0x8(%rbp), %rax
cmpq $0x0, 0xbf70(%rax)
je 0x1eea8
movq -0x8(%rbp), %rax
movq 0xbf70(%rax), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0xbf70(%rax), %rax
cmpq $0x0, 0x18(%rax)
jne 0x1ee67
movq -0x8(%rbp), %rax
movswl (%rax), %eax
cmpl $0x1, %eax
jne 0x1ee87
movq -0x8(%rbp), %rax
movq 0xbf70(%rax), %rax
movq 0x20(%rax), %rax
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rcx
movq 0xbf70(%rcx), %rsi
callq *%rax
movq -0x8(%rbp), %rax
movq 0xbf70(%rax), %rdi
callq 0x3030
movq -0x18(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0xbf70(%rax)
jmp 0x1ee29
movq -0x8(%rbp), %rax
leaq 0x4ad(%rip), %rcx       # 0x1f360
movq %rcx, 0xc058(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0xc060(%rax)
movq -0x8(%rbp), %rax
leaq 0x50c(%rip), %rcx       # 0x1f3e0
movq %rcx, 0xbf88(%rax)
movq -0x8(%rbp), %rax
leaq 0xb0a(%rip), %rcx       # 0x1f9f0
movq %rcx, 0xbf98(%rax)
movq -0x8(%rbp), %rax
leaq 0xb18(%rip), %rcx       # 0x1fa10
movq %rcx, 0xbf90(%rax)
movq -0x8(%rbp), %rax
leaq 0xb16(%rip), %rcx       # 0x1fa20
movq %rcx, 0xbfa0(%rax)
movq -0x8(%rbp), %rax
leaq 0xb04(%rip), %rcx       # 0x1fa20
movq %rcx, 0xbfa8(%rax)
movq -0x8(%rbp), %rax
leaq 0xaf2(%rip), %rcx       # 0x1fa20
movq %rcx, 0xbfb0(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0xbfb8(%rax)
movq -0x8(%rbp), %rax
leaq 0xae1(%rip), %rcx       # 0x1fa30
movq %rcx, 0xbfc0(%rax)
movq -0x8(%rbp), %rax
leaq 0xb7f(%rip), %rcx       # 0x1fae0
movq %rcx, 0xbfc8(%rax)
movq -0x8(%rbp), %rax
leaq 0xfbd(%rip), %rcx       # 0x1ff30
movq %rcx, 0xbfd0(%rax)
movq -0x8(%rbp), %rax
leaq 0x195b(%rip), %rcx      # 0x208e0
movq %rcx, 0xbfd8(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0xbfe0(%rax)
movq -0x8(%rbp), %rax
leaq 0x1f8a(%rip), %rcx      # 0x20f30
movq %rcx, 0xbfe8(%rax)
movq -0x8(%rbp), %rax
leaq 0x2038(%rip), %rcx      # 0x20ff0
movq %rcx, 0xc018(%rax)
movq -0x8(%rbp), %rax
leaq 0x2066(%rip), %rcx      # 0x21030
movq %rcx, 0xc010(%rax)
movq -0x8(%rbp), %rax
leaq 0x2dd4(%rip), %rcx      # 0x21db0
movq %rcx, 0xc020(%rax)
movq -0x8(%rbp), %rax
leaq 0x2e42(%rip), %rcx      # 0x21e30
movq %rcx, 0xc000(%rax)
movq -0x8(%rbp), %rax
leaq 0x2e50(%rip), %rcx      # 0x21e50
movq %rcx, 0xc008(%rax)
movq -0x8(%rbp), %rax
leaq 0x2e6e(%rip), %rcx      # 0x21e80
movq %rcx, 0xc028(%rax)
movq -0x8(%rbp), %rax
leaq 0x325c(%rip), %rcx      # 0x22280
movq %rcx, 0xc030(%rax)
movq -0x8(%rbp), %rax
leaq -0x10d6(%rip), %rcx     # 0x1df60
movq %rcx, 0xc038(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0xc068(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0xc070(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0xc078(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0xc080(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0xc088(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0xc090(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0xc098(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0xc0a0(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0xc0a8(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0xc0b0(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0xc0c0(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0xc0c8(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0xc040(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0xc048(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0xc050(%rax)
movq -0x8(%rbp), %rax
movswl (%rax), %eax
cmpl $0x1, %eax
jne 0x1f162
movq -0x8(%rbp), %rax
cmpl $-0x1, 0xc130(%rax)
je 0x1f160
movq -0x8(%rbp), %rax
movq 0xc000(%rax), %rax
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rcx
movl 0xc130(%rcx), %esi
callq *%rax
movq -0x8(%rbp), %rax
movl $0xffffffff, 0xc130(%rax) # imm = 0xFFFFFFFF
jmp 0x1f162
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)