// File: /workspace/github_c_makefile_star2_O0/hkshenSmart[P]ONVIF-discovery_cs/stdsoap2.c
// Function: soap_end_recv
SOAP_FMAC2
soap_end_recv(struct soap *soap)
{ soap->part = SOAP_END;
#ifndef WITH_LEAN
  soap->wsuid = NULL;		/* reset before next send */
  soap->c14nexclude = NULL;	/* reset before next send */
#endif
#ifndef WITH_LEANER
  soap->ffilterrecv = NULL;
  if ((soap->mode & SOAP_ENC_DIME) && soap_getdime(soap))
  { soap->dime.first = NULL;
    soap->dime.last = NULL;
    return soap->error;
  }
  soap->dime.list = soap->dime.first;
  soap->dime.first = NULL;
  soap->dime.last = NULL;
  /* Check if MIME attachments and mime-post-check flag is set, if so call soap_resolve() and return */
  if (soap->mode & SOAP_ENC_MIME)
  { if (soap->mode & SOAP_MIME_POSTCHECK)
    { DBGLOG(TEST,SOAP_MESSAGE(fdebug, "Post checking MIME attachments\n"));
      if (!soap->keep_alive)
        soap->keep_alive = -1;
#ifndef WITH_NOIDREF
      soap_resolve(soap);
#endif
      return SOAP_OK;
    }
    if (soap_getmime(soap))
      return soap->error;
  }
  soap->mime.list = soap->mime.first;
  soap->mime.first = NULL;
  soap->mime.last = NULL;
  soap->mime.boundary = NULL;
  if (soap->xlist)
  { struct soap_multipart *content;
    for (content = soap->mime.list; content; content = content->next)
      soap_resolve_attachment(soap, content);
  }
#endif
  DBGLOG(TEST,SOAP_MESSAGE(fdebug, "End of receive message ok\n"));
#ifdef WITH_ZLIB
  if (soap->mode & SOAP_ENC_ZLIB)
  { /* Make sure end of compressed content is reached */
    while (soap->d_stream->next_out != Z_NULL)
      if ((int)soap_get1(soap) == EOF)
        break;
    soap->mode &= ~SOAP_ENC_ZLIB;
    memcpy(soap->buf, soap->z_buf, SOAP_BUFLEN);
    soap->bufidx = (char*)soap->d_stream->next_in - soap->z_buf;
    soap->buflen = soap->z_buflen;
    soap->zlib_state = SOAP_ZLIB_NONE;
    if (inflateEnd(soap->d_stream) != Z_OK)
      return soap->error = SOAP_ZLIB_ERROR;
    DBGLOG(TEST,SOAP_MESSAGE(fdebug, "Inflate end ok\n"));
#ifdef WITH_GZIP
    if (soap->zlib_in == SOAP_ZLIB_GZIP)
    { soap_wchar c;
      short i;
      DBGLOG(TEST,SOAP_MESSAGE(fdebug, "Inflate gzip crc check\n"));
      for (i = 0; i < 8; i++)
      { if ((int)(c = soap_get1(soap)) == EOF)
        { DBGLOG(TEST,SOAP_MESSAGE(fdebug, "Gzip error: unable to read crc value\n"));
          return soap->error = SOAP_EOF;
        }
        soap->z_buf[i] = (char)c;
      }
      if (soap->z_crc != ((uLong)(unsigned char)soap->z_buf[0] | ((uLong)(unsigned char)soap->z_buf[1] << 8) | ((uLong)(unsigned char)soap->z_buf[2] << 16) | ((uLong)(unsigned char)soap->z_buf[3] << 24)))
      { DBGLOG(TEST,SOAP_MESSAGE(fdebug, "Gzip inflate error: crc check failed, message corrupted? (crc32=%lu)\n", (unsigned long)soap->z_crc));
        return soap->error = SOAP_ZLIB_ERROR;
      }
      if (soap->d_stream->total_out != ((uLong)(unsigned char)soap->z_buf[4] | ((uLong)(unsigned char)soap->z_buf[5] << 8) | ((uLong)(unsigned char)soap->z_buf[6] << 16) | ((uLong)(unsigned char)soap->z_buf[7] << 24)))
      { DBGLOG(TEST,SOAP_MESSAGE(fdebug, "Gzip inflate error: incorrect message length\n"));
        return soap->error = SOAP_ZLIB_ERROR;
      }
    }
    soap->zlib_in = SOAP_ZLIB_NONE;
#endif
  }
#endif
  if ((soap->mode & SOAP_IO) == SOAP_IO_CHUNK)
    while (soap->ahead != EOF && !soap_recv_raw(soap))
      ;
#ifndef WITH_NOIDREF
  if (soap_resolve(soap))
    return soap->error;
#endif
#ifndef WITH_LEANER
  if (soap->xlist)
  { if (soap->mode & SOAP_ENC_MTOM)
      return soap->error = SOAP_MIME_HREF;
    return soap->error = SOAP_DIME_HREF;
  }
#endif
  soap_free_ns(soap);
#ifndef WITH_LEANER
  if (soap->fpreparefinalrecv)
    return soap->error = soap->fpreparefinalrecv(soap);
#endif
  return SOAP_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movw $0x9, 0x1e5f0(%rax)
movq -0x10(%rbp), %rax
movq $0x0, 0x27348(%rax)
movq -0x10(%rbp), %rax
movq $0x0, 0x27350(%rax)
movq -0x10(%rbp), %rax
movq $0x0, 0xc0c8(%rax)
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x80, %eax
cmpl $0x0, %eax
je 0x262c5
movq -0x10(%rbp), %rdi
callq 0x264f0
cmpl $0x0, %eax
je 0x262c5
movq -0x10(%rbp), %rax
movq $0x0, 0x1f2d8(%rax)
movq -0x10(%rbp), %rax
movq $0x0, 0x1f2e0(%rax)
movq -0x10(%rbp), %rax
movl 0x1f274(%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x264df
movq -0x10(%rbp), %rax
movq 0x1f2d8(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x1f2d0(%rax)
movq -0x10(%rbp), %rax
movq $0x0, 0x1f2d8(%rax)
movq -0x10(%rbp), %rax
movq $0x0, 0x1f2e0(%rax)
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x100, %eax            # imm = 0x100
cmpl $0x0, %eax
je 0x2636d
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x10000000, %eax       # imm = 0x10000000
cmpl $0x0, %eax
je 0x2634b
movq -0x10(%rbp), %rax
cmpw $0x0, 0x1f22c(%rax)
jne 0x26336
movq -0x10(%rbp), %rax
movw $0xffff, 0x1f22c(%rax)  # imm = 0xFFFF
movq -0x10(%rbp), %rdi
callq 0x1ba80
movl $0x0, -0x4(%rbp)
jmp 0x264df
movq -0x10(%rbp), %rdi
callq 0x26bd0
cmpl $0x0, %eax
je 0x2636b
movq -0x10(%rbp), %rax
movl 0x1f274(%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x264df
jmp 0x2636d
movq -0x10(%rbp), %rax
movq 0x1f300(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x1f2f8(%rax)
movq -0x10(%rbp), %rax
movq $0x0, 0x1f300(%rax)
movq -0x10(%rbp), %rax
movq $0x0, 0x1f308(%rax)
movq -0x10(%rbp), %rax
movq $0x0, 0x1f2e8(%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x1f310(%rax)
je 0x263f0
movq -0x10(%rbp), %rax
movq 0x1f2f8(%rax), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x263ee
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x26c10
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0x263cd
jmp 0x263f0
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x3, %eax
cmpl $0x3, %eax
jne 0x26434
jmp 0x26401
movq -0x10(%rbp), %rcx
xorl %eax, %eax
cmpl $-0x1, 0xc160(%rcx)
movb %al, -0x19(%rbp)
je 0x26427
movq -0x10(%rbp), %rdi
callq 0x171c0
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
movb %al, -0x19(%rbp)
movb -0x19(%rbp), %al
testb $0x1, %al
jne 0x26430
jmp 0x26432
jmp 0x26401
jmp 0x26434
movq -0x10(%rbp), %rdi
callq 0x1ba80
cmpl $0x0, %eax
je 0x26454
movq -0x10(%rbp), %rax
movl 0x1f274(%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x264df
movq -0x10(%rbp), %rax
cmpq $0x0, 0x1f310(%rax)
je 0x264a1
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x200, %eax            # imm = 0x200
cmpl $0x0, %eax
je 0x2648a
movq -0x10(%rbp), %rax
movl $0x25, 0x1f274(%rax)
movl $0x25, -0x4(%rbp)
jmp 0x264df
movq -0x10(%rbp), %rax
movl $0x21, 0x1f274(%rax)
movl $0x21, -0x4(%rbp)
jmp 0x264df
movq -0x10(%rbp), %rdi
callq 0x239b0
movq -0x10(%rbp), %rax
cmpq $0x0, 0xc0b0(%rax)
je 0x264d8
movq -0x10(%rbp), %rax
movq 0xc0b0(%rax), %rax
movq -0x10(%rbp), %rdi
callq *%rax
movq -0x10(%rbp), %rcx
movl %eax, 0x1f274(%rcx)
movl %eax, -0x4(%rbp)
jmp 0x264df
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)