// File: /workspace/github_c_makefile_star2_O0/loversmile[P]sugarcrm/sugar_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->fget = http_get;
  soap->fput = http_405;
  soap->fdel = 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->fprepareinitsend = NULL;
  soap->fprepareinitrecv = NULL;
  soap->fpreparesend = NULL;
  soap->fpreparerecv = NULL;
  soap->fpreparefinalsend = NULL;
  soap->fpreparefinalrecv = 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;
    }
  }
#endif
#ifdef WITH_OPENSSL
  ERR_remove_state(0);
#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 0x557ab
movq -0x8(%rbp), %rax
movswl (%rax), %eax
cmpl $0x1, %eax
je 0x557b0
movq -0x8(%rbp), %rax
movswl (%rax), %eax
cmpl $0x2, %eax
je 0x557b0
jmp 0x55af6
movq -0x8(%rbp), %rdi
callq 0x55b00
movq -0x8(%rbp), %rax
cmpq $0x0, 0x98(%rax)
je 0x557fa
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 0x557b9
movq -0x8(%rbp), %rax
movswl (%rax), %eax
cmpl $0x1, %eax
jne 0x55813
movq -0x8(%rbp), %rax
movl 0xc(%rax), %ecx
andl $-0x5, %ecx
movl %ecx, 0xc(%rax)
movq -0x8(%rbp), %rax
movw $0x0, 0x191cc(%rax)
movq -0x8(%rbp), %rdi
callq 0x55cf0
movq -0x8(%rbp), %rax
cmpq $0x0, 0x5f50(%rax)
je 0x558a8
movq -0x8(%rbp), %rax
movq 0x5f50(%rax), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x5f50(%rax), %rax
cmpq $0x0, 0x18(%rax)
jne 0x55867
movq -0x8(%rbp), %rax
movswl (%rax), %eax
cmpl $0x1, %eax
jne 0x55887
movq -0x8(%rbp), %rax
movq 0x5f50(%rax), %rax
movq 0x20(%rax), %rax
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rcx
movq 0x5f50(%rcx), %rsi
callq *%rax
movq -0x8(%rbp), %rax
movq 0x5f50(%rax), %rdi
callq 0x3030
movq -0x18(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x5f50(%rax)
jmp 0x55829
movq -0x8(%rbp), %rax
leaq 0x4dd(%rip), %rcx       # 0x55d90
movq %rcx, 0x6030(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x6038(%rax)
movq -0x8(%rbp), %rax
leaq 0x53c(%rip), %rcx       # 0x55e10
movq %rcx, 0x5f68(%rax)
movq -0x8(%rbp), %rax
leaq 0xb3a(%rip), %rcx       # 0x56420
movq %rcx, 0x5f70(%rax)
movq -0x8(%rbp), %rax
leaq 0xb38(%rip), %rcx       # 0x56430
movq %rcx, 0x5f78(%rax)
movq -0x8(%rbp), %rax
leaq 0xb26(%rip), %rcx       # 0x56430
movq %rcx, 0x5f80(%rax)
movq -0x8(%rbp), %rax
leaq 0xb14(%rip), %rcx       # 0x56430
movq %rcx, 0x5f88(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x5f90(%rax)
movq -0x8(%rbp), %rax
leaq 0xb03(%rip), %rcx       # 0x56440
movq %rcx, 0x5f98(%rax)
movq -0x8(%rbp), %rax
leaq 0xba1(%rip), %rcx       # 0x564f0
movq %rcx, 0x5fa0(%rax)
movq -0x8(%rbp), %rax
leaq 0xfdf(%rip), %rcx       # 0x56940
movq %rcx, 0x5fa8(%rax)
movq -0x8(%rbp), %rax
leaq 0x190d(%rip), %rcx      # 0x57280
movq %rcx, 0x5fb0(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x5fb8(%rax)
movq -0x8(%rbp), %rax
leaq 0x1f3c(%rip), %rcx      # 0x578d0
movq %rcx, 0x5fc0(%rax)
movq -0x8(%rbp), %rax
leaq 0x1fea(%rip), %rcx      # 0x57990
movq %rcx, 0x5ff0(%rax)
movq -0x8(%rbp), %rax
leaq 0x2018(%rip), %rcx      # 0x579d0
movq %rcx, 0x5fe8(%rax)
movq -0x8(%rbp), %rax
leaq 0x2d66(%rip), %rcx      # 0x58730
movq %rcx, 0x5ff8(%rax)
movq -0x8(%rbp), %rax
leaq 0x2dd4(%rip), %rcx      # 0x587b0
movq %rcx, 0x5fd8(%rax)
movq -0x8(%rbp), %rax
leaq 0x2de2(%rip), %rcx      # 0x587d0
movq %rcx, 0x5fe0(%rax)
movq -0x8(%rbp), %rax
leaq 0x2e00(%rip), %rcx      # 0x58800
movq %rcx, 0x6000(%rax)
movq -0x8(%rbp), %rax
leaq 0x31ee(%rip), %rcx      # 0x58c00
movq %rcx, 0x6008(%rax)
movq -0x8(%rbp), %rax
leaq 0x349c(%rip), %rcx      # 0x58ec0
movq %rcx, 0x6010(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x6040(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x6048(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x6050(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x6058(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x6060(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x6068(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x6018(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x6020(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x6028(%rax)
movq -0x8(%rbp), %rax
movswl (%rax), %eax
cmpl $0x1, %eax
jne 0x55af6
movq -0x8(%rbp), %rax
cmpl $-0x1, 0x60d0(%rax)
je 0x55af4
movq -0x8(%rbp), %rax
movq 0x5fd8(%rax), %rax
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rcx
movl 0x60d0(%rcx), %esi
callq *%rax
movq -0x8(%rbp), %rax
movl $0xffffffff, 0x60d0(%rax) # imm = 0xFFFFFFFF
jmp 0x55af6
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)