docs: def rar3_decompress(vers, meth, data, declen=0, flags=0, crc=0, psw=None, salt=None):
      """Decompress blob of compressed data.
  
      Used for data with non-standard header - eg. comments.
      """
      # already uncompressed?
      if meth == RAR_M0 and (flags & RAR_FILE_PASSWORD) == 0:
          return data
  
      # take only necessary flags
      flags = flags & (RAR_FILE_PASSWORD | RAR_FILE_SALT | RAR_FILE_DICTMASK)
      flags |= RAR_LONG_BLOCK
  
      # file header
      fname = b'data'
      date = 0
      mode = 0x20
      fhdr = S_FILE_HDR.pack(len(data), declen, RAR_OS_MSDOS, crc,
                             date, vers, meth, len(fname), mode)
      fhdr += fname
      if flags & RAR_FILE_SALT:
          if not salt:
              return EMPTY
          fhdr += salt
  
      # full header
      hlen = S_BLK_HDR.size + len(fhdr)
      hdr = S_BLK_HDR.pack(0, RAR_BLOCK_FILE, flags, hlen) + fhdr
      hcrc = rar_crc32(hdr[2:]) & 0xFFFF
      hdr = S_BLK_HDR.pack(hcrc, RAR_BLOCK_FILE, flags, hlen) + fhdr
  
      # archive main header
      mh = S_BLK_HDR.pack(0x90CF, RAR_BLOCK_MAIN, 0, 13) + ZERO * (2 + 4)
  
      # decompress via temp rar
      tmpfd, tmpname = mkstemp(suffix='.rar')
      tmpf = os.fdopen(tmpfd, "wb")
      try:
          tmpf.write(RAR_ID + mh + hdr + data)
          tmpf.close()
  
          cmd = [UNRAR_TOOL] + list(OPEN_ARGS)
          add_password_arg(cmd, psw, (flags & RAR_FILE_PASSWORD))
          cmd.append(tmpname)
  
          p = custom_popen(cmd)
          return p.communicate()[0]
      finally:
          tmpf.close()
          os.unlink(tmpname)